@alook/app 0.0.5 → 0.0.7

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.
Files changed (61) hide show
  1. package/bundled/web/.open-next/.build/durable-objects/queue.js +4 -4
  2. package/bundled/web/.open-next/assets/BUILD_ID +1 -1
  3. package/bundled/web/.open-next/assets/_next/static/chunks/0-ak0pl36y6db.js +20 -0
  4. package/bundled/web/.open-next/assets/_next/static/chunks/{12oay61-cq.qw.js → 03ttku7i148lq.js} +1 -1
  5. package/bundled/web/.open-next/assets/_next/static/chunks/0iq-wdylmm182.js +1 -0
  6. package/bundled/web/.open-next/assets/_next/static/chunks/0~d77nakvw-pm.js +1 -0
  7. package/bundled/web/.open-next/assets/_next/static/chunks/{0xzbhdkkpaanc.js → 13en7fv.b2pc1.js} +1 -1
  8. package/bundled/web/.open-next/cache/{jsS4n9BW-F-LPiDHcvvEr → V1c6eLDYgmPMijvNSPLv0}/_global-error.cache +1 -1
  9. package/bundled/web/.open-next/cache/{jsS4n9BW-F-LPiDHcvvEr → V1c6eLDYgmPMijvNSPLv0}/_not-found.cache +1 -1
  10. package/bundled/web/.open-next/cache/{jsS4n9BW-F-LPiDHcvvEr → V1c6eLDYgmPMijvNSPLv0}/sitemap.xml.cache +1 -1
  11. package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
  12. package/bundled/web/.open-next/cloudflare/init.js +1 -1
  13. package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
  14. package/bundled/web/.open-next/middleware/handler.mjs +2 -2
  15. package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
  16. package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
  17. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
  18. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/new/page_client-reference-manifest.js +1 -1
  19. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/activity/page_client-reference-manifest.js +1 -1
  20. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page_client-reference-manifest.js +1 -1
  21. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
  22. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/email/page_client-reference-manifest.js +1 -1
  23. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/files/page_client-reference-manifest.js +1 -1
  24. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/meetings/page_client-reference-manifest.js +1 -1
  25. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/page_client-reference-manifest.js +1 -1
  26. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/new/page_client-reference-manifest.js +1 -1
  27. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
  28. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
  29. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/help/email-setup/page_client-reference-manifest.js +1 -1
  30. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
  31. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
  32. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
  33. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
  34. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/[traceId]/page_client-reference-manifest.js +1 -1
  35. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/page_client-reference-manifest.js +1 -1
  36. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
  37. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/workspaces/page_client-reference-manifest.js +1 -1
  38. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
  39. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  40. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page_client-reference-manifest.js +1 -1
  41. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
  42. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
  43. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0o6ydx5._.js +1 -1
  44. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0vhi1.k._.js +1 -1
  45. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0y.08ek._.js +1 -1
  46. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0yeokgf._.js +1 -1
  47. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(auth)_sign-in_page_tsx_0jdlb-h._.js +1 -1
  48. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
  49. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +1 -1
  50. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +8 -8
  51. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +76 -76
  52. package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +2 -2
  53. package/dist/index.js +39 -2
  54. package/package.json +1 -1
  55. package/bundled/web/.open-next/assets/_next/static/chunks/06ksvdw1qrvwk.js +0 -1
  56. package/bundled/web/.open-next/assets/_next/static/chunks/0lo_c9qps6nzn.js +0 -20
  57. package/bundled/web/.open-next/assets/_next/static/chunks/0p7q1v_ivmnag.js +0 -1
  58. /package/bundled/web/.open-next/assets/_next/static/{jsS4n9BW-F-LPiDHcvvEr → V1c6eLDYgmPMijvNSPLv0}/_buildManifest.js +0 -0
  59. /package/bundled/web/.open-next/assets/_next/static/{jsS4n9BW-F-LPiDHcvvEr → V1c6eLDYgmPMijvNSPLv0}/_clientMiddlewareManifest.js +0 -0
  60. /package/bundled/web/.open-next/assets/_next/static/{jsS4n9BW-F-LPiDHcvvEr → V1c6eLDYgmPMijvNSPLv0}/_ssgManifest.js +0 -0
  61. /package/bundled/web/.open-next/cache/{jsS4n9BW-F-LPiDHcvvEr → V1c6eLDYgmPMijvNSPLv0}/robots.txt.cache +0 -0
@@ -180,7 +180,7 @@ var DOQueueHandler = class extends DurableObject {
180
180
  "INSERT OR REPLACE INTO sync (id, lastSuccess, buildId) VALUES (?, unixepoch(), ?)",
181
181
  // We cannot use the deduplication id because it's not unique per route - every time a route is revalidated, the deduplication id is different.
182
182
  `${host}${url}`,
183
- "jsS4n9BW-F-LPiDHcvvEr"
183
+ "V1c6eLDYgmPMijvNSPLv0"
184
184
  );
185
185
  }
186
186
  this.routeInFailedState.delete(msg.MessageDeduplicationId);
@@ -232,7 +232,7 @@ var DOQueueHandler = class extends DurableObject {
232
232
  }
233
233
  this.routeInFailedState.set(msg.MessageDeduplicationId, updatedFailedState);
234
234
  if (!this.disableSQLite) {
235
- this.sql.exec("INSERT OR REPLACE INTO failed_state (id, data, buildId) VALUES (?, ?, ?)", msg.MessageDeduplicationId, JSON.stringify(updatedFailedState), "jsS4n9BW-F-LPiDHcvvEr");
235
+ this.sql.exec("INSERT OR REPLACE INTO failed_state (id, data, buildId) VALUES (?, ?, ?)", msg.MessageDeduplicationId, JSON.stringify(updatedFailedState), "V1c6eLDYgmPMijvNSPLv0");
236
236
  }
237
237
  await this.addAlarm();
238
238
  }
