1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63495,349967,178263,667912,789321,e=>{"use strict";var t=e.i(843476),a=e.i(271645),r=e.i(174080),l=e.i(846932),n=e.i(88653),o=e.i(876239),s=e.i(928950),i=e.i(574520),c=e.i(231319);let d=a.forwardRef(function({title:e,titleId:t,...r},l){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))});e.s(["XMarkIcon",0,d],349967);let u=a.forwardRef(function({title:e,titleId:t,...r},l){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M12.75 12.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM7.5 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.25 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM9.75 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM10.5 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM12.75 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM14.25 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM15 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM16.5 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM15 12.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM16.5 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z"}),a.createElement("path",{fillRule:"evenodd",d:"M6.75 2.25A.75.75 0 0 1 7.5 3v1.5h9V3A.75.75 0 0 1 18 3v1.5h.75a3 3 0 0 1 3 3v11.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V7.5a3 3 0 0 1 3-3H6V3a.75.75 0 0 1 .75-.75Zm13.5 9a1.5 1.5 0 0 0-1.5-1.5H5.25a1.5 1.5 0 0 0-1.5 1.5v7.5a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5v-7.5Z",clipRule:"evenodd"}))}),m=a.forwardRef(function({title:e,titleId:t,...r},l){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M12.963 2.286a.75.75 0 0 0-1.071-.136 9.742 9.742 0 0 0-3.539 6.176 7.547 7.547 0 0 1-1.705-1.715.75.75 0 0 0-1.152-.082A9 9 0 1 0 15.68 4.534a7.46 7.46 0 0 1-2.717-2.248ZM15.75 14.25a3.75 3.75 0 1 1-7.313-1.172c.628.465 1.35.81 2.133 1a5.99 5.99 0 0 1 1.925-3.546 3.75 3.75 0 0 1 3.255 3.718Z",clipRule:"evenodd"}))});e.s(["FireIcon",0,m],178263);var p=e.i(694214),x=e.i(459808),h=e.i(224928),g=e.i(633576),f=e.i(586177),y=e.i(42473),b=e.i(107657);let v=a.forwardRef(function({title:e,titleId:t,...r},l){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 1 1 9 0v3.75M3.75 21.75h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H3.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"}))});e.s(["LockOpenIcon",0,v],667912);var k=e.i(782611),w=e.i(562718);let j=["from-pink-500 to-rose-400","from-orange-500 to-amber-400","from-violet-500 to-purple-400","from-blue-500 to-cyan-400","from-emerald-500 to-teal-400"],N=[{key:"all",label:"All",color:"#F97316"},{key:"user",label:"People",color:"#6366F1"},{key:"creator",label:"Creators",color:"#A855F7"},{key:"campaign",label:"Campaigns",color:"#EC4899"},{key:"organization",label:"Orgs",color:"#0EA5E9"},{key:"deal",label:"Deals",color:"#10B981"}],C=[{match:/\b(urgent|asap|rush|critical|p0)\b/i,value:"critical"},{match:/\b(high priority|important|p1)\b/i,value:"high"}
1];function E(e,t){return t?(e.slice(0,t.index)+e.slice(t.index+t.text.length)).replace(/\s+/g," ").trim():e}let D=[{key:"today",label:"Due today",keywords:["today","td"],icon:u,color:"#F59E0B",apply:e=>{let t;return{dueDate:((t=new Date).setHours(17,0,0,0),t.toISOString())}},badge:"TODAY"},{key:"tomorrow",label:"Due tomorrow",keywords:["tomorrow","tmrw","tm"],icon:u,color:"#0EA5E9",apply:()=>{let e;return{dueDate:((e=new Date).setDate(e.getDate()+1),e.setHours(17,0,0,0),e.toISOString())}},badge:"TMRW"},{key:"next-week",label:"Due next week",keywords:["next week","nextweek","nw"],icon:u,color:"#6366F1",apply:()=>{let e;return{dueDate:((e=new Date).setDate(e.getDate()+7),e.setHours(17,0,0,0),e.toISOString())}},badge:"+7D"},{key:"critical",label:"Mark critical",keywords:["critical","urgent","crit"],icon:m,color:"#EF4444",apply:()=>({priority:"critical"}),badge:"!!!"},{key:"high",label:"High priority",keywords:["high","hi"],icon:m,color:"#F59E0B",apply:()=>({priority:"high"}),badge:"!!"},{key:"medium",label:"Medium priority",keywords:["medium","med"],icon:m,color:"#6366F1",apply:()=>({priority:"medium"}),badge:"!"},{key:"low",label:"Low priority",keywords:["low"],icon:m,color:"var(--text-label)",apply:()=>({priority:"low"}),badge:"â"},{key:"done",label:"Mark as Done",keywords:["done","complete","finished"],icon:p.CheckCircleIcon,color:"#10B981",apply:()=>({status:"Done",statusColor:"#00c875"}),badge:"â"},{key:"in-progress",label:"Mark in progress",keywords:["in progress","inprogress","wip","doing"],icon:f.BoltIcon,color:"#F59E0B",apply:()=>({status:"In Progress",statusColor:"#fdab3d"}),badge:"WIP"}];function S({label:e,icon:a,color:r,hidden:l,showWhenEmpty:n}){return l&&!n?null:(0,t.jsxs)("div",{className:"px-3 pt-1.5 pb-0.5 flex items-center gap-1.5 text-[9px] font-bold uppercase tracking-[0.14em]",style:{color:r},children:[(0,t.jsx)(a,{className:"w-3 h-3"}),e]})}function A({count:e=2}){return(0,t.jsx)("div",{className:"space-y-1 px-3 py-1",children:Array.from({length:e}).map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2.5 py-1 animate-pulse",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-full bg-gray-200/70 dark:bg-zinc-800/70"}),(0,t.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,t.jsx)("div",{className:"h-2.5 bg-gray-200/70 dark:bg-zinc-800/70 rounded w-2/3"}),(0,t.jsx)("div",{className:"h-2 bg-gray-100 dark:bg-zinc-900 rounded w-1/3"})]})]},a))})}function z({label:e,hint:a}){return(0,t.jsxs)("div",{className:"px-4 py-5 text-center",children:[(0,t.jsx)("p",{className:"text-xs text-gray-500 dark:text-zinc-400 font-semibold",children:e}),a&&(0,t.jsx)("p",{className:"text-[10px] text-gray-400 dark:text-zinc-500 mt-0.5",children:a})]})}function $({avatar:e,primary:a,secondary:r,badge:l,badgeBg:n,badgeColor:o,isActive:s,onClick:i,onHover:c}){return(0,t.jsxs)("button",{onMouseDown:e=>{e.preventDefault(),i()},onMouseEnter:c,className:"w-full px-3 py-2 flex items-center gap-2.5 text-xs transition-all duration-100 relative",style:{background:s?"linear-gradient(90deg, rgba(249,115,22,0.08), rgba(236,72,153,0.06))":"transparent"},children:[s&&(0,t.jsx)("div",{className:"absolute left-0 top-1 bottom-1 w-[3px] rounded-r-full",style:{background:o}}),e,(0,t.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,t.jsx)("div",{className:"text-gray-800 dark:text-zinc-100 font-semibold truncate",children:a}),r&&(0,t.jsx)("div",{className:"text-[10px] text-gray-400 dark:text-zinc-500 truncate",children:r})]}),(0,t.jsx)("span",{className:"text-[8px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded flex-shrink-0",style:{background:n,color:o},children:l})]})}function I({icon:e,color:a,label:r,hint:n,onAccept:o,onDismiss:s}){return(0,t.jsxs)(l.motion.span,{initial:{opacity:0,scale:.92},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.92},transition:{duration:.14},className:"inline-flex items-center gap-1.5 pl-1 pr-1 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`linear-gradient(135deg, ${a}10, ${a}06)`,border:`1px solid ${a}30`,boxShadow:`0 1px 4px ${a}15`,color:a},children:[(0,t.jsx)("span",{className:"w-4 h-4 rounded-full flex items-center justify-center",style:{background:`${a}20`},children:(0,t.jsx)(e,{className:"w-2.5 h-2.5",style:{color:a}})}),(0,t.jsx)("button",{onMouseDown:e=>{e.preventDefault(),o()},className:"hover:underline",title:n,children:r}),(0,t.jsx)("button",{onMouseDown:e=>{e.preventDefault(),s()},className:"opacity-50 hover:opacity-100 ml-0.5",children:(0,t.jsx)(d,{className:"w-2.5 h-2.5"})})]})}function M({media:e,onRemove:a}){let r="image"===e.type||"gif"===e.type||e.mimeType?.startsWith("image/"),l="video"===e.type||e.mimeType?.startsWith("video/");return(0,t.jsxs)("div",{className:"relative rounded-md overflow-hidden flex-shrink-0",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-panel)"},children:[r?(0,t.jsx)("img",{src:e.url,alt:e.name||"Screenshot",className:"w-9 h-9 object-cover",loading:"lazy"}):l?(0,t.jsx)("video",{src:e.url,className:"w-9 h-9 object-cover",muted:!0,playsInl
1ine:!0,preload:"metadata"}):(0,t.jsx)("div",{className:"w-9 h-9 flex items-center justify-center",style:{background:"rgba(139,92,246,0.08)"},children:(0,t.jsx)(w.PhotoIcon,{className:"w-4 h-4 text-violet-500"})}),(0,t.jsx)("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:a,className:"absolute top-0.5 right-0.5 w-3.5 h-3.5 rounded-full flex items-center justify-center",style:{background:"var(--overlay-scrim-strong)",color:"white"},title:"Remove","aria-label":"Remove staged attachment",children:(0,t.jsx)(d,{className:"w-2.5 h-2.5"})})]})}function F({kind:e,label:a,image:r,onRemove:l}){let n={user:{bg:"rgba(99,102,241,0.08)",border:"rgba(99,102,241,0.18)",color:"#6366F1"},creator:{bg:"rgba(168,85,247,0.08)",border:"rgba(168,85,247,0.18)",color:"#A855F7"},campaign:{bg:"rgba(236,72,153,0.08)",border:"rgba(236,72,153,0.18)",color:"#EC4899"},organization:{bg:"rgba(14,165,233,0.08)",border:"rgba(14,165,233,0.18)",color:"#0EA5E9"},deal:{bg:"rgba(16,185,129,0.08)",border:"rgba(16,185,129,0.18)",color:"#10B981"}}[e];return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 pl-1 pr-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:n.bg,border:`1px solid ${n.border}`,color:n.color},children:[r?(0,t.jsx)("img",{src:r,alt:"",className:"w-4 h-4 rounded-full object-cover"}):(0,t.jsx)("div",{className:"w-4 h-4 rounded-full flex items-center justify-center",style:{background:n.bg},children:"campaign"===e?(0,t.jsx)(i.MegaphoneIcon,{className:"w-2.5 h-2.5",style:{color:n.color}}):"organization"===e?(0,t.jsx)(c.BuildingOffice2Icon,{className:"w-2.5 h-2.5",style:{color:n.color}}):"deal"===e?(0,t.jsx)(h.BriefcaseIcon,{className:"w-2.5 h-2.5",style:{color:n.color}}):(0,t.jsx)(s.UserCircleIcon,{className:"w-3 h-3",style:{color:n.color}})}),(0,t.jsx)("span",{className:"truncate max-w-[140px]",children:a}),(0,t.jsx)("button",{onClick:l,className:"opacity-60 hover:opacity-100 transition-opacity",children:(0,t.jsx)(d,{className:"w-2.5 h-2.5"})})]})}e.s(["default",0,function({teamMembers:e=[],defaultLinkedCampaign:p,defaultLinkedCreator:w,defaultOrganization:R,defaultParentDeal:B,placeholder:T="What needs to be done? Type naturally â dates, @ to tag, / for actions",onSubmit:L,onCancel:P,groupColor:O="#6366F1",autoFocus:_=!0,defaultPrivate:Z=!1,portalPopovers:U=!1,clearOnSubmit:q=!1}){let[W,H]=(0,a.useState)(!!Z),G=(0,a.useRef)(null),[K,V]=(0,a.useState)(null),Y=(0,a.useRef)(!1),[Q,X]=(0,a.useState)(""),[J,ee]=(0,a.useState)(null),[et,ea]=(0,a.useState)(null),[er,el]=(0,a.useState)("all"),[en,eo]=(0,a.useState)(-1),[es,ei]=(0,a.useState)(0),[ec,ed]=(0,a.useState)([]),[eu,em]=(0,a.useState)(w||null),[ep,ex]=(0,a.useState)(p||null),[eh,eg]=(0,a.useState)(R||null),[ef,ey]=(0,a.useState)(B||null),[eb,ev]=(0,a.useState)([]),[ek,ew]=(0,a.useState)({}),[ej,eN]=(0,a.useState)([]),[eC,eE]=(0,a.useState)(!1),[eD,eS]=(0,a.useState)(new Set),[eA,ez]=(0,a.useState)(!1),[e$,eI]=(0,a.useState)(!1),[eM,eF]=(0,a.useState)([]),[eR,eB]=(0,a.useState)([]),[eT,eL]=(0,a.useState)([]),[eP,eO]=(0,a.useState)(!1),e_=(0,a.useRef)(null),eZ=(0,a.useRef)(null),eU=(0,a.useRef)(null),[eq,eW]=(0,a.useState)([]),[eH,eG]=(0,a.useState)(!1);async function eK(e){let t=Array.from(e||[]).filter(e=>e.type?.startsWith("image/")||e.type?.startsWith("video/")||"application/pdf"===e.type);if(0!==t.length){eG(!0);try{let e=(await Promise.all(t.map(async e=>{try{let t=new FormData;t.append("file",e);let a=await fetch("/api/tasks/upload-attachment",{method:"POST",body:t});if(!a.ok)throw Error("upload_failed");return await a.json()}catch{return null}}))).filter(Boolean);if(0===e.length)return;eW(t=>[...t,...e])}finally{eG(!1)}}}(0,a.useEffect)(()=>{let e=e_.current;if(!e)return;let t=e.selectionStart,a=Q.slice(0,t),r=/(^|\s)@([A-Za-z0-9_.\- ]{0,30})$/.exec(a),l=/(^|\s)\/([A-Za-z0-9\- ]{0,20})$/.exec(a);r?(ee({query:r[2],start:t-r[2].length-1}),ea(null)):l?(ea({query:l[2],start:t-l[2].length-1}),ee(null)):(ee(null),ea(null))},[Q]);let eV=(0,a.useMemo)(()=>{if(!et)return[];let e=(et.query||"").toLowerCase().trim();return e?D.filter(t=>t.key.includes(e)||t.label.toLowerCase().includes(e)||t.keywords.some(t=>t.includes(e))):D},[et]);function eY(e){if(!et||!e_.current)return;let{start:t}=et,a=e_.current.selectionStart;X(Q.slice(0,t)+Q.slice(a)),ea(null);let r=e.apply();ew(e=>({...e,...r})),ev(t=>[...t.filter(e=>(!r.priority||!e.apply().priority)&&(!r.status||!e.apply().status)&&(!r.dueDate||!e.apply().dueDate)),e]),setTimeout(()=>{let e=e_.current;e&&(e.focus(),e.setSelectionRange(t,t))},0)}(0,a.useEffect)(()=>{ei(0)},[et?.query]),(0,a.useEffect)(()=>
1{if(!J){eF([]),eB([]),eN([]),eL([]),ez(!1),eI(!1),eE(!1),eO(!1);return}let e=J.query?.trim();if(!e){eF([]),eB([]),eN([]),eL([]);return}return eZ.current&&clearTimeout(eZ.current),ez(!0),eI(!0),eE(!0),eO(!0),eZ.current=setTimeout(()=>{fetch(`/api/searchAutoCompleteCreators?query=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():[]).then(e=>eF(Array.isArray(e)?e.slice(0,5):[])).catch(()=>eF([])).finally(()=>ez(!1)),fetch(`/api/searchAutoCompleteCampaigns?query=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():[]).then(e=>eB(Array.isArray(e)?e.slice(0,5):[])).catch(()=>eB([])).finally(()=>eI(!1)),fetch(`/api/searchAutoCompleteOrganizations?query=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():[]).then(e=>eN(Array.isArray(e)?e.slice(0,5):[])).catch(()=>eN([])).finally(()=>eE(!1)),fetch(`/api/searchAutoCompleteDeals?query=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():[]).then(e=>eL(Array.isArray(e)?e.slice(0,5):[])).catch(()=>eL([])).finally(()=>eO(!1))},180),()=>clearTimeout(eZ.current)},[J?.query]);let eQ=(0,a.useMemo)(()=>(function(e){if(!e||e.length<2)return null;try{let t=o.casual.parse(e,new Date,{forwardDate:!0});if(t&&t.length>0){let e=t[0];return{date:e.start.date(),text:e.text,index:e.index}}}catch{}return function(e){let t=e.match(/(^|\s)(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?(?=\s|$|[,.;!?])/);if(!t)return null;let a=parseInt(t[2],10)-1,r=parseInt(t[3],10),l=t[4]?parseInt(t[4],10):new Date().getFullYear();if(l<100&&(l+=2e3),a<0||a>11||r<1||r>31)return null;let n=new Date(l,a,r,12,0,0);return isNaN(n.getTime())?null:(!t[4]&&n.getTime()<Date.now()-432e5&&n.setFullYear(l+1),{date:n,text:t[4]?`${t[2]}/${t[3]}/${t[4]}`:`${t[2]}/${t[3]}`,index:t.index+t[1].length})}(e)})(Q),[Q]),eX=(0,a.useMemo)(()=>(function(e){if(!e)return null;for(let t of C){let a=e.match(t.match);if(a)return{value:t.value,text:a[0],index:a.index}}return null})(Q),[Q]),eJ=!!eQ&&!ek.dueDate&&!eD.has(`date:${eQ.text}`),e0=!!eX&&!ek.priority&&!eD.has(`priority:${eX.value}`),e1=(0,a.useMemo)(()=>{if(!J)return[];let t=(J.query||"").toLowerCase();return e.filter(e=>(e.name||"").toLowerCase().includes(t)||(e.email||"").toLowerCase().includes(t)).slice(0,6)},[J?.query,e]),e5=(0,a.useMemo)(()=>{if(!J)return[];let e=e1.map(e=>({kind:"user",item:e})),t=eM.map(e=>({kind:"creator",item:e})),a=eR.map(e=>({kind:"campaign",item:e})),r=ej.map(e=>({kind:"organization",item:e})),l=eT.map(e=>({kind:"deal",item:e}));return"user"===er?e:"creator"===er?t:"campaign"===er?a:"organization"===er?r:"deal"===er?l:[...e,...t,...r,...a,...l]},[er,e1,eM,eR,ej,eT,J]);(0,a.useEffect)(()=>{eo(-1)},[er,J?.query]);let e2=en>=0?en:e5.length>0?0:-1;function e7(e){if(!J||!e_.current)return;let{start:t}=J,a=e_.current.selectionStart,r=e.item;X(Q.slice(0,t)+Q.slice(a)),ee(null),"user"===e.kind?ed(e=>e.some(e=>e._id===r._id)?e:[...e,r]):"creator"===e.kind?em(r):"campaign"===e.kind?ex(r):"organization"===e.kind?eg(r):"deal"===e.kind&&ey(r),setTimeout(()=>{let e=e_.current;e&&(e.focus(),e.setSelectionRange(t,t))},0)}function e3(){if(Y.current)return;let e=Q,t=null;eJ&&eQ&&(t=eQ.date.toISOString(),e=E(e,eQ));let a=null;e0&&eX&&(a=eX.value);let r=e.trim().replace(/\s+/g," ")||(eq.length>0?"Attachment":"");if(!r)return void P?.();Y.current=!0;let l=L({title:r,assignees:ec.map(e=>e._id),linkedCreator:eu?._id||null,linkedCampaign:ep?._id||null,organization:eh?._id||null,parentDeal:ef?._id||null,isPrivate:W,media:eq,...ek,...t&&!ek.dueDate?{dueDate:t}:{},...a&&!ek.priority?{priority:a}:{}});Promise.resolve(l).catch(()=>{}).finally(()=>{Y.current=!1}),q&&Promise.resolve(l).then(e=>{!1!==e&&(X(""),ed([]),ey(B||null),ew({}),ev([]),eW([]),ee(null),ea(null),eS(new Set),e_.current?.focus())})}let e4={user:e1.length,creator:eM.length,campaign:eR.length,organization:ej.length,deal:eT.length},e6=!!(J||et);(0,a.useLayoutEffect)(()=>{if(!U||!e6)return;let e=()=>{let e=G.current?.getBoundingClientRect();e&&V({top:e.bottom,left:e.left,width:e.width})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[U,e6]);let e9=e=>U&&!("u"<typeof document)&&K?(0,r.createPortal)((0,t.jsx)("div",{style:{position:"fixed",top:K.top,left
1:K.left,width:K.width,height:0,zIndex:1e4,pointerEvents:"none"},children:(0,t.jsx)("div",{style:{position:"relative",pointerEvents:"auto"},children:e})}),document.body):e;return(0,t.jsxs)("div",{ref:G,className:"relative px-5 py-2.5 border-b",style:{borderColor:"var(--shadow-ambient-xs)",background:`${O}06`},children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-[3px] h-4 rounded-full flex-shrink-0",style:{background:O}}),(0,t.jsx)("input",{ref:e_,autoFocus:_,value:Q,onChange:e=>X(e.target.value),onKeyDown:function(e){if(et&&eV.length>0){if("ArrowDown"===e.key){e.preventDefault(),ei(e=>(e+1)%eV.length);return}if("ArrowUp"===e.key){e.preventDefault(),ei(e=>(e-1+eV.length)%eV.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault(),eY(eV[es]);return}if("Escape"===e.key){e.preventDefault(),e.stopPropagation(),ea(null);return}}if(J){if("Tab"===e.key){e.preventDefault();let t=N.findIndex(e=>e.key===er);el((e.shiftKey?N[(t-1+N.length)%N.length]:N[(t+1)%N.length]).key);return}if(e5.length>0){if("ArrowDown"===e.key){e.preventDefault(),eo(e=>(Math.max(e,0)+1)%e5.length);return}if("ArrowUp"===e.key){e.preventDefault(),eo(e=>e<=0?e5.length-1:e-1);return}if("Enter"===e.key){e.preventDefault(),e7(e5[e2]);return}}if("Enter"===e.key)return void e.preventDefault();if("Escape"===e.key){e.preventDefault(),e.stopPropagation(),ee(null);return}}"Enter"===e.key&&(e.preventDefault(),e3()),"Escape"===e.key&&P?.()},onPaste:e=>{let t=e.clipboardData?.items||[],a=[];for(let e of t)if("file"===e.kind){let t=e.getAsFile();t&&a.push(t)}a.length>0&&(e.preventDefault(),eK(a))},onBlur:e=>{let t=e.relatedTarget;!(t&&t.closest?.("[data-mention-popover]"))&&(J||e3())},placeholder:T,className:"flex-1 text-[13px] font-medium bg-transparent border-none focus:outline-none placeholder-gray-300 min-w-0 dark:placeholder-zinc-700",style:{color:"var(--text-secondary)"}}),(0,t.jsx)("input",{ref:eU,type:"file",accept:"image/*,video/*,application/pdf",multiple:!0,className:"hidden",onChange:e=>{let t=e.target.files;t&&t.length>0&&eK(t),e.target.value=""}}),(0,t.jsx)("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>eU.current?.click(),disabled:eH,"aria-label":"Attach screenshot, video, or PDF",title:"Attach screenshot, video, or PDF (or paste one into the field)",className:"inline-flex items-center justify-center w-7 h-7 rounded-full transition-all flex-shrink-0 disabled:opacity-50",style:{background:"rgba(99,102,241,0.10)",border:"1px solid rgba(99,102,241,0.25)",color:"#6366F1"},children:eH?(0,t.jsx)("span",{className:"w-3 h-3 border-2 border-indigo-300 border-t-indigo-500 rounded-full animate-spin"}):(0,t.jsx)(k.PaperClipIcon,{className:"w-3.5 h-3.5"})}),(0,t.jsxs)("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>H(e=>!e),"aria-pressed":W,title:W?"Private â only you and explicit assignees can see this task":"Shared with your agency â click to make private",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold transition-all flex-shrink-0",style:W?{background:"rgba(99,102,241,0.12)",border:"1px solid rgba(99,102,241,0.3)",color:"#6366F1"}:{background:"transparent",border:"1px solid var(--border-subtle)",color:"var(--text-tertiary)"},children:[W?(0,t.jsx)(b.LockClosedIcon,{className:"w-3 h-3"}):(0,t.jsx)(v,{className:"w-3 h-3"}),W?"Private":"Shared"]}),(0,t.jsx)("span",{className:"text-[10px] text-gray-300 dark:text-zinc-700 font-medium flex-shrink-0",children:J?e5.length>0?"ââ to navigate · Enter to select · Esc to close":"Keep typing to search · Esc to close":"@ to tag · Enter to save"})]}),eq.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 mt-2 pl-4",children:eq.map((e,a)=>(0,t.jsx)(M,{media:e,onRemove:()=>{eW(e=>e.filter((e,t)=>t!==a))}},`${e.url}-${a}`))}),(ec.length>0||eu||ep||eh||ef||eb.length>0)&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 mt-2 pl-4",children:[ec.map(e=>(0,t.jsx)(F,{kind:"user",label:e.name,onRemove:()=>{var t;return t=e._id,void ed(e=>e.filter(e=>e._id!==t))}},`u-${e._id}
1`)),eu&&(0,t.jsx)(F,{kind:"creator",label:eu.name,image:eu.image,onRemove:()=>em(null)}),ep&&(0,t.jsx)(F,{kind:"campaign",label:ep.name,image:ep.image,onRemove:()=>ex(null)}),eh&&(0,t.jsx)(F,{kind:"organization",label:eh.name,image:eh.image,onRemove:()=>eg(null)}),ef&&(0,t.jsx)(F,{kind:"deal",label:ef.name,onRemove:()=>ey(null)}),eb.map(e=>{let a=e.icon;return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 pl-1.5 pr-2 py-0.5 rounded-full text-[10px] font-bold",style:{background:`${e.color}12`,border:`1px solid ${e.color}30`,color:e.color},children:[(0,t.jsx)(a,{className:"w-3 h-3"}),e.label,(0,t.jsx)("button",{onClick:()=>(function(e){let t=D.find(t=>t.key===e);if(!t)return;ev(t=>t.filter(t=>t.key!==e));let a=t.apply();ew(e=>{let t={...e};return Object.keys(a).forEach(e=>delete t[e]),t})})(e.key),className:"opacity-60 hover:opacity-100 transition-opacity",children:(0,t.jsx)(d,{className:"w-2.5 h-2.5"})})]},e.key)})]}),(0,t.jsx)(n.AnimatePresence,{children:(eJ||e0)&&(0,t.jsxs)(l.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.18},className:"flex items-center gap-1.5 mt-2 pl-4 flex-wrap",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[9px] font-bold uppercase tracking-[0.14em] text-gray-400 dark:text-zinc-500 mr-1",children:[(0,t.jsx)(x.SparklesIcon,{className:"w-2.5 h-2.5",style:{color:"#A855F7"}}),"Suggestions"]}),eJ&&(0,t.jsx)(I,{icon:u,color:"#F59E0B",label:`Set due to ${eQ.date.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`,hint:`from "${eQ.text}"`,onAccept:()=>{ew(e=>({...e,dueDate:eQ.date.toISOString()})),X(e=>E(e,eQ))},onDismiss:()=>eS(e=>new Set(e).add(`date:${eQ.text}`))}),e0&&(0,t.jsx)(I,{icon:m,color:"critical"===eX.value?"#EF4444":"#F59E0B",label:`Mark ${eX.value}`,hint:`detected "${eX.text}"`,onAccept:()=>{ew(e=>({...e,priority:eX.value}))},onDismiss:()=>eS(e=>new Set(e).add(`priority:${eX.value}`))})]})}),e9((0,t.jsx)(n.AnimatePresence,{children:et&&eV.length>0&&(0,t.jsxs)(l.motion.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:{duration:.14},className:"absolute z-50 left-5 mt-1.5 rounded-2xl overflow-hidden",style:{top:"100%",maxWidth:"320px",background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 16px 48px var(--shadow-ambient-lg), 0 4px 12px var(--border-subtle)",border:"1px solid var(--border-subtle)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-2 border-b",style:{borderColor:"var(--surface-softer)"},children:[(0,t.jsx)(y.CommandLineIcon,{className:"w-3.5 h-3.5 text-orange-500"}),(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-gray-500 dark:text-zinc-400",children:"Slash command"})]}),(0,t.jsx)("div",{className:"max-h-72 overflow-y-auto py-1.5",children:eV.map((e,a)=>{let r=e.icon,l=a===es;return(0,t.jsxs)("button",{onMouseDown:t=>{t.preventDefault(),eY(e)},onMouseEnter:()=>ei(a),className:"w-full px-3 py-2 flex items-center gap-2.5 text-xs transition-all duration-100 relative",style:{background:l?`linear-gradient(90deg, ${e.color}12, transparent)`:"transparent"},children:[l&&(0,t.jsx)("div",{className:"absolute left-0 top-1 bottom-1 w-[3px] rounded-r-full",style:{background:e.color}}),(0,t.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:`${e.color}15`},children:(0,t.jsx)(r,{className:"w-3.5 h-3.5",style:{color:e.color}})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,t.jsx)("div",{className:"text-gray-800 dark:text-zinc-100 font-semibold truncate",children:e.label}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-400 dark:text-zinc-500 font-medium truncate",children:["/",e.key]})]}),(0,t.jsx)("span",{className:"text-[9px] font-black tracking-wider px-1.5 py-0.5 rounded flex-shrink-0",style:{background:`${e.color}15`,color:e.color},children:e.badge})]},e.key)})}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 text-[10px] font-medium border-t",style:{borderColor:"var(--surface-softer)",color:"var(--text-label)",background:"var(--surface-soft)"},children:[(0,t.jsx)("span",{children:"ââ navigate · âµ apply"}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(f.BoltIcon,{className:"w-3 h-3"}),"Quick action"]})]})]})})),e9((0,t.jsx)(n.AnimatePresence,{children:J&&(0,t.jsxs)(l.motion.div,{"data-mention-popover":!0,initial:{opacity:0,y:-4,scale:.98}
1,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:{duration:.14},tabIndex:-1,className:"absolute z-50 left-5 right-5 mt-1.5 rounded-2xl overflow-hidden",style:{top:"100%",maxWidth:"480px",background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 16px 48px var(--shadow-ambient-lg), 0 4px 12px var(--border-subtle)",border:"1px solid var(--border-subtle)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-0.5 px-2 pt-2 pb-1 border-b",style:{borderColor:"var(--surface-softer)"},children:[N.map(e=>{let a=er===e.key,r="all"===e.key?e4.user+e4.creator+e4.campaign+e4.organization+e4.deal:e4[e.key],l=("creator"===e.key||"all"===e.key)&&eA&&!eM.length,n=("campaign"===e.key||"all"===e.key)&&e$&&!eR.length;return(0,t.jsxs)("button",{onClick:()=>el(e.key),onMouseDown:e=>e.preventDefault(),className:"relative flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-bold rounded-lg transition-all duration-200",style:{color:a?"white":"var(--text-tertiary)",background:a?e.color:"transparent",boxShadow:a?`0 2px 8px ${e.color}40`:"none"},children:[e.label,r>0&&(0,t.jsx)("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded-full",style:{background:a?"var(--tint-strong)":"var(--border-subtle)",color:a?"white":"var(--text-label)"},children:r}),(l||n)&&(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{background:a?"white":e.color}})]},e.key)}),(0,t.jsx)("div",{className:"ml-auto pr-1",children:(0,t.jsx)("span",{className:"text-[9px] text-gray-400 dark:text-zinc-500 font-medium",children:"Tab to switch"})})]}),(0,t.jsxs)("div",{className:"max-h-72 overflow-y-auto py-1.5",children:[("all"===er||"user"===er)&&e1.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S,{label:"People",icon:g.UserGroupIcon,color:"#6366F1",hidden:"all"!==er}),e1.map((e,a)=>{let r;return(0,t.jsx)($,{isActive:a===e2,onClick:()=>e7({kind:"user",item:e}),onHover:()=>eo(a),avatar:(0,t.jsx)("div",{className:`w-7 h-7 rounded-full bg-gradient-to-br ${(r=(e.name||"").charCodeAt(0)%j.length,j[r])} flex items-center justify-center text-white text-[10px] font-bold shadow-sm`,children:(e.name||"?")[0].toUpperCase()}),primary:e.name,secondary:e.email,badge:"USER",badgeBg:"rgba(99,102,241,0.1)",badgeColor:"#6366F1"},`u-${e._id}`)})]}),("all"===er||"creator"===er)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S,{label:"Creators",icon:s.UserCircleIcon,color:"#A855F7",hidden:"all"!==er,showWhenEmpty:"all"===er&&(eA||0===eM.length)}),eA&&0===eM.length?(0,t.jsx)(A,{count:2}):0===eM.length&&"creator"===er?(0,t.jsx)(z,{label:"No creators match",hint:"Try a partial name or social handle"}):eM.map((e,a)=>{let r="creator"===er?a:e1.length+a;return(0,t.jsx)($,{isActive:r===e2,onClick:()=>e7({kind:"creator",item:e}),onHover:()=>eo(r),avatar:e.image?(0,t.jsx)("img",{src:e.image,alt:e.name,className:"w-7 h-7 rounded-full object-cover ring-1 ring-purple-200/60 shadow-sm"}):(0,t.jsx)("div",{className:"w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center",children:(0,t.jsx)(s.UserCircleIcon,{className:"w-4 h-4 text-purple-500"})}),primary:e.name,secondary:e.category||e.socials?.tiktok?.handle||e.socials?.instagram?.handle,badge:"CREATOR",badgeBg:"rgba(168,85,247,0.1)",badgeColor:"#A855F7"},`c-${e._id}`)})]}),("all"===er||"organization"===er)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S,{label:"Organizations",icon:c.BuildingOffice2Icon,color:"#0EA5E9",hidden:"all"!==er,showWhenEmpty:"all"===er&&(eC||0===ej.length)}),eC&&0===ej.length?(0,t.jsx)(A,{count:2}):0===ej.length&&"organization"===er?(0,t.jsx)(z,{label:"No organizations match",hint:"Type more of the brand or org name"}):ej.map((e,a)=>{let r="organization"===er?a:e1.length+eM.length+a;return(0,t.jsx)($,{isActive:r===e2,onClick:()=>e7({kind:"organization",item:e}),onHover:()=>eo(r),avatar:e.image?(0,t.jsx)("img",{src:e.image,alt:e.name,className:"w-7 h-7 rounded-full object-cover ring-1 ring-sky-200/60 shadow-sm"}):(0,t.jsx)("div",{className:"w-7 h-7 rounded-full bg-sky-100 flex items-center justify-center",children:(0,t.jsx)(c.BuildingOffice2Icon,{className:"w-3.5 h-3.5 text-sky-500"})}),primary:e.name,badge:"ORG",badgeBg:"rgba(14,165,233,0.1)",badgeColor:"#0EA5E9"},`o-${e._id}`)})]}),("all"===er||"campaign"===er)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S,{label:"Campaigns",icon:i.MegaphoneIcon,color:"#EC4899",hidden:"all"!==er,showWhenEmpty:"all"===er&&(e$||0===eR.length)}),e$&&0===eR.length?(0,t.jsx)(A,{count:2}):0===eR.length&&"campaign"===er?(0,t.jsx)(z,{label:"No campaigns match",hint:"Type more of the campaign name"}):eR.map((e,a)=>{let r="campaign"===er?a:e1.length+eM.length+ej.length+a;return(0,t.jsx)($,{isActive:r===e2,onClick:()=>e7({kind:"campaign",item:e}),onHover:()=>eo(r),avatar:e.image?(0,t.jsx)("img",{src:e.image,alt:e.name,className:"w-7 h-7 rounded-full object-cover ring-1 ring-pink-200/60 shadow-sm"}):(0,t.jsx)("div",{className:"w-7 h-7 rounded-full bg-pink-100 flex items-center justify-center",children:(0,t.jsx)(i.MegaphoneIcon,{className:"w-3.5 h-3.5 text-pink-500"})}),primary:e.name,badge:"CAMPAIGN",badgeBg:"rgba(236,72,153,0.1)",badgeColor:"#EC4899"},`cm-${e._id}`)})]}),("all"===er||"deal"===er)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S,{label:"Deals",icon:h.BriefcaseIcon,color:"#10B981",hidden:"all"!==er,showWhenEmpty:"all"===er&&(eP||0===eT.length)}),eP&&0===eT.length?(0,t.jsx)(A,{count:2}):0===eT.length&&"deal"===er?(0,t.jsx)(z,{label:"No deals match",hint:"Type more of the deal name"}):eT.map((e,a)=>{let r="deal"===er?a:e1.length+eM.length+ej.length+eR.length+a;return(0,t.jsx)($,{isActive:r===e2,onClick:()=>e7({kind:"deal",item:e}),onHover:()=>eo(r),avatar:(0,t.jsx)("div",{className:"w-7 h-7 rounded-full bg-emerald-100 dark:bg-emerald-500/15 flex items-center justify-center",children:(0,t.jsx)(h.BriefcaseIcon,{className:"w-3.5 h-3.5 text-emerald-500"})}
1),primary:e.name,secondary:[e.organizationName,e.stage].filter(Boolean).join(" · ")||void 0,badge:"DEAL",badgeBg:"rgba(16,185,129,0.1)",badgeColor:"#10B981"},`d-${e._id}`)})]}),"all"===er&&0===e1.length&&0===eM.length&&0===eR.length&&0===ej.length&&0===eT.length&&!eA&&!e$&&!eC&&!eP&&(0,t.jsx)(z,{label:`Nothing matches "${J.query}"`,hint:"Try a name, social handle, brand, campaign, or deal keyword"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 text-[10px] font-medium border-t",style:{borderColor:"var(--surface-softer)",color:"var(--text-label)",background:"var(--surface-soft)"},children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("kbd",{className:"px-1.5 py-0.5 rounded bg-white dark:bg-zinc-950 border border-gray-200 dark:border-zinc-800",children:"ââ"}),"navigate",(0,t.jsx)("kbd",{className:"ml-2 px-1.5 py-0.5 rounded bg-white dark:bg-zinc-950 border border-gray-200 dark:border-zinc-800",children:"âµ"}),"select"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(f.BoltIcon,{className:"w-3 h-3"}),"Smart link"]})]})]})}))]})}],63495);var R=e.i(247103),B=e.i(39875);e.s(["default",0,function({accent:e="#6366F1",onResolve:r,buttonLabel:o="Add a team"}){let[s,i]=(0,a.useState)(!1),[c,d]=(0,a.useState)([]),[u,m]=(0,a.useState)(!1),[p,x]=(0,a.useState)(null),[h,f]=(0,a.useState)(null),[y,b]=(0,a.useState)(""),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{function e(e){v.current&&!v.current.contains(e.target)&&(i(!1),b(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,a.useEffect)(()=>{s&&(m(!0),f(null),fetch("/api/teams").then(e=>{if(!e.ok)throw Error("Failed to load teams");return e.json()}).then(e=>d(e.teams||[])).catch(e=>f(e.message)).finally(()=>m(!1)))},[s]);let k=c.filter(e=>e.name?.toLowerCase().includes(y.toLowerCase())||e.description?.toLowerCase().includes(y.toLowerCase()));async function w(e){x(e._id);try{let t=await fetch(`/api/teams/${e._id}/resolve`);if(!t.ok)throw Error("Failed to resolve team members");let a=await t.json();r?.(a.members||[]),i(!1),b("")}catch(e){f(e.message)}finally{x(null)}}return(0,t.jsxs)("div",{ref:v,className:"relative",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!s),className:"flex items-center gap-1.5 text-[11px] font-semibold px-2.5 py-1.5 rounded-lg transition-all duration-200",style:{background:`${e}10`,border:`1px solid ${e}25`,color:e},children:[(0,t.jsx)(g.UserGroupIcon,{className:"w-3 h-3"}),o]}),(0,t.jsx)(n.AnimatePresence,{children:s&&(0,t.jsxs)(l.motion.div,{initial:{opacity:0,y:-4,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.96},transition:{duration:.14},className:"absolute z-50 right-0 mt-1.5 rounded-xl py-2 w-72",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 12px 40px var(--shadow-ambient-lg), 0 2px 8px var(--border-subtle)",border:"1px solid var(--border-default)"},children:[(0,t.jsx)("div",{className:"px-3 pb-2",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(B.MagnifyingGlassIcon,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400 dark:text-zinc-500 pointer-events-none"}
1),(0,t.jsx)("input",{autoFocus:!0,type:"text",placeholder:"Search teamsâ¦",value:y,onChange:e=>b(e.target.value),className:"w-full text-xs pl-7 pr-3 py-2 rounded-lg focus:outline-none focus:ring-2 transition-all text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)","--tw-ring-color":`${e}40`}})]})}),(0,t.jsxs)("div",{className:"max-h-56 overflow-y-auto",children:[u&&(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)("div",{className:"w-5 h-5 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:`${e}40`,borderTopColor:e}})}),!u&&h&&(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-red-500 dark:text-red-400 text-center",children:h}),!u&&!h&&0===k.length&&(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 dark:text-zinc-500 text-center",children:y?"No teams match":"No teams yet"}),!u&&!h&&k.map(a=>{let r=p===a._id,l=a.members?.length??0;return(0,t.jsxs)("button",{type:"button",onClick:()=>w(a),disabled:r,className:"w-full px-3 py-2.5 flex items-center gap-2.5 hover:bg-gray-50/80 dark:hover:bg-zinc-900/80 text-xs text-left disabled:opacity-60 transition-colors",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:`${e}14`},children:r?(0,t.jsx)("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:`${e}40`,borderTopColor:e}}):(0,t.jsx)(g.UserGroupIcon,{className:"w-3.5 h-3.5",style:{color:e}})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-gray-700 dark:text-zinc-300 font-semibold truncate",children:a.name}),(0,t.jsx)("div",{className:"text-[10px] text-gray-400 dark:text-zinc-500 mt-0.5",children:0===l?"No members":1===l?"1 member":`${l} members`})]}),l>0&&(0,t.jsxs)("div",{className:"flex -space-x-1.5 flex-shrink-0",children:[(a.members||[]).slice(0,3).map(e=>(0,t.jsx)("div",{title:e.name,className:"w-5 h-5 rounded-full ring-1 ring-white dark:ring-zinc-950 bg-gradient-to-br from-indigo-400 to-violet-500 flex items-center justify-center text-white text-[8px] font-bold flex-shrink-0",children:e.image?(0,t.jsx)("img",{src:e.image,alt:e.name||"",className:"w-full h-full rounded-full object-cover"}):(e.name||"?").charAt(0).toUpperCase()},e._id)),l>3&&(0,t.jsxs)("div",{className:"w-5 h-5 rounded-full ring-1 ring-white dark:ring-zinc-950 flex items-center justify-center text-[8px] font-bold flex-shrink-0",style:{background:`${e}20`,color:e},children:["+",l-3]})]}),(0,t.jsx)(R.ChevronRightIcon,{className:"w-3 h-3 text-gray-300 dark:text-zinc-600 flex-shrink-0"})]},a._id)})]}),!u&&!h&&k.length>0&&(0,t.jsx)("div",{className:"border-t mt-1 px-3 pt-2 pb-0.5",style:{borderColor:"var(--border-subtle)"},children:(0,t.jsx)("p",{className:"text-[9px] font-bold uppercase tracking-[0.12em] text-gray-400 dark:text-zinc-600",children:"Selecting a team merges its members in"})})]})})]})}],789321)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.