@alook/app 0.0.139 → 0.0.140

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 (68) hide show
  1. package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
  2. package/bundled/web/.open-next/assets/BUILD_ID +1 -1
  3. package/bundled/web/.open-next/assets/_next/static/chunks/{3a4lcn1k6my37.js → 0u1g621cl6cpa.js} +1 -1
  4. package/bundled/web/.open-next/assets/_next/static/chunks/{0gadq1gaq7l2d.js → 0v8_t40u7sj2s.js} +3 -3
  5. package/bundled/web/.open-next/assets/_next/static/chunks/{2h7oy-ljwoem9.js → 1avrt94npx8p3.js} +1 -1
  6. package/bundled/web/.open-next/assets/_next/static/chunks/{0rmmmmqzr5q8u.js → 1vdalq9vvychb.js} +1 -1
  7. package/bundled/web/.open-next/cache/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/_global-error.cache +1 -1
  8. package/bundled/web/.open-next/cache/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/_not-found.cache +1 -1
  9. package/bundled/web/.open-next/cache/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/device.cache +1 -1
  10. package/bundled/web/.open-next/cache/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/privacy.cache +1 -1
  11. package/bundled/web/.open-next/cache/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/sitemap.xml.cache +1 -1
  12. package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
  13. package/bundled/web/.open-next/cloudflare/init.js +1 -1
  14. package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
  15. package/bundled/web/.open-next/middleware/handler.mjs +4 -4
  16. package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
  17. package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
  18. package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
  19. package/bundled/web/.open-next/server-functions/default/src/web/.next/required-server-files.json +1 -1
  20. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
  21. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/new/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]/activity/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]/chat/[convId]/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]/chat/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]/email/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/[id]/files/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/[id]/meetings/page_client-reference-manifest.js +1 -1
  28. 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
  29. 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
  30. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
  31. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
  32. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/flags/page_client-reference-manifest.js +1 -1
  33. 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
  34. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
  35. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
  36. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/page_client-reference-manifest.js +1 -1
  37. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
  38. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
  39. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/traces/[traceId]/page_client-reference-manifest.js +1 -1
  40. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/traces/page_client-reference-manifest.js +1 -1
  41. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
  42. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/workspaces/page_client-reference-manifest.js +1 -1
  43. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
  44. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  45. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/device/page_client-reference-manifest.js +1 -1
  46. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page_client-reference-manifest.js +1 -1
  47. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  48. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
  49. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
  50. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__13aweo1._.js +1 -1
  51. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0qgcnj5._.js +1 -1
  52. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_1kzi5ju._.js +1 -1
  53. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_runtimes_page_tsx_11-1juy._.js +1 -1
  54. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
  55. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
  56. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
  57. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
  58. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +6 -6
  59. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +33 -33
  60. package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +4 -4
  61. package/bundled/web/wrangler.toml +1 -1
  62. package/dist/cli/index.js +11 -10
  63. package/dist/index.js +37 -11
  64. package/package.json +1 -1
  65. /package/bundled/web/.open-next/assets/_next/static/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/_buildManifest.js +0 -0
  66. /package/bundled/web/.open-next/assets/_next/static/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/_clientMiddlewareManifest.js +0 -0
  67. /package/bundled/web/.open-next/assets/_next/static/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/_ssgManifest.js +0 -0
  68. /package/bundled/web/.open-next/cache/{0z9UpPLBZKa_jgTjfoBR5 → WTLpHjXNd0wVnZOUBMJJz}/robots.txt.cache +0 -0
