import{o as e}from"./rolldown-runtime-C_s2cVnS.js";import{Ir as t,a as n,r}from"./i18n-CsN8OUP9.js";import{S as i,l as a,t as o,v as s}from"./profile-DkxWhVLn.js";import{h as c,m as l,n as u}from"./vendor-react-nmZsNlRz.js";import{t as d}from"./utils-BRwGVQJx.js";var f=e(c(),1),p=u(),m=t(null);function h(e){let t=s(e);m.set(t===s(o.get())?null:t)}var g=s(o.get());o.subscribe(e=>{let t=s(e);t!==g&&(g=t,m.set(null))});var _=e(l(),1);function v(e){let t=(0,p.c)(6),{active:n,label:r,onSelect:i}=e,a=n?`border-(--ui-stroke-secondary) bg-(--ui-bg-tertiary) text-(--ui-text-primary)`:`border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) text-(--ui-text-tertiary) hover:bg-(--chrome-action-hover)`,o;t[0]===a?o=t[1]:(o=d(`rounded-full border px-3 py-1 text-[length:var(--conversation-caption-font-size)] transition`,a),t[0]=a,t[1]=o);let s;return t[2]!==r||t[3]!==i||t[4]!==o?(s=(0,_.jsx)(`button`,{className:o,onClick:i,type:`button`,children:r}),t[2]=r,t[3]=i,t[4]=o,t[5]=s):s=t[5],s}function y(e){let t=(0,p.c)(13),{className:i}=e,{t:c}=n(),l=c.settings.profileScope,u=r(m),g=r(o),y=r(a),x;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[0]=x):x=t[0],(0,f.useEffect)(b,x),y.length<2)return null;let S;if(t[1]!==g||t[2]!==i||t[3]!==u||t[4]!==y||t[5]!==l){let e=s(u??g),n;t[7]===i?n=t[8]:(n=d(`grid gap-2`,i),t[7]=i,t[8]=n);let r;t[9]===l.appliesTo?r=t[10]:(r=(0,_.jsx)(`div`,{className:`text-[length:var(--conversation-caption-font-size)] font-medium text-(--ui-text-secondary)`,children:l.appliesTo}),t[9]=l.appliesTo,t[10]=r);let a=y.map(t=>(0,_.jsx)(v,{active:s(t.name)===e,label:t.name,onSelect:()=>h(t.name)},t.name)),o;t[11]===a?o=t[12]:(o=(0,_.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:a}),t[11]=a,t[12]=o),S=(0,_.jsxs)(`div`,{className:n,children:[r,o,u===null?null:(0,_.jsx)(`p`,{className:`text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height) text-(--ui-text-tertiary)`,children:l.editsProfile(e)})]}),t[1]=g,t[2]=i,t[3]=u,t[4]=y,t[5]=l,t[6]=S}else S=t[6];return S}function b(){i().catch(x)}function x(){}export{m as n,y as t};