@alook/app 0.0.61 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
- package/bundled/web/.open-next/assets/BUILD_ID +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0-mpehtea82gj.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0.2cm-frpsn46.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/02l4ozfj-bus0.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/02m~kr41yqpgu.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/02oywn5r~vty4.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/037bobdy3gbd3.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/05pjee3c_08ry.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/09fl.5j3fsb-~.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/09g3tf250sygu.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0_.5~wi4~pwek.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0b~ih_tyx7kz2.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0e68yx9h-f6.4.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0h--f0f9fru_b.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{0ckywgfha.zc8.js → 0ioy_kjd42n1w.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0khqgglj_9zdp.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0l-ma4.~.hl0g.js +3 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0mq7ossd6d7or.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0ojkmo0k890x0.js +63 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{05x9e8ndr.o12.js → 0pg7cnm39yoom.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0q8gx414vnsur.js +3 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0uht5kak3uat9.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0v5mv7gpv3g0e.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0v~f5hjxbtvse.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0wehjlyi0zl04.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0ypg5.fp9-.a2.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0zplaqwk4a-ro.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/1053vndt~uadk.js +2 -0
- package/bundled/web/.open-next/cache/{ouY0UJDBkwSzFlKOVDaoD → SuuOnXXAS0ccoLD99O2QP}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{ouY0UJDBkwSzFlKOVDaoD → SuuOnXXAS0ccoLD99O2QP}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/{ouY0UJDBkwSzFlKOVDaoD → SuuOnXXAS0ccoLD99O2QP}/sitemap.xml.cache +1 -1
- package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
- package/bundled/web/.open-next/cloudflare/init.js +1 -1
- package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
- package/bundled/web/.open-next/middleware/handler.mjs +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/new/page_client-reference-manifest.js +1 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/flags/page_client-reference-manifest.js +1 -1
- 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
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/[traceId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/workspaces/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +11 -13
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0jkll-p._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0tpn293._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +11 -13
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_00tia4h._.js +65 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_01-aa1p._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_06cffai._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_07nc8as._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0_gdn-k._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0grgpqw._.js → _0icffya._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0xd~7d0._.js → _0l89059._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_07nfm8a._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_0d6x0l6._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_0ivfx3i._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_0o~nukr._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0dvds67._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0stugv_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_activity_page_tsx_0sthpjy._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_email_page_tsx_09mq1-g._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_files_page_tsx_11eh380._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_layout_tsx_0juu2um._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_flags_page_tsx_01u6ba1._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_home_page_tsx_0lkx78f._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_issues_page_tsx_0_k5j03._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_settings_page_tsx_0fdcupy._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_threads_[traceId]_page_tsx_00bx721._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_00xgo_-._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_0nj0euq._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_avatar_index_ts_0v3qm09._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_issues_issue-sheet_tsx_02fma1.._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_ui_tooltip_tsx_01x-izi._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_workspace-shell_tsx_0479plk._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +31 -31
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +202 -238
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +3 -3
- package/package.json +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0.sz8uokz4r3z.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/02eur_~.0beq1.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0897z5r~zf_64.js +0 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/09cf5_rxgdweq.js +0 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/09g0nda2m8qs6.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/09xlaawkmeo-1.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0_r2q9b0p3~43.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0cevbp17ckdk8.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0cfcuvz1i5ib-.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0d_~94mojr73c.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0fv1xxx5~japv.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0h3_qte--w1zd.js +0 -2
- package/bundled/web/.open-next/assets/_next/static/chunks/0kv3zo-jlu8ys.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0ns6eebx34b7y.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0s.jfkn9-ghod.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0tzluwv791ius.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0v1r-i08gf2_r.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0vy6bvkl._5cz.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0wh92yl8ru81f.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0wiz11twa9nza.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0xgmeffaed_g1.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/11awu4cnrpf_2.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/13ghp4pyj_rtr.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/15b8tj5zgbyem.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/17vrtnfkomuz6.js +0 -63
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/0r03_@base-ui_react_esm_0rw~qhg._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__07kw94m._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0j4zfi1._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_00lrpyh._.js +0 -65
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0388irl._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0cq9vt9._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0rb2_75._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0rkr3t4._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_01s8r3n._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_0r.85x_._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_0rwgvis._.js +0 -3
- /package/bundled/web/.open-next/assets/_next/static/{ouY0UJDBkwSzFlKOVDaoD → SuuOnXXAS0ccoLD99O2QP}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{ouY0UJDBkwSzFlKOVDaoD → SuuOnXXAS0ccoLD99O2QP}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{ouY0UJDBkwSzFlKOVDaoD → SuuOnXXAS0ccoLD99O2QP}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{ouY0UJDBkwSzFlKOVDaoD → SuuOnXXAS0ccoLD99O2QP}/robots.txt.cache +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[224226,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(75118);function h({className:a,...c}){return(0,b.jsx)("textarea",{"data-slot":"textarea",className:(0,g.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",a),...c})}var i=a.i(354498),j=a.i(432340),k=a.i(74414);function l({value:a,onValueChange:c,runtimes:d,disabled:e,triggerProps:f}){let g=function(a){let b=new Map;for(let c of a){let a=c.daemon_id||c.id;b.has(a)||b.set(a,{label:("string"==typeof c.device_info?c.device_info:"")||a,runtimes:[]}),b.get(a).runtimes.push(c)}return b}(d),h=e||0===d.length||d.every(a=>"online"!==a.status);return(0,b.jsxs)(i.Select,{value:a,onValueChange:a=>{a&&c(a)},disabled:h,items:d.map(a=>{let b=("string"==typeof a.device_info?a.device_info:"")||"",c=b?`${a.provider} (${b})`:a.provider;return{value:a.id,label:c}}),children:[(0,b.jsx)(i.SelectTrigger,{...f,children:(0,b.jsx)(i.SelectValue,{placeholder:0===d.length?"No runtimes — start a daemon first":d.every(a=>"online"!==a.status)?"All runtimes offline":"Select a runtime"})}),(0,b.jsx)(i.SelectPopup,{children:Array.from(g.entries()).map(([a,c])=>(0,b.jsxs)(i.SelectGroup,{children:[(0,b.jsx)(i.SelectGroupLabel,{className:"truncate",children:c.label}),c.runtimes.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,disabled:"online"!==a.status,children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.ProviderLogo,{provider:a.provider,className:"h-4 w-4"}),(0,b.jsx)("span",{children:a.provider}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",a.status,")"]})]})},a.id))]},a))})]})}a.i(974936),process.env.ALOOK_DOMAIN;let m=/^[a-zA-Z0-9-]{3,}$/,n=new Set(["no-reply","noreply","admin","support","help","info","postmaster","abuse","security","mailer-daemon","root","webmaster","hostmaster","system","alook"]);function o(a){return m.test(a)&&!n.has(a.toLowerCase())}let p=(0,a.i(790090).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var q=a.i(942854),r=a.i(506180),s=a.i(588339),t=a.i(752792),u=a.i(446827),v=a.i(921584);a.s(["AgentAccessTab",0,function({agentId:e,ownerId:f}){let{workspaceId:h}=(0,r.useWorkspace)(),[k,l]=(0,c.useState)("private"),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)([]),[t,w]=(0,c.useState)([]),[x,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let a=!1;return y(!0),Promise.all([(0,s.listAgentAccess)(h,e),(0,s.listMembers)(h)]).then(([b,c])=>{a||(p(b),w(c))}).catch(b=>{a||(b instanceof u.ApiError&&403===b.status?A(b.message):A("Failed to load access list"))}).finally(()=>{a||y(!1)}),()=>{a=!0}},[h,e]),(0,c.useEffect)(()=>{a.A(81396).then(({listAgents:a})=>{a(h).then(a=>{let b=a.find(a=>a.id===e);b&&l(b.visibility??"private")}).catch(()=>{})})},[h,e]);let J=async a=>{l(a),n(!0);try{await (0,s.updateAgent)(e,{visibility:a},h),v.toast.success("public"===a?"Agent is now public":"Agent is now private")}catch{l(k),v.toast.error("Failed to update visibility")}finally{n(!1)}},K=t.find(a=>a.user_id===f),L=new Set(o.map(a=>a.user_id)),M=t.filter(a=>!L.has(a.user_id)&&a.user_id!==f),N=async a=>{if(a&&!D){E(!0),A(null);try{await (0,s.grantAgentAccess)(h,e,a);let b=t.find(b=>b.user_id===a);b&&p(c=>[...c,{id:a,user_id:b.user_id,name:b.name,email:b.email,created_at:new Date().toISOString()}]),C(""),v.toast.success("Access granted")}catch(a){A(a instanceof Error?a.message:"Failed to grant access")}finally{E(!1)}}},O=async()=>{if(F){p(a=>a.filter(a=>a.user_id!==F.user_id)),G(null),A(null);try{await (0,s.revokeAgentAccess)(h,e,F.user_id,H),v.toast.success(H?"Access revoked and removed from whitelist":"Access revoked")}catch{p(o),A("Failed to revoke access")}}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-6",children:[(0,b.jsx)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Visibility"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"public"===k?"All workspace members can use this agent":"Only authorized members can use this agent"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:m?"Saving…":"public"===k?"Public":"Private"}),(0,b.jsx)("input",{type:"checkbox",checked:"public"===k,onChange:a=>J(a.target.checked?"public":"private"),disabled:m,className:"sr-only peer"}),(0,b.jsx)("div",{className:"relative w-9 h-5 bg-muted rounded-full peer-checked:bg-primary transition-colors",children:(0,b.jsx)("div",{className:(0,g.cn)("absolute left-0.5 top-0.5 w-4 h-4 bg-background rounded-full transition-transform","public"===k?"translate-x-4":"translate-x-0")})})]})]})}),"private"===k&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Authorized Members"}),z&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:z}),x?(0,b.jsx)("div",{className:"space-y-2",children:[1,2].map(a=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},a))}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[K&&(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:K.name||K.email}),K.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:K.email})]}),(0,b.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:"Owner"})]}),o.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:a.name||a.email}),a.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.user_id,void((c=o.find(a=>a.user_id===b))&&(G(c),I(!0)))},className:"ml-2 shrink-0 rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.user_id))]}),M.length>0?(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(i.Select,{value:B,onValueChange:a=>{a&&(C(a),N(a))},children:[(0,b.jsx)(i.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)(i.SelectValue,{placeholder:"Add a member..."})}),(0,b.jsx)(i.SelectPopup,{children:M.map(a=>(0,b.jsx)(i.SelectItem,{value:a.user_id,children:a.name||a.email},a.user_id))})]})}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"All workspace members have been added. Invite new members from workspace settings."})]})]}),(0,b.jsx)(j.Dialog,{open:!!F,onOpenChange:a=>{a||G(null)},children:(0,b.jsxs)(j.DialogContent,{children:[(0,b.jsxs)(j.DialogHeader,{children:[(0,b.jsx)(j.DialogTitle,{children:"Remove Member Access"}),(0,b.jsxs)(j.DialogDescription,{children:["Remove"," ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:F?.name||F?.email})," ","from this agent?"]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer px-1",children:[(0,b.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked),className:"size-4 rounded border-border accent-primary"}),(0,b.jsx)("span",{className:"text-sm",children:"Also remove from email whitelist"})]}),(0,b.jsxs)(j.DialogFooter,{children:[(0,b.jsx)(j.DialogClose,{render:(0,b.jsx)(d.Button,{variant:"outline",size:"sm"}),children:"Cancel"}),(0,b.jsx)(d.Button,{size:"sm",variant:"destructive",onClick:O,children:"Remove"})]})]})})]})},"AllowedSendersTab",0,function({agentId:a}){let{workspaceId:f}=(0,r.useWorkspace)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1),[o,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let b=!1;return l(!0),(0,s.listWhitelist)(a,f).then(a=>{b||h(a)}).catch(()=>{b||t("Failed to load whitelist")}).finally(()=>{b||l(!1)}),()=>{b=!0}},[a,f]),(0,c.useEffect)(()=>{let b=!1;return(0,s.listAgents)(f).then(c=>{b||v(c.filter(b=>b.id!==a&&b.email_handle).length>0)}).catch(()=>{}),()=>{b=!0}},[a,f]);let w=i.includes("@")&&i.trim().length>0,x=async()=>{if(w&&!m){n(!0),t(null);try{let b=await (0,s.addWhitelistEmail)(a,i.toLowerCase(),f);h(a=>[...a,b]),j("")}catch(a){t(a instanceof Error?a.message:"Failed to add email")}finally{n(!1)}}},y=async b=>{h(a=>a.filter(a=>a.id!==b)),t(null);try{await (0,s.removeWhitelistEmail)(a,b,f)}catch{h(g),t("Failed to remove email")}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Allowed Senders"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only emails from these addresses will trigger this agent. Applies to all configured email addresses (alook.ai handle and custom email)."}),u&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground/70 mt-1.5 flex items-center gap-1",children:[(0,b.jsx)(p,{className:"size-3 shrink-0"}),"Agents in this workspace can already email each other — no whitelist entry needed."]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Input,{value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"user@example.com",type:"email",className:"flex-1"}),(0,b.jsx)(d.Button,{type:"button",size:"sm",variant:"secondary",disabled:!w||m,onClick:x,children:m?"Adding...":"Add"})]}),o&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:o}),k?(0,b.jsx)("div",{className:"space-y-2",children:[1,2,3].map(a=>(0,b.jsx)("span",{className:"block h-8 animate-pulse rounded-md bg-muted"},a))}):0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No allowed senders — all inbound emails will be rejected."}):(0,b.jsx)("div",{className:"space-y-1.5",children:g.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsx)("span",{className:"text-sm",children:a.email}),(0,b.jsx)("button",{type:"button",onClick:()=>y(a.id),className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.id))})]})},"EmailHandleField",0,function({emailHandle:a,setEmailHandle:c,derivedHandle:d}){let h=a||d,i=h&&!o(h)?"Must be 3+ characters, letters/numbers/hyphens only":"";return(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{htmlFor:"agent-handle",children:"Email Handle"}),(0,b.jsxs)("div",{className:"flex items-center gap-0",children:[(0,b.jsx)(e.Input,{id:"agent-handle",value:a,onChange:a=>c(a.target.value.toLowerCase()),placeholder:d||"my-agent",className:"rounded-r-none"}),(0,b.jsx)("span",{className:"inline-flex h-8 items-center rounded-r-lg border border-l-0 border-input bg-muted px-2.5 text-sm text-muted-foreground",children:"@alook.ai"})]}),h&&(0,b.jsx)("p",{className:(0,g.cn)("text-xs",i?"text-destructive":"text-muted-foreground"),children:i||`${h}@alook.ai`}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"This cannot be changed after creation."})]})},"GeneralFields",0,function({name:a,setName:c,description:d,setDescription:i,instructions:j,setInstructions:m,model:n,setModel:o,runtimeId:p,setRuntimeId:q,runtimes:r,providerModels:s,errors:t,runtimeAsRadio:u=!1}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsxs)(f.Label,{htmlFor:"agent-name",children:["Name ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(e.Input,{id:"agent-name",value:a,onChange:a=>c(a.target.value),placeholder:"My Agent",required:!0,"aria-invalid":!!t?.name,"aria-describedby":t?.name?"agent-name-error":void 0}),t?.name&&(0,b.jsx)("p",{id:"agent-name-error",className:"text-xs text-destructive",children:t.name})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{htmlFor:"agent-description",children:"Description"}),(0,b.jsx)(e.Input,{id:"agent-description",value:d,onChange:a=>i(a.target.value),placeholder:"What does this agent do?"})]}),m&&(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{htmlFor:"agent-instructions",children:"Instructions"}),(0,b.jsx)(h,{id:"agent-instructions",value:j??"",onChange:a=>m(a.target.value),placeholder:"System prompt or instructions...",rows:6})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{htmlFor:"agent-model",children:"Model"}),(0,b.jsx)(e.Input,{id:"agent-model",value:n,onChange:a=>o(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options"}),s.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options",children:s.map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"Optional. Leave blank to use the runtime's default model."})]}),(0,b.jsxs)("div",{id:"agent-runtime-select",className:"space-y-1.5",children:[(0,b.jsxs)(f.Label,{children:["Runtime ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),u?(0,b.jsx)("div",{className:"space-y-1.5",role:"radiogroup","aria-label":"Runtime",children:0===r.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No runtimes — start a daemon first"}):r.map(a=>{let c="online"===a.status,d=p===a.id,e="string"==typeof a.device_info?a.device_info:"";return(0,b.jsxs)("label",{className:(0,g.cn)("flex items-center gap-2.5 rounded-lg border p-2.5 cursor-pointer transition-colors",d?"border-primary bg-primary/5":"border-border hover:border-foreground/20",!c&&"opacity-40 pointer-events-none"),children:[(0,b.jsx)("input",{type:"radio",name:"runtime",value:a.id,checked:d,disabled:!c,onChange:()=>{let b=r.find(a=>a.id===p)?.provider,c=a.provider;q(a.id),b&&b!==c&&o("")},className:"accent-primary size-3.5"}),(0,b.jsx)(k.ProviderLogo,{provider:a.provider,className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-sm",children:a.provider}),e&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),!c&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:"offline"})]},a.id)})}):(0,b.jsx)(l,{value:p,onValueChange:a=>{let b=r.find(a=>a.id===p)?.provider,c=r.find(b=>b.id===a)?.provider;q(a),b&&b!==c&&o("")},runtimes:r,triggerProps:{"aria-invalid":!!t?.runtimeId,"aria-describedby":t?.runtimeId?"agent-runtime-error":void 0}}),t?.runtimeId&&(0,b.jsx)("p",{id:"agent-runtime-error",className:"text-xs text-destructive",children:t.runtimeId})]})]})},"PinToggle",0,function({agentId:a}){let{pins:d,handlePinAgent:e,handleUnpinAgent:f}=(0,t.useAgentContext)(),h=d.has(a),[i,j]=(0,c.useState)(!1),k=async()=>{j(!0);try{h?await f(a):await e(a)}finally{j(!1)}};return(0,b.jsxs)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Pin to Sidebar"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:h?"This agent is pinned to the top of the sidebar":"Pin this agent to the top of the sidebar"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:i?"Saving…":h?"Pinned":"Unpinned"}),(0,b.jsx)("input",{type:"checkbox",checked:h,onChange:k,disabled:i,className:"sr-only peer"}),(0,b.jsx)("div",{className:"relative w-9 h-5 bg-muted rounded-full peer-checked:bg-primary transition-colors",children:(0,b.jsx)("div",{className:(0,g.cn)("absolute left-0.5 top-0.5 w-4 h-4 bg-background rounded-full transition-transform",h?"translate-x-4":"translate-x-0")})})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"Tip: You can also right-click an agent in the sidebar to pin or unpin it."})]})},"getHandleError",0,function(a){return a&&!o(a)?"Must be 3+ characters, letters/numbers/hyphens only":""},"nameToHandle",0,function(a){return a.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"")}],224226)},137993,22239,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(7455),h=a.i(75118),i=a.i(588339),j=a.i(527779),k=a.i(918768),l=a.i(461794),m=a.i(180222),n=a.i(67196),o=a.i(95590),p=a.i(942854);let q=(0,a.i(790090).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["CircleHelp",0,q],22239);var r=a.i(921584),s=a.i(506180),t=a.i(390248);let u={Gmail:{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:587},Outlook:{imapHost:"outlook.office365.com",imapPort:993,smtpHost:"smtp.office365.com",smtpPort:587},Yahoo:{imapHost:"imap.mail.yahoo.com",imapPort:993,smtpHost:"smtp.mail.yahoo.com",smtpPort:587}};function v({fields:a,applyPreset:c,errors:g,onClearError:h}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex gap-1.5",children:Object.keys(u).map(a=>(0,b.jsx)(d.Button,{type:"button",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>c(a),children:a},a))}),(0,b.jsxs)("div",{className:"grid gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Email Address *"}),(0,b.jsx)(e.Input,{placeholder:"you@gmail.com",value:a.emailAddress,onChange:b=>{a.setEmailAddress(b.target.value),b.target.value.trim()&&h("emailAddress")},"aria-invalid":!!g.emailAddress,"aria-describedby":g.emailAddress?"custom-email-address-error":void 0,className:"h-8 text-sm"}),g.emailAddress&&(0,b.jsx)("p",{id:"custom-email-address-error",className:"mt-1 text-xs text-destructive",children:g.emailAddress})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Display Name"}),(0,b.jsx)(e.Input,{placeholder:"My Agent",value:a.displayName,onChange:b=>a.setDisplayName(b.target.value),className:"h-8 text-sm"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"IMAP (Receive)"}),(0,b.jsx)(e.Input,{placeholder:"imap.gmail.com",value:a.imapHost,onChange:b=>{a.setImapHost(b.target.value),b.target.value.trim()&&h("imapHost")},"aria-invalid":!!g.imapHost,"aria-describedby":g.imapHost?"custom-email-imap-host-error":void 0,className:"h-8 text-sm"}),g.imapHost&&(0,b.jsx)("p",{id:"custom-email-imap-host-error",className:"text-xs text-destructive",children:g.imapHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"993",value:a.imapPort,onChange:b=>a.setImapPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.imapUsername,onChange:b=>a.setImapUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.imapPassword,onChange:b=>{a.setImapPassword(b.target.value),b.target.value.trim()&&h("imapPassword")},"aria-invalid":!!g.imapPassword,"aria-describedby":g.imapPassword?"custom-email-imap-password-error":void 0,className:"h-8 text-sm"}),g.imapPassword&&(0,b.jsx)("p",{id:"custom-email-imap-password-error",className:"text-xs text-destructive",children:g.imapPassword})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"SMTP (Send)"}),(0,b.jsx)(e.Input,{placeholder:"smtp.gmail.com",value:a.smtpHost,onChange:b=>{a.setSmtpHost(b.target.value),b.target.value.trim()&&h("smtpHost")},"aria-invalid":!!g.smtpHost,"aria-describedby":g.smtpHost?"custom-email-smtp-host-error":void 0,className:"h-8 text-sm"}),g.smtpHost&&(0,b.jsx)("p",{id:"custom-email-smtp-host-error",className:"text-xs text-destructive",children:g.smtpHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"587",value:a.smtpPort,onChange:b=>a.setSmtpPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.smtpUsername,onChange:b=>a.setSmtpUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.smtpPassword,onChange:b=>{a.setSmtpPassword(b.target.value),b.target.value.trim()&&h("smtpPassword")},"aria-invalid":!!g.smtpPassword,"aria-describedby":g.smtpPassword?"custom-email-smtp-password-error":void 0,className:"h-8 text-sm"}),g.smtpPassword&&(0,b.jsx)("p",{id:"custom-email-smtp-password-error",className:"text-xs text-destructive",children:g.smtpPassword})]})]})]})}a.s(["CustomEmailForm",0,function({agentId:a,workspaceId:e,onDataChange:f,getDataRef:w}){let{slug:x}=(0,s.useWorkspace)(),y=!a,[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)([]),[D,E]=(0,c.useState)(!y),[F,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)({}),{fields:N,applyPreset:O,buildData:P}=function(){let[a,b]=(0,c.useState)(""),[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(993),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(587),[r,s]=(0,c.useState)(""),[t,v]=(0,c.useState)(""),w=j||a,x=r||a;return{fields:{emailAddress:a,setEmailAddress:b,displayName:d,setDisplayName:e,imapHost:f,setImapHost:g,imapPort:h,setImapPort:i,imapUsername:j,setImapUsername:k,imapPassword:l,setImapPassword:m,smtpHost:n,setSmtpHost:o,smtpPort:p,setSmtpPort:q,smtpUsername:r,setSmtpUsername:s,smtpPassword:t,setSmtpPassword:v},applyPreset:function(a){let b=u[a];b&&(g(b.imapHost),i(b.imapPort),o(b.smtpHost),q(b.smtpPort))},buildData:function(){return a&&f&&w&&l&&n&&x&&t?{emailAddress:a,displayName:d,imapHost:f,imapPort:h,imapUsername:w,imapPassword:l,imapTls:!0,smtpHost:n,smtpPort:p,smtpUsername:x,smtpPassword:t,smtpTls:1,pollIntervalSeconds:60}:null}}}(),Q=N.imapUsername||N.emailAddress,R=N.smtpUsername||N.emailAddress,S=(0,c.useCallback)(a=>{M(b=>({...b,[a]:void 0}))},[]);(0,c.useEffect)(()=>{w&&(w.current=P)}),(0,c.useEffect)(()=>{y&&f?.(P())},[y,P,f,N.emailAddress,N.displayName,N.imapHost,N.imapPort,N.imapUsername,N.imapPassword,N.smtpHost,N.smtpPort,N.smtpUsername,N.smtpPassword]);let T=(0,c.useCallback)(async()=>{if(!y)try{let b=await (0,i.listEmailAccounts)(a,e);C(b)}catch{}finally{E(!1)}},[a,e,y]);(0,c.useEffect)(()=>{T()},[T]);let U=B[0]??null;async function V(){let b=(0,t.validateCustomEmailFields)({emailAddress:N.emailAddress,imapHost:N.imapHost,imapUsername:Q,imapPassword:N.imapPassword,smtpHost:N.smtpHost,smtpUsername:R,smtpPassword:N.smtpPassword});if(M(b),(0,t.hasCustomEmailErrors)(b))return;let c=P();if(c&&a){G(!0);try{await (0,i.createEmailAccount)(a,c,e),r.toast.success("Custom email configured"),A(!1),await T()}catch(a){r.toast.error(a instanceof Error?a.message:"Failed to save")}finally{G(!1)}}}async function W(){if(U&&a){K(!0);try{await (0,i.deleteEmailAccount)(a,U.id,e),r.toast.success("Custom email removed"),C([])}catch(a){r.toast.error(a instanceof Error?a.message:"Failed to remove")}finally{K(!1)}}}async function X(){if(U&&a){I(!0);try{await (0,i.syncEmailAccount)(a,U.id,e),r.toast.success("Sync triggered"),setTimeout(()=>T(),2e3)}catch(a){r.toast.error(a instanceof Error?a.message:"Sync failed")}finally{I(!1)}}}let Y=y?N.emailAddress?N.emailAddress:"Connect your own mailbox via IMAP/SMTP":D?"Loading...":U?U.email_address:"Connect your own mailbox via IMAP/SMTP";return(0,b.jsxs)(g.Sheet,{open:z,onOpenChange:A,children:[(0,b.jsxs)(g.SheetTrigger,{render:(0,b.jsx)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50"}),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Custom Email"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Y})]}),!y&&U?(0,b.jsxs)("span",{className:(0,h.cn)("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium shrink-0","active"===U.status?"bg-green-500/10 text-green-600":"error"===U.status?"bg-red-500/10 text-red-600":"bg-yellow-500/10 text-yellow-600"),children:["active"===U.status?(0,b.jsx)(n.CheckCircle2,{className:"size-2.5"}):"error"===U.status?(0,b.jsx)(m.AlertCircle,{className:"size-2.5"}):null,U.status]}):(0,b.jsx)(o.ChevronRight,{className:"size-4 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(g.SheetContent,{side:"right",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,b.jsx)(g.SheetTitle,{className:"sr-only",children:"Custom Email"}),(0,b.jsx)(g.SheetBody,{className:"px-8 pt-10 pb-6",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-heading text-lg font-semibold",children:"Custom Email"}),(0,b.jsx)("a",{href:`/w/${x}/help/email-setup`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors",title:"How to get IMAP/SMTP credentials",children:(0,b.jsx)(q,{className:"size-4"})})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your own mailbox to send and receive email as your identity."})]}),!y&&U?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(k.Mail,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm truncate",children:U.email_address})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsx)("button",{type:"button",onClick:X,disabled:H,title:"Sync now",className:"rounded-full p-1 text-muted-foreground hover:bg-muted transition-colors",children:(0,b.jsx)(l.RefreshCw,{className:(0,h.cn)("size-3.5",H&&"animate-spin")})}),(0,b.jsx)("button",{type:"button",onClick:W,disabled:J,title:"Remove",className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:J?(0,b.jsx)(j.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(p.XIcon,{className:"size-3.5"})})]})]}),U.error_message&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:U.error_message}),U.last_synced_at&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(U.last_synced_at).toLocaleString()]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/50 px-3 py-2 text-xs text-muted-foreground space-y-1",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"IMAP"}),(0,b.jsxs)("span",{children:[U.imap_host,":",U.imap_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"SMTP"}),(0,b.jsxs)("span",{children:[U.smtp_host,":",U.smtp_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"Poll interval"}),(0,b.jsxs)("span",{children:[U.poll_interval_seconds,"s"]})]})]})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(v,{fields:N,applyPreset:O,errors:L,onClearError:S}),!y&&(0,b.jsxs)(d.Button,{type:"button",size:"sm",className:"w-full",onClick:V,disabled:F,children:[F&&(0,b.jsx)(j.Loader2,{className:"size-3 animate-spin mr-1"}),"Save & Connect"]}),y&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Will be connected after creating the agent."})]})]})})]})]})}],137993)}];
|
|
1
|
+
module.exports=[224226,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(75118);function h({className:a,...c}){return(0,b.jsx)("textarea",{"data-slot":"textarea",className:(0,g.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",a),...c})}var i=a.i(354498),j=a.i(432340),k=a.i(74414);function l({value:a,onValueChange:c,runtimes:d,disabled:e,triggerProps:f}){let g=function(a){let b=new Map;for(let c of a){let a=c.daemon_id||c.id;b.has(a)||b.set(a,{label:("string"==typeof c.device_info?c.device_info:"")||a,runtimes:[]}),b.get(a).runtimes.push(c)}return b}(d),h=e||0===d.length||d.every(a=>"online"!==a.status);return(0,b.jsxs)(i.Select,{value:a,onValueChange:a=>{a&&c(a)},disabled:h,items:d.map(a=>{let b=("string"==typeof a.device_info?a.device_info:"")||"",c=b?`${a.provider} (${b})`:a.provider;return{value:a.id,label:c}}),children:[(0,b.jsx)(i.SelectTrigger,{...f,children:(0,b.jsx)(i.SelectValue,{placeholder:0===d.length?"No runtimes — start a daemon first":d.every(a=>"online"!==a.status)?"All runtimes offline":"Select a runtime"})}),(0,b.jsx)(i.SelectPopup,{children:Array.from(g.entries()).map(([a,c])=>(0,b.jsxs)(i.SelectGroup,{children:[(0,b.jsx)(i.SelectGroupLabel,{className:"truncate",children:c.label}),c.runtimes.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,disabled:"online"!==a.status,children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.ProviderLogo,{provider:a.provider,className:"h-4 w-4"}),(0,b.jsx)("span",{children:a.provider}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",a.status,")"]})]})},a.id))]},a))})]})}a.i(974936),process.env.ALOOK_DOMAIN;let m=/^[a-zA-Z0-9-]{3,}$/,n=new Set(["no-reply","noreply","admin","support","help","info","postmaster","abuse","security","mailer-daemon","root","webmaster","hostmaster","system","alook"]);function o(a){return m.test(a)&&!n.has(a.toLowerCase())}let p=(0,a.i(790090).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var q=a.i(942854),r=a.i(506180),s=a.i(588339),t=a.i(752792),u=a.i(446827),v=a.i(921584);a.s(["AgentAccessTab",0,function({agentId:e,ownerId:f}){let{workspaceId:h}=(0,r.useWorkspace)(),[k,l]=(0,c.useState)("private"),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)([]),[t,w]=(0,c.useState)([]),[x,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let a=!1;return y(!0),Promise.all([(0,s.listAgentAccess)(h,e),(0,s.listMembers)(h)]).then(([b,c])=>{a||(p(b),w(c))}).catch(b=>{a||(b instanceof u.ApiError&&403===b.status?A(b.message):A("Failed to load access list"))}).finally(()=>{a||y(!1)}),()=>{a=!0}},[h,e]),(0,c.useEffect)(()=>{a.A(81396).then(({listAgents:a})=>{a(h).then(a=>{let b=a.find(a=>a.id===e);b&&l(b.visibility??"private")}).catch(()=>{})})},[h,e]);let J=async a=>{l(a),n(!0);try{await (0,s.updateAgent)(e,{visibility:a},h),v.toast.success("public"===a?"Agent is now public":"Agent is now private")}catch{l(k),v.toast.error("Failed to update visibility")}finally{n(!1)}},K=t.find(a=>a.user_id===f),L=new Set(o.map(a=>a.user_id)),M=t.filter(a=>!L.has(a.user_id)&&a.user_id!==f),N=async a=>{if(a&&!D){E(!0),A(null);try{await (0,s.grantAgentAccess)(h,e,a);let b=t.find(b=>b.user_id===a);b&&p(c=>[...c,{id:a,user_id:b.user_id,name:b.name,email:b.email,created_at:new Date().toISOString()}]),C(""),v.toast.success("Access granted")}catch(a){A(a instanceof Error?a.message:"Failed to grant access")}finally{E(!1)}}},O=async()=>{if(F){p(a=>a.filter(a=>a.user_id!==F.user_id)),G(null),A(null);try{await (0,s.revokeAgentAccess)(h,e,F.user_id,H),v.toast.success(H?"Access revoked and removed from whitelist":"Access revoked")}catch{p(o),A("Failed to revoke access")}}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-6",children:[(0,b.jsx)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Visibility"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"public"===k?"All workspace members can use this agent":"Only authorized members can use this agent"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:m?"Saving…":"public"===k?"Public":"Private"}),(0,b.jsx)("input",{type:"checkbox",checked:"public"===k,onChange:a=>J(a.target.checked?"public":"private"),disabled:m,className:"sr-only peer"}),(0,b.jsx)("div",{className:"relative w-9 h-5 bg-muted rounded-full peer-checked:bg-primary transition-colors",children:(0,b.jsx)("div",{className:(0,g.cn)("absolute left-0.5 top-0.5 w-4 h-4 bg-background rounded-full transition-transform","public"===k?"translate-x-4":"translate-x-0")})})]})]})}),"private"===k&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Authorized Members"}),z&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:z}),x?(0,b.jsx)("div",{className:"space-y-2",children:[1,2].map(a=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},a))}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[K&&(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:K.name||K.email}),K.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:K.email})]}),(0,b.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:"Owner"})]}),o.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:a.name||a.email}),a.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.user_id,void((c=o.find(a=>a.user_id===b))&&(G(c),I(!0)))},className:"ml-2 shrink-0 rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.user_id))]}),M.length>0?(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(i.Select,{value:B,onValueChange:a=>{a&&(C(a),N(a))},children:[(0,b.jsx)(i.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)(i.SelectValue,{placeholder:"Add a member..."})}),(0,b.jsx)(i.SelectPopup,{children:M.map(a=>(0,b.jsx)(i.SelectItem,{value:a.user_id,children:a.name||a.email},a.user_id))})]})}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"All workspace members have been added. Invite new members from workspace settings."})]})]}),(0,b.jsx)(j.Dialog,{open:!!F,onOpenChange:a=>{a||G(null)},children:(0,b.jsxs)(j.DialogContent,{children:[(0,b.jsxs)(j.DialogHeader,{children:[(0,b.jsx)(j.DialogTitle,{children:"Remove Member Access"}),(0,b.jsxs)(j.DialogDescription,{children:["Remove"," ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:F?.name||F?.email})," ","from this agent?"]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer px-1",children:[(0,b.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked),className:"size-4 rounded border-border accent-primary"}),(0,b.jsx)("span",{className:"text-sm",children:"Also remove from email whitelist"})]}),(0,b.jsxs)(j.DialogFooter,{children:[(0,b.jsx)(j.DialogClose,{render:(0,b.jsx)(d.Button,{variant:"outline",size:"sm"}),children:"Cancel"}),(0,b.jsx)(d.Button,{size:"sm",variant:"destructive",onClick:O,children:"Remove"})]})]})})]})},"AllowedSendersTab",0,function({agentId:a}){let{workspaceId:f}=(0,r.useWorkspace)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1),[o,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let b=!1;return l(!0),(0,s.listWhitelist)(a,f).then(a=>{b||h(a)}).catch(()=>{b||t("Failed to load whitelist")}).finally(()=>{b||l(!1)}),()=>{b=!0}},[a,f]),(0,c.useEffect)(()=>{let b=!1;return(0,s.listAgents)(f).then(c=>{b||v(c.filter(b=>b.id!==a&&b.email_handle).length>0)}).catch(()=>{}),()=>{b=!0}},[a,f]);let w=i.includes("@")&&i.trim().length>0,x=async()=>{if(w&&!m){n(!0),t(null);try{let b=await (0,s.addWhitelistEmail)(a,i.toLowerCase(),f);h(a=>[...a,b]),j("")}catch(a){t(a instanceof Error?a.message:"Failed to add email")}finally{n(!1)}}},y=async b=>{h(a=>a.filter(a=>a.id!==b)),t(null);try{await (0,s.removeWhitelistEmail)(a,b,f)}catch{h(g),t("Failed to remove email")}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Allowed Senders"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only emails from these addresses will trigger this agent. Applies to all configured email addresses (alook.ai handle and custom email)."}),u&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground/70 mt-1.5 flex items-center gap-1",children:[(0,b.jsx)(p,{className:"size-3 shrink-0"}),"Agents in this workspace can already email each other — no whitelist entry needed."]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Input,{value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"user@example.com",type:"email",className:"flex-1"}),(0,b.jsx)(d.Button,{type:"button",size:"sm",variant:"secondary",disabled:!w||m,onClick:x,children:m?"Adding...":"Add"})]}),o&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:o}),k?(0,b.jsx)("div",{className:"space-y-2",children:[1,2,3].map(a=>(0,b.jsx)("span",{className:"block h-8 animate-pulse rounded-md bg-muted"},a))}):0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No allowed senders — all inbound emails will be rejected."}):(0,b.jsx)("div",{className:"space-y-1.5",children:g.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsx)("span",{className:"text-sm",children:a.email}),(0,b.jsx)("button",{type:"button",onClick:()=>y(a.id),className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.id))})]})},"EmailHandleField",0,function({emailHandle:a,setEmailHandle:c,derivedHandle:d}){let h=a||d,i=h&&!o(h)?"Must be 3+ characters, letters/numbers/hyphens only":"";return(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{htmlFor:"agent-handle",children:"Email Handle"}),(0,b.jsxs)("div",{className:"flex items-center gap-0",children:[(0,b.jsx)(e.Input,{id:"agent-handle",value:a,onChange:a=>c(a.target.value.toLowerCase()),placeholder:d||"my-agent",className:"rounded-r-none"}),(0,b.jsx)("span",{className:"inline-flex h-8 items-center rounded-r-lg border border-l-0 border-input bg-muted px-2.5 text-sm text-muted-foreground",children:"@alook.ai"})]}),h&&(0,b.jsx)("p",{className:(0,g.cn)("text-xs",i?"text-destructive":"text-muted-foreground"),children:i||`${h}@alook.ai`}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"This cannot be changed after creation."})]})},"GeneralFields",0,function({name:a,setName:c,description:d,setDescription:i,instructions:j,setInstructions:m,model:n,setModel:o,runtimeId:p,setRuntimeId:q,runtimes:r,providerModels:s,errors:t,runtimeAsRadio:u=!1}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsxs)(f.Label,{htmlFor:"agent-name",children:["Name ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(e.Input,{id:"agent-name",value:a,onChange:a=>c(a.target.value),placeholder:"My Agent",required:!0,"aria-invalid":!!t?.name,"aria-describedby":t?.name?"agent-name-error":void 0}),t?.name&&(0,b.jsx)("p",{id:"agent-name-error",className:"text-xs text-destructive",children:t.name})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{htmlFor:"agent-description",children:"Description"}),(0,b.jsx)(e.Input,{id:"agent-description",value:d,onChange:a=>i(a.target.value),placeholder:"What does this agent do?"})]}),m&&(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{htmlFor:"agent-instructions",children:"Instructions"}),(0,b.jsx)(h,{id:"agent-instructions",value:j??"",onChange:a=>m(a.target.value),placeholder:"System prompt or instructions...",rows:6})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{htmlFor:"agent-model",children:"Model"}),(0,b.jsx)(e.Input,{id:"agent-model",value:n,onChange:a=>o(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options"}),s.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options",children:s.map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"Optional. Leave blank to use the runtime's default model."})]}),(0,b.jsxs)("div",{id:"agent-runtime-select",className:"space-y-1.5",children:[(0,b.jsxs)(f.Label,{children:["Runtime ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),u?(0,b.jsx)("div",{className:"space-y-1.5",role:"radiogroup","aria-label":"Runtime",children:0===r.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No runtimes — start a daemon first"}):r.map(a=>{let c="online"===a.status,d=p===a.id,e="string"==typeof a.device_info?a.device_info:"";return(0,b.jsxs)("label",{className:(0,g.cn)("flex items-center gap-2.5 rounded-lg border p-2.5 cursor-pointer transition-colors",d?"border-primary bg-primary/5":"border-border hover:border-foreground/20",!c&&"opacity-40 pointer-events-none"),children:[(0,b.jsx)("input",{type:"radio",name:"runtime",value:a.id,checked:d,disabled:!c,onChange:()=>{let b=r.find(a=>a.id===p)?.provider,c=a.provider;q(a.id),b&&b!==c&&o("")},className:"accent-primary size-3.5"}),(0,b.jsx)(k.ProviderLogo,{provider:a.provider,className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-sm",children:a.provider}),e&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),!c&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:"offline"})]},a.id)})}):(0,b.jsx)(l,{value:p,onValueChange:a=>{let b=r.find(a=>a.id===p)?.provider,c=r.find(b=>b.id===a)?.provider;q(a),b&&b!==c&&o("")},runtimes:r,triggerProps:{"aria-invalid":!!t?.runtimeId,"aria-describedby":t?.runtimeId?"agent-runtime-error":void 0}}),t?.runtimeId&&(0,b.jsx)("p",{id:"agent-runtime-error",className:"text-xs text-destructive",children:t.runtimeId})]})]})},"PinToggle",0,function({agentId:a}){let{pins:d,handlePinAgent:e,handleUnpinAgent:f}=(0,t.useAgentContext)(),h=d.has(a),[i,j]=(0,c.useState)(!1),k=async()=>{j(!0);try{h?await f(a):await e(a)}finally{j(!1)}};return(0,b.jsxs)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Pin to Sidebar"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:h?"This agent is pinned to the top of the sidebar":"Pin this agent to the top of the sidebar"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:i?"Saving…":h?"Pinned":"Unpinned"}),(0,b.jsx)("input",{type:"checkbox",checked:h,onChange:k,disabled:i,className:"sr-only peer"}),(0,b.jsx)("div",{className:"relative w-9 h-5 bg-muted rounded-full peer-checked:bg-primary transition-colors",children:(0,b.jsx)("div",{className:(0,g.cn)("absolute left-0.5 top-0.5 w-4 h-4 bg-background rounded-full transition-transform",h?"translate-x-4":"translate-x-0")})})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"Tip: You can also right-click an agent in the sidebar to pin or unpin it."})]})},"getHandleError",0,function(a){return a&&!o(a)?"Must be 3+ characters, letters/numbers/hyphens only":""},"nameToHandle",0,function(a){return a.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"")}],224226)},137993,22239,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(7455),h=a.i(525132),i=a.i(75118),j=a.i(588339),k=a.i(527779),l=a.i(918768),m=a.i(461794),n=a.i(180222),o=a.i(67196),p=a.i(95590),q=a.i(942854);let r=(0,a.i(790090).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["CircleHelp",0,r],22239);var s=a.i(921584),t=a.i(506180),u=a.i(390248);let v={Gmail:{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:587},Outlook:{imapHost:"outlook.office365.com",imapPort:993,smtpHost:"smtp.office365.com",smtpPort:587},Yahoo:{imapHost:"imap.mail.yahoo.com",imapPort:993,smtpHost:"smtp.mail.yahoo.com",smtpPort:587}};function w({fields:a,applyPreset:c,errors:g,onClearError:h}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex gap-1.5",children:Object.keys(v).map(a=>(0,b.jsx)(d.Button,{type:"button",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>c(a),children:a},a))}),(0,b.jsxs)("div",{className:"grid gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Email Address *"}),(0,b.jsx)(e.Input,{placeholder:"you@gmail.com",value:a.emailAddress,onChange:b=>{a.setEmailAddress(b.target.value),b.target.value.trim()&&h("emailAddress")},"aria-invalid":!!g.emailAddress,"aria-describedby":g.emailAddress?"custom-email-address-error":void 0,className:"h-8 text-sm"}),g.emailAddress&&(0,b.jsx)("p",{id:"custom-email-address-error",className:"mt-1 text-xs text-destructive",children:g.emailAddress})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Display Name"}),(0,b.jsx)(e.Input,{placeholder:"My Agent",value:a.displayName,onChange:b=>a.setDisplayName(b.target.value),className:"h-8 text-sm"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"IMAP (Receive)"}),(0,b.jsx)(e.Input,{placeholder:"imap.gmail.com",value:a.imapHost,onChange:b=>{a.setImapHost(b.target.value),b.target.value.trim()&&h("imapHost")},"aria-invalid":!!g.imapHost,"aria-describedby":g.imapHost?"custom-email-imap-host-error":void 0,className:"h-8 text-sm"}),g.imapHost&&(0,b.jsx)("p",{id:"custom-email-imap-host-error",className:"text-xs text-destructive",children:g.imapHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"993",value:a.imapPort,onChange:b=>a.setImapPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.imapUsername,onChange:b=>a.setImapUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.imapPassword,onChange:b=>{a.setImapPassword(b.target.value),b.target.value.trim()&&h("imapPassword")},"aria-invalid":!!g.imapPassword,"aria-describedby":g.imapPassword?"custom-email-imap-password-error":void 0,className:"h-8 text-sm"}),g.imapPassword&&(0,b.jsx)("p",{id:"custom-email-imap-password-error",className:"text-xs text-destructive",children:g.imapPassword})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"SMTP (Send)"}),(0,b.jsx)(e.Input,{placeholder:"smtp.gmail.com",value:a.smtpHost,onChange:b=>{a.setSmtpHost(b.target.value),b.target.value.trim()&&h("smtpHost")},"aria-invalid":!!g.smtpHost,"aria-describedby":g.smtpHost?"custom-email-smtp-host-error":void 0,className:"h-8 text-sm"}),g.smtpHost&&(0,b.jsx)("p",{id:"custom-email-smtp-host-error",className:"text-xs text-destructive",children:g.smtpHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"587",value:a.smtpPort,onChange:b=>a.setSmtpPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.smtpUsername,onChange:b=>a.setSmtpUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.smtpPassword,onChange:b=>{a.setSmtpPassword(b.target.value),b.target.value.trim()&&h("smtpPassword")},"aria-invalid":!!g.smtpPassword,"aria-describedby":g.smtpPassword?"custom-email-smtp-password-error":void 0,className:"h-8 text-sm"}),g.smtpPassword&&(0,b.jsx)("p",{id:"custom-email-smtp-password-error",className:"text-xs text-destructive",children:g.smtpPassword})]})]})]})}a.s(["CustomEmailForm",0,function({agentId:a,workspaceId:e,onDataChange:f,getDataRef:x}){let{slug:y}=(0,t.useWorkspace)(),z=!a,[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]),[E,F]=(0,c.useState)(!z),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)({}),{fields:O,applyPreset:P,buildData:Q}=function(){let[a,b]=(0,c.useState)(""),[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(993),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(587),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),w=j||a,x=r||a;return{fields:{emailAddress:a,setEmailAddress:b,displayName:d,setDisplayName:e,imapHost:f,setImapHost:g,imapPort:h,setImapPort:i,imapUsername:j,setImapUsername:k,imapPassword:l,setImapPassword:m,smtpHost:n,setSmtpHost:o,smtpPort:p,setSmtpPort:q,smtpUsername:r,setSmtpUsername:s,smtpPassword:t,setSmtpPassword:u},applyPreset:function(a){let b=v[a];b&&(g(b.imapHost),i(b.imapPort),o(b.smtpHost),q(b.smtpPort))},buildData:function(){return a&&f&&w&&l&&n&&x&&t?{emailAddress:a,displayName:d,imapHost:f,imapPort:h,imapUsername:w,imapPassword:l,imapTls:!0,smtpHost:n,smtpPort:p,smtpUsername:x,smtpPassword:t,smtpTls:1,pollIntervalSeconds:60}:null}}}(),R=O.imapUsername||O.emailAddress,S=O.smtpUsername||O.emailAddress,T=(0,c.useCallback)(a=>{N(b=>({...b,[a]:void 0}))},[]);(0,c.useEffect)(()=>{x&&(x.current=Q)}),(0,c.useEffect)(()=>{z&&f?.(Q())},[z,Q,f,O.emailAddress,O.displayName,O.imapHost,O.imapPort,O.imapUsername,O.imapPassword,O.smtpHost,O.smtpPort,O.smtpUsername,O.smtpPassword]);let U=(0,c.useCallback)(async()=>{if(!z)try{let b=await (0,j.listEmailAccounts)(a,e);D(b)}catch{}finally{F(!1)}},[a,e,z]);(0,c.useEffect)(()=>{U()},[U]);let V=C[0]??null;async function W(){let b=(0,u.validateCustomEmailFields)({emailAddress:O.emailAddress,imapHost:O.imapHost,imapUsername:R,imapPassword:O.imapPassword,smtpHost:O.smtpHost,smtpUsername:S,smtpPassword:O.smtpPassword});if(N(b),(0,u.hasCustomEmailErrors)(b))return;let c=Q();if(c&&a){H(!0);try{await (0,j.createEmailAccount)(a,c,e),s.toast.success("Custom email configured"),B(!1),await U()}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to save")}finally{H(!1)}}}async function X(){if(V&&a){L(!0);try{await (0,j.deleteEmailAccount)(a,V.id,e),s.toast.success("Custom email removed"),D([])}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to remove")}finally{L(!1)}}}async function Y(){if(V&&a){J(!0);try{await (0,j.syncEmailAccount)(a,V.id,e),s.toast.success("Sync triggered"),setTimeout(()=>U(),2e3)}catch(a){s.toast.error(a instanceof Error?a.message:"Sync failed")}finally{J(!1)}}}let Z=z?O.emailAddress?O.emailAddress:"Connect your own mailbox via IMAP/SMTP":E?"Loading...":V?V.email_address:"Connect your own mailbox via IMAP/SMTP";return(0,b.jsxs)(g.Sheet,{open:A,onOpenChange:B,children:[(0,b.jsxs)(g.SheetTrigger,{render:(0,b.jsx)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50"}),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Custom Email"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Z})]}),!z&&V?(0,b.jsxs)("span",{className:(0,i.cn)("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium shrink-0","active"===V.status?"bg-green-500/10 text-green-600":"error"===V.status?"bg-red-500/10 text-red-600":"bg-yellow-500/10 text-yellow-600"),children:["active"===V.status?(0,b.jsx)(o.CheckCircle2,{className:"size-2.5"}):"error"===V.status?(0,b.jsx)(n.AlertCircle,{className:"size-2.5"}):null,V.status]}):(0,b.jsx)(p.ChevronRight,{className:"size-4 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(g.SheetContent,{side:"right",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,b.jsx)(g.SheetTitle,{className:"sr-only",children:"Custom Email"}),(0,b.jsx)(g.SheetBody,{className:"px-8 pt-10 pb-6",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-heading text-lg font-semibold",children:"Custom Email"}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)("a",{href:`/w/${y}/help/email-setup`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors"}),children:(0,b.jsx)(r,{className:"size-4"})}),(0,b.jsx)(h.TooltipContent,{children:"How to get IMAP/SMTP credentials"})]})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your own mailbox to send and receive email as your identity."})]}),!z&&V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(l.Mail,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm truncate",children:V.email_address})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:Y,disabled:I,className:"rounded-full text-muted-foreground"}),children:(0,b.jsx)(m.RefreshCw,{className:(0,i.cn)("size-3.5",I&&"animate-spin")})}),(0,b.jsx)(h.TooltipContent,{children:"Sync now"})]}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:X,disabled:K,className:"rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive"}),children:K?(0,b.jsx)(k.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(q.XIcon,{className:"size-3.5"})}),(0,b.jsx)(h.TooltipContent,{children:"Remove"})]})]})]}),V.error_message&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:V.error_message}),V.last_synced_at&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(V.last_synced_at).toLocaleString()]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/50 px-3 py-2 text-xs text-muted-foreground space-y-1",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"IMAP"}),(0,b.jsxs)("span",{children:[V.imap_host,":",V.imap_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"SMTP"}),(0,b.jsxs)("span",{children:[V.smtp_host,":",V.smtp_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"Poll interval"}),(0,b.jsxs)("span",{children:[V.poll_interval_seconds,"s"]})]})]})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(w,{fields:O,applyPreset:P,errors:M,onClearError:T}),!z&&(0,b.jsxs)(d.Button,{type:"button",size:"sm",className:"w-full",onClick:W,disabled:G,children:[G&&(0,b.jsx)(k.Loader2,{className:"size-3 animate-spin mr-1"}),"Save & Connect"]}),z&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Will be connected after creating the agent."})]})]})})]})]})}],137993)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_components_0nj0euq._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[735132,325848,253260,628508,949409,a=>{"use strict";var b=a.i(749314),c=a.i(437199);let d="#27272a",e={fill:"rgba(255,255,255,0.92)",stroke:"rgba(255,255,255,0.95)",strokeWidth:3.5},f=[{name:"Purple",value:"#a855f7",gradient:["#c084fc","#a855f7","#7c3aed"],faceColor:"#2e1065"},{name:"Teal",value:"#14b8a6",gradient:["#5eead4","#14b8a6","#0d9488"],faceColor:"#134e4a"},{name:"Orange",value:"#f97316",gradient:["#fdba74","#f97316","#c2410c"],faceColor:"#7c2d12"},{name:"Blue",value:"#3b82f6",gradient:["#93c5fd","#3b82f6","#1d4ed8"],faceColor:"#1e3a5f"},{name:"Pink",value:"#f472b6",gradient:["#fda4af","#f472b6","#be185d"],faceColor:"#831843"},{name:"Yellow",value:"#eab308",gradient:["#fde047","#eab308","#a16207"],faceColor:"#713f12"},{name:"Green",value:"#22c55e",gradient:["#86efac","#22c55e","#15803d"],faceColor:"#14532d"},{name:"Beige",value:"#d6ccb8",gradient:["#e8e0d4","#d6ccb8","#b8a990"],faceColor:"#57534e"},{name:"Red",value:"#ef4444",gradient:["#fca5a5","#ef4444","#991b1b"],faceColor:"#7f1d1d"},{name:"Lake Blue",value:"#6366f1",gradient:["#a5b4fc","#6366f1","#3730a3"],faceColor:"#312e81"},{name:"Gray",value:"#9ca3af",gradient:["#d4d4d8","#9ca3af","#6b7280"],faceColor:"#374151"},{name:"Deep Purple",value:"#8b5cf6",gradient:["#c4b5fd","#8b5cf6","#5b21b6"],faceColor:"#3b0764"}],g={circle:{name:"Circle",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("circle",{cx:"100",cy:"100",r:"66",...e})},rounded:{name:"Rounded",face:{cx:100,cy:100,w:90},render:()=>(0,b.jsx)("rect",{x:"30",y:"30",width:"140",height:"140",rx:"32",...e})},hexagon:{name:"Hexagon",face:{cx:100,cy:100,w:86},render:()=>(0,b.jsx)("path",{d:"M100 32 C108 32 114 35 120 39 L155 60 C161 64 165 70 165 78 L165 122 C165 130 161 136 155 140 L120 161 C114 165 108 168 100 168 C92 168 86 165 80 161 L45 140 C39 136 35 130 35 122 L35 78 C35 70 39 64 45 60 L80 39 C86 35 92 32 100 32 Z",...e})},task:{name:"Task",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("rect",{x:"34",y:"34",width:"132",height:"132",rx:"24",...e})},book:{name:"Book",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("path",{d:"M42 162 L42 88 C42 54 68 34 100 34 C132 34 158 54 158 88 L158 162 C158 166 154 170 150 170 L50 170 C46 170 42 166 42 162 Z",...e})},mail:{name:"Mail",face:{cx:100,cy:100,w:86},render:()=>(0,b.jsx)("rect",{x:"28",y:"54",width:"144",height:"92",rx:"46",...e})},calendar:{name:"Calendar",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("path",{d:"M100 34 C138 34 166 52 166 80 C166 94 158 106 158 118 C158 148 138 166 100 166 C62 166 42 148 42 118 C42 106 34 94 34 80 C34 52 62 34 100 34 Z",...e})},bulb:{name:"Bulb",face:{cx:100,cy:104,w:76},render:()=>(0,b.jsx)("ellipse",{cx:"100",cy:"104",rx:"58",ry:"66",...e})},folder:{name:"Folder",face:{cx:102,cy:108,w:80},render:()=>(0,b.jsx)("path",{d:"M62 144 C40 144 32 128 36 116 C32 104 40 90 54 88 C56 72 70 60 88 62 C100 50 118 50 132 58 C144 52 162 60 162 76 C172 82 174 98 166 108 C172 120 164 136 150 140 Z",...e})},mountain:{name:"Mountain",face:{cx:100,cy:100,w:76},render:()=>(0,b.jsx)("path",{d:"M92 36 C120 32 156 48 164 78 C172 108 156 148 124 160 C92 172 48 156 38 124 C28 92 62 40 92 36 Z",...e})}},h=Object.keys(g),i={dot:{name:"Dot",render:(a=d)=>(0,b.jsx)("circle",{cx:"0",cy:"0",r:"4.5",fill:a})},dash:{name:"Dash",render:(a=d)=>(0,b.jsx)("line",{x1:"-10",y1:"0",x2:"10",y2:"0",stroke:a,strokeWidth:"5",strokeLinecap:"round"})},hookL:{name:"Hook",render:(a=d)=>(0,b.jsx)("path",{d:"M-11 0 Q-5.5 7 0 1.5 Q5.5 7 11 0",fill:"none",stroke:a,strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"})},smile:{name:"Smile",render:(a=d)=>(0,b.jsx)("path",{d:"M-11 0 Q0 11 11 0",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"})},caret:{name:"Caret",render:(a=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:"M-10 0 Q0 8 10 0",fill:"none",stroke:a,strokeWidth:"4.5",strokeLinecap:"round"}),(0,b.jsx)("ellipse",{cx:"3",cy:"6",rx:"4",ry:"4.5",fill:"#f472b6"})]})},arrow:{name:"Arrow",render:(a=d)=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"6",ry:"7.5",fill:a})},oh:{name:"o",render:(a=d)=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"7",ry:"7.5",fill:"none",stroke:a,strokeWidth:"4.5"})}},j=Object.keys(i),k=(a,c)=>{let e=c??a,f=(c,f=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("g",{transform:`translate(${-c}, 0)`,children:a(f)}),(0,b.jsx)("g",{transform:`translate(${c}, 0)`,children:e(f)})]});return f.displayName="EyePair",f},l={dots:{name:"Dots",render:k(a=>(0,b.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:a}))},big:{name:"Big",render:k(a=>(0,b.jsxs)("g",{children:[(0,b.jsx)("circle",{cx:"0",cy:"0",r:"10",fill:a}),(0,b.jsx)("circle",{cx:"2.5",cy:"-3",r:"3.5",fill:"rgba(255,255,255,0.9)"})]}))},rings:{name:"Rings",render:k(a=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:"none",stroke:a,strokeWidth:"4.5"}))},arches:{name:"Arches",render:k(a=>(0,b.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},lines:{name:"Lines",render:k(a=>(0,b.jsx)("path",{d:"M-10 0 Q0 -6 10 0",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},happy:{name:"Happy",render:k(a=>(0,b.jsx)("path",{d:"M-10 5 Q0 -11 10 5",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},sleepy:{name:"Sleepy",render:k(a=>(0,b.jsx)("path",{d:"M-10 -2 Q0 8 10 -2",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},shy:{name:"Shy",render:k(a=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:a}))},wink:{name:"Wink",render:(a,c=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("g",{transform:`translate(${-a}, 0)`,children:(0,b.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:c})}),(0,b.jsx)("g",{transform:`translate(${a}, 0)`,children:(0,b.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:c,strokeWidth:"5",strokeLinecap:"round"})})]})}},m=Object.keys(l),n={shape:"book",eye:"happy",nose:"dash",bg:1},o=[{name:"Task",config:{shape:"task",nose:"dot",eye:"dots",bg:0}},{name:"Notes",config:{shape:"book",nose:"dash",eye:"happy",bg:1}},{name:"Mail",config:{shape:"mail",nose:"smile",eye:"dots",bg:3}},{name:"Schedule",config:{shape:"calendar",nose:"dot",eye:"dots",bg:4}},{name:"Idea",config:{shape:"bulb",nose:"oh",eye:"rings",bg:5}},{name:"Project",config:{shape:"folder",nose:"dash",eye:"lines",bg:7}},{name:"Goal",config:{shape:"mountain",nose:"caret",eye:"arches",bg:8}},{name:"Dream",config:{shape:"circle",nose:"smile",eye:"shy",bg:11}},{name:"Organize",config:{shape:"rounded",nose:"dot",eye:"sleepy",bg:6}},{name:"Explore",config:{shape:"hexagon",nose:"hookL",eye:"wink",bg:9}},{name:"Focus",config:{shape:"task",nose:"caret",eye:"lines",bg:2}},{name:"Collect",config:{shape:"book",nose:"oh",eye:"rings",bg:10}}];function p(a){return a[Math.floor(Math.random()*a.length)]}function q(){return{shape:p(h),eye:p(m),nose:p(j),bg:Math.floor(Math.random()*f.length)}}function r({config:a,size:d=200,className:e}){let h=(0,c.useId)().replace(/:/g,""),j=g[a.shape]??g.book,k=l[a.eye],m=i[a.nose],n=f[a.bg]??f[0],[o,p,q]=n.gradient,s=n.faceColor,{cx:t,cy:u,w:v}=j.face,w=Math.max(13,.24*v),x=u-Math.max(12,.16*v);return(0,b.jsxs)("svg",{viewBox:"0 0 200 200",width:d,height:d,className:e,style:{display:"block"},children:[(0,b.jsxs)("defs",{children:[(0,b.jsxs)("linearGradient",{id:`bg-${h}`,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:o}),(0,b.jsx)("stop",{offset:"50%",stopColor:p}),(0,b.jsx)("stop",{offset:"100%",stopColor:q})]}),(0,b.jsxs)("radialGradient",{id:`gl-${h}`,cx:"30%",cy:"25%",r:"60%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:"rgba(255,255,255,0.32)"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"rgba(255,255,255,0)"})]}),(0,b.jsx)("filter",{id:`sh-${h}`,x:"-10%",y:"-5%",width:"120%",height:"130%",children:(0,b.jsx)("feDropShadow",{dx:"0",dy:"3",stdDeviation:"4",floodColor:"rgba(0,0,0,0.18)"})})]}),(0,b.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#bg-${h})`}),(0,b.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#gl-${h})`}),(0,b.jsxs)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:[(0,b.jsx)("g",{"data-avatar-shape":"",filter:`url(#sh-${h})`,children:j.render()}),k&&(0,b.jsx)("g",{transform:`translate(${t}, ${x})`,children:(0,b.jsx)("g",{"data-avatar-eyes":"",children:k.render(w,s)})}),m&&(0,b.jsx)("g",{transform:`translate(${t}, ${u+7})`,children:(0,b.jsx)("g",{"data-avatar-nose":"",children:m.render(s)})})]})]})}let s="avatar:";function t(a){if(!a||!a.startsWith(s))return null;try{let b=JSON.parse(a.slice(s.length));if("object"==typeof b&&null!==b&&"string"==typeof b.shape&&"string"==typeof b.eye&&"string"==typeof b.nose&&"number"==typeof b.bg)return b;if("object"==typeof b&&null!==b&&"outline"in b)return n;return null}catch{return null}}a.s(["AvatarRenderer",0,r,"BG_COLORS",0,f,"DEFAULT_CONFIG",0,n,"EYE_KEYS",0,m,"Eyes",0,l,"NOSE_KEYS",0,j,"Noses",0,i,"PRESETS",0,o,"SHAPE_KEYS",0,h,"Shapes",0,g,"parseAvatarUrl",0,t,"randomConfig",0,q,"serializeAvatarConfig",0,function(a){return s+JSON.stringify(a)}],325848);let u=["avatar-anim-shape-bounce","avatar-anim-head-tilt","avatar-anim-shake","avatar-anim-wobble","avatar-anim-pulse","avatar-anim-spin","avatar-anim-jelly","avatar-anim-float","avatar-anim-nod"];a.s(["AnimatedAvatar",0,function({config:a,size:d,className:e,isHovered:f,isWorking:g}){let[h,i]=(0,c.useState)(null),j=(0,c.useRef)(-1);function k(){let a=Math.floor(Math.random()*u.length);return a===j.current&&(a=(a+1)%u.length),j.current=a,u[a]}return(0,c.useEffect)(()=>{f?i(k()):g||i(null)},[f,g]),(0,c.useEffect)(()=>{if(!g){f||i(null);return}i(k());let a=setInterval(()=>{i(k())},4e3);return()=>clearInterval(a)},[f,g]),(0,b.jsx)("div",{className:h??void 0,children:(0,b.jsx)(r,{config:a,size:d,className:e})})}],253260);var v=a.i(75118);function w({label:a,keys:c,value:d,onChange:e,renderThumb:f,mobile:g=!1}){let h=c.indexOf(d),i=a=>e(c[(h+a+c.length)%c.length]),j=c[(h-1+c.length)%c.length],k=c[(h+1)%c.length];return(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-12 text-xs font-medium text-muted-foreground shrink-0",children:a}),(0,b.jsx)("button",{type:"button",onClick:()=>i(-1),className:(0,v.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",g?"size-10":"size-7"),children:(0,b.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,b.jsx)("path",{d:"M15 5 L8 12 L15 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-1 justify-center",children:[(0,b.jsx)("button",{type:"button",onClick:()=>i(-1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:f(j)}),(0,b.jsx)("button",{type:"button",onClick:()=>i(1),className:"border-2 border-primary rounded-lg p-0.5",children:f(d)}),(0,b.jsx)("button",{type:"button",onClick:()=>i(1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:f(k)})]}),(0,b.jsx)("button",{type:"button",onClick:()=>i(1),className:(0,v.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",g?"size-10":"size-7"),children:(0,b.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,b.jsx)("path",{d:"M9 5 L16 12 L9 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function x({config:a,onChange:d,layout:e="vertical",mobile:k=!1}){let[n,p]=(0,c.useState)("presets"),s=(0,c.useCallback)((b,c)=>{d({...a,[b]:c})},[a,d]),[t,u]=(0,c.useState)(!1),y=(0,c.useRef)(a);(0,c.useEffect)(()=>{if(y.current.shape!==a.shape||y.current.eye!==a.eye||y.current.nose!==a.nose||y.current.bg!==a.bg){u(!0);let b=setTimeout(()=>u(!1),450);return y.current=a,()=>clearTimeout(b)}},[a]),(0,c.useEffect)(()=>{if("horizontal"!==e)return;let a=a=>{"Space"===a.code&&a.target===document.body&&(a.preventDefault(),d(q()))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,d]);let z="horizontal"===e,A=z?220:k?120:160,B=(0,b.jsxs)("div",{className:(0,v.cn)("flex flex-col items-center gap-3 rounded-2xl bg-muted/30",k?"p-3":"p-4",z?"w-70 shrink-0 justify-center":""),children:[(0,b.jsx)("div",{className:(0,v.cn)("rounded-2xl",t&&"animate-[shake_0.45s_cubic-bezier(.36,.07,.19,.97)]"),children:(0,b.jsx)(r,{config:a,size:A})}),(0,b.jsxs)("button",{type:"button",onClick:()=>d(q()),className:"inline-flex items-center gap-2 rounded-full bg-foreground px-4 py-1.5 text-sm font-medium text-background hover:bg-foreground/80 transition-colors",children:[(0,b.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),(0,b.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"16",cy:"8",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"8",cy:"16",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"16",cy:"16",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]}),"Random",z&&(0,b.jsx)("kbd",{className:"ml-1 rounded bg-background/20 px-1.5 py-0.5 text-[10px] font-mono",children:"Space"})]})]}),C=(0,b.jsxs)("div",{className:(0,v.cn)("flex flex-col gap-3 flex-1 min-w-0",z&&"rounded-2xl bg-muted/30 p-4 h-95"),children:[(0,b.jsxs)("div",{className:"flex border-b border-border",children:[(0,b.jsx)("button",{type:"button",onClick:()=>p("presets"),className:(0,v.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","presets"===n?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"★ Presets"}),(0,b.jsx)("button",{type:"button",onClick:()=>p("custom"),className:(0,v.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","custom"===n?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"⚙ Custom"})]}),(0,b.jsxs)("div",{className:(0,v.cn)("flex-1 min-h-0",z&&"overflow-y-auto thin-scrollbar"),children:["presets"===n&&(0,b.jsx)("div",{className:(0,v.cn)("grid gap-2",k?"grid-cols-3":"grid-cols-4"),children:o.map(c=>{let e=c.config.shape===a.shape&&c.config.eye===a.eye&&c.config.nose===a.nose&&c.config.bg===a.bg;return(0,b.jsx)("button",{type:"button",onClick:()=>d(c.config),className:(0,v.cn)("flex items-center justify-center rounded-xl border p-2 transition-all",e?"border-primary border-2 bg-primary/5 shadow-sm":"border-border bg-background hover:border-primary/40"),children:(0,b.jsx)(r,{config:c.config,size:56})},c.name)})}),"custom"===n&&(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsx)(w,{label:"Shape",keys:h,value:a.shape,onChange:a=>s("shape",a),renderThumb:a=>(0,b.jsxs)("svg",{viewBox:"0 0 200 200",width:"40",height:"40",children:[(0,b.jsx)("rect",{width:"200",height:"200",rx:"56",fill:"hsl(var(--muted))"}),(0,b.jsx)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:g[a]?.render()})]}),mobile:k}),(0,b.jsx)(w,{label:"Nose",keys:j,value:a.nose,onChange:a=>s("nose",a),renderThumb:a=>(0,b.jsx)("svg",{viewBox:"-14 -10 28 20",width:"36",height:"24",children:i[a]?.render("currentColor")}),mobile:k}),(0,b.jsx)(w,{label:"Eyes",keys:m,value:a.eye,onChange:a=>s("eye",a),renderThumb:a=>(0,b.jsx)("svg",{viewBox:"-18 -10 36 20",width:"44",height:"24",children:l[a]?.render(8,"currentColor")}),mobile:k}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Color"}),(0,b.jsx)("div",{className:(0,v.cn)("flex flex-wrap p-1",k?"gap-3":"gap-2"),children:f.map((c,d)=>(0,b.jsx)("button",{type:"button",onClick:()=>s("bg",d),title:c.name,className:(0,v.cn)("rounded-full transition-shadow",k?"size-8":"size-7",a.bg===d?"ring-2 ring-primary ring-offset-2":"ring-1 ring-border"),style:{background:`linear-gradient(135deg, ${c.gradient[0]}, ${c.gradient[1]}, ${c.gradient[2]})`}},c.value))})]})]})]})]});return z?(0,b.jsxs)("div",{className:"flex gap-4",children:[B,C]}):(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[B,C]})}var y=a.i(432340),z=a.i(586220);a.s(["AvatarPickerDialog",0,function({config:a,onChange:d}){let[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(a),i=(0,z.useIsMobile)();return(0,b.jsxs)(y.Dialog,{open:e,onOpenChange:b=>{b&&h(a),f(b)},children:[(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsx)(y.DialogTrigger,{render:(0,b.jsx)("button",{type:"button",className:"rounded-2xl bg-background p-1.5 shadow-sm border border-border hover:border-primary/40 transition-colors cursor-pointer"}),children:(0,b.jsx)(r,{config:a,size:80})})}),(0,b.jsxs)(y.DialogContent,{className:i?"top-auto left-0 translate-x-0 translate-y-0 bottom-0 max-w-full sm:max-w-full w-full rounded-b-none rounded-t-xl max-h-[85dvh] overflow-y-auto pb-[env(safe-area-inset-bottom)]":"sm:max-w-180",children:[(0,b.jsx)(y.DialogHeader,{children:(0,b.jsx)(y.DialogTitle,{children:"Choose Avatar"})}),(0,b.jsx)(x,{config:g,layout:i?"vertical":"horizontal",onChange:a=>{h(a),d(a)},mobile:i}),i&&(0,b.jsx)("button",{type:"button",onClick:()=>f(!1),className:"w-full rounded-xl bg-primary py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:"Done"})]})]})}],628508),a.s(["AgentAvatar",0,function({name:a,avatarUrl:c,size:d=32}){let e=t(c);return e?(0,b.jsx)(r,{config:e,size:d,className:"rounded-full shrink-0"}):(0,b.jsx)("span",{className:"flex items-center justify-center rounded-full bg-secondary text-xs font-medium shrink-0",style:{width:d,height:d},children:(a??"?").charAt(0).toUpperCase()})}],949409),a.s([],735132)}];
|
|
1
|
+
module.exports=[735132,325848,253260,628508,949409,a=>{"use strict";var b=a.i(749314),c=a.i(437199);let d="#27272a",e={fill:"rgba(255,255,255,0.92)",stroke:"rgba(255,255,255,0.95)",strokeWidth:3.5},f=[{name:"Purple",value:"#a855f7",gradient:["#c084fc","#a855f7","#7c3aed"],faceColor:"#2e1065"},{name:"Teal",value:"#14b8a6",gradient:["#5eead4","#14b8a6","#0d9488"],faceColor:"#134e4a"},{name:"Orange",value:"#f97316",gradient:["#fdba74","#f97316","#c2410c"],faceColor:"#7c2d12"},{name:"Blue",value:"#3b82f6",gradient:["#93c5fd","#3b82f6","#1d4ed8"],faceColor:"#1e3a5f"},{name:"Pink",value:"#f472b6",gradient:["#fda4af","#f472b6","#be185d"],faceColor:"#831843"},{name:"Yellow",value:"#eab308",gradient:["#fde047","#eab308","#a16207"],faceColor:"#713f12"},{name:"Green",value:"#22c55e",gradient:["#86efac","#22c55e","#15803d"],faceColor:"#14532d"},{name:"Beige",value:"#d6ccb8",gradient:["#e8e0d4","#d6ccb8","#b8a990"],faceColor:"#57534e"},{name:"Red",value:"#ef4444",gradient:["#fca5a5","#ef4444","#991b1b"],faceColor:"#7f1d1d"},{name:"Lake Blue",value:"#6366f1",gradient:["#a5b4fc","#6366f1","#3730a3"],faceColor:"#312e81"},{name:"Gray",value:"#9ca3af",gradient:["#d4d4d8","#9ca3af","#6b7280"],faceColor:"#374151"},{name:"Deep Purple",value:"#8b5cf6",gradient:["#c4b5fd","#8b5cf6","#5b21b6"],faceColor:"#3b0764"}],g={circle:{name:"Circle",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("circle",{cx:"100",cy:"100",r:"66",...e})},rounded:{name:"Rounded",face:{cx:100,cy:100,w:90},render:()=>(0,b.jsx)("rect",{x:"30",y:"30",width:"140",height:"140",rx:"32",...e})},hexagon:{name:"Hexagon",face:{cx:100,cy:100,w:86},render:()=>(0,b.jsx)("path",{d:"M100 32 C108 32 114 35 120 39 L155 60 C161 64 165 70 165 78 L165 122 C165 130 161 136 155 140 L120 161 C114 165 108 168 100 168 C92 168 86 165 80 161 L45 140 C39 136 35 130 35 122 L35 78 C35 70 39 64 45 60 L80 39 C86 35 92 32 100 32 Z",...e})},task:{name:"Task",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("rect",{x:"34",y:"34",width:"132",height:"132",rx:"24",...e})},book:{name:"Book",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("path",{d:"M42 162 L42 88 C42 54 68 34 100 34 C132 34 158 54 158 88 L158 162 C158 166 154 170 150 170 L50 170 C46 170 42 166 42 162 Z",...e})},mail:{name:"Mail",face:{cx:100,cy:100,w:86},render:()=>(0,b.jsx)("rect",{x:"28",y:"54",width:"144",height:"92",rx:"46",...e})},calendar:{name:"Calendar",face:{cx:100,cy:100,w:80},render:()=>(0,b.jsx)("path",{d:"M100 34 C138 34 166 52 166 80 C166 94 158 106 158 118 C158 148 138 166 100 166 C62 166 42 148 42 118 C42 106 34 94 34 80 C34 52 62 34 100 34 Z",...e})},bulb:{name:"Bulb",face:{cx:100,cy:104,w:76},render:()=>(0,b.jsx)("ellipse",{cx:"100",cy:"104",rx:"58",ry:"66",...e})},folder:{name:"Folder",face:{cx:102,cy:108,w:80},render:()=>(0,b.jsx)("path",{d:"M62 144 C40 144 32 128 36 116 C32 104 40 90 54 88 C56 72 70 60 88 62 C100 50 118 50 132 58 C144 52 162 60 162 76 C172 82 174 98 166 108 C172 120 164 136 150 140 Z",...e})},mountain:{name:"Mountain",face:{cx:100,cy:100,w:76},render:()=>(0,b.jsx)("path",{d:"M92 36 C120 32 156 48 164 78 C172 108 156 148 124 160 C92 172 48 156 38 124 C28 92 62 40 92 36 Z",...e})}},h=Object.keys(g),i={dot:{name:"Dot",render:(a=d)=>(0,b.jsx)("circle",{cx:"0",cy:"0",r:"4.5",fill:a})},dash:{name:"Dash",render:(a=d)=>(0,b.jsx)("line",{x1:"-10",y1:"0",x2:"10",y2:"0",stroke:a,strokeWidth:"5",strokeLinecap:"round"})},hookL:{name:"Hook",render:(a=d)=>(0,b.jsx)("path",{d:"M-11 0 Q-5.5 7 0 1.5 Q5.5 7 11 0",fill:"none",stroke:a,strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"})},smile:{name:"Smile",render:(a=d)=>(0,b.jsx)("path",{d:"M-11 0 Q0 11 11 0",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"})},caret:{name:"Caret",render:(a=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:"M-10 0 Q0 8 10 0",fill:"none",stroke:a,strokeWidth:"4.5",strokeLinecap:"round"}),(0,b.jsx)("ellipse",{cx:"3",cy:"6",rx:"4",ry:"4.5",fill:"#f472b6"})]})},arrow:{name:"Arrow",render:(a=d)=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"6",ry:"7.5",fill:a})},oh:{name:"o",render:(a=d)=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"7",ry:"7.5",fill:"none",stroke:a,strokeWidth:"4.5"})}},j=Object.keys(i),k=(a,c)=>{let e=c??a,f=(c,f=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("g",{transform:`translate(${-c}, 0)`,children:a(f)}),(0,b.jsx)("g",{transform:`translate(${c}, 0)`,children:e(f)})]});return f.displayName="EyePair",f},l={dots:{name:"Dots",render:k(a=>(0,b.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:a}))},big:{name:"Big",render:k(a=>(0,b.jsxs)("g",{children:[(0,b.jsx)("circle",{cx:"0",cy:"0",r:"10",fill:a}),(0,b.jsx)("circle",{cx:"2.5",cy:"-3",r:"3.5",fill:"rgba(255,255,255,0.9)"})]}))},rings:{name:"Rings",render:k(a=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:"none",stroke:a,strokeWidth:"4.5"}))},arches:{name:"Arches",render:k(a=>(0,b.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},lines:{name:"Lines",render:k(a=>(0,b.jsx)("path",{d:"M-10 0 Q0 -6 10 0",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},happy:{name:"Happy",render:k(a=>(0,b.jsx)("path",{d:"M-10 5 Q0 -11 10 5",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},sleepy:{name:"Sleepy",render:k(a=>(0,b.jsx)("path",{d:"M-10 -2 Q0 8 10 -2",fill:"none",stroke:a,strokeWidth:"5",strokeLinecap:"round"}))},shy:{name:"Shy",render:k(a=>(0,b.jsx)("ellipse",{cx:"0",cy:"0",rx:"8.5",ry:"9.5",fill:a}))},wink:{name:"Wink",render:(a,c=d)=>(0,b.jsxs)("g",{children:[(0,b.jsx)("g",{transform:`translate(${-a}, 0)`,children:(0,b.jsx)("circle",{cx:"0",cy:"0",r:"7",fill:c})}),(0,b.jsx)("g",{transform:`translate(${a}, 0)`,children:(0,b.jsx)("path",{d:"M-10 2 Q0 -9 10 2",fill:"none",stroke:c,strokeWidth:"5",strokeLinecap:"round"})})]})}},m=Object.keys(l),n={shape:"book",eye:"happy",nose:"dash",bg:1},o=[{name:"Task",config:{shape:"task",nose:"dot",eye:"dots",bg:0}},{name:"Notes",config:{shape:"book",nose:"dash",eye:"happy",bg:1}},{name:"Mail",config:{shape:"mail",nose:"smile",eye:"dots",bg:3}},{name:"Schedule",config:{shape:"calendar",nose:"dot",eye:"dots",bg:4}},{name:"Idea",config:{shape:"bulb",nose:"oh",eye:"rings",bg:5}},{name:"Project",config:{shape:"folder",nose:"dash",eye:"lines",bg:7}},{name:"Goal",config:{shape:"mountain",nose:"caret",eye:"arches",bg:8}},{name:"Dream",config:{shape:"circle",nose:"smile",eye:"shy",bg:11}},{name:"Organize",config:{shape:"rounded",nose:"dot",eye:"sleepy",bg:6}},{name:"Explore",config:{shape:"hexagon",nose:"hookL",eye:"wink",bg:9}},{name:"Focus",config:{shape:"task",nose:"caret",eye:"lines",bg:2}},{name:"Collect",config:{shape:"book",nose:"oh",eye:"rings",bg:10}}];function p(a){return a[Math.floor(Math.random()*a.length)]}function q(){return{shape:p(h),eye:p(m),nose:p(j),bg:Math.floor(Math.random()*f.length)}}function r({config:a,size:d=200,className:e}){let h=(0,c.useId)().replace(/:/g,""),j=g[a.shape]??g.book,k=l[a.eye],m=i[a.nose],n=f[a.bg]??f[0],[o,p,q]=n.gradient,s=n.faceColor,{cx:t,cy:u,w:v}=j.face,w=Math.max(13,.24*v),x=u-Math.max(12,.16*v);return(0,b.jsxs)("svg",{viewBox:"0 0 200 200",width:d,height:d,className:e,style:{display:"block"},children:[(0,b.jsxs)("defs",{children:[(0,b.jsxs)("linearGradient",{id:`bg-${h}`,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:o}),(0,b.jsx)("stop",{offset:"50%",stopColor:p}),(0,b.jsx)("stop",{offset:"100%",stopColor:q})]}),(0,b.jsxs)("radialGradient",{id:`gl-${h}`,cx:"30%",cy:"25%",r:"60%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:"rgba(255,255,255,0.32)"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"rgba(255,255,255,0)"})]}),(0,b.jsx)("filter",{id:`sh-${h}`,x:"-10%",y:"-5%",width:"120%",height:"130%",children:(0,b.jsx)("feDropShadow",{dx:"0",dy:"3",stdDeviation:"4",floodColor:"rgba(0,0,0,0.18)"})})]}),(0,b.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#bg-${h})`}),(0,b.jsx)("rect",{x:"0",y:"0",width:"200",height:"200",rx:"56",fill:`url(#gl-${h})`}),(0,b.jsxs)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:[(0,b.jsx)("g",{"data-avatar-shape":"",filter:`url(#sh-${h})`,children:j.render()}),k&&(0,b.jsx)("g",{transform:`translate(${t}, ${x})`,children:(0,b.jsx)("g",{"data-avatar-eyes":"",children:k.render(w,s)})}),m&&(0,b.jsx)("g",{transform:`translate(${t}, ${u+7})`,children:(0,b.jsx)("g",{"data-avatar-nose":"",children:m.render(s)})})]})]})}let s="avatar:";function t(a){if(!a||!a.startsWith(s))return null;try{let b=JSON.parse(a.slice(s.length));if("object"==typeof b&&null!==b&&"string"==typeof b.shape&&"string"==typeof b.eye&&"string"==typeof b.nose&&"number"==typeof b.bg)return b;if("object"==typeof b&&null!==b&&"outline"in b)return n;return null}catch{return null}}a.s(["AvatarRenderer",0,r,"BG_COLORS",0,f,"DEFAULT_CONFIG",0,n,"EYE_KEYS",0,m,"Eyes",0,l,"NOSE_KEYS",0,j,"Noses",0,i,"PRESETS",0,o,"SHAPE_KEYS",0,h,"Shapes",0,g,"parseAvatarUrl",0,t,"randomConfig",0,q,"serializeAvatarConfig",0,function(a){return s+JSON.stringify(a)}],325848);let u=["avatar-anim-shape-bounce","avatar-anim-head-tilt","avatar-anim-shake","avatar-anim-wobble","avatar-anim-pulse","avatar-anim-spin","avatar-anim-jelly","avatar-anim-float","avatar-anim-nod"];a.s(["AnimatedAvatar",0,function({config:a,size:d,className:e,isHovered:f,isWorking:g}){let[h,i]=(0,c.useState)(null),j=(0,c.useRef)(-1);function k(){let a=Math.floor(Math.random()*u.length);return a===j.current&&(a=(a+1)%u.length),j.current=a,u[a]}return(0,c.useEffect)(()=>{f?i(k()):g||i(null)},[f,g]),(0,c.useEffect)(()=>{if(!g){f||i(null);return}i(k());let a=setInterval(()=>{i(k())},4e3);return()=>clearInterval(a)},[f,g]),(0,b.jsx)("div",{className:h??void 0,children:(0,b.jsx)(r,{config:a,size:d,className:e})})}],253260);var v=a.i(75118),w=a.i(525132);function x({label:a,keys:c,value:d,onChange:e,renderThumb:f,mobile:g=!1}){let h=c.indexOf(d),i=a=>e(c[(h+a+c.length)%c.length]),j=c[(h-1+c.length)%c.length],k=c[(h+1)%c.length];return(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-12 text-xs font-medium text-muted-foreground shrink-0",children:a}),(0,b.jsx)("button",{type:"button",onClick:()=>i(-1),className:(0,v.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",g?"size-10":"size-7"),children:(0,b.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,b.jsx)("path",{d:"M15 5 L8 12 L15 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-1 justify-center",children:[(0,b.jsx)("button",{type:"button",onClick:()=>i(-1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:f(j)}),(0,b.jsx)("button",{type:"button",onClick:()=>i(1),className:"border-2 border-primary rounded-lg p-0.5",children:f(d)}),(0,b.jsx)("button",{type:"button",onClick:()=>i(1),className:"opacity-30 hover:opacity-60 transition-opacity",tabIndex:-1,children:f(k)})]}),(0,b.jsx)("button",{type:"button",onClick:()=>i(1),className:(0,v.cn)("flex items-center justify-center rounded-md hover:bg-accent transition-colors",g?"size-10":"size-7"),children:(0,b.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:(0,b.jsx)("path",{d:"M9 5 L16 12 L9 19",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function y({config:a,onChange:d,layout:e="vertical",mobile:k=!1}){let[n,p]=(0,c.useState)("presets"),s=(0,c.useCallback)((b,c)=>{d({...a,[b]:c})},[a,d]),[t,u]=(0,c.useState)(!1),z=(0,c.useRef)(a);(0,c.useEffect)(()=>{if(z.current.shape!==a.shape||z.current.eye!==a.eye||z.current.nose!==a.nose||z.current.bg!==a.bg){u(!0);let b=setTimeout(()=>u(!1),450);return z.current=a,()=>clearTimeout(b)}},[a]),(0,c.useEffect)(()=>{if("horizontal"!==e)return;let a=a=>{"Space"===a.code&&a.target===document.body&&(a.preventDefault(),d(q()))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,d]);let A="horizontal"===e,B=A?220:k?120:160,C=(0,b.jsxs)("div",{className:(0,v.cn)("flex flex-col items-center gap-3 rounded-2xl bg-muted/30",k?"p-3":"p-4",A?"w-70 shrink-0 justify-center":""),children:[(0,b.jsx)("div",{className:(0,v.cn)("rounded-2xl",t&&"animate-[shake_0.45s_cubic-bezier(.36,.07,.19,.97)]"),children:(0,b.jsx)(r,{config:a,size:B})}),(0,b.jsxs)("button",{type:"button",onClick:()=>d(q()),className:"inline-flex items-center gap-2 rounded-full bg-foreground px-4 py-1.5 text-sm font-medium text-background hover:bg-foreground/80 transition-colors",children:[(0,b.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),(0,b.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"16",cy:"8",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"8",cy:"16",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"16",cy:"16",r:"1.5",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]}),"Random",A&&(0,b.jsx)("kbd",{className:"ml-1 rounded bg-background/20 px-1.5 py-0.5 text-[10px] font-mono",children:"Space"})]})]}),D=(0,b.jsxs)("div",{className:(0,v.cn)("flex flex-col gap-3 flex-1 min-w-0",A&&"rounded-2xl bg-muted/30 p-4 h-95"),children:[(0,b.jsxs)("div",{className:"flex border-b border-border",children:[(0,b.jsx)("button",{type:"button",onClick:()=>p("presets"),className:(0,v.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","presets"===n?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"★ Presets"}),(0,b.jsx)("button",{type:"button",onClick:()=>p("custom"),className:(0,v.cn)("flex-1 pb-2 text-sm font-medium text-center transition-colors border-b-2","custom"===n?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:"⚙ Custom"})]}),(0,b.jsxs)("div",{className:(0,v.cn)("flex-1 min-h-0",A&&"overflow-y-auto thin-scrollbar"),children:["presets"===n&&(0,b.jsx)("div",{className:(0,v.cn)("grid gap-2",k?"grid-cols-3":"grid-cols-4"),children:o.map(c=>{let e=c.config.shape===a.shape&&c.config.eye===a.eye&&c.config.nose===a.nose&&c.config.bg===a.bg;return(0,b.jsx)("button",{type:"button",onClick:()=>d(c.config),className:(0,v.cn)("flex items-center justify-center rounded-xl border p-2 transition-all",e?"border-primary border-2 bg-primary/5 shadow-sm":"border-border bg-background hover:border-primary/40"),children:(0,b.jsx)(r,{config:c.config,size:56})},c.name)})}),"custom"===n&&(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsx)(x,{label:"Shape",keys:h,value:a.shape,onChange:a=>s("shape",a),renderThumb:a=>(0,b.jsxs)("svg",{viewBox:"0 0 200 200",width:"40",height:"40",children:[(0,b.jsx)("rect",{width:"200",height:"200",rx:"56",fill:"hsl(var(--muted))"}),(0,b.jsx)("g",{transform:"translate(100,100) scale(0.8) translate(-100,-100)",children:g[a]?.render()})]}),mobile:k}),(0,b.jsx)(x,{label:"Nose",keys:j,value:a.nose,onChange:a=>s("nose",a),renderThumb:a=>(0,b.jsx)("svg",{viewBox:"-14 -10 28 20",width:"36",height:"24",children:i[a]?.render("currentColor")}),mobile:k}),(0,b.jsx)(x,{label:"Eyes",keys:m,value:a.eye,onChange:a=>s("eye",a),renderThumb:a=>(0,b.jsx)("svg",{viewBox:"-18 -10 36 20",width:"44",height:"24",children:l[a]?.render(8,"currentColor")}),mobile:k}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Color"}),(0,b.jsx)("div",{className:(0,v.cn)("flex flex-wrap p-1",k?"gap-3":"gap-2"),children:f.map((c,d)=>(0,b.jsxs)(w.Tooltip,{children:[(0,b.jsx)(w.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:()=>s("bg",d),className:(0,v.cn)("rounded-full transition-shadow",k?"size-8":"size-7",a.bg===d?"ring-2 ring-primary ring-offset-2":"ring-1 ring-border"),style:{background:`linear-gradient(135deg, ${c.gradient[0]}, ${c.gradient[1]}, ${c.gradient[2]})`}})}),(0,b.jsx)(w.TooltipContent,{children:c.name})]},c.value))})]})]})]})]});return A?(0,b.jsxs)("div",{className:"flex gap-4",children:[C,D]}):(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[C,D]})}var z=a.i(432340),A=a.i(586220);a.s(["AvatarPickerDialog",0,function({config:a,onChange:d}){let[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(a),i=(0,A.useIsMobile)();return(0,b.jsxs)(z.Dialog,{open:e,onOpenChange:b=>{b&&h(a),f(b)},children:[(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsx)(z.DialogTrigger,{render:(0,b.jsx)("button",{type:"button",className:"rounded-2xl bg-background p-1.5 shadow-sm border border-border hover:border-primary/40 transition-colors cursor-pointer"}),children:(0,b.jsx)(r,{config:a,size:80})})}),(0,b.jsxs)(z.DialogContent,{className:i?"top-auto left-0 translate-x-0 translate-y-0 bottom-0 max-w-full sm:max-w-full w-full rounded-b-none rounded-t-xl max-h-[85dvh] overflow-y-auto pb-[env(safe-area-inset-bottom)]":"sm:max-w-180",children:[(0,b.jsx)(z.DialogHeader,{children:(0,b.jsx)(z.DialogTitle,{children:"Choose Avatar"})}),(0,b.jsx)(y,{config:g,layout:i?"vertical":"horizontal",onChange:a=>{h(a),d(a)},mobile:i}),i&&(0,b.jsx)("button",{type:"button",onClick:()=>f(!1),className:"w-full rounded-xl bg-primary py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:"Done"})]})]})}],628508),a.s(["AgentAvatar",0,function({name:a,avatarUrl:c,size:d=32}){let e=t(c);return e?(0,b.jsx)(r,{config:e,size:d,className:"rounded-full shrink-0"}):(0,b.jsx)("span",{className:"flex items-center justify-center rounded-full bg-secondary text-xs font-medium shrink-0",style:{width:d,height:d},children:(a??"?").charAt(0).toUpperCase()})}],949409),a.s([],735132)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_components_avatar_index_ts_0v3qm09._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[963744,763510,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(7455),e=a.i(732254),f=a.i(889624),g=a.i(25668),h=a.i(722393);let i=(0,a.i(790090).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,i],763510);var j=a.i(556371),k=a.i(249453),l=a.i(338660),m=a.i(89275),n=a.i(527779),o=a.i(363928),p=a.i(166198),q=a.i(26822),r=a.i(75118),s=a.i(921584);a.i(343563);var t=a.i(347788);a.i(974936);var u=a.i(988024),v=a.i(588339);a.i(735132);var w=a.i(325848),x=a.i(22902);let y="h-7 border-0 bg-transparent px-1.5 text-xs text-foreground hover:bg-accent transition-colors -ml-1.5",z=(0,r.cn)(y,"rounded-md outline-none focus-visible:bg-accent focus-visible:ring-0 appearance-none pr-6"),A=["todo","in_progress","review","done"];function B({agent:a,size:c=24}){let d=(0,w.parseAvatarUrl)(a?.avatar_url);return d?(0,b.jsx)(w.AvatarRenderer,{config:d,size:c,className:"shrink-0 rounded-full"}):(0,b.jsx)("span",{className:"flex shrink-0 items-center justify-center rounded-full border border-border bg-muted text-[11px] font-medium text-muted-foreground",style:{width:c,height:c},children:(a?.name??"?").slice(0,1).toUpperCase()})}function C({agent:a,size:c=24}){let d=a.email_handle?`${a.email_handle}@alook.ai`:"";return(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)(B,{agent:a,size:c}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[(0,b.jsx)("div",{className:"truncate text-xs font-medium",children:a.name}),d?(0,b.jsx)("div",{className:"truncate text-[11px] text-muted-foreground",children:d}):null]})]})}function D({icon:a,children:c}){return(0,b.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,b.jsx)("span",{className:"inline-flex size-6 shrink-0 items-center justify-center text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:c})]})}function E({message:a}){return"event"===a.role?(0,b.jsx)("div",{className:"rounded-md border bg-muted/50 text-muted-foreground text-xs px-3 py-2",children:a.content}):(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-background/55 p-3",children:[(0,b.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"capitalize",children:a.role}),(0,b.jsx)("span",{children:new Date(a.created_at).toLocaleString()})]}),(0,b.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm wrap-break-word",children:(0,b.jsx)(t.Streamdown,{children:a.content})})]})}function F({comment:a,agents:c}){let d="agent"===a.author_type?c.find(b=>b.id===a.author_id)?.name??"Agent":"You";return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-background p-3",children:[(0,b.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium",children:d}),(0,b.jsx)("span",{children:new Date(a.created_at).toLocaleString()})]}),(0,b.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm wrap-break-word",children:(0,b.jsx)(t.Streamdown,{children:a.content})})]})}function G({artifacts:a,workspaceId:c}){return 0===a.length?null:(0,b.jsx)("div",{className:"space-y-1",children:a.map(a=>(0,b.jsxs)("a",{href:`/api/artifacts/${a.id}/content?workspace_id=${c}&download=1`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent",children:[(0,b.jsx)(l.File,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.filename}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.size<1024?`${a.size} B`:a.size<1048576?`${(a.size/1024).toFixed(1)} KB`:`${(a.size/1048576).toFixed(1)} MB`})]},a.id))})}a.s(["IssueSheet",0,function({open:a,onOpenChange:l,agents:t,issue:w,detail:H,detailLoading:I,activeTask:J,traceTasks:K,submitting:L,defaultAgentId:M,slug:N,workspaceId:O,width:P=448,onWidthChange:Q,draft:R,onDraftChange:S,onCreate:T,onUpdate:U,onStatusChange:V,onCommented:W,onDispatched:X}){let Y,Z,$=w?"detail":"create",[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)(""),[ad,ae]=(0,c.useState)(M??""),[af,ag]=(0,c.useState)(!1),[ah,ai]=(0,c.useState)(""),[aj,ak]=(0,c.useState)(!1),[al,am]=(0,c.useState)(null),[an,ao]=(0,c.useState)(!1),ap=(0,c.useRef)(null),aq=(0,c.useRef)(null),ar=(0,c.useRef)(null),as=(0,c.useRef)(!1),at=J&&!["completed","failed","cancelled","superseded"].includes(J.status),au=K?.some(a=>["queued","dispatched","running"].includes(a.status))??!1;(0,c.useEffect)(()=>{a&&(w?(aa(w.title),ac(w.description??"")):(aa(R?.title??""),ac(R?.description??""),ae(R?.agentId||M||"")))},[a,w?.id]),(0,c.useEffect)(()=>{"create"===$&&a&&S?.({title:_,description:ab,agentId:ad})},[_,ab,ad,$,a]),(0,c.useEffect)(()=>{ar.current&&(ar.current.scrollTop=ar.current.scrollHeight)},[H?.messages?.length,H?.comments?.length,K?.length]);let av=(0,c.useRef)(null),aw=(0,c.useRef)(U);(0,c.useEffect)(()=>{aw.current=U},[U]);let ax=(0,c.useRef)(_);(0,c.useEffect)(()=>{ax.current=_},[_]);let ay=(0,c.useRef)(ab);(0,c.useEffect)(()=>{ay.current=ab},[ab]);let az=(0,c.useRef)(w);(0,c.useEffect)(()=>{az.current=w},[w]);let aA=(0,c.useCallback)(()=>{av.current&&clearTimeout(av.current),av.current=null;let a=az.current;if(!a)return;let b=ax.current!==a.title,c=ay.current!==(a.description??"");if(!b&&!c||!ax.current.trim())return;let d={};b&&(d.title=ax.current.trim()),c&&(d.description=ay.current.trim()),aw.current?.(a.id,d)},[]);(0,c.useEffect)(()=>{if("detail"!==$||!w||!a)return;let b=_!==w.title,c=ab!==(w.description??"");if((b||c)&&_.trim())return av.current&&clearTimeout(av.current),av.current=setTimeout(aA,500),()=>{av.current&&clearTimeout(av.current)}},[_,ab,$,w,a,aA]);let aB=(0,c.useRef)(a);(0,c.useEffect)(()=>{aB.current&&!a&&"detail"===$&&aA(),aB.current=a},[a,$,aA]);let aC=(0,c.useCallback)(a=>{let b=a??ap.current;b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)},[]);(0,c.useEffect)(()=>{requestAnimationFrame(()=>aC())},[_,aC]);let aD=(0,c.useCallback)(a=>{a.preventDefault(),as.current=!0,a.target.setPointerCapture(a.pointerId)},[]),aE=(0,c.useCallback)(a=>{if(!as.current)return;let b=Math.min(.8*window.innerWidth,Math.max(320,window.innerWidth-a.clientX));Q?.(b)},[Q]),aF=(0,c.useCallback)(()=>{as.current=!1},[]),aG=async()=>{_.trim()&&!L&&await T?.({agent_id:ad||void 0,title:_.trim(),description:ab.trim()})},aH=async()=>{if(ah.trim()&&!aj&&w){ak(!0);try{if(!(await fetch(`/api/issues/${w.id}/comments?workspace_id=${O}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ah.trim()})})).ok)throw Error("Failed to send comment");ai(""),W?.()}catch{s.toast.error("Failed to send comment")}finally{ak(!1)}}},aI=(0,c.useRef)(null),aJ=(0,c.useCallback)(a=>{"Enter"===a.key&&a.shiftKey&&"create"===$&&(aI.current&&aI.current.contains(a.target)||(a.preventDefault(),a.stopPropagation(),aG()))},[$,_,ab,ad,L]),aK="detail"===$&&w?.status==="todo",aL=t.find(a=>a.id===ad)??null,aM=w?.agent_id?t.find(a=>a.id===w.agent_id)??null:null,[aN,aO]=(0,c.useState)("issue");(0,c.useEffect)(()=>{aO("issue")},[w?.id,$]);let aP=(0,b.jsx)(b.Fragment,{children:I?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)(g.Skeleton,{className:"h-12"}),(0,b.jsx)(g.Skeleton,{className:"h-8"}),(0,b.jsx)(g.Skeleton,{className:"h-12"})]}):0!==(Z=[...(H?.messages??[]).filter(a=>"event"===a.role).map(a=>({kind:"event",id:a.id,created_at:a.created_at,data:a})),...(H?.comments??[]).map(a=>({kind:"comment",id:a.id,created_at:a.created_at,data:a}))].sort((a,b)=>new Date(a.created_at).getTime()-new Date(b.created_at).getTime())).length||at?(0,b.jsxs)("div",{className:"relative pl-4",children:[(0,b.jsx)("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-border"}),(0,b.jsxs)("div",{className:"space-y-3",children:[Z.map(a=>(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background bg-muted-foreground/40"}),"event"===a.kind?(0,b.jsx)(E,{message:a.data}):(0,b.jsx)(F,{comment:a.data,agents:t})]},a.id)),(at||au)&&((Y=K?.filter(a=>["queued","dispatched","running"].includes(a.status)))&&Y.length>0?Y.map(a=>{let c="running"===a.status;return(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:(0,r.cn)("absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background",c?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40")}),(0,b.jsx)("div",{className:(0,r.cn)("rounded-md border px-3 py-2.5",c?"border-emerald-500/30 bg-emerald-500/10":"border-border/60 bg-muted/30"),children:(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[a.agent&&(0,b.jsx)(B,{agent:{avatar_url:a.agent.avatarUrl,name:a.agent.name},size:16}),(0,b.jsxs)("span",{className:c?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground",children:[a.agent?.name??"Agent"," ",c?"is working":"— queued"]})]})})]},a.id)}):(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background bg-emerald-500 animate-pulse"}),(0,b.jsx)("div",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-2.5",children:(0,b.jsx)("div",{className:"flex items-center gap-2 text-xs text-emerald-600 dark:text-emerald-400",children:"Working"})})]}))]})]}):(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"No activity yet."})}),aQ="detail"!==$||!w||aK||at||(0,u.isTerminalIssueStatus)(w.status)?null:(0,b.jsxs)("div",{className:"flex flex-col rounded-xl border bg-background/60 transition-colors duration-200 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",children:[(0,b.jsx)("textarea",{ref:aI,placeholder:"Leave a comment...",value:ah,onChange:a=>ai(a.target.value),className:"w-full resize-none bg-transparent px-3.5 py-2.5 text-sm leading-relaxed outline-none placeholder:text-muted-foreground field-sizing-content min-h-15 max-h-32 thin-scrollbar overflow-y-auto",onKeyDown:a=>{"Enter"===a.key&&a.shiftKey&&(a.preventDefault(),aH())}}),(0,b.jsxs)("div",{className:"flex items-center justify-between px-2.5 pb-2 pt-0.5",children:[(0,b.jsx)("kbd",{className:"text-[11px] text-muted-foreground/50 font-sans select-none",children:"⇧↵"}),(0,b.jsx)(e.Button,{size:"icon-sm",onClick:aH,disabled:!ah.trim()||aj,className:(0,r.cn)("rounded-lg transition-opacity duration-200",!ah.trim()&&!aj&&"opacity-40"),children:aj?(0,b.jsx)(n.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(i,{className:"size-3.5"})})]})]}),aR=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"shrink-0 px-2 sm:px-3 pt-5 pb-1",children:(0,b.jsx)("textarea",{ref:a=>{ap.current=a,aC(a)},value:_,onChange:a=>{aa(a.target.value),aC(a.target)},onKeyDown:a=>{if("Enter"===a.key&&!a.shiftKey){a.preventDefault();let b=aq.current?.querySelector('[contenteditable="true"]');b?.focus()}},placeholder:"create"===$?"New issue":"Untitled",autoFocus:"create"===$,rows:1,className:"w-full resize-none overflow-hidden rounded-none border-0 bg-transparent px-0 py-1 font-news text-2xl md:text-3xl font-medium leading-[1.2] tracking-tight shadow-none outline-none focus-visible:border-0 focus-visible:ring-0 focus-visible:ring-offset-0 placeholder:text-muted-foreground/40 placeholder:font-normal"})}),(0,b.jsxs)("div",{className:"shrink-0 space-y-1.5 px-2 sm:px-3 py-2",children:[(0,b.jsx)(D,{icon:(0,b.jsx)(p.User,{className:"size-3.5"}),children:"create"===$||aK?(0,b.jsxs)(h.Popover,{open:af,onOpenChange:ag,children:[(0,b.jsx)(h.PopoverTrigger,{render:(0,b.jsx)("button",{type:"button",disabled:L||an,className:(0,r.cn)(y,"flex items-center gap-1.5 rounded-md")}),children:aL?(0,b.jsx)("span",{className:"truncate",children:aL.name}):(0,b.jsx)("span",{className:"text-muted-foreground/70",children:"Unassigned"})}),(0,b.jsxs)(h.PopoverContent,{align:"start",className:"max-h-64 w-72 overflow-y-auto thin-scrollbar p-1",children:[!aK&&(0,b.jsxs)("button",{type:"button",onClick:()=>{ae(""),ag(!1)},className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"None (unassigned)"}),ad?null:(0,b.jsx)(j.Check,{className:"size-3.5 shrink-0"})]}),t.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{aK?am(a):ae(a.id),ag(!1)},className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,b.jsx)(C,{agent:a,size:18}),ad===a.id?(0,b.jsx)(j.Check,{className:"size-3.5 shrink-0"}):null]},a.id))]})]}):(0,b.jsx)("span",{className:"text-xs truncate",children:aM?aM.name:(0,b.jsx)("span",{className:"text-muted-foreground/70",children:"Unassigned"})})}),"detail"===$&&w&&(0,b.jsx)(D,{icon:(0,b.jsx)(k.CircleDot,{className:"size-3.5"}),children:(0,b.jsx)("select",{value:w.status,onChange:a=>{var b;return b=a.target.value,void(w&&b!==w.status&&V?.(w.id,b))},className:z,children:(aK?["todo","done"]:A).map(a=>(0,b.jsx)("option",{value:a,children:"done"===a?"Complete":a.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())},a))})}),"detail"===$&&w?.agent_id&&w?.conversation_id&&(0,b.jsx)(D,{icon:(0,b.jsx)(o.MessageSquare,{className:"size-3.5"}),children:(0,b.jsx)(q.default,{href:`/w/${N}/agents/${w.agent_id}?conv=${w.conversation_id}${w.latest_task_id?`&task=${w.latest_task_id}`:""}`,className:(0,r.cn)(y,"inline-flex items-center rounded-md"),children:"Chat"})}),"detail"===$&&H?.traceId&&(0,b.jsx)(D,{icon:(0,b.jsx)(m.GitBranch,{className:"size-3.5"}),children:(0,b.jsx)(q.default,{href:`/w/${N}/threads/${H.traceId}`,className:(0,r.cn)(y,"inline-flex items-center rounded-md"),children:"Thread"})})]}),(0,b.jsx)("div",{className:(0,r.cn)("px-2 sm:px-3 py-2 flex-1 min-h-0 overflow-y-auto thin-scrollbar"),ref:aq,children:(0,b.jsx)(f.MarkdownEditor,{value:ab,onChange:ac,placeholder:"Describe the issue...",minHeight:"create"===$?"10rem":"4rem",variant:"seamless",contentType:"markdown",agents:t},w?.id??"new")}),"detail"===$&&H?.artifacts&&H.artifacts.length>0&&(0,b.jsx)("div",{className:"shrink-0 px-2 sm:px-3 py-2",children:(0,b.jsx)(G,{artifacts:H.artifacts,workspaceId:O})})]});return(0,b.jsxs)(d.Sheet,{open:a,onOpenChange:l,children:[(0,b.jsxs)(d.SheetContent,{side:"right",showCloseButton:!1,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 overflow-visible",style:{width:`min(${P}px, 100vw)`,maxWidth:"none"},children:[(0,b.jsx)("div",{onPointerDown:aD,onPointerMove:aE,onPointerUp:aF,onLostPointerCapture:aF,className:"hidden sm:block absolute -left-px top-0 bottom-0 w-1.5 cursor-col-resize z-10 hover:bg-primary/20 active:bg-primary/30 transition-colors rounded-l-xl"}),"detail"===$&&!aK&&(0,b.jsxs)("div",{className:"hidden lg:flex absolute right-full top-0 bottom-0 mr-2 w-90 flex-col rounded-xl border bg-background shadow-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"shrink-0 flex items-center border-b px-4 py-2.5",children:(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Activity"})}),(0,b.jsx)("div",{ref:ar,className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar px-4 py-4 space-y-3",children:aP}),aQ&&(0,b.jsx)("div",{className:"shrink-0 border-t px-4 py-3",children:aQ})]}),(0,b.jsx)(d.SheetTitle,{className:"sr-only",children:"create"===$?"New Issue":w?.title??"Issue"}),(0,b.jsxs)("div",{className:"flex flex-1 min-h-0 flex-col",onKeyDownCapture:aJ,children:["detail"===$&&!aK&&(0,b.jsxs)("div",{className:"shrink-0 flex items-center gap-1 border-b px-2 py-1.5 lg:hidden",children:[(0,b.jsx)("button",{type:"button",onClick:()=>aO("issue"),className:(0,r.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors","issue"===aN?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:"Issue"}),(0,b.jsx)("button",{type:"button",onClick:()=>aO("activity"),className:(0,r.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors","activity"===aN?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:"Activity"})]}),(0,b.jsxs)(d.SheetBody,{className:"flex flex-col gap-0 p-0 overflow-hidden",children:[(0,b.jsx)("div",{className:(0,r.cn)("flex flex-col flex-1 min-h-0","detail"===$&&"activity"===aN&&"hidden lg:flex"),children:aR}),"detail"===$&&!aK&&"activity"===aN&&(0,b.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 lg:hidden",children:[(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar px-3 py-4 space-y-3",children:aP}),aQ&&(0,b.jsx)("div",{className:"shrink-0 border-t px-3 py-3",children:aQ})]})]}),"create"===$&&(0,b.jsxs)(d.SheetFooter,{children:[(0,b.jsx)(e.Button,{variant:"outline",size:"sm",onClick:()=>l(!1),disabled:L,children:"Cancel"}),(0,b.jsxs)(e.Button,{size:"sm",onClick:aG,disabled:!_.trim()||L,children:[L&&(0,b.jsx)(n.Loader2,{className:"mr-1.5 size-3.5 animate-spin"}),(0,b.jsxs)("kbd",{className:"mr-1 hidden sm:inline-flex items-center gap-0.5 font-sans font-medium leading-none opacity-60",children:[(0,b.jsx)("span",{children:"⇧"}),(0,b.jsx)("span",{children:"+"}),(0,b.jsx)("span",{children:"⏎"})]}),"Create"]})]})]})]}),(0,b.jsx)(x.ConfirmDialog,{open:!!al,onOpenChange:a=>{a||am(null)},title:"Run issue?",description:`This issue will be assigned to ${al?.name??"the agent"} and start running immediately.`,confirmLabel:"Run",loadingLabel:"Running...",confirmVariant:"default",loading:an,onConfirm:async()=>{if(al&&w){ao(!0);try{await (0,v.updateIssue)(O,w.id,{agent_id:al.id}),am(null),X?.(w.id)}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to dispatch issue"),am(null)}finally{ao(!1)}}}})]})}],963744)}];
|
|
1
|
+
module.exports=[963744,763510,698824,207461,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(7455),e=a.i(732254),f=a.i(889624),g=a.i(25668),h=a.i(722393),i=a.i(790090);let j=(0,i.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,j],763510);var k=a.i(556371),l=a.i(249453),m=a.i(338660),n=a.i(89275),o=a.i(527779),p=a.i(363928),q=a.i(166198),r=a.i(26822),s=a.i(75118),t=a.i(921584);a.i(343563);var u=a.i(347788),v=a.i(588339);let w=(0,i.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),x=new Set(["application/json","application/xml","application/javascript","application/typescript","application/x-yaml","application/toml","application/sql"]);function y(a){return!!(a.startsWith("text/")||x.has(a))}function z(a){return a.startsWith("text/html")}function A(a){return a.startsWith("image/")}function B(a){return y(a.content_type)||A(a.content_type)}function C(a,b,c){let d=new URLSearchParams({workspace_id:b});return c&&d.set("download","1"),`/api/artifacts/${a}/content?${d}`}function D({artifact:a,workspaceId:d}){let[e,f]=(0,c.useState)(null),[g,h]=(0,c.useState)(!1),i=C(a.id,d);if((0,c.useEffect)(()=>{y(a.content_type)&&!z(a.content_type)&&(h(!0),f(null),(0,v.getArtifactContent)(a.id,d).then(f).catch(()=>f("(failed to load content)")).finally(()=>h(!1)))},[a.id,a.content_type,d]),g)return(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(o.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});if(A(a.content_type))return(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsx)("img",{src:i,alt:a.filename,className:"max-w-full rounded-md"})});if(z(a.content_type))return(0,b.jsx)(E,{url:i,title:a.filename});if(y(a.content_type)){var j;return(j=a.filename,/\.md$/i.test(j))?(0,b.jsx)("div",{className:"markdown text-sm",children:(0,b.jsx)(u.Streamdown,{children:e??""})}):(0,b.jsx)("pre",{className:"whitespace-pre-wrap text-sm font-mono text-foreground",children:e})}return(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"This file type cannot be previewed."}),(0,b.jsxs)("a",{href:C(a.id,d,!0),download:a.filename,className:"inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium hover:bg-accent hover:text-accent-foreground transition-colors",children:[(0,b.jsx)(w,{className:"size-3.5"}),"Download"]})]})}function E({url:a,title:c}){return(0,b.jsx)("iframe",{src:a,sandbox:"allow-same-origin",className:"w-full h-full rounded-b-xl overflow-hidden",style:{border:"none",display:"block"},title:c})}a.s(["ArtifactContentRenderer",0,D,"computeArtifactVersions",0,function(a){let b=new Map;for(let c of a){let a=b.get(c.filename)||[];a.push(c),b.set(c.filename,a)}let c=new Map,d=new Set;for(let[a,e]of b)e.sort((a,b)=>a.created_at.localeCompare(b.created_at)),e.length>1&&d.add(a),e.forEach((a,b)=>c.set(a.id,b+1));return{versionMap:c,duplicateFilenames:d}},"getArtifactUrl",0,C,"isHtmlType",0,z,"isPreviewable",0,B],698824);var F=a.i(784847),G=a.i(143788);function H(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}a.s(["ArtifactSheet",0,function({open:a,onOpenChange:f,artifacts:g,workspaceId:h,initialArtifact:i=null,versionMap:j,duplicateFilenames:k}){let[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(448),p=(0,c.useRef)(!1);(0,c.useEffect)(()=>{a&&i&&m(i)},[a,i]);let q=a=>{f(a),a||setTimeout(()=>m(null),300)},r=(0,c.useCallback)(a=>{a.preventDefault(),p.current=!0,a.target.setPointerCapture(a.pointerId)},[]),t=(0,c.useCallback)(a=>{p.current&&o(Math.min(.8*window.innerWidth,Math.max(320,window.innerWidth-a.clientX)))},[]),u=(0,c.useCallback)(()=>{p.current=!1},[]);return(0,b.jsx)(d.Sheet,{open:a,onOpenChange:q,children:(0,b.jsxs)(d.SheetContent,{side:"right",showCloseButton:!1,style:{width:`min(${n}px, 100vw)`,maxWidth:"none"},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,b.jsx)("div",{onPointerDown:r,onPointerMove:t,onPointerUp:u,className:"hidden sm:block absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 hover:bg-primary/20 active:bg-primary/30 transition-colors rounded-l-xl"}),l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.SheetHeader,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0 sm:hidden",onClick:()=>{g.length>1?m(null):q(!1)},children:(0,b.jsx)(G.ArrowLeft,{className:"size-4"})}),(0,b.jsxs)(d.SheetTitle,{className:"truncate flex-1",children:[l.filename,k.has(l.filename)&&(0,b.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground bg-muted rounded-full px-1.5 py-0.5 font-normal",children:["v",j.get(l.id)??1]})]}),(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>window.open(C(l.id,h,!0),"_blank"),children:(0,b.jsx)(w,{className:"size-4"})})]})}),(0,b.jsx)(d.SheetBody,{className:(0,s.cn)("thin-scrollbar",z(l.content_type)&&"!p-0 !overflow-hidden"),children:(0,b.jsx)(D,{artifact:l,workspaceId:h})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.SheetHeader,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0 sm:hidden",onClick:()=>q(!1),children:(0,b.jsx)(G.ArrowLeft,{className:"size-4"})}),(0,b.jsx)(d.SheetTitle,{className:"flex-1",children:"Artifacts"})]})}),(0,b.jsx)(d.SheetBody,{className:"thin-scrollbar",children:0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No artifacts uploaded yet."}):(0,b.jsx)("div",{className:"space-y-1",children:g.map(a=>(0,b.jsxs)("button",{onClick:()=>m(a),className:"flex items-center gap-3 w-full rounded-lg px-3 py-2.5 text-left hover:bg-muted/50 transition-colors",children:[(0,b.jsx)(F.FileText,{className:"size-4 shrink-0 text-muted-foreground"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("p",{className:"text-sm font-medium truncate",children:[a.filename,k.has(a.filename)&&(0,b.jsxs)("span",{className:"ml-1.5 text-xs text-muted-foreground bg-muted rounded-full px-1.5 py-0.5 font-normal",children:["v",j.get(a.id)??1]})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[H(a.size)," · ",new Date(a.created_at).toLocaleString()]})]})]},a.id))})})]})]})})},"formatSize",0,H],207461),a.i(974936);var I=a.i(988024);a.i(735132);var J=a.i(325848),K=a.i(22902);let L="h-7 border-0 bg-transparent px-1.5 text-xs text-foreground hover:bg-accent transition-colors -ml-1.5",M=(0,s.cn)(L,"rounded-md outline-none focus-visible:bg-accent focus-visible:ring-0 appearance-none pr-6"),N=["todo","in_progress","review","done"];function O({agent:a,size:c=24}){let d=(0,J.parseAvatarUrl)(a?.avatar_url);return d?(0,b.jsx)(J.AvatarRenderer,{config:d,size:c,className:"shrink-0 rounded-full"}):(0,b.jsx)("span",{className:"flex shrink-0 items-center justify-center rounded-full border border-border bg-muted text-[11px] font-medium text-muted-foreground",style:{width:c,height:c},children:(a?.name??"?").slice(0,1).toUpperCase()})}function P({agent:a,size:c=24}){let d=a.email_handle?`${a.email_handle}@alook.ai`:"";return(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)(O,{agent:a,size:c}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[(0,b.jsx)("div",{className:"truncate text-xs font-medium",children:a.name}),d?(0,b.jsx)("div",{className:"truncate text-[11px] text-muted-foreground",children:d}):null]})]})}function Q({icon:a,children:c}){return(0,b.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,b.jsx)("span",{className:"inline-flex size-6 shrink-0 items-center justify-center text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:c})]})}function R({message:a}){return"event"===a.role?(0,b.jsx)("div",{className:"rounded-md border bg-muted/50 text-muted-foreground text-xs px-3 py-2",children:a.content}):(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-background/55 p-3",children:[(0,b.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"capitalize",children:a.role}),(0,b.jsx)("span",{children:new Date(a.created_at).toLocaleString()})]}),(0,b.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm wrap-break-word",children:(0,b.jsx)(u.Streamdown,{children:a.content})})]})}function S({comment:a,agents:c}){let d="agent"===a.author_type?c.find(b=>b.id===a.author_id)?.name??"Agent":"You";return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-background p-3",children:[(0,b.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium",children:d}),(0,b.jsx)("span",{children:new Date(a.created_at).toLocaleString()})]}),(0,b.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm wrap-break-word",children:(0,b.jsx)(u.Streamdown,{children:a.content})})]})}function T({artifacts:a,workspaceId:c,onArtifactClick:d}){if(0===a.length)return null;let e="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent";return(0,b.jsx)("div",{className:"space-y-1",children:a.map(a=>{let f=d&&B(a),g=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(m.File,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.filename}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:H(a.size)})]});return f?(0,b.jsx)("button",{type:"button",onClick:()=>d(a),className:(0,s.cn)(e,"w-full text-left"),children:g},a.id):(0,b.jsx)("a",{href:C(a.id,c,!0),target:"_blank",rel:"noopener noreferrer",className:e,children:g},a.id)})})}a.s(["IssueSheet",0,function({open:a,onOpenChange:i,agents:m,issue:u,detail:w,detailLoading:x,activeTask:y,traceTasks:z,submitting:A,defaultAgentId:B,slug:C,workspaceId:D,width:E=448,onWidthChange:F,draft:G,onDraftChange:H,onCreate:J,onUpdate:U,onStatusChange:V,onCommented:W,onDispatched:X,onArtifactClick:Y}){let Z,$,_=u?"detail":"create",[aa,ab]=(0,c.useState)(""),[ac,ad]=(0,c.useState)(""),[ae,af]=(0,c.useState)(B??""),[ag,ah]=(0,c.useState)(!1),[ai,aj]=(0,c.useState)(""),[ak,al]=(0,c.useState)(!1),[am,an]=(0,c.useState)(null),[ao,ap]=(0,c.useState)(!1),aq=(0,c.useRef)(null),ar=(0,c.useRef)(null),as=(0,c.useRef)(null),at=(0,c.useRef)(!1),au=y&&!["completed","failed","cancelled","superseded"].includes(y.status),av=z?.some(a=>["queued","dispatched","running"].includes(a.status))??!1;(0,c.useEffect)(()=>{a&&(u?(ab(u.title),ad(u.description??"")):(ab(G?.title??""),ad(G?.description??""),af(G?.agentId||B||"")))},[a,u?.id]),(0,c.useEffect)(()=>{"create"===_&&a&&H?.({title:aa,description:ac,agentId:ae})},[aa,ac,ae,_,a]),(0,c.useEffect)(()=>{as.current&&(as.current.scrollTop=as.current.scrollHeight)},[w?.messages?.length,w?.comments?.length,z?.length]);let aw=(0,c.useRef)(null),ax=(0,c.useRef)(U);(0,c.useEffect)(()=>{ax.current=U},[U]);let ay=(0,c.useRef)(aa);(0,c.useEffect)(()=>{ay.current=aa},[aa]);let az=(0,c.useRef)(ac);(0,c.useEffect)(()=>{az.current=ac},[ac]);let aA=(0,c.useRef)(u);(0,c.useEffect)(()=>{aA.current=u},[u]);let aB=(0,c.useCallback)(()=>{aw.current&&clearTimeout(aw.current),aw.current=null;let a=aA.current;if(!a)return;let b=ay.current!==a.title,c=az.current!==(a.description??"");if(!b&&!c||!ay.current.trim())return;let d={};b&&(d.title=ay.current.trim()),c&&(d.description=az.current.trim()),ax.current?.(a.id,d)},[]);(0,c.useEffect)(()=>{if("detail"!==_||!u||!a)return;let b=aa!==u.title,c=ac!==(u.description??"");if((b||c)&&aa.trim())return aw.current&&clearTimeout(aw.current),aw.current=setTimeout(aB,500),()=>{aw.current&&clearTimeout(aw.current)}},[aa,ac,_,u,a,aB]);let aC=(0,c.useRef)(a);(0,c.useEffect)(()=>{aC.current&&!a&&"detail"===_&&aB(),aC.current=a},[a,_,aB]);let aD=(0,c.useCallback)(a=>{let b=a??aq.current;b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)},[]);(0,c.useEffect)(()=>{requestAnimationFrame(()=>aD())},[aa,aD]);let aE=(0,c.useCallback)(a=>{a.preventDefault(),at.current=!0,a.target.setPointerCapture(a.pointerId)},[]),aF=(0,c.useCallback)(a=>{if(!at.current)return;let b=Math.min(.8*window.innerWidth,Math.max(320,window.innerWidth-a.clientX));F?.(b)},[F]),aG=(0,c.useCallback)(()=>{at.current=!1},[]),aH=async()=>{aa.trim()&&!A&&await J?.({agent_id:ae||void 0,title:aa.trim(),description:ac.trim()})},aI=async()=>{if(ai.trim()&&!ak&&u){al(!0);try{if(!(await fetch(`/api/issues/${u.id}/comments?workspace_id=${D}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ai.trim()})})).ok)throw Error("Failed to send comment");aj(""),W?.()}catch{t.toast.error("Failed to send comment")}finally{al(!1)}}},aJ=(0,c.useRef)(null),aK=(0,c.useCallback)(a=>{"Enter"===a.key&&a.shiftKey&&"create"===_&&(aJ.current&&aJ.current.contains(a.target)||(a.preventDefault(),a.stopPropagation(),aH()))},[_,aa,ac,ae,A]),aL="detail"===_&&u?.status==="todo",aM=m.find(a=>a.id===ae)??null,aN=u?.agent_id?m.find(a=>a.id===u.agent_id)??null:null,[aO,aP]=(0,c.useState)("issue");(0,c.useEffect)(()=>{aP("issue")},[u?.id,_]);let aQ=(0,b.jsx)(b.Fragment,{children:x?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)(g.Skeleton,{className:"h-12"}),(0,b.jsx)(g.Skeleton,{className:"h-8"}),(0,b.jsx)(g.Skeleton,{className:"h-12"})]}):0!==($=[...(w?.messages??[]).filter(a=>"event"===a.role).map(a=>({kind:"event",id:a.id,created_at:a.created_at,data:a})),...(w?.comments??[]).map(a=>({kind:"comment",id:a.id,created_at:a.created_at,data:a}))].sort((a,b)=>new Date(a.created_at).getTime()-new Date(b.created_at).getTime())).length||au?(0,b.jsxs)("div",{className:"relative pl-4",children:[(0,b.jsx)("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-border"}),(0,b.jsxs)("div",{className:"space-y-3",children:[$.map(a=>(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background bg-muted-foreground/40"}),"event"===a.kind?(0,b.jsx)(R,{message:a.data}):(0,b.jsx)(S,{comment:a.data,agents:m})]},a.id)),(au||av)&&((Z=z?.filter(a=>["queued","dispatched","running"].includes(a.status)))&&Z.length>0?Z.map(a=>{let c="running"===a.status;return(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:(0,s.cn)("absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background",c?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40")}),(0,b.jsx)("div",{className:(0,s.cn)("rounded-md border px-3 py-2.5",c?"border-emerald-500/30 bg-emerald-500/10":"border-border/60 bg-muted/30"),children:(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[a.agent&&(0,b.jsx)(O,{agent:{avatar_url:a.agent.avatarUrl,name:a.agent.name},size:16}),(0,b.jsxs)("span",{className:c?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground",children:[a.agent?.name??"Agent"," ",c?"is working":"— queued"]})]})})]},a.id)}):(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"absolute -left-4 top-2.5 size-2.5 rounded-full border-2 border-background bg-emerald-500 animate-pulse"}),(0,b.jsx)("div",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-2.5",children:(0,b.jsx)("div",{className:"flex items-center gap-2 text-xs text-emerald-600 dark:text-emerald-400",children:"Working"})})]}))]})]}):(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"No activity yet."})}),aR="detail"!==_||!u||aL||au||(0,I.isTerminalIssueStatus)(u.status)?null:(0,b.jsxs)("div",{className:"flex flex-col rounded-xl border bg-background/60 transition-colors duration-200 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",children:[(0,b.jsx)("textarea",{ref:aJ,placeholder:"Leave a comment...",value:ai,onChange:a=>aj(a.target.value),className:"w-full resize-none bg-transparent px-3.5 py-2.5 text-sm leading-relaxed outline-none placeholder:text-muted-foreground field-sizing-content min-h-15 max-h-32 thin-scrollbar overflow-y-auto",onKeyDown:a=>{"Enter"===a.key&&a.shiftKey&&(a.preventDefault(),aI())}}),(0,b.jsxs)("div",{className:"flex items-center justify-between px-2.5 pb-2 pt-0.5",children:[(0,b.jsx)("kbd",{className:"text-[11px] text-muted-foreground/50 font-sans select-none",children:"⇧↵"}),(0,b.jsx)(e.Button,{size:"icon-sm",onClick:aI,disabled:!ai.trim()||ak,className:(0,s.cn)("rounded-lg transition-opacity duration-200",!ai.trim()&&!ak&&"opacity-40"),children:ak?(0,b.jsx)(o.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(j,{className:"size-3.5"})})]})]}),aS=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"shrink-0 px-2 sm:px-3 pt-5 pb-1",children:(0,b.jsx)("textarea",{ref:a=>{aq.current=a,aD(a)},value:aa,onChange:a=>{ab(a.target.value),aD(a.target)},onKeyDown:a=>{if("Enter"===a.key&&!a.shiftKey){a.preventDefault();let b=ar.current?.querySelector('[contenteditable="true"]');b?.focus()}},placeholder:"create"===_?"New issue":"Untitled",autoFocus:"create"===_,rows:1,className:"w-full resize-none overflow-hidden rounded-none border-0 bg-transparent px-0 py-1 font-news text-2xl md:text-3xl font-medium leading-[1.2] tracking-tight shadow-none outline-none focus-visible:border-0 focus-visible:ring-0 focus-visible:ring-offset-0 placeholder:text-muted-foreground/40 placeholder:font-normal"})}),(0,b.jsxs)("div",{className:"shrink-0 space-y-1.5 px-2 sm:px-3 py-2",children:[(0,b.jsx)(Q,{icon:(0,b.jsx)(q.User,{className:"size-3.5"}),children:"create"===_||aL?(0,b.jsxs)(h.Popover,{open:ag,onOpenChange:ah,children:[(0,b.jsx)(h.PopoverTrigger,{render:(0,b.jsx)("button",{type:"button",disabled:A||ao,className:(0,s.cn)(L,"flex items-center gap-1.5 rounded-md")}),children:aM?(0,b.jsx)("span",{className:"truncate",children:aM.name}):(0,b.jsx)("span",{className:"text-muted-foreground/70",children:"Unassigned"})}),(0,b.jsxs)(h.PopoverContent,{align:"start",className:"max-h-64 w-72 overflow-y-auto thin-scrollbar p-1",children:[!aL&&(0,b.jsxs)("button",{type:"button",onClick:()=>{af(""),ah(!1)},className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"None (unassigned)"}),ae?null:(0,b.jsx)(k.Check,{className:"size-3.5 shrink-0"})]}),m.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{aL?an(a):af(a.id),ah(!1)},className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",children:[(0,b.jsx)(P,{agent:a,size:18}),ae===a.id?(0,b.jsx)(k.Check,{className:"size-3.5 shrink-0"}):null]},a.id))]})]}):(0,b.jsx)("span",{className:"text-xs truncate",children:aN?aN.name:(0,b.jsx)("span",{className:"text-muted-foreground/70",children:"Unassigned"})})}),"detail"===_&&u&&(0,b.jsx)(Q,{icon:(0,b.jsx)(l.CircleDot,{className:"size-3.5"}),children:(0,b.jsx)("select",{value:u.status,onChange:a=>{var b;return b=a.target.value,void(u&&b!==u.status&&V?.(u.id,b))},className:M,children:(aL?["todo","done"]:N).map(a=>(0,b.jsx)("option",{value:a,children:"done"===a?"Complete":a.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())},a))})}),"detail"===_&&u?.agent_id&&u?.conversation_id&&(0,b.jsx)(Q,{icon:(0,b.jsx)(p.MessageSquare,{className:"size-3.5"}),children:(0,b.jsx)(r.default,{href:`/w/${C}/agents/${u.agent_id}?conv=${u.conversation_id}${u.latest_task_id?`&task=${u.latest_task_id}`:""}`,className:(0,s.cn)(L,"inline-flex items-center rounded-md"),children:"Chat"})}),"detail"===_&&w?.traceId&&(0,b.jsx)(Q,{icon:(0,b.jsx)(n.GitBranch,{className:"size-3.5"}),children:(0,b.jsx)(r.default,{href:`/w/${C}/threads/${w.traceId}`,className:(0,s.cn)(L,"inline-flex items-center rounded-md"),children:"Thread"})})]}),(0,b.jsx)("div",{className:(0,s.cn)("px-2 sm:px-3 py-2 flex-1 min-h-0 overflow-y-auto thin-scrollbar"),ref:ar,children:(0,b.jsx)(f.MarkdownEditor,{value:ac,onChange:ad,placeholder:"Describe the issue...",minHeight:"create"===_?"10rem":"4rem",variant:"seamless",contentType:"markdown",agents:m},u?.id??"new")}),"detail"===_&&w?.artifacts&&w.artifacts.length>0&&(0,b.jsx)("div",{className:"shrink-0 px-2 sm:px-3 py-2",children:(0,b.jsx)(T,{artifacts:w.artifacts,workspaceId:D,onArtifactClick:Y})})]});return(0,b.jsxs)(d.Sheet,{open:a,onOpenChange:i,children:[(0,b.jsxs)(d.SheetContent,{side:"right",showCloseButton:!1,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 overflow-visible",style:{width:`min(${E}px, 100vw)`,maxWidth:"none"},children:[(0,b.jsx)("div",{onPointerDown:aE,onPointerMove:aF,onPointerUp:aG,onLostPointerCapture:aG,className:"hidden sm:block absolute -left-px top-0 bottom-0 w-1.5 cursor-col-resize z-10 hover:bg-primary/20 active:bg-primary/30 transition-colors rounded-l-xl"}),"detail"===_&&!aL&&(0,b.jsxs)("div",{className:"hidden lg:flex absolute right-full top-0 bottom-0 mr-2 w-90 flex-col rounded-xl border bg-background shadow-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"shrink-0 flex items-center border-b px-4 py-2.5",children:(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Activity"})}),(0,b.jsx)("div",{ref:as,className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar px-4 py-4 space-y-3",children:aQ}),aR&&(0,b.jsx)("div",{className:"shrink-0 border-t px-4 py-3",children:aR})]}),(0,b.jsx)(d.SheetTitle,{className:"sr-only",children:"create"===_?"New Issue":u?.title??"Issue"}),(0,b.jsxs)("div",{className:"flex flex-1 min-h-0 flex-col",onKeyDownCapture:aK,children:["detail"===_&&!aL&&(0,b.jsxs)("div",{className:"shrink-0 flex items-center gap-1 border-b px-2 py-1.5 lg:hidden",children:[(0,b.jsx)("button",{type:"button",onClick:()=>aP("issue"),className:(0,s.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors","issue"===aO?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:"Issue"}),(0,b.jsx)("button",{type:"button",onClick:()=>aP("activity"),className:(0,s.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors","activity"===aO?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:"Activity"})]}),(0,b.jsxs)(d.SheetBody,{className:"flex flex-col gap-0 p-0 overflow-hidden",children:[(0,b.jsx)("div",{className:(0,s.cn)("flex flex-col flex-1 min-h-0","detail"===_&&"activity"===aO&&"hidden lg:flex"),children:aS}),"detail"===_&&!aL&&"activity"===aO&&(0,b.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 lg:hidden",children:[(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar px-3 py-4 space-y-3",children:aQ}),aR&&(0,b.jsx)("div",{className:"shrink-0 border-t px-3 py-3",children:aR})]})]}),"create"===_&&(0,b.jsxs)(d.SheetFooter,{children:[(0,b.jsx)(e.Button,{variant:"outline",size:"sm",onClick:()=>i(!1),disabled:A,children:"Cancel"}),(0,b.jsxs)(e.Button,{size:"sm",onClick:aH,disabled:!aa.trim()||A,children:[A&&(0,b.jsx)(o.Loader2,{className:"mr-1.5 size-3.5 animate-spin"}),(0,b.jsxs)("kbd",{className:"mr-1 hidden sm:inline-flex items-center gap-0.5 font-sans font-medium leading-none opacity-60",children:[(0,b.jsx)("span",{children:"⇧"}),(0,b.jsx)("span",{children:"+"}),(0,b.jsx)("span",{children:"⏎"})]}),"Create"]})]})]})]}),(0,b.jsx)(K.ConfirmDialog,{open:!!am,onOpenChange:a=>{a||an(null)},title:"Run issue?",description:`This issue will be assigned to ${am?.name??"the agent"} and start running immediately.`,confirmLabel:"Run",loadingLabel:"Running...",confirmVariant:"default",loading:ao,onConfirm:async()=>{if(am&&u){ap(!0);try{await (0,v.updateIssue)(D,u.id,{agent_id:am.id}),an(null),X?.(u.id)}catch(a){t.toast.error(a instanceof Error?a.message:"Failed to dispatch issue"),an(null)}finally{ap(!1)}}}})]})}],963744)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_components_issues_issue-sheet_tsx_02fma1.._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[525132,659284,a=>{"use strict";var b,c,d=a.i(749314);a.s([],624035),a.i(624035);var e=a.i(437199),f=a.i(149080),g=a.i(500310),h=a.i(901496),i=a.i(485177);let j=e.createContext(void 0);function k(a){let b=e.useContext(j);if(void 0===b&&!a)throw Error((0,i.default)(72));return b}var l=a.i(95133),m=a.i(780332),n=a.i(935469),o=a.i(685748),p=a.i(643667);function q(a){return null!=a&&null!=a.clientX}var r=a.i(547950),s=a.i(663533),t=a.i(331700),u=a.i(588507),v=a.i(131675),w=a.i(915423),x=a.i(583108),y=a.i(980403),z=a.i(852629),A=a.i(874514),B=a.i(651427),C=a.i(453665);let D={...B.popupStoreSelectors,disabled:(0,w.createSelector)(a=>a.disabled),instantType:(0,w.createSelector)(a=>a.instantType),isInstantPhase:(0,w.createSelector)(a=>a.isInstantPhase),trackCursorAxis:(0,w.createSelector)(a=>a.trackCursorAxis),disableHoverablePopup:(0,w.createSelector)(a=>a.disableHoverablePopup),lastOpenChangeReason:(0,w.createSelector)(a=>a.openChangeReason),closeOnClick:(0,w.createSelector)(a=>a.closeOnClick),closeDelay:(0,w.createSelector)(a=>a.closeDelay),hasViewport:(0,w.createSelector)(a=>a.hasViewport)};class E extends x.ReactStore{constructor(a){super({...(0,B.createInitialPopupStoreState)(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1,...a},{popupRef:e.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new C.PopupTriggerMap},D)}setOpen=(a,b)=>{let c=b.reason,d=c===A.REASONS.triggerHover,e=a&&c===A.REASONS.triggerFocus,f=!a&&(c===A.REASONS.triggerPress||c===A.REASONS.escapeKey);if(b.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(a,b),b.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(a,b);let g=()=>{let d={open:a,openChangeReason:c};e?d.instantType="focus":f?d.instantType="dismiss":c===A.REASONS.triggerHover&&(d.instantType=void 0);let g=b.trigger?.id??null;(g||a)&&(d.activeTriggerId=g,d.activeTriggerElement=b.trigger??null),this.update(d)};d?v.flushSync(g):g()};static useStore(a,b){let c=(0,y.useRefWithInit)(()=>new E(b)).current,d=a??c,e=(0,z.useSyncedFloatingRootContext)({popupStore:d,onOpenChange:d.setOpen});return d.state.floatingRootContext=e,d}}let F=(0,f.fastComponent)(function(a){let{disabled:b=!1,defaultOpen:c=!1,open:f,disableHoverablePopup:i=!1,trackCursorAxis:k="none",actionsRef:v,onOpenChange:w,onOpenChangeComplete:x,handle:y,triggerId:z,defaultTriggerId:B=null,children:C}=a,D=E.useStore(y?.store,{open:c,openProp:f,activeTriggerId:B,triggerIdProp:z});(0,g.useOnFirstRender)(()=>{void 0===f&&!1===D.state.open&&!0===c&&D.update({open:!0,activeTriggerId:B})}),D.useControlledProp("openProp",f),D.useControlledProp("triggerIdProp",z),D.useContextCallback("onOpenChange",w),D.useContextCallback("onOpenChangeComplete",x);let F=D.useState("open"),G=!b&&F,H=D.useState("activeTriggerId"),I=D.useState("payload");D.useSyncedValues({trackCursorAxis:k,disableHoverablePopup:i}),(0,h.useIsoLayoutEffect)(()=>{F&&b&&D.setOpen(!1,(0,t.createChangeEventDetails)(A.REASONS.disabled))},[F,b,D]),D.useSyncedValue("disabled",b),(0,u.useImplicitActiveTrigger)(D);let{forceUnmount:J,transitionStatus:K}=(0,u.useOpenStateTransitions)(G,D),L=D.select("floatingRootContext"),M=D.useState("isInstantPhase"),N=D.useState("instantType"),O=D.useState("lastOpenChangeReason"),P=e.useRef(null);(0,h.useIsoLayoutEffect)(()=>{"ending"===K&&O===A.REASONS.none||"ending"!==K&&M?("delay"!==N&&(P.current=N),D.set("instantType","delay")):null!==P.current&&(D.set("instantType",P.current),P.current=null)},[K,M,O,N,D]),(0,h.useIsoLayoutEffect)(()=>{G&&null==H&&D.set("payload",void 0)},[D,H,G]);let Q=e.useCallback(()=>{D.setOpen(!1,(0,t.createChangeEventDetails)(A.REASONS.imperativeAction))},[D]);e.useImperativeHandle(v,()=>({unmount:J,close:Q}),[J,Q]);let R=(0,r.useDismiss)(L,{enabled:!b,referencePress:()=>D.select("closeOnClick")}),S=function(a,b={}){let c="rootStore"in a?a.rootStore:a,d=c.useState("open"),f=c.useState("floatingElement"),g=c.useState("domReferenceElement"),h=c.context.dataRef,{enabled:i=!0,axis:j="both"}=b,k=e.useRef(!1),r=e.useRef(null),[s,t]=e.useState(),[u,v]=e.useState([]),w=(0,n.useStableCallback)((a,b,d)=>{if(!k.current&&(!h.current.openEvent||q(h.current.openEvent))){var e,f;let i,k,l;c.set("positionReference",(e=d??g,f={x:a,y:b,axis:j,dataRef:h,pointerType:s},i=null,k=null,l=!1,{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},b="x"===f.axis||"both"===f.axis,c="y"===f.axis||"both"===f.axis,d=["mouseenter","mousemove"].includes(f.dataRef.current.openEvent?.type||"")&&"touch"!==f.pointerType,g=a.width,h=a.height,j=a.x,m=a.y;return null==i&&f.x&&b&&(i=a.x-f.x),null==k&&f.y&&c&&(k=a.y-f.y),j-=i||0,m-=k||0,g=0,h=0,!l||d?(g="y"===f.axis?a.width:0,h="x"===f.axis?a.height:0,j=b&&null!=f.x?f.x:j,m=c&&null!=f.y?f.y:m):l&&!d&&(h="x"===f.axis?a.height:h,g="y"===f.axis?a.width:g),l=!0,{width:g,height:h,x:j,y:m,top:m,right:j+g,bottom:m+h,left:j}}}))}}),x=(0,n.useStableCallback)(a=>{d?r.current||v([]):w(a.clientX,a.clientY,a.currentTarget)}),y=(0,p.isMouseLikePointerType)(s)?f:d,z=e.useCallback(()=>{if(!y||!i)return;let a=(0,l.getWindow)(f);if(!h.current.openEvent||q(h.current.openEvent))return r.current=(0,m.addEventListener)(a,"mousemove",function(a){let b=(0,o.getTarget)(a);(0,o.contains)(f,b)?(r.current?.(),r.current=null):w(a.clientX,a.clientY)}),()=>{r.current?.(),r.current=null};c.set("positionReference",g)},[y,i,f,h,g,c,w]);e.useEffect(()=>z(),[z,u]),e.useEffect(()=>{i&&!f&&(k.current=!1)},[i,f]),e.useEffect(()=>{!i&&d&&(k.current=!0)},[i,d]);let A=e.useMemo(()=>{function a(a){t(a.pointerType)}return{onPointerDown:a,onPointerEnter:a,onMouseMove:x,onMouseEnter:x}},[x]);return e.useMemo(()=>i?{reference:A,trigger:A}:{},[i,A])}(L,{enabled:!b&&"none"!==k,axis:"none"===k?void 0:k}),{getReferenceProps:T,getFloatingProps:U,getTriggerProps:V}=(0,s.useInteractions)([R,S]),W=e.useMemo(()=>T(),[T]),X=e.useMemo(()=>V(),[V]),Y=e.useMemo(()=>U(),[U]);return D.useSyncedValues({activeTriggerProps:W,inactiveTriggerProps:X,popupProps:Y}),(0,d.jsx)(j.Provider,{value:D,children:"function"==typeof C?C({payload:I}):C})});var G=a.i(827746),H=a.i(147909),I=a.i(423994);let J=e.createContext(void 0);var K=a.i(481480),L=a.i(622079),M=a.i(808680);let N=e.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new L.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function O(a){let{children:b,delay:c,timeoutMs:f=0}=a,g=e.useRef(c),h=e.useRef(c),i=e.useRef(null),j=e.useRef(null),k=(0,L.useTimeout)();return(0,d.jsx)(N.Provider,{value:e.useMemo(()=>({hasProvider:!0,delayRef:g,initialDelayRef:h,currentIdRef:i,timeoutMs:f,currentContextRef:j,timeout:k}),[f,k]),children:b})}var P=a.i(626120),Q=a.i(883281),R=a.i(55059),S=a.i(792826),T=a.i(598830);let U=Q.isMac&&Q.isSafari;function V(a,b={}){let c="rootStore"in a?a.rootStore:a,{events:d,dataRef:f}=c.context,{enabled:g=!0,delay:h}=b,i=e.useRef(!1),j=e.useRef(null),k=(0,L.useTimeout)(),n=e.useRef(!0);e.useEffect(()=>{let a=c.select("domReferenceElement");if(!g)return;let b=(0,l.getWindow)(a);return(0,P.mergeCleanups)((0,m.addEventListener)(b,"blur",function(){let a=c.select("domReferenceElement");!c.select("open")&&(0,l.isHTMLElement)(a)&&a===(0,o.activeElement)((0,R.ownerDocument)(a))&&(i.current=!0)}),U&&(0,m.addEventListener)(b,"keydown",function(){n.current=!0},!0),U&&(0,m.addEventListener)(b,"pointerdown",function(){n.current=!1},!0))},[c,g]),e.useEffect(()=>{if(g)return d.on("openchange",a),()=>{d.off("openchange",a)};function a(a){if(a.reason===A.REASONS.triggerPress||a.reason===A.REASONS.escapeKey){let a=c.select("domReferenceElement");(0,l.isElement)(a)&&(j.current=a,i.current=!0)}}},[d,g,c]);let p=e.useMemo(()=>({onMouseLeave(){i.current=!1,j.current=null},onFocus(a){let b=a.currentTarget;if(i.current){if(j.current===b)return;i.current=!1,j.current=null}let d=(0,o.getTarget)(a.nativeEvent);if((0,l.isElement)(d)){if(U&&!a.relatedTarget){if(!n.current&&!(0,S.isTypeableElement)(d))return}else if(!(0,S.matchesFocusVisible)(d))return}let e=(0,S.isTargetInsideEnabledTrigger)(a.relatedTarget,c.context.triggerElements),{nativeEvent:f,currentTarget:g}=a,m="function"==typeof h?h():h;c.select("open")&&e||0===m||void 0===m?c.setOpen(!0,(0,t.createChangeEventDetails)(A.REASONS.triggerFocus,f,g)):k.start(m,()=>{i.current||c.setOpen(!0,(0,t.createChangeEventDetails)(A.REASONS.triggerFocus,f,g))})},onBlur(a){i.current=!1,j.current=null;let b=a.relatedTarget,d=a.nativeEvent,e=(0,l.isElement)(b)&&b.hasAttribute((0,T.createAttribute)("focus-guard"))&&"outside"===b.getAttribute("data-type");k.start(0,()=>{let a=c.select("domReferenceElement"),g=(0,o.activeElement)((0,R.ownerDocument)(a));if(!b&&g===a||(0,o.contains)(f.current.floatingContext?.refs.floating.current,g)||(0,o.contains)(a,g)||e)return;let h=b??g;(0,S.isTargetInsideEnabledTrigger)(h,c.context.triggerElements)||c.setOpen(!1,(0,t.createChangeEventDetails)(A.REASONS.triggerFocus,d))})}}),[f,c,k,h]);return e.useMemo(()=>g?{reference:p,trigger:p}:{},[g,p])}a.s(["useFocus",0,V],659284);var W=a.i(503607);let X=((b={})[b.popupOpen=G.CommonTriggerDataAttributes.popupOpen]="popupOpen",b.triggerDisabled="data-trigger-disabled",b),Y=(0,f.fastComponentRef)(function(a,b){let{className:c,render:d,handle:f,payload:g,disabled:j,delay:l,closeOnClick:m=!0,closeDelay:n,id:o,style:p,...q}=a,r=k(!0),s=f?.store??r;if(!s)throw Error((0,i.default)(82));let v=(0,I.useBaseUiId)(o),w=s.useState("isTriggerActive",v),x=s.useState("isOpenedByTrigger",v),y=s.useState("floatingRootContext"),z=e.useRef(null),B=l??600,C=n??0,{registerTrigger:D,isMountedByThisTrigger:E}=(0,u.useTriggerDataForwarding)(v,z,s,{payload:g,closeOnClick:m,closeDelay:C}),F=e.useContext(J),{delayRef:L,isInstantPhase:O,hasProvider:P}=function(a,b={open:!1}){let c="rootStore"in a?a.rootStore:a,d=c.useState("floatingId"),{open:f}=b,{currentIdRef:g,delayRef:i,timeoutMs:j,initialDelayRef:k,currentContextRef:l,hasProvider:m,timeout:n}=e.useContext(N),[o,p]=e.useState(!1);return(0,h.useIsoLayoutEffect)(()=>{function a(){p(!1),l.current?.setIsInstantPhase(!1),g.current=null,l.current=null,i.current=k.current}if(g.current&&!f&&g.current===d){if(p(!1),j)return n.start(j,()=>{c.select("open")||g.current&&g.current!==d||a()}),()=>{n.clear()};a()}},[f,d,g,i,j,k,l,n,c]),(0,h.useIsoLayoutEffect)(()=>{if(!f)return;let a=l.current,b=g.current;n.clear(),l.current={onOpenChange:c.setOpen,setIsInstantPhase:p},g.current=d,i.current={open:0,close:(0,M.getDelay)(k.current,"close")},null!==b&&b!==d?(p(!0),a?.setIsInstantPhase(!0),a?.onOpenChange(!1,(0,t.createChangeEventDetails)(A.REASONS.none))):(p(!1),a?.setIsInstantPhase(!1))},[f,d,c,g,i,j,k,l,n]),(0,h.useIsoLayoutEffect)(()=>()=>{l.current=null},[l]),e.useMemo(()=>({hasProvider:m,delayRef:i,isInstantPhase:o}),[m,i,o])}(y,{open:x});s.useSyncedValue("isInstantPhase",O);let Q=s.useState("disabled"),R=j??Q,S=s.useState("trackCursorAxis"),T=s.useState("disableHoverablePopup"),U=(0,W.useHoverReferenceInteraction)(y,{enabled:!R,mouseOnly:!0,move:!1,handleClose:T||"both"===S?null:(0,K.safePolygon)(),restMs(){let a=F?.delay,b="object"==typeof L.current?L.current.open:void 0,c=B;return P&&(c=0!==b?l??a??B:0),c},delay(){let a="object"==typeof L.current?L.current.close:void 0,b=C;return null==n&&P&&(b=a),{close:b}},triggerElementRef:z,isActiveTrigger:w,isClosing:()=>"ending"===s.select("transitionStatus")}),Y=V(y,{enabled:!R}).reference,Z=s.useState("triggerProps",E);return(0,H.useRenderElement)("button",a,{state:{open:x},ref:[b,D,z],props:[U,Y,Z,{onPointerDown(){s.set("closeOnClick",m)},id:v,[X.triggerDisabled]:R?"":void 0},q],stateAttributesMapping:G.triggerOpenStateMapping})}),Z=e.createContext(void 0);var $=a.i(22278);let _=e.forwardRef(function(a,b){let{children:c,container:f,className:g,render:h,style:i,...j}=a,{portalNode:k,portalSubtree:l}=(0,$.useFloatingPortalNode)({container:f,ref:b,componentProps:a,elementProps:j});return l||k?(0,d.jsxs)(e.Fragment,{children:[l,k&&v.createPortal(c,k)]}):null}),aa=e.forwardRef(function(a,b){let{keepMounted:c=!1,...e}=a;return k().useState("mounted")||c?(0,d.jsx)(Z.Provider,{value:c,children:(0,d.jsx)(_,{ref:b,...e})}):null}),ab=e.createContext(void 0);function ac(){let a=e.useContext(ab);if(void 0===a)throw Error((0,i.default)(71));return a}var ad=a.i(374268),ae=a.i(966624),af=a.i(247035),ag=a.i(882544);let ah=e.forwardRef(function(a,b){let{render:c,className:f,anchor:g,positionMethod:h="absolute",side:j="top",align:l="center",sideOffset:m=0,alignOffset:n=0,collisionBoundary:o="clipping-ancestors",collisionPadding:p=5,arrowPadding:q=5,sticky:r=!1,disableAnchorTracking:s=!1,collisionAvoidance:t=ae.POPUP_COLLISION_AVOIDANCE,style:u,...v}=a,w=k(),x=function(){let a=e.useContext(Z);if(void 0===a)throw Error((0,i.default)(70));return a}(),y=w.useState("open"),z=w.useState("mounted"),A=w.useState("trackCursorAxis"),B=w.useState("disableHoverablePopup"),C=w.useState("floatingRootContext"),D=w.useState("instantType"),E=w.useState("transitionStatus"),F=w.useState("hasViewport"),G=(0,ad.useAnchorPositioning)({anchor:g,positionMethod:h,floatingRootContext:C,mounted:z,side:j,sideOffset:m,align:l,alignOffset:n,collisionBoundary:o,collisionPadding:p,sticky:r,arrowPadding:q,disableAnchorTracking:s,keepMounted:x,collisionAvoidance:t,adaptiveOrigin:F?af.adaptiveOrigin:void 0}),H=e.useMemo(()=>({open:y,side:G.side,align:G.align,anchorHidden:G.anchorHidden,instant:"none"!==A?"tracking-cursor":D}),[y,G.side,G.align,G.anchorHidden,A,D]),I=(0,ag.usePositioner)(a,H,{styles:G.positionerStyles,transitionStatus:E,props:v,refs:[b,w.useStateSetter("positionerElement")],hidden:!z,inert:!y||"both"===A||B});return(0,d.jsx)(ab.Provider,{value:G,children:I})});var ai=a.i(254464),aj=a.i(121102),ak=a.i(884864),al=a.i(238413);let am={...G.popupStateMapping,...ai.transitionStatusMapping},an=e.forwardRef(function(a,b){let{className:c,render:d,style:e,...f}=a,g=k(),{side:h,align:i}=ac(),j=g.useState("open"),l=g.useState("instantType"),m=g.useState("transitionStatus"),n=g.useState("popupProps"),o=g.useState("floatingRootContext");(0,aj.useOpenChangeComplete)({open:j,ref:g.context.popupRef,onComplete(){j&&g.context.onOpenChangeComplete?.(!0)}});let p=g.useState("disabled"),q=g.useState("closeDelay");return(0,al.useHoverFloatingInteraction)(o,{enabled:!p,closeDelay:q}),(0,H.useRenderElement)("div",a,{state:{open:j,side:h,align:i,instant:l,transitionStatus:m},ref:[b,g.context.popupRef,g.useStateSetter("popupElement")],props:[n,(0,ak.getDisabledMountTransitionStyles)(m),f],stateAttributesMapping:am})}),ao=e.forwardRef(function(a,b){let{className:c,render:d,style:e,...f}=a,g=k(),h=g.useState("open"),i=g.useState("instantType"),{arrowRef:j,side:l,align:m,arrowUncentered:n,arrowStyles:o}=ac();return(0,H.useRenderElement)("div",a,{state:{open:h,side:l,align:m,uncentered:n,instant:i},ref:[b,j],props:[{style:o,"aria-hidden":!0},f],stateAttributesMapping:G.popupStateMapping})}),ap=((c={}).popupWidth="--popup-width",c.popupHeight="--popup-height",c);var aq=a.i(761842);let ar={activationDirection:a=>a?{"data-activation-direction":a}:null},as=e.forwardRef(function(a,b){let{render:c,className:d,style:e,children:f,...g}=a,h=k(),i=ac(),j=h.useState("instantType"),{children:l,state:m}=(0,aq.usePopupViewport)({store:h,side:i.side,cssVars:ap,children:f}),n={activationDirection:m.activationDirection,transitioning:m.transitioning,instant:j};return(0,H.useRenderElement)("div",a,{state:n,ref:b,props:[g,{children:l}],stateAttributesMapping:ar})});class at{constructor(){this.store=new E}open(a){let b=a?this.store.context.triggerElements.getById(a):void 0;if(a&&!b)throw Error((0,i.default)(81,a));this.store.setOpen(!0,(0,t.createChangeEventDetails)(A.REASONS.imperativeAction,void 0,b))}close(){this.store.setOpen(!1,(0,t.createChangeEventDetails)(A.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}a.s(["Arrow",0,ao,"Handle",0,at,"Popup",0,an,"Portal",0,aa,"Positioner",0,ah,"Provider",0,function(a){let{delay:b,closeDelay:c,timeout:f=400}=a,g=e.useMemo(()=>({delay:b,closeDelay:c}),[b,c]),h=e.useMemo(()=>({open:b,close:c}),[b,c]);return(0,d.jsx)(J.Provider,{value:g,children:(0,d.jsx)(O,{delay:h,timeoutMs:f,children:a.children})})},"Root",0,F,"Trigger",0,Y,"Viewport",0,as,"createHandle",0,function(){return new at}],538653);var au=a.i(538653),au=au,av=a.i(75118);a.s(["Tooltip",0,function({...a}){return(0,d.jsx)(au.Root,{"data-slot":"tooltip",...a})},"TooltipContent",0,function({className:a,side:b="top",sideOffset:c=4,align:e="center",alignOffset:f=0,children:g,...h}){return(0,d.jsx)(au.Portal,{children:(0,d.jsx)(au.Positioner,{align:e,alignOffset:f,side:b,sideOffset:c,className:"isolate z-50",children:(0,d.jsxs)(au.Popup,{"data-slot":"tooltip-content",className:(0,av.cn)("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",a),...h,children:[g,(0,d.jsx)(au.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})},"TooltipProvider",0,function({delay:a=0,...b}){return(0,d.jsx)(au.Provider,{"data-slot":"tooltip-provider",delay:a,...b})},"TooltipTrigger",0,function({...a}){return(0,d.jsx)(au.Trigger,{"data-slot":"tooltip-trigger",...a})}],525132)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=src_web_src_components_ui_tooltip_tsx_01x-izi._.js.map
|