@@ -156,7 +156,7 @@ var DOQueueHandler = class extends DurableObject {
156
156
  method: "HEAD",
157
157
  headers: {
158
158
  // This is defined during build
159
- "x-prerender-revalidate": "ad9eb5749e96d72f91a46e5bf04b9636",
159
+ "x-prerender-revalidate": "6485355b57efc1e9d711871bec451241",
160
160
  "x-isr": "1"
161
161
  },
162
162
  // This one is kind of problematic, it will always show the wall time of the revalidation to `this.revalidationTimeout`
@@ -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
- "0z9UpPLBZKa_jgTjfoBR5"
183
+ "WTLpHjXNd0wVnZOUBMJJz"
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), "0z9UpPLBZKa_jgTjfoBR5");
235
+ this.sql.exec("INSERT OR REPLACE INTO failed_state (id, data, buildId) VALUES (?, ?, ?)", msg.MessageDeduplicationId, JSON.stringify(updatedFailedState), "WTLpHjXNd0wVnZOUBMJJz");
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 != ?", "0z9UpPLBZKa_jgTjfoBR5");
260
- this.sql.exec("DELETE FROM sync WHERE buildId != ?", "0z9UpPLBZKa_jgTjfoBR5");
259
+ this.sql.exec("DELETE FROM failed_state WHERE buildId != ?", "WTLpHjXNd0wVnZOUBMJJz");
260
+ this.sql.exec("DELETE FROM sync WHERE buildId != ?", "WTLpHjXNd0wVnZOUBMJJz");
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
- 0z9UpPLBZKa_jgTjfoBR5
1
+ WTLpHjXNd0wVnZOUBMJJz
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,934351,e=>{"use strict";var s=e.i(653772),t=e.i(613349);e.s(["Card",0,function({className:e,size:a="default",...r}){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),...r})},"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(653772),t=e.i(646769);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 r({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 n({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 c({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 o({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)(r,{className:m});case"opencode":return(0,s.jsx)(n,{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)(c,{className:m});case"cursor":return(0,s.jsx)(o,{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(653772),t=e.i(511043),a=e.i(186339),r=e.i(329686),n=e.i(353155);let i=(0,e.i(419412).default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var l=e.i(945074),d=e.i(516266),c=e.i(613349);e.i(954194);var o=e.i(824863);e.s(["ConnectMachineSteps",0,function({generatedToken:e,generatingToken:u,onGenerateToken:m,registered:x,daemonOnline:h}){let f=(0,t.useRef)(!1),p="desktop"===(0,c.getAppMode)(),[g,C]=(0,t.useState)(!1),[j,v]=(0,t.useState)(null);(0,t.useEffect)(()=>{p&&(0,o.isTauri)()&&(0,o.tauriInvoke)("get_cli_info").then(e=>v(e.command)).catch(()=>{})},[p]),(0,t.useEffect)(()=>{e||u||f.current||(f.current=!0,m())},[e,u,m]);let N=`${(0,c.cliCmd)()} register --token ${e}`,y=()=>{navigator.clipboard.writeText(N),d.toast.success("Copied to clipboard")},w=async()=>{if((0,o.isTauri)()){C(!0);try{let s=await (0,o.tauriInvoke)("register_cli",{token:e});s.success?d.toast.success("Registered successfully"):d.toast.error(s.message||"Registration failed")}catch{d.toast.error("Failed to execute registration")}finally{C(!1)}}};return x&&h?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-emerald-600",children:[(0,s.jsx)(n.Check,{className:"size-4"}),"Computer connected"]}):(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Connect a computer"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:p?"Click to register your machine with Alook.":"Run this in your terminal to link your machine."}),u?(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.jsx)("div",{className:"space-y-2",children:p?(0,s.jsx)(a.Button,{size:"sm",onClick:w,disabled:g,className:"w-full",title:j?`${j} register --token <token>`:void 0,children:g?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Loader2,{className:"size-3 animate-spin mr-1"})," Registering..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i,{className:"size-3 mr-1"})," Register"]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.Tooltip,{children:[(0,s.jsx)(r.TooltipTrigger,{render:(0,s.jsx)("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:y}),children:N}),(0,s.jsx)(r.TooltipContent,{children:"Click to copy"})]}),(0,s.jsx)(a.Button,{size:"sm",onClick:y,className:"w-full",children:"Copy Command"})]})}):null]})}],371406)},7374,e=>{"use strict";var s=e.i(653772),t=e.i(511043),a=e.i(126942),r=e.i(355578),n=e.i(186339),i=e.i(875061),l=e.i(934351),d=e.i(332680),c=e.i(393153),o=e.i(329686),u=e.i(516266),m=e.i(728886),x=e.i(646769),h=e.i(947308);e.i(954194);var f=e.i(907903),p=e.i(824863),g=e.i(613349),C=e.i(855372),j=e.i(222862),v=e.i(945074),N=e.i(758870),y=e.i(371406),w=e.i(205189);e.s(["default",0,function(){let{agents:e,runtimes:b,loading:k,handleGenerateToken:S,handleDeleteMachine:A,subscribeWs:L,workspaceId:R}=(0,r.useAgentContext)(),z=(0,a.useSearchParams)(),M=(0,a.useRouter)(),B=(0,a.usePathname)(),T=(0,g.getAppMode)(),V=(0,p.isTauri)()&&(0,p.isDesktop)(),H="mobile"===T||V,[F,D]=(0,t.useState)(()=>z.has("connect")),[P,U]=(0,t.useState)(""),[I,O]=(0,t.useState)(!1),[K,X]=(0,t.useState)(null),[G,_]=(0,t.useState)(!1),[Z,E]=(0,t.useState)(null),[Y,q]=(0,t.useState)(new Set),[J,Q]=(0,t.useState)(new Set),[W,$]=(0,t.useState)(!1),[ee,es]=(0,t.useState)(""),[et,ea]=(0,t.useState)(""),[er,en]=(0,t.useState)("Remove"),[ei,el]=(0,t.useState)(void 0),[ed,ec]=(0,t.useState)("destructive"),[eo,eu]=(0,t.useState)(!1),em=(0,t.useRef)(null);(0,t.useEffect)(()=>{(0,j.fetchLatestCliVersion)().then(e=>E(e.version)).catch(()=>{})},[]),(0,t.useEffect)(()=>{z.has("connect")&&M.replace(B,{scroll:!1})},[z,M,B]);let ex=(0,t.useRef)(F);(0,t.useEffect)(()=>{ex.current=F},[F]);let eh=(0,t.useRef)(e);(0,t.useEffect)(()=>{eh.current=e},[e]);let ef=(0,t.useRef)(K);(0,t.useEffect)(()=>{ef.current=K},[K]),(0,t.useEffect)(()=>L(e=>{if(ex.current&&("runtime.registered"===e.type&&e.workspaceId===R&&X(e.daemonId),"runtime.status"===e.type&&e.workspaceId===R&&"online"===e.status&&ef.current&&e.daemonId===ef.current)&&((0,w.trackRuntimeConnected)({runtime_type:"desktop"}),D(!1),U(""),X(null),_(!1),u.toast.success("Machine connected"),0===eh.current.length)){let e=B.split("/")[2];M.push(`/w/${e}/agents/new`)}}),[L,R,B,M]);let ep=(e,s,t,a)=>{es(e),ea(s),en(a?.label??"Remove"),el(a?.loadingLabel),ec(a?.variant??"destructive"),em.current=t,$(!0)},eg=async()=>{if(em.current){eu(!0);try{await em.current()}finally{eu(!1),$(!1),em.current=null}}},eC=(0,t.useCallback)(async()=>{O(!0);try{let e=await S();e&&U(e)}finally{O(!1)}},[S]),ej=async(e,s)=>{q(e=>new Set(e).add(s));try{await (0,j.triggerRuntimeUpdate)(e,R),u.toast.success("Update triggered")}catch{u.toast.error("Failed to trigger update"),q(e=>{let t=new Set(e);return t.delete(s),t})}},ev=async(e,s)=>{Q(e=>new Set(e).add(s));try{await (0,j.triggerRuntimeRescan)(e,R),u.toast.success("Rescan triggered — daemon will restart to detect runtimes")}catch{u.toast.error("Failed to trigger rescan"),Q(e=>{let t=new Set(e);return t.delete(s),t})}},eN=(0,t.useMemo)(()=>{if(0===Y.size)return Y;let e=new Set;for(let s of b){let t=s.daemon_id||s.id;Y.has(t)&&s.pending_update_version&&e.add(t)}return e},[b,Y]),ey=(0,t.useMemo)(()=>{if(0===J.size)return J;let e=new Set;for(let s of b){let t=s.daemon_id||s.id;J.has(t)&&s.pending_rescan&&e.add(t)}return e},[b,J]),ew=new Map;for(let e of b){let s=e.daemon_id||e.id;if(!ew.has(s)){let t=e.metadata;ew.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:[]})}ew.get(s).runtimes.push(e)}return k?(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)(m.Skeleton,{className:"h-4 w-16"}),(0,s.jsx)(m.Skeleton,{className:"h-3 w-52"})]}),(0,s.jsx)(m.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)(m.Skeleton,{className:"size-4 rounded"}),(0,s.jsx)(m.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)(m.Skeleton,{className:"h-3 w-20"}),(0,s.jsx)(m.Skeleton,{className:"h-3 w-28"})]}),(0,s.jsx)(m.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."})]}),!H&&(0,s.jsxs)(n.Button,{size:"sm",variant:"outline",onClick:()=>{U(""),X(null),D(!0)},disabled:I,children:[(0,s.jsx)(h.Plus,{className:"size-3.5"}),"New machine"]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:0===b.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:H?"No machines connected. Use the desktop app or CLI to connect a machine.":"Connect a machine to start running agents locally."}),!H&&(0,s.jsx)(n.Button,{size:"sm",className:"mt-4 glow-border",onClick:()=>{U(""),D(!0)},children:"Connect Machine"})]})}):(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from(ew.entries()).map(([e,t])=>{let a,r,d,c=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)(x.Monitor,{className:"size-4 text-muted-foreground shrink-0"}),(0,s.jsx)(l.CardTitle,{className:"truncate",children:c}),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||eN.has(e),r=Z&&(!t.cliVersion||!(0,f.semverGte)(t.cliVersion,Z)),a?(0,s.jsxs)(n.Button,{variant:"ghost",size:"sm",disabled:!0,className:"text-xs h-6 px-2",children:[(0,s.jsx)(v.Loader2,{className:"size-3 animate-spin mr-1"}),"Updating..."]}):r?(0,s.jsx)(n.Button,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:()=>ep("Update daemon",`This will update the daemon on "${c}" to the latest CLI version. The daemon will restart during the update.`,async()=>{await ej(t.runtimes[0].id,e)},{label:"Update",loadingLabel:"Updating...",variant:"default"}),children:"Update"}):null),(d=t.pendingRescan||ey.has(e),"online"!==t.status?null:d?(0,s.jsxs)(n.Button,{variant:"ghost",size:"sm",disabled:!0,className:"text-xs h-6 px-2",children:[(0,s.jsx)(N.RefreshCw,{className:"size-3 animate-spin mr-1"}),"Rescanning..."]}):(0,s.jsxs)(n.Button,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:()=>ep("Rescan runtimes",`This will restart the daemon on "${c}" to re-detect available runtimes (Claude Code, Codex, OpenCode).`,async()=>{await ev(t.runtimes[0].id,e)},{label:"Rescan",loadingLabel:"Triggering...",variant:"default"}),children:[(0,s.jsx)(N.RefreshCw,{className:"size-3 mr-1"}),"Rescan"]})),(0,s.jsx)(n.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-6 px-2 hover:text-destructive",onClick:()=>{ep("Remove machine",`This will remove "${c}" and all its runtimes. Agents using these runtimes will be unlinked.`,async()=>{await A(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)(C.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:"}),"desktop"===T&&(0,p.isTauri)()?(0,s.jsx)(n.Button,{size:"sm",variant:"outline",className:"w-full h-7 text-[11px]",onClick:async()=>{try{await (0,p.tauriInvoke)("daemon_start"),u.toast.success("Daemon started")}catch{u.toast.error("Failed to start daemon")}},children:"Start Daemon"}):(0,s.jsxs)(o.Tooltip,{children:[(0,s.jsxs)(o.TooltipTrigger,{render:(0,s.jsx)("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,g.cliCmd)()} daemon start`),u.toast.success("Copied to clipboard")}}),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,g.cliCmd)()," daemon start"]})]}),(0,s.jsx)(o.TooltipContent,{children:"Click to copy"})]})]})]})})]},e)})})}),(0,s.jsx)(d.Sheet,{open:F,onOpenChange:e=>{D(e),e||U("")},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)(y.ConnectMachineSteps,{generatedToken:P,generatingToken:I,onGenerateToken:eC,registered:!!K,daemonOnline:G})})]})}),(0,s.jsx)(c.ConfirmDialog,{open:W,onOpenChange:$,title:ee,description:et,confirmLabel:er,loadingLabel:ei,confirmVariant:ed,loading:eo,onConfirm:eg})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,934351,e=>{"use strict";var s=e.i(653772),t=e.i(613349);e.s(["Card",0,function({className:e,size:a="default",...r}){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),...r})},"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(653772),t=e.i(646769);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 r({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 n({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 c({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 o({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)(r,{className:m});case"opencode":return(0,s.jsx)(n,{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)(c,{className:m});case"cursor":return(0,s.jsx)(o,{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(653772),t=e.i(511043),a=e.i(186339),r=e.i(329686),n=e.i(353155);let i=(0,e.i(419412).default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var l=e.i(945074),d=e.i(516266),c=e.i(613349);e.i(954194);var o=e.i(824863);e.s(["ConnectMachineSteps",0,function({generatedToken:e,generatingToken:u,onGenerateToken:m,registered:x,daemonOnline:h}){let f=(0,t.useRef)(!1),p="desktop"===(0,c.getAppMode)(),[g,C]=(0,t.useState)(!1),[j,v]=(0,t.useState)(null);(0,t.useEffect)(()=>{p&&(0,o.isTauri)()&&(0,o.tauriInvoke)("get_cli_info").then(e=>v(e.command)).catch(()=>{})},[p]),(0,t.useEffect)(()=>{e||u||f.current||(f.current=!0,m())},[e,u,m]);let N=`${(0,c.cliCmd)()} register --token ${e}`,y=()=>{navigator.clipboard.writeText(N),d.toast.success("Copied to clipboard")},w=async()=>{if((0,o.isTauri)()){C(!0);try{let s=await (0,o.tauriInvoke)("register_cli",{token:e});s.success?d.toast.success("Registered successfully"):d.toast.error(s.message||"Registration failed")}catch{d.toast.error("Failed to execute registration")}finally{C(!1)}}};return x&&h?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-emerald-600",children:[(0,s.jsx)(n.Check,{className:"size-4"}),"Computer connected"]}):(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Connect a computer"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:p?"Click to register your machine with Alook.":"Run this in your terminal to link your machine."}),u?(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.jsx)("div",{className:"space-y-2",children:p?(0,s.jsx)(a.Button,{size:"sm",onClick:w,disabled:g,className:"w-full",title:j?`${j} register --token <token>`:void 0,children:g?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Loader2,{className:"size-3 animate-spin mr-1"})," Registering..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i,{className:"size-3 mr-1"})," Register"]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.Tooltip,{children:[(0,s.jsx)(r.TooltipTrigger,{render:(0,s.jsx)("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:y}),children:N}),(0,s.jsx)(r.TooltipContent,{children:"Click to copy"})]}),(0,s.jsx)(a.Button,{size:"sm",onClick:y,className:"w-full",children:"Copy Command"})]})}):null]})}],371406)},7374,e=>{"use strict";var s=e.i(653772),t=e.i(511043),a=e.i(126942),r=e.i(355578),n=e.i(186339),i=e.i(875061),l=e.i(934351),d=e.i(332680),c=e.i(393153),o=e.i(329686),u=e.i(516266),m=e.i(728886),x=e.i(646769),h=e.i(947308);e.i(954194);var f=e.i(907903),p=e.i(824863),g=e.i(613349),C=e.i(855372),j=e.i(222862),v=e.i(945074),N=e.i(758870),y=e.i(371406),w=e.i(205189);e.s(["default",0,function(){let{agents:e,runtimes:b,loading:k,handleGenerateToken:S,handleDeleteMachine:A,subscribeWs:L,workspaceId:R}=(0,r.useAgentContext)(),z=(0,a.useSearchParams)(),M=(0,a.useRouter)(),B=(0,a.usePathname)(),T=(0,g.getAppMode)(),V=(0,p.isTauri)()&&(0,p.isDesktop)(),H="mobile"===T||V,[F,D]=(0,t.useState)(()=>z.has("connect")),[P,U]=(0,t.useState)(""),[I,O]=(0,t.useState)(!1),[K,X]=(0,t.useState)(null),[G,_]=(0,t.useState)(!1),[Z,E]=(0,t.useState)(null),[Y,q]=(0,t.useState)(new Set),[J,Q]=(0,t.useState)(new Set),[W,$]=(0,t.useState)(!1),[ee,es]=(0,t.useState)(""),[et,ea]=(0,t.useState)(""),[er,en]=(0,t.useState)("Remove"),[ei,el]=(0,t.useState)(void 0),[ed,ec]=(0,t.useState)("destructive"),[eo,eu]=(0,t.useState)(!1),em=(0,t.useRef)(null);(0,t.useEffect)(()=>{(0,j.fetchLatestCliVersion)().then(e=>E(e.version)).catch(()=>{})},[]),(0,t.useEffect)(()=>{z.has("connect")&&M.replace(B,{scroll:!1})},[z,M,B]);let ex=(0,t.useRef)(F);(0,t.useEffect)(()=>{ex.current=F},[F]);let eh=(0,t.useRef)(e);(0,t.useEffect)(()=>{eh.current=e},[e]);let ef=(0,t.useRef)(K);(0,t.useEffect)(()=>{ef.current=K},[K]),(0,t.useEffect)(()=>L(e=>{if(ex.current&&("runtime.registered"===e.type&&e.workspaceId===R&&X(e.daemonId),"runtime.status"===e.type&&e.workspaceId===R&&"online"===e.status&&ef.current&&e.daemonId===ef.current)&&((0,w.trackRuntimeConnected)({runtime_type:"desktop"}),D(!1),U(""),X(null),_(!1),u.toast.success("Machine connected"),0===eh.current.length)){let e=B.split("/")[2];M.push(`/w/${e}/agents/new`)}}),[L,R,B,M]);let ep=(e,s,t,a)=>{es(e),ea(s),en(a?.label??"Remove"),el(a?.loadingLabel),ec(a?.variant??"destructive"),em.current=t,$(!0)},eg=async()=>{if(em.current){eu(!0);try{await em.current()}finally{eu(!1),$(!1),em.current=null}}},eC=(0,t.useCallback)(async()=>{O(!0);try{let e=await S();e&&U(e)}finally{O(!1)}},[S]),ej=async(e,s)=>{q(e=>new Set(e).add(s));try{await (0,j.triggerRuntimeUpdate)(e,R),u.toast.success("Update triggered")}catch{u.toast.error("Failed to trigger update"),q(e=>{let t=new Set(e);return t.delete(s),t})}},ev=async(e,s)=>{Q(e=>new Set(e).add(s));try{await (0,j.triggerRuntimeRescan)(e,R),u.toast.success("Rescan triggered — daemon will restart to detect runtimes")}catch{u.toast.error("Failed to trigger rescan"),Q(e=>{let t=new Set(e);return t.delete(s),t})}},eN=(0,t.useMemo)(()=>{if(0===Y.size)return Y;let e=new Set;for(let s of Y){let t=b.find(e=>(e.daemon_id||e.id)===s);(!t||t.pending_update_version)&&e.add(s)}return e},[b,Y]),ey=(0,t.useMemo)(()=>{if(0===J.size)return J;let e=new Set;for(let s of b){let t=s.daemon_id||s.id;J.has(t)&&s.pending_rescan&&e.add(t)}return e},[b,J]),ew=new Map;for(let e of b){let s=e.daemon_id||e.id;if(!ew.has(s)){let t=e.metadata;ew.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:[]})}ew.get(s).runtimes.push(e)}return k?(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)(m.Skeleton,{className:"h-4 w-16"}),(0,s.jsx)(m.Skeleton,{className:"h-3 w-52"})]}),(0,s.jsx)(m.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)(m.Skeleton,{className:"size-4 rounded"}),(0,s.jsx)(m.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)(m.Skeleton,{className:"h-3 w-20"}),(0,s.jsx)(m.Skeleton,{className:"h-3 w-28"})]}),(0,s.jsx)(m.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."})]}),!H&&(0,s.jsxs)(n.Button,{size:"sm",variant:"outline",onClick:()=>{U(""),X(null),D(!0)},disabled:I,children:[(0,s.jsx)(h.Plus,{className:"size-3.5"}),"New machine"]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:0===b.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:H?"No machines connected. Use the desktop app or CLI to connect a machine.":"Connect a machine to start running agents locally."}),!H&&(0,s.jsx)(n.Button,{size:"sm",className:"mt-4 glow-border",onClick:()=>{U(""),D(!0)},children:"Connect Machine"})]})}):(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from(ew.entries()).map(([e,t])=>{let a,r,d,c=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)(x.Monitor,{className:"size-4 text-muted-foreground shrink-0"}),(0,s.jsx)(l.CardTitle,{className:"truncate",children:c}),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||eN.has(e),r="online"===t.status&&Z&&(!t.cliVersion||!(0,f.semverGte)(t.cliVersion,Z)),a?(0,s.jsxs)(n.Button,{variant:"ghost",size:"sm",disabled:!0,className:"text-xs h-6 px-2",children:[(0,s.jsx)(v.Loader2,{className:"size-3 animate-spin mr-1"}),"Updating..."]}):r?(0,s.jsx)(n.Button,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:()=>ep("Update daemon",`This will update the daemon on "${c}" to the latest CLI version. The daemon will restart during the update.`,async()=>{await ej(t.runtimes[0].id,e)},{label:"Update",loadingLabel:"Updating...",variant:"default"}),children:"Update"}):null),(d=t.pendingRescan||ey.has(e),"online"!==t.status?null:d?(0,s.jsxs)(n.Button,{variant:"ghost",size:"sm",disabled:!0,className:"text-xs h-6 px-2",children:[(0,s.jsx)(N.RefreshCw,{className:"size-3 animate-spin mr-1"}),"Rescanning..."]}):(0,s.jsxs)(n.Button,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:()=>ep("Rescan runtimes",`This will restart the daemon on "${c}" to re-detect available runtimes (Claude Code, Codex, OpenCode).`,async()=>{await ev(t.runtimes[0].id,e)},{label:"Rescan",loadingLabel:"Triggering...",variant:"default"}),children:[(0,s.jsx)(N.RefreshCw,{className:"size-3 mr-1"}),"Rescan"]})),(0,s.jsx)(n.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-6 px-2 hover:text-destructive",onClick:()=>{ep("Remove machine",`This will remove "${c}" and all its runtimes. Agents using these runtimes will be unlinked.`,async()=>{await A(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)(C.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:"}),"desktop"===T&&(0,p.isTauri)()?(0,s.jsx)(n.Button,{size:"sm",variant:"outline",className:"w-full h-7 text-[11px]",onClick:async()=>{try{await (0,p.tauriInvoke)("daemon_start"),u.toast.success("Daemon started")}catch{u.toast.error("Failed to start daemon")}},children:"Start Daemon"}):(0,s.jsxs)(o.Tooltip,{children:[(0,s.jsxs)(o.TooltipTrigger,{render:(0,s.jsx)("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,g.cliCmd)()} daemon start`),u.toast.success("Copied to clipboard")}}),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,g.cliCmd)()," daemon start"]})]}),(0,s.jsx)(o.TooltipContent,{children:"Click to copy"})]})]})]})})]},e)})})}),(0,s.jsx)(d.Sheet,{open:F,onOpenChange:e=>{D(e),e||U("")},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)(y.ConnectMachineSteps,{generatedToken:P,generatingToken:I,onGenerateToken:eC,registered:!!K,daemonOnline:G})})]})}),(0,s.jsx)(c.ConfirmDialog,{open:W,onOpenChange:$,title:ee,description:et,confirmLabel:er,loadingLabel:ei,confirmVariant:ed,loading:eo,onConfirm:eg})]})}])}]);
@@ -1,5 +1,5 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,860150,(e,t,s)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:s,blurHeight:a,blurDataURL:i,objectFit:n}){let o=s?40*s:e,l=a?40*a:t,c=o&&l?`viewBox='0 0 ${o} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${c}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${c?"none":"contain"===n?"xMidYMid":"cover"===n?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${i}'/%3E%3C/svg%3E`}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},495703,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return i},imageConfigDefault:function(){return n}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let i=["default","imgix","cloudinary","akamai","custom"],n={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},715596,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImgProps",{enumerable:!0,get:function(){return c}}),e.r(519990);let r=e.r(66960),a=e.r(860150),i=e.r(495703),n=["-moz-initial","fill","none","scale-down",void 0];function o(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function c({src:e,sizes:t,unoptimized:s=!1,priority:d=!1,preload:u=!1,loading:m,className:p,quality:h,width:f,height:g,fill:x=!1,style:y,overrideSrc:v,onLoad:b,onLoadingComplete:w,placeholder:j="empty",blurDataURL:C,fetchPriority:k,decoding:N="async",layout:S,objectFit:P,objectPosition:_,lazyBoundary:z,lazyRoot:O,...R},A){var L;let M,I,E,{imgConf:D,showAltText:F,blurComplete:B,defaultLoader:H}=A,T=D||i.imageConfigDefault;if("allSizes"in T)M=T;else{let e=[...T.deviceSizes,...T.imageSizes].sort((e,t)=>e-t),t=T.deviceSizes.sort((e,t)=>e-t),s=T.qualities?.sort((e,t)=>e-t);M={...T,allSizes:e,deviceSizes:t,qualities:s}}if(void 0===H)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let U=R.loader||H;delete R.loader,delete R.srcSet;let Y="__next_img_default"in U;if(Y){if("custom"===M.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
2
- Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=U;U=t=>{let{config:s,...r}=t;return e(r)}}if(S){"fill"===S&&(x=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[S];e&&(y={...y,...e});let s={responsive:"100vw",fill:"100vw"}[S];s&&!t&&(t=s)}let V="",q=l(f),G=l(g);if((L=e)&&"object"==typeof L&&(o(L)||void 0!==L.src)){let t=o(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(I=t.blurWidth,E=t.blurHeight,C=C||t.blurDataURL,V=t.src,!x)if(q||G){if(q&&!G){let e=q/t.width;G=Math.round(t.height*e)}else if(!q&&G){let e=G/t.height;q=Math.round(t.width*e)}}else q=t.width,G=t.height}let $=!d&&!u&&("lazy"===m||void 0===m);(!(e="string"==typeof e?e:V)||e.startsWith("data:")||e.startsWith("blob:"))&&(s=!0,$=!1),M.unoptimized&&(s=!0),Y&&!M.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(s=!0);let X=l(h),W=Object.assign(x?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:P,objectPosition:_}:{},F?{}:{color:"transparent"},y),K=B||"empty"===j?null:"blur"===j?`url("data:image/svg+xml;charset=utf-8,${(0,a.getImageBlurSvg)({widthInt:q,heightInt:G,blurWidth:I,blurHeight:E,blurDataURL:C||"",objectFit:W.objectFit})}")`:`url("${j}")`,Z=n.includes(W.objectFit)?"fill"===W.objectFit?"100% 100%":"cover":W.objectFit,J=K?{backgroundSize:Z,backgroundPosition:W.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:K}:{},Q=function({config:e,src:t,unoptimized:s,width:a,quality:i,sizes:n,loader:o}){if(s){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,r.getDeploymentId)();if(e){let s=t.indexOf("?");if(-1!==s){let r=new URLSearchParams(t.slice(s+1));r.get("dpl")||(r.append("dpl",e),t=t.slice(0,s)+"?"+r.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:c}=function({deviceSizes:e,allSizes:t},s,r){if(r){let s=/(^|\s)(1?\d?\d)vw/g,a=[];for(let e;e=s.exec(r);)a.push(parseInt(e[2]));if(a.length){let s=.01*Math.min(...a);return{widths:t.filter(t=>t>=e[0]*s),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof s?{widths:e,kind:"w"}:{widths:[...new Set([s,2*s].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,n),d=l.length-1;return{sizes:n||"w"!==c?n:"100vw",srcSet:l.map((s,r)=>`${o({config:e,src:t,quality:i,width:s})} ${"w"===c?s:r+1}${c}`).join(", "),src:o({config:e,src:t,quality:i,width:l[d]})}}({config:M,src:e,unoptimized:s,width:q,quality:X,sizes:t,loader:U}),ee=$?"lazy":m;return{props:{...R,loading:ee,fetchPriority:k,width:q,height:G,decoding:N,className:p,style:{...W,...J},sizes:Q.sizes,srcSet:Q.srcSet,src:v||Q.src},meta:{unoptimized:s,preload:u||d,placeholder:j,fill:x}}}},948147,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return o}});let r=e.r(511043),a="u"<typeof window,i=a?()=>{}:r.useLayoutEffect,n=a?()=>{}:r.useEffect;function o(e){let{headManager:t,reduceComponentsToState:s}=e;function o(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(s(e))}}return a&&(t?.mountedInstances?.add(e.children),o()),i(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),i(()=>(t&&(t._pendingUpdate=o),()=>{t&&(t._pendingUpdate=o)})),n(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},818757,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={default:function(){return f},defaultHead:function(){return u}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let i=e.r(481258),n=e.r(744066),o=e.r(653772),l=n._(e.r(511043)),c=i._(e.r(948147)),d=e.r(477441);function u(){return[(0,o.jsx)("meta",{charSet:"utf-8"},"charset"),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function m(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(519990);let p=["name","httpEquiv","charSet","itemProp"];function h(e){let t,s,r,a;return e.reduce(m,[]).reverse().concat(u().reverse()).filter((t=new Set,s=new Set,r=new Set,a={},e=>{let i=!0,n=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){n=!0;let s=e.key.slice(e.key.indexOf("$")+1);t.has(s)?i=!1:t.add(s)}switch(e.type){case"title":case"base":s.has(e.type)?i=!1:s.add(e.type);break;case"meta":for(let t=0,s=p.length;t<s;t++){let s=p[t];if(e.props.hasOwnProperty(s))if("charSet"===s)r.has(s)?i=!1:r.add(s);else{let t=e.props[s],r=a[s]||new Set;("name"!==s||!n)&&r.has(t)?i=!1:(r.add(t),a[s]=r)}}}return i})).reverse().map((e,t)=>{let s=e.key||t;return l.default.cloneElement(e,{key:s})})}let f=function({children:e}){let t=(0,l.useContext)(d.HeadManagerContext);return(0,o.jsx)(c.default,{reduceComponentsToState:h,headManager:t,children:e})};("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},660272,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let r=e.r(481258)._(e.r(511043)),a=e.r(495703),i=r.default.createContext(a.imageConfigDefault)},738821,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(481258)._(e.r(511043)).default.createContext(null)},800643,(e,t,s)=>{"use strict";function r(e,t){let s=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-s)<Math.abs(e-s)?t:e,t.qualities[0]):s}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"findClosestQuality",{enumerable:!0,get:function(){return r}})},179871,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return n}});let r=e.r(800643),a=e.r(66960);function i({config:e,src:t,width:s,quality:n}){let o=(0,a.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")){let e=t.indexOf("?");if(-1!==e){let s=new URLSearchParams(t.slice(e+1)),r=s.get("dpl");if(r){o=r,s.delete("dpl");let a=s.toString();t=t.slice(0,e)+(a?"?"+a:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,860150,(e,t,s)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:s,blurHeight:a,blurDataURL:i,objectFit:n}){let o=s?40*s:e,l=a?40*a:t,c=o&&l?`viewBox='0 0 ${o} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${c}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${c?"none":"contain"===n?"xMidYMid":"cover"===n?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${i}'/%3E%3C/svg%3E`}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},495703,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return i},imageConfigDefault:function(){return n}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let i=["default","imgix","cloudinary","akamai","custom"],n={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},715596,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImgProps",{enumerable:!0,get:function(){return c}}),e.r(519990);let r=e.r(66960),a=e.r(860150),i=e.r(495703),n=["-moz-initial","fill","none","scale-down",void 0];function o(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function c({src:e,sizes:t,unoptimized:s=!1,priority:d=!1,preload:u=!1,loading:m,className:p,quality:h,width:f,height:g,fill:x=!1,style:y,overrideSrc:v,onLoad:b,onLoadingComplete:w,placeholder:j="empty",blurDataURL:C,fetchPriority:k,decoding:N="async",layout:S,objectFit:P,objectPosition:_,lazyBoundary:z,lazyRoot:O,...R},A){var L;let M,E,I,{imgConf:D,showAltText:F,blurComplete:B,defaultLoader:H}=A,T=D||i.imageConfigDefault;if("allSizes"in T)M=T;else{let e=[...T.deviceSizes,...T.imageSizes].sort((e,t)=>e-t),t=T.deviceSizes.sort((e,t)=>e-t),s=T.qualities?.sort((e,t)=>e-t);M={...T,allSizes:e,deviceSizes:t,qualities:s}}if(void 0===H)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let U=R.loader||H;delete R.loader,delete R.srcSet;let Y="__next_img_default"in U;if(Y){if("custom"===M.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
2
+ Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=U;U=t=>{let{config:s,...r}=t;return e(r)}}if(S){"fill"===S&&(x=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[S];e&&(y={...y,...e});let s={responsive:"100vw",fill:"100vw"}[S];s&&!t&&(t=s)}let V="",q=l(f),G=l(g);if((L=e)&&"object"==typeof L&&(o(L)||void 0!==L.src)){let t=o(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(E=t.blurWidth,I=t.blurHeight,C=C||t.blurDataURL,V=t.src,!x)if(q||G){if(q&&!G){let e=q/t.width;G=Math.round(t.height*e)}else if(!q&&G){let e=G/t.height;q=Math.round(t.width*e)}}else q=t.width,G=t.height}let $=!d&&!u&&("lazy"===m||void 0===m);(!(e="string"==typeof e?e:V)||e.startsWith("data:")||e.startsWith("blob:"))&&(s=!0,$=!1),M.unoptimized&&(s=!0),Y&&!M.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(s=!0);let X=l(h),W=Object.assign(x?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:P,objectPosition:_}:{},F?{}:{color:"transparent"},y),K=B||"empty"===j?null:"blur"===j?`url("data:image/svg+xml;charset=utf-8,${(0,a.getImageBlurSvg)({widthInt:q,heightInt:G,blurWidth:E,blurHeight:I,blurDataURL:C||"",objectFit:W.objectFit})}")`:`url("${j}")`,Z=n.includes(W.objectFit)?"fill"===W.objectFit?"100% 100%":"cover":W.objectFit,J=K?{backgroundSize:Z,backgroundPosition:W.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:K}:{},Q=function({config:e,src:t,unoptimized:s,width:a,quality:i,sizes:n,loader:o}){if(s){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,r.getDeploymentId)();if(e){let s=t.indexOf("?");if(-1!==s){let r=new URLSearchParams(t.slice(s+1));r.get("dpl")||(r.append("dpl",e),t=t.slice(0,s)+"?"+r.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:c}=function({deviceSizes:e,allSizes:t},s,r){if(r){let s=/(^|\s)(1?\d?\d)vw/g,a=[];for(let e;e=s.exec(r);)a.push(parseInt(e[2]));if(a.length){let s=.01*Math.min(...a);return{widths:t.filter(t=>t>=e[0]*s),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof s?{widths:e,kind:"w"}:{widths:[...new Set([s,2*s].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,n),d=l.length-1;return{sizes:n||"w"!==c?n:"100vw",srcSet:l.map((s,r)=>`${o({config:e,src:t,quality:i,width:s})} ${"w"===c?s:r+1}${c}`).join(", "),src:o({config:e,src:t,quality:i,width:l[d]})}}({config:M,src:e,unoptimized:s,width:q,quality:X,sizes:t,loader:U}),ee=$?"lazy":m;return{props:{...R,loading:ee,fetchPriority:k,width:q,height:G,decoding:N,className:p,style:{...W,...J},sizes:Q.sizes,srcSet:Q.srcSet,src:v||Q.src},meta:{unoptimized:s,preload:u||d,placeholder:j,fill:x}}}},948147,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return o}});let r=e.r(511043),a="u"<typeof window,i=a?()=>{}:r.useLayoutEffect,n=a?()=>{}:r.useEffect;function o(e){let{headManager:t,reduceComponentsToState:s}=e;function o(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(s(e))}}return a&&(t?.mountedInstances?.add(e.children),o()),i(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),i(()=>(t&&(t._pendingUpdate=o),()=>{t&&(t._pendingUpdate=o)})),n(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},818757,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={default:function(){return f},defaultHead:function(){return u}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let i=e.r(481258),n=e.r(744066),o=e.r(653772),l=n._(e.r(511043)),c=i._(e.r(948147)),d=e.r(477441);function u(){return[(0,o.jsx)("meta",{charSet:"utf-8"},"charset"),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function m(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(519990);let p=["name","httpEquiv","charSet","itemProp"];function h(e){let t,s,r,a;return e.reduce(m,[]).reverse().concat(u().reverse()).filter((t=new Set,s=new Set,r=new Set,a={},e=>{let i=!0,n=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){n=!0;let s=e.key.slice(e.key.indexOf("$")+1);t.has(s)?i=!1:t.add(s)}switch(e.type){case"title":case"base":s.has(e.type)?i=!1:s.add(e.type);break;case"meta":for(let t=0,s=p.length;t<s;t++){let s=p[t];if(e.props.hasOwnProperty(s))if("charSet"===s)r.has(s)?i=!1:r.add(s);else{let t=e.props[s],r=a[s]||new Set;("name"!==s||!n)&&r.has(t)?i=!1:(r.add(t),a[s]=r)}}}return i})).reverse().map((e,t)=>{let s=e.key||t;return l.default.cloneElement(e,{key:s})})}let f=function({children:e}){let t=(0,l.useContext)(d.HeadManagerContext);return(0,o.jsx)(c.default,{reduceComponentsToState:h,headManager:t,children:e})};("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},660272,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let r=e.r(481258)._(e.r(511043)),a=e.r(495703),i=r.default.createContext(a.imageConfigDefault)},738821,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(481258)._(e.r(511043)).default.createContext(null)},800643,(e,t,s)=>{"use strict";function r(e,t){let s=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-s)<Math.abs(e-s)?t:e,t.qualities[0]):s}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"findClosestQuality",{enumerable:!0,get:function(){return r}})},179871,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return n}});let r=e.r(800643),a=e.r(66960);function i({config:e,src:t,width:s,quality:n}){let o=(0,a.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")){let e=t.indexOf("?");if(-1!==e){let s=new URLSearchParams(t.slice(e+1)),r=s.get("dpl");if(r){o=r,s.delete("dpl");let a=s.toString();t=t.slice(0,e)+(a?"?"+a:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
3
3
  Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let l=(0,r.findClosestQuality)(n,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${s}&q=${l}${t.startsWith("/")&&o?`&dpl=${o}`:""}`}i.__next_img_default=!0;let n=i},348935,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"Image",{enumerable:!0,get:function(){return b}});let r=e.r(481258),a=e.r(744066),i=e.r(653772),n=a._(e.r(511043)),o=r._(e.r(280115)),l=r._(e.r(818757)),c=e.r(715596),d=e.r(495703),u=e.r(660272);e.r(519990);let m=e.r(738821),p=r._(e.r(179871)),h=e.r(842781),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,s,r,a,i,n){let o=e?.src;e&&e["data-loaded-src"]!==o&&(e["data-loaded-src"]=o,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&a(!0),s?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,a=!1;s.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function x(e){return n.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let y=(0,n.forwardRef)(({src:e,srcSet:t,sizes:s,height:r,width:a,decoding:o,className:l,style:c,fetchPriority:d,placeholder:u,loading:m,unoptimized:p,fill:f,onLoadRef:y,onLoadingCompleteRef:v,setBlurComplete:b,setShowAltText:w,sizesInput:j,onLoad:C,onError:k,...N},S)=>{let P=(0,n.useCallback)(e=>{e&&(k&&(e.src=e.src),e.complete&&g(e,u,y,v,b,p,j))},[e,u,y,v,b,k,p,j]),_=(0,h.useMergedRef)(S,P);return(0,i.jsx)("img",{...N,...x(d),loading:m,width:a,height:r,decoding:o,"data-nimg":f?"fill":"1",className:l,style:c,sizes:s,srcSet:t,src:e,ref:_,onLoad:e=>{g(e.currentTarget,u,y,v,b,p,j)},onError:e=>{w(!0),"empty"!==u&&b(!0),k&&k(e)}})});function v({isAppRouter:e,imgAttributes:t}){let s={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...x(t.fetchPriority)};return e&&o.default.preload?(o.default.preload(t.src,s),null):(0,i.jsx)(l.default,{children:(0,i.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...s},"__nimg-"+t.src+t.srcSet+t.sizes)})}let b=(0,n.forwardRef)((e,t)=>{let s=(0,n.useContext)(m.RouterContext),r=(0,n.useContext)(u.ImageConfigContext),a=(0,n.useMemo)(()=>{let e=f||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),s=e.deviceSizes.sort((e,t)=>e-t),a=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:s,qualities:a,localPatterns:"u"<typeof window?r?.localPatterns:e.localPatterns}},[r]),{onLoad:o,onLoadingComplete:l}=e,h=(0,n.useRef)(o);(0,n.useEffect)(()=>{h.current=o},[o]);let g=(0,n.useRef)(l);(0,n.useEffect)(()=>{g.current=l},[l]);let[x,b]=(0,n.useState)(!1),[w,j]=(0,n.useState)(!1),{props:C,meta:k}=(0,c.getImgProps)(e,{defaultLoader:p.default,imgConf:a,blurComplete:x,showAltText:w});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{...C,unoptimized:k.unoptimized,placeholder:k.placeholder,fill:k.fill,onLoadRef:h,onLoadingCompleteRef:g,setBlurComplete:b,setShowAltText:j,sizesInput:e.sizes,ref:t}),k.preload?(0,i.jsx)(v,{isAppRouter:!s,imgAttributes:C}):null]})});("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},121649,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={default:function(){return d},getImageProps:function(){return c}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let i=e.r(481258),n=e.r(715596),o=e.r(348935),l=i._(e.r(179871));function c(e){let{props:t}=(0,n.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,s]of Object.entries(t))void 0===s&&delete t[e];return{props:t}}let d=o.Image},837002,(e,t,s)=>{t.exports=e.r(121649)},934351,e=>{"use strict";var t=e.i(653772),s=e.i(613349);e.s(["Card",0,function({className:e,size:r="default",...a}){return(0,t.jsx)("div",{"data-slot":"card","data-size":r,className:(0,s.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,...r}){return(0,t.jsx)("div",{"data-slot":"card-action",className:(0,s.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...r})},"CardContent",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",e),...r})},"CardHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.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),...r})},"CardTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...r})}])},489960,e=>{"use strict";let t=(0,e.i(419412).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,t],489960)},765398,e=>{"use strict";var t=e.i(653772),s=e.i(48663),r=e.i(837002);let a=[{href:"/templates",label:"Templates"},{href:"/blog",label:"Blog"},{href:"https://github.com/alookai/alook",label:"GitHub",external:!0},{href:"https://discord.alook.ai",label:"Discord",external:!0},{href:"https://x.com/alook_ai",label:"X",external:!0},{href:"/privacy",label:"Privacy"}];e.s(["PublicLayout",0,function({maxWidth:e="5xl",breadcrumb:i,leftSlot:n,centerSlot:o,rightSlot:l,footer:c="none",mainClassName:d,children:u}){let m="4xl"===e?"max-w-4xl":"max-w-5xl";return(0,t.jsxs)("div",{className:"min-h-dvh flex flex-col bg-background text-foreground",children:[(0,t.jsx)("nav",{className:"sticky top-0 z-50 bg-background/90 backdrop-blur-sm border-b border-border/40",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-5xl items-center justify-between px-6 py-2.5",children:[n?(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:n}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(s.default,{href:"/",className:"flex items-center gap-1",children:[(0,t.jsx)(r.default,{src:"/alook.svg",alt:"Alook",width:22,height:22}),(0,t.jsx)("span",{className:"text-lg tracking-tight font-bold",style:{fontFamily:"var(--font-brand)"},children:"Alook"})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-sm",children:"/"}),(0,t.jsx)(s.default,{href:`/${i.toLowerCase()}`,className:"text-sm font-medium text-foreground hover:text-muted-foreground transition-colors",children:i})]})]}),o&&(0,t.jsx)("div",{className:"flex items-center gap-3",children:o}),l&&(0,t.jsx)("div",{className:"flex items-center gap-3",children:l})]})}),(0,t.jsx)("main",{className:d?`flex-1 ${d}`:"flex-1",children:u}),"simple"===c&&(0,t.jsx)("footer",{className:"border-t border-border px-6 py-12",children:(0,t.jsx)("div",{className:`mx-auto flex ${m} items-center justify-center`,children:(0,t.jsxs)("span",{className:"text-[10px] uppercase tracking-[0.2em] font-mono text-muted-foreground/50",children:["© ",new Date().getFullYear()," Alook AI"]})})}),"rich"===c&&(0,t.jsx)("footer",{className:"border-t border-border px-6 py-12",children:(0,t.jsxs)("div",{className:`mx-auto flex ${m} flex-col items-center justify-between gap-6 md:flex-row`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)(s.default,{href:"/",className:"flex items-center gap-1",children:[(0,t.jsx)(r.default,{src:"/alook.svg",alt:"Alook",width:20,height:20}),(0,t.jsx)("span",{className:"text-lg tracking-tight font-bold",style:{fontFamily:"var(--font-brand)"},children:"Alook"})]}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-[0.2em] font-mono text-muted-foreground",children:"Your Personal Company"})]}),(0,t.jsx)("nav",{className:"flex flex-wrap items-center justify-center gap-x-5 gap-y-2","aria-label":"Footer navigation",children:a.map(e=>e.external?(0,t.jsx)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] uppercase tracking-[0.15em] font-mono text-muted-foreground transition-opacity hover:opacity-70",children:e.label},e.label):(0,t.jsx)(s.default,{href:e.href,className:"text-[11px] uppercase tracking-[0.15em] font-mono text-muted-foreground transition-opacity hover:opacity-70",children:e.label},e.label))}),(0,t.jsxs)("span",{className:"text-[10px] uppercase tracking-[0.2em] font-mono text-muted-foreground/50",children:["© ",new Date().getFullYear()," Alook AI"]})]})})]})}])},758870,e=>{"use strict";let t=(0,e.i(419412).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],758870)},646769,e=>{"use strict";let t=(0,e.i(419412).default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);e.s(["Monitor",0,t],646769)},855372,e=>{"use strict";var t=e.i(653772),s=e.i(646769);function r({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 16 16",fill:"#D97757",className:e,children:(0,t.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 a({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:e,children:(0,t.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 i({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 240 300",fill:"none",className:e,children:[(0,t.jsx)("path",{d:"M180 240H60V120H180V240Z",fill:"#CFCECD"}),(0,t.jsx)("path",{d:"M180 60H60V240H180V60ZM240 300H0V0H240V300Z",fill:"#211E1E"})]})}function n({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:e,children:[(0,t.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,t.jsx)("path",{d:"M3.5 5.5C2 5 1 6 1.5 7s2 .5 2.2-.7",fill:"#FF6B5A"}),(0,t.jsx)("path",{d:"M12.5 5.5c1.5-.5 2.5.5 2 1.5s-2 .5-2.2-.7",fill:"#FF6B5A"}),(0,t.jsx)("path",{d:"M6.5 3Q5 1.2 4.3 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M9.5 3Q11 1.2 11.7 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:"6.2",cy:"5.2",r:"0.9",fill:"#050810"}),(0,t.jsx)("circle",{cx:"9.8",cy:"5.2",r:"0.9",fill:"#050810"}),(0,t.jsx)("circle",{cx:"6.4",cy:"5",r:"0.3",fill:"#00E5CC"}),(0,t.jsx)("circle",{cx:"10",cy:"5",r:"0.3",fill:"#00E5CC"})]})}function o({className:e}){return(0,t.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 l({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 800 800",fill:"none",className:e,children:[(0,t.jsx)("rect",{width:"800",height:"800",rx:"150",fill:"#09090b"}),(0,t.jsx)("path",{fill:"#fff",fillRule:"evenodd",d:"M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z"}),(0,t.jsx)("path",{fill:"#fff",d:"M517.36 400H634.72V634.72H517.36Z"})]})}function c({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:e,children:(0,t.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 d({className:e}){return(0,t.jsxs)("svg",{viewBox:"600 300 400 400",fill:"none",className:e,children:[(0,t.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,t.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,t.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,t.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,t.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,t.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,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:e,children:[(0,t.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,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gemini-gradient",x1:"0",y1:"0",x2:"24",y2:"24",gradientUnits:"userSpaceOnUse",children:[(0,t.jsx)("stop",{stopColor:"#4285F4"}),(0,t.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,t.jsx)(r,{className:m});case"codex":return(0,t.jsx)(a,{className:m});case"opencode":return(0,t.jsx)(i,{className:m});case"openclaw":return(0,t.jsx)(n,{className:m});case"hermes":return(0,t.jsx)(o,{className:m});case"pi":return(0,t.jsx)(l,{className:m});case"copilot":return(0,t.jsx)(c,{className:m});case"cursor":return(0,t.jsx)(d,{className:m});case"gemini":return(0,t.jsx)(u,{className:m});default:return(0,t.jsx)(s.Monitor,{className:m})}}])},106772,e=>{"use strict";let t=(0,e.i(419412).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,t],106772)},794683,e=>{"use strict";let t=(0,e.i(419412).default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);e.s(["LayoutGrid",0,t],794683)},371406,e=>{"use strict";var t=e.i(653772),s=e.i(511043),r=e.i(186339),a=e.i(329686),i=e.i(353155);let n=(0,e.i(419412).default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var o=e.i(945074),l=e.i(516266),c=e.i(613349);e.i(954194);var d=e.i(824863);e.s(["ConnectMachineSteps",0,function({generatedToken:e,generatingToken:u,onGenerateToken:m,registered:p,daemonOnline:h}){let f=(0,s.useRef)(!1),g="desktop"===(0,c.getAppMode)(),[x,y]=(0,s.useState)(!1),[v,b]=(0,s.useState)(null);(0,s.useEffect)(()=>{g&&(0,d.isTauri)()&&(0,d.tauriInvoke)("get_cli_info").then(e=>b(e.command)).catch(()=>{})},[g]),(0,s.useEffect)(()=>{e||u||f.current||(f.current=!0,m())},[e,u,m]);let w=`${(0,c.cliCmd)()} register --token ${e}`,j=()=>{navigator.clipboard.writeText(w),l.toast.success("Copied to clipboard")},C=async()=>{if((0,d.isTauri)()){y(!0);try{let t=await (0,d.tauriInvoke)("register_cli",{token:e});t.success?l.toast.success("Registered successfully"):l.toast.error(t.message||"Registration failed")}catch{l.toast.error("Failed to execute registration")}finally{y(!1)}}};return p&&h?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-emerald-600",children:[(0,t.jsx)(i.Check,{className:"size-4"}),"Computer connected"]}):(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Connect a computer"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g?"Click to register your machine with Alook.":"Run this in your terminal to link your machine."}),u?(0,t.jsx)("div",{className:"rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground animate-pulse",children:"Generating token..."}):e?(0,t.jsx)("div",{className:"space-y-2",children:g?(0,t.jsx)(r.Button,{size:"sm",onClick:C,disabled:x,className:"w-full",title:v?`${v} register --token <token>`:void 0,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"size-3 animate-spin mr-1"})," Registering..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n,{className:"size-3 mr-1"})," Register"]})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("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:j}),children:w}),(0,t.jsx)(a.TooltipContent,{children:"Click to copy"})]}),(0,t.jsx)(r.Button,{size:"sm",onClick:j,className:"w-full",children:"Copy Command"})]})}):null]})}],371406)},319755,e=>{"use strict";var t=e.i(653772),s=e.i(511043),r=e.i(126942),a=e.i(186339),i=e.i(945074),n=e.i(106772),o=e.i(489960),l=e.i(967723),c=e.i(794683),d=e.i(516266),u=e.i(23055),m=e.i(275351),p=e.i(205189),h=e.i(765398),f=e.i(613349),g=e.i(909832);e.i(400175);var x=e.i(126366);let y=`You are the lead coordinator. You receive tasks from the user and decide how to handle them.
4
4
 
5
5
  ## Principles
@@ -61,4 +61,4 @@ Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpattern
61
61
  - Every interaction builds trust. Be empathetic, accurate, and efficient — resolve on first response when possible.
62
62
  - Lead with acknowledgment, then solution or clear next steps. Use simple language.
63
63
  - If you can't resolve immediately, set realistic expectations: what you'll do, by when.
64
- - Track open issues proactively. Escalate complex or sensitive cases with full context.`,relationship:"Delegate support tasks with: customer issue summary, urgency level, prior interaction context, and resolution approach.\n\nReport back with: response drafted or sent, resolution status, follow-up schedule, and recurring patterns to flag."}]},{id:"custom",label:"Custom",description:"Build your own team from scratch",icon:"✨",members:[{role:"leader",description:"Coordinates work and replies to you",instructions:y}]}];function b(e){let t=new Set,s=[];for(let r=0;r<e;r++){let e,r=0;do e=(0,g.uniqueNamesGenerator)({dictionaries:[g.names],length:1,style:"capital"}),r++;while(t.has(e)&&r<100)t.add(e),s.push({name:e,avatarUrl:(0,x.serializeAvatarConfig)((0,x.randomConfig)())})}return s}function w({selected:e,onSelect:s,onBrowseTemplates:r}){return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"What will your company focus on?"}),r&&(0,t.jsxs)("button",{type:"button",onClick:r,className:"text-[11px] text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:["Browse templates ",(0,t.jsx)("span",{"aria-hidden":"true",children:"›"})]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:v.map(r=>(0,t.jsxs)("button",{onClick:()=>s(r.id),className:(0,f.cn)("flex flex-col items-start gap-1 rounded-lg border p-4 text-left transition-all hover:border-foreground/30",e===r.id?"border-foreground/50 bg-muted/50":"border-border"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)("span",{className:"text-lg",children:r.icon}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/70",children:[r.members.length," agent",r.members.length>1?"s":""]})]}),(0,t.jsx)("span",{className:"text-sm font-medium",children:r.label}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-tight",children:r.description})]},r.id))})]})}var j=e.i(934351),C=e.i(758870),k=e.i(89110),N=e.i(855372);e.i(954194);var S=e.i(439769);let P={leader:"Lead",researcher:"Researcher",engineer:"Engineer",assistant:"Assistant"};function _({members:e,runtimes:s,onShuffle:r,onAssignRuntime:i}){let n=s.length>1&&i;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Your company"}),(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",onClick:r,className:"h-7 text-xs gap-1.5",children:[(0,t.jsx)(C.RefreshCw,{className:"size-3"}),"Shuffle"]})]}),(0,t.jsx)("div",{className:(0,f.cn)("grid gap-3 grid-cols-1",2===e.length&&"sm:grid-cols-2",3===e.length&&"sm:grid-cols-2 md:grid-cols-3",e.length>=4&&"sm:grid-cols-2 md:grid-cols-4"),children:e.map((e,r)=>{let a,o=e.avatarUrl?(0,x.parseAvatarUrl)(e.avatarUrl):null;return(0,t.jsxs)(j.Card,{size:"sm",className:"flex flex-col px-3 py-4 gap-2 h-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[o?(0,t.jsx)(x.AvatarRenderer,{config:o,size:36,className:"rounded-xl shrink-0"}):(0,t.jsx)("div",{className:"size-9 rounded-xl bg-muted flex items-center justify-center text-sm font-semibold shrink-0",children:e.name.charAt(0)}),(0,t.jsxs)("div",{className:"flex flex-col items-start gap-0.5",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground bg-muted/60 px-1.5 py-0.5 rounded",children:P[e.role]})]})]}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground/70 font-mono truncate",children:(0,S.toAlookAddress)(e.emailHandle||e.name.toLowerCase())}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug flex-1",children:e.description}),n&&(a=s.find(t=>t.id===e.runtimeId),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)(k.Select,{value:e.runtimeId,onValueChange:e=>{e&&i(r,e)},children:[(0,t.jsx)(k.SelectTrigger,{className:"h-7 text-[11px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 truncate",children:[a&&(0,t.jsx)(N.ProviderLogo,{provider:a.provider||"",className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a?.provider||a?.runtime_mode||"Select"})]})}),(0,t.jsx)(k.SelectContent,{children:s.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.provider||e.runtime_mode},e.id))})]})}))]},r)})})]})}var z=e.i(824863),O=e.i(222862),R=e.i(642342),A=e.i(371406);e.s(["StudioOnboardingClient",0,function({workspaceId:e,workspaceSlug:f,initialTemplate:g}){let x=(0,r.useRouter)(),[y,j]=(0,s.useState)([]),[C,k]=(0,s.useState)(!0),[N,S]=(0,s.useState)(g?g.baseScenario:null),[P,L]=(0,s.useState)([]),[M,I]=(0,s.useState)(!1),[E,D]=(0,s.useState)(""),[F,B]=(0,s.useState)(!1),[H,T]=(0,s.useState)(!1),[U,Y]=(0,s.useState)(!1),V=(0,z.isTauri)()&&(0,z.isDesktop)(),q=y.filter(e=>"online"===e.status),G=q.length>0;(0,s.useEffect)(()=>{(0,O.listRuntimes)(e).then(e=>{j(e),e.some(e=>"online"===e.status)&&(T(!0),Y(!0))}).catch(()=>{}).finally(()=>k(!1))},[e]);let $=(0,s.useCallback)(t=>{"runtime.registered"===t.type&&t.workspaceId===e?(T(!0),Y(!0),(0,O.listRuntimes)(e).then(j).catch(()=>{})):"runtime.status"===t.type&&t.workspaceId===e&&(T(!0),"online"===t.status?Y(!0):Y(!1))},[e]);(0,R.useUserWs)($);let X=(0,s.useCallback)(async()=>{B(!0);try{let t=await (0,O.createMachineToken)("cli",e);if(D(t.token),V){let s=await (0,z.tauriInvoke)("register_cli",{token:t.token});s.success?(T(!0),Y(!0),(0,O.listRuntimes)(e).then(j).catch(()=>{})):d.toast.error(s.message||"Auto-registration failed")}}catch{d.toast.error("Failed to generate token")}finally{B(!1)}},[e,V]);(0,s.useEffect)(()=>{let e=q[0]?.id;e&&L(t=>0!==t.length&&t.some(e=>!e.runtimeId)?t.map(t=>t.runtimeId?t:{...t,runtimeId:e}):t)},[q]);let W=(0,s.useCallback)(async e=>{try{let t=await fetch("/api/studios/check-handles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:e})});if(!t.ok)return null;return await t.json()}catch{return null}},[]);(0,s.useEffect)(()=>{if(!g||C||P.length>0)return;let e=b(g.members.length),t=q[0]?.id||"",s=g.members.map((s,r)=>({name:e[r].name,role:s.role,description:s.description,instructions:s.instructions,avatarUrl:e[r].avatarUrl,runtimeId:t,relationship:s.relationship}));L(s),W(s.map(e=>e.name)).then(e=>{e&&L(t=>t.map(t=>{let s=e.find(e=>e.name===t.name);return s?{...t,emailHandle:s.handle}:t}))})},[g,C]);let K=async e=>{S(e);let t=v.find(t=>t.id===e),s=b(t.members.length),r=q[0]?.id||"",a=t.members.map((e,t)=>({name:s[t].name,role:e.role,description:e.description,instructions:e.instructions,avatarUrl:s[t].avatarUrl,runtimeId:r,relationship:e.relationship}));L(a);let i=await W(a.map(e=>e.name));i&&L(e=>e.map(e=>{let t=i.find(t=>t.name===e.name);return t?{...e,emailHandle:t.handle}:e}))},Z=async()=>{let e=b(P.length),t=P.map((t,s)=>({...t,name:e[s].name,avatarUrl:e[s].avatarUrl,emailHandle:void 0}));L(t);let s=await W(t.map(e=>e.name));s&&L(e=>e.map(e=>{let t=s.find(t=>t.name===e.name);return t?{...e,emailHandle:t.handle}:e}))},J=async()=>{I(!0);try{let t=await fetch("/api/studios",{method:"POST",headers:{"Content-Type":"application/json","X-Workspace-ID":e},body:JSON.stringify({name:void 0,scenario:N,members:P.map(e=>({name:e.name,role:e.role,runtime_id:e.runtimeId,description:e.description,instructions:e.instructions,avatar_url:e.avatarUrl||null,email_handle:e.emailHandle||void 0,relationship:e.relationship||void 0}))})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to create company")}let s=await t.json();await fetch(`/api/workspaces/${e}/onboarded`,{method:"POST"}).catch(()=>{}),(0,p.trackWorkspaceCreated)("onboarding"),(0,p.trackOnboardingCompleted)({template_used:N??void 0,agent_count:P.length});for(let e=0;e<P.length;e++)(0,p.trackAgentCreated)({is_first_agent:0===e,has_email:!!P[e].emailHandle});d.toast.success("Company created!"),x.push(`/w/${s.workspace.slug}/agents/${s.leader_agent_id}`)}catch(e){d.toast.error(e instanceof Error?e.message:"Failed to create company"),I(!1)}},Q=N&&P.length>0&&P.every(e=>e.runtimeId)&&(G||H&&U||V);return N?(0,t.jsx)(h.PublicLayout,{leftSlot:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>x.push("/workspaces"),children:[(0,t.jsx)(c.LayoutGrid,{className:"size-3 mr-1.5"}),"Workspaces"]}),(0,t.jsx)("span",{className:"text-muted-foreground/40",children:"/"}),(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>S(null),children:[(0,t.jsx)(l.ArrowLeft,{className:"size-3 mr-1.5"}),"Back"]})]}),rightSlot:(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:async()=>{await (0,m.clearAllCache)(),(0,u.signOut)({fetchOptions:{onSuccess:()=>x.push("/sign-in")}})},children:[(0,t.jsx)(o.LogOut,{className:"size-3 mr-1.5"}),"Sign out"]}),children:(0,t.jsxs)("div",{className:"mx-auto w-full max-w-3xl space-y-10 px-6 py-14",children:[(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",style:{fontFamily:"var(--font-news)"},children:"Build your company"})}),C?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(i.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_,{members:P,runtimes:q,onShuffle:Z,onAssignRuntime:(e,t)=>{L(s=>s.map((s,r)=>r===e?{...s,runtimeId:t}:s))}}),!V&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Connect a computer"}),G||H&&U?(0,t.jsxs)("p",{className:"text-xs text-emerald-600 flex items-center gap-1",children:[(0,t.jsx)(n.CheckCircle2,{className:"size-3"})," Computer connected"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your company needs a connected computer to run tasks."}),(0,t.jsx)("div",{className:"rounded-xl bg-muted/40 p-5",children:(0,t.jsx)(A.ConnectMachineSteps,{generatedToken:E,generatingToken:F,onGenerateToken:X,registered:H,daemonOnline:U})})]})]}),(0,t.jsx)(a.Button,{onClick:J,disabled:!Q||M,className:"w-full",size:"lg",children:M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin mr-2"}),"Launching..."]}):"Launch company"})]})]})}):(0,t.jsx)(h.PublicLayout,{leftSlot:(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>x.push("/workspaces"),children:[(0,t.jsx)(c.LayoutGrid,{className:"size-3 mr-1.5"}),"Workspaces"]}),rightSlot:(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:async()=>{await (0,m.clearAllCache)(),(0,u.signOut)({fetchOptions:{onSuccess:()=>x.push("/sign-in")}})},children:[(0,t.jsx)(o.LogOut,{className:"size-3 mr-1.5"}),"Sign out"]}),mainClassName:"flex items-center justify-center",children:(0,t.jsxs)("div",{className:"w-full max-w-3xl space-y-8 px-6 py-6",children:[(0,t.jsxs)("div",{className:"text-center space-y-2",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",style:{fontFamily:"var(--font-news)"},children:"What will your company do?"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Pick a focus area. You can always add more agents later."})]}),(0,t.jsx)(w,{selected:N,onSelect:K,onBrowseTemplates:()=>x.push(`/templates?workspace_id=${e}`)}),(0,t.jsx)("div",{className:"flex justify-center pt-2",children:(0,t.jsx)("button",{type:"button",onClick:async()=>{await fetch(`/api/workspaces/${e}/onboarded`,{method:"POST"}).catch(()=>{}),x.push(`/w/${f}/home`)},className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Skip for now"})})]})})}],319755)}]);
64
+ - Track open issues proactively. Escalate complex or sensitive cases with full context.`,relationship:"Delegate support tasks with: customer issue summary, urgency level, prior interaction context, and resolution approach.\n\nReport back with: response drafted or sent, resolution status, follow-up schedule, and recurring patterns to flag."}]},{id:"custom",label:"Custom",description:"Build your own team from scratch",icon:"✨",members:[{role:"leader",description:"Coordinates work and replies to you",instructions:y}]}];function b(e){let t=new Set,s=[];for(let r=0;r<e;r++){let e,r=0;do e=(0,g.uniqueNamesGenerator)({dictionaries:[g.names],length:1,style:"capital"}),r++;while(t.has(e)&&r<100)t.add(e),s.push({name:e,avatarUrl:(0,x.serializeAvatarConfig)((0,x.randomConfig)())})}return s}function w({selected:e,onSelect:s,onBrowseTemplates:r}){return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"What will your company focus on?"}),r&&(0,t.jsxs)("button",{type:"button",onClick:r,className:"text-[11px] text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:["Browse templates ",(0,t.jsx)("span",{"aria-hidden":"true",children:"›"})]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:v.map(r=>(0,t.jsxs)("button",{onClick:()=>s(r.id),className:(0,f.cn)("flex flex-col items-start gap-1 rounded-lg border p-4 text-left transition-all hover:border-foreground/30",e===r.id?"border-foreground/50 bg-muted/50":"border-border"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)("span",{className:"text-lg",children:r.icon}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/70",children:[r.members.length," agent",r.members.length>1?"s":""]})]}),(0,t.jsx)("span",{className:"text-sm font-medium",children:r.label}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-tight",children:r.description})]},r.id))})]})}var j=e.i(934351),C=e.i(758870),k=e.i(89110),N=e.i(855372);e.i(954194);var S=e.i(439769);let P={leader:"Lead",researcher:"Researcher",engineer:"Engineer",assistant:"Assistant"};function _({members:e,runtimes:s,onShuffle:r,onAssignRuntime:i}){let n=s.length>1&&i;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Your company"}),(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",onClick:r,className:"h-7 text-xs gap-1.5",children:[(0,t.jsx)(C.RefreshCw,{className:"size-3"}),"Shuffle"]})]}),(0,t.jsx)("div",{className:(0,f.cn)("grid gap-3 grid-cols-1",2===e.length&&"sm:grid-cols-2",3===e.length&&"sm:grid-cols-2 md:grid-cols-3",e.length>=4&&"sm:grid-cols-2 md:grid-cols-4"),children:e.map((e,r)=>{let a,o=e.avatarUrl?(0,x.parseAvatarUrl)(e.avatarUrl):null;return(0,t.jsxs)(j.Card,{size:"sm",className:"flex flex-col px-3 py-4 gap-2 h-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[o?(0,t.jsx)(x.AvatarRenderer,{config:o,size:36,className:"rounded-xl shrink-0"}):(0,t.jsx)("div",{className:"size-9 rounded-xl bg-muted flex items-center justify-center text-sm font-semibold shrink-0",children:e.name.charAt(0)}),(0,t.jsxs)("div",{className:"flex flex-col items-start gap-0.5",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground bg-muted/60 px-1.5 py-0.5 rounded",children:P[e.role]})]})]}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground/70 font-mono truncate",children:(0,S.toAlookAddress)(e.emailHandle||e.name.toLowerCase())}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug flex-1",children:e.description}),n&&(a=s.find(t=>t.id===e.runtimeId),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)(k.Select,{value:e.runtimeId,onValueChange:e=>{e&&i(r,e)},children:[(0,t.jsx)(k.SelectTrigger,{className:"h-7 text-[11px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 truncate",children:[a&&(0,t.jsx)(N.ProviderLogo,{provider:a.provider||"",className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a?.provider||a?.runtime_mode||"Select"})]})}),(0,t.jsx)(k.SelectContent,{children:s.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.provider||e.runtime_mode},e.id))})]})}))]},r)})})]})}var z=e.i(824863),O=e.i(222862),R=e.i(642342),A=e.i(371406);e.s(["StudioOnboardingClient",0,function({workspaceId:e,workspaceSlug:f,initialTemplate:g}){let x=(0,r.useRouter)(),[y,j]=(0,s.useState)([]),[C,k]=(0,s.useState)(!0),[N,S]=(0,s.useState)(g?g.baseScenario:null),[P,L]=(0,s.useState)([]),[M,E]=(0,s.useState)(!1),[I,D]=(0,s.useState)(""),[F,B]=(0,s.useState)(!1),[H,T]=(0,s.useState)(!1),[U,Y]=(0,s.useState)(!1),V=(0,z.isTauri)()&&(0,z.isDesktop)(),q=y.filter(e=>"online"===e.status),G=q.length>0;(0,s.useEffect)(()=>{(0,O.listRuntimes)(e).then(e=>{j(e),e.some(e=>"online"===e.status)&&(T(!0),Y(!0))}).catch(()=>{}).finally(()=>k(!1))},[e]);let $=(0,s.useCallback)(t=>{"runtime.registered"===t.type&&t.workspaceId===e?(T(!0),Y(!0),(0,O.listRuntimes)(e).then(j).catch(()=>{})):"runtime.status"===t.type&&t.workspaceId===e&&(T(!0),"online"===t.status?Y(!0):Y(!1))},[e]);(0,R.useUserWs)($);let X=(0,s.useCallback)(async()=>{B(!0);try{let t=await (0,O.createMachineToken)("cli",e);if(D(t.token),V){let s=await (0,z.tauriInvoke)("register_cli",{token:t.token});if(s.success){T(!0),Y(!0);let t=await (0,O.listRuntimes)(e).catch(()=>[]);j(t)}else d.toast.error(s.message||"Auto-registration failed")}}catch{d.toast.error("Failed to generate token")}finally{B(!1)}},[e,V]);(0,s.useEffect)(()=>{!V||C||G||H||X()},[V,C]),(0,s.useEffect)(()=>{let e=q[0]?.id;e&&L(t=>0!==t.length&&t.some(e=>!e.runtimeId)?t.map(t=>t.runtimeId?t:{...t,runtimeId:e}):t)},[q]);let W=(0,s.useCallback)(async e=>{try{let t=await fetch("/api/studios/check-handles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:e})});if(!t.ok)return null;return await t.json()}catch{return null}},[]);(0,s.useEffect)(()=>{if(!g||C||P.length>0)return;let e=b(g.members.length),t=q[0]?.id||"",s=g.members.map((s,r)=>({name:e[r].name,role:s.role,description:s.description,instructions:s.instructions,avatarUrl:e[r].avatarUrl,runtimeId:t,relationship:s.relationship}));L(s),W(s.map(e=>e.name)).then(e=>{e&&L(t=>t.map(t=>{let s=e.find(e=>e.name===t.name);return s?{...t,emailHandle:s.handle}:t}))})},[g,C]);let K=async e=>{S(e);let t=v.find(t=>t.id===e),s=b(t.members.length),r=q[0]?.id||"",a=t.members.map((e,t)=>({name:s[t].name,role:e.role,description:e.description,instructions:e.instructions,avatarUrl:s[t].avatarUrl,runtimeId:r,relationship:e.relationship}));L(a);let i=await W(a.map(e=>e.name));i&&L(e=>e.map(e=>{let t=i.find(t=>t.name===e.name);return t?{...e,emailHandle:t.handle}:e}))},Z=async()=>{let e=b(P.length),t=P.map((t,s)=>({...t,name:e[s].name,avatarUrl:e[s].avatarUrl,emailHandle:void 0}));L(t);let s=await W(t.map(e=>e.name));s&&L(e=>e.map(e=>{let t=s.find(t=>t.name===e.name);return t?{...e,emailHandle:t.handle}:e}))},J=async()=>{E(!0);try{let t=await fetch("/api/studios",{method:"POST",headers:{"Content-Type":"application/json","X-Workspace-ID":e},body:JSON.stringify({name:void 0,scenario:N,members:P.map(e=>({name:e.name,role:e.role,runtime_id:e.runtimeId,description:e.description,instructions:e.instructions,avatar_url:e.avatarUrl||null,email_handle:e.emailHandle||void 0,relationship:e.relationship||void 0}))})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to create company")}let s=await t.json();await fetch(`/api/workspaces/${e}/onboarded`,{method:"POST"}).catch(()=>{}),(0,p.trackWorkspaceCreated)("onboarding"),(0,p.trackOnboardingCompleted)({template_used:N??void 0,agent_count:P.length});for(let e=0;e<P.length;e++)(0,p.trackAgentCreated)({is_first_agent:0===e,has_email:!!P[e].emailHandle});d.toast.success("Company created!"),x.push(`/w/${s.workspace.slug}/agents/${s.leader_agent_id}`)}catch(e){d.toast.error(e instanceof Error?e.message:"Failed to create company"),E(!1)}},Q=N&&P.length>0&&P.every(e=>e.runtimeId)&&(G||H&&U||V);return N?(0,t.jsx)(h.PublicLayout,{leftSlot:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>x.push("/workspaces"),children:[(0,t.jsx)(c.LayoutGrid,{className:"size-3 mr-1.5"}),"Workspaces"]}),(0,t.jsx)("span",{className:"text-muted-foreground/40",children:"/"}),(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>S(null),children:[(0,t.jsx)(l.ArrowLeft,{className:"size-3 mr-1.5"}),"Back"]})]}),rightSlot:(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:async()=>{await (0,m.clearAllCache)(),(0,u.signOut)({fetchOptions:{onSuccess:()=>x.push("/sign-in")}})},children:[(0,t.jsx)(o.LogOut,{className:"size-3 mr-1.5"}),"Sign out"]}),children:(0,t.jsxs)("div",{className:"mx-auto w-full max-w-3xl space-y-10 px-6 py-14",children:[(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",style:{fontFamily:"var(--font-news)"},children:"Build your company"})}),C?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(i.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_,{members:P,runtimes:q,onShuffle:Z,onAssignRuntime:(e,t)=>{L(s=>s.map((s,r)=>r===e?{...s,runtimeId:t}:s))}}),!V&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:"Connect a computer"}),G||H&&U?(0,t.jsxs)("p",{className:"text-xs text-emerald-600 flex items-center gap-1",children:[(0,t.jsx)(n.CheckCircle2,{className:"size-3"})," Computer connected"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your company needs a connected computer to run tasks."}),(0,t.jsx)("div",{className:"rounded-xl bg-muted/40 p-5",children:(0,t.jsx)(A.ConnectMachineSteps,{generatedToken:I,generatingToken:F,onGenerateToken:X,registered:H,daemonOnline:U})})]})]}),(0,t.jsx)(a.Button,{onClick:J,disabled:!Q||M,className:"w-full",size:"lg",children:M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin mr-2"}),"Launching..."]}):"Launch company"})]})]})}):(0,t.jsx)(h.PublicLayout,{leftSlot:(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>x.push("/workspaces"),children:[(0,t.jsx)(c.LayoutGrid,{className:"size-3 mr-1.5"}),"Workspaces"]}),rightSlot:(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:async()=>{await (0,m.clearAllCache)(),(0,u.signOut)({fetchOptions:{onSuccess:()=>x.push("/sign-in")}})},children:[(0,t.jsx)(o.LogOut,{className:"size-3 mr-1.5"}),"Sign out"]}),mainClassName:"flex items-center justify-center",children:(0,t.jsxs)("div",{className:"w-full max-w-3xl space-y-8 px-6 py-6",children:[(0,t.jsxs)("div",{className:"text-center space-y-2",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",style:{fontFamily:"var(--font-news)"},children:"What will your company do?"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Pick a focus area. You can always add more agents later."})]}),(0,t.jsx)(w,{selected:N,onSelect:K,onBrowseTemplates:()=>x.push(`/templates?workspace_id=${e}`)}),(0,t.jsx)("div",{className:"flex justify-center pt-2",children:(0,t.jsx)("button",{type:"button",onClick:async()=>{await fetch(`/api/workspaces/${e}/onboarded`,{method:"POST"}).catch(()=>{}),x.push(`/w/${f}/home`)},className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Skip for now"})})]})})}],319755)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,716032,e=>{"use strict";e.i(811374);var s=e.i(653772),t=e.i(511043),a=e.i(255334),r=e.i(613349),i=e.i(516266),n=e.i(126942),l=e.i(500324),c=e.i(23055),d=e.i(222862),o=e.i(186339),m=e.i(903477),u=e.i(473131),x=e.i(728886),h=e.i(553617),p=e.i(205189);function f(){let{workspaceId:e,slug:a}=(0,l.useWorkspace)(),r=(0,c.useSession)(),f=(0,n.useRouter)(),[g,j]=(0,t.useState)(""),[v,N]=(0,t.useState)(!0),[b,y]=(0,t.useState)(""),[k,w]=(0,t.useState)(""),[C,T]=(0,t.useState)(""),[S,E]=(0,t.useState)(""),[_,M]=(0,t.useState)(!1),[P,z]=(0,t.useState)({}),[I,O]=(0,t.useState)(""),[R,$]=(0,t.useState)(!1),F=(0,t.useCallback)(async()=>{N(!0);try{let s=r.data?.user?.id,[t,a]=await Promise.all([(0,d.listMembers)(e),(0,d.listWorkspaces)()]),i=t.find(e=>e.user_id===s);j(i?.role??"");let n=a.find(s=>s.id===e);n&&(y(n.name),w(n.slug),T(n.name),E(n.slug))}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load workspace info")}finally{N(!1)}},[e,r.data?.user?.id]);(0,t.useEffect)(()=>{r.data&&F()},[F,r.data]);let A=b!==C||k!==S,D=async()=>{let s=(0,h.validateWorkspaceForm)({name:b,slug:k});if(z(s),!(0,h.hasWorkspaceFormErrors)(s)){M(!0);try{let s=await (0,d.updateWorkspace)(e,{name:b.trim(),slug:k.trim()});(0,p.trackSettingsUpdated)({setting_tab:"general"}),T(s.name),E(s.slug),i.toast.success("Workspace updated"),s.slug!==a&&f.replace(`/w/${s.slug}/settings`)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to update workspace")}finally{M(!1)}}},L=async()=>{if(I===C){$(!0);try{await (0,d.deleteWorkspace)(e,C),i.toast.success("Workspace deleted"),f.replace("/workspaces")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to delete workspace")}finally{$(!1)}}};return v?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-32"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"})]}):"owner"!==g?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Only workspace owners can edit workspace settings."}):(0,s.jsxs)("div",{className:"space-y-10",children:[(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Workspace"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(u.Label,{htmlFor:"workspace-name",children:"Name"}),(0,s.jsx)(m.Input,{id:"workspace-name",value:b,onChange:e=>{let s=e.target.value;y(s),P.name&&s.trim()&&z(e=>({...e,name:void 0}))},placeholder:"Workspace name","aria-invalid":!!P.name,"aria-describedby":P.name?"workspace-name-error":void 0}),P.name&&(0,s.jsx)("p",{id:"workspace-name-error",className:"text-xs text-destructive",children:P.name})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(u.Label,{htmlFor:"workspace-slug",children:"Slug"}),(0,s.jsx)(m.Input,{id:"workspace-slug",value:k,onChange:e=>{let s=e.target.value;w(s),P.slug&&s.trim()&&z(e=>({...e,slug:void 0}))},placeholder:"workspace-slug","aria-invalid":!!P.slug,"aria-describedby":P.slug?"workspace-slug-error":void 0}),P.slug&&(0,s.jsx)("p",{id:"workspace-slug-error",className:"text-xs text-destructive",children:P.slug}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground/70",children:["Used in URLs: /w/",k,"/"]})]})]}),(0,s.jsx)(o.Button,{size:"sm",onClick:D,disabled:!A||_,children:_?"Saving…":"Save"})]}),(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-destructive",children:"Danger Zone"}),(0,s.jsxs)("div",{className:"rounded-md border border-destructive/30 p-4 space-y-3",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Deleting this workspace is permanent and cannot be undone. All agents, conversations, and data will be lost."}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)(u.Label,{htmlFor:"delete-confirm",className:"text-xs",children:["Type ",(0,s.jsx)("span",{className:"font-medium text-foreground",children:C})," to confirm"]}),(0,s.jsx)(m.Input,{id:"delete-confirm",value:I,onChange:e=>O(e.target.value),placeholder:C})]}),(0,s.jsx)(o.Button,{size:"sm",variant:"destructive",onClick:L,disabled:I!==C||R,children:R?"Deleting…":"Delete Workspace"})]})]})]})}var g=e.i(740513);function j({ratio:e,size:t=16,stroke:a=1.5}){let i=(t-a)/2,n=2*Math.PI*i,l=(e<=0?0:e>=1?1:Math.log1p(99*e)/Math.log(100))*n;return(0,s.jsxs)("svg",{width:t,height:t,className:"shrink-0 -rotate-90","aria-hidden":!0,children:[(0,s.jsx)("circle",{cx:t/2,cy:t/2,r:i,fill:"none",stroke:"currentColor",strokeWidth:a,className:"text-border"}),(0,s.jsx)("circle",{cx:t/2,cy:t/2,r:i,fill:"none",stroke:"currentColor",strokeWidth:a,strokeDasharray:`${l} ${n-l}`,strokeLinecap:"round",className:(0,r.cn)("transition-all duration-300",e>.9?"text-destructive/70":e>.7?"text-yellow-500/50":"text-muted-foreground/30")})]})}function v(){let{workspaceId:e}=(0,l.useWorkspace)(),[a,r]=(0,t.useState)(""),[n,c]=(0,t.useState)(""),[o,m]=(0,t.useState)(!0),u=(0,t.useRef)(a);(0,t.useEffect)(()=>{u.current=a},[a]);let h=(0,t.useRef)(n);(0,t.useEffect)(()=>{h.current=n},[n]);let p=(0,t.useRef)(null),f=(0,t.useRef)(!1),v=(0,t.useCallback)(async()=>{m(!0);try{let s=await (0,d.getMemberMe)(e);r(s.global_instruction),c(s.global_instruction)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load settings")}finally{m(!1)}},[e]);(0,t.useEffect)(()=>{v()},[v]);let N=(0,t.useRef)(()=>{}),b=(0,t.useCallback)(async()=>{if(f.current)return;let s=u.current;if(s!==h.current){f.current=!0;try{let t=await (0,d.updateMemberMe)(e,s);c(t.global_instruction)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to save")}finally{f.current=!1,u.current!==h.current&&N.current()}}},[e]),y=(0,t.useCallback)(()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(b,500)},[b]);(0,t.useEffect)(()=>{N.current=y},[y]);let k=(0,t.useCallback)(e=>{r(e),y()},[y]);(0,t.useEffect)(()=>{let s=()=>{if(p.current&&clearTimeout(p.current),u.current!==h.current){let s=new URLSearchParams({workspace_id:e});fetch(`/api/members/me?${s}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:u.current}),keepalive:!0})}};return window.addEventListener("beforeunload",s),()=>window.removeEventListener("beforeunload",s)},[e]),(0,t.useEffect)(()=>()=>{if(p.current&&clearTimeout(p.current),u.current!==h.current){let s=new URLSearchParams({workspace_id:e});fetch(`/api/members/me?${s}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:u.current}),keepalive:!0})}},[e]);let w=a.length/5e4;return o?(0,s.jsxs)("div",{className:"px-6 py-6 space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-48"}),(0,s.jsx)(x.Skeleton,{className:"h-40 w-full"})]}):(0,s.jsxs)("div",{className:"flex flex-col h-full",children:[(0,s.jsx)("div",{className:"flex-1 px-6 pt-4 pb-4",children:(0,s.jsx)(g.MarkdownEditor,{value:a,onChange:k,placeholder:"Write instructions that every agent you own will follow...",minHeight:"calc(100vh - 240px)",contentType:"markdown",variant:"seamless"})}),(0,s.jsxs)("div",{className:"flex items-center gap-2 px-6 py-3",children:[(0,s.jsx)(j,{ratio:w}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"This instruction is prepended to every agent's individual instruction."})]})]})}var N=e.i(330746),b=e.i(813141),y=e.i(947308),k=e.i(419412);let w=(0,k.default)("user-minus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);var C=e.i(329686);function T(e){return`${window.location.origin}/invite/${e}`}function S(){let{workspaceId:e}=(0,l.useWorkspace)(),a=(0,c.useSession)(),n=a.data?.user?.id,[m,u]=(0,t.useState)([]),[h,f]=(0,t.useState)([]),[g,j]=(0,t.useState)(!0),[v,k]=(0,t.useState)(!1),S=m.find(e=>e.user_id===n)?.role==="owner",E=(0,t.useCallback)(async()=>{j(!0);try{let[s,t]=await Promise.all([(0,d.listMembers)(e),(0,d.listInvites)(e).catch(()=>[])]);u(s),f(t)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load members")}finally{j(!1)}},[e]);(0,t.useEffect)(()=>{E()},[E]);let _=async()=>{k(!0);try{let s=await (0,d.createInvite)(e);(0,p.trackTeamMemberInvited)({workspace_id:e}),f(e=>[...e,s]);let t=T(s.token);await navigator.clipboard.writeText(t),i.toast.success("Invite link copied to clipboard")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to generate invite")}finally{k(!1)}},M=async e=>{let s=T(e);try{await navigator.clipboard.writeText(s),i.toast.success("Invite link copied")}catch{i.toast.error("Failed to copy link")}},P=async s=>{try{await (0,d.revokeInvite)(e,s),f(e=>e.filter(e=>e.id!==s)),i.toast.success("Invite revoked")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to revoke invite")}},z=async s=>{try{await (0,d.removeMember)(e,s),u(e=>e.filter(e=>e.id!==s)),i.toast.success("Member removed")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to remove member")}};return g?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-24"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-4 w-24 mt-6"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"})]}):(0,s.jsxs)("div",{className:"space-y-8",children:[S&&(0,s.jsxs)("section",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Pending Invites"}),(0,s.jsxs)(o.Button,{size:"sm",variant:"outline",onClick:_,disabled:v,children:[(0,s.jsx)(y.Plus,{className:"size-3.5 mr-1"}),v?"Generating…":"Generate invite link"]})]}),0===h.length?(0,s.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:"No active invite links. Generate one to invite someone to this workspace."}):(0,s.jsx)("div",{className:"space-y-1.5",children:h.map(e=>{let t=new Date(e.expires_at),a=t<new Date;return(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2 text-xs",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:(0,r.cn)("font-mono truncate",a&&"text-muted-foreground line-through"),children:["/invite/",e.token.slice(0,12),"…"]}),(0,s.jsx)("p",{className:(0,r.cn)("text-muted-foreground/70 mt-0.5",a&&"text-destructive/70"),children:a?"Expired":`Expires ${t.toLocaleDateString()}`})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 ml-2 shrink-0",children:[!a&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>M(e.token)}),children:(0,s.jsx)(N.Copy,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Copy invite link"})]}),(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-destructive hover:text-destructive",onClick:()=>P(e.id)}),children:(0,s.jsx)(b.Trash2,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Revoke invite"})]})]})]},e.id)})})]}),(0,s.jsxs)("section",{className:"space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Members"}),(0,s.jsx)("div",{className:"space-y-1.5",children:m.map(e=>{let t=e.user_id===n,a=e.name?e.name.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():e.email.slice(0,2).toUpperCase();return(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-border/50 px-3 py-2",children:[(0,s.jsx)("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center text-xs font-medium text-muted-foreground shrink-0 overflow-hidden",children:e.image?(0,s.jsx)("img",{src:e.image,alt:e.name,className:"size-full object-cover"}):a}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"text-sm font-medium truncate leading-tight",children:[e.name||e.email,t&&(0,s.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"(you)"})]}),e.name&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.email})]}),(0,s.jsx)("span",{className:(0,r.cn)("text-xs px-1.5 py-0.5 rounded shrink-0","owner"===e.role?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:e.role}),S&&!t&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive shrink-0",onClick:()=>z(e.id)}),children:(0,s.jsx)(w,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Remove member"})]})]},e.id)})})]})]})}var E=e.i(885515),_=e.i(254618),M=e.i(899746);function P(){let[e,a]=(0,t.useState)(!1),[r,n]=(0,t.useState)([...M.NOTIFICATION_EVENTS]),[l,c]=(0,t.useState)(!0),[d,o]=(0,t.useState)(!1);(0,t.useEffect)(()=>{c((0,M.isNotificationSupported)()),a((0,M.getNotificationEnabled)()),n((0,M.getNotificationEvents)()),(0,M.isNotificationSupported)()&&o("denied"===Notification.permission)},[]);let m=async e=>{if(!e){a(!1),(0,M.setNotificationEnabled)(!1);return}await (0,M.requestNotificationPermission)()?(a(!0),(0,M.setNotificationEnabled)(!0)):(o(!0),i.toast.error("Notification permission denied. Please enable it in browser settings."))};return l?(0,s.jsx)("div",{className:"space-y-6",children:(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Browser Notifications"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)("p",{className:"text-sm",children:"Enable notifications"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Get notified when tasks finish while the tab is in the background"})]}),(0,s.jsx)(_.Switch,{checked:e,onCheckedChange:m,disabled:d&&!e})]}),d&&!e&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:"Notification permission was denied. Please allow it in your browser settings."}),e&&(0,s.jsxs)("div",{className:"space-y-2 pl-0.5",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Notify me when:"}),M.NOTIFICATION_EVENTS.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer select-none",children:[(0,s.jsx)(E.Checkbox,{checked:r.includes(e),onCheckedChange:()=>{n(s=>{let t=s.includes(e)?s.filter(s=>s!==e):[...s,e];return(0,M.setNotificationEvents)(t),t})}}),M.NOTIFICATION_EVENT_LABELS[e]]},e))]})]})]})}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your browser does not support notifications."})}let z=(0,k.default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var I=e.i(399561),O=e.i(460520),R=e.i(961909),$=e.i(790961);function F(){let[e,a]=(0,t.useState)(!1),[i,n]=(0,t.useState)(I.CLOUD_CODE_MONSTER_PET_PRESETS[0].id),l=(0,I.getCloudCodeMonsterPreset)(i);return(0,t.useEffect)(()=>{a((0,$.readHomePetSettings)().enabled),n((0,I.readCloudCodeMonsterPetPresetId)());let e=e=>{let s=e.detail?.presetId;n(s?(0,I.getCloudCodeMonsterPreset)(s).id:(0,I.readCloudCodeMonsterPetPresetId)())};return window.addEventListener(O.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,e),()=>{window.removeEventListener(O.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,e)}},[]),(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Pet"}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(u.Label,{htmlFor:"pet-enabled",className:"text-sm",children:"Enable pet"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Off by default. Turn it on when you want the workspace companion."})]}),(0,s.jsx)(_.Switch,{id:"pet-enabled",checked:e,onCheckedChange:e=>{a(e),(0,$.writeHomePetSettings)({enabled:e})}})]})})]}),e?(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Preset"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:l.name})]}),(0,s.jsx)("div",{className:"grid size-14 place-items-center rounded-md bg-card ring-1 ring-border/60",children:(0,s.jsx)(R.CloudCodeMonsterPresetPreview,{preset:l,className:"size-11"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:I.CLOUD_CODE_MONSTER_PET_PRESETS.map(e=>{let t=e.id===l.id;return(0,s.jsxs)("button",{type:"button","aria-pressed":t,onClick:()=>{n((0,I.writeCloudCodeMonsterPetPresetId)(e.id))},className:(0,r.cn)("group grid h-28 min-w-0 grid-rows-[1fr_auto] rounded-md border bg-card/60 p-2 text-left transition-all hover:border-foreground/20 hover:bg-accent/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70",t?"border-primary/50 bg-accent text-foreground":"border-border/50 text-muted-foreground"),children:[(0,s.jsx)("div",{className:"grid place-items-center rounded bg-background/70 ring-1 ring-border/35",children:(0,s.jsx)(R.CloudCodeMonsterPresetPreview,{preset:e,className:"size-14 transition-transform duration-200 group-hover:scale-105"})}),(0,s.jsxs)("div",{className:"mt-1.5 flex min-w-0 items-center justify-between gap-1 text-[10px] leading-none",children:[(0,s.jsx)("span",{className:"truncate font-medium text-foreground",children:e.name}),t?(0,s.jsx)(z,{className:"size-3 shrink-0 text-primary"}):(0,s.jsx)("span",{className:"shrink-0 text-muted-foreground",children:e.id.replace("pet-","#")})]})]},e.id)})})]}):null]})}var A=e.i(355578),D=e.i(934351),L=e.i(875061);let W=(0,k.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var U=e.i(896210),B=e.i(392277);let H=(0,k.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var q=e.i(646769);let G=(0,k.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function V({icon:e,label:t,value:a,sub:r}){return(0,s.jsx)(D.Card,{size:"sm",children:(0,s.jsxs)(D.CardContent,{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,s.jsx)(e,{className:"size-4"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,s.jsx)("p",{className:"text-2xl font-semibold leading-none tracking-tight",children:a}),r&&(0,s.jsx)(L.Badge,{variant:"secondary",className:"text-[10px] px-1.5 h-4 font-normal",children:r})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground truncate",children:t})]})]})})}function J({agents:e,runtimes:t,activeTaskCounts:a,overview:r}){let i=new Map;for(let e of t){let s=e.daemon_id??e.id;i.set(s,i.get(s)||"online"===e.status)}let n=i.size,l=[...i.values()].filter(Boolean).length,c=Object.values(a).reduce((e,s)=>e+s,0),d=e.filter(e=>{let s=t.find(s=>s.id===e.runtime_id);return s?.status==="online"}).length;return(0,s.jsxs)("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,s.jsx)(V,{icon:q.Monitor,label:"Machines",value:`${l}/${n}`,sub:"online"}),(0,s.jsx)(V,{icon:W,label:"Agents",value:e.length,sub:`${d} online`}),(0,s.jsx)(V,{icon:H,label:"Members",value:r.members.length,sub:r.pending_invites>0?`${r.pending_invites} pending`:void 0}),(0,s.jsx)(V,{icon:G,label:"Active Tasks",value:c,sub:r.task_stats.queued>0?`${r.task_stats.queued} queued`:void 0}),(0,s.jsx)(V,{icon:B.Send,label:"Emails Sent",value:r.email_stats.outbound,sub:`${r.email_stats.unread} unread`}),(0,s.jsx)(V,{icon:U.Mail,label:"Custom Emails",value:r.email_accounts.length})]})}function K({overview:e}){let{completed:t,failed:a,cancelled:r,queued:i,stale:n}=e.task_stats,l=t+a,c=l>0?(a/l*100).toFixed(1):"0";return(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Task Health (Today)"})}),(0,s.jsx)(D.CardContent,{children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)(Q,{label:"Completed",value:t}),(0,s.jsx)(Q,{label:"Failed",value:a,className:a>0?"text-destructive":void 0}),(0,s.jsx)(Q,{label:"Cancelled",value:r}),(0,s.jsx)(Q,{label:"Failure Rate",value:`${c}%`,className:Number(c)>10?"text-destructive":void 0}),(0,s.jsx)(Q,{label:"Queue Backlog",value:i,className:i>10?"text-amber-500":void 0}),(0,s.jsx)(Q,{label:"Stale Tasks",value:n,className:n>0?"text-destructive":void 0})]})})]})}function Q({label:e,value:t,className:a}){return(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${a??""}`,children:t}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})}function Y({overview:e,agents:t}){let{inbound:a,outbound:r,unread:i,rejected:n}=e.email_stats,l=new Map(t.map(e=>[e.id,e.name]));return(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Email Summary"})}),(0,s.jsxs)(D.CardContent,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xl font-semibold",children:a}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Received"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xl font-semibold",children:r}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Sent"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${i>0?"text-primary":""}`,children:i}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Unread"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${n>0?"text-amber-500":""}`,children:n}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Untrust"})]})]}),e.email_accounts.length>0&&(0,s.jsxs)("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Custom Mailboxes"}),e.email_accounts.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{className:`size-1.5 shrink-0 rounded-full ${"active"===e.status?"bg-emerald-500":"bg-destructive"}`})}),(0,s.jsx)(C.TooltipContent,{side:"top",children:"active"===e.status?"Active":`Error: ${e.error_message||"inactive"}`})]}),(0,s.jsx)("span",{className:"truncate",children:e.email_address})]}),(0,s.jsx)("span",{className:"text-muted-foreground shrink-0",children:l.get(e.agent_id)??"—"})]},e.id))]})]})]})}var Z=e.i(345262);function X({runtimes:e,agents:t}){let a=(0,n.useRouter)(),{slug:r}=(0,l.useWorkspace)(),i=new Map;for(let s of e){let e=s.daemon_id??s.id;i.has(e)||i.set(e,{runtimes:[],deviceInfo:s.device_info??""}),i.get(e).runtimes.push(s)}let c=[...i.entries()];return 0===c.length?(0,s.jsxs)(D.Card,{children:[(0,s.jsxs)(D.CardHeader,{children:[(0,s.jsx)(D.CardTitle,{children:"Machines"}),(0,s.jsx)(D.CardAction,{children:(0,s.jsx)("button",{type:"button",onClick:()=>a.push(`/w/${r}/runtimes`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,s.jsx)(Z.ArrowUpRight,{className:"size-4"})})})]}),(0,s.jsx)(D.CardContent,{children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No machines connected."})})]}):(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Machines"})}),(0,s.jsx)(D.CardContent,{className:"space-y-3",children:c.map(([e,a])=>{let r=a.runtimes.some(e=>"online"===e.status),i=a.runtimes.map(e=>e.last_seen_at).filter(Boolean).sort().reverse()[0],n=t.filter(e=>a.runtimes.some(s=>s.id===e.runtime_id)),l=a.runtimes.some(e=>e.pending_update_version),c=a.runtimes.find(e=>e.pending_update_version)?.pending_update_version;return(0,s.jsxs)("div",{className:"flex items-start gap-3 text-xs",children:[(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{className:`mt-1 size-2 shrink-0 rounded-full ${r?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,s.jsx)(C.TooltipContent,{side:"top",children:r?"Online":"Offline"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium truncate",children:a.deviceInfo||e.slice(0,12)}),l&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{children:(0,s.jsx)(L.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0 text-amber-500 border-amber-500/30",children:"update"})})}),(0,s.jsxs)(C.TooltipContent,{side:"top",children:["Pending update to v",c]})]})]}),(0,s.jsxs)("div",{className:"text-muted-foreground mt-0.5",children:[n.length>0?n.map(e=>e.name).join(", "):"No agents"," · ",function(e){if(!e)return"never";let s=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(s<60)return`${s}s ago`;let t=Math.floor(s/60);if(t<60)return`${t}m ago`;let a=Math.floor(t/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}(i??null)]})]})]},e)})})]})}function ee({overview:e}){let t=(0,n.useRouter)(),{slug:a}=(0,l.useWorkspace)(),{members:r,pending_invites:i}=e;return(0,s.jsxs)(D.Card,{children:[(0,s.jsxs)(D.CardHeader,{children:[(0,s.jsx)(D.CardAction,{children:(0,s.jsx)("button",{type:"button",onClick:()=>t.push(`/w/${a}/settings`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,s.jsx)(Z.ArrowUpRight,{className:"size-4"})})}),(0,s.jsxs)(D.CardTitle,{children:["Team",i>0&&(0,s.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground font-normal",children:["(",i," pending invite",i>1?"s":"",")"]})]})]}),(0,s.jsx)(D.CardContent,{className:"p-0",children:(0,s.jsx)("div",{className:"divide-y divide-border/50",children:[...r].sort((e,s)=>"owner"===e.role?-1:+("owner"===s.role)).map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.image?(0,s.jsx)("img",{src:e.image,alt:e.name,className:"size-7 rounded-full shrink-0"}):(0,s.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-secondary text-xs font-medium",children:(e.name||e.email).charAt(0).toUpperCase()}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("span",{className:"text-sm font-medium truncate block",children:e.name||e.email}),e.name&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground truncate block",children:e.email})]}),(0,s.jsx)(L.Badge,{variant:"owner"===e.role?"default":"secondary",className:"text-[10px] px-1.5 py-0 shrink-0",children:e.role})]},e.id))})})]})}function es(){let{agents:e,runtimes:a,loading:r,activeTaskCounts:i}=(0,A.useAgentContext)(),{workspaceId:n}=(0,l.useWorkspace)(),[c,o]=(0,t.useState)(null),[m,u]=(0,t.useState)(!1);return((0,t.useEffect)(()=>{if(r)return;let e=!1;return u(!0),(0,d.getWorkspaceOverview)(n).then(s=>{e||o(s)}).catch(()=>{}).finally(()=>{e||u(!1)}),()=>{e=!0}},[r,n]),m||!c)?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(J,{agents:e,runtimes:a,activeTaskCounts:i,overview:c}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(K,{overview:c}),(0,s.jsx)(Y,{overview:c,agents:e})]}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(X,{runtimes:a,agents:e}),(0,s.jsx)(ee,{overview:c})]})]})}let et=[{id:"general",label:"General"},{id:"pet",label:"Pet"},{id:"instruction",label:"Global Instruction"},{id:"notifications",label:"Notifications"},{id:"members",label:"Members"},{id:"usages",label:"Usages"}];e.s(["default",0,function(){let[e,i]=(0,t.useState)("general");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5 gap-3",children:(0,s.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,s.jsx)("h1",{className:"text-sm font-medium",children:"Settings"})})}),(0,s.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,s.jsxs)("nav",{className:"w-48 shrink-0 border-r border-border/50 py-3 px-2 hidden md:flex md:flex-col",children:[(0,s.jsx)("div",{className:"flex-1",children:et.map(t=>(0,s.jsx)("button",{onClick:()=>i(t.id),className:(0,r.cn)("w-full rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",e===t.id?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:t.label},t.id))}),(0,s.jsxs)("div",{className:"px-2.5 pt-3 border-t border-border/50 text-[11px] text-muted-foreground/60",children:["v","0.0.139"]})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,s.jsx)("div",{className:"px-4 pt-2 md:hidden",children:(0,s.jsx)(a.Tabs,{className:"items-center",value:e,onValueChange:e=>i(e),children:(0,s.jsx)(a.TabsList,{className:"h-auto gap-1",children:et.map(e=>(0,s.jsx)(a.TabsTrigger,{value:e.id,children:e.label},e.id))})})}),(0,s.jsx)("div",{className:(0,r.cn)("flex-1 overflow-y-auto thin-scrollbar","instruction"!==e&&"px-5 py-5"),children:"instruction"===e?(0,s.jsx)(v,{}):"usages"===e?(0,s.jsx)(es,{}):(0,s.jsxs)("div",{className:"mx-auto max-w-md",children:["general"===e&&(0,s.jsx)(f,{}),"pet"===e&&(0,s.jsx)(F,{}),"notifications"===e&&(0,s.jsx)(P,{}),"members"===e&&(0,s.jsx)(S,{})]})}),(0,s.jsxs)("div",{className:"px-4 py-2 text-[11px] text-muted-foreground/60 md:hidden",children:["v","0.0.139"]})]})]})]})}],716032)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,716032,e=>{"use strict";e.i(811374);var s=e.i(653772),t=e.i(511043),a=e.i(255334),r=e.i(613349),i=e.i(516266),n=e.i(126942),l=e.i(500324),c=e.i(23055),d=e.i(222862),o=e.i(186339),m=e.i(903477),u=e.i(473131),x=e.i(728886),h=e.i(553617),p=e.i(205189);function f(){let{workspaceId:e,slug:a}=(0,l.useWorkspace)(),r=(0,c.useSession)(),f=(0,n.useRouter)(),[g,j]=(0,t.useState)(""),[v,N]=(0,t.useState)(!0),[b,y]=(0,t.useState)(""),[k,w]=(0,t.useState)(""),[C,T]=(0,t.useState)(""),[S,E]=(0,t.useState)(""),[_,M]=(0,t.useState)(!1),[P,z]=(0,t.useState)({}),[I,O]=(0,t.useState)(""),[R,$]=(0,t.useState)(!1),F=(0,t.useCallback)(async()=>{N(!0);try{let s=r.data?.user?.id,[t,a]=await Promise.all([(0,d.listMembers)(e),(0,d.listWorkspaces)()]),i=t.find(e=>e.user_id===s);j(i?.role??"");let n=a.find(s=>s.id===e);n&&(y(n.name),w(n.slug),T(n.name),E(n.slug))}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load workspace info")}finally{N(!1)}},[e,r.data?.user?.id]);(0,t.useEffect)(()=>{r.data&&F()},[F,r.data]);let A=b!==C||k!==S,D=async()=>{let s=(0,h.validateWorkspaceForm)({name:b,slug:k});if(z(s),!(0,h.hasWorkspaceFormErrors)(s)){M(!0);try{let s=await (0,d.updateWorkspace)(e,{name:b.trim(),slug:k.trim()});(0,p.trackSettingsUpdated)({setting_tab:"general"}),T(s.name),E(s.slug),i.toast.success("Workspace updated"),s.slug!==a&&f.replace(`/w/${s.slug}/settings`)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to update workspace")}finally{M(!1)}}},L=async()=>{if(I===C){$(!0);try{await (0,d.deleteWorkspace)(e,C),i.toast.success("Workspace deleted"),f.replace("/workspaces")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to delete workspace")}finally{$(!1)}}};return v?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-32"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"})]}):"owner"!==g?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Only workspace owners can edit workspace settings."}):(0,s.jsxs)("div",{className:"space-y-10",children:[(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Workspace"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(u.Label,{htmlFor:"workspace-name",children:"Name"}),(0,s.jsx)(m.Input,{id:"workspace-name",value:b,onChange:e=>{let s=e.target.value;y(s),P.name&&s.trim()&&z(e=>({...e,name:void 0}))},placeholder:"Workspace name","aria-invalid":!!P.name,"aria-describedby":P.name?"workspace-name-error":void 0}),P.name&&(0,s.jsx)("p",{id:"workspace-name-error",className:"text-xs text-destructive",children:P.name})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(u.Label,{htmlFor:"workspace-slug",children:"Slug"}),(0,s.jsx)(m.Input,{id:"workspace-slug",value:k,onChange:e=>{let s=e.target.value;w(s),P.slug&&s.trim()&&z(e=>({...e,slug:void 0}))},placeholder:"workspace-slug","aria-invalid":!!P.slug,"aria-describedby":P.slug?"workspace-slug-error":void 0}),P.slug&&(0,s.jsx)("p",{id:"workspace-slug-error",className:"text-xs text-destructive",children:P.slug}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground/70",children:["Used in URLs: /w/",k,"/"]})]})]}),(0,s.jsx)(o.Button,{size:"sm",onClick:D,disabled:!A||_,children:_?"Saving…":"Save"})]}),(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-destructive",children:"Danger Zone"}),(0,s.jsxs)("div",{className:"rounded-md border border-destructive/30 p-4 space-y-3",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Deleting this workspace is permanent and cannot be undone. All agents, conversations, and data will be lost."}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)(u.Label,{htmlFor:"delete-confirm",className:"text-xs",children:["Type ",(0,s.jsx)("span",{className:"font-medium text-foreground",children:C})," to confirm"]}),(0,s.jsx)(m.Input,{id:"delete-confirm",value:I,onChange:e=>O(e.target.value),placeholder:C})]}),(0,s.jsx)(o.Button,{size:"sm",variant:"destructive",onClick:L,disabled:I!==C||R,children:R?"Deleting…":"Delete Workspace"})]})]})]})}var g=e.i(740513);function j({ratio:e,size:t=16,stroke:a=1.5}){let i=(t-a)/2,n=2*Math.PI*i,l=(e<=0?0:e>=1?1:Math.log1p(99*e)/Math.log(100))*n;return(0,s.jsxs)("svg",{width:t,height:t,className:"shrink-0 -rotate-90","aria-hidden":!0,children:[(0,s.jsx)("circle",{cx:t/2,cy:t/2,r:i,fill:"none",stroke:"currentColor",strokeWidth:a,className:"text-border"}),(0,s.jsx)("circle",{cx:t/2,cy:t/2,r:i,fill:"none",stroke:"currentColor",strokeWidth:a,strokeDasharray:`${l} ${n-l}`,strokeLinecap:"round",className:(0,r.cn)("transition-all duration-300",e>.9?"text-destructive/70":e>.7?"text-yellow-500/50":"text-muted-foreground/30")})]})}function v(){let{workspaceId:e}=(0,l.useWorkspace)(),[a,r]=(0,t.useState)(""),[n,c]=(0,t.useState)(""),[o,m]=(0,t.useState)(!0),u=(0,t.useRef)(a);(0,t.useEffect)(()=>{u.current=a},[a]);let h=(0,t.useRef)(n);(0,t.useEffect)(()=>{h.current=n},[n]);let p=(0,t.useRef)(null),f=(0,t.useRef)(!1),v=(0,t.useCallback)(async()=>{m(!0);try{let s=await (0,d.getMemberMe)(e);r(s.global_instruction),c(s.global_instruction)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load settings")}finally{m(!1)}},[e]);(0,t.useEffect)(()=>{v()},[v]);let N=(0,t.useRef)(()=>{}),b=(0,t.useCallback)(async()=>{if(f.current)return;let s=u.current;if(s!==h.current){f.current=!0;try{let t=await (0,d.updateMemberMe)(e,s);c(t.global_instruction)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to save")}finally{f.current=!1,u.current!==h.current&&N.current()}}},[e]),y=(0,t.useCallback)(()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(b,500)},[b]);(0,t.useEffect)(()=>{N.current=y},[y]);let k=(0,t.useCallback)(e=>{r(e),y()},[y]);(0,t.useEffect)(()=>{let s=()=>{if(p.current&&clearTimeout(p.current),u.current!==h.current){let s=new URLSearchParams({workspace_id:e});fetch(`/api/members/me?${s}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:u.current}),keepalive:!0})}};return window.addEventListener("beforeunload",s),()=>window.removeEventListener("beforeunload",s)},[e]),(0,t.useEffect)(()=>()=>{if(p.current&&clearTimeout(p.current),u.current!==h.current){let s=new URLSearchParams({workspace_id:e});fetch(`/api/members/me?${s}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:u.current}),keepalive:!0})}},[e]);let w=a.length/5e4;return o?(0,s.jsxs)("div",{className:"px-6 py-6 space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-48"}),(0,s.jsx)(x.Skeleton,{className:"h-40 w-full"})]}):(0,s.jsxs)("div",{className:"flex flex-col h-full",children:[(0,s.jsx)("div",{className:"flex-1 px-6 pt-4 pb-4",children:(0,s.jsx)(g.MarkdownEditor,{value:a,onChange:k,placeholder:"Write instructions that every agent you own will follow...",minHeight:"calc(100vh - 240px)",contentType:"markdown",variant:"seamless"})}),(0,s.jsxs)("div",{className:"flex items-center gap-2 px-6 py-3",children:[(0,s.jsx)(j,{ratio:w}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"This instruction is prepended to every agent's individual instruction."})]})]})}var N=e.i(330746),b=e.i(813141),y=e.i(947308),k=e.i(419412);let w=(0,k.default)("user-minus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);var C=e.i(329686);function T(e){return`${window.location.origin}/invite/${e}`}function S(){let{workspaceId:e}=(0,l.useWorkspace)(),a=(0,c.useSession)(),n=a.data?.user?.id,[m,u]=(0,t.useState)([]),[h,f]=(0,t.useState)([]),[g,j]=(0,t.useState)(!0),[v,k]=(0,t.useState)(!1),S=m.find(e=>e.user_id===n)?.role==="owner",E=(0,t.useCallback)(async()=>{j(!0);try{let[s,t]=await Promise.all([(0,d.listMembers)(e),(0,d.listInvites)(e).catch(()=>[])]);u(s),f(t)}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to load members")}finally{j(!1)}},[e]);(0,t.useEffect)(()=>{E()},[E]);let _=async()=>{k(!0);try{let s=await (0,d.createInvite)(e);(0,p.trackTeamMemberInvited)({workspace_id:e}),f(e=>[...e,s]);let t=T(s.token);await navigator.clipboard.writeText(t),i.toast.success("Invite link copied to clipboard")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to generate invite")}finally{k(!1)}},M=async e=>{let s=T(e);try{await navigator.clipboard.writeText(s),i.toast.success("Invite link copied")}catch{i.toast.error("Failed to copy link")}},P=async s=>{try{await (0,d.revokeInvite)(e,s),f(e=>e.filter(e=>e.id!==s)),i.toast.success("Invite revoked")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to revoke invite")}},z=async s=>{try{await (0,d.removeMember)(e,s),u(e=>e.filter(e=>e.id!==s)),i.toast.success("Member removed")}catch(e){i.toast.error(e instanceof Error?e.message:"Failed to remove member")}};return g?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-4 w-24"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-4 w-24 mt-6"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"}),(0,s.jsx)(x.Skeleton,{className:"h-10 w-full"})]}):(0,s.jsxs)("div",{className:"space-y-8",children:[S&&(0,s.jsxs)("section",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Pending Invites"}),(0,s.jsxs)(o.Button,{size:"sm",variant:"outline",onClick:_,disabled:v,children:[(0,s.jsx)(y.Plus,{className:"size-3.5 mr-1"}),v?"Generating…":"Generate invite link"]})]}),0===h.length?(0,s.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:"No active invite links. Generate one to invite someone to this workspace."}):(0,s.jsx)("div",{className:"space-y-1.5",children:h.map(e=>{let t=new Date(e.expires_at),a=t<new Date;return(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2 text-xs",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:(0,r.cn)("font-mono truncate",a&&"text-muted-foreground line-through"),children:["/invite/",e.token.slice(0,12),"…"]}),(0,s.jsx)("p",{className:(0,r.cn)("text-muted-foreground/70 mt-0.5",a&&"text-destructive/70"),children:a?"Expired":`Expires ${t.toLocaleDateString()}`})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 ml-2 shrink-0",children:[!a&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>M(e.token)}),children:(0,s.jsx)(N.Copy,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Copy invite link"})]}),(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-destructive hover:text-destructive",onClick:()=>P(e.id)}),children:(0,s.jsx)(b.Trash2,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Revoke invite"})]})]})]},e.id)})})]}),(0,s.jsxs)("section",{className:"space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Members"}),(0,s.jsx)("div",{className:"space-y-1.5",children:m.map(e=>{let t=e.user_id===n,a=e.name?e.name.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():e.email.slice(0,2).toUpperCase();return(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-border/50 px-3 py-2",children:[(0,s.jsx)("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center text-xs font-medium text-muted-foreground shrink-0 overflow-hidden",children:e.image?(0,s.jsx)("img",{src:e.image,alt:e.name,className:"size-full object-cover"}):a}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"text-sm font-medium truncate leading-tight",children:[e.name||e.email,t&&(0,s.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"(you)"})]}),e.name&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.email})]}),(0,s.jsx)("span",{className:(0,r.cn)("text-xs px-1.5 py-0.5 rounded shrink-0","owner"===e.role?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:e.role}),S&&!t&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)(o.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive shrink-0",onClick:()=>z(e.id)}),children:(0,s.jsx)(w,{className:"size-3.5"})}),(0,s.jsx)(C.TooltipContent,{children:"Remove member"})]})]},e.id)})})]})]})}var E=e.i(885515),_=e.i(254618),M=e.i(899746);function P(){let[e,a]=(0,t.useState)(!1),[r,n]=(0,t.useState)([...M.NOTIFICATION_EVENTS]),[l,c]=(0,t.useState)(!0),[d,o]=(0,t.useState)(!1);(0,t.useEffect)(()=>{c((0,M.isNotificationSupported)()),a((0,M.getNotificationEnabled)()),n((0,M.getNotificationEvents)()),(0,M.isNotificationSupported)()&&o("denied"===Notification.permission)},[]);let m=async e=>{if(!e){a(!1),(0,M.setNotificationEnabled)(!1);return}await (0,M.requestNotificationPermission)()?(a(!0),(0,M.setNotificationEnabled)(!0)):(o(!0),i.toast.error("Notification permission denied. Please enable it in browser settings."))};return l?(0,s.jsx)("div",{className:"space-y-6",children:(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Browser Notifications"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)("p",{className:"text-sm",children:"Enable notifications"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Get notified when tasks finish while the tab is in the background"})]}),(0,s.jsx)(_.Switch,{checked:e,onCheckedChange:m,disabled:d&&!e})]}),d&&!e&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:"Notification permission was denied. Please allow it in your browser settings."}),e&&(0,s.jsxs)("div",{className:"space-y-2 pl-0.5",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Notify me when:"}),M.NOTIFICATION_EVENTS.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer select-none",children:[(0,s.jsx)(E.Checkbox,{checked:r.includes(e),onCheckedChange:()=>{n(s=>{let t=s.includes(e)?s.filter(s=>s!==e):[...s,e];return(0,M.setNotificationEvents)(t),t})}}),M.NOTIFICATION_EVENT_LABELS[e]]},e))]})]})]})}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your browser does not support notifications."})}let z=(0,k.default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var I=e.i(399561),O=e.i(460520),R=e.i(961909),$=e.i(790961);function F(){let[e,a]=(0,t.useState)(!1),[i,n]=(0,t.useState)(I.CLOUD_CODE_MONSTER_PET_PRESETS[0].id),l=(0,I.getCloudCodeMonsterPreset)(i);return(0,t.useEffect)(()=>{a((0,$.readHomePetSettings)().enabled),n((0,I.readCloudCodeMonsterPetPresetId)());let e=e=>{let s=e.detail?.presetId;n(s?(0,I.getCloudCodeMonsterPreset)(s).id:(0,I.readCloudCodeMonsterPetPresetId)())};return window.addEventListener(O.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,e),()=>{window.removeEventListener(O.CLOUD_CODE_MONSTER_PRESET_CHANGED_EVENT,e)}},[]),(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Pet"}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(u.Label,{htmlFor:"pet-enabled",className:"text-sm",children:"Enable pet"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Off by default. Turn it on when you want the workspace companion."})]}),(0,s.jsx)(_.Switch,{id:"pet-enabled",checked:e,onCheckedChange:e=>{a(e),(0,$.writeHomePetSettings)({enabled:e})}})]})})]}),e?(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-sm font-medium",children:"Preset"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:l.name})]}),(0,s.jsx)("div",{className:"grid size-14 place-items-center rounded-md bg-card ring-1 ring-border/60",children:(0,s.jsx)(R.CloudCodeMonsterPresetPreview,{preset:l,className:"size-11"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:I.CLOUD_CODE_MONSTER_PET_PRESETS.map(e=>{let t=e.id===l.id;return(0,s.jsxs)("button",{type:"button","aria-pressed":t,onClick:()=>{n((0,I.writeCloudCodeMonsterPetPresetId)(e.id))},className:(0,r.cn)("group grid h-28 min-w-0 grid-rows-[1fr_auto] rounded-md border bg-card/60 p-2 text-left transition-all hover:border-foreground/20 hover:bg-accent/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70",t?"border-primary/50 bg-accent text-foreground":"border-border/50 text-muted-foreground"),children:[(0,s.jsx)("div",{className:"grid place-items-center rounded bg-background/70 ring-1 ring-border/35",children:(0,s.jsx)(R.CloudCodeMonsterPresetPreview,{preset:e,className:"size-14 transition-transform duration-200 group-hover:scale-105"})}),(0,s.jsxs)("div",{className:"mt-1.5 flex min-w-0 items-center justify-between gap-1 text-[10px] leading-none",children:[(0,s.jsx)("span",{className:"truncate font-medium text-foreground",children:e.name}),t?(0,s.jsx)(z,{className:"size-3 shrink-0 text-primary"}):(0,s.jsx)("span",{className:"shrink-0 text-muted-foreground",children:e.id.replace("pet-","#")})]})]},e.id)})})]}):null]})}var A=e.i(355578),D=e.i(934351),L=e.i(875061);let W=(0,k.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var U=e.i(896210),B=e.i(392277);let H=(0,k.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var q=e.i(646769);let G=(0,k.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function V({icon:e,label:t,value:a,sub:r}){return(0,s.jsx)(D.Card,{size:"sm",children:(0,s.jsxs)(D.CardContent,{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,s.jsx)(e,{className:"size-4"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,s.jsx)("p",{className:"text-2xl font-semibold leading-none tracking-tight",children:a}),r&&(0,s.jsx)(L.Badge,{variant:"secondary",className:"text-[10px] px-1.5 h-4 font-normal",children:r})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground truncate",children:t})]})]})})}function J({agents:e,runtimes:t,activeTaskCounts:a,overview:r}){let i=new Map;for(let e of t){let s=e.daemon_id??e.id;i.set(s,i.get(s)||"online"===e.status)}let n=i.size,l=[...i.values()].filter(Boolean).length,c=Object.values(a).reduce((e,s)=>e+s,0),d=e.filter(e=>{let s=t.find(s=>s.id===e.runtime_id);return s?.status==="online"}).length;return(0,s.jsxs)("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,s.jsx)(V,{icon:q.Monitor,label:"Machines",value:`${l}/${n}`,sub:"online"}),(0,s.jsx)(V,{icon:W,label:"Agents",value:e.length,sub:`${d} online`}),(0,s.jsx)(V,{icon:H,label:"Members",value:r.members.length,sub:r.pending_invites>0?`${r.pending_invites} pending`:void 0}),(0,s.jsx)(V,{icon:G,label:"Active Tasks",value:c,sub:r.task_stats.queued>0?`${r.task_stats.queued} queued`:void 0}),(0,s.jsx)(V,{icon:B.Send,label:"Emails Sent",value:r.email_stats.outbound,sub:`${r.email_stats.unread} unread`}),(0,s.jsx)(V,{icon:U.Mail,label:"Custom Emails",value:r.email_accounts.length})]})}function K({overview:e}){let{completed:t,failed:a,cancelled:r,queued:i,stale:n}=e.task_stats,l=t+a,c=l>0?(a/l*100).toFixed(1):"0";return(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Task Health (Today)"})}),(0,s.jsx)(D.CardContent,{children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)(Q,{label:"Completed",value:t}),(0,s.jsx)(Q,{label:"Failed",value:a,className:a>0?"text-destructive":void 0}),(0,s.jsx)(Q,{label:"Cancelled",value:r}),(0,s.jsx)(Q,{label:"Failure Rate",value:`${c}%`,className:Number(c)>10?"text-destructive":void 0}),(0,s.jsx)(Q,{label:"Queue Backlog",value:i,className:i>10?"text-amber-500":void 0}),(0,s.jsx)(Q,{label:"Stale Tasks",value:n,className:n>0?"text-destructive":void 0})]})})]})}function Q({label:e,value:t,className:a}){return(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${a??""}`,children:t}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})}function Y({overview:e,agents:t}){let{inbound:a,outbound:r,unread:i,rejected:n}=e.email_stats,l=new Map(t.map(e=>[e.id,e.name]));return(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Email Summary"})}),(0,s.jsxs)(D.CardContent,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xl font-semibold",children:a}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Received"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xl font-semibold",children:r}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Sent"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${i>0?"text-primary":""}`,children:i}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Unread"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:`text-xl font-semibold ${n>0?"text-amber-500":""}`,children:n}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Untrust"})]})]}),e.email_accounts.length>0&&(0,s.jsxs)("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Custom Mailboxes"}),e.email_accounts.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{className:`size-1.5 shrink-0 rounded-full ${"active"===e.status?"bg-emerald-500":"bg-destructive"}`})}),(0,s.jsx)(C.TooltipContent,{side:"top",children:"active"===e.status?"Active":`Error: ${e.error_message||"inactive"}`})]}),(0,s.jsx)("span",{className:"truncate",children:e.email_address})]}),(0,s.jsx)("span",{className:"text-muted-foreground shrink-0",children:l.get(e.agent_id)??"—"})]},e.id))]})]})]})}var Z=e.i(345262);function X({runtimes:e,agents:t}){let a=(0,n.useRouter)(),{slug:r}=(0,l.useWorkspace)(),i=new Map;for(let s of e){let e=s.daemon_id??s.id;i.has(e)||i.set(e,{runtimes:[],deviceInfo:s.device_info??""}),i.get(e).runtimes.push(s)}let c=[...i.entries()];return 0===c.length?(0,s.jsxs)(D.Card,{children:[(0,s.jsxs)(D.CardHeader,{children:[(0,s.jsx)(D.CardTitle,{children:"Machines"}),(0,s.jsx)(D.CardAction,{children:(0,s.jsx)("button",{type:"button",onClick:()=>a.push(`/w/${r}/runtimes`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,s.jsx)(Z.ArrowUpRight,{className:"size-4"})})})]}),(0,s.jsx)(D.CardContent,{children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No machines connected."})})]}):(0,s.jsxs)(D.Card,{children:[(0,s.jsx)(D.CardHeader,{children:(0,s.jsx)(D.CardTitle,{children:"Machines"})}),(0,s.jsx)(D.CardContent,{className:"space-y-3",children:c.map(([e,a])=>{let r=a.runtimes.some(e=>"online"===e.status),i=a.runtimes.map(e=>e.last_seen_at).filter(Boolean).sort().reverse()[0],n=t.filter(e=>a.runtimes.some(s=>s.id===e.runtime_id)),l=a.runtimes.some(e=>e.pending_update_version),c=a.runtimes.find(e=>e.pending_update_version)?.pending_update_version;return(0,s.jsxs)("div",{className:"flex items-start gap-3 text-xs",children:[(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{className:`mt-1 size-2 shrink-0 rounded-full ${r?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,s.jsx)(C.TooltipContent,{side:"top",children:r?"Online":"Offline"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium truncate",children:a.deviceInfo||e.slice(0,12)}),l&&(0,s.jsxs)(C.Tooltip,{children:[(0,s.jsx)(C.TooltipTrigger,{render:(0,s.jsx)("span",{children:(0,s.jsx)(L.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0 text-amber-500 border-amber-500/30",children:"update"})})}),(0,s.jsxs)(C.TooltipContent,{side:"top",children:["Pending update to v",c]})]})]}),(0,s.jsxs)("div",{className:"text-muted-foreground mt-0.5",children:[n.length>0?n.map(e=>e.name).join(", "):"No agents"," · ",function(e){if(!e)return"never";let s=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(s<60)return`${s}s ago`;let t=Math.floor(s/60);if(t<60)return`${t}m ago`;let a=Math.floor(t/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}(i??null)]})]})]},e)})})]})}function ee({overview:e}){let t=(0,n.useRouter)(),{slug:a}=(0,l.useWorkspace)(),{members:r,pending_invites:i}=e;return(0,s.jsxs)(D.Card,{children:[(0,s.jsxs)(D.CardHeader,{children:[(0,s.jsx)(D.CardAction,{children:(0,s.jsx)("button",{type:"button",onClick:()=>t.push(`/w/${a}/settings`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,s.jsx)(Z.ArrowUpRight,{className:"size-4"})})}),(0,s.jsxs)(D.CardTitle,{children:["Team",i>0&&(0,s.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground font-normal",children:["(",i," pending invite",i>1?"s":"",")"]})]})]}),(0,s.jsx)(D.CardContent,{className:"p-0",children:(0,s.jsx)("div",{className:"divide-y divide-border/50",children:[...r].sort((e,s)=>"owner"===e.role?-1:+("owner"===s.role)).map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.image?(0,s.jsx)("img",{src:e.image,alt:e.name,className:"size-7 rounded-full shrink-0"}):(0,s.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-secondary text-xs font-medium",children:(e.name||e.email).charAt(0).toUpperCase()}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("span",{className:"text-sm font-medium truncate block",children:e.name||e.email}),e.name&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground truncate block",children:e.email})]}),(0,s.jsx)(L.Badge,{variant:"owner"===e.role?"default":"secondary",className:"text-[10px] px-1.5 py-0 shrink-0",children:e.role})]},e.id))})})]})}function es(){let{agents:e,runtimes:a,loading:r,activeTaskCounts:i}=(0,A.useAgentContext)(),{workspaceId:n}=(0,l.useWorkspace)(),[c,o]=(0,t.useState)(null),[m,u]=(0,t.useState)(!1);return((0,t.useEffect)(()=>{if(r)return;let e=!1;return u(!0),(0,d.getWorkspaceOverview)(n).then(s=>{e||o(s)}).catch(()=>{}).finally(()=>{e||u(!1)}),()=>{e=!0}},[r,n]),m||!c)?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"}),(0,s.jsx)(x.Skeleton,{className:"h-44 rounded-xl"})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(J,{agents:e,runtimes:a,activeTaskCounts:i,overview:c}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(K,{overview:c}),(0,s.jsx)(Y,{overview:c,agents:e})]}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)(X,{runtimes:a,agents:e}),(0,s.jsx)(ee,{overview:c})]})]})}let et=[{id:"general",label:"General"},{id:"pet",label:"Pet"},{id:"instruction",label:"Global Instruction"},{id:"notifications",label:"Notifications"},{id:"members",label:"Members"},{id:"usages",label:"Usages"}];e.s(["default",0,function(){let[e,i]=(0,t.useState)("general");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5 gap-3",children:(0,s.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,s.jsx)("h1",{className:"text-sm font-medium",children:"Settings"})})}),(0,s.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,s.jsxs)("nav",{className:"w-48 shrink-0 border-r border-border/50 py-3 px-2 hidden md:flex md:flex-col",children:[(0,s.jsx)("div",{className:"flex-1",children:et.map(t=>(0,s.jsx)("button",{onClick:()=>i(t.id),className:(0,r.cn)("w-full rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",e===t.id?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:t.label},t.id))}),(0,s.jsxs)("div",{className:"px-2.5 pt-3 border-t border-border/50 text-[11px] text-muted-foreground/60",children:["v","0.0.140"]})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,s.jsx)("div",{className:"px-4 pt-2 md:hidden",children:(0,s.jsx)(a.Tabs,{className:"items-center",value:e,onValueChange:e=>i(e),children:(0,s.jsx)(a.TabsList,{className:"h-auto gap-1",children:et.map(e=>(0,s.jsx)(a.TabsTrigger,{value:e.id,children:e.label},e.id))})})}),(0,s.jsx)("div",{className:(0,r.cn)("flex-1 overflow-y-auto thin-scrollbar","instruction"!==e&&"px-5 py-5"),children:"instruction"===e?(0,s.jsx)(v,{}):"usages"===e?(0,s.jsx)(es,{}):(0,s.jsxs)("div",{className:"mx-auto max-w-md",children:["general"===e&&(0,s.jsx)(f,{}),"pet"===e&&(0,s.jsx)(F,{}),"notifications"===e&&(0,s.jsx)(P,{}),"members"===e&&(0,s.jsx)(S,{})]})}),(0,s.jsxs)("div",{className:"px-4 py-2 text-[11px] text-muted-foreground/60 md:hidden",children:["v","0.0.140"]})]})]})]})}],716032)}]);