@@ -256,8 +256,8 @@ var DOQueueHandler = class extends DurableObject {
256
256
  return;
257
257
  this.sql.exec("CREATE TABLE IF NOT EXISTS failed_state (id TEXT PRIMARY KEY, data TEXT, buildId TEXT)");
258
258
  this.sql.exec("CREATE TABLE IF NOT EXISTS sync (id TEXT PRIMARY KEY, lastSuccess INTEGER, buildId TEXT)");
259
- this.sql.exec("DELETE FROM failed_state WHERE buildId != ?", "jsS4n9BW-F-LPiDHcvvEr");
260
- this.sql.exec("DELETE FROM sync WHERE buildId != ?", "jsS4n9BW-F-LPiDHcvvEr");
259
+ this.sql.exec("DELETE FROM failed_state WHERE buildId != ?", "V1c6eLDYgmPMijvNSPLv0");
260
+ this.sql.exec("DELETE FROM sync WHERE buildId != ?", "V1c6eLDYgmPMijvNSPLv0");
261
261
  const failedStateCursor = this.sql.exec("SELECT * FROM failed_state");
262
262
  for (const row of failedStateCursor) {
263
263
  this.routeInFailedState.set(row.id, JSON.parse(row.data));
@@ -1 +1 @@
1
- jsS4n9BW-F-LPiDHcvvEr
1
+ V1c6eLDYgmPMijvNSPLv0
@@ -0,0 +1,20 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,855062,e=>{"use strict";var t=e.i(298699);e.s(["useLocalStorage",0,function(e,a){let[n,r]=(0,t.useState)(a);return(0,t.useLayoutEffect)(()=>{try{let t=localStorage.getItem(e);t&&r(JSON.parse(t))}catch{}},[e]),[n,(0,t.useCallback)(t=>{r(a=>{let n=t instanceof Function?t(a):t;try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])]}])},957563,e=>{"use strict";var t=e.i(298699),a=e.i(597849);let n=t.forwardRef(function(e,t){let{className:n,render:r,orientation:l="horizontal",style:i,...o}=e;return(0,a.useRenderElement)("div",e,{state:{orientation:l},ref:t,props:[{role:"separator","aria-orientation":l},o]})});e.s(["Separator",0,n])},934351,e=>{"use strict";var t=e.i(368075),a=e.i(613349);e.s(["Card",0,function({className:e,size:n="default",...r}){return(0,t.jsx)("div",{"data-slot":"card","data-size":n,className:(0,a.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...r})},"CardAction",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-action",className:(0,a.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...n})},"CardContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-4 group-data-[size=sm]/card:px-3",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...n})}])},473131,e=>{"use strict";var t=e.i(368075),a=e.i(613349);e.s(["Label",0,function({className:e,...n}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,a.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}])},898707,e=>{"use strict";var t=e.i(368075);e.s(["GradientBackground",0,function(){return(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0 -z-10 overflow-hidden bg-[oklch(0.93_0.015_80)] dark:bg-transparent"})}])},860115,e=>{"use strict";let t=(0,e.i(706875).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",0,t])},45356,e=>{"use strict";var t=e.i(368075),a=e.i(298699),n=e.i(208020),r=e.i(23055),l=e.i(186339),i=e.i(934351),o=e.i(903477),s=Object.defineProperty,c=Object.defineProperties,d=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,f=(e,t,a)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,h=a.createContext({}),g=a.forwardRef((e,t)=>{let n;var r,l,i,o,s,{value:g,onChange:b,maxLength:w,textAlign:j="left",pattern:y,placeholder:S,inputMode:C="numeric",onComplete:k,pushPasswordManagerStrategy:E="increase-width",pasteTransformer:N,containerClassName:P,noScriptCSSFallback:M=x,render:R,children:T}=e,B=((e,t)=>{var a={};for(var n in e)p.call(e,n)&&0>t.indexOf(n)&&(a[n]=e[n]);if(null!=e&&u)for(var n of u(e))0>t.indexOf(n)&&m.call(e,n)&&(a[n]=e[n]);return a})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[O,D]=a.useState("string"==typeof B.defaultValue?B.defaultValue:""),F=null!=g?g:O,I=(n=a.useRef(),a.useEffect(()=>{n.current=F}),n.current),A=a.useCallback(e=>{null==b||b(e),D(e)},[b]),z=a.useMemo(()=>y?"string"==typeof y?new RegExp(y):y:null,[y]),W=a.useRef(null),L=a.useRef(null),_=a.useRef({value:F,onChange:A,isIOS:"u">typeof window&&(null==(l=null==(r=null==window?void 0:window.CSS)?void 0:r.supports)?void 0:l.call(r,"-webkit-touch-callout","none"))}),H=a.useRef({prev:[null==(i=W.current)?void 0:i.selectionStart,null==(o=W.current)?void 0:o.selectionEnd,null==(s=W.current)?void 0:s.selectionDirection]});a.useImperativeHandle(t,()=>W.current,[]),a.useEffect(()=>{let e=W.current,t=L.current;if(!e||!t)return;function a(){if(document.activeElement!==e){J(null),X(null);return}let t=e.selectionStart,a=e.selectionEnd,n=e.selectionDirection,r=e.maxLength,l=e.value,i=H.current.prev,o=-1,s=-1,c;if(0!==l.length&&null!==t&&null!==a){let e=t===a,n=t===l.length&&l.length<r;if(e&&!n){if(0===t)o=0,s=1,c="forward";else if(t===r)o=t-1,s=t,c="backward";else if(r>1&&l.length>1){let e=0;if(null!==i[0]&&null!==i[1]){c=t<i[1]?"backward":"forward";let a=i[0]===i[1]&&i[0]<r;"backward"!==c||a||(e=-1)}o=e+t,s=e+t+1}}-1!==o&&-1!==s&&o!==s&&W.current.setSelectionRange(o,s,c)}let d=-1!==o?o:t,u=-1!==s?s:a,p=null!=c?c:n;J(d),X(u),H.current.prev=[d,u,p]}if(_.current.value!==e.value&&_.current.onChange(e.value),H.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",a,{capture:!0}),a(),document.activeElement===e&&$(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";v(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),v(e.sheet,`[data-input-otp]:autofill { ${t} }`),v(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),v(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),v(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let n=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};n();let r=new ResizeObserver(n);return r.observe(e),()=>{document.removeEventListener("selectionchange",a,{capture:!0}),r.disconnect()}},[]);let[G,U]=a.useState(!1),[V,$]=a.useState(!1),[q,J]=a.useState(null),[K,X]=a.useState(null);a.useEffect(()=>{var e;setTimeout(e=()=>{var e,t,a,n;null==(e=W.current)||e.dispatchEvent(new Event("input"));let r=null==(t=W.current)?void 0:t.selectionStart,l=null==(a=W.current)?void 0:a.selectionEnd,i=null==(n=W.current)?void 0:n.selectionDirection;null!==r&&null!==l&&(J(r),X(l),H.current.prev=[r,l,i])},0),setTimeout(e,10),setTimeout(e,50)},[F,V]),a.useEffect(()=>{void 0!==I&&F!==I&&I.length<w&&F.length===w&&(null==k||k(F))},[w,k,I,F]);let Y=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[l,i]=a.useState(!1),[o,s]=a.useState(!1),[c,d]=a.useState(!1),u=a.useMemo(()=>"none"!==n&&("increase-width"===n||"experimental-no-flickering"===n)&&l&&o,[l,o,n]),p=a.useCallback(()=>{let a=e.current,r=t.current;if(!a||!r||c||"none"===n)return;let l=a.getBoundingClientRect().left+a.offsetWidth,o=a.getBoundingClientRect().top+a.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(l-18,o)===a||(i(!0),d(!0))},[e,t,c,n]);return a.useEffect(()=>{let t=e.current;if(!t||"none"===n)return;function a(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}a();let r=setInterval(a,1e3);return()=>{clearInterval(r)}},[e,n]),a.useEffect(()=>{let e=r||document.activeElement===t.current;if("none"===n||!e)return;let a=setTimeout(p,0),l=setTimeout(p,2e3),i=setTimeout(p,5e3),o=setTimeout(()=>{d(!0)},6e3);return()=>{clearTimeout(a),clearTimeout(l),clearTimeout(i),clearTimeout(o)}},[t,r,n,p]),{hasPWMBadge:l,willPushPWMBadge:u,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:L,inputRef:W,pushPasswordManagerStrategy:E,isFocused:V}),Q=a.useCallback(e=>{let t=e.currentTarget.value.slice(0,w);t.length>0&&z&&!z.test(t)?e.preventDefault():("string"==typeof I&&t.length<I.length&&document.dispatchEvent(new Event("selectionchange")),A(t))},[w,A,I,z]),Z=a.useCallback(()=>{var e;if(W.current){let t=Math.min(W.current.value.length,w-1),a=W.current.value.length;null==(e=W.current)||e.setSelectionRange(t,a),J(t),X(a)}$(!0)},[w]),ee=a.useCallback(e=>{var t,a;let n=W.current;if(!N&&(!_.current.isIOS||!e.clipboardData||!n))return;let r=e.clipboardData.getData("text/plain"),l=N?N(r):r;e.preventDefault();let i=null==(t=W.current)?void 0:t.selectionStart,o=null==(a=W.current)?void 0:a.selectionEnd,s=(i!==o?F.slice(0,i)+l+F.slice(o):F.slice(0,i)+l+F.slice(i)).slice(0,w);if(s.length>0&&z&&!z.test(s))return;n.value=s,A(s);let c=Math.min(s.length,w-1),d=s.length;n.setSelectionRange(c,d),J(c),X(d)},[w,A,z,F]),et=a.useMemo(()=>({position:"relative",cursor:B.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[B.disabled]),ea=a.useMemo(()=>({position:"absolute",inset:0,width:Y.willPushPWMBadge?`calc(100% + ${Y.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:Y.willPushPWMBadge?`inset(0 ${Y.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:j,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[Y.PWM_BADGE_SPACE_WIDTH,Y.willPushPWMBadge,j]),en=a.useMemo(()=>a.createElement("input",c(((e,t)=>{for(var a in t||(t={}))p.call(t,a)&&f(e,a,t[a]);if(u)for(var a of u(t))m.call(t,a)&&f(e,a,t[a]);return e})({autoComplete:B.autoComplete||"one-time-code"},B),d({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===F.length||void 0,"data-input-otp-mss":q,"data-input-otp-mse":K,inputMode:C,pattern:null==z?void 0:z.source,"aria-placeholder":S,style:ea,maxLength:w,value:F,ref:W,onPaste:e=>{var t;ee(e),null==(t=B.onPaste)||t.call(B,e)},onChange:Q,onMouseOver:e=>{var t;U(!0),null==(t=B.onMouseOver)||t.call(B,e)},onMouseLeave:e=>{var t;U(!1),null==(t=B.onMouseLeave)||t.call(B,e)},onFocus:e=>{var t;Z(),null==(t=B.onFocus)||t.call(B,e)},onBlur:e=>{var t;$(!1),null==(t=B.onBlur)||t.call(B,e)}}))),[Q,Z,ee,C,ea,w,K,q,B,null==z?void 0:z.source,F]),er=a.useMemo(()=>({slots:Array.from({length:w}).map((e,t)=>{var a;let n=V&&null!==q&&null!==K&&(q===K&&t===q||t>=q&&t<K),r=void 0!==F[t]?F[t]:null;return{char:r,placeholderChar:void 0!==F[0]?null:null!=(a=null==S?void 0:S[t])?a:null,isActive:n,hasFakeCaret:n&&null===r}}),isFocused:V,isHovering:!B.disabled&&G}),[V,G,w,K,q,B.disabled,F]),el=a.useMemo(()=>R?R(er):a.createElement(h.Provider,{value:er},T),[T,er,R]);return a.createElement(a.Fragment,null,null!==M&&a.createElement("noscript",null,a.createElement("style",null,M)),a.createElement("div",{ref:L,"data-input-otp-container":!0,style:et,className:P},el,a.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},en)))});function v(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}g.displayName="Input";var x=`
2
+ [data-input-otp] {
3
+ --nojs-bg: white !important;
4
+ --nojs-fg: black !important;
5
+
6
+ background-color: var(--nojs-bg) !important;
7
+ color: var(--nojs-fg) !important;
8
+ caret-color: var(--nojs-fg) !important;
9
+ letter-spacing: .25em !important;
10
+ text-align: center !important;
11
+ border: 1px solid var(--nojs-fg) !important;
12
+ border-radius: 4px !important;
13
+ width: 100% !important;
14
+ }
15
+ @media (prefers-color-scheme: dark) {
16
+ [data-input-otp] {
17
+ --nojs-bg: black !important;
18
+ --nojs-fg: white !important;
19
+ }
20
+ }`,b=e.i(613349);function w({className:e,containerClassName:a,...n}){return(0,t.jsx)(g,{"data-slot":"input-otp",containerClassName:(0,b.cn)("cn-input-otp flex items-center has-disabled:opacity-50",a),spellCheck:!1,className:(0,b.cn)("disabled:cursor-not-allowed",e),...n})}function j({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"input-otp-group",className:(0,b.cn)("flex items-center rounded-lg has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40",e),...a})}function y({index:e,className:n,...r}){let l=a.useContext(h),{char:i,hasFakeCaret:o,isActive:s}=l?.slots[e]??{};return(0,t.jsxs)("div",{"data-slot":"input-otp-slot","data-active":s,className:(0,b.cn)("relative flex size-8 items-center justify-center border-y border-r border-input text-sm transition-all outline-none first:rounded-l-lg first:border-l last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40",n),...r,children:[i,o&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})}e.i(860115);var S=e.i(294237),C=e.i(473131),k=e.i(957563);function E({className:e,orientation:a="horizontal",...n}){return(0,t.jsx)(k.Separator,{"data-slot":"separator",orientation:a,className:(0,b.cn)("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}function N({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"field-group",className:(0,b.cn)("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",e),...a})}let P=(0,S.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function M({className:e,orientation:a="vertical",...n}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":a,className:(0,b.cn)(P({orientation:a}),e),...n})}function R({className:e,...a}){return(0,t.jsx)(C.Label,{"data-slot":"field-label",className:(0,b.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...a})}function T({children:e,className:a,...n}){return(0,t.jsxs)("div",{"data-slot":"field-separator","data-content":!!e,className:(0,b.cn)("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",a),...n,children:[(0,t.jsx)(E,{className:"absolute inset-0 top-1/2"}),e&&(0,t.jsx)("span",{className:"relative mx-auto block w-fit bg-background px-2 text-muted-foreground","data-slot":"field-separator-content",children:e})]})}function B({className:e,children:n,errors:r,...l}){let i=(0,a.useMemo)(()=>{if(n)return n;if(!r?.length)return null;let e=[...new Map(r.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,t.jsx)("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:e.map((e,a)=>e?.message&&(0,t.jsx)("li",{children:e.message},a))})},[n,r]);return i?(0,t.jsx)("div",{role:"alert","data-slot":"field-error",className:(0,b.cn)("text-sm font-normal text-destructive",e),...l,children:i}):null}let O=a.forwardRef(function({title:e="GitHub",color:a="currentColor",size:n=24,...r},l){return"default"===a&&(a="#181717"),(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,fill:a,viewBox:"0 0 24 24",ref:l,...r,children:[(0,t.jsx)("title",{children:e}),(0,t.jsx)("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),D=a.forwardRef(function({title:e="Google",color:a="currentColor",size:n=24,...r},l){return"default"===a&&(a="#4285F4"),(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,fill:a,viewBox:"0 0 24 24",ref:l,...r,children:[(0,t.jsx)("title",{children:e}),(0,t.jsx)("path",{d:"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"})]})});var F=e.i(898707),I=e.i(795379);e.i(954194);var A=e.i(582168);let z=!(0,b.isLocalMode)();function W({postLoginUrl:e}){let[n,i]=(0,a.useState)(""),[s,c]=(0,a.useState)(""),[d,u]=(0,a.useState)(!1),[p,m]=(0,a.useState)(""),[f,h]=(0,a.useState)("email"),[g,v]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(null==g)return;let e=setTimeout(()=>{v(e=>null==e||e<=1?null:e-1)},1e3);return()=>clearTimeout(e)},[g]);let x={onError:e=>{if(429===e.response.status){let t=function(e){let t=e.get("X-Retry-After")??e.get("Retry-After");if(!t)return null;let a=Number.parseInt(t,10);return Number.isFinite(a)&&a>0?a:null}(e.response.headers);null!=t&&v(t)}}};async function b(e){if(e.preventDefault(),null==g){c(""),v(null),u(!0);try{let{error:e}=await r.authClient.emailOtp.sendVerificationOtp({email:n,type:"sign-in",fetchOptions:x});e?429!==e.status&&c(e.message??"Failed to send code"):h("code")}catch{c("Failed to send code")}u(!1)}}async function S(t){if(m(t),6===t.length){c(""),u(!0);try{let{error:a}=await r.authClient.signIn.emailOtp({email:n,otp:t});if(a)c(a.message??"Invalid code"),m("");else{window.location.href=e;return}}catch{c("Invalid code"),m("")}u(!1)}}async function C(t){t.preventDefault(),c(""),u(!0);let{error:a}=await r.signIn.email({email:n,password:A.DEV_PASSWORD},{onError:()=>{}});if(a){let{error:e}=await r.signUp.email({name:n.split("@")[0],email:n,password:A.DEV_PASSWORD},{onError:()=>{}});if(e){c(e.message??"Failed to sign in"),u(!1);return}}window.location.href=e}let k=null!=g,E=d?"Sending...":k?`Wait ${g}s`:"Send Code",P=z&&"code"===f?"Enter the code we sent you":z?"Enter your email — we’ll send you a verification code":void 0;return(0,t.jsxs)(N,{children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold",children:"Sign in"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"or create an account to get started"}),P&&(0,t.jsx)("p",{className:"text-balance text-muted-foreground",children:P})]}),k&&(0,t.jsxs)(B,{children:["Too many requests. Try again in ",g,"s."]}),s&&!k&&(0,t.jsx)(B,{children:s}),z?"email"===f?(0,t.jsx)("form",{onSubmit:b,children:(0,t.jsxs)(N,{children:[(0,t.jsxs)(M,{children:[(0,t.jsx)(R,{htmlFor:"email",children:"Email"}),(0,t.jsx)(o.Input,{id:"email",type:"email",placeholder:"you@example.com",value:n,onChange:e=>i(e.target.value),required:!0,autoFocus:!0})]}),(0,t.jsx)(M,{children:(0,t.jsx)(l.Button,{type:"submit",disabled:d||k,className:"w-full",children:E})})]})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-sm text-muted-foreground text-center",children:["We sent a code to ",(0,t.jsx)("strong",{children:n})]}),(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(w,{maxLength:6,value:p,onChange:S,disabled:d,autoFocus:!0,children:(0,t.jsxs)(j,{children:[(0,t.jsx)(y,{index:0}),(0,t.jsx)(y,{index:1}),(0,t.jsx)(y,{index:2}),(0,t.jsx)(y,{index:3}),(0,t.jsx)(y,{index:4}),(0,t.jsx)(y,{index:5})]})})}),(0,t.jsx)(l.Button,{variant:"ghost",className:"w-full",onClick:()=>{h("email"),m(""),c("")},children:"Use a different email"})]}):(0,t.jsx)("form",{onSubmit:C,children:(0,t.jsxs)(N,{children:[(0,t.jsxs)(M,{children:[(0,t.jsx)(R,{htmlFor:"email",children:"Email"}),(0,t.jsx)(o.Input,{id:"email",type:"email",placeholder:"you@example.com",value:n,onChange:e=>i(e.target.value),required:!0,autoFocus:!0})]}),(0,t.jsx)(M,{children:(0,t.jsx)(l.Button,{type:"submit",disabled:d,className:"w-full",children:d?"Signing in...":"Sign in"})})]})}),(0,t.jsx)(T,{className:"*:data-[slot=field-separator-content]:bg-card",children:"Or continue with"}),(0,t.jsxs)(M,{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)(l.Button,{variant:"outline",type:"button",onClick:()=>r.signIn.social({provider:"github",callbackURL:e}),children:[(0,t.jsx)(O,{className:"size-4"}),"GitHub"]}),(0,t.jsxs)(l.Button,{variant:"outline",type:"button",onClick:()=>r.signIn.social({provider:"google",callbackURL:e}),children:[(0,t.jsx)(D,{className:"size-4"}),"Google"]})]})]})}e.s(["default",0,function(){var e;let a=(e=(0,n.useSearchParams)().get("redirect"))&&e.startsWith("/")&&!e.startsWith("//")?e:"/workspaces?auto";return(0,t.jsxs)("div",{className:"relative flex min-h-svh flex-col items-center justify-center p-6 md:p-10",children:[(0,t.jsx)(F.GradientBackground,{}),(0,t.jsx)("div",{className:"w-full max-w-sm md:max-w-4xl",children:(0,t.jsx)("div",{className:"flex flex-col gap-6",children:(0,t.jsx)(i.Card,{className:"overflow-hidden p-0",children:(0,t.jsxs)(i.CardContent,{className:"grid p-0 md:grid-cols-2",children:[(0,t.jsx)("div",{className:"p-6 md:p-8 md:min-h-105 flex flex-col justify-center",children:(0,t.jsx)(W,{postLoginUrl:a})}),(0,t.jsx)("div",{className:"hidden bg-muted md:flex items-center justify-center overflow-visible min-h-80 pt-24",children:(0,t.jsx)(I.TypewriterVisual,{className:"scale-[0.65] shrink-0",emails:I.EMAILS_PLAYFUL,blobScale:2.5,blobBottom:"30%"})})]})})})})]})}],45356)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,858924,e=>{"use strict";let s=(0,e.i(706875).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,s],858924)},393153,e=>{"use strict";var s=e.i(368075),t=e.i(779646),a=e.i(186339);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:n,title:r,description:i,confirmLabel:l="Remove",loadingLabel:d,confirmVariant:o="destructive",loading:c=!1,onConfirm:u}){return(0,s.jsx)(t.Dialog,{open:e,onOpenChange:n,children:(0,s.jsxs)(t.DialogContent,{showCloseButton:!1,children:[(0,s.jsxs)(t.DialogHeader,{children:[(0,s.jsx)(t.DialogTitle,{children:r}),(0,s.jsx)(t.DialogDescription,{children:i})]}),(0,s.jsxs)(t.DialogFooter,{children:[(0,s.jsx)(a.Button,{variant:"outline",size:"sm",onClick:()=>n(!1),disabled:c,children:"Cancel"}),(0,s.jsx)(a.Button,{variant:o,size:"sm",onClick:u,disabled:c,children:c?d??`${l}...`:l})]})]})})}])},934351,e=>{"use strict";var s=e.i(368075),t=e.i(613349);e.s(["Card",0,function({className:e,size:a="default",...n}){return(0,s.jsx)("div",{"data-slot":"card","data-size":a,className:(0,t.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})},"CardAction",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-action",className:(0,t.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...a})},"CardContent",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,t.cn)("px-4 group-data-[size=sm]/card:px-3",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,t.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,t.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...a})}])},855372,e=>{"use strict";var s=e.i(368075),t=e.i(609049);function a({className:e}){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",fill:"#D97757",className:e,children:(0,s.jsx)("path",{d:"m3.127 10.604 3.135-1.76.053-.153-.053-.085H6.11l-.525-.032-1.791-.048-1.554-.065-1.505-.08-.38-.081L0 7.832l.036-.234.32-.214.455.04 1.009.069 1.513.105 1.097.064 1.626.17h.259l.036-.105-.089-.065-.068-.064-1.566-1.062-1.695-1.121-.887-.646-.48-.327-.243-.306-.104-.67.435-.48.585.04.15.04.593.456 1.267.981 1.654 1.218.242.202.097-.068.012-.049-.109-.181-.9-1.626-.96-1.655-.428-.686-.113-.411a2 2 0 0 1-.068-.484l.496-.674L4.446 0l.662.089.279.242.411.94.666 1.48 1.033 2.014.302.597.162.553.06.17h.105v-.097l.085-1.134.157-1.392.154-1.792.052-.504.25-.605.497-.327.387.186.319.456-.045.294-.19 1.23-.37 1.93-.243 1.29h.142l.161-.16.654-.868 1.097-1.372.484-.545.565-.601.363-.287h.686l.505.751-.226.775-.707.895-.585.759-.839 1.13-.524.904.048.072.125-.012 1.897-.403 1.024-.186 1.223-.21.553.258.06.263-.218.536-1.307.323-1.533.307-2.284.54-.028.02.032.04 1.029.098.44.024h1.077l2.005.15.525.346.315.424-.053.323-.807.411-3.631-.863-.872-.218h-.12v.073l.726.71 1.331 1.202 1.667 1.55.084.383-.214.302-.226-.032-1.464-1.101-.565-.497-1.28-1.077h-.084v.113l.295.432 1.557 2.34.08.718-.112.234-.404.141-.444-.08-.911-1.28-.94-1.44-.759-1.291-.093.053-.448 4.821-.21.246-.484.186-.403-.307-.214-.496.214-.98.258-1.28.21-1.016.19-1.263.112-.42-.008-.028-.092.012-.953 1.307-1.448 1.957-1.146 1.227-.274.109-.477-.247.045-.44.266-.39 1.586-2.018.956-1.25.617-.723-.004-.105h-.036l-4.212 2.736-.75.096-.324-.302.04-.496.154-.162 1.267-.871z"})})}function n({className:e}){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:e,children:(0,s.jsx)("path",{d:"M14.949 6.547a3.94 3.94 0 0 0-.348-3.273 4.11 4.11 0 0 0-4.4-1.934A4.1 4.1 0 0 0 8.423.2 4.15 4.15 0 0 0 6.305.086a4.1 4.1 0 0 0-1.891.948 4.04 4.04 0 0 0-1.158 1.753 4.1 4.1 0 0 0-1.563.679A4 4 0 0 0 .554 4.72a3.99 3.99 0 0 0 .502 4.731 3.94 3.94 0 0 0 .346 3.274 4.11 4.11 0 0 0 4.402 1.933c.382.425.852.764 1.377.995.526.231 1.095.35 1.67.346 1.78.002 3.358-1.132 3.901-2.804a4.1 4.1 0 0 0 1.563-.68 4 4 0 0 0 1.14-1.253 3.99 3.99 0 0 0-.506-4.716m-6.097 8.406a3.05 3.05 0 0 1-1.945-.694l.096-.054 3.23-1.838a.53.53 0 0 0 .265-.455v-4.49l1.366.778q.02.011.025.035v3.722c-.003 1.653-1.361 2.992-3.037 2.996m-6.53-2.75a2.95 2.95 0 0 1-.36-2.01l.095.057L5.29 12.09a.53.53 0 0 0 .527 0l3.949-2.246v1.555a.05.05 0 0 1-.022.041L6.473 13.3c-1.454.826-3.311.335-4.15-1.098m-.85-6.94A3.02 3.02 0 0 1 3.07 3.949v3.785a.51.51 0 0 0 .262.451l3.93 2.237-1.366.779a.05.05 0 0 1-.048 0L2.585 9.342a2.98 2.98 0 0 1-1.113-4.094zm11.216 2.571L8.747 5.576l1.362-.776a.05.05 0 0 1 .048 0l3.265 1.86a3 3 0 0 1 1.173 1.207 2.96 2.96 0 0 1-.27 3.2 3.05 3.05 0 0 1-1.36.997V8.279a.52.52 0 0 0-.276-.445m1.36-2.015-.097-.057-3.226-1.855a.53.53 0 0 0-.53 0L6.249 6.153V4.598a.04.04 0 0 1 .019-.04L9.533 2.7a3.07 3.07 0 0 1 3.257.139c.474.325.843.778 1.066 1.303.223.526.289 1.103.191 1.664zM5.503 8.575 4.139 7.8a.05.05 0 0 1-.026-.037V4.049c0-.57.166-1.127.476-1.607s.752-.864 1.275-1.105a3.08 3.08 0 0 1 3.234.41l-.096.054-3.23 1.838a.53.53 0 0 0-.265.455zm.742-1.577 1.758-1 1.762 1v2l-1.755 1-1.762-1z"})})}function r({className:e}){return(0,s.jsxs)("svg",{viewBox:"0 0 240 300",fill:"none",className:e,children:[(0,s.jsx)("path",{d:"M180 240H60V120H180V240Z",fill:"#CFCECD"}),(0,s.jsx)("path",{d:"M180 60H60V240H180V60ZM240 300H0V0H240V300Z",fill:"#211E1E"})]})}function i({className:e}){return(0,s.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:e,children:[(0,s.jsx)("path",{d:"M8 2C5.5 2 3.5 4 3.5 6.5S5 10.5 6.5 11v1.5H8V11c.3.1.7.1 1 0v1.5h1.5V11c1.5-.5 3-2.5 3-4.5S10.5 2 8 2Z",fill:"#E8453A"}),(0,s.jsx)("path",{d:"M3.5 5.5C2 5 1 6 1.5 7s2 .5 2.2-.7",fill:"#FF6B5A"}),(0,s.jsx)("path",{d:"M12.5 5.5c1.5-.5 2.5.5 2 1.5s-2 .5-2.2-.7",fill:"#FF6B5A"}),(0,s.jsx)("path",{d:"M6.5 3Q5 1.2 4.3 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,s.jsx)("path",{d:"M9.5 3Q11 1.2 11.7 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,s.jsx)("circle",{cx:"6.2",cy:"5.2",r:"0.9",fill:"#050810"}),(0,s.jsx)("circle",{cx:"9.8",cy:"5.2",r:"0.9",fill:"#050810"}),(0,s.jsx)("circle",{cx:"6.4",cy:"5",r:"0.3",fill:"#00E5CC"}),(0,s.jsx)("circle",{cx:"10",cy:"5",r:"0.3",fill:"#00E5CC"})]})}function l({className:e}){return(0,s.jsx)("img",{src:"data:image/webp;base64,UklGRuYDAABXRUJQVlA4INoDAADQEwCdASowADAAPm0uk0ckIiGhKrqpWIANiWkAEyQea/fD8IewvGL5V7Nb3H8u/MA8G9rT+4flL+UfIe42/23GB8zPqF/o3E0UAP5h/h/+F6ZX+x5evnX/r+4T/K/67/u/zg7znogfrusMANZLkn1gvlY/vNsKubtj/9xLSzxTsLr7K9GLdFNs5rwtISRcPXvH4z57n2fg0XR3aQ2D+pPpycwyl7TwAAD+/2DbjivnePzfyHCsdOgJXKlUR/OgAkofD7K4AdmsPKyP5Ml4/4HBYmIm5/efn/H+X3IZtngyaUOvwbFuRS/1yODFYO3vf3qeXGgPdfgIROXd/EPT7K2jysfvY9N71+w6g2gBPs+P6lxYkPf6S9QfpvH/7Pp7i8xRh0nVDBTEQyczSz7V9hoqo4nDJuii+SfibZRR/d5zB+9jkcb1DNN7YnC5Y7+WfGrE3eseXt3hSm+NS5++m1MHbjsrd9z/Q4HPRP/C85Po41XObalGyIUcFUL2j2n3uI/Yh6U8r6trCUJFB4kT3fsv6+8ylX/d96y2hq869FCXLjq4YqEO8vs5BtT52sf7KyDxPAWkH/b06YbfVXf4/7y5THL6Sr/4mOrrY9P2LW81f05HHFN8n0jcyqKOH7AluMm0AHPgFyz8RVrfBdmnPiC2FLMQfNDte5yGFzGC3fMlDed/tS/PO3Q/hjsNLvAXUUjqHyCo3JeN69jyNgWjjf8iUqoBsXT+lJyp2r8p60ad1jxhNyTblyJwda8aWEw1hFDeGjpMGguDF66RL4c+ZO+PhculC6WxvCsZ7IPAsdD7/ywx3w3AowJ66hAAK7k+m6X2QV06OVOCwyIGERex/AUyuBbLUK93X58+M+Si7YfYjVYGpoJ7JvSgD8ExaA21z9OY+si+1wreacDanKnFDmhwBQC3t6MLeXCOGp3VURDKl10K7tdKHQcb4hr48ba+1x/MrMRwHfq3IQrDIXPYCg4b0OLnVN9JyXttKGM63B5imIdKuU0r6hhSslT10lGLjnIJuwO5WKR0RHs+BX5vs6H63y3K7IuuZ1eRN+Aczvbs4QuDs6ZRuzjJ/1DJ5R/3ZrFPrtxvMwT06vAXIgcbhLGNLhOQUYRPdUN5MgyCtL5NH71ArTPLRRkIjhGwoCYXKKqlqIKKT9NX3vwp/nlh4SX71dlYg/mPXbJ9bMeVugyjqFahjFTJ/rT3HtBCWG8h+OvvbOFDFKurCG9BOhO9B719OS7zsP0KPqoymnv7hVvoJyZp0iziCbBvaJpmF9Cvfs8/vWqWr7TUo616WfMW+X9nkgpuqtnfAAAAAA==",alt:"Hermes",className:`${e} rounded-sm`})}function d({className:e}){return(0,s.jsxs)("svg",{viewBox:"0 0 800 800",fill:"none",className:e,children:[(0,s.jsx)("rect",{width:"800",height:"800",rx:"150",fill:"#09090b"}),(0,s.jsx)("path",{fill:"#fff",fillRule:"evenodd",d:"M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z"}),(0,s.jsx)("path",{fill:"#fff",d:"M517.36 400H634.72V634.72H517.36Z"})]})}function o({className:e}){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:e,children:(0,s.jsx)("path",{d:"M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"})})}function c({className:e}){return(0,s.jsxs)("svg",{viewBox:"600 300 400 400",fill:"none",className:e,children:[(0,s.jsx)("path",{fill:"#14120B",d:"M999.994 554.294C999.994 559.859 999.994 565.419 999.962 570.984C999.935 575.67 999.882 580.357 999.753 585.038C999.475 595.247 998.875 605.542 997.059 615.639C995.217 625.88 992.212 635.409 987.477 644.718C982.822 653.861 976.738 662.233 969.485 669.491C962.227 676.748 953.861 682.828 944.712 687.482C935.409 692.217 925.875 695.222 915.633 697.065C905.537 698.88 895.242 699.48 885.033 699.759C880.346 699.887 875.665 699.941 870.978 699.968C865.413 700.005 859.853 700 854.288 700H745.695C740.13 700 734.571 700 729.005 699.968C724.319 699.941 719.632 699.887 714.951 699.759C704.742 699.48 694.447 698.88 684.35 697.065C674.109 695.222 664.58 692.217 655.271 687.482C646.128 682.828 637.756 676.743 630.499 669.491C623.241 662.233 617.161 653.866 612.507 644.718C607.772 635.414 604.767 625.88 602.925 615.639C601.109 605.542 600.509 595.247 600.23 585.038C600.102 580.352 600.048 575.67 600.021 570.984C600 565.419 600 559.859 600 554.294V445.701C600 440.136 600 434.576 600.032 429.011C600.059 424.324 600.112 419.637 600.241 414.956C600.52 404.747 601.119 394.452 602.935 384.356C604.778 374.115 607.783 364.586 612.518 355.277C617.172 346.133 623.257 337.762 630.509 330.504C637.767 323.246 646.133 317.167 655.282 312.512C664.586 307.777 674.12 304.772 684.361 302.93C694.458 301.114 704.752 300.514 714.961 300.236C719.648 300.107 724.329 300.054 729.016 300.027C734.576 300 740.136 300 745.701 300H854.294C859.859 300 865.419 300 870.984 300.032C875.67 300.059 880.357 300.112 885.038 300.241C895.247 300.52 905.542 301.119 915.639 302.935C925.88 304.778 935.409 307.783 944.718 312.518C953.861 317.172 962.233 323.257 969.491 330.509C976.748 337.767 982.828 346.133 987.482 355.282C992.217 364.586 995.222 374.12 997.065 384.361C998.88 394.458 999.48 404.752 999.759 414.961C999.887 419.648 999.941 424.329 999.968 429.016C1000.01 434.581 1000 440.141 1000 445.706V554.299L999.994 554.294Z"}),(0,s.jsx)("path",{fill:"#72716D",d:"M800.004 500L923.821 571.486C923.061 572.804 921.957 573.929 920.591 574.716L804.863 641.531C801.858 643.266 798.151 643.266 795.146 641.531L679.417 574.716C678.052 573.929 676.948 572.804 676.188 571.486L800.004 500Z"}),(0,s.jsx)("path",{fill:"#55544F",d:"M800.005 357.168V500L676.188 571.486C675.427 570.168 675.004 568.647 675.004 567.072V432.928C675.004 429.774 676.686 426.865 679.418 425.285L795.141 358.47C796.646 357.602 798.323 357.168 799.999 357.168H800.005Z"}),(0,s.jsx)("path",{fill:"#43413C",d:"M923.815 428.515C923.055 427.197 921.951 426.072 920.586 425.285L804.857 358.47C803.357 357.602 801.68 357.168 800.004 357.168V500L923.821 571.486C924.581 570.168 925.005 568.647 925.005 567.072V432.928C925.005 431.348 924.587 429.838 923.821 428.515H923.815Z"}),(0,s.jsx)("path",{fill:"#D6D5D2",d:"M915.156 433.518C915.857 434.728 915.954 436.281 915.156 437.663L802.764 632.323C802.008 633.641 800 633.1 800 631.584V503.311C800 502.287 799.727 501.302 799.229 500.44L915.15 433.512H915.156V433.518Z"}),(0,s.jsx)("path",{fill:"white",d:"M915.155 433.518L799.233 500.445C798.741 499.588 798.023 498.86 797.134 498.345L686.049 434.209C684.731 433.453 685.272 431.445 686.788 431.445H911.566C913.162 431.445 914.459 432.307 915.155 433.518Z"})]})}function u({className:e}){return(0,s.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:e,children:[(0,s.jsx)("path",{d:"M12 24C12 18.2 12 15.5 10.1 13.9C8.5 12 5.8 12 0 12C5.8 12 8.5 12 10.1 10.1C12 8.5 12 5.8 12 0C12 5.8 12 8.5 13.9 10.1C15.5 12 18.2 12 24 12C18.2 12 15.5 12 13.9 13.9C12 15.5 12 18.2 12 24Z",fill:"url(#gemini-gradient)"}),(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:"gemini-gradient",x1:"0",y1:"0",x2:"24",y2:"24",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#4285F4"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#886FBF"})]})})]})}e.s(["ProviderLogo",0,function({provider:e,className:m="h-4 w-4"}){switch(e){case"claude":return(0,s.jsx)(a,{className:m});case"codex":return(0,s.jsx)(n,{className:m});case"opencode":return(0,s.jsx)(r,{className:m});case"openclaw":return(0,s.jsx)(i,{className:m});case"hermes":return(0,s.jsx)(l,{className:m});case"pi":return(0,s.jsx)(d,{className:m});case"copilot":return(0,s.jsx)(o,{className:m});case"cursor":return(0,s.jsx)(c,{className:m});case"gemini":return(0,s.jsx)(u,{className:m});default:return(0,s.jsx)(t.Monitor,{className:m})}}])},371406,e=>{"use strict";var s=e.i(368075),t=e.i(298699),a=e.i(186339),n=e.i(575607),r=e.i(880932),i=e.i(613349);function l({step:e,completed:t}){return t?(0,s.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-emerald-500 text-white transition-all duration-300",children:(0,s.jsx)(n.Check,{className:"size-3",strokeWidth:3})}):(0,s.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-foreground text-background text-xs font-semibold",children:e})}e.s(["ConnectMachineSteps",0,function({generatedToken:e,generatingToken:n,onGenerateToken:d,registered:o}){let c=(0,t.useRef)(!1);(0,t.useEffect)(()=>{e||n||c.current||(c.current=!0,d())},[e,n,d]);let u=()=>{navigator.clipboard.writeText(`${i.CLI_CMD} register --token ${e}`),r.toast.success("Copied to clipboard")},m=`${i.CLI_CMD} daemon start`,x=()=>{navigator.clipboard.writeText(m),r.toast.success("Copied to clipboard")};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,s.jsx)(l,{step:1,completed:o}),"Register your CLI",o&&(0,s.jsx)("span",{className:"text-xs text-emerald-500 font-normal",children:"Done"})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"Run this in your terminal to link your machine."}),n?(0,s.jsx)("div",{className:"pl-7",children:(0,s.jsx)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground animate-pulse",children:"Generating token..."})}):e?(0,s.jsxs)("div",{className:"pl-7 space-y-2",children:[(0,s.jsxs)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors break-all",onClick:u,title:"Click to copy",children:[i.CLI_CMD," register --token"," ",(0,s.jsx)("span",{className:"text-foreground/70",children:e})]}),!o&&(0,s.jsx)(a.Button,{size:"sm",onClick:u,className:"w-full",children:"Copy Command"})]}):null]}),(0,s.jsxs)("div",{className:`space-y-2 transition-opacity duration-300 ${!o?"opacity-40 pointer-events-none":""}`,children:[(0,s.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,s.jsx)(l,{step:2,completed:!1}),"Start the daemon"]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"The daemon connects your local agents to Alook."}),(0,s.jsx)("div",{className:"ml-7 rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors",onClick:x,title:"Click to copy",children:m}),o&&(0,s.jsx)("div",{className:"pl-7",children:(0,s.jsx)(a.Button,{size:"sm",onClick:x,className:"w-full",children:"Copy Command"})})]})]})}])},7374,e=>{"use strict";var s=e.i(368075),t=e.i(298699),a=e.i(208020),n=e.i(355578),r=e.i(186339),i=e.i(875061),l=e.i(934351),d=e.i(332680),o=e.i(393153),c=e.i(880932),u=e.i(728886),m=e.i(609049),x=e.i(877942);e.i(954194);var h=e.i(907903),p=e.i(613349),f=e.i(855372),g=e.i(222862),C=e.i(858924),j=e.i(695554),v=e.i(371406);e.s(["default",0,function(){let{agents:e,runtimes:N,loading:b,handleGenerateToken:y,handleDeleteMachine:w,subscribeWs:S,workspaceId:k}=(0,n.useAgentContext)(),L=(0,a.useSearchParams)(),A=(0,a.useRouter)(),z=(0,a.usePathname)(),[M,R]=(0,t.useState)(()=>L.has("connect")),[B,D]=(0,t.useState)(""),[H,V]=(0,t.useState)(!1),[F,P]=(0,t.useState)(!1),[T,I]=(0,t.useState)(null),[U,O]=(0,t.useState)(new Set),[K,X]=(0,t.useState)(new Set),[G,_]=(0,t.useState)(!1),[Z,E]=(0,t.useState)(""),[Y,q]=(0,t.useState)(""),[J,Q]=(0,t.useState)("Remove"),[W,$]=(0,t.useState)(void 0),[ee,es]=(0,t.useState)("destructive"),[et,ea]=(0,t.useState)(!1),en=(0,t.useRef)(null);(0,t.useEffect)(()=>{(0,g.fetchLatestCliVersion)().then(e=>I(e.version)).catch(()=>{})},[]),(0,t.useEffect)(()=>{L.has("connect")&&A.replace(z,{scroll:!1})},[L,A,z]);let er=(0,t.useRef)(M);(0,t.useEffect)(()=>{er.current=M},[M]);let ei=(0,t.useRef)(e);(0,t.useEffect)(()=>{ei.current=e},[e]),(0,t.useEffect)(()=>S(e=>{if(er.current&&("runtime.registered"===e.type&&e.workspaceId===k&&P(!0),"runtime.status"===e.type&&e.workspaceId===k&&"online"===e.status)&&(R(!1),D(""),P(!1),c.toast.success("Machine connected"),0===ei.current.length)){let e=z.split("/")[2];A.push(`/w/${e}/agents/new`)}}),[S,k,z,A]);let el=(e,s,t,a)=>{E(e),q(s),Q(a?.label??"Remove"),$(a?.loadingLabel),es(a?.variant??"destructive"),en.current=t,_(!0)},ed=async()=>{if(en.current){ea(!0);try{await en.current()}finally{ea(!1),_(!1),en.current=null}}},eo=(0,t.useCallback)(async()=>{V(!0);try{let e=await y();e&&D(e)}finally{V(!1)}},[y]),ec=async(e,s)=>{O(e=>new Set(e).add(s));try{await (0,g.triggerRuntimeUpdate)(e,k),c.toast.success("Update triggered")}catch{c.toast.error("Failed to trigger update"),O(e=>{let t=new Set(e);return t.delete(s),t})}},eu=async(e,s)=>{X(e=>new Set(e).add(s));try{await (0,g.triggerRuntimeRescan)(e,k),c.toast.success("Rescan triggered — daemon will restart to detect runtimes")}catch{c.toast.error("Failed to trigger rescan"),X(e=>{let t=new Set(e);return t.delete(s),t})}},em=(0,t.useMemo)(()=>{if(0===U.size)return U;let e=new Set;for(let s of N){let t=s.daemon_id||s.id;U.has(t)&&s.pending_update_version&&e.add(t)}return e},[N,U]),ex=(0,t.useMemo)(()=>{if(0===K.size)return K;let e=new Set;for(let s of N){let t=s.daemon_id||s.id;K.has(t)&&s.pending_rescan&&e.add(t)}return e},[N,K]),eh=new Map;for(let e of N){let s=e.daemon_id||e.id;if(!eh.has(s)){let t=e.metadata;eh.set(s,{deviceInfo:"string"==typeof e.device_info?e.device_info:"",status:e.status,lastSeenAt:e.last_seen_at,pendingUpdateVersion:e.pending_update_version??null,pendingRescan:!!e.pending_rescan,cliVersion:t?.cli_version??null,runtimes:[]})}eh.get(s).runtimes.push(e)}return b?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(u.Skeleton,{className:"h-4 w-16"}),(0,s.jsx)(u.Skeleton,{className:"h-3 w-52"})]}),(0,s.jsx)(u.Skeleton,{className:"h-8 w-29 rounded-md"})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:3}).map((e,t)=>(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u.Skeleton,{className:"size-4 rounded"}),(0,s.jsx)(u.Skeleton,{className:"h-4 w-28"})]}),(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(u.Skeleton,{className:"h-3 w-20"}),(0,s.jsx)(u.Skeleton,{className:"h-3 w-28"})]}),(0,s.jsx)(u.Skeleton,{className:"h-5 w-14 rounded-full"})]})})]},t))})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h1",{className:"text-sm font-medium",children:"Runtimes"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your machines and their agent runtimes."})]}),(0,s.jsxs)(r.Button,{size:"sm",variant:"outline",onClick:()=>{D(""),P(!1),R(!0)},disabled:H,children:[(0,s.jsx)(x.Plus,{className:"size-3.5"}),"New machine"]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:0===N.length?(0,s.jsx)("div",{className:"flex flex-1 items-center justify-center min-h-[60vh]",children:(0,s.jsxs)("div",{className:"text-center animate-[fade-up_400ms_ease-out_both]",children:[(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"Connect a machine to start running agents locally."}),(0,s.jsx)(r.Button,{size:"sm",className:"mt-4 glow-border",onClick:()=>{D(""),R(!0)},children:"Connect Machine"})]})}):(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from(eh.entries()).map(([e,t])=>{let a,n,d,o=t.deviceInfo||e;return(0,s.jsxs)(l.Card,{size:"sm",children:[(0,s.jsx)(l.CardHeader,{children:(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)(m.Monitor,{className:"size-4 text-muted-foreground shrink-0"}),(0,s.jsx)(l.CardTitle,{className:"truncate",children:o}),t.cliVersion&&(0,s.jsxs)("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:["v",t.cliVersion]}),(0,s.jsx)(i.Badge,{variant:"online"===t.status?"default":"outline",className:"shrink-0",children:t.status})]})}),(0,s.jsx)(l.CardContent,{children:(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:t.lastSeenAt?new Date(t.lastSeenAt).toLocaleString():"Never seen"}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(a=!!t.pendingUpdateVersion||em.has(e),n=T&&(!t.cliVersion||!(0,h.semverGte)(t.cliVersion,T)),a?(0,s.jsxs)(r.Button,{variant:"ghost",size:"sm",disabled:!0,className:"text-xs h-6 px-2",children:[(0,s.jsx)(C.Loader2,{className:"size-3 animate-spin mr-1"}),"Updating..."]}):n?(0,s.jsx)(r.Button,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:()=>el("Update daemon",`This will update the daemon on "${o}" to the latest CLI version. The daemon will restart during the update.`,async()=>{await ec(t.runtimes[0].id,e)},{label:"Update",loadingLabel:"Updating...",variant:"default"}),children:"Update"}):null),(d=t.pendingRescan||ex.has(e),"online"!==t.status?null:d?(0,s.jsxs)(r.Button,{variant:"ghost",size:"sm",disabled:!0,className:"text-xs h-6 px-2",children:[(0,s.jsx)(j.RefreshCw,{className:"size-3 animate-spin mr-1"}),"Rescanning..."]}):(0,s.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:()=>el("Rescan runtimes",`This will restart the daemon on "${o}" to re-detect available runtimes (Claude Code, Codex, OpenCode).`,async()=>{await eu(t.runtimes[0].id,e)},{label:"Rescan",loadingLabel:"Triggering...",variant:"default"}),children:[(0,s.jsx)(j.RefreshCw,{className:"size-3 mr-1"}),"Rescan"]})),(0,s.jsx)(r.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-6 px-2 hover:text-destructive",onClick:()=>{el("Remove machine",`This will remove "${o}" and all its runtimes. Agents using these runtimes will be unlinked.`,async()=>{await w(e)})},children:"Remove"})]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.runtimes.map(e=>(0,s.jsxs)(i.Badge,{variant:"secondary",className:"gap-1.5",children:[(0,s.jsx)(f.ProviderLogo,{provider:e.provider,className:"h-3.5 w-3.5"}),e.provider,e.metadata?.version?(0,s.jsx)("span",{className:"text-muted-foreground font-normal",children:String(e.metadata.version)}):null]},e.id))}),"online"!==t.status&&(0,s.jsxs)("div",{className:"pt-1.5 border-t border-border/50",children:[(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground mb-1.5",children:"Bring this machine online:"}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-md bg-muted px-2.5 py-1.5 font-mono text-[11px] text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors",onClick:()=>{navigator.clipboard.writeText(`${p.CLI_CMD} daemon start`),c.toast.success("Copied to clipboard")},title:"Click to copy",children:[(0,s.jsx)("span",{className:"absolute inset-0 -translate-x-full animate-[shimmer_2.5s_infinite] bg-linear-to-r from-transparent via-(--shimmer-peak) to-transparent"}),(0,s.jsxs)("span",{className:"relative",children:[p.CLI_CMD," daemon start"]})]})]})]})})]},e)})})}),(0,s.jsx)(d.Sheet,{open:M,onOpenChange:e=>{R(e),e||D("")},children:(0,s.jsxs)(d.SheetContent,{className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,s.jsxs)(d.SheetHeader,{children:[(0,s.jsx)(d.SheetTitle,{children:"Connect a machine"}),(0,s.jsx)(d.SheetDescription,{children:"Your machine runs AI agents locally using Claude Code, Codex, or OpenCode."})]}),(0,s.jsx)(d.SheetBody,{children:(0,s.jsx)(v.ConnectMachineSteps,{generatedToken:B,generatingToken:H,onGenerateToken:eo,registered:F})})]})}),(0,s.jsx)(o.ConfirmDialog,{open:G,onOpenChange:_,title:Z,description:Y,confirmLabel:J,loadingLabel:W,confirmVariant:ee,loading:et,onConfirm:ed})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,858924,e=>{"use strict";let s=(0,e.i(706875).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,s],858924)},393153,e=>{"use strict";var s=e.i(368075),t=e.i(779646),a=e.i(186339);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:n,title:r,description:i,confirmLabel:l="Remove",loadingLabel:d,confirmVariant:o="destructive",loading:c=!1,onConfirm:u}){return(0,s.jsx)(t.Dialog,{open:e,onOpenChange:n,children:(0,s.jsxs)(t.DialogContent,{showCloseButton:!1,children:[(0,s.jsxs)(t.DialogHeader,{children:[(0,s.jsx)(t.DialogTitle,{children:r}),(0,s.jsx)(t.DialogDescription,{children:i})]}),(0,s.jsxs)(t.DialogFooter,{children:[(0,s.jsx)(a.Button,{variant:"outline",size:"sm",onClick:()=>n(!1),disabled:c,children:"Cancel"}),(0,s.jsx)(a.Button,{variant:o,size:"sm",onClick:u,disabled:c,children:c?d??`${l}...`:l})]})]})})}])},934351,e=>{"use strict";var s=e.i(368075),t=e.i(613349);e.s(["Card",0,function({className:e,size:a="default",...n}){return(0,s.jsx)("div",{"data-slot":"card","data-size":a,className:(0,t.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})},"CardAction",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-action",className:(0,t.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...a})},"CardContent",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,t.cn)("px-4 group-data-[size=sm]/card:px-3",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,t.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,t.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...a})}])},855372,e=>{"use strict";var s=e.i(368075),t=e.i(609049);function a({className:e}){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",fill:"#D97757",className:e,children:(0,s.jsx)("path",{d:"m3.127 10.604 3.135-1.76.053-.153-.053-.085H6.11l-.525-.032-1.791-.048-1.554-.065-1.505-.08-.38-.081L0 7.832l.036-.234.32-.214.455.04 1.009.069 1.513.105 1.097.064 1.626.17h.259l.036-.105-.089-.065-.068-.064-1.566-1.062-1.695-1.121-.887-.646-.48-.327-.243-.306-.104-.67.435-.48.585.04.15.04.593.456 1.267.981 1.654 1.218.242.202.097-.068.012-.049-.109-.181-.9-1.626-.96-1.655-.428-.686-.113-.411a2 2 0 0 1-.068-.484l.496-.674L4.446 0l.662.089.279.242.411.94.666 1.48 1.033 2.014.302.597.162.553.06.17h.105v-.097l.085-1.134.157-1.392.154-1.792.052-.504.25-.605.497-.327.387.186.319.456-.045.294-.19 1.23-.37 1.93-.243 1.29h.142l.161-.16.654-.868 1.097-1.372.484-.545.565-.601.363-.287h.686l.505.751-.226.775-.707.895-.585.759-.839 1.13-.524.904.048.072.125-.012 1.897-.403 1.024-.186 1.223-.21.553.258.06.263-.218.536-1.307.323-1.533.307-2.284.54-.028.02.032.04 1.029.098.44.024h1.077l2.005.15.525.346.315.424-.053.323-.807.411-3.631-.863-.872-.218h-.12v.073l.726.71 1.331 1.202 1.667 1.55.084.383-.214.302-.226-.032-1.464-1.101-.565-.497-1.28-1.077h-.084v.113l.295.432 1.557 2.34.08.718-.112.234-.404.141-.444-.08-.911-1.28-.94-1.44-.759-1.291-.093.053-.448 4.821-.21.246-.484.186-.403-.307-.214-.496.214-.98.258-1.28.21-1.016.19-1.263.112-.42-.008-.028-.092.012-.953 1.307-1.448 1.957-1.146 1.227-.274.109-.477-.247.045-.44.266-.39 1.586-2.018.956-1.25.617-.723-.004-.105h-.036l-4.212 2.736-.75.096-.324-.302.04-.496.154-.162 1.267-.871z"})})}function n({className:e}){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:e,children:(0,s.jsx)("path",{d:"M14.949 6.547a3.94 3.94 0 0 0-.348-3.273 4.11 4.11 0 0 0-4.4-1.934A4.1 4.1 0 0 0 8.423.2 4.15 4.15 0 0 0 6.305.086a4.1 4.1 0 0 0-1.891.948 4.04 4.04 0 0 0-1.158 1.753 4.1 4.1 0 0 0-1.563.679A4 4 0 0 0 .554 4.72a3.99 3.99 0 0 0 .502 4.731 3.94 3.94 0 0 0 .346 3.274 4.11 4.11 0 0 0 4.402 1.933c.382.425.852.764 1.377.995.526.231 1.095.35 1.67.346 1.78.002 3.358-1.132 3.901-2.804a4.1 4.1 0 0 0 1.563-.68 4 4 0 0 0 1.14-1.253 3.99 3.99 0 0 0-.506-4.716m-6.097 8.406a3.05 3.05 0 0 1-1.945-.694l.096-.054 3.23-1.838a.53.53 0 0 0 .265-.455v-4.49l1.366.778q.02.011.025.035v3.722c-.003 1.653-1.361 2.992-3.037 2.996m-6.53-2.75a2.95 2.95 0 0 1-.36-2.01l.095.057L5.29 12.09a.53.53 0 0 0 .527 0l3.949-2.246v1.555a.05.05 0 0 1-.022.041L6.473 13.3c-1.454.826-3.311.335-4.15-1.098m-.85-6.94A3.02 3.02 0 0 1 3.07 3.949v3.785a.51.51 0 0 0 .262.451l3.93 2.237-1.366.779a.05.05 0 0 1-.048 0L2.585 9.342a2.98 2.98 0 0 1-1.113-4.094zm11.216 2.571L8.747 5.576l1.362-.776a.05.05 0 0 1 .048 0l3.265 1.86a3 3 0 0 1 1.173 1.207 2.96 2.96 0 0 1-.27 3.2 3.05 3.05 0 0 1-1.36.997V8.279a.52.52 0 0 0-.276-.445m1.36-2.015-.097-.057-3.226-1.855a.53.53 0 0 0-.53 0L6.249 6.153V4.598a.04.04 0 0 1 .019-.04L9.533 2.7a3.07 3.07 0 0 1 3.257.139c.474.325.843.778 1.066 1.303.223.526.289 1.103.191 1.664zM5.503 8.575 4.139 7.8a.05.05 0 0 1-.026-.037V4.049c0-.57.166-1.127.476-1.607s.752-.864 1.275-1.105a3.08 3.08 0 0 1 3.234.41l-.096.054-3.23 1.838a.53.53 0 0 0-.265.455zm.742-1.577 1.758-1 1.762 1v2l-1.755 1-1.762-1z"})})}function r({className:e}){return(0,s.jsxs)("svg",{viewBox:"0 0 240 300",fill:"none",className:e,children:[(0,s.jsx)("path",{d:"M180 240H60V120H180V240Z",fill:"#CFCECD"}),(0,s.jsx)("path",{d:"M180 60H60V240H180V60ZM240 300H0V0H240V300Z",fill:"#211E1E"})]})}function i({className:e}){return(0,s.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:e,children:[(0,s.jsx)("path",{d:"M8 2C5.5 2 3.5 4 3.5 6.5S5 10.5 6.5 11v1.5H8V11c.3.1.7.1 1 0v1.5h1.5V11c1.5-.5 3-2.5 3-4.5S10.5 2 8 2Z",fill:"#E8453A"}),(0,s.jsx)("path",{d:"M3.5 5.5C2 5 1 6 1.5 7s2 .5 2.2-.7",fill:"#FF6B5A"}),(0,s.jsx)("path",{d:"M12.5 5.5c1.5-.5 2.5.5 2 1.5s-2 .5-2.2-.7",fill:"#FF6B5A"}),(0,s.jsx)("path",{d:"M6.5 3Q5 1.2 4.3 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,s.jsx)("path",{d:"M9.5 3Q11 1.2 11.7 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,s.jsx)("circle",{cx:"6.2",cy:"5.2",r:"0.9",fill:"#050810"}),(0,s.jsx)("circle",{cx:"9.8",cy:"5.2",r:"0.9",fill:"#050810"}),(0,s.jsx)("circle",{cx:"6.4",cy:"5",r:"0.3",fill:"#00E5CC"}),(0,s.jsx)("circle",{cx:"10",cy:"5",r:"0.3",fill:"#00E5CC"})]})}function l({className:e}){return(0,s.jsx)("img",{src:"data:image/webp;base64,UklGRuYDAABXRUJQVlA4INoDAADQEwCdASowADAAPm0uk0ckIiGhKrqpWIANiWkAEyQea/fD8IewvGL5V7Nb3H8u/MA8G9rT+4flL+UfIe42/23GB8zPqF/o3E0UAP5h/h/+F6ZX+x5evnX/r+4T/K/67/u/zg7znogfrusMANZLkn1gvlY/vNsKubtj/9xLSzxTsLr7K9GLdFNs5rwtISRcPXvH4z57n2fg0XR3aQ2D+pPpycwyl7TwAAD+/2DbjivnePzfyHCsdOgJXKlUR/OgAkofD7K4AdmsPKyP5Ml4/4HBYmIm5/efn/H+X3IZtngyaUOvwbFuRS/1yODFYO3vf3qeXGgPdfgIROXd/EPT7K2jysfvY9N71+w6g2gBPs+P6lxYkPf6S9QfpvH/7Pp7i8xRh0nVDBTEQyczSz7V9hoqo4nDJuii+SfibZRR/d5zB+9jkcb1DNN7YnC5Y7+WfGrE3eseXt3hSm+NS5++m1MHbjsrd9z/Q4HPRP/C85Po41XObalGyIUcFUL2j2n3uI/Yh6U8r6trCUJFB4kT3fsv6+8ylX/d96y2hq869FCXLjq4YqEO8vs5BtT52sf7KyDxPAWkH/b06YbfVXf4/7y5THL6Sr/4mOrrY9P2LW81f05HHFN8n0jcyqKOH7AluMm0AHPgFyz8RVrfBdmnPiC2FLMQfNDte5yGFzGC3fMlDed/tS/PO3Q/hjsNLvAXUUjqHyCo3JeN69jyNgWjjf8iUqoBsXT+lJyp2r8p60ad1jxhNyTblyJwda8aWEw1hFDeGjpMGguDF66RL4c+ZO+PhculC6WxvCsZ7IPAsdD7/ywx3w3AowJ66hAAK7k+m6X2QV06OVOCwyIGERex/AUyuBbLUK93X58+M+Si7YfYjVYGpoJ7JvSgD8ExaA21z9OY+si+1wreacDanKnFDmhwBQC3t6MLeXCOGp3VURDKl10K7tdKHQcb4hr48ba+1x/MrMRwHfq3IQrDIXPYCg4b0OLnVN9JyXttKGM63B5imIdKuU0r6hhSslT10lGLjnIJuwO5WKR0RHs+BX5vs6H63y3K7IuuZ1eRN+Aczvbs4QuDs6ZRuzjJ/1DJ5R/3ZrFPrtxvMwT06vAXIgcbhLGNLhOQUYRPdUN5MgyCtL5NH71ArTPLRRkIjhGwoCYXKKqlqIKKT9NX3vwp/nlh4SX71dlYg/mPXbJ9bMeVugyjqFahjFTJ/rT3HtBCWG8h+OvvbOFDFKurCG9BOhO9B719OS7zsP0KPqoymnv7hVvoJyZp0iziCbBvaJpmF9Cvfs8/vWqWr7TUo616WfMW+X9nkgpuqtnfAAAAAA==",alt:"Hermes",className:`${e} rounded-sm`})}function d({className:e}){return(0,s.jsxs)("svg",{viewBox:"0 0 800 800",fill:"none",className:e,children:[(0,s.jsx)("rect",{width:"800",height:"800",rx:"150",fill:"#09090b"}),(0,s.jsx)("path",{fill:"#fff",fillRule:"evenodd",d:"M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z"}),(0,s.jsx)("path",{fill:"#fff",d:"M517.36 400H634.72V634.72H517.36Z"})]})}function o({className:e}){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:e,children:(0,s.jsx)("path",{d:"M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"})})}function c({className:e}){return(0,s.jsxs)("svg",{viewBox:"600 300 400 400",fill:"none",className:e,children:[(0,s.jsx)("path",{fill:"#14120B",d:"M999.994 554.294C999.994 559.859 999.994 565.419 999.962 570.984C999.935 575.67 999.882 580.357 999.753 585.038C999.475 595.247 998.875 605.542 997.059 615.639C995.217 625.88 992.212 635.409 987.477 644.718C982.822 653.861 976.738 662.233 969.485 669.491C962.227 676.748 953.861 682.828 944.712 687.482C935.409 692.217 925.875 695.222 915.633 697.065C905.537 698.88 895.242 699.48 885.033 699.759C880.346 699.887 875.665 699.941 870.978 699.968C865.413 700.005 859.853 700 854.288 700H745.695C740.13 700 734.571 700 729.005 699.968C724.319 699.941 719.632 699.887 714.951 699.759C704.742 699.48 694.447 698.88 684.35 697.065C674.109 695.222 664.58 692.217 655.271 687.482C646.128 682.828 637.756 676.743 630.499 669.491C623.241 662.233 617.161 653.866 612.507 644.718C607.772 635.414 604.767 625.88 602.925 615.639C601.109 605.542 600.509 595.247 600.23 585.038C600.102 580.352 600.048 575.67 600.021 570.984C600 565.419 600 559.859 600 554.294V445.701C600 440.136 600 434.576 600.032 429.011C600.059 424.324 600.112 419.637 600.241 414.956C600.52 404.747 601.119 394.452 602.935 384.356C604.778 374.115 607.783 364.586 612.518 355.277C617.172 346.133 623.257 337.762 630.509 330.504C637.767 323.246 646.133 317.167 655.282 312.512C664.586 307.777 674.12 304.772 684.361 302.93C694.458 301.114 704.752 300.514 714.961 300.236C719.648 300.107 724.329 300.054 729.016 300.027C734.576 300 740.136 300 745.701 300H854.294C859.859 300 865.419 300 870.984 300.032C875.67 300.059 880.357 300.112 885.038 300.241C895.247 300.52 905.542 301.119 915.639 302.935C925.88 304.778 935.409 307.783 944.718 312.518C953.861 317.172 962.233 323.257 969.491 330.509C976.748 337.767 982.828 346.133 987.482 355.282C992.217 364.586 995.222 374.12 997.065 384.361C998.88 394.458 999.48 404.752 999.759 414.961C999.887 419.648 999.941 424.329 999.968 429.016C1000.01 434.581 1000 440.141 1000 445.706V554.299L999.994 554.294Z"}),(0,s.jsx)("path",{fill:"#72716D",d:"M800.004 500L923.821 571.486C923.061 572.804 921.957 573.929 920.591 574.716L804.863 641.531C801.858 643.266 798.151 643.266 795.146 641.531L679.417 574.716C678.052 573.929 676.948 572.804 676.188 571.486L800.004 500Z"}),(0,s.jsx)("path",{fill:"#55544F",d:"M800.005 357.168V500L676.188 571.486C675.427 570.168 675.004 568.647 675.004 567.072V432.928C675.004 429.774 676.686 426.865 679.418 425.285L795.141 358.47C796.646 357.602 798.323 357.168 799.999 357.168H800.005Z"}),(0,s.jsx)("path",{fill:"#43413C",d:"M923.815 428.515C923.055 427.197 921.951 426.072 920.586 425.285L804.857 358.47C803.357 357.602 801.68 357.168 800.004 357.168V500L923.821 571.486C924.581 570.168 925.005 568.647 925.005 567.072V432.928C925.005 431.348 924.587 429.838 923.821 428.515H923.815Z"}),(0,s.jsx)("path",{fill:"#D6D5D2",d:"M915.156 433.518C915.857 434.728 915.954 436.281 915.156 437.663L802.764 632.323C802.008 633.641 800 633.1 800 631.584V503.311C800 502.287 799.727 501.302 799.229 500.44L915.15 433.512H915.156V433.518Z"}),(0,s.jsx)("path",{fill:"white",d:"M915.155 433.518L799.233 500.445C798.741 499.588 798.023 498.86 797.134 498.345L686.049 434.209C684.731 433.453 685.272 431.445 686.788 431.445H911.566C913.162 431.445 914.459 432.307 915.155 433.518Z"})]})}function u({className:e}){return(0,s.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:e,children:[(0,s.jsx)("path",{d:"M12 24C12 18.2 12 15.5 10.1 13.9C8.5 12 5.8 12 0 12C5.8 12 8.5 12 10.1 10.1C12 8.5 12 5.8 12 0C12 5.8 12 8.5 13.9 10.1C15.5 12 18.2 12 24 12C18.2 12 15.5 12 13.9 13.9C12 15.5 12 18.2 12 24Z",fill:"url(#gemini-gradient)"}),(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:"gemini-gradient",x1:"0",y1:"0",x2:"24",y2:"24",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#4285F4"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#886FBF"})]})})]})}e.s(["ProviderLogo",0,function({provider:e,className:m="h-4 w-4"}){switch(e){case"claude":return(0,s.jsx)(a,{className:m});case"codex":return(0,s.jsx)(n,{className:m});case"opencode":return(0,s.jsx)(r,{className:m});case"openclaw":return(0,s.jsx)(i,{className:m});case"hermes":return(0,s.jsx)(l,{className:m});case"pi":return(0,s.jsx)(d,{className:m});case"copilot":return(0,s.jsx)(o,{className:m});case"cursor":return(0,s.jsx)(c,{className:m});case"gemini":return(0,s.jsx)(u,{className:m});default:return(0,s.jsx)(t.Monitor,{className:m})}}])},371406,e=>{"use strict";var s=e.i(368075),t=e.i(298699),a=e.i(186339),n=e.i(575607),r=e.i(880932),i=e.i(613349);function l({step:e,completed:t}){return t?(0,s.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-emerald-500 text-white transition-all duration-300",children:(0,s.jsx)(n.Check,{className:"size-3",strokeWidth:3})}):(0,s.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-foreground text-background text-xs font-semibold",children:e})}e.s(["ConnectMachineSteps",0,function({generatedToken:e,generatingToken:n,onGenerateToken:d,registered:o}){let c=(0,t.useRef)(!1);(0,t.useEffect)(()=>{e||n||c.current||(c.current=!0,d())},[e,n,d]);let u=()=>{navigator.clipboard.writeText(`${(0,i.cliCmd)()} register --token ${e}`),r.toast.success("Copied to clipboard")},m=`${(0,i.cliCmd)()} daemon start`,x=()=>{navigator.clipboard.writeText(m),r.toast.success("Copied to clipboard")};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,s.jsx)(l,{step:1,completed:o}),"Register your CLI",o&&(0,s.jsx)("span",{className:"text-xs text-emerald-500 font-normal",children:"Done"})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"Run this in your terminal to link your machine."}),n?(0,s.jsx)("div",{className:"pl-7",children:(0,s.jsx)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground animate-pulse",children:"Generating token..."})}):e?(0,s.jsxs)("div",{className:"pl-7 space-y-2",children:[(0,s.jsxs)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors break-all",onClick:u,title:"Click to copy",children:[(0,i.cliCmd)()," register --token"," ",(0,s.jsx)("span",{className:"text-foreground/70",children:e})]}),!o&&(0,s.jsx)(a.Button,{size:"sm",onClick:u,className:"w-full",children:"Copy Command"})]}):null]}),(0,s.jsxs)("div",{className:`space-y-2 transition-opacity duration-300 ${!o?"opacity-40 pointer-events-none":""}`,children:[(0,s.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,s.jsx)(l,{step:2,completed:!1}),"Start the daemon"]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"The daemon connects your local agents to Alook."}),(0,s.jsx)("div",{className:"ml-7 rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors",onClick:x,title:"Click to copy",children:m}),o&&(0,s.jsx)("div",{className:"pl-7",children:(0,s.jsx)(a.Button,{size:"sm",onClick:x,className:"w-full",children:"Copy Command"})})]})]})}])},7374,e=>{"use strict";var s=e.i(368075),t=e.i(298699),a=e.i(208020),n=e.i(355578),r=e.i(186339),i=e.i(875061),l=e.i(934351),d=e.i(332680),o=e.i(393153),c=e.i(880932),u=e.i(728886),m=e.i(609049),x=e.i(877942);e.i(954194);var h=e.i(907903),p=e.i(613349),f=e.i(855372),g=e.i(222862),C=e.i(858924),j=e.i(695554),v=e.i(371406);e.s(["default",0,function(){let{agents:e,runtimes:N,loading:b,handleGenerateToken:y,handleDeleteMachine:w,subscribeWs:S,workspaceId:k}=(0,n.useAgentContext)(),A=(0,a.useSearchParams)(),L=(0,a.useRouter)(),z=(0,a.usePathname)(),[R,B]=(0,t.useState)(()=>A.has("connect")),[M,H]=(0,t.useState)(""),[V,D]=(0,t.useState)(!1),[F,P]=(0,t.useState)(!1),[T,U]=(0,t.useState)(null),[O,I]=(0,t.useState)(new Set),[K,X]=(0,t.useState)(new Set),[G,Z]=(0,t.useState)(!1),[E,Y]=(0,t.useState)(""),[_,q]=(0,t.useState)(""),[J,Q]=(0,t.useState)("Remove"),[W,$]=(0,t.useState)(void 0),[ee,es]=(0,t.useState)("destructive"),[et,ea]=(0,t.useState)(!1),en=(0,t.useRef)(null);(0,t.useEffect)(()=>{(0,g.fetchLatestCliVersion)().then(e=>U(e.version)).catch(()=>{})},[]),(0,t.useEffect)(()=>{A.has("connect")&&L.replace(z,{scroll:!1})},[A,L,z]);let er=(0,t.useRef)(R);(0,t.useEffect)(()=>{er.current=R},[R]);let ei=(0,t.useRef)(e);(0,t.useEffect)(()=>{ei.current=e},[e]),(0,t.useEffect)(()=>S(e=>{if(er.current&&("runtime.registered"===e.type&&e.workspaceId===k&&P(!0),"runtime.status"===e.type&&e.workspaceId===k&&"online"===e.status)&&(B(!1),H(""),P(!1),c.toast.success("Machine connected"),0===ei.current.length)){let e=z.split("/")[2];L.push(`/w/${e}/agents/new`)}}),[S,k,z,L]);let el=(e,s,t,a)=>{Y(e),q(s),Q(a?.label??"Remove"),$(a?.loadingLabel),es(a?.variant??"destructive"),en.current=t,Z(!0)},ed=async()=>{if(en.current){ea(!0);try{await en.current()}finally{ea(!1),Z(!1),en.current=null}}},eo=(0,t.useCallback)(async()=>{D(!0);try{let e=await y();e&&H(e)}finally{D(!1)}},[y]),ec=async(e,s)=>{I(e=>new Set(e).add(s));try{await (0,g.triggerRuntimeUpdate)(e,k),c.toast.success("Update triggered")}catch{c.toast.error("Failed to trigger update"),I(e=>{let t=new Set(e);return t.delete(s),t})}},eu=async(e,s)=>{X(e=>new Set(e).add(s));try{await (0,g.triggerRuntimeRescan)(e,k),c.toast.success("Rescan triggered — daemon will restart to detect runtimes")}catch{c.toast.error("Failed to trigger rescan"),X(e=>{let t=new Set(e);return t.delete(s),t})}},em=(0,t.useMemo)(()=>{if(0===O.size)return O;let e=new Set;for(let s of N){let t=s.daemon_id||s.id;O.has(t)&&s.pending_update_version&&e.add(t)}return e},[N,O]),ex=(0,t.useMemo)(()=>{if(0===K.size)return K;let e=new Set;for(let s of N){let t=s.daemon_id||s.id;K.has(t)&&s.pending_rescan&&e.add(t)}return e},[N,K]),eh=new Map;for(let e of N){let s=e.daemon_id||e.id;if(!eh.has(s)){let t=e.metadata;eh.set(s,{deviceInfo:"string"==typeof e.device_info?e.device_info:"",status:e.status,lastSeenAt:e.last_seen_at,pendingUpdateVersion:e.pending_update_version??null,pendingRescan:!!e.pending_rescan,cliVersion:t?.cli_version??null,runtimes:[]})}eh.get(s).runtimes.push(e)}return b?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(u.Skeleton,{className:"h-4 w-16"}),(0,s.jsx)(u.Skeleton,{className:"h-3 w-52"})]}),(0,s.jsx)(u.Skeleton,{className:"h-8 w-29 rounded-md"})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:3}).map((e,t)=>(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u.Skeleton,{className:"size-4 rounded"}),(0,s.jsx)(u.Skeleton,{className:"h-4 w-28"})]}),(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(u.Skeleton,{className:"h-3 w-20"}),(0,s.jsx)(u.Skeleton,{className:"h-3 w-28"})]}),(0,s.jsx)(u.Skeleton,{className:"h-5 w-14 rounded-full"})]})})]},t))})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h1",{className:"text-sm font-medium",children:"Runtimes"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your machines and their agent runtimes."})]}),(0,s.jsxs)(r.Button,{size:"sm",variant:"outline",onClick:()=>{H(""),P(!1),B(!0)},disabled:V,children:[(0,s.jsx)(x.Plus,{className:"size-3.5"}),"New machine"]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:0===N.length?(0,s.jsx)("div",{className:"flex flex-1 items-center justify-center min-h-[60vh]",children:(0,s.jsxs)("div",{className:"text-center animate-[fade-up_400ms_ease-out_both]",children:[(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"Connect a machine to start running agents locally."}),(0,s.jsx)(r.Button,{size:"sm",className:"mt-4 glow-border",onClick:()=>{H(""),B(!0)},children:"Connect Machine"})]})}):(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from(eh.entries()).map(([e,t])=>{let a,n,d,o=t.deviceInfo||e;return(0,s.jsxs)(l.Card,{size:"sm",children:[(0,s.jsx)(l.CardHeader,{children:(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)(m.Monitor,{className:"size-4 text-muted-foreground shrink-0"}),(0,s.jsx)(l.CardTitle,{className:"truncate",children:o}),t.cliVersion&&(0,s.jsxs)("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:["v",t.cliVersion]}),(0,s.jsx)(i.Badge,{variant:"online"===t.status?"default":"outline",className:"shrink-0",children:t.status})]})}),(0,s.jsx)(l.CardContent,{children:(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:t.lastSeenAt?new Date(t.lastSeenAt).toLocaleString():"Never seen"}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(a=!!t.pendingUpdateVersion||em.has(e),n=T&&(!t.cliVersion||!(0,h.semverGte)(t.cliVersion,T)),a?(0,s.jsxs)(r.Button,{variant:"ghost",size:"sm",disabled:!0,className:"text-xs h-6 px-2",children:[(0,s.jsx)(C.Loader2,{className:"size-3 animate-spin mr-1"}),"Updating..."]}):n?(0,s.jsx)(r.Button,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:()=>el("Update daemon",`This will update the daemon on "${o}" to the latest CLI version. The daemon will restart during the update.`,async()=>{await ec(t.runtimes[0].id,e)},{label:"Update",loadingLabel:"Updating...",variant:"default"}),children:"Update"}):null),(d=t.pendingRescan||ex.has(e),"online"!==t.status?null:d?(0,s.jsxs)(r.Button,{variant:"ghost",size:"sm",disabled:!0,className:"text-xs h-6 px-2",children:[(0,s.jsx)(j.RefreshCw,{className:"size-3 animate-spin mr-1"}),"Rescanning..."]}):(0,s.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:()=>el("Rescan runtimes",`This will restart the daemon on "${o}" to re-detect available runtimes (Claude Code, Codex, OpenCode).`,async()=>{await eu(t.runtimes[0].id,e)},{label:"Rescan",loadingLabel:"Triggering...",variant:"default"}),children:[(0,s.jsx)(j.RefreshCw,{className:"size-3 mr-1"}),"Rescan"]})),(0,s.jsx)(r.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-6 px-2 hover:text-destructive",onClick:()=>{el("Remove machine",`This will remove "${o}" and all its runtimes. Agents using these runtimes will be unlinked.`,async()=>{await w(e)})},children:"Remove"})]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.runtimes.map(e=>(0,s.jsxs)(i.Badge,{variant:"secondary",className:"gap-1.5",children:[(0,s.jsx)(f.ProviderLogo,{provider:e.provider,className:"h-3.5 w-3.5"}),e.provider,e.metadata?.version?(0,s.jsx)("span",{className:"text-muted-foreground font-normal",children:String(e.metadata.version)}):null]},e.id))}),"online"!==t.status&&(0,s.jsxs)("div",{className:"pt-1.5 border-t border-border/50",children:[(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground mb-1.5",children:"Bring this machine online:"}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-md bg-muted px-2.5 py-1.5 font-mono text-[11px] text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors",onClick:()=>{navigator.clipboard.writeText(`${(0,p.cliCmd)()} daemon start`),c.toast.success("Copied to clipboard")},title:"Click to copy",children:[(0,s.jsx)("span",{className:"absolute inset-0 -translate-x-full animate-[shimmer_2.5s_infinite] bg-linear-to-r from-transparent via-(--shimmer-peak) to-transparent"}),(0,s.jsxs)("span",{className:"relative",children:[(0,p.cliCmd)()," daemon start"]})]})]})]})})]},e)})})}),(0,s.jsx)(d.Sheet,{open:R,onOpenChange:e=>{B(e),e||H("")},children:(0,s.jsxs)(d.SheetContent,{className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,s.jsxs)(d.SheetHeader,{children:[(0,s.jsx)(d.SheetTitle,{children:"Connect a machine"}),(0,s.jsx)(d.SheetDescription,{children:"Your machine runs AI agents locally using Claude Code, Codex, or OpenCode."})]}),(0,s.jsx)(d.SheetBody,{children:(0,s.jsx)(v.ConnectMachineSteps,{generatedToken:M,generatingToken:V,onGenerateToken:eo,registered:F})})]})}),(0,s.jsx)(o.ConfirmDialog,{open:G,onOpenChange:Z,title:E,description:_,confirmLabel:J,loadingLabel:W,confirmVariant:ee,loading:et,onConfirm:ed})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,500324,e=>{"use strict";var t=e.i(368075),a=e.i(298699);let r=(0,a.createContext)(null);e.s(["WorkspaceProvider",0,function({workspaceId:e,slug:n,children:s}){return(0,a.useEffect)(()=>{try{localStorage.setItem("lastWorkspace",n)}catch{}},[n]),(0,t.jsx)(r.Provider,{value:{workspaceId:e,slug:n},children:s})},"useWorkspace",0,function(){let e=(0,a.useContext)(r);if(!e)throw Error("useWorkspace must be used within WorkspaceProvider");return e}])},222862,636557,e=>{"use strict";class t extends Error{status;details;constructor(e,t,a){super(e),this.name="ApiError",this.status=t,this.details=a}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function a(e,t){return"validation error"===e&&t?.length?function(e){let[t,...a]=e.split(":"),r=a.join(":").trim();if(!r)return e;let n=t.trim(),s=n.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),i=r.replace(/^required$/i,"is required"),o=i.toLowerCase().replace(/[_-]+/g," "),l=n.toLowerCase().replace(/[_-]+/g," ");return l&&o.startsWith(`${l} `)&&(i=i.slice(n.length).trimStart()),s?`${s} ${i}`:i}(t[0]):e}async function r(e,r){let n;try{n=await fetch(""+e,{...r,credentials:"include",headers:{"Content-Type":"application/json",...r?.headers}})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!n.ok){let e,r;try{let t=await n.json();e=t.error,r=t.details}catch{}if(429===n.status)throw new t("Please wait a moment before trying again",429);if(n.status>=500)throw new t(a(e,r)||"Something went wrong — please try again",n.status,r);throw new t(a(e,r)||"Something went wrong",n.status,r)}if(204!==n.status)return n.json()}function n(e,t){let a=new URLSearchParams({workspace_id:e,...t});return`?${a.toString()}`}e.s(["ApiError",0,t],636557);let s=async(e,a,s,i)=>{let o;if(!i||0===i.length)return r(`/api/conversations/${e}/messages${n(s)}`,{method:"POST",body:JSON.stringify({content:a})});let l=new FormData;for(let e of(l.append("content",a),i))l.append("file",e);try{o=await fetch(`/api/conversations/${e}/messages${n(s)}`,{method:"POST",credentials:"include",body:l})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===o.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!o.ok){let e,a;try{let t=await o.json();e=t.error,a=t.details}catch{}if(429===o.status)throw new t("Please wait a moment before trying again",429);if(o.status>=500)throw new t(e||"Something went wrong — please try again",o.status,a);throw new t(e||"Something went wrong",o.status,a)}return o.json()},i=async(e,a,s,i)=>{let o;if(!i||0===i.length)return r(`/api/conversations/${e}/buffered-messages${n(s)}`,{method:"POST",body:JSON.stringify({content:a})});let l=new FormData;for(let e of(l.append("content",a),i))l.append("file",e);try{o=await fetch(`/api/conversations/${e}/buffered-messages${n(s)}`,{method:"POST",credentials:"include",body:l})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===o.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!o.ok){let e,a;try{let t=await o.json();e=t.error,a=t.details}catch{}if(429===o.status)throw new t(e||"Maximum follow-ups reached",429);if(o.status>=500)throw new t(e||"Something went wrong — please try again",o.status,a);throw new t(e||"Something went wrong",o.status,a)}return o.json()},o=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/email/${e}/body?${a}`,{credentials:"include"});if(!r.ok)return{content:"(body not available)",isHtml:!1};let n=r.headers.get("Content-Type")??"";return{content:await r.text(),isHtml:n.includes("text/html")}},l=async(e,a)=>{let r=new FormData;r.append("file",e);let s=await fetch(`/api/email/upload${n(a)}`,{method:"POST",credentials:"include",body:r});if(!s.ok)throw new t(await s.text().catch(()=>"Upload failed"),s.status);return s.json()},d=async(e,a)=>{let s;if(!a.files||0===a.files.length)return r(`/api/issues${n(e)}`,{method:"POST",body:JSON.stringify({agent_id:a.agent_id,title:a.title,description:a.description})});let i=new FormData;for(let e of(a.agent_id&&i.append("agent_id",a.agent_id),i.append("title",a.title),i.append("description",a.description??""),a.files))i.append("file",e);try{s=await fetch(`/api/issues${n(e)}`,{method:"POST",credentials:"include",body:i})}catch(e){if(e instanceof TypeError)throw new t("Unable to connect — check your network",0);throw e}if(401===s.status)throw window.location.href="/sign-in",new t("Unauthorized",401);if(!s.ok){let e,a;try{let t=await s.json();e=t.error,a=t.details}catch{}if(429===s.status)throw new t("Please wait a moment before trying again",429);if(s.status>=500)throw new t(e||"Something went wrong — please try again",s.status,a);throw new t(e||"Something went wrong",s.status,a)}return s.json()},c=async(e,t)=>{let a=new URLSearchParams({workspace_id:t}),r=await fetch(`/api/artifacts/${e}/content?${a}`,{credentials:"include"});return r.ok?r.text():"(content not available)"};e.s(["acceptInvite",0,e=>r(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,a)=>r(`/api/agents/${e}/whitelist${n(a)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,a)=>r(`/api/agents/${e}/meetings/${t}/approve${n(a)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>r(`/api/conversations/${e}/active-task${n(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,a)=>r(`/api/agents/${e}/chat-init${n(t)}`,{method:"POST",body:JSON.stringify({...a?{channel:a}:{}})}),"createAgent",0,(e,t)=>r(`/api/agents${n(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>r(`/api/agent-links${n(t)}`,{method:"POST",body:JSON.stringify(e)}),"createBufferedMessage",0,i,"createCalendarEvent",0,(e,t)=>r(`/api/calendar${n(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>r(`/api/channels${n(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,a)=>r(`/api/conversations${n(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...a?{channel:a}:{}})}),"createEmailAccount",0,(e,t,a)=>r(`/api/agents/${e}/email-accounts${n(a)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>r(`/api/workspaces/${e}/invites${n(e)}`,{method:"POST"}),"createIssue",0,d,"createMachineToken",0,(e,t)=>r(`/api/machine-tokens${t?n(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,a)=>r(`/api/agents/${e}/meetings${n(t)}`,{method:"POST",body:JSON.stringify(a)}),"deleteAgent",0,(e,t)=>r(`/api/agents/${e}${n(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>r(`/api/agent-links/${e}${n(t)}`,{method:"DELETE"}),"deleteBufferedMessage",0,(e,t,a)=>r(`/api/conversations/${e}/buffered-messages/${t}${n(a)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,a)=>r(`/api/calendar/${e}${n(t)}`,{method:"DELETE",...a&&a.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}:{}}),"deleteChannelApi",0,(e,t)=>r(`/api/channels/${e}${n(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>r(`/api/email/${e}${n(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,a)=>r(`/api/agents/${e}/email-accounts/${t}${n(a)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>r(`/api/issues/${t}${n(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>r(`/api/runtimes/machine${n(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,a)=>r(`/api/agents/${e}/meetings/${t}${n(a)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>r(`/api/workspaces/${e}${n(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>r("/api/cli/latest-version"),"fetchModelOptions",0,()=>r("/api/config/model-options"),"getActiveTask",0,(e,t)=>r(`/api/conversations/${e}/active-task${n(t)}`),"getArtifactContent",0,c,"getConversation",0,(e,t)=>r(`/api/conversations/${e}${n(t)}`),"getEmail",0,(e,t)=>r(`/api/email/${e}${n(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>r(`/api/email/${e}/thread${n(t)}`),"getInboxCount",0,e=>r(`/api/inbox/count${n(e)}`),"getInviteInfo",0,e=>r(`/api/invite/${e}`),"getIssue",0,(e,t)=>r(`/api/issues/${t}${n(e)}`),"getMemberMe",0,e=>r(`/api/members/me${n(e)}`),"getMinCliVersion",0,()=>r("/api/config/min-version"),"getTask",0,(e,t)=>r(`/api/tasks/${e}${n(t)}`),"getTaskMessages",0,(e,t,a)=>r(`/api/tasks/${e}/messages${n(t,a?{since:String(a)}:void 0)}`),"getTaskStepCounts",0,(e,t)=>r(`/api/tasks/step-counts${n(t)}`,{method:"POST",body:JSON.stringify({task_ids:e})}),"getTrace",0,(e,t)=>r(`/api/traces/${e}${n(t)}`),"getWorkspaceOverview",0,e=>r(`/api/workspaces/${e}/overview${n(e)}`),"grantAgentAccess",0,(e,t,a)=>r(`/api/agents/${t}/access${n(e)}`,{method:"POST",body:JSON.stringify({user_id:a})}),"listAgentAccess",0,(e,t)=>r(`/api/agents/${t}/access${n(e)}`),"listAgentActiveTaskCounts",0,e=>r(`/api/agents/active-task-counts${n(e)}`),"listAgentActivity",0,(e,t,a)=>{let s={};return a?.limit&&(s.limit=String(a.limit)),a?.before&&(s.before=a.before),a?.beforeId&&(s.before_id=a.beforeId),a?.status&&(s.status=a.status),a?.type&&(s.type=a.type),r(`/api/agents/${e}/activity${n(t,s)}`)},"listAgentLinks",0,e=>r(`/api/agent-links${n(e)}`),"listAgentPins",0,e=>r(`/api/agents/pins${n(e)}`),"listAgents",0,e=>r(`/api/agents${n(e)}`),"listArtifacts",0,(e,t)=>r(`/api/artifacts${n(t,{conversation_id:e})}`),"listBufferedMessages",0,(e,t)=>r(`/api/conversations/${e}/buffered-messages${n(t)}`),"listCalendarEvents",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.from&&(a.from=t.from),t?.to&&(a.to=t.to),r(`/api/calendar${n(e,a)}`)},"listChannels",0,e=>r(`/api/channels${n(e)}`),"listEmailAccounts",0,(e,t)=>r(`/api/agents/${e}/email-accounts${n(t)}`),"listEmails",0,(e,t,a,s)=>r(`/api/email${n(t,{agentId:e,...a?{folder:a}:{},...s?{address:s}:{}})}`),"listInboxItems",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),r(`/api/inbox${n(e,a)}`)},"listInvites",0,e=>r(`/api/workspaces/${e}/invites${n(e)}`),"listIssues",0,(e,t)=>{let a={};return t?.agentId&&(a.agentId=t.agentId),t?.status&&(a.status=t.status),t?.terminal!==void 0&&(a.terminal=String(t.terminal)),r(`/api/issues${n(e,a)}`)},"listMeetings",0,(e,t)=>r(`/api/agents/${e}/meetings${n(t)}`),"listMembers",0,e=>r(`/api/workspaces/${e}/members${n(e)}`),"listMessages",0,(e,t,a)=>{let s={};return a?.limit&&(s.limit=String(a.limit)),a?.before&&(s.before=a.before),a?.beforeId&&(s.before_id=a.beforeId),r(`/api/conversations/${e}/messages${n(t,s)}`)},"listMessagesAroundTask",0,(e,t,a)=>r(`/api/conversations/${e}/messages${n(t,{around_task:a})}`),"listPreviousConversations",0,(e,t,a)=>{let s={exclude:a.exclude,before:a.before};return a.channel&&(s.channel=a.channel),a.limit&&(s.limit=String(a.limit)),r(`/api/agents/${e}/conversations${n(t,s)}`)},"listRuntimes",0,e=>r(`/api/runtimes${n(e)}`),"listTraces",0,(e,t)=>{let a={};return t?.limit&&(a.limit=String(t.limit)),t?.before&&(a.before=t.before),t?.status&&(a.status=t.status),t?.multiAgent&&(a.multiAgent="true"),t?.agentId&&(a.agentId=t.agentId),t?.channel&&(a.channel=t.channel),r(`/api/traces${n(e,a)}`)},"listWhitelist",0,(e,t)=>r(`/api/agents/${e}/whitelist${n(t)}`),"listWorkspaceActiveTasks",0,e=>r(`/api/agents/active-tasks${n(e)}`),"listWorkspaces",0,()=>r("/api/workspaces"),"markAllInboxRead",0,e=>r(`/api/inbox/read-all${n(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>r(`/api/inbox/read${n(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>r(`/api/agents/${t}/pin${n(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>r(`/api/workspaces/${e}/members/${t}${n(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,a)=>r(`/api/agents/${e}/whitelist/${t}${n(a)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,a)=>r(`/api/channels/${e}${n(t)}`,{method:"PATCH",body:JSON.stringify({name:a})}),"reorderAgentPins",0,(e,t)=>r(`/api/agents/pins/reorder${n(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>r(`/api/agents/sidebar/reorder${n(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,a,s)=>r(`/api/agents/${e}/workspace/browse${n(t)}`,{method:"POST",body:JSON.stringify({request_type:a,path:s})}),"retryTask",0,(e,t)=>r(`/api/tasks/${e}/retry${n(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,a,s=!1)=>r(`/api/agents/${t}/access/${a}${n(e)}${s?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>r(`/api/workspaces/${e}/invites/${t}${n(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,a,s,i,o,l,d)=>r(`/api/email/send${n(i)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:a,htmlBody:s,attachments:o,...l,customAccountId:d})}),"sendMessage",0,s,"stopMeeting",0,(e,t,a)=>r(`/api/agents/${e}/meetings/${t}/stop${n(a)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,a)=>r(`/api/agents/${e}/email-accounts/${t}/sync${n(a)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>r(`/api/runtimes/${e}/rescan${n(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>r(`/api/runtimes/${e}/update${n(t)}`,{method:"POST"}),"unpinAgent",0,(e,t)=>r(`/api/agents/${t}/pin${n(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,a)=>r(`/api/agents/${e}${n(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,a)=>r(`/api/agent-links/${e}${n(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,a)=>r(`/api/calendar/${e}${n(a)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,a)=>r(`/api/email/${e}${n(t)}`,{method:"PATCH",body:JSON.stringify({status:a})}),"updateIssue",0,(e,t,a)=>r(`/api/issues/${t}${n(e)}`,{method:"PATCH",body:JSON.stringify(a)}),"updateMemberMe",0,(e,t)=>r(`/api/members/me${n(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>r(`/api/workspaces/${e}${n(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,l],222862)},728886,e=>{"use strict";var t=e.i(368075),a=e.i(613349);e.s(["Skeleton",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...r})}])},642342,e=>{"use strict";var t=e.i(459119),a=e.i(298699);let r=(0,e.i(613349).isLocalMode)(),n=Number(t.default.env.NEXT_PUBLIC_WS_DO_PORT)||8789,s=Number(t.default.env.NEXT_PUBLIC_WS_RECONNECT_DELAY_MS)||1e3,i=Number(t.default.env.NEXT_PUBLIC_WS_RECONNECT_MAX_DELAY_MS)||3e4;e.s(["useUserWs",0,function(e){let t=(0,a.useRef)(null),o=(0,a.useRef)(s),l=(0,a.useRef)(e),d=(0,a.useRef)(null);(0,a.useEffect)(()=>{l.current=e},[e]);let c=(0,a.useRef)(null),u=(0,a.useCallback)(()=>{let e=Math.min(o.current,i);o.current=Math.min(2*e,i),d.current=setTimeout(()=>{c.current?.()},e+500*Math.random())},[]),p=(0,a.useCallback)(async()=>{let e,a,i;try{let t=await fetch("/api/ws/token");if(!t.ok){console.warn("[ws] token fetch failed:",t.status),u();return}let r=await t.json();e=r.userId,a=r.token}catch(e){console.warn("[ws] token fetch error:",e),u();return}let d=r?`ws://localhost:${n}/?userId=${e}`:`${location.origin.replace("http","ws")}/api/ws/user?userId=${e}`;try{i=new WebSocket(d)}catch(e){console.warn("[ws] WebSocket creation failed:",e),u();return}t.current=i,i.onopen=()=>{o.current=s,i.send(JSON.stringify({type:"auth",token:a}))},i.onmessage=e=>{try{let t=JSON.parse(e.data);if("auth.ok"===t.type)return;l.current(t)}catch{}},i.onerror=()=>{},i.onclose=()=>{i===t.current&&u()}},[u]);(0,a.useEffect)(()=>{c.current=p},[p]),(0,a.useEffect)(()=>(p(),()=>{null!==d.current&&(clearTimeout(d.current),d.current=null);let e=t.current;t.current=null,e?.close()}),[p])}])},355578,e=>{"use strict";var t=e.i(368075),a=e.i(298699),r=e.i(222862),n=e.i(880932),s=e.i(642342);let i=(0,a.createContext)(null);e.s(["AgentProvider",0,function({workspaceId:e,children:o}){let[l,d]=(0,a.useState)([]),[c,u]=(0,a.useState)([]),[p,g]=(0,a.useState)(!0),[m,f]=(0,a.useState)({}),[h,v]=(0,a.useState)([]),b=(0,a.useRef)(!1),[y,x]=(0,a.useState)([]),[w,k]=(0,a.useState)(new Map),[$,S]=(0,a.useState)(new Map),T=(0,a.useRef)(!1),N=(0,a.useRef)(new Set),E=(0,a.useRef)(!0),C=(0,a.useCallback)(e=>(N.current.add(e),()=>{N.current.delete(e)}),[]),j=(0,a.useRef)(!1),A=(0,a.useCallback)(async()=>{if(!j.current){j.current=!0;try{if(b.current){let t=await (0,r.listWorkspaceActiveTasks)(e);if(!E.current)return;v(t.tasks);let a={};for(let e of t.tasks)a[e.agent_id]=(a[e.agent_id]??0)+1;f(a),b.current=t.tasks.length>0}else{let t=await (0,r.listAgentActiveTaskCounts)(e);if(!E.current)return;if(f(t.counts),Object.values(t.counts).some(e=>e>0)){b.current=!0;let t=await (0,r.listWorkspaceActiveTasks)(e);E.current&&v(t.tasks)}else v([])}}catch{}finally{j.current=!1}}},[e]);(0,a.useEffect)(()=>{E.current=!0,A();let e=setInterval(A,5e3);return()=>{E.current=!1,clearInterval(e)}},[A]);let P=(0,a.useCallback)(async()=>{try{let[t,a,n,s]=await Promise.all([(0,r.listAgents)(e),(0,r.listRuntimes)(e),(0,r.listAgentPins)(e),(0,r.listAgentLinks)(e)]);d(t),u(a),x(s),k(new Map(n.pins.map(e=>[e.agent_id,{created_at:e.created_at,position:e.position}]))),S(new Map(n.sidebar_order.map(e=>[e.agent_id,e.position])))}catch(e){n.toast.error(e instanceof Error?e.message:"Failed to load data")}finally{g(!1),T.current=!0}},[e]);(0,a.useEffect)(()=>{P()},[P]);let O=(0,a.useRef)(null),_=(0,a.useCallback)(()=>{O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{O.current=null,P()},300)},[P]);(0,a.useEffect)(()=>()=>{O.current&&clearTimeout(O.current)},[]);let I=(0,a.useCallback)(t=>{for(let e of N.current)e(t);switch(t.type){case"runtime.registered":if(t.workspaceId!==e)break;P();break;case"runtime.deleted":P();break;case"runtime.status":if(t.workspaceId!==e)break;_();break;case"task.updated":A()}},[P,_,A,e]);(0,s.useUserWs)(I);let M=(0,a.useCallback)(async t=>{try{let a=await (0,r.createAgent)(t,e);return await P(),a}catch(e){return n.toast.error(e instanceof Error?e.message:"Failed to create agent"),null}},[P,e]),D=(0,a.useCallback)(async(t,a)=>{try{return await (0,r.updateAgent)(t,a,e),await P(),!0}catch(e){return n.toast.error(e instanceof Error?e.message:"Failed to update agent"),!1}},[P,e]),L=(0,a.useCallback)(async t=>{try{return await (0,r.deleteAgent)(t,e),await P(),!0}catch(e){return n.toast.error(e instanceof Error?e.message:"Failed to remove agent"),!1}},[P,e]),R=(0,a.useCallback)(async t=>{k(e=>{let a=Math.max(-1,...[...e.values()].map(e=>e.position));return new Map(e).set(t,{created_at:new Date().toISOString(),position:a+1})});try{await (0,r.pinAgent)(e,t)}catch{k(e=>{let a=new Map(e);return a.delete(t),a}),n.toast.error("Failed to pin agent")}},[e]),U=(0,a.useCallback)(async t=>{let a;k(e=>{a=e.get(t);let r=new Map(e);return r.delete(t),r});try{await (0,r.unpinAgent)(e,t)}catch{void 0!==a&&k(e=>new Map(e).set(t,a)),n.toast.error("Failed to unpin agent")}},[e]),z=(0,a.useCallback)(async t=>{let a=new Map(w);k(e=>{let a=new Map(e);return t.forEach((e,t)=>{let r=a.get(e);r&&a.set(e,{...r,position:t})}),a});try{await (0,r.reorderAgentPins)(e,t)}catch{k(a),n.toast.error("Failed to reorder pins")}},[e,w]),W=(0,a.useCallback)(async t=>{let a=new Map($);S(new Map(t.map((e,t)=>[e,t])));try{await (0,r.reorderUnpinnedAgents)(e,t)}catch{S(a),n.toast.error("Failed to reorder agents")}},[e,$]),J=(0,a.useCallback)(()=>{let e=c.find(e=>"online"===e.status);return e?.id??""},[c]),B=(0,a.useCallback)(async()=>{try{return(await (0,r.createMachineToken)("cli",e)).token}catch(e){return n.toast.error(e instanceof Error?e.message:"Failed to generate token"),null}},[e]),F=(0,a.useCallback)(async t=>{try{return await (0,r.deleteMachine)(t,e),await P(),!0}catch(e){return n.toast.error(e instanceof Error?e.message:"Failed to remove machine"),!1}},[P,e]);return(0,t.jsx)(i.Provider,{value:{workspaceId:e,agents:l,agentLinks:y,runtimes:c,loading:p,activeTaskCounts:m,activeTaskDetails:h,pins:w,reload:P,subscribeWs:C,handleCreateAgent:M,handleUpdateAgent:D,handleDeleteAgent:L,handlePinAgent:R,handleUnpinAgent:U,handleReorderPins:z,unpinnedOrder:$,handleReorderUnpinned:W,getFirstOnlineRuntimeId:J,handleGenerateToken:B,handleDeleteMachine:F},children:o})},"useAgentContext",0,function(){let e=(0,a.useContext)(i);if(!e)throw Error("useAgentContext must be used within AgentProvider");return e}])},361268,e=>{"use strict";let t=(0,e.i(706875).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],361268)},332680,e=>{"use strict";var t=e.i(368075),a=e.i(917739),r=e.i(613349),n=e.i(186339),s=e.i(71951);function i({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function o({className:e,...n}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,r.cn)("fixed inset-0 z-50 bg-black/20 backdrop-blur-[2px] transition-[opacity,backdrop-filter] duration-200 ease-out data-ending-style:opacity-0 data-ending-style:backdrop-blur-none data-starting-style:opacity-0 data-starting-style:backdrop-blur-none",e),...n})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"sheet",...e})},"SheetBody",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-body",className:(0,r.cn)("flex-1 overflow-y-auto px-4 sm:px-6 py-5",e),...a})},"SheetContent",0,function({className:e,children:l,side:d="right",showCloseButton:c=!0,...u}){return(0,t.jsxs)(i,{children:[(0,t.jsx)(o,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,r.cn)("fixed z-50 flex flex-col bg-background shadow-xl outline-none transition duration-300 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0","data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-full data-[side=right]:max-w-md data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-10 data-[side=right]:data-starting-style:translate-x-10","data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-full data-[side=left]:max-w-md data-[side=left]:border-r data-[side=left]:data-ending-style:-translate-x-10 data-[side=left]:data-starting-style:-translate-x-10","data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:-translate-y-10 data-[side=top]:data-starting-style:-translate-y-10","data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-10 data-[side=bottom]:data-starting-style:translate-y-10",e),...u,children:[l,c&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(n.Button,{variant:"ghost",className:"absolute top-3 right-3 z-10",size:"icon-sm"}),children:[(0,t.jsx)(s.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...n}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...n})},"SheetFooter",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-footer",className:(0,r.cn)("flex flex-col-reverse gap-2 border-t bg-muted/50 px-4 sm:px-6 py-4 sm:flex-row sm:justify-end",e),...a})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,r.cn)("flex flex-col gap-1 border-b px-4 sm:px-6 py-5",e),...a})},"SheetTitle",0,function({className:e,...n}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,r.cn)("font-heading text-lg leading-none font-semibold",e),...n})},"SheetTrigger",0,function({...e}){return(0,t.jsx)(a.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}])},875061,e=>{"use strict";var t=e.i(943891),a=e.i(597849),r=e.i(294237),n=e.i(613349);let s=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:i,...o}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,n.cn)(s({variant:r}),e)},o),render:i,state:{slot:"badge",variant:r}},(0,a.useRenderElement)(l.defaultTagName??"div",l,l)},"badgeVariants",0,s],875061)},208020,(e,t,a)=>{t.exports=e.r(170928)},706875,e=>{"use strict";var t=e.i(298699);let a=(...e)=>e.filter((e,t,a)=>!!e&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim(),r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,t.createContext)({}),i=(0,t.forwardRef)(({color:e,size:r,strokeWidth:i,absoluteStrokeWidth:o,className:l="",children:d,iconNode:c,...u},p)=>{let{size:g=24,strokeWidth:m=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:v=""}=(0,t.useContext)(s)??{},b=o??f?24*Number(i??m)/Number(r??g):i??m;return(0,t.createElement)("svg",{ref:p,...n,width:r??g??n.width,height:r??g??n.height,stroke:e??h,strokeWidth:b,className:a("lucide",v,l),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(u)&&{"aria-hidden":"true"},...u},[...c.map(([e,a])=>(0,t.createElement)(e,a)),...Array.isArray(d)?d:[d]])});e.s(["default",0,(e,n)=>{let s=(0,t.forwardRef)(({className:s,...o},l)=>(0,t.createElement)(i,{ref:l,iconNode:n,className:a(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...o}));return s.displayName=r(e),s}],706875)},616117,484665,e=>{"use strict";e.i(459119);var t=e.i(298699),a=e.i(92615),r=e.i(773825),n=e.i(389068),s=e.i(943891),i=e.i(398258);let o=t.createContext(void 0);function l(e=!1){let a=t.useContext(o);if(void 0===a&&!e)throw Error((0,i.default)(16));return a}function d(e){return(0,a.isHTMLElement)(e)&&"BUTTON"===e.tagName}e.s(["CompositeRootContext",0,o,"useCompositeRootContext",0,l],484665),e.s(["useButton",0,function(e={}){let{disabled:a=!1,focusableWhenDisabled:i,tabIndex:o=0,native:c=!0,composite:u}=e,p=t.useRef(null),g=l(!0),m=u??void 0!==g,{props:f}=function(e){let{focusableWhenDisabled:a,disabled:r,composite:n=!1,tabIndex:s=0,isNativeButton:i}=e,o=n&&!1!==a,l=n&&!1===a;return{props:t.useMemo(()=>{let e={onKeyDown(e){r&&a&&"Tab"!==e.key&&e.preventDefault()}};return n||(e.tabIndex=s,!i&&r&&(e.tabIndex=a?s:-1)),(i&&(a||o)||!i&&r)&&(e["aria-disabled"]=r),i&&(!a||l)&&(e.disabled=r),e},[n,r,a,o,l,i,s])}}({focusableWhenDisabled:i,disabled:a,composite:m,tabIndex:o,isNativeButton:c}),h=t.useCallback(()=>{let e=p.current;d(e)&&m&&a&&void 0===f.disabled&&e.disabled&&(e.disabled=!1)},[a,f.disabled,m]);return(0,n.useIsoLayoutEffect)(h,[h]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:r,onKeyUp:n,onKeyDown:i,onPointerDown:o,...l}=e,u=c?"button":void 0;return(0,s.mergeProps)({type:u,onClick(e){a?e.preventDefault():t?.(e)},onMouseDown(e){a||r?.(e)},onKeyDown(e){var r;if(a||((0,s.makeEventPreventable)(e),i?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,o=e.currentTarget,l=d(o),u=!c&&(r=o,!!(r?.tagName==="A"&&r?.href)),p=n&&(c?l:!u),g="Enter"===e.key,f=" "===e.key,h=o.getAttribute("role"),v=h?.startsWith("menuitem")||"option"===h||"gridcell"===h;if(n&&m&&f){if(e.defaultPrevented&&v)return;e.preventDefault(),u||c&&l?(o.click(),e.preventBaseUIHandler()):p&&(t?.(e),e.preventBaseUIHandler());return}p&&(!c&&(f||g)&&e.preventDefault(),!c&&g&&t?.(e))},onKeyUp(e){a||(((0,s.makeEventPreventable)(e),n?.(e),e.target===e.currentTarget&&c&&m&&d(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||c||m||" "!==e.key||t?.(e)))},onPointerDown(e){a?e.preventDefault():o?.(e)}},c?void 0:{role:"button"},f,l)},[a,f,m,c]),buttonRef:(0,r.useStableCallback)(e=>{p.current=e,h()})}}],616117)},294237,e=>{"use strict";var t=e.i(7284);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,r=t.clsx;e.s(["cva",0,(e,t)=>n=>{var s;if((null==t?void 0:t.variants)==null)return r(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(e=>{let t=null==n?void 0:n[e],r=null==o?void 0:o[e];if(null===t)return null;let s=a(t)||a(r);return i[e][s]}),d=n&&Object.entries(n).reduce((e,t)=>{let[a,r]=t;return void 0===r||(e[a]=r),e},{});return r(e,l,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:a,className:r,...n}=t;return Object.entries(n).every(e=>{let[t,a]=e;return Array.isArray(a)?a.includes({...o,...d}[t]):({...o,...d})[t]===a})?[...e,a,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}])},186339,e=>{"use strict";var t=e.i(368075);e.i(459119);var a=e.i(298699),r=e.i(616117),n=e.i(597849);let s=a.forwardRef(function(e,t){let{render:a,className:s,disabled:i=!1,focusableWhenDisabled:o=!1,nativeButton:l=!0,style:d,...c}=e,{getButtonProps:u,buttonRef:p}=(0,r.useButton)({disabled:i,focusableWhenDisabled:o,native:l});return(0,n.useRenderElement)("button",e,{state:{disabled:i},ref:[t,p],props:[c,u]})});var i=e.i(294237),o=e.i(613349);let l=(0,i.cva)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:a="default",size:r="default",...n}){return(0,t.jsx)(s,{"data-slot":"button",className:(0,o.cn)(l({variant:a,size:r,className:e})),...n})},"buttonVariants",0,l],186339)},29512,e=>{"use strict";let t=(0,e.i(706875).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t])},575607,e=>{"use strict";var t=e.i(29512);e.s(["Check",()=>t.default])},309475,450463,e=>{"use strict";var t=e.i(368075),a=e.i(298699),r=e.i(789994),n=e.i(875061),s=e.i(224950),i=e.i(728886),o=e.i(613349),l=e.i(222862),d=e.i(500324);function c(e){let t=new Date(e);if(isNaN(t.getTime()))return"";let a=Math.floor((new Date().getTime()-t.getTime())/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let n=Math.floor(r/24);return n<7?`${n}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function u({online:e}){return(0,t.jsx)("span",{className:(0,o.cn)("size-1.5 rounded-full shrink-0",e?"bg-status-online":"bg-status-offline")})}function p({task:e,slug:a,agentId:n}){var s;let i,l="running"===e.status;return(0,t.jsxs)(r.default,{href:`/w/${a}/agents/${n}?task=${e.id}&conv=${e.conversation_id}`,className:"flex items-center gap-2 w-full py-1.5 px-2 hover:bg-muted rounded-md transition-colors cursor-pointer",children:[(0,t.jsx)("span",{className:(0,o.cn)("size-1.5 rounded-full shrink-0",l?"bg-primary animate-pulse":"bg-muted-foreground/40")}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsx)("p",{className:"text-xs truncate",children:(i=(s=e.prompt).match(/^Issue\s+iss_\w+:\s*(.+)/))?i[1].split("\n")[0]:s.split("\n")[0]})}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground whitespace-nowrap shrink-0",children:c(e.created_at)})]})}e.s(["relativeTime",0,c],450463);let g="gap-1.5 text-muted-foreground hover:text-foreground cursor-pointer";e.s(["AgentStatusBadge",0,function({isOnline:e,taskCount:c,agentId:m}){let{slug:f,workspaceId:h}=(0,d.useWorkspace)(),[v,b]=(0,a.useState)(null),[y,x]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),$=(0,a.useCallback)(async()=>{b(null),x(!0),k(!1);try{let e=await (0,l.listWorkspaceActiveTasks)(h);b(e.tasks.filter(e=>e.agent_id===m))}catch{k(!0)}finally{x(!1)}},[m,h]);return e?(0,t.jsxs)(s.Popover,{onOpenChange:e=>{e&&$()},children:[(0,t.jsxs)(s.PopoverTrigger,{render:(0,t.jsx)("button",{type:"button",className:(0,o.cn)((0,n.badgeVariants)({variant:"outline"}),g),onClick:e=>e.stopPropagation()}),children:[(0,t.jsx)(u,{online:!0}),c>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Working"}),(0,t.jsx)("span",{className:"tabular-nums",children:c})]})]}),(0,t.jsx)(s.PopoverContent,{className:"w-72 p-1",children:y?(0,t.jsx)("div",{className:"p-2 space-y-1",children:Array.from({length:3}).map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 py-1.5 px-2",children:[(0,t.jsx)(i.Skeleton,{className:"size-1.5 rounded-full"}),(0,t.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,t.jsx)(i.Skeleton,{className:"h-2.5 w-10"}),(0,t.jsx)(i.Skeleton,{className:"h-3 w-full"})]}),(0,t.jsx)(i.Skeleton,{className:"h-2.5 w-8"})]},a))}):w?(0,t.jsx)("div",{className:"p-3 text-xs text-muted-foreground",children:"Failed to load"}):v&&0!==v.length?(0,t.jsxs)("div",{className:"max-h-75 overflow-y-auto",children:[v.slice(0,6).map(e=>(0,t.jsx)(p,{task:e,slug:f,agentId:m},e.id)),v.length>6&&(0,t.jsxs)(r.default,{href:`/w/${f}/agents/${m}/activity?status=running`,className:"block text-xs text-muted-foreground hover:text-foreground text-center py-1.5 transition-colors",children:["View all ",v.length," tasks"]})]}):(0,t.jsx)("div",{className:"p-3 text-xs text-muted-foreground",children:"No active tasks"})})]}):(0,t.jsxs)(n.Badge,{variant:"outline",render:(0,t.jsx)(r.default,{href:`/w/${f}/runtimes`,title:"Runtime offline — click to manage runtimes"}),className:g,children:[(0,t.jsx)(u,{online:!1}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Offline"})]})}],309475)},844010,e=>{"use strict";var t=e.i(368075),a=e.i(298699),r=e.i(575607),n=e.i(361268),s=e.i(880932);e.i(400175);var i=e.i(819748),o=e.i(126366),l=e.i(309475),d=e.i(613349);e.s(["AgentPreviewCard",0,function({agent:e,isOnline:c,activeTaskCount:u,variant:p="default",isHovered:g}){let[m,f]=(0,a.useState)(!1),h=e.email_handle?`${e.email_handle}@alook.ai`:null,v=(0,a.useCallback)(async()=>{if(h)try{await navigator.clipboard.writeText(h),f(!0),s.toast.success("Email copied to clipboard"),setTimeout(()=>f(!1),2e3)}catch{s.toast.error("Failed to copy email")}},[h]);if("compact"===p){let a;return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-0",children:[(a=(0,o.parseAvatarUrl)(e.avatar_url))?(0,t.jsx)(i.AnimatedAvatar,{config:a,size:32,className:"shrink-0 rounded-xl",isHovered:g??!1,isWorking:!!c&&(u??0)>0}):(0,t.jsx)("div",{className:"flex items-center justify-center size-8 rounded-xl bg-secondary text-secondary-foreground text-xs font-medium shrink-0",children:e.name.charAt(0).toUpperCase()}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium truncate max-w-35",children:e.name}),h&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:h})]}),void 0!==c&&(0,t.jsx)("div",{className:"pointer-events-none mt-0.5",children:(0,t.jsx)(l.AgentStatusBadge,{isOnline:c,taskCount:u??0,agentId:e.id})})]})]})}return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 p-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium truncate",children:e.name}),(0,t.jsx)("span",{className:"flex-1"}),void 0!==c&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground",children:[(0,t.jsx)("span",{className:(0,d.cn)("size-1.5 rounded-full",c?"bg-status-online":"bg-status-offline")}),c?(u??0)>0?"Working":null:"Offline"]})]}),h&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:h}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),v()},className:"shrink-0 p-0.5 rounded-sm text-muted-foreground/60 hover:text-foreground transition-colors cursor-pointer",children:m?(0,t.jsx)(r.Check,{className:"size-3 text-green-500"}):(0,t.jsx)(n.Copy,{className:"size-3"})})]}),e.description&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:e.description})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,642342,e=>{"use strict";var r=e.i(459119),t=e.i(298699);let n=(0,e.i(613349).isLocalMode)(),a=Number(r.default.env.NEXT_PUBLIC_WS_DO_PORT)||8789,s=Number(r.default.env.NEXT_PUBLIC_WS_RECONNECT_DELAY_MS)||1e3,o=Number(r.default.env.NEXT_PUBLIC_WS_RECONNECT_MAX_DELAY_MS)||3e4;e.s(["useUserWs",0,function(e){let r=(0,t.useRef)(null),i=(0,t.useRef)(s),l=(0,t.useRef)(e),d=(0,t.useRef)(null);(0,t.useEffect)(()=>{l.current=e},[e]);let c=(0,t.useRef)(null),u=(0,t.useCallback)(()=>{let e=Math.min(i.current,o);i.current=Math.min(2*e,o),d.current=setTimeout(()=>{c.current?.()},e+500*Math.random())},[]),f=(0,t.useCallback)(async()=>{let e,t,o;try{let r=await fetch("/api/ws/token");if(!r.ok){console.warn("[ws] token fetch failed:",r.status),u();return}let n=await r.json();e=n.userId,t=n.token}catch(e){console.warn("[ws] token fetch error:",e),u();return}let d=n?`ws://localhost:${a}/?userId=${e}`:`${location.origin.replace("http","ws")}/api/ws/user?userId=${e}`;try{o=new WebSocket(d)}catch(e){console.warn("[ws] WebSocket creation failed:",e),u();return}r.current=o,o.onopen=()=>{i.current=s,o.send(JSON.stringify({type:"auth",token:t}))},o.onmessage=e=>{try{let r=JSON.parse(e.data);if("auth.ok"===r.type)return;l.current(r)}catch{}},o.onerror=()=>{},o.onclose=()=>{o===r.current&&u()}},[u]);(0,t.useEffect)(()=>{c.current=f},[f]),(0,t.useEffect)(()=>(f(),()=>{null!==d.current&&(clearTimeout(d.current),d.current=null);let e=r.current;r.current=null,e?.close()}),[f])}])},996718,e=>{"use strict";var r=e.i(298699);e.s(["useIsMobile",0,function(){let[e,t]=r.useState(void 0);return r.useEffect(()=>{let e=window.matchMedia("(max-width: 639px)"),r=()=>{t(window.innerWidth<640)};return e.addEventListener("change",r),t(window.innerWidth<640),()=>e.removeEventListener("change",r)},[]),!!e}])},400175,126366,819748,108772,e=>{"use strict";var r=e.i(368075),t=e.i(298699);let n="#27272a",a={fill:"rgba(255,255,255,0.92)",stroke:"rgba(255,255,255,0.95)",strokeWidth:3.5},s=[{name:"Purple",value:"#a855f7",gradient:["#c084fc","#a855f7","#7c3aed"],faceColor:"#2e1065"},{name:"Teal",value:"#14b8a6",gradient:["#5eead4","#14b8a6","#0d9488"],faceColor:"#134e4a"},{name:"Orange",value:"#f97316",gradient:["#fdba74","#f97316","#c2410c"],faceColor:"#7c2d12"},{name:"Blue",value:"#3b82f6",gradient:["#93c5fd","#3b82f6","#1d4ed8"],faceColor:"#1e3a5f"},{name:"Pink",value:"#f472b6",gradient:["#fda4af","#f472b6","#be185d"],faceColor:"#831843"},{name:"Yellow",value:"#eab308",gradient:["#fde047","#eab308","#a16207"],faceColor:"#713f12"},{name:"Green",value:"#22c55e",gradient:["#86efac","#22c55e","#15803d"],faceColor:"#14532d"},{name:"Beige",value:"#d6ccb8",gradient:["#e8e0d4","#d6ccb8","#b8a990"],faceColor:"#57534e"},{name:"Red",value:"#ef4444",gradient:["#fca5a5","#ef4444","#991b1b"],faceColor:"#7f1d1d"},{name:"Lake Blue",value:"#6366f1",gradient:["#a5b4fc","#6366f1","#3730a3"],faceColor:"#312e81"},{name:"Gray",value:"#9ca3af",gradient:["#d4d4d8","#9ca3af","#6b7280"],faceColor:"#374151"},{name:"Deep Purple",value:"#8b5cf6",gradient:["#c4b5fd","#8b5cf6","#5b21b6"],faceColor:"#3b0764"}],o={circle:{name:"Circle",face:{cx:100,cy:100,w:80},render:()=>(0,r.jsx)("circle",{cx:"100",cy:"100",r:"66",...a})},rounded:{name:"Rounded",face:{cx:100,cy:100,w:90},render:()=>(0,r.jsx)("rect",{x:"30",y:"30",width:"140",height:"140",rx:"32",...a})},hexagon:{name:"Hexagon",face:{cx:100,cy:100,w:86},render:()=>(0,r.jsx)("path",{d:"M100 32 C108 32 114 35 120 39 L155 60 C161 64 165 70 165 78 L165 122 C165 130 161 136 155 140 L120 161 C114 165 108 168 100 168 C92 168 86 165 80 161 L45 140 C39 136 35 130 35 122 L35 78 C35 70 39 64 45 60 L80 39 C86 35 92 32 100 32 Z",...a})},task:{name:"Task",face:{cx:100,cy:100,w:80},render:()=>(0,r.jsx)("rect",{x:"34",y:"34",width:"132",height:"132",rx:"24",...a})},book:{name:"Book",face:{cx:100,cy:100,w:80},render:()=>(0,r.jsx)("path",{d:"M42 162 L42 88 C42 54 68 34 100 34 C132 34 158 54 158 88 L158 162 C158 166 154 170 150 170 L50 170 C46 170 42 166 42 162 Z",...a})},mail:{name:"Mail",face:{cx:100,cy:100,w:86},render:()=>(0,r.jsx)("rect",{x:"28",y:"54",width:"144",height:"92",rx:"46",...a})},calendar:{name:"Calendar",face:{cx:100,cy:100,w:80},render:()=>(0,r.jsx)("path",{d:"M100 34 C138 34 166 52 166 80 C166 94 158 106 158 118 C158 148 138 166 100 166 C62 166 42 148 42 118 C42 106 34 94 34 80 C34 52 62 34 100 34 Z",...a})},bulb:{name:"Bulb",face:{cx:100,cy:104,w:76},render:()=>(0,r.jsx)("ellipse",{cx:"100",cy:"104",rx:"58",ry:"66",...a})},folder:{name:"Folder",face:{cx:102,cy:108,w:80},render:()=>(0,r.jsx)("path",{d:"M62 144 C40 144 32 128 36 116 C32 104 40 90 54 88 C56 72 70 60 88 62 C100 50 118 50 132 58 C144 52 162 60 162 76 C172 82 174 98 166 108 C172 120 164 136 150 140 Z",...a})},mountain:{name:"Mountain",face:{cx:100,cy:100,w:76},render:()=>(0,r.jsx)("path",{d:"M92 36 C120 32 156 48 164 78 C172 108 156 148 124 160 C92 172 48 156 38 124 C28 92 62 40 92 36 Z",...a})}},i=Object.keys(o),l={dot:{name:"Dot",render:(e=n)=>(0,r.jsx)("circle",{cx:"0",cy:"0",r:"4.5",fill:e})},dash:{name:"Dash",render:(e=n)=>(0,r.jsx)("line",{x1:"-10",y1:"0",x2:"10",y2:"0",stroke:e,strokeWidth:"5",strokeLinecap:"round"})},hookL:{name:"Hook",render:(e=n)=>(0,r.jsx)("path",{d:"M-11 0 Q-5.5 7 0 1.5 Q5.5 7 11 0",fill:"none",stroke:e,strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"})},smile:{name:"Smile",render:(e=n)=>(0,r.jsx)("path",{d:"M-11 0 Q0 11 11 0",fill:"none",stroke:e,strokeWidth:"5",strokeLinecap:"round"})},caret:{name:"Caret",render:(e=n)=>(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M-10 0 Q0 8 10 0",fill:"none",stroke:e,strokeWidth:"4.5",strokeLinecap:"round"}),(0,r.jsx)("ellipse",{cx:"3",cy:"6",rx:"4",ry:"4.5",fill:"#f472b6"})]})},arrow:{name:"Arrow",render:(e=n)=>(0,r.jsx)("ellipse",{cx:"0",cy:"0",rx:"6",ry:"7.5",fill:e})},oh:{name:"o",render:(e=n)=>(0,r.jsx)("ellipse",{cx:"0",cy:"0",rx:"7",ry:"7.5",fill:"none",stroke:e,strokeWidth:"4.5"})}},d=Object.keys(l),c=(e,t)=>{let a=t??e,s=(t,s=n)=>(0,r.jsxs)("g",{children:[(0,r.jsx)("g",{transform:`translate(${-t}, 0)`,children:e(s)}),(0,r.jsx)("g",{transform:`translate(${t}, 0)`,children:a(s)})]});return s.displayName="EyePair",s},u={dots:{name:"Dots",render:c(e=>(0,r.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:e}))},big:{name:"Big",render:c(e=>(0,r.jsxs)("g",{children:[(0,r.jsx)("circle",{cx:"0",cy:"0",r:"10",fill:e}),(0,r.jsx)("circle",{cx:"2.5",cy:"-3",r:"3.5",fill:"rgba(255,255,255,0.9)"})]}))},rings:{name:"Rings",render:c(e=>(0,r.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:"none",stroke:e,strokeWidth:"4.5"}))},arches:{name:"Arches",render:c(e=>(0,r.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:e,strokeWidth:"5",strokeLinecap:"round"}))},lines:{name:"Lines",render:c(e=>(0,r.jsx)("path",{d:"M-10 0 Q0 -6 10 0",fill:"none",stroke:e,strokeWidth:"5",strokeLinecap:"round"}))},happy:{name:"Happy",render:c(e=>(0,r.jsx)("path",{d:"M-10 5 Q0 -11 10 5",fill:"none",stroke:e,strokeWidth:"5",strokeLinecap:"round"}))},sleepy:{name:"Sleepy",render:c(e=>(0,r.jsx)("path",{d:"M-10 -2 Q0 8 10 -2",fill:"none",stroke:e,strokeWidth:"5",strokeLinecap:"round"}))},shy:{name:"Shy",render:c(e=>(0,r.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:e}))},wink:{name:"Wink",render:(e,t=n)=>(0,r.jsxs)("g",{children:[(0,r.jsx)("g",{transform:`translate(${-e}, 0)`,children:(0,r.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:t})}),(0,r.jsx)("g",{transform:`translate(${e}, 0)`,children:(0,r.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:t,strokeWidth:"5",strokeLinecap:"round"})})]})}},f=Object.keys(u),x={shape:"book",eye:"happy",nose:"dash",bg:1},h=[{name:"Task",config:{shape:"task",nose:"dot",eye:"dots",bg:0}},{name:"Notes",config:{shape:"book",nose:"dash",eye:"happy",bg:1}},{name:"Mail",config:{shape:"mail",nose:"smile",eye:"dots",bg:3}},{name:"Schedule",config:{shape:"calendar",nose:"dot",eye:"dots",bg:4}},{name:"Idea",config:{shape:"bulb",nose:"oh",eye:"rings",bg:5}},{name:"Project",config:{shape:"folder",nose:"dash",eye:"lines",bg:7}},{name:"Goal",config:{shape:"mountain",nose:"caret",eye:"arches",bg:8}},{name:"Dream",config:{shape:"circle",nose:"smile",eye:"shy",bg:11}},{name:"Organize",config:{shape:"rounded",nose:"dot",eye:"sleepy",bg:6}},{name:"Explore",config:{shape:"hexagon",nose:"hookL",eye:"wink",bg:9}},{name:"Focus",config:{shape:"task",nose:"caret",eye:"lines",bg:2}},{name:"Collect",config:{shape:"book",nose:"oh",eye:"rings",bg:10}}];function m(e){return e[Math.floor(Math.random()*e.length)]}function p(){return{shape:m(i),eye:m(f),nose:m(d),bg:Math.floor(Math.random()*s.length)}}function g({config:e,size:n=200,className:a}){let i=(0,t.useId)().replace(/:/g,""),d=o[e.shape]??o.book,c=u[e.eye],f=l[e.nose],x=s[e.bg]??s[0],[h,m,p]=x.gradient,b=x.faceColor,{cx:v,cy:y,w:j}=d.face,k=Math.max(13,.24*j),C=y-Math.max(12,.16*j);return(0,r.jsxs)("svg",{viewBox:"0 0 200 200",width:n,height:n,className:a,style:{display:"block"},children:[(0,r.jsxs)("defs",{children:[(0,r.jsxs)("linearGradient",{id:`bg-${i}`,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:h}),(0,r.jsx)("stop",{offset:"50%",stopColor:m}),(0,r.jsx)("stop",{offset:"100%",stopColor:p})]}),(0,r.jsxs)("radialGradient",{id:`gl-${i}`,cx:"30%",cy:"25%",r:"60%",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:"rgba(255,255,255,0.32)"}),(0,r.jsx)("stop",{offset:"100%",stopColor:"rgba(255,255,255,0)"})]}),(0,r.jsx)("filter",{id:`sh-${i}`,x:"-10%",y:"-5%",width:"120%",height:"130%",children:(0,r.jsx)("feDropShadow",{dx:"0",dy:"3",stdDeviation:"4",floodColor:"rgba(0,0,0,0.18)"})})]}),(0,r.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#bg-${i})`}),(0,r.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#gl-${i})`}),(0,r.jsxs)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:[(0,r.jsx)("g",{"data-avatar-shape":"",filter:`url(#sh-${i})`,children:d.render()}),c&&(0,r.jsx)("g",{transform:`translate(${v}, ${C})`,children:(0,r.jsx)("g",{"data-avatar-eyes":"",children:c.render(k,b)})}),f&&(0,r.jsx)("g",{transform:`translate(${v}, ${y+7})`,children:(0,r.jsx)("g",{"data-avatar-nose":"",children:f.render(b)})})]})]})}let b="avatar:";e.s(["AvatarRenderer",0,g,"BG_COLORS",0,s,"DEFAULT_CONFIG",0,x,"EYE_KEYS",0,f,"Eyes",0,u,"NOSE_KEYS",0,d,"Noses",0,l,"PRESETS",0,h,"SHAPE_KEYS",0,i,"Shapes",0,o,"parseAvatarUrl",0,function(e){if(!e||!e.startsWith(b))return null;try{let r=JSON.parse(e.slice(b.length));if("object"==typeof r&&null!==r&&"string"==typeof r.shape&&"string"==typeof r.eye&&"string"==typeof r.nose&&"number"==typeof r.bg)return r;if("object"==typeof r&&null!==r&&"outline"in r)return x;return null}catch{return null}},"randomConfig",0,p,"serializeAvatarConfig",0,function(e){return b+JSON.stringify(e)}],126366);let v=["avatar-anim-shape-bounce","avatar-anim-head-tilt","avatar-anim-shake","avatar-anim-wobble","avatar-anim-pulse","avatar-anim-spin","avatar-anim-jelly","avatar-anim-float","avatar-anim-nod"];e.s(["AnimatedAvatar",0,function({config:e,size:n,className:a,isHovered:s,isWorking:o}){let[i,l]=(0,t.useState)(null),d=(0,t.useRef)(-1);function c(){let e=Math.floor(Math.random()*v.length);return e===d.current&&(e=(e+1)%v.length),d.current=e,v[e]}return(0,t.useEffect)(()=>{s?l(c()):o||l(null)},[s,o]),(0,t.useEffect)(()=>{if(!o){s||l(null);return}l(c());let e=setInterval(()=>{l(c())},4e3);return()=>clearInterval(e)},[s,o]),(0,r.jsx)("div",{className:i??void 0,children:(0,r.jsx)(g,{config:e,size:n,className:a})})}],819748);var y=e.i(613349);function j({label:e,keys:t,value:n,onChange:a,renderThumb:s,mobile:o=!1}){let i=t.indexOf(n),l=e=>a(t[(i+e+t.length)%t.length]),d=t[(i-1+t.length)%t.length],c=t[(i+1)%t.length];return(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"w-12 text-xs font-medium text-muted-foreground shrink-0",children:e}),(0,r.jsx)("button",{type:"button",onClick:()=>l(-1),className:(0,y.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",o?"size-10":"size-7"),children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,r.jsx)("path",{d:"M15 5 L8 12 L15 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,r.jsxs)("div",{className:"flex items-center gap-1 flex-1 justify-center",children:[(0,r.jsx)("button",{type:"button",onClick:()=>l(-1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:s(d)}),(0,r.jsx)("button",{type:"button",onClick:()=>l(1),className:"border-2 border-primary rounded-lg p-0.5",children:s(n)}),(0,r.jsx)("button",{type:"button",onClick:()=>l(1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:s(c)})]}),(0,r.jsx)("button",{type:"button",onClick:()=>l(1),className:(0,y.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",o?"size-10":"size-7"),children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,r.jsx)("path",{d:"M9 5 L16 12 L9 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function k({config:e,onChange:n,layout:a="vertical",mobile:c=!1}){let[x,m]=(0,t.useState)("presets"),b=(0,t.useCallback)((r,t)=>{n({...e,[r]:t})},[e,n]),[v,C]=(0,t.useState)(!1),w=(0,t.useRef)(e);(0,t.useEffect)(()=>{if(w.current.shape!==e.shape||w.current.eye!==e.eye||w.current.nose!==e.nose||w.current.bg!==e.bg){C(!0);let r=setTimeout(()=>C(!1),450);return w.current=e,()=>clearTimeout(r)}},[e]),(0,t.useEffect)(()=>{if("horizontal"!==a)return;let e=e=>{"Space"===e.code&&e.target===document.body&&(e.preventDefault(),n(p()))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a,n]);let N="horizontal"===a,L=N?220:c?120:160,z=(0,r.jsxs)("div",{className:(0,y.cn)("flex flex-col items-center gap-3 rounded-2xl bg-muted/30",c?"p-3":"p-4",N?"w-70 shrink-0 justify-center":""),children:[(0,r.jsx)("div",{className:(0,y.cn)("rounded-2xl",v&&"animate-[shake_0.45s_cubic-bezier(.36,.07,.19,.97)]"),children:(0,r.jsx)(g,{config:e,size:L})}),(0,r.jsxs)("button",{type:"button",onClick:()=>n(p()),className:"inline-flex items-center gap-2 rounded-full bg-foreground px-4 py-1.5 text-sm font-medium text-background hover:bg-foreground/80 transition-colors",children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"16",cy:"8",r:"1.5",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"8",cy:"16",r:"1.5",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"16",cy:"16",r:"1.5",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]}),"Random",N&&(0,r.jsx)("kbd",{className:"ml-1 rounded bg-background/20 px-1.5 py-0.5 text-[10px] font-mono",children:"Space"})]})]}),E=(0,r.jsxs)("div",{className:(0,y.cn)("flex flex-col gap-3 flex-1 min-w-0",N&&"rounded-2xl bg-muted/30 p-4 h-95"),children:[(0,r.jsxs)("div",{className:"flex border-b border-border",children:[(0,r.jsx)("button",{type:"button",onClick:()=>m("presets"),className:(0,y.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","presets"===x?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"★ Presets"}),(0,r.jsx)("button",{type:"button",onClick:()=>m("custom"),className:(0,y.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","custom"===x?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"⚙ Custom"})]}),(0,r.jsxs)("div",{className:(0,y.cn)("flex-1 min-h-0",N&&"overflow-y-auto thin-scrollbar"),children:["presets"===x&&(0,r.jsx)("div",{className:(0,y.cn)("grid gap-2",c?"grid-cols-3":"grid-cols-4"),children:h.map(t=>{let a=t.config.shape===e.shape&&t.config.eye===e.eye&&t.config.nose===e.nose&&t.config.bg===e.bg;return(0,r.jsx)("button",{type:"button",onClick:()=>n(t.config),className:(0,y.cn)("flex items-center justify-center rounded-xl border p-2 transition-all",a?"border-primary border-2 bg-primary/5 shadow-sm":"border-border bg-background hover:border-primary/40"),children:(0,r.jsx)(g,{config:t.config,size:56})},t.name)})}),"custom"===x&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(j,{label:"Shape",keys:i,value:e.shape,onChange:e=>b("shape",e),renderThumb:e=>(0,r.jsxs)("svg",{viewBox:"0 0 200 200",width:"40",height:"40",children:[(0,r.jsx)("rect",{width:"200",height:"200",rx:"56",fill:"hsl(var(--muted))"}),(0,r.jsx)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:o[e]?.render()})]}),mobile:c}),(0,r.jsx)(j,{label:"Nose",keys:d,value:e.nose,onChange:e=>b("nose",e),renderThumb:e=>(0,r.jsx)("svg",{viewBox:"-14 -10 28 20",width:"36",height:"24",children:l[e]?.render("currentColor")}),mobile:c}),(0,r.jsx)(j,{label:"Eyes",keys:f,value:e.eye,onChange:e=>b("eye",e),renderThumb:e=>(0,r.jsx)("svg",{viewBox:"-18 -10 36 20",width:"44",height:"24",children:u[e]?.render(8,"currentColor")}),mobile:c}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Color"}),(0,r.jsx)("div",{className:(0,y.cn)("flex flex-wrap p-1",c?"gap-3":"gap-2"),children:s.map((t,n)=>(0,r.jsx)("button",{type:"button",onClick:()=>b("bg",n),title:t.name,className:(0,y.cn)("rounded-full transition-shadow",c?"size-8":"size-7",e.bg===n?"ring-2 ring-primary ring-offset-2":"ring-1 ring-border"),style:{background:`linear-gradient(135deg, ${t.gradient[0]}, ${t.gradient[1]}, ${t.gradient[2]})`}},t.value))})]})]})]})]});return N?(0,r.jsxs)("div",{className:"flex gap-4",children:[z,E]}):(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[z,E]})}var C=e.i(779646),w=e.i(996718);e.s(["AvatarPickerDialog",0,function({config:e,onChange:n}){let[a,s]=(0,t.useState)(!1),[o,i]=(0,t.useState)(e),l=(0,w.useIsMobile)();return(0,r.jsxs)(C.Dialog,{open:a,onOpenChange:r=>{r&&i(e),s(r)},children:[(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(C.DialogTrigger,{render:(0,r.jsx)("button",{type:"button",className:"rounded-2xl bg-background p-1.5 shadow-sm border border-border hover:border-primary/40 transition-colors cursor-pointer"}),children:(0,r.jsx)(g,{config:e,size:80})})}),(0,r.jsxs)(C.DialogContent,{className:l?"top-auto left-0 translate-x-0 translate-y-0 bottom-0 max-w-full sm:max-w-full w-full rounded-b-none rounded-t-xl max-h-[85dvh] overflow-y-auto pb-[env(safe-area-inset-bottom)]":"sm:max-w-180",children:[(0,r.jsx)(C.DialogHeader,{children:(0,r.jsx)(C.DialogTitle,{children:"Choose Avatar"})}),(0,r.jsx)(k,{config:o,layout:l?"vertical":"horizontal",onChange:e=>{i(e),n(e)},mobile:l}),l&&(0,r.jsx)("button",{type:"button",onClick:()=>s(!1),className:"w-full rounded-xl bg-primary py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:"Done"})]})]})}],108772),e.s([],400175)},952003,e=>{"use strict";let r=(0,e.i(706875).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,r],952003)},575607,e=>{"use strict";var r=e.i(29512);e.s(["Check",()=>r.default])},208020,(e,r,t)=>{r.exports=e.r(170928)},706875,e=>{"use strict";var r=e.i(298699);let t=(...e)=>e.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim(),n=e=>{let r=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,t)=>t?t.toUpperCase():r.toLowerCase());return r.charAt(0).toUpperCase()+r.slice(1)};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,r.createContext)({}),o=(0,r.forwardRef)(({color:e,size:n,strokeWidth:o,absoluteStrokeWidth:i,className:l="",children:d,iconNode:c,...u},f)=>{let{size:x=24,strokeWidth:h=2,absoluteStrokeWidth:m=!1,color:p="currentColor",className:g=""}=(0,r.useContext)(s)??{},b=i??m?24*Number(o??h)/Number(n??x):o??h;return(0,r.createElement)("svg",{ref:f,...a,width:n??x??a.width,height:n??x??a.height,stroke:e??p,strokeWidth:b,className:t("lucide",g,l),...!d&&!(e=>{for(let r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0;return!1})(u)&&{"aria-hidden":"true"},...u},[...c.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(d)?d:[d]])});e.s(["default",0,(e,a)=>{let s=(0,r.forwardRef)(({className:s,...i},l)=>(0,r.createElement)(o,{ref:l,iconNode:a,className:t(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...i}));return s.displayName=n(e),s}],706875)},616117,484665,e=>{"use strict";e.i(459119);var r=e.i(298699),t=e.i(92615),n=e.i(773825),a=e.i(389068),s=e.i(943891),o=e.i(398258);let i=r.createContext(void 0);function l(e=!1){let t=r.useContext(i);if(void 0===t&&!e)throw Error((0,o.default)(16));return t}function d(e){return(0,t.isHTMLElement)(e)&&"BUTTON"===e.tagName}e.s(["CompositeRootContext",0,i,"useCompositeRootContext",0,l],484665),e.s(["useButton",0,function(e={}){let{disabled:t=!1,focusableWhenDisabled:o,tabIndex:i=0,native:c=!0,composite:u}=e,f=r.useRef(null),x=l(!0),h=u??void 0!==x,{props:m}=function(e){let{focusableWhenDisabled:t,disabled:n,composite:a=!1,tabIndex:s=0,isNativeButton:o}=e,i=a&&!1!==t,l=a&&!1===t;return{props:r.useMemo(()=>{let e={onKeyDown(e){n&&t&&"Tab"!==e.key&&e.preventDefault()}};return a||(e.tabIndex=s,!o&&n&&(e.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(e["aria-disabled"]=n),o&&(!t||l)&&(e.disabled=n),e},[a,n,t,i,l,o,s])}}({focusableWhenDisabled:o,disabled:t,composite:h,tabIndex:i,isNativeButton:c}),p=r.useCallback(()=>{let e=f.current;d(e)&&h&&t&&void 0===m.disabled&&e.disabled&&(e.disabled=!1)},[t,m.disabled,h]);return(0,a.useIsoLayoutEffect)(p,[p]),{getButtonProps:r.useCallback((e={})=>{let{onClick:r,onMouseDown:n,onKeyUp:a,onKeyDown:o,onPointerDown:i,...l}=e,u=c?"button":void 0;return(0,s.mergeProps)({type:u,onClick(e){t?e.preventDefault():r?.(e)},onMouseDown(e){t||n?.(e)},onKeyDown(e){var n;if(t||((0,s.makeEventPreventable)(e),o?.(e),e.baseUIHandlerPrevented))return;let a=e.target===e.currentTarget,i=e.currentTarget,l=d(i),u=!c&&(n=i,!!(n?.tagName==="A"&&n?.href)),f=a&&(c?l:!u),x="Enter"===e.key,m=" "===e.key,p=i.getAttribute("role"),g=p?.startsWith("menuitem")||"option"===p||"gridcell"===p;if(a&&h&&m){if(e.defaultPrevented&&g)return;e.preventDefault(),u||c&&l?(i.click(),e.preventBaseUIHandler()):f&&(r?.(e),e.preventBaseUIHandler());return}f&&(!c&&(m||x)&&e.preventDefault(),!c&&x&&r?.(e))},onKeyUp(e){t||(((0,s.makeEventPreventable)(e),a?.(e),e.target===e.currentTarget&&c&&h&&d(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||c||h||" "!==e.key||r?.(e)))},onPointerDown(e){t?e.preventDefault():i?.(e)}},c?void 0:{role:"button"},m,l)},[t,m,h,c]),buttonRef:(0,n.useStableCallback)(e=>{f.current=e,p()})}}],616117)},294237,e=>{"use strict";var r=e.i(7284);let t=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=r.clsx;e.s(["cva",0,(e,r)=>a=>{var s;if((null==r?void 0:r.variants)==null)return n(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:o,defaultVariants:i}=r,l=Object.keys(o).map(e=>{let r=null==a?void 0:a[e],n=null==i?void 0:i[e];if(null===r)return null;let s=t(r)||t(n);return o[e][s]}),d=a&&Object.entries(a).reduce((e,r)=>{let[t,n]=r;return void 0===n||(e[t]=n),e},{});return n(e,l,null==r||null==(s=r.compoundVariants)?void 0:s.reduce((e,r)=>{let{class:t,className:n,...a}=r;return Object.entries(a).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...i,...d}[r]):({...i,...d})[r]===t})?[...e,t,n]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}])},186339,e=>{"use strict";var r=e.i(368075);e.i(459119);var t=e.i(298699),n=e.i(616117),a=e.i(597849);let s=t.forwardRef(function(e,r){let{render:t,className:s,disabled:o=!1,focusableWhenDisabled:i=!1,nativeButton:l=!0,style:d,...c}=e,{getButtonProps:u,buttonRef:f}=(0,n.useButton)({disabled:o,focusableWhenDisabled:i,native:l});return(0,a.useRenderElement)("button",e,{state:{disabled:o},ref:[r,f],props:[c,u]})});var o=e.i(294237),i=e.i(613349);let l=(0,o.cva)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:t="default",size:n="default",...a}){return(0,r.jsx)(s,{"data-slot":"button",className:(0,i.cn)(l({variant:t,size:n,className:e})),...a})},"buttonVariants",0,l],186339)},29512,e=>{"use strict";let r=(0,e.i(706875).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,r])},858924,e=>{"use strict";let r=(0,e.i(706875).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,r],858924)},934351,e=>{"use strict";var r=e.i(368075),t=e.i(613349);e.s(["Card",0,function({className:e,size:n="default",...a}){return(0,r.jsx)("div",{"data-slot":"card","data-size":n,className:(0,t.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...a})},"CardAction",0,function({className:e,...n}){return(0,r.jsx)("div",{"data-slot":"card-action",className:(0,t.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...n})},"CardContent",0,function({className:e,...n}){return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,t.cn)("px-4 group-data-[size=sm]/card:px-3",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,r.jsx)("div",{"data-slot":"card-header",className:(0,t.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,r.jsx)("div",{"data-slot":"card-title",className:(0,t.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...n})}])},972248,e=>{"use strict";let r=(0,e.i(706875).default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);e.s(["LogOut",0,r],972248)},371406,e=>{"use strict";var r=e.i(368075),t=e.i(298699),n=e.i(186339),a=e.i(575607),s=e.i(880932),o=e.i(613349);function i({step:e,completed:t}){return t?(0,r.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-emerald-500 text-white transition-all duration-300",children:(0,r.jsx)(a.Check,{className:"size-3",strokeWidth:3})}):(0,r.jsx)("span",{className:"flex items-center justify-center size-5 rounded-full bg-foreground text-background text-xs font-semibold",children:e})}e.s(["ConnectMachineSteps",0,function({generatedToken:e,generatingToken:a,onGenerateToken:l,registered:d}){let c=(0,t.useRef)(!1);(0,t.useEffect)(()=>{e||a||c.current||(c.current=!0,l())},[e,a,l]);let u=()=>{navigator.clipboard.writeText(`${(0,o.cliCmd)()} register --token ${e}`),s.toast.success("Copied to clipboard")},f=`${(0,o.cliCmd)()} daemon start`,x=()=>{navigator.clipboard.writeText(f),s.toast.success("Copied to clipboard")};return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,r.jsx)(i,{step:1,completed:d}),"Register your CLI",d&&(0,r.jsx)("span",{className:"text-xs text-emerald-500 font-normal",children:"Done"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"Run this in your terminal to link your machine."}),a?(0,r.jsx)("div",{className:"pl-7",children:(0,r.jsx)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground animate-pulse",children:"Generating token..."})}):e?(0,r.jsxs)("div",{className:"pl-7 space-y-2",children:[(0,r.jsxs)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors break-all",onClick:u,title:"Click to copy",children:[(0,o.cliCmd)()," register --token"," ",(0,r.jsx)("span",{className:"text-foreground/70",children:e})]}),!d&&(0,r.jsx)(n.Button,{size:"sm",onClick:u,className:"w-full",children:"Copy Command"})]}):null]}),(0,r.jsxs)("div",{className:`space-y-2 transition-opacity duration-300 ${!d?"opacity-40 pointer-events-none":""}`,children:[(0,r.jsxs)("p",{className:"text-sm font-medium flex items-center gap-2",children:[(0,r.jsx)(i,{step:2,completed:!1}),"Start the daemon"]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground pl-7",children:"The daemon connects your local agents to Alook."}),(0,r.jsx)("div",{className:"ml-7 rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors",onClick:x,title:"Click to copy",children:f}),d&&(0,r.jsx)("div",{className:"pl-7",children:(0,r.jsx)(n.Button,{size:"sm",onClick:x,className:"w-full",children:"Copy Command"})})]})]})}])}]);