PageSourceSearch

https://www.thecloud.so/_next/static/chunks/0ukfy9m9w-ugo.js?dpl=dpl_2Mc4c8YmZ3hm8Eyv9iLtw2aGhBd7

js thecloud.so collected 2026-10-02 00:42:48 UTC 428,604 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,392576,191749,e=>{"use strict";let t;var n,a=e.i(931718),s=e.i(729386),i=e.i(439119),r=e.i(283164);e.i(857266);var l=e.i(246257);e.i(116233);var o=e.i(235893),d=e.i(699597),c=e.i(741790),u=e.i(512643),m=e.i(485954);e.i(553512);var p=e.i(108450),h=e.i(175386),f=e.i(220023),x=e.i(224012),g=e.i(841767),v=e.i(832877),b=e.i(960036);e.i(585184);var y=e.i(546121),j=e.i(632137),I=e.i(214877),_=e.i(923440),S=e.i(248499),k=e.i(467069);function w(e,t=120,n){e.style.height="auto";let a=Math.min(Math.max(e.scrollHeight,n??0),t);e.style.height=`${a}px`}let C="My Tasks";function T(){let e,t,n,a,i=(0,s.c)(10),{gate:o,isGuest:d}=(0,f.useGuestGate)();i[0]!==o?(e=o({}),i[0]=o,i[1]=e):e=i[1];let c=(0,l.useQuery)(r.api.preferences.queries.get,e),u=(0,l.useMutation)(r.api.preferences.sidebar_mutations.updateMyTasksLabel);if(d){let e;return i[2]===Symbol.for("react.memo_cache_sentinel")?(e={label:C,updateLabel:N},i[2]=e):e=i[2],e}i[3]!==c?(t=c?.myTasksLabel?.trim()?c.myTasksLabel.trim():C,i[3]=c,i[4]=t):t=i[4];let m=t;i[5]!==u?(n=async e=>{await u({label:e})},i[5]=u,i[6]=n):n=i[6];let p=n;return i[7]!==m||i[8]!==p?(a={label:m,updateLabel:p},i[7]=m,i[8]=p,i[9]=a):a=i[9],a}async function N(){}var D=e.i(526171);function L(e){let{value:t,selectionStart:n}=e;if(n>=2&&"--"===t.slice(n-2,n)){let a=t.slice(0,n-2)+"—"+t.slice(n),s=n-1;return requestAnimationFrame(()=>{e.setSelectionRange(s,s)}),a}return t}var A=e.i(159197);function P(e){let t=e.split("-");return new Date(Number(t[0]),Number(t[1])-1,Number(t[2]))}function O(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function E(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}let M={today:0,tomorrow:1,nextWeek:7};function R(e){return(0,A.formatDate)(P(e),{variant:"day"})}let z={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6},B={jan:0,january:0,feb:1,february:1,mar:2,march:2,apr:3,april:3,may:4,jun:5,june:5,jul:6,july:6,aug:7,august:7,sep:8,sept:8,september:8,oct:9,october:9,nov:10,november:10,dec:11,december:11},U=new Set(["at","on"]),F=/[.,;]+$/,G=/^(\d{1,2})(?::(\d{2}))?(am|pm)$/,q=/^([01]?\d|2[0-3]):([0-5]\d)$/,$=/^\d{4}-\d{2}-\d{2}$/,K=/^(\d{1,2})\/(\d{1,2})$/,Q=/^\d{1,2}$/,V=/\s+/;function W(e){return e.toLowerCase().replace(F,"")}function H(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Y(e,t,n){let a=new Date(e.getFullYear(),t,n);if(a.getMonth()!==t||a.getDate()!==n)return;if(O(a)>=O(e))return O(a);let s=new Date(e.getFullYear()+1,t,n);if(s.getMonth()===t)return O(s)}let X="My Tasks";var J=e.i(998873),Z=e.i(34388),ee=e.i(228206),et=e.i(791191);function en(e){let t,n,a,i,o,d,c,u,m,p,h,x,g,v=(0,s.c)(48),{gate:b,isGuest:y}=(0,f.useGuestGate)(),j=(0,et.useLocalTodosAdapter)(e),I=e?.teamId??null,_=e?.listId??null,S=e?.listIds,k=e?.personalInbox??!1,w=e?.date,C=e?.myTasks??!1;if(v[0]!==b||v[1]!==C||v[2]!==I){let e=I?{teamId:I}:{};t=l.useQuery,n=r.api.todos.queries.getAll,a=C?"skip":b(e),v[0]=b,v[1]=C,v[2]=I,v[3]=t,v[4]=n,v[5]=a}else t=v[3],n=v[4],a=v[5];let T=t(n,a);v[6]!==b||v[7]!==C?(i=C?b({}):"skip",v[6]=b,v[7]=C,v[8]=i):i=v[8];let N=(0,l.useQuery)(r.api.todos.assignments.getMyTasks,i),D=C?N:T;if(v[9]!==w||v[10]!==_||v[11]!==S||v[12]!==C||v[13]!==k||v[14]!==D){let e,t=D??[];if(C)e=t;else if(null!=w){let n;v[16]!==w?(n=e=>e.date===w,v[16]=w,v[17]=n):n=v[17],e=t.filter(n)}else if(null!=_){let n;v[18]!==_?(n=e=>e.listId===_,v[18]=_,v[19]=n):n=v[19],e=t.filter(n)}else if(null!=S){let n,a;v[20]!==S?(n=new Set(S),v[20]=S,v[21]=n):n=v[21];let s=n;v[22]!==s?(a=e=>null!=e.listId&&s.has(e.listId),v[22]=s,v[23]=a):a=v[23],e=t.filter(a)}else e=k?t.filter(ec):t;o=[...e].sort(ed),v[9]=w,v[10]=_,v[11]=S,v[12]=C,v[13]=k,v[14]=D,v[15]=o}else o=v[15];let L=o,A=(0,l.useMutation)(r.api.todos.mutations.create);v[24]!==A?(d=A.withOptimisticUpdate(eo),v[24]=A,v[25]=d):d=v[25];let P=d,O=(0,l.useMutation)(r.api.todos.mutations.toggle);v[26]!==O?(c=O.withOptimisticUpdate(el),v[26]=O,v[27]=c):c=v[27];let E=c,M=(0,J.useRecordDeletion)(),R=(0,l.useMutation)(r.api.todos.mutations.deleteTodo);v[28]!==R?(u=R.withOptimisticUpdate(er),v[28]=R,v[29]=u):u=v[29];let z=u;v[30]!==z||v[31]!==M?(m=e=>(M({kind:"task",id:e.id}),z(e)),v[30]=z,v[31]=M,v[32]=m):m=v[32];let B=m,U=(0,l.useMutation)(r.api.todos.mutations.update);v[33]!==U?(p=U.withOptimisticUpdate(ei),v[33]=U,v[34]=p):p=v[34];let F=p,G=(0,l.useMutation)(r.api.todos.batch_mutations.deleteAllInList);v[35]!==G?(h=G.withOptimisticUpdate(es),v[35]=G,v[36]=h):h=v[36];let q=h,$=(0,l.useMutation)(r.api.todos.batch_mutations.uncheckAllInList);v[37]!==$?(x=$.withOptimisticUpdate(ea),v[37]=$,v[38]=x):x=v[38];let K=x;if(y)return j;let Q=void 0===D;return v[39]!==P||v[40]!==q||v[41]!==B||v[42]!==Q||v[43]!==L||v[44]!==E||v[45]!==K||v[46]!==F?(g={todos:L,isLoading:Q,createTodo:P,toggleTodo:E,deleteTodo:B,updateTodo:F,deleteAllInList:q,uncheckAllInList:K},v[39]=P,v[40]=q,v[41]=B,v[42]=Q,v[43]=L,v[44]=E,v[45]=K,v[46]=F,v[47]=g):g=v[47],g}function ea(e,t){let n=Date.now();for(let{args:a,value:s}of e.getAllQueries(r.api.todos.queries.getAll))if(void 0!==s){let i=s.map(e=>e.listId===t.listId&&e.completed?{...e,completed:!1,updatedAt:n}:e);e.setQuery(r.api.todos.queries.getAll,a,i)}}function es(e,t){for(let{args:n,value:a}of e.getAllQueries(r.api.todos.queries.getAll))if(void 0!==a){let s=a.filter(e=>e.listId!==t.listId);e.setQuery(r.api.todos.queries.getAll,n,s)}}function ei(e,t){(0,ee.applyTodoUpdate)(e,t)}function er(e,t){for(let{args:n,value:a}of e.getAllQueries(r.api.todos.queries.getAll))void 0!==a&&e.setQuery(r.api.todos.queries.getAll,n,a.filter(e=>e._id!==t.id));for(let{args:n,value:a}of e.getAllQueries(r.api.todos.queries.getByDate))void 0!==a&&e.setQuery(r.api.todos.queries.getByDate,n,{...a,tasks:a.tasks.filter(e=>e._id!==t.id)})}function el(e,t){let n=Date.now();for(let{args:a,value:s}of e.getAllQueries(r.api.todos.queries.getAll))if(void 0!==s){let i=s.map(e=>e._id===t.id?{...e,completed:t.completed,updatedAt:n}:e);e.setQuery(r.api.todos.queries.getAll,a,i)}for(let{args:a,value:s}of e.getAllQueries(r.api.todos.queries.getByDate))if(void 0!==s){let i=s.tasks.map(e=>e._id===t.id?{...e,completed:t.completed,updatedAt:n}:e);e.setQuery(r.api.todos.queries.getByDate,a,{...s,tasks:i})}}function eo(e,t){let n=Date.now(),a={_id:(0,Z.assertId)(crypto.randomUUID()),_creationTime:n,text:t.text,completed:!1,listId:t.listId,teamId:t.teamId,date:t.date,createdAt:n,updatedAt:n,sortOrder:t.sortOrder??n};for(let{args:n,value:s}of e.getAllQueries(r.api.todos.queries.getAll))void 0!==s&&n.teamId===t.teamId&&e.setQuery(r.api.todos.queries.getAll,n,[...s,a]);if(t.date)for(let{args:n,value:s}of e.getAllQueries(r.api.todos.queries.getByDate))void 0!==s&&n.date===t.date&&e.setQuery(r.api.todos.queries.getByDate,n,{...s,tasks:[...s.tasks,a]})}function ed(e,t){return(e.sortOrder??e._creationTime)-(t.sortOrder??t._creationTime)}function ec(e){return null==e.listId}var eu=e.i(160444);e.i(339295);var em=e.i(101155),ep=e.i(867506),eh=e.i(729910),ef=e.i(459333);let ex={type:"emoji",value:"🗒️"};var eg=e.i(556317);function ev(e){let t,n=(0,s.c)(3),{displayIcon:i,showMyTasksIcon:r}=e;if(r){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:(0,a.jsx)(eg.MyTasksIcon,{size:14})}),n[0]=e):e=n[0],e}let l=i??ex;return n[1]!==l?(t=(0,a.jsx)("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:(0,a.jsx)(em.IconDisplay,{size:14,value:l})}),n[1]=l,n[2]=t):t=n[2],t}function eb(e){let t,n,i,r,l,o,d,c,u,m,p,h,f,x=(0,s.c)(46),{displayParentList:g,displayList:v,displayMyTasksInbox:b,displayTeamId:y,grouped:I,hasNoLists:_,myTasksLabel:S,onCreateList:k,onSelectParentListInbox:w,onSelectList:C,onSelectMyTasksInbox:T,onSelectTeamInbox:N}=e,D=void 0===S?X:S;x[0]!==y||x[1]!==I?(t=null==y?void 0:I.find(e=>e.team?._id===y),x[0]=y,x[1]=I,x[2]=t):t=x[2];let L=t;n=g?g.name:L?L.label:b?D:v?.name??(_?D:"Select list");let A=L?.team?.iconData??g?.iconData??v?.iconData,P=b??(null==g&&null==v&&null==L&&_);if(x[3]!==A||x[4]!==P?(i=(0,a.jsx)(ev,{displayIcon:A,showMyTasksIcon:P}),x[3]=A,x[4]=P,x[5]=i):i=x[5],x[6]!==n?(r=(0,a.jsx)("span",{className:"max-w-[120px] truncate",children:n}),x[6]=n,x[7]=r):r=x[7],x[8]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(eh.ChevronDown,{className:"h-3 w-3 shrink-0 opacity-60"}),x[8]=l):l=x[8],x[9]!==i||x[10]!==r?(o=(0,a.jsxs)(eu.DropdownMenuTrigger,{"aria-label":"Choose list",className:"inline-flex items-center gap-1.5 rounded-lg bg-surface px-2 py-1.5 text-muted-foreground text-xs outline-none transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",type:"button",children:[i,r,l]}),x[9]=i,x[10]=r,x[11]=o):o=x[11],x[12]!==b||x[13]!==g||x[14]!==_?(d=_&&!g&&!b&&(0,a.jsx)(eu.DropdownMenuItem,{className:"text-muted-foreground",disabled:!0,children:(0,a.jsx)("span",{className:"truncate",children:X})}),x[12]=b,x[13]=g,x[14]=_,x[15]=d):d=x[15],x[16]!==v||x[17]!==b||x[18]!==g?._id||x[19]!==y||x[20]!==I||x[21]!==C||x[22]!==T||x[23]!==w||x[24]!==N){let e;x[26]!==v||x[27]!==b||x[28]!==g?._id||x[29]!==y||x[30]!==C||x[31]!==T||x[32]!==w||x[33]!==N?(e=(e,t)=>{let n=null!=e.parentList,s="my-tasks"===e.key,i=null!=e.team,r=n&&g?._id===e.parentList?._id&&null==v,l=s&&b,o=i&&y===e.team?._id&&null==v,d=n&&w||s&&T||i&&N,c=r||l||o,u=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:s?(0,a.jsx)(eg.MyTasksIcon,{size:14}):(0,a.jsx)(em.IconDisplay,{size:14,value:e.parentList?.iconData??e.team?.iconData??{type:"lucide",name:"folder-open"}})}),(0,a.jsx)("span",{className:"truncate",children:e.label}),c&&(0,a.jsx)(ep.Check,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-primary"})]});return(0,a.jsxs)("div",{children:[t>0&&(0,a.jsx)(eu.DropdownMenuSeparator,{}),d?(0,a.jsx)(eu.DropdownMenuItem,{"aria-selected":c,className:(0,j.cn)("flex items-center gap-2 font-medium",c&&"bg-accent text-accent-foreground"),onClick:()=>{n&&e.parentList?w?.(e.parentList._id):s?T?.():i&&e.team&&N?.(e.team._id)},children:u}):(0,a.jsx)("p",{className:"flex items-center gap-2 px-1.5 py-1 font-medium text-muted-foreground
1/70 text-xs",children:u}),e.lists.map(e=>{let t=v?._id===e._id;return(0,a.jsxs)(eu.DropdownMenuItem,{"aria-selected":t,className:(0,j.cn)("flex items-center gap-2",t&&"bg-accent text-accent-foreground"),onClick:()=>C(e._id),children:[(0,a.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:(0,a.jsx)(em.IconDisplay,{size:14,value:e.iconData??ex})}),(0,a.jsx)("span",{className:"truncate",children:e.name}),t&&(0,a.jsx)(ep.Check,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-primary"})]},e._id)})]},e.key)},x[26]=v,x[27]=b,x[28]=g?._id,x[29]=y,x[30]=C,x[31]=T,x[32]=w,x[33]=N,x[34]=e):e=x[34],c=I.map(e),x[16]=v,x[17]=b,x[18]=g?._id,x[19]=y,x[20]=I,x[21]=C,x[22]=T,x[23]=w,x[24]=N,x[25]=c}else c=x[25];return x[35]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)(eu.DropdownMenuSeparator,{}),x[35]=u):u=x[35],x[36]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ef.Plus,{className:"mr-2 h-3.5 w-3.5"}),x[36]=m):m=x[36],x[37]!==k?(p=(0,a.jsxs)(eu.DropdownMenuItem,{onClick:k,children:[m,"Create new list"]}),x[37]=k,x[38]=p):p=x[38],x[39]!==p||x[40]!==d||x[41]!==c?(h=(0,a.jsxs)(eu.DropdownMenuContent,{align:"end",children:[d,c,u,p]}),x[39]=p,x[40]=d,x[41]=c,x[42]=h):h=x[42],x[43]!==h||x[44]!==o?(f=(0,a.jsxs)(eu.DropdownMenu,{children:[o,h]}),x[43]=h,x[44]=o,x[45]=f):f=x[45],f}var ey=e.i(21079),ej=e.i(535352),eI=e.i(400810),e_=e.i(314149);function eS(e){(0,e_.showLimitReachedToast)("list",e,{description:"Upgrade your plan to create more lists."})}var ek=e.i(884171),ew=e.i(943637),eC=e.i(745110),eT=e.i(985067);function eN(e){let t,n,i,r,l=(0,s.c)(9),{staged:o}=e;if((0,eT.isImageType)(o.mimeType)||o.previewUrl.startsWith("data:image/")){let e;return l[0]!==o.previewUrl?(e=(0,a.jsx)("img",{alt:"",className:"h-full w-full object-cover",height:48,src:o.previewUrl,width:48}),l[0]=o.previewUrl,l[1]=e):e=l[1],e}l[2]!==o.file.name?(t=o.file.name.split(".").pop()?.toUpperCase().slice(0,4)??"",l[2]=o.file.name,l[3]=t):t=l[3];let d=t;return l[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(ew.FileTextIcon,{className:"h-5 w-5"}),l[4]=n):n=l[4],l[5]!==d?(i=d&&(0,a.jsx)("span",{className:"font-medium text-[8px] leading-none",children:d}),l[5]=d,l[6]=i):i=l[6],l[7]!==i?(r=(0,a.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-0.5 text-muted-foreground",children:[n,i]}),l[7]=i,l[8]=r):r=l[8],r}function eD(e){let t,n,i,r=(0,s.c)(10),{isUploading:l,onRemove:o,stagedFiles:d}=e;if(0===d.length)return null;if(r[0]!==o||r[1]!==d){let e;r[3]!==o?(e=e=>(0,a.jsxs)("div",{className:"group/staged relative shrink-0 pt-3 pr-2",children:[(0,a.jsx)("div",{className:"h-12 w-12 overflow-hidden rounded-md border border-border/50 bg-muted/30",children:(0,a.jsx)(eN,{staged:e})}),(0,a.jsx)("button",{className:"absolute top-1 right-0 z-10 flex h-4 w-4 items-center justify-center rounded-full bg-background text-muted-foreground opacity-0 shadow-sm ring-1 ring-border transition-opacity hover:text-foreground group-hover/staged:opacity-100",onClick:()=>o(e.id),type:"button",children:(0,a.jsx)(eC.XIcon,{className:"h-2.5 w-2.5"})})]},e.id),r[3]=o,r[4]=e):e=r[4],t=d.map(e),r[0]=o,r[1]=d,r[2]=t}else t=r[2];return r[5]!==l?(n=l&&(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border border-border/50 bg-muted/30"}),r[5]=l,r[6]=n):n=r[6],r[7]!==t||r[8]!==n?(i=(0,a.jsxs)("div",{className:"no-scrollbar mb-1.5 flex gap-1.5 overflow-x-auto",children:[t,n]}),r[7]=t,r[8]=n,r[9]=i):i=r[9],i}var eL=e.i(341965),eA=e.i(806281),eP=e.i(444485);let eO=/\s+/;function eE(e){if(!e)return"?";let t=e.trim().split(eO);return((t[0]?.[0]??"")+(t[1]?.[0]??"")).toUpperCase()||"?"}function eM(e){if(e.iconData?.type==="image")return e.iconData.url}let eR="!size-[1.125rem]",ez="text-[9px]";function eB(e){let t,n,i,r,l,o,d=(0,s.c)(17),{assignees:c,size:u}=e,m=void 0===u?"sm":u;if(0===c.length)return null;if(d[0]!==c||d[1]!==m){let e,s=c.slice(0,3);i=c.length-s.length;let l=(n="sm"===m)?eR:void 0,o=n?ez:void 0;t=eP.AvatarGroup,d[6]!==l||d[7]!==o||d[8]!==m?(e=e=>{let t=eM(e);return(0,a.jsxs)(eP.Avatar,{className:l,size:m,children:[t?(0,a.jsx)(eP.AvatarImage,{alt:e.displayName??"Assignee",src:t}):null,(0,a.jsx)(eP.AvatarFallback,{className:o,children:eE(e.displayName)})]},e.userId)},d[6]=l,d[7]=o,d[8]=m,d[9]=e):e=d[9],r=s.map(e),d[0]=c,d[1]=m,d[2]=t,d[3]=n,d[4]=i,d[5]=r}
1else t=d[2],n=d[3],i=d[4],r=d[5];return d[10]!==n||d[11]!==i?(l=i>0&&(0,a.jsxs)(eP.AvatarGroupCount,{className:n?`${eR} ${ez}`:void 0,children:["+",i]}),d[10]=n,d[11]=i,d[12]=l):l=d[12],d[13]!==t||d[14]!==r||d[15]!==l?(o=(0,a.jsxs)(t,{children:[r,l]}),d[13]=t,d[14]=r,d[15]=l,d[16]=o):o=d[16],o}function eU(e){let t,n,i,r,l,o,c,u,p=(0,s.c)(31),{members:h,onToggle:f,selectedIds:x}=e,[g,v]=(0,m.useState)("");if(p[0]!==h||p[1]!==f||p[2]!==g||p[3]!==x){let e,s,c,u;p[10]!==g?(e=e=>0===g.length||(e.displayName??"").toLowerCase().includes(g.toLowerCase()),p[10]=g,p[11]=e):e=p[11];let m=h.filter(e);p[12]!==x?(s=new Set(x),p[12]=x,p[13]=s):s=p[13];let b=s;i="flex flex-col gap-2",p[14]===Symbol.for("react.memo_cache_sentinel")?(c=e=>v(e.target.value),p[14]=c):c=p[14],p[15]!==g?(r=(0,a.jsx)(ey.Input,{autoFocus:!0,onChange:c,placeholder:"Search members...",value:g}),p[15]=g,p[16]=r):r=p[16],p[17]!==h.length?(l=0===h.length&&(0,a.jsx)(d.Text,{variant:"bodyMuted",children:"No members available."}),p[17]=h.length,p[18]=l):l=p[18],o=h.length>0&&0===m.length&&(0,a.jsx)(d.Text,{variant:"bodyMuted",children:"No matches."}),t="flex max-h-64 flex-col gap-0.5 overflow-y-auto",p[19]!==f||p[20]!==b?(u=e=>{let t=b.has(e.userId),n=eM(e);return(0,a.jsxs)("button",{className:(0,j.cn)("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-surface-hover",t&&"bg-surface-hover"),"data-selected":t,onClick:()=>f(e.userId),type:"button",children:[(0,a.jsxs)(eP.Avatar,{size:"sm",children:[n?(0,a.jsx)(eP.AvatarImage,{alt:e.displayName??"Member",src:n}):null,(0,a.jsx)(eP.AvatarFallback,{children:eE(e.displayName)})]}),(0,a.jsx)(d.Text,{as:"span",className:"flex-1",variant:"label",children:e.displayName??e.userId}),t&&(0,a.jsx)(ep.Check,{className:"h-4 w-4 text-primary"})]},e.userId)},p[19]=f,p[20]=b,p[21]=u):u=p[21],n=m.map(u),p[0]=h,p[1]=f,p[2]=g,p[3]=x,p[4]=t,p[5]=n,p[6]=i,p[7]=r,p[8]=l,p[9]=o}else t=p[4],n=p[5],i=p[6],r=p[7],l=p[8],o=p[9];return p[22]!==t||p[23]!==n?(c=(0,a.jsx)("div",{className:t,children:n}),p[22]=t,p[23]=n,p[24]=c):c=p[24],p[25]!==i||p[26]!==r||p[27]!==l||p[28]!==o||p[29]!==c?(u=(0,a.jsxs)("div",{className:i,children:[r,l,o,c]}),p[25]=i,p[26]=r,p[27]=l,p[28]=o,p[29]=c,p[30]=u):u=p[30],u}function eF(e){let t,n=(0,s.c)(4),{listId:i,onChange:r,selectedAssignees:l}=e;return i?(n[0]!==i||n[1]!==r||n[2]!==l?(t=(0,a.jsx)(eG,{listId:i,onChange:r,selectedAssignees:l}),n[0]=i,n[1]=r,n[2]=l,n[3]=t):t=n[3],t):null}function eG(e){let t,n,i,o,d,c,u,m=(0,s.c)(22),{listId:p,onChange:h,selectedAssignees:x}=e,{gate:g}=(0,f.useGuestGate)();m[0]!==g||m[1]!==p?(t=g({listId:p}),m[0]=g,m[1]=p,m[2]=t):t=m[2];let v=(0,l.useQuery)(r.api.todos.assignments.getAssignableMembers,t);m[3]!==x?(n=x.map(eq),m[3]=x,m[4]=n):n=m[4];let b=n,y=0===x.length;m[5]!==v||m[6]!==h||m[7]!==x||m[8]!==b?(i=e=>{b.includes(e)?h(x.filter(t=>t.userId!==e)):h([...x,(v??[]).find(t=>t.userId===e)??{userId:e}])},m[5]=v,m[6]=h,m[7]=x,m[8]=b,m[9]=i):i=m[9];let j=i;return m[10]!==y||m[11]!==x?(o=(0,a.jsx)(eL.PopoverTrigger,{"aria-label":"Assign members",className:"inline-flex h-7 min-w-7 shrink-0 cursor-pointer select-none items-center justify-center rounded-md px-1 text-muted-foreground outline-none transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",title:"Assign members",children:y?(0,a.jsx)(eA.UserPlus,{className:"h-3.5 w-3.5"}):(0,a.jsx)(eB,{assignees:x,size:"sm"})}),m[10]=y,m[11]=x,m[12]=o):o=m[12],m[13]!==v?(d=v??[],m[13]=v,m[14]=d):d=m[14],m[15]!==j||m[16]!==b||m[17]!==d?(c=(0,a.jsx)(eL.PopoverContent,{align:"end",side:"top",children:(0,a.jsx)(eU,{members:d,onToggle:j,selectedIds:b})}),m[15]=j,m[16]=b,m[17]=d,m[18]=c):c=m[18],m[19]!==o||m[20]!==c?(u=(0,a.jsxs)(eL.Popover,{children:[o,c]}),m[19]=o,m[20]=c,m[21]=u):u=m[21],u}function eq(e){return e.userId}var e$=e.i(75647),eK=e.i(668108),eQ=e.i(781243),eV=e.i(596202);let eW=[{kind:"today",label:"Today"},{kind:"tomorrow",label:"Tomorrow"},{kind:"nextWeek",label:"Next week"}];function eH(e){let t,n,i=(0,s.c)(4),{onPick:r}=e;return i[0]!==r?(t=eW.map(e=>(0,a.jsx)(o.Button,{onClick:()=>r(function(e,t=new Date){var n;return O((n=M[e],new Date(t.getFullYear(),t.getMonth(),t.getDate()+n)))}(e.kind)),size:"sm",type:"button",variant:"ghost",children:e.label},e.kind)),i[0]=r,i[1]=t):t=i[1],i[2]!==t?(n=(0,a.jsx)("div",{className:"flex gap-1 border-b px-3 py-2",children:t}),i[2]=t,i[3]=n):n=i[3],n}function eY(e){let t,n,i,r,l,c,u,m,p,h,f=(0,s.c)(32),{date:x,startTimeStr:g,endTimeStr:v,onDateChange:b,onRemoveDate:y,onClose:j,onTimeToggle:I,onStartTimeChange:_,onEndTimeChange:S,showTime:k}=e;f[0]!==x?(t=x?P(x):void 0,f[0]=x,f[1]=t):t=f[1];let w=t;return f[2]!==b?(n=(0,a.jsx)(eH,{onPick:e=>b(e)}),f[2]=b,f[3]=n):n=f[3],f[4]!==b?(i=e=>{e&&b(O(e))},f[4]=b,f[5]=i):i=f[5],f[6]!==w||f[7]!==i?(r=(0,a.jsx)(eK.Calendar,{mode:"single",onSelect:i,selected:w}),f[6]=w,f[7]=i,f[8]=r):r=f[8],f[9]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:"Time"}),f[9]=l):l=f[9],f[10]!==I||f[11]!==k?(c=(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[l,(0,a.jsx)(eQ.Switch,{checked:k,onCheckedChange:I})]}),f[10]=I,f[11]=k,f[12]=c):c=f[12],f[13]!==v||f[14]!==S||f[15]!==_||f[16]!==k||f[17]!==g?(u=k&&(0,a.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[(0,a.jsx)(eV.TimeField,{label:"Start",onChange:_,value:g}),(0,a.jsx)(eV.TimeField,{label:"End",onChange:S,value:v})]}),f[13]=v,f[14]=S,f[15]=_,f[16]=k,f[17]=g,f[18]=u):u=f[18],f[19]!==c||f[20]!==u?(m=(0,a.jsxs)("div",{className:"border-t px-3 py-2",children:[c,u]}),f[19]=c,f[20]=u,f[21]=m):m=f[21],f[22]!==x||f[23]!==j||f[24]!==b||f[25]!==y?(p=x&&(0,a.jsx)("div",{className:"border-t px-3 py-2",children:(0,a.jsxs)(o.Button,{className:"w-full",onClick:()=>{y?(y(),j()):b(null)},size:"sm",variant:"ghost",children:[(0,a.jsx)(ej.X,{className:"mr-1 h-3 w-3"}),"Remove date"]})}),f[22]=x,f[23]=j,f[24]=b,f[25]=y,f[26]=p):p=f[26],f[27]!==n||f[28]!==r||f[29]!==m||f[30]!==p?(h=(0,a.jsxs)(a.Fragment,{children:[n,r,m,p]}),f[27]=n,f[28]=r,f[29]=m,f[30]=p,f[31]=h):h=f[31],h}function eX(e,t,n){let a=e.split("-"),[s,i]=t.split(":").map(Number),[r,l]=n.split(":").map(Number),o=Number(a[0]),d=Number(a[1])-1,c=Number(a[2]);return{startTime:new Date(o,d,c,s,i).getTime(),endTime:new Date(o,d,c,r,l).getTime()}}function eJ(e){let t,n,i,r,l,o,d,c,u,p,h,f,x,g=(0,s.c)(46),{staged:v,onChange:b}=e,[y,I]=(0,m.useState)(!1),_=null!=v.startTime&&null!=v.endTime,[S,k]=(0,m.useState)(_);g[0]!==v.startTime?(t=null==v.startTime?"09:00":E(v.startTime),g[0]=v.startTime,g[1]=t):t=g[1];
1let[w,C]=(0,m.useState)(t);g[2]!==v.endTime?(n=null==v.endTime?"10:00":E(v.endTime),g[2]=v.endTime,g[3]=n):n=g[3];let[T,N]=(0,m.useState)(n);g[4]!==T||g[5]!==b||g[6]!==S||g[7]!==w?(i=e=>{if(!e){b({date:void 0,startTime:void 0,endTime:void 0}),I(!1);return}S?b({date:e,...eX(e,w,T)}):b({date:e,startTime:void 0,endTime:void 0}),I(!1)},g[4]=T,g[5]=b,g[6]=S,g[7]=w,g[8]=i):i=g[8];let D=i;g[9]!==T||g[10]!==b||g[11]!==v.date||g[12]!==w?(r=e=>{if(k(e),v.date){if(e)return void b({date:v.date,...eX(v.date,w,T)});b({date:v.date,startTime:void 0,endTime:void 0})}},g[9]=T,g[10]=b,g[11]=v.date,g[12]=w,g[13]=r):r=g[13];let L=r;g[14]!==v.date?(l=v.date?`Date: ${R(v.date)}`:"Set date",g[14]=v.date,g[15]=l):l=g[15];let A=v.date?"bg-primary/10 px-1.5 text-[11px] text-primary hover:bg-primary/20":"min-w-7 px-1 text-muted-foreground hover:bg-surface-hover hover:text-foreground";return g[16]!==A?(o=(0,j.cn)("inline-flex h-7 shrink-0 cursor-pointer select-none items-center justify-center rounded-md outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",A),g[16]=A,g[17]=o):o=g[17],g[18]!==v.date?(d=v.date?R(v.date):(0,a.jsx)(e$.Calendar,{className:"h-3.5 w-3.5"}),g[18]=v.date,g[19]=d):d=g[19],g[20]!==l||g[21]!==o||g[22]!==d?(c=(0,a.jsx)(eL.PopoverTrigger,{"aria-label":l,className:o,title:"Set date",children:d}),g[20]=l,g[21]=o,g[22]=d,g[23]=c):c=g[23],g[24]===Symbol.for("react.memo_cache_sentinel")?(u=()=>I(!1),g[24]=u):u=g[24],g[25]!==b||g[26]!==v.date||g[27]!==w?(p=e=>{N(e),v.date&&b({date:v.date,...eX(v.date,w,e)})},g[25]=b,g[26]=v.date,g[27]=w,g[28]=p):p=g[28],g[29]!==T||g[30]!==b||g[31]!==v.date?(h=e=>{C(e),v.date&&b({date:v.date,...eX(v.date,e,T)})},g[29]=T,g[30]=b,g[31]=v.date,g[32]=h):h=g[32],g[33]!==T||g[34]!==D||g[35]!==L||g[36]!==S||g[37]!==v.date||g[38]!==w||g[39]!==p||g[40]!==h?(f=(0,a.jsx)(eL.PopoverContent,{align:"end",className:"w-auto p-0",side:"top",children:(0,a.jsx)(eY,{date:v.date,endTimeStr:T,onClose:u,onDateChange:D,onEndTimeChange:p,onStartTimeChange:h,onTimeToggle:L,showTime:S,startTimeStr:w})}),g[33]=T,g[34]=D,g[35]=L,g[36]=S,g[37]=v.date,g[38]=w,g[39]=p,g[40]=h,g[41]=f):f=g[41],g[42]!==y||g[43]!==f||g[44]!==c?(x=(0,a.jsxs)(eL.Popover,{onOpenChange:I,open:y,children:[c,f]}),g[42]=y,g[43]=f,g[44]=c,g[45]=x):x=g[45],x}var eZ=e.i(722361);function e0(e){let t,n,i,r,l,o,d=(0,s.c)(15),{onChange:c,value:u}=e,m=u.trim().length>0,p=m?"Edit note":"Add note",h=m?"text-foreground":"text-muted-foreground hover:text-foreground";d[0]!==h?(t=(0,j.cn)("inline-flex h-7 min-w-7 shrink-0 cursor-pointer select-none items-center justify-center rounded-md px-1 outline-none transition-colors hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-ring",h),d[0]=h,d[1]=t):t=d[1];let f=m?"Edit note":"Add note";return d[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(eZ.StickyNote,{className:"h-3.5 w-3.5"}),d[2]=n):n=d[2],d[3]!==p||d[4]!==t||d[5]!==f?(i=(0,a.jsx)(eL.PopoverTrigger,{"aria-label":p,className:t,title:f,children:n}),d[3]=p,d[4]=t,d[5]=f,d[6]=i):i=d[6],d[7]!==c?(r=e=>c(L(e.target)),d[7]=c,d[8]=r):r=d[8],d[9]!==r||d[10]!==u?(l=(0,a.jsx)(eL.PopoverContent,{align:"end",className:"w-80 p-2",side:"top",children:(0,a.jsx)(I.Textarea,{"aria-label":"Task note",autoFocus:!0,className:"max-h-[200px] min-h-[96px] w-full resize-none text-sm",onChange:r,placeholder:"Add a note...",value:u})}),d[9]=r,d[10]=u,d[11]=l):l=d[11],d[12]!==i||d[13]!==l?(o=(0,a.jsxs)(eL.Popover,{children:[i,l]}),d[12]=i,d[13]=l,d[14]=o):o=d[14],o}var e1=e.i(331796);function e2(e){let t,n,i,r=(0,s.c)(10),{completedCount:l,totalCount:o}=e,d=o>0?88-l/o*88:88;return r[0]!==l||r[1]!==d||r[2]!==o?(t=o>0&&(0,a.jsx)("div",{className:"relative flex h-4 w-4 items-center justify-center",children:(0,a.jsxs)("svg",{className:"h-4 w-4 -rotate-90 transform",viewBox:"0 0 32 32",children:[(0,a.jsxs)("title",{children:["Progress: ",l," of ",o," tasks completed"]}),(0,a.jsx)("circle",{className:"stroke-muted",cx:"16",cy:"16",fill:"none",r:"14",strokeWidth:"3"}),(0,a.jsx)(e1.motion.circle,{animate:{strokeDashoffset:d},className:"stroke-primary",cx:"16",cy:"16",fill:"none",initial:!1,r:"14",strokeDasharray:String(88),strokeLinecap:"round",strokeWidth:"3",transition:{duration:.3}})]})}),r[0]=l,r[1]=d,r[2]=o,r[3]=t):t=r[3],r[4]!==l||r[5]!==o?(n=(0,a.jsxs)("span",{children:[l,"/",o," done"]}),r[4]=l,r[5]=o,r[6]=n):n=r[6],r[7]!==t||r[8]!==n?(i=(0,a.jsxs)("div",{className:"inline-flex select-none items-center gap-1.5 rounded-lg bg-surface px-2 py-1.5 text-muted-foreground text-xs",children:[t,n]}),r[7]=t,r[8]=n,r[9]=i):i=r[9],i}var e3=e.i(913939),e4=e.i(868280),e5=e.i(809601);e.i(762070);var e6=e.i(261024);let e7=(0,e.i(246166).create)(e=>({byTodoId:new Map,set:(t,n)=>e(e=>{let a=new Map(e.byTodoId);return a.set(t,n),{byTodoId:a}}),clear:t=>e(e=>{if(!e.byTodoId.has(t))return e;let n=new Map(e.byTodoId);return n.delete(t),{byTodoId:n}})})),e8=[],e9=e4.z.object({storageId:e4.z.string()}),te={date:void 0,endTime:void 0,startTime:void 0};function tt(){var e;let t,n,i,d,c,u,p,h,x,g,C,N,A,E,M,R,F,ee,et,ea,es,ei,er,el,eo,ed,ec,eu,em,ep,eh,ef,eg,ev,e_,ew,eC=(0,s.c)(103),eT=(0,m.useRef)(null),eN=(0,m.useRef)(null),eL=(0,m.useRef)(null),eA=(0,m.useRef)(null),[eP,eO]=(0,m.useState)(""),[eE,eM]=(0,m.useState)(null),[eR,ez]=(0,m.useState)(null),[eB,eU]=(0,m.useState)(null),[eG,eq]=(0,m.useState)(null);eC[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],eC[0]=t):t=eC[0];let[e$,eK]=(0,m.useState)(t),[eQ,eV]=(0,m.useState)(te),[eW,eH]=(0,m.useState)(""),eY=(0,l.useMutation)(r.api.todos.assignments.assignTodo),eX=(0,J.useCurrentListId)(),eZ=(0,J.useLastUsedListId)(),{rootLists:e1}=(0,y.useFeatureLimits)(),e4=!e1.canCreate,{label:e8}=T(),{myTasksListId:tt,ensure:tr}=(0,D.useMyTasksListId)(),tl=(0,J.useScrollToNewTask)(),to=(0,J.useSetLastUsedListId)(),td=(0,J.useCurrentParentListId)(),tc=(0,J.useTeamId)(),{createTodo:tu,updateTodo:tm,todos:tp}=en(),{gate:th}=(0,f.useGuestGate)();eC[1]!==tm?(n={formBarRef:eA,updateTodo:tm},eC[1]=tm,eC[2]=n):n=eC[2];let{stagedFiles:tf,isUploading:tx,isFileDragOver:tg,removeStagedFile:tv,uploadAndAttach:tb,handleFileInputChange:ty,handlePaste:tj,clearStagedFiles:tI}=function({formBarRef:e,updateTodo:t}){let[n,a]=(0,m.useState)([]),[s,i]=(0,m.useState)(!1),[o,d]=(0,m.useState)(!1),c=(0,m.useRef)(0),u=(0,l.useMutation)(r.api.files.uploads.generateUploadUrl),p=(0,l.useMutation)(r.api.files.uploads.getStorageUrl),h=e=>{let t=e.filter(e=>!(e.size>0xa00000)||(e3.toast.error("File is too large. Maximum size is 10 MB."),!1)).map(e=>({id:crypto.randomUUID(),file:e,mimeType:e.type,previewUrl:URL.createObjectURL(e)}));
1for(let e of(a(e=>[...e,...t]),t))(0,e5.isPdfFile)(e.file)&&(0,e5.getPdfPreviewDataUrl)(e.file).then(t=>{t&&a(n=>n.map(n=>n.id===e.id?{...n,previewUrl:t}:n))})},f=(0,m.useRef)(h);return f.current=h,(0,m.useEffect)(function(){let t=e.current;if(!t)return;let n=e=>{e.dataTransfer&&Array.from(e.dataTransfer.types).includes("Files")&&(c.current+=1,d(!0))},a=()=>{c.current-=1,c.current<=0&&(c.current=0,d(!1))},s=e=>{e.dataTransfer&&Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),e.stopPropagation())},i=e=>{c.current=0,d(!1);let t=Array.from(e.dataTransfer?.files??[]);t.length>0&&(e.preventDefault(),e.stopPropagation(),f.current(t))};return t.addEventListener("dragenter",n),t.addEventListener("dragleave",a),t.addEventListener("dragover",s),t.addEventListener("drop",i),()=>{t.removeEventListener("dragenter",n),t.removeEventListener("dragleave",a),t.removeEventListener("dragover",s),t.removeEventListener("drop",i)}},[e.current]),{stagedFiles:n,isUploading:s,isFileDragOver:o,removeStagedFile:e=>{a(t=>{let n=t.find(t=>t.id===e);return n?.previewUrl.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl),t.filter(t=>t.id!==e)})},uploadAndAttach:async(e,n)=>{i(!0),e7.getState().set(e,n.map(e=>({id:e.id,mimeType:e.mimeType,previewUrl:e.previewUrl})));let a=[];for(let e of n)try{let t=await (0,e6.convertHeicIfNeeded)(e.file),n=await u(),s=await fetch(n,{method:"POST",headers:{"Content-Type":t.type},body:t});if(!s.ok)throw Error("Upload failed");let{storageId:i}=e9.parse(await s.json()),r=await p({storageId:(0,Z.assertId)(i)});r&&a.push(r)}catch{e3.toast.error("Failed to upload file. Please try again.")}for(let s of(a.length>0&&t({id:e,imageUrls:a}),e7.getState().clear(e),n))s.previewUrl.startsWith("blob:")&&URL.revokeObjectURL(s.previewUrl);i(!1)},handleFileInputChange:e=>{let t=Array.from(e.target.files??[]);t.length>0&&h(t),e.target.value=""},handlePaste:e=>{let t=Array.from(e.clipboardData.items).map(e=>e.getAsFile()).filter(e=>null!==e);t.length>0&&(e.preventDefault(),h(t))},clearStagedFiles:()=>a([])}}(n),t_=(0,b.useSwipeToRevealContext)();eC[3]!==t_?(i=()=>t_?.closeAll(),eC[3]=t_,eC[4]=i):i=eC[4];let tS=i;eC[5]===Symbol.for("react.memo_cache_sentinel")?(d=()=>eT.current?.focus(),eC[5]=d):d=eC[5],eC[6]!==eX||eC[7]!==td?(c=e=>{eM(e),ez(eX),eU(td)},eC[6]=eX,eC[7]=td,eC[8]=c):c=eC[8],eC[9]!==tS||eC[10]!==e4||eC[11]!==c?(u={focusMainInput:d,isRootListAtLimit:e4,onCloseSwipes:tS,onListCreated:c},eC[9]=tS,eC[10]=e4,eC[11]=c,eC[12]=u):u=eC[12];let{startCreateList:tk,element:tw}=function(e){let t,n,i,r,l,d,c,u,p,h,f,x,g=(0,s.c)(37),{focusMainInput:b,isRootListAtLimit:y,onCloseSwipes:j,onListCreated:I}=e,_=(0,m.useRef)(null),S=(0,m.useRef)(null),[w,C]=(0,m.useState)(!1),[T,N]=(0,m.useState)(""),D=(0,J.useCurrentParentListId)(),L=(0,J.useTeamId)(),A=(0,J.useSetLastUsedListId)(),P=(0,v.useOnOpenApp)(),{createList:O}=(0,ek.useTodoLists)();g[0]!==D||g[1]!==y||g[2]!==P||g[3]!==L?(t=()=>{null==D&&null==L&&y?eS(()=>P?.("settings",{activeTab:"billing"})):(C(!0),N(""),requestAnimationFrame(()=>{_.current?.focus()}))},g[0]=D,g[1]=y,g[2]=P,g[3]=L,g[4]=t):t=g[4];let E=t;g[5]!==O||g[6]!==D||g[7]!==b||g[8]!==y||g[9]!==T||g[10]!==I||g[11]!==P||g[12]!==A||g[13]!==L?(n=async()=>{let e=T.trim();if(!e)return void C(!1);if(null==D&&null==L&&y){eS(()=>P?.("settings",{activeTab:"billing"})),C(!1),N("");return}let t=await O({name:e,parentId:D??void 0,teamId:L??void 0,iconData:(0,eI.toConvexIconData)(ex)});t?._id&&((0,k.trackEvent)(k.ANALYTICS_EVENTS.todoListCreated),A(t._id),I(t._id)),C(!1),N(""),window.matchMedia("(pointer: fine)").matches&&requestAnimationFrame(()=>{b()})},g[5]=O,g[6]=D,g[7]=b,g[8]=y,g[9]=T,g[10]=I,g[11]=P,g[12]=A,g[13]=L,g[14]=n):n=g[14];let M=n;g[15]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{C(!1),N("")},g[15]=i):i=g[15];let R=i;g[16]!==M?(r=async e=>{e.preventDefault(),await M()},g[16]=M,g[17]=r):r=g[17];let z=r;g[18]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{"Escape"===e.key&&(e.preventDefault(),R()),"Enter"===e.key&&(e.preventDefault(),S.current?.requestSubmit())},g[18]=l):l=g[18];let B=l;if(!w){let e;return g[19]!==E?(e={startCreateList:E,element:null},g[19]=E,g[20]=e):e=g[20],e}g[21]===Symbol.for("react.memo_cache_sentinel")?(d=e=>N(e.currentTarget.value),g[21]=d):d=g[21],g[22]!==T||g[23]!==j?(c=(0,a.jsx)(ey.Input,{"aria-label":"Name your new list",autoCapitalize:"sentences",className:"min-w-0 flex-1",onChange:d,onFocus:j,onKeyDown:B,placeholder:"Name your new list...",ref:_,value:T}),g[22]=T,g[23]=j,g[24]=c):c=g[24],g[25]!==T?(u=T.trim(),g[25]=T,g[26]=u):u=g[26];let U=!u;return g[27]!==U?(p=(0,a.jsx)(o.Button,{disabled:U,size:"sm",type:"submit",children:"Create"}),g[27]=U,g[28]=p):p=g[28],g[29]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsx)(o.Button,{"aria-label":"Cancel",onClick:R,size:"icon",type:"button",variant:"ghost",children:(0,a.jsx)(ej.X,{className:"h-4 w-4"})}),g[29]=h):h=g[29],g[30]!==z||g[31]!==p||g[32]!==c?(f=(0,a.jsxs)("form",{className:"mb-2 flex gap-2",onSubmit:z,ref:S,children:[c,p,h]}),g[30]=z,g[31]=p,g[32]=c,g[33]=f):f=g[33],g[34]!==E||g[35]!==f?(x={startCreateList:E,element:f},g[34]=E,g[35]=f,g[36]=x):x=g[36],x}(u),tC=`${eX??""}-${td??""}-${tc??""}`,tT=(0,m.useRef)(tC);
1eC[13]!==tC?(p=function(){tT.current!==tC&&(tT.current=tC,eq(null),eM(null),ez(null),eU(null),eK([]))},h=[tC],eC[13]=tC,eC[14]=p,eC[15]=h):(p=eC[14],h=eC[15]),(0,m.useEffect)(p,h);let tN=(0,l.useQuery)(r.api.todo_lists.queries.getAllAccessible,th({}))??[],tD=tN.filter(ti),tL=((0,l.useQuery)(r.api.teams.queries.getAll,th({}))??[]).filter(ts),tA=(0,J.useFocusInputKey)(),tP=new Set(tN.map(ta)),tO=eR===eX&&eB===td,tE=function(e){let{currentListId:t,effectiveUserSelection:n,lastUsedListId:a,listIdsSet:s,lists:i}=e;return n&&s.has(n)?n:t&&s.has(t)?t:null==t&&null==n?null:a&&s.has(a)?a:i[0]?._id??null}({currentListId:eX,currentParentListId:td,effectiveUserSelection:tO?eE:null,lastUsedListId:eZ,listIdsSet:tP,lists:tN,teamId:tc}),tM=0===tN.length,{displayListId:tR,displayParentList:tz,displayMyTasksInbox:tB,displayTeamId:tU,targetParentListId:tF,targetTeamId:tG}=function(e){let{baseDisplayListId:t,parentLists:n,currentParentListId:a,currentListId:s,dropdownTarget:i,teamId:r}=e,l=i?.type==="list"?i.listId:null!=i?null:t,o=null!=l?void 0:i?.type==="parent-list"?n.find(e=>e._id===i.parentListId):null==i?null==a?void 0:n.find(e=>e._id===a):void 0,d=i?.type==="my-tasks"||null==i&&null==l&&null==a&&null==r&&null==s,c=i?.type==="team"?i.teamId:null!=r&&null==s&&null==a?r:null;return{displayParentList:o,displayListId:l,displayMyTasksInbox:d,displayTeamId:c,targetParentListId:i?.type==="parent-list"?i.parentListId:null!=i?null:a,targetTeamId:i?.type==="team"?i.teamId:null==i?r:void 0}}({baseDisplayListId:tE,currentListId:eX,currentParentListId:td,dropdownTarget:eG,parentLists:tD,teamId:tc}),tq=tN.find(e=>e._id===tR),t$=function(e,t,n){let{byParent:a,byTeam:s,uncategorized:i}=function(e,t){let n=[],a=new Map,s=new Map;for(let i of e)if(void 0!==i.teamId){let e=s.get(i.teamId),n=t.find(e=>e._id===i.teamId),a=n?.name??"Space";e?e.lists.push(i):s.set(i.teamId,{label:a,lists:[i],team:n})}else if(void 0===i.parentId)n.push(i);else{let e=a.get(i.parentId);e?e.push(i):a.set(i.parentId,[i])}let i=new Set(a.keys());return{byParent:a,byTeam:s,uncategorized:n.filter(e=>!i.has(e._id))}}(e,n),r=[];for(let e of(i.length>0&&r.push({key:"my-tasks",label:X,lists:i}),t)){if(void 0!==e.teamId)continue;let t=a.get(e._id);void 0!==t&&0!==t.length&&r.push({parentList:e,key:e._id,label:e.name,lists:t})}for(let[e,{label:t,lists:n,team:a}]of s)r.push({key:`team-${e}`,label:t,lists:n,team:a});return r}(tN,tD,tL);eC[16]!==tp||eC[17]!==eX||eC[18]!==td||eC[19]!==tc?(x=(g=function(e,t){let{currentListId:n,currentParentListId:a,teamId:s}=t;return null!=n?e.filter(e=>e.listId===n):null!=a?e.filter(e=>e.parentId===a&&null==e.listId):null==a&&null==s?e.filter(e=>null==e.listId&&null==e.parentId):[]}(tp,{currentListId:eX,currentParentListId:td,teamId:tc})).filter(tn),eC[16]=tp,eC[17]=eX,eC[18]=td,eC[19]=tc,eC[20]=x,eC[21]=g):(x=eC[20],g=eC[21]);let tK=x.length,tQ=g.length;eC[22]!==tr||eC[23]!==tA||eC[24]!==tt||eC[25]!==eP?(C={ensure:tr,focusInputKey:tA,inputRef:eT,myTasksListId:tt,newTodoText:eP},eC[22]=tr,eC[23]=tA,eC[24]=tt,eC[25]=eP,eC[26]=C):C=eC[26],function({ensure:e,focusInputKey:t,inputRef:n,myTasksListId:a,newTodoText:s}){(0,m.useEffect)(function(){null==a&&e().catch(()=>{})},[a,e]),(0,m.useEffect)(function(){n.current&&w(n.current,120,36),window.matchMedia("(pointer: fine)").matches&&n.current?.focus()},[n.current]),(0,m.useEffect)(function(){t>0&&n.current?.focus()},[t,n.current?.focus]),(0,m.useEffect)(function(){""===s&&n.current&&w(n.current,120,36)},[s,n.current])}(C);let tV=async e=>{var t,n,a,s;let i,r;e.preventDefault();let l=eP.trim();if(!l)return;let o=(t={staged:eQ,text:l}).staged.date?{text:t.text,date:t.staged.date,startTime:t.staged.startTime,endTime:t.staged.endTime}:function(e,t=new Date){let n=e.trim().split(V).filter(Boolean);if(0===n.length)return;let a=function(e,t){let n,a,s=e.length-1,i=!1;for(;s>=0;){let r=W(e[s]??"");if(i&&U.has(r)){s-=1;continue}if(!a){let e=function(e){let t=G.exec(e);if(t?.[1]&&t[3])return function(e,t,n){let a=void 0===t?0:Number(t);if(!(e<1)&&!(e>12)&&!(a>59))return"am"===n?{hours:12===e?0:e,minutes:a}:{hours:12===e?12:e+12,minutes:a}}(Number(t[1]),t[2],t[3]);let n=q.exec(e);if(!(n?.[1]&&n[2]))return;let a=Number(n[1]);if(!(a<13))return{hours:a,minutes:Number(n[2])}}(r);if(e){a=e,i=!0,s-=1;continue}}if(!n){let a=function(e,t,n){let a=W(e[t]??""),s=t>0?W(e[t-1]??""):"";if("today"===a)return{date:O(n),nextIndex:t-1};if("tomorrow"===a)return{date:O(H(n,1)),nextIndex:t-1};if("week"===a&&"next"===s)return{date:O(H(n,7)),nextIndex:t-2};if(a in z){var i;let e,r="next"===s;return{date:(i=z[a],e=(i-n.getDay()+7)%7,O(H(n,0===e&&r?7:e))),nextIndex:r?t-2:t-1}}return function(e,t,n,a){let s=function(e){if($.test(e)&&O(P(e))===e)return e}(e);if(s)return{date:s,nextIndex:n-1};let i=function(e,t){let n=K.exec(e);if(!(n?.[1]&&n[2]))return;let a=Number(n[1])-1;if(!(a<0)&&!(a>11))return Y(t,a,Number(n[2]))}(e,a);if(i)return{date:i,nextIndex:n-1};if(!Q.test(e))return;let r=B[t];
1if(void 0===r)return;let l=Y(a,r,Number(e));if(l)return{date:l,nextIndex:n-2}}(a,s,t,n)}(e,s,t);if(a){n=a.date,i=!0,s=a.nextIndex;continue}}break}return{date:n,time:a,titleEnd:s+1}}(n,t);if(!(a.date||a.time))return;let s=n.slice(0,a.titleEnd).join(" ").trim();if(0!==s.length)return function(e,t,n){if(!n)return{text:e,date:t};let a=P(t);return a.setHours(n.hours,n.minutes,0,0),{text:e,date:t,startTime:a.getTime(),endTime:a.getTime()+36e5}}(s,a.date??O(t),a.time)}(t.text,t.now)??{text:t.text},d=(i={date:(n={displayListId:tR,myTasksListId:tt,pendingDate:{date:o.date,endTime:o.endTime,startTime:o.startTime},targetParentListId:tF,targetTeamId:tG,text:o.text}).pendingDate.date,endTime:n.pendingDate.endTime,startTime:n.pendingDate.startTime},(r=n.displayListId??n.targetParentListId??(null===n.targetTeamId?n.myTasksListId??null:null))?{listId:r,teamId:n.targetTeamId??void 0,text:n.text,...i}:null!==n.targetTeamId?{teamId:n.targetTeamId,text:n.text,...i}:null);if(!d)return;let c=[...tf],u=[...e$];eO(""),tI(),eK([]),eV(te),eH(""),eT.current?.focus(),d.listId&&to(d.listId);let m=await tu(d),p=m?._id;(0,k.trackEvent)(k.ANALYTICS_EVENTS.todoCreated),tl(),p&&(a={pendingAssignees:u,pendingFiles:c,pendingNote:eW},s={assignTodo:eY,updateTodo:tm,uploadAndAttach:tb},a.pendingAssignees.length>0&&s.assignTodo({todoId:p,userIds:a.pendingAssignees.map(e=>e.userId)}).catch(console.error),a.pendingNote.trim().length>0&&s.updateTodo({id:p,note:a.pendingNote}).catch(console.error),a.pendingFiles.length>0&&s.uploadAndAttach(p,a.pendingFiles))};eC[27]===Symbol.for("react.memo_cache_sentinel")?(N=e=>{if("Tab"===e.key&&e.shiftKey){e.preventDefault();let t=Array.from(document.querySelectorAll("[data-task-input], [data-task-note]")).at(-1);t?.focus();return}if("Enter"===e.key){if(e.shiftKey)return;e.preventDefault(),eN.current?.requestSubmit()}},eC[27]=N):N=eC[27];let tW=N;eC[28]!==eX||eC[29]!==td?(A=e=>{eq(e),"list"===e.type?(eM(e.listId),ez(eX),eU(td)):"parent-list"===e.type?(eM(null),ez(null),eU(e.parentListId)):(eM(null),ez(null),eU(null))},eC[28]=eX,eC[29]=td,eC[30]=A):A=eC[30];let tH=A,tY=!!((eP.trim()||tf.length>0)&&(tR||tM||null!==tF||null!==tG||tB)),tX=(e={displayListId:tR,myTasksListId:tt,targetParentListId:tF,targetTeamId:tG}).displayListId?e.displayListId:e.targetParentListId?e.targetParentListId:null===e.targetTeamId?e.myTasksListId??void 0:void 0;eC[31]!==tK||eC[32]!==eX||eC[33]!==td||eC[34]!==tB||eC[35]!==tQ?(E=(null!==eX||null!==td||tB)&&(0,a.jsx)(e2,{completedCount:tK,totalCount:tQ}),eC[31]=tK,eC[32]=eX,eC[33]=td,eC[34]=tB,eC[35]=tQ,eC[36]=E):E=eC[36],eC[37]!==tH?(M=e=>tH({listId:e,type:"list"}),R=()=>tH({type:"my-tasks"}),F=e=>tH({parentListId:e,type:"parent-list"}),ee=e=>tH({teamId:e,type:"team"}),eC[37]=tH,eC[38]=M,eC[39]=R,eC[40]=F,eC[41]=ee):(M=eC[38],R=eC[39],F=eC[40],ee=eC[41]),eC[42]!==tq||eC[43]!==tB||eC[44]!==tz||eC[45]!==tU||eC[46]!==t$||eC[47]!==tM||eC[48]!==e8||eC[49]!==tk||eC[50]!==M||eC[51]!==R||eC[52]!==F||eC[53]!==ee?(et=(0,a.jsx)(eb,{displayList:tq,displayMyTasksInbox:tB,displayParentList:tz,displayTeamId:tU,grouped:t$,hasNoLists:tM,myTasksLabel:e8,onCreateList:tk,onSelectList:M,onSelectMyTasksInbox:R,onSelectParentListInbox:F,onSelectTeamInbox:ee}),eC[42]=tq,eC[43]=tB,eC[44]=tz,eC[45]=tU,eC[46]=t$,eC[47]=tM,eC[48]=e8,eC[49]=tk,eC[50]=M,eC[51]=R,eC[52]=F,eC[53]=ee,eC[54]=et):et=eC[54],eC[55]!==E||eC[56]!==et?(ea=(0,a.jsxs)("div",{className:"absolute -top-7 right-3 z-10 flex items-center justify-end gap-1.5",children:[E,et]}),eC[55]=E,eC[56]=et,eC[57]=ea):ea=eC[57],eC[58]!==tx||eC[59]!==tv||eC[60]!==tf?(es=(tf.length>0||tx)&&(0,a.jsx)("div",{className:"pointer-events-none absolute right-0 bottom-full left-0 z-20 pb-1.5 [mask-image:linear-gradient(to_right,black_50%,transparent_100%)]",children:(0,a.jsx)("div",{className:"pointer-events-auto inline-block max-w-full",children:(0,a.jsx)(eD,{isUploading:tx,onRemove:tv,stagedFiles:tf})})}),eC[58]=tx,eC[59]=tv,eC[60]=tf,eC[61]=es):es=eC[61];let tJ=tg&&"ring-2 ring-ring";eC[62]!==tJ?(ei=(0,j.cn)("flex items-end rounded-xl bg-card ring-1 ring-border transition-colors focus-within:bg-surface-hover focus-within:ring-ring",tJ),eC[62]=tJ,eC[63]=ei):ei=eC[63],eC[64]===Symbol.for("react.memo_cache_sentinel")?(er=e=>{eO(L(e.target)),w(e.target,120,36)},eC[64]=er):er=eC[64],eC[65]!==tS||eC[66]!==tj||eC[67]!==tW||eC[68]!==eP?(el=(0,a.jsx)("div",{className:"flex min-h-10 min-w-0 flex-1 items-center",children:(0,a.jsx)(I.Textarea,{"aria-label":"Add a task",autoCapitalize:"sentences",className:"max-h-[120px] min-h-9 w-full min-w-0 overflow-y-auto","data-global-task-input":!0,onChange:er,onFocus:tS,onKeyDown:tW,onPaste:tj,placeholder:"Add a task...",ref:eT,rows:1,size:"default",title:"Create task (C)",value:eP,variant:"flush"})}),eC[65]=tS,eC[66]=tj,eC[67]=tW,eC[68]=eP,eC[69]=el):el=eC[69],eC[70]!==ty?(eo=(0,a.jsx)("input",{className:"hidden",multiple:!0,onChange:ty,ref:eL,type:"file"}),eC[70]=ty,eC[71]=eo):eo=eC[71],eC[72]!==tX||eC[73]!==e$?(ed=(0,a.jsx)(eF,{listId:tX,onChange:eK,selectedAssignees:e$}),eC[72]=tX,eC[73]=e$,eC[74]=ed):ed=eC[74],eC[75]!==eQ?(ec=(0,a.jsx)(eJ,{onChange:eV,staged:eQ}),eC[75]=eQ,eC[76]=ec):ec=eC[76],eC[77]!==eW?(eu=(0,a.jsx)(e0,{onChange:eH,value:eW}),eC[77]=eW,eC[78]=eu):eu=eC[78],eC[79]===Symbol.for("react.memo_cache_sentinel")?(em=()=>eL.current?.click(),eC[79]=em):em=eC[79],eC[80]===Symbol.for("react.memo_cache_sentinel")?(ep=(0,a.jsx)(o.Button,{"aria-label":"Attach files",onClick:em,size:"icon-sm",type:"button",variant:"ghost",children:(0,a.jsx)(S.Paperclip,{className:"h-3.5 w-3.5"})}),eC[80]=ep):ep=eC[80];let tZ=!tY,t0=tY?"default":"soft";return eC[81]===Symbol.for("react.memo_cache_sentinel")?(eh=(0,a.jsx)(_.ArrowUp,{className:"h-3.5 w-3.5"}),eC[81]=eh):eh=eC[81],eC[82]!==tZ||eC[83]!==t0?(ef=(0,a.jsx)(o.Button,{"aria-label":"Add task",disabled:tZ,size:"icon-sm",type:"submit",variant:t0,children:eh}),eC[82]=tZ,eC[83]=t0,eC[84]=ef):ef=eC[84],eC[85]!==eo||eC[86]!==ed||eC[87]!==ec||eC[88]!==eu||eC[89]!==ef?(eg=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 p-1.5",children:[eo,ed,ec,eu,ep,ef]}),eC[85]=eo,eC[86]=ed,eC[87]=ec,eC[88]=eu,eC[89]=ef,eC[90]=eg):eg=eC[90],eC[91]!==ei||eC[92]!==el||eC[93]!==eg?
1(ev=(0,a.jsxs)("div",{className:ei,ref:eA,children:[el,eg]}),eC[91]=ei,eC[92]=el,eC[93]=eg,eC[94]=ev):ev=eC[94],eC[95]!==tV||eC[96]!==es||eC[97]!==ev?(e_=(0,a.jsxs)("form",{className:"relative",onSubmit:tV,ref:eN,children:[es,ev]}),eC[95]=tV,eC[96]=es,eC[97]=ev,eC[98]=e_):e_=eC[98],eC[99]!==tw||eC[100]!==ea||eC[101]!==e_?(ew=(0,a.jsxs)("div",{className:"relative shrink-0 px-3 pt-2 pb-1.5 max-md:pb-[calc(3.75rem+env(safe-area-inset-bottom,0px))]",children:[tw,ea,e_]}),eC[99]=tw,eC[100]=ea,eC[101]=e_,eC[102]=ew):ew=eC[102],ew}function tn(e){return e.completed}function ta(e){return e._id}function ts(e){return null!==e}function ti(e){return void 0===e.parentId&&void 0===e.teamId}var tr=e.i(998518);let tl=e=>{let t,{draggingNodeRect:n,transform:a,scrollableAncestorRects:s}=e,i=s[0];return n&&i?(t={...a},n.top+a.y<=i.top?t.y=i.top-n.top:n.bottom+a.y>=i.top+i.height&&(t.y=i.top+i.height-n.bottom),n.left+a.x<=i.left?t.x=i.left-n.left:n.right+a.x>=i.left+i.width&&(t.x=i.left+i.width-n.right),t):a};e.s(["restrictToFirstScrollableAncestor",0,tl],191749);var to=e.i(274069),td=e.i(548830);function tc(e,t,n,a){let s=a.get(e);if(void 0!==s)return s;let i=n.get(e),r=(t.get(e)??[]).map(e=>tc(e,t,n,a)),l=i??Math.min(...r,Number.MAX_SAFE_INTEGER);return a.set(e,l),l}function tu(e){let t=new Map(e.all.map(e=>[e._id,e])),n=new Map(e.matched.map((e,t)=>[e._id,t])),a=new Map;for(let n of e.matched){for(let e of function(e,t){let n=[],a=new Set([e._id]),{parentId:s}=e;for(;void 0!==s&&!a.has(s);){let e=t.get(s);if(void 0===e)break;a.add(s),n.unshift(e),{parentId:s}=e}return n}(n,t))a.set(e._id,e);a.set(n._id,n)}let s=function(e){let t=new Map;for(let n of e.values()){let{parentId:a}=n;if(void 0===a||!e.has(a))continue;let s=t.get(a);s?s.push(n._id):t.set(a,[n._id])}return t}(a),i=new Map,r=(e,t)=>tc(e,s,n,i)-tc(t,s,n,i),l=[],o=(e,t)=>{for(let i of[...e].sort(r)){let e=a.get(i);void 0!==e&&(l.push({...e,depth:t,isContext:!n.has(i),type:"task"}),o(s.get(i)??[],t+1))}};return o(function(e){let t=[];for(let n of e.values())void 0!==n.parentId&&e.has(n.parentId)||t.push(n._id);return t}(a),0),l}var tm=e.i(8513),tp=e.i(387432),th=e.i(721538);function tf(e){let t,n,i,r=(0,s.c)(13),{onToggle:l,selectedIds:o,tabs:d}=e;if(d.length<=1)return null;r[0]!==o?(t=o.every(tx),r[0]=o,r[1]=t):t=r[1];let c=t;if(r[2]!==c||r[3]!==l||r[4]!==o||r[5]!==d){let e;r[7]!==c||r[8]!==l||r[9]!==o?(e=e=>(0,a.jsx)(tp.FilterChip,{active:e.id===th.ALL_SCOPE_ID?c:o.includes(e.id),count:e.count,label:e.label,onSelect:()=>l(e.id)},e.id),r[7]=c,r[8]=l,r[9]=o,r[10]=e):e=r[10],n=d.map(e),r[2]=c,r[3]=l,r[4]=o,r[5]=d,r[6]=n}else n=r[6];return r[11]!==n?(i=(0,a.jsx)(tm.ScrollArea,{className:"min-w-0 flex-1",children:(0,a.jsx)("div",{className:"flex items-center gap-1",children:n})}),r[11]=n,r[12]=i):i=r[12],i}function tx(e){return e===th.ALL_SCOPE_ID}function tg(e){return[e._id,e.name]}let tv=["identifier","status","priority","images","estimate","labels","linkedWork","project","list","assignee","created","due","updated"],tb={assignee:{cards:!0,name:"Assignee",rows:!0},created:{cards:!0,name:"Created",rows:!1},due:{cards:!0,name:"Due",rows:!0},estimate:{cards:!0,name:"Estimate",rows:!0},identifier:{cards:!0,name:"Identifier",rows:!0},images:{cards:!1,name:"Images",rows:!0},labels:{cards:!0,name:"Labels",rows:!0},linkedWork:{cards:!0,name:"Linked work",rows:!0},list:{cards:!0,name:"List",rows:!0},priority:{cards:!0,name:"Priority",rows:!0},project:{cards:!0,name:"Project",rows:!0},status:{cards:!1,name:"Status",rows:!0},updated:{cards:!0,name:"Updated",rows:!1}};function ty(e){let t=tb[e];return{key:e,showInRows:t.rows,showOnCards:t.cards}}function tj(){return tv.map(ty)}function tI(e,t){return e.filter(e=>"rows"===t?e.showInRows:e.showOnCards)}function t_(e){return e.label??tb[e.key].name}function tS(e,t){let n=e.getQuery(r.api.todo_lists.view_queries.getMyListView,{listId:t.listId});n&&e.setQuery(r.api.todo_lists.view_queries.getMyListView,{listId:t.listId},{...n,kanbanEnabled:t.kanbanEnabled??n.kanbanEnabled,properties:t.properties?function(e){if(!e)return tj();let t=new Map;for(let n of e)n.key in tb&&!t.has(n.key)&&t.set(n.key,function(e){let t=tb[e.key],n=e.label?.trim();return{key:e.key,label:n||void 0,showInRows:t.rows&&e.showInRows,showOnCards:t.cards&&e.showOnCards}}(n));let n=tv.filter(e=>!t.has(e)).map(ty);return[...t.values(),...n]}(t.properties):n.properties})}function tk(e,t){let n=e.getQuery(r.api.todo_lists.view_queries.getMyListView,{listId:t.listId});n&&e.setQuery(r.api.todo_lists.view_queries.getMyListView,{listId:t.listId},{...n,mode:t.mode})}let tw={kanbanEnabled:!1,mode:"shared",properties:tj()};function tC(e){let t,n=(0,s.c)(3),{gate:a}=(0,f.useGuestGate)();return n[0]!==a||n[1]!==e?(t=e?a({listId:e}):"skip",n[0]=a,n[1]=e,n[2]=t):t=n[2],(0,l.useQuery)(r.api.todo_lists.view_queries.getMyListView,t)??tw}function tT(e){let t,n,a,i,o,d,c=(0,s.c)(17),u=(0,l.useMutation)(r.api.todo_lists.view_mutations.updateListView);c[0]!==u?(t=u.withOptimisticUpdate(tS),c[0]=u,c[1]=t):t=c[1];let m=t,p=(0,l.useMutation)(r.api.todo_lists.view_mutations.setListViewMode);c[2]!==p?(n=p.withOptimisticUpdate(tk),c[2]=p,c[3]=n):n=c[3];let h=n;if(e)return c[4]!==e||c[5]!==m?(a=t=>{m({kanbanEnabled:t,listId:e}).catch(console.error)},c[4]=e,c[5]=m,c[6]=a):a=c[6],c[7]!==e||c[8]!==h?(i=t=>{h({listId:e,mode:t}).catch(console.error)},c[7]=e,c[8]=h,c[9]=i):i=c[9],c[10]!==e||c[11]!==m?(o=t=>{m({listId:e,properties:t}).catch(console.error)},c[10]=e,c[11]=m,c[12]=o):o=c[12],c[13]!==a||c[14]!==i||c[15]!==o?(d={setKanbanEnabled:a,setMode:i,setProperties:o},c[13]=a,c[14]=i,c[15]=o,c[16]=d):d=c[16],d}let tN={type:"lucide",name:"user"},tD={type:"lucide",name:"users"};function tL(e,t,n=!0){let{gate:a,isGuest:s}=(0,f.useGuestGate)(),{label:i}=T(),{myTasksListId:o}=(0,D.useMyTasksListId)(),d=(0,l.useQuery)(r.api.todo_lists.queries.getById,n&&o&&!s?a({id:o}):"skip"),c=(0,J.useSelectMyTasks)(),u=(0,J.useSelectTeam)(),p=(0,J.useSelectParentList)(),h=(0,l.useQuery)(r.api.todo_lists.queries.getById,n&&e&&!s?a({id:e}):"skip"),x=(0,l.useQuery)(r.api.teams.queries.getAll,n?a({}):"skip")??[],g=n?function(e){var t;let{listParentId:n,listTeamId:a,myTasksLabel:s,myTasksListId:i,myTasksList:r,parentList:l,teams:o,selectMyTasks:d,selectTeam:c,selectParentList:u}=e;if(a&&n){let e=o.find(e=>e&&e._id===a);return e&&void 0!==l?[{iconData:e.iconData??tD,label:e.name,onClick:()=>c(a)},{iconData:l?.iconData??ex,label:l?.name??"List",onClick:()=>u(n,a)}]:[]}if(a){let e=o.find(e=>e&&e._id===a);return e?[{iconData:e.iconData??tD,label:e.name,onClick:()=>c(a)}]:[]}if(n){let e;return n!==i&&void 0===l?[]:(t=l??null,[{iconData:(e=n===i)?r?.iconData??tN:t?.iconData??ex,isMyTasks:e,label:e?s:t?.name??"List",onClick:()=>e?d():u(n)}])}return[{iconData:r?.iconData??tN,isMyTasks:!0,label:s,onClick:()=>d()}]}({listParentId:e,listTeamId:t,myTasksLabel:i,myTasksListId:o,myTasksList:d,parentList:h,teams:x,selectMyTasks:c,selectTeam:u,selectParentList:p}):[],v=(0,m.useRef)(g);return n?(g.length>0&&(v.current=g),g.length>
10?g:v.current):(v.current=[],[])}var tA=e.i(529877);function tP(){let{gate:e}=(0,f.useGuestGate)(),t=(0,l.useQuery)(r.api.todo_lists.queries.getAllAccessible,e({}))??[],n=new Map;for(let e of t){let t=new Map;for(let n of e.statusOptions??[])t.set(n.id,n.group);n.set(e._id,t)}return{resolve:(e,t)=>{if(e&&t)return n.get(e)?.get(t)}}}function tO(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(e),a=(0,m.useRef)(!0);return e!==n.current&&(n.current=e,a.current=!0,t.current&&(t.current.scrollTop=0,a.current=!1)),(0,m.useCallback)(e=>{t.current=e,e&&a.current&&(e.scrollTop=0,a.current=!1)},[])}var tE=e.i(902769);function tM(e,t,n,a){let s=e.findIndex(e=>e._id===t),i=e.findIndex(e=>e._id===n);if(-1===s||-1===i)return 0;let r=e[s];if(!r)return 0;let l=function(e,t,n){if(t<n)return e[n];let a=n-1;return a===t&&a--,a>=0?e[a]:void 0}(e,s,i),o=l?l.depth+1:0,d=Math.round(a/24),c=e[i];return Math.max(0,Math.min(o,(t===n?r.depth:c?c.depth:0)+d))}function tR(e,t,n,a,s){if(a<=0)return;let i=a-1,r=n<t?t:t-1;for(let t=r;t>=0;t--){let n=e[t];if(n&&n._id!==s){if(n.depth===i)return n._id;if(n.depth<i)break}}}function tz(e,t,n,a,s,i){let r=e[n],l=tR(e,a,n,s,t);l!==(r&&"parentId"in r?r.parentId:void 0)&&i(t,l)}function tB(e){let t,n,a,r,l,o,d,c,u,p=(0,s.c)(21),{listItems:h,onReorder:f,onUpdateParentId:x}=e;p[0]===Symbol.for("react.memo_cache_sentinel")?(t={activationConstraint:{distance:5}},p[0]=t):t=p[0],p[1]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{delay:200,tolerance:8}},p[1]=n):n=p[1],p[2]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:tE.sortableKeyboardCoordinates},p[2]=a):a=p[2];let g=(0,i.useSensors)((0,i.useSensor)(i.PointerSensor,t),(0,i.useSensor)(i.TouchSensor,n),(0,i.useSensor)(i.KeyboardSensor,a)),[v,b]=(0,m.useState)(null),y=(0,m.useRef)(null),j=(0,m.useRef)(0);p[3]!==h?(r=e=>{let t=String(e.active.id),n=h.find(e=>e._id===t),a={activeId:t,overId:t,depth:n?.depth??0,parentId:n?.parentId};y.current=a,b(a),j.current=0},p[3]=h,p[4]=r):r=p[4];let I=r;p[5]!==h?(l=e=>{j.current=e.delta.x;let t=y.current;if(!t)return;let n=tM(h,t.activeId,t.overId,e.delta.x),a=h.findIndex(e=>e._id===t.activeId),s=h.findIndex(e=>e._id===t.overId),i=-1!==a&&-1!==s?tR(h,s,a,n,t.activeId):void 0;if(n!==t.depth||i!==t.parentId){let e={...t,depth:n,parentId:i};y.current=e,b(e)}},p[5]=h,p[6]=l):l=p[6];let _=l;p[7]!==h?(o=e=>{let t=y.current;if(!(e.over&&t))return;let n=String(e.over.id),a=tM(h,t.activeId,n,j.current),s=h.findIndex(e=>e._id===t.activeId),i=h.findIndex(e=>e._id===n),r=-1!==s&&-1!==i?tR(h,i,s,a,t.activeId):void 0;if(n!==t.overId||a!==t.depth||r!==t.parentId){let e={...t,overId:n,depth:a,parentId:r};y.current=e,b(e)}},p[7]=h,p[8]=o):o=p[8];let S=o;p[9]!==h||p[10]!==f||p[11]!==x?(d=e=>{let t,n,a=y.current;y.current=null,b(null);let{active:s,over:i}=e;if(!(i&&a))return;let r=h.findIndex(e=>e._id===s.id),l=h.findIndex(e=>e._id===i.id);if(-1===r||-1===l)return;if(s.id===i.id)return void tz(h,String(s.id),r,l,a.depth,x);let o=(l<r?(t=l>0?h[l-1]?.sortOrder:void 0,n=h[l]?.sortOrder):(t=h[l]?.sortOrder,n=l<h.length-1?h[l+1]?.sortOrder:void 0),void 0!==t&&void 0!==n)?(t+n)/2:void 0!==t?t+1e3:void 0!==n?n-1e3:void 0;void 0!==o&&(f(String(s.id),o),tz(h,String(s.id),r,l,a.depth,x))},p[9]=h,p[10]=f,p[11]=x,p[12]=d):d=p[12];let k=d;p[13]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{y.current=null,b(null)},p[13]=c):c=p[13];let w=c;return p[14]!==k||p[15]!==_||p[16]!==S||p[17]!==I||p[18]!==v||p[19]!==g?(u={sensors:g,projection:v,handleDragStart:I,handleDragMove:_,handleDragOver:S,handleDragEnd:k,handleDragCancel:w},p[14]=k,p[15]=_,p[16]=S,p[17]=I,p[18]=v,p[19]=g,p[20]=u):u=p[20],u}var tU=e.i(655262),tF=e.i(305972),tG=e.i(680613);let tq=e4.z.enum(["low","medium","high","urgent"]),t$=e4.z.object({completed:e4.z.boolean(),completedAt:e4.z.number().optional(),createdAt:e4.z.number(),date:e4.z.string().optional(),dueDate:e4.z.number().optional(),endTime:e4.z.number().optional(),estimatedMinutes:e4.z.number().optional(),isMilestone:e4.z.boolean().optional(),note:e4.z.string().optional(),parentTempId:e4.z.string().optional(),priority:tq.optional(),privateNote:e4.z.string().optional(),sortOrder:e4.z.number().optional(),startTime:e4.z.number().optional(),statusId:e4.z.string().optional(),tempId:e4.z.string(),text:e4.z.string(),updatedAt:e4.z.number()}),tK=e4.z.enum(["gray","blue","green","yellow","orange","red","purple","pink","brown"]),tQ=e4.z.object({color:tK.optional(),glyph:e4.z.enum(["backlog","todo","in_progress","in_review","blocked","done","canceled"]).optional(),group:e4.z.enum(["backlog","todo","in_progress","in_review","blocked","complete","canceled"]),id:e4.z.string(),name:e4.z.string(),sortOrder:e4.z.number()}),tV=e4.z.object({defaultOptionByGroup:e4.z.object({backlog:e4.z.string().optional(),blocked:e4.z.string().optional(),canceled:e4.z.string().optional(),complete:e4.z.string().optional(),in_progress:e4.z.string().optional(),in_review:e4.z.string().optional(),todo:e4.z.string().optional()}).optional(),kanbanEnabled:e4.z.boolean().optional(),statusOptions:e4.z.array(tQ).optional(),todos:e4.z.array(t$),v:e4.z.literal(1)});function tW(e){let t,n,a,i,o,d=(0,s.c)(17),c=(0,l.useConvex)();d[0]!==c||d[1]!==e?(t=async(t,n,a,s)=>{let i,{sealed:l}=await (0,tG.sealForLock)({pageId:e,passcode:t,bodyJson:(i=new Map,a.forEach((e,t)=>{i.set(e._id,`t${t}`)}),JSON.stringify({defaultOptionByGroup:n.defaultOptionByGroup,kanbanEnabled:n.kanbanEnabled,statusOptions:n.statusOptions,todos:a.map(e=>({completed:e.completed,completedAt:e.completedAt,createdAt:e.createdAt,date:e.date,dueDate:e.dueDate,endTime:e.endTime,estimatedMinutes:e.estimatedMinutes,isMilestone:e.isMilestone,note:e.note,parentTempId:void 0===e.parentId?void 0:i.get(e.parentId),priority:e.priority,privateNote:e.privateNote,sortOrder:e.sortOrder,startTime:e.startTime,statusId:e.statusId,tempId:i.get(e._id)??"",text:e.text,updatedAt:e.updatedAt})),v:1})),bodyVersion:1});await c.mutation(r.api.todo_lists.list_lock.lockTaskList,{listId:e,salt:l.salt,wrappedDek:l.wrappedDek,wrappedDekIv:l.wrappedDekIv,ciphertext:l.ciphertext,iv:l.iv,bodyVersion:l.bodyVersion,...s?{hint:s}:{}})},d[0]=c,d[1]=e,d[2]=t):t=d[2];let u=t;d[3]!==c||d[4]!==e?(n=async t=>{let n=await c.query(r.api.todo_lists.list_lock.unlockTaskListContent,{listId:e});if(null===n)return{kind:"missing"};let{bodyJson:a}=await (0,tG.unsealForUnlock)({pageId:e,passcode:t,bundle:n}),s=tV.parse(JSON.parse(a));return await c.mutation(r.api.todo_lists.list_lock.removeTaskListLock,{listId:e,todos:s.todos,statusOptions:s.statusOptions,defaultOptionByGroup:s.defaultOptionByGroup,kanbanEnabled:s.kanbanEnabled}),{kind:"unlocked"}},d[3]=c,d[4]=e,d[5]=n):n=d[5];let m=n;d[6]!==c||d[7]!==e?(a=async(t,n,a)=>{let s=await c.query(r.api.todo_lists.list_lock.unlockTaskListContent,{listId:e});if(null===s)throw Error("List is not locked.");let i=await (0,tG.rewrapForPasscodeChange)({oldPasscode:t,newPasscode:n,bundle:s});await c.mutation(r.api.todo_lists.list_lock.rewrapTaskListLock,{listId:e,salt:i.salt,wrappedDek:i.wrappedDek,wrappedDekIv:i.wrappedDekIv,...void 0===a?{}:{hint:a}})},d[6]=c,d[7]=e,d[8]=a):a=d[8];let p=a;d[9]!==c||d[10]!==e?(i=async()=>{await c.mutation(r.api.todo_lists.list_lock.discardTaskListLock,{listId:e})},d[9]=c,d[10]=e,d[11]=i):i=d[11];let h=i;return d[12]!==p||d[13]!==h||d[14]!==u||d[15]!==m?(o={changePasscode:p,discard:h,lock:u,unlock:m},d[12]=p,d[13]=h,d[14]=u,d[15]=m,d[16]=o):o=d[16],o}function tH({listId:e,hint:t}){let n=tW(e),[s,i]=(0,m.useState)(""),[r,l]=(0,m.useState)(null),[d,c]=(0,m.useState)(!1),[u,p]=(0,m.useState)(!1),[h,f]=(0,m.useState)(!1),x=(0,m.useCallback)(async()=>{c(!0),l(null);try{let e=await n.unlock(s);if("missing"===e.kind)return void l("This list is no longer locked.");i("")}catch(e){e instanceof tG.WrongPasscodeError?l("Wrong passcode."):l("Couldn't open this list. Please try again.")}finally{c(!1)}},[n,s]),g=(0,m.useCallback)(async()=>{await n.discard(),e3.toast.success("Locked list discarded.")},[n]);return(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center py-16",children:(0,a.jsxs)("div",{className:"flex w-[min(380px,calc(100vw-2rem))] flex-col items-center gap-4 roun
1ded-2xl border bg-card-solid p-7 text-center shadow-sm",children:[(0,a.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,a.jsx)(tU.Lock,{className:"size-5 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("h2",{className:"font-medium text-base",children:"This list is locked"}),(0,a.jsx)("p",{className:"text-muted-foreground text-sm leading-snug",children:"Only you can open this list with your passcode. It's encrypted on your device and hidden from Ora and any connected AI."})]}),(0,a.jsxs)("form",{className:"flex w-full flex-col gap-2",onSubmit:e=>{e.preventDefault(),x()},children:[(0,a.jsx)(tF.PasscodeInput,{autoFocus:!0,invalid:null!==r,onChange:e=>{i(e),l(null)},value:s}),t?(0,a.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Hint: ",t]}):null,r?(0,a.jsx)("p",{className:"text-destructive text-sm",role:"alert",children:r}):null,(0,a.jsx)(o.Button,{className:"mt-1 w-full",disabled:d||0===s.length,type:"submit",children:d?"Opening…":"Open list"})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)("button",{className:"text-muted-foreground text-xs underline underline-offset-2",onClick:()=>f(!0),type:"button",children:"Change passcode"}),(0,a.jsx)("button",{className:"text-muted-foreground text-xs underline underline-offset-2",onClick:()=>p(!0),type:"button",children:"Forgot your passcode?"})]}),(0,a.jsx)(tY,{listId:e,onOpenChange:f,open:h}),(0,a.jsx)(td.DiscardLockedPageDialog,{noun:"list",onConfirm:g,onOpenChange:p,open:u})]})})}function tY(e){let t,n,i=(0,s.c)(6),{listId:r,open:l,onOpenChange:o}=e,d=tW(r);i[0]!==d?(t=async(e,t)=>{await d.changePasscode(e,t),e3.toast.success("Passcode changed.")},i[0]=d,i[1]=t):t=i[1];let c=t;return i[2]!==c||i[3]!==o||i[4]!==l?(n=(0,a.jsx)(td.ChangePasscodeDialog,{onOpenChange:o,onSubmit:c,open:l}),i[2]=c,i[3]=o,i[4]=l,i[5]=n):n=i[5],n}function tX(e,t){let[n,a]=(0,m.useState)(new Map),s=(0,m.useRef)(new Map);return s.current=n,(0,m.useEffect)(()=>{if(0===s.current.size)return;let n=!1,i=new Map(s.current);for(let[a,r]of s.current){let s=e.find(e=>e._id===a);s&&t(s)===r&&(i.delete(a),n=!0)}n&&(s.current=i,a(i))},[e,t]),{overrides:n,ref:s,set:(e,t)=>{let n=new Map(s.current);n.set(e,t),s.current=n,a(n)}}}function tJ(e){return"object"==typeof e&&null!==e&&"userId"in e&&"string"==typeof Reflect.get(e,"userId")}function tZ(e){if(!("assignees"in e))return;let t=Reflect.get(e,"assignees");if(Array.isArray(t))return t.filter(tJ)}function t0(e,t,n,a,s,i,r,l){let o=e.filter(e=>!(n.has(e._id)||void 0!==e.sortOrder&&a.has(e.sortOrder))),d=new Set(o.map(e=>e.sortOrder).filter(e=>void 0!==e));return[...o.map(e=>({_id:e._id,assignees:tZ(e),completed:i.get(e._id)??e.completed,createdAt:e.createdAt,date:e.date,dueDate:e.dueDate,estimatedMinutes:e.estimatedMinutes,iconData:e.iconData,identifier:e.identifier,imageUrls:e.imageUrls,labels:e.labels,listId:e.listId,note:e.note,parentId:l.has(e._id)?l.get(e._id):e.parentId,priority:e.priority,projectId:e.projectId,projectName:e.projectName,pullRequestCount:e.pullRequestCount,pullRequestNumber:e.pullRequestNumber,sortOrder:r.get(e._id)??e.sortOrder??e._creationTime,statusId:e.statusId,teamId:e.teamId,text:s.get(e._id)??e.text,updatedAt:e.updatedAt})),...t.filter(e=>!d.has(e.sortOrder)).map(e=>({_id:e.tempId,completed:!1,sortOrder:e.sortOrder,text:e.text}))].sort((e,t)=>e.sortOrder-t.sortOrder)}function t1(e){return e._id}let t2=e=>e.text,t3=e=>e.completed,t4=e=>e.sortOrder,t5=e=>e.parentId;function t6(e){let t,n,a,i,r,l,o,d,c,{todos:u,createTodo:p,deleteTodo:h,updateTodo:f,toggleTodo:x,uncheckAllInList:g,deleteAllInList:v,isLoading:b}=en(e),[y,j]=(0,m.useState)([]),I=(0,m.useRef)([]);I.current=y;let[_,S]=(0,m.useState)(new Set),w=(0,m.useRef)(new Set);w.current=_;let C=(0,m.useRef)(new Set),T=tX(u,t2),N=tX(u,t3),D=tX(u,t4),L=tX(u,t5),[A,P]=(0,m.useState)(null),[O,E]=(0,m.useState)(0),[M,R]=(0,m.useState)(void 0),z=t0(u,y,_,C.current,T.overrides,N.overrides,D.overrides,L.overrides);(a=(0,s.c)(7))[0]!==A||a[1]!==I||a[2]!==u||a[3]!==P||a[4]!==j?(t=function(){if(0===I.current.length)return;let e=new Map;for(let t of u)void 0!==t.sortOrder&&e.set(t.sortOrder,t._id);let t=!1,n=[];for(let a of I.current){let s=e.get(a.sortOrder);void 0===s?n.push(a):(t=!0,A===a.tempId&&P(s))}t&&(I.current=n,j(n))},n=[u,A,I,P,j],a[0]=A,a[1]=I,a[2]=u,a[3]=P,a[4]=j,a[5]=t,a[6]=n):(t=a[5],n=a[6]),(0,m.useEffect)(t,n),(l=(0,s.c)(5))[0]!==w||l[1]!==u||l[2]!==S?(i=function(){if(0===w.current.size)return;let e=new Set(u.map(t1)),t=new Set([...w.current].filter(t=>e.has(t)));t.size<w.current.size&&(w.current=t,S(t))},r=[u,w,S],l[0]=w,l[1]=u,l[2]=S,l[3]=i,l[4]=r):(i=l[3],r=l[4]),(0,m.useEffect)(i,r),(c=(0,s.c)(14))[0]!==C.current||c[1]!==w||c[2]!==h||c[3]!==u||c[4]!==S?(o=function(){if(0!==C.current.size){for(let e of u)if(void 0!==e.sortOrder&&C.current.has(e.sortOrder)){C.current.delete(e.sortOrder);let t=new Set(w.current).add(e._id);w.current=t,S(t),h({id:e._id})}}},c[0]=C.current,c[1]=w,c[2]=h,c[3]=u,c[4]=S,c[5]=o):o=c[5],c[6]!==C.current.delete||c[7]!==C.current.has||c[8]!==C.current.size||c[9]!==w||c[10]!==h||c[11]!==u||c[12]!==S?(d=[u,h,C.current.delete,C.current.has,C.current.size,w,S],c[6]=C.current.delete,c[7]=C.current.has,c[8]=C.current.size,c[9]=w,c[10]=h,c[11]=u,c[12]=S,c[13]=d):d=c[13],(0,m.useEffect)(o,d);let B=()=>t0(u,I.current,w.current,C.current,T.ref.current,N.ref.current,D.ref.current,L.ref.current),U=e=>{let t=I.current.find(t=>t.tempId===e);if(t){let n=I.current.filter(t=>t.tempId!==e);I.current=n,j(n);let a=u.find(e=>e.sortOrder===t.sortOrder);if(a){let e=new Set(w.current).add(a._id);w.current=e,S(e),h({id:a._id})}else C.current.add(t.sortOrder);return}let n=new Set(w.current).add(e);w.current=n,S(n);let a=u.find(t=>t._id===e);a&&h({id:a._id})},F=(e,t)=>{let n=I.current.find(t=>t.tempId===e);if(n){let a=I.current.map(n=>n.tempId===e?{...n,text:t}:n);I.current=a,j(a);let s=u.find(e=>e.sortOrder===n.sortOrder);s&&f({id:s._id,text:t});return}let a=u.find(t=>t._id===e);a&&(T.set(e,t),f({id:a._id,text:t}))};return{clearFocus:()=>{P(null),E(0),R(void 0)},createBelow:(t,n,a)=>{let{date:s,listIds:i,personalInbox:r}=e,l=e.listId??(i&&i.length>0?i[0]:void 0);if(!(l||r||s))return;let o=(e=>{let t=I.current.find(t=>t.tempId===e);if(!t)return e;let n=u.find(e=>e.sortOrder===t.sortOrder);return n?n._id:e})(t),d=B(),c=d.findIndex(e=>e._id===o);if(-1===c)return;let m=d[c];if(!m)return;let h=d[c+1],x=h?h.sortOrder:m.sortOrder+1e3,g=(m.sortOrder+x)/2,v=function(e){if(!C.current.has(e))return;C.current.delete(e);let t=u.find(t=>t.sortOrder===e);if(!(t&&w.current.has(t._id)))return;let n=new Set(w.current);return n.delete(t._id),w.current=n,S(n),t}(g);if(v)T.set(v._id,n),f({id:v._id,text:n}),P(v._id),E(0),R(n);else{let e=`pending-${Date.now()}-${Math.random().toString(36).slice(2)}`,t=[...I.current,{sortOrder:g,tempId:e,text:n}];I.current=t,j(t),P(e),E(0),R(void 0),p({date:s,listId:l,parentId:(0,Z.assertOptionalId)(a?.parentId),sortOrder:g,text:n}
1).catch(console.error),(0,k.trackEvent)(k.ANALYTICS_EVENTS.todoCreated)}},deleteAllInList:e=>{let t=u.filter(t=>t.listId===e).map(e=>e._id);if(t.length>0){let e=new Set([...w.current,...t]);w.current=e,S(e)}v({listId:e})},deleteAndFocusPrevious:e=>{let t=B(),n=t.findIndex(t=>t._id===e),a=n>0?t[n-1]:void 0;U(e),a&&(P(a._id),E(Number.MAX_SAFE_INTEGER),R(void 0))},deleteTodo:U,displayTodos:z,focusCursorPosition:O,focusTodoId:A,focusWithText:M,isLoading:b,mergeIntoPrevious:(e,t)=>{let n=B(),a=n.findIndex(t=>t._id===e);if(a<=0)return;let s=n[a-1];if(!s)return;let i=s.text.length,r=s.text+t;F(s._id,r),U(e),P(s._id),E(i),R(r)},reorderTodo:(e,t)=>{let n=u.find(t=>t._id===e);n&&(D.set(e,t),f({id:n._id,sortOrder:t}))},toggleTodo:(e,t)=>{if(I.current.some(t=>t.tempId===e))return;let n=u.find(t=>t._id===e);n&&(N.set(e,t),x({completed:t,id:n._id}))},uncheckAllInList:e=>{for(let t of u)t.listId===e&&t.completed&&N.set(t._id,!1);g({listId:e})},updateImages:(e,t)=>{let n=u.find(t=>t._id===e);n&&f({id:n._id,imageUrls:t})},updateNote:(e,t)=>{let n=u.find(t=>t._id===e);return n?f({id:n._id,note:t}):Promise.reject(Error(`Task ${e} has no server row to write its note to`))},updateParentId:(e,t)=>{let n=u.find(t=>t._id===e);n&&(L.set(e,t),f({id:n._id,parentId:(0,Z.assertOptionalId)(t)}))},updateTodo:F}}var t7=e.i(6396);function t8(){let e,t,n,a=(0,s.c)(7),i=(0,J.useIsSidebarOpen)(),[r,l]=(0,m.useState)(null),[o,d]=(0,m.useState)(0);return a[0]!==i||a[1]!==o?(e=()=>{if(i)return void l(null);let e=document.getElementById("tasks-collapsed-header-slot");e?l(e):o<10&&d(t9)},t=[i,o],a[0]=i,a[1]=o,a[2]=e,a[3]=t):(e=a[2],t=a[3]),(0,m.useLayoutEffect)(e,t),a[4]!==i||a[5]!==r?(n=e=>i?e:r?(0,t7.createPortal)(e,r):null,a[4]=i,a[5]=r,a[6]=n):n=a[6],n}function t9(e){return e+1}var ne=e.i(627239),nt=e.i(830118),nn=e.i(993063),na=e.i(610782),ns=e.i(834410),ni=e.i(810468),nr=e.i(323490),nl=e.i(76075),no=e.i(723823),nd=e.i(899409),nc=e.i(406938),nu=e.i(213011),nm=e.i(876793),np=e.i(615915),nh=e.i(734498);function nf(e){let t,n,a,i,o,d,c=(0,s.c)(24),{gate:u,isGuest:m}=(0,f.useGuestGate)(),p=m||null==e||e===et.LOCAL_MY_TASKS_LIST_ID;c[0]!==u||c[1]!==e||c[2]!==p?(t=p?"skip":u({id:e}),c[0]=u,c[1]=e,c[2]=p,c[3]=t):t=c[3];let h=(0,l.useQuery)(r.api.todo_lists.queries.getById,t),x=(0,l.useMutation)(r.api.todo_lists.list_organization.publish),g=(0,l.useMutation)(r.api.todo_lists.list_organization.unpublish),v=!!h?.isPublic;c[4]!==h?(n=h?.slug??(h?.name&&h.name.toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-|-$/g,"").slice(0,50)||"list"),c[4]=h,c[5]=n):n=c[5];let b=n,y=e?`/t/${b}_${e}`:null;c[6]!==m||c[7]!==e||c[8]!==x?(a=async()=>{if(e&&!m)return await x({id:e})},c[6]=m,c[7]=e,c[8]=x,c[9]=a):a=c[9];let j=a;c[10]!==m||c[11]!==e||c[12]!==g?(i=async()=>{if(e&&!m)return await g({id:e})},c[10]=m,c[11]=e,c[12]=g,c[13]=i):i=c[13];let I=i;c[14]!==v||c[15]!==j||c[16]!==I?(o=async()=>{v?await I():await j()},c[14]=v,c[15]=j,c[16]=I,c[17]=o):o=c[17];let _=o;return c[18]!==v||c[19]!==j||c[20]!==y||c[21]!==_||c[22]!==I?(d={isPublic:v,shareUrl:y,publish:j,unpublish:I,toggleVisibility:_},c[18]=v,c[19]=j,c[20]=y,c[21]=_,c[22]=I,c[23]=d):d=c[23],d}function nx(e){let t,n,i,d,c,u,p,h,x,g,v,b=(0,s.c)(34),{listId:y,onToggleVisibility:j,isPublic:I}=e,{shareUrl:_}=nf(y),{gate:S,isGuest:k}=(0,f.useGuestGate)();b[0]!==S||b[1]!==k||b[2]!==y?(t=k?"skip":S({id:y}),b[0]=S,b[1]=k,b[2]=y,b[3]=t):t=b[3];let w=(0,l.useQuery)(r.api.todo_lists.share_queries.getSpaceAccess,t),[C,T]=(0,m.useState)(!1);b[4]!==_?(n=async()=>{_&&(await navigator.clipboard.writeText((0,nm.buildShareUrl)(_)),T(!0),e3.toast.success("Link copied to clipboard"),setTimeout(()=>T(!1),2e3))},b[4]=_,b[5]=n):n=b[5];let N=n;b[6]!==_?(i=_&&(0,a.jsx)(o.Button,{"aria-label":"Open list link",className:"text-muted-foreground hover:text-foreground",onClick:()=>{window.open((0,nm.buildShareUrl)(_),"_blank","noopener,noreferrer")},size:"icon",variant:"ghost",children:(0,a.jsx)(nd.ExternalLink,{className:"h-3.5 w-3.5"})}),b[6]=_,b[7]=i):i=b[7];let D=C?"Link copied":"Copy link";b[8]!==C?(d=C?(0,a.jsx)(ep.Check,{className:"h-3.5 w-3.5 text-green-500"}):(0,a.jsx)(nu.Link2,{className:"h-3.5 w-3.5"}),b[8]=C,b[9]=d):d=b[9],b[10]!==N||b[11]!==D||b[12]!==d?(c=(0,a.jsx)(o.Button,{"aria-label":D,className:"text-muted-foreground hover:text-foreground",onClick:N,size:"icon",variant:"ghost",children:d}),b[10]=N,b[11]=D,b[12]=d,b[13]=c):c=b[13],b[14]!==i||b[15]!==c?(u=(0,a.jsxs)(a.Fragment,{children:[i,c]}
1),b[14]=i,b[15]=c,b[16]=u):u=b[16],b[17]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(no.TabsTrigger,{value:"share",children:"Share"}),(0,a.jsx)(no.TabsTrigger,{value:"publish",children:"Publish"})]}),b[17]=p):p=b[17],b[18]!==u?(h=(0,a.jsx)(np.ShareTabsHeader,{actions:u,tabs:p}),b[18]=u,b[19]=h):h=b[19];let L=w??null;return b[20]!==I||b[21]!==j||b[22]!==L?(x=(0,a.jsx)(no.TabsContent,{className:"p-0",value:"share",children:(0,a.jsx)("div",{className:"space-y-3 p-3",children:(0,a.jsx)(ng,{isPublic:I,onToggle:j,spaceAccess:L})})}),b[20]=I,b[21]=j,b[22]=L,b[23]=x):x=b[23],b[24]!==N||b[25]!==I||b[26]!==C||b[27]!==j||b[28]!==_?(g=(0,a.jsx)(no.TabsContent,{className:"max-h-96 overflow-y-auto p-3",value:"publish",children:(0,a.jsx)(nv,{isPublic:I,linkCopied:C,onCopyLink:N,onToggle:j,shareUrl:_})}),b[24]=N,b[25]=I,b[26]=C,b[27]=j,b[28]=_,b[29]=g):g=b[29],b[30]!==x||b[31]!==g||b[32]!==h?(v=(0,a.jsxs)(no.Tabs,{defaultValue:"share",children:[h,x,g]}),b[30]=x,b[31]=g,b[32]=h,b[33]=v):v=b[33],v}function ng(e){let t,n,i,r,l,c,u,m,p,h,f=(0,s.c)(25),{isPublic:x,onToggle:g,spaceAccess:v}=e;f[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(d.Text,{className:"mb-1.5",variant:"caption",children:"General access"}),f[0]=t):t=f[0],f[1]!==v?(n=v?(0,a.jsx)(nh.SpaceAccessSummaryRow,{access:v}):null,f[1]=v,f[2]=n):n=f[2],f[3]!==x?(i=(0,a.jsx)("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-muted",children:x?(0,a.jsx)(nc.Globe,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,a.jsx)(tU.Lock,{className:"h-3.5 w-3.5 text-muted-foreground"})}),f[3]=x,f[4]=i):i=f[4];let b=null!==v;if(f[5]!==x||f[6]!==b)r=x?"Anyone with the link":b?"No one outside the Space":"Only you",f[5]=x,f[6]=b,f[7]=r;else r=f[7];f[8]!==r?(l=(0,a.jsx)(d.Text,{variant:"label",children:r}),f[8]=r,f[9]=l):l=f[9],f[10]!==i||f[11]!==l?(c=(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[i,l]}),f[10]=i,f[11]=l,f[12]=c):c=f[12];let y=x?"Make list private":"Make list public";return f[13]!==x?(u=x?(0,a.jsx)(ns.Eye,{className:"h-3.5 w-3.5 text-sky-600 dark:text-sky-500"}):(0,a.jsx)(ni.EyeClosed,{className:"h-3.5 w-3.5"}),f[13]=x,f[14]=u):u=f[14],f[15]!==g||f[16]!==y||f[17]!==u?(m=(0,a.jsx)(o.Button,{"aria-label":y,className:"h-7 text-xs",onClick:g,size:"sm",variant:"ghost",children:u}),f[15]=g,f[16]=y,f[17]=u,f[18]=m):m=f[18],f[19]!==m||f[20]!==c?(p=(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-lg px-1 py-1.5",children:[c,m]}),f[19]=m,f[20]=c,f[21]=p):p=f[21],f[22]!==p||f[23]!==n?(h=(0,a.jsxs)("div",{children:[t,n,p]}),f[22]=p,f[23]=n,f[24]=h):h=f[24],h}function nv(e){let t,n,i,r,l,c,u,m=(0,s.c)(18),{isPublic:p,shareUrl:h,linkCopied:f,onCopyLink:x,onToggle:g}=e;return m[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsxs)(nl.CardHeader,{children:[(0,a.jsx)(nl.CardTitle,{className:"text-base",children:"Share link"}),(0,a.jsx)(nl.CardDescription,{children:"Publish this list so anyone with the link can view it"})]}),m[0]=t):t=m[0],m[1]!==p||m[2]!==f||m[3]!==x||m[4]!==h?(n=p&&h&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-muted/40 px-3 py-2",children:[(0,a.jsx)(d.Text,{as:"span",className:"min-w-0 flex-1 truncate font-mono",variant:"caption",children:h}),(0,a.jsx)(o.Button,{"aria-label":f?"Copied":"Copy list link",className:"shrink-0 text-muted-foreground",onClick:x,size:"icon-xs",variant:"ghost",children:f?(0,a.jsx)(ep.Check,{className:"h-3 w-3 text-green-500"}):(0,a.jsx)(nu.Link2,{className:"h-3 w-3"})}),(0,a.jsx)(o.Button,{"aria-label":"Open link",className:"shrink-0 text-muted-foreground",onClick:()=>{window.open((0,nm.buildShareUrl)(h),"_blank","noopener,noreferrer")},size:"icon-xs",variant:"ghost",children:(0,a.jsx)(nd.ExternalLink,{className:"h-3 w-3"})})]}),m[1]=p,m[2]=f,m[3]=x,m[4]=h,m[5]=n):n=m[5],m[6]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsxs)("div",{className:"space-y-0.5",children:[(0,a.jsx)(d.Text,{variant:"label",children:"Publish list"}),(0,a.jsx)(d.Text,{variant:"caption",children:"Anyone with the link can view tasks in this list"})]}
1),m[6]=i):i=m[6],m[7]!==p||m[8]!==g?(r=(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[i,(0,a.jsx)(eQ.Switch,{checked:p,onCheckedChange:g})]}),m[7]=p,m[8]=g,m[9]=r):r=m[9],m[10]!==n||m[11]!==r?(l=(0,a.jsxs)(nl.CardContent,{className:"space-y-3",children:[n,r]}),m[10]=n,m[11]=r,m[12]=l):l=m[12],m[13]!==p?(c=(0,a.jsx)(nl.CardFooter,{children:(0,a.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:p?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ns.Eye,{className:"h-4 w-4 text-sky-600 dark:text-sky-500"}),(0,a.jsxs)(nr.Badge,{className:"gap-1",variant:"emerald",children:[(0,a.jsx)(nc.Globe,{className:"h-3 w-3"}),"Live"]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ni.EyeClosed,{className:"h-4 w-4"}),(0,a.jsx)(nr.Badge,{variant:"secondary",children:"Private"})]})})}),m[13]=p,m[14]=c):c=m[14],m[15]!==l||m[16]!==c?(u=(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)(nl.Card,{children:[t,l,c]})}),m[15]=l,m[16]=c,m[17]=u):u=m[17],u}function nb(e){let t,n,i,r,l,d,c,u,m=(0,s.c)(27),{listId:p,isPublic:h,onToggleVisibility:f,open:x,onOpenChange:g}=e,v=x?"Close share menu":"Open share menu",b=h?"Make list private":"Make list public",y=h?"text-sky-600 dark:text-sky-500":"";m[0]!==h?(t=h?(0,a.jsx)(ns.Eye,{className:"h-3 w-3"}):(0,a.jsx)(ni.EyeClosed,{className:"h-3 w-3"}),m[0]=h,m[1]=t):t=m[1],m[2]!==f||m[3]!==b||m[4]!==y||m[5]!==t?(n=(0,a.jsx)(o.Button,{"aria-label":b,className:y,onClick:f,size:"icon-xs",variant:"ghost",children:t}),m[2]=f,m[3]=b,m[4]=y,m[5]=t,m[6]=n):n=m[6];let j=x?"secondary":"ghost";return m[7]!==v||m[8]!==j?(i=(0,a.jsx)(o.Button,{"aria-label":v,size:"icon-xs",variant:j}),m[7]=v,m[8]=j,m[9]=i):i=m[9],m[10]!==x?(r=x?(0,a.jsx)(na.ChevronUp,{className:"h-3 w-3"}):(0,a.jsx)(eh.ChevronDown,{className:"h-3 w-3"}),m[10]=x,m[11]=r):r=m[11],m[12]!==i||m[13]!==r?(l=(0,a.jsx)(eL.PopoverTrigger,{render:i,children:r}),m[12]=i,m[13]=r,m[14]=l):l=m[14],m[15]!==n||m[16]!==l?(d=(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[n,l]}),m[15]=n,m[16]=l,m[17]=d):d=m[17],m[18]!==h||m[19]!==p||m[20]!==f?(c=(0,a.jsx)(eL.PopoverContent,{align:"end",className:"w-[calc(100vw-2rem)] gap-0 p-0 sm:w-96",sideOffset:8,children:(0,a.jsx)(nx,{isPublic:h,listId:p,onToggleVisibility:f})}),m[18]=h,m[19]=p,m[20]=f,m[21]=c):c=m[21],m[22]!==g||m[23]!==x||m[24]!==c||m[25]!==d?(u=(0,a.jsxs)(eL.Popover,{onOpenChange:g,open:x,children:[d,c]}),m[22]=g,m[23]=x,m[24]=c,m[25]=d,m[26]=u):u=m[26],u}var ny=e.i(26247),nj=e.i(869409);function nI(e){let t,n,a,i=(0,s.c)(6),r=(0,m.useRef)(null);i[0]!==e?(t=t=>{r.current=t,e.setNodeRef(t)},i[0]=e,i[1]=t):t=i[1];let l=t;return i[2]!==e.transform||i[3]!==e.transition?(n=function(){let t=r.current;t&&(t.style.transform=tr.CSS.Transform.toString(e.transform)??"",t.style.transition=e.transition??"")},a=[e.transform,e.transition],i[2]=e.transform,i[3]=e.transition,i[4]=n,i[5]=a):(n=i[4],a=i[5]),(0,m.useLayoutEffect)(n,a),l}function n_(e){let t,n,i,r,l,c,u,p,h,f,x=(0,s.c)(37),{onChange:g,property:v}=e,[b,y]=(0,m.useState)(!1);x[0]!==v.key?(t={id:v.key},x[0]=v.key,x[1]=t):t=x[1];let I=(0,tE.useSortable)(t);x[2]!==I.setNodeRef||x[3]!==I.transform||x[4]!==I.transition?(n={setNodeRef:I.setNodeRef,transform:I.transform,transition:I.transition},x[2]=I.setNodeRef,x[3]=I.transform,x[4]=I.transition,x[5]=n):n=x[5];let _=nI(n),S=tb[v.key];x[6]!==v?(i=t_(v),x[6]=v,x[7]=i):i=x[7];let k=i,w=I.isDragging&&"opacity-50";x[8]!==w?(r=(0,j.cn)("group flex items-center gap-1.5 rounded-md px-1.5 py-1 hover:bg-surface-hover",w),x[8]=w,x[9]=r):r=x[9];let C=`Reorder ${k}`;return x[10]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(nj.GripVertical,{}),x[10]=l):l=x[10],x[11]!==I.listeners||x[12]!==C?(c=(0,a.jsx)(o.Button,{"aria-label":C,size:"icon-xs",tabIndex:-1,type:"button",variant:"ghost",...I.listeners,children:l}),x[11]=I.listeners,x[12]=C,x[13]=c):c=x[13],x[14]!==b||x[15]!==k||x[16]!==g||x[17]!==v?(u=b?(0,a.jsx)(nk,{initialName:k,onCancel:()=>y(!1),onCommit:e=>{g({...v,label:e}),y(!1)}}):(0,a.jsx)(o.Button,{className:"min-w-0 flex-1 justify-start",onClick:()=>y(!0),size:"sm",type:"button",variant:"ghost",children:(0,a.jsx)(d.Text,{as:"span",className:"truncate",variant:"label",children:k})}),x[14]=b,x[15]=k,x[16]=g,x[17]=v,x[18]=u):u=x[18],x[19]!==S.rows||x[20]!==k||x[21]!==g||x[22]!==v?(p=S.rows?(0,a.jsx)(nS,{checked:v.showInRows,label:`${k} on rows`,onChange:e=>g({...v,showInRows:e}),text:"Rows"}):null,x[19]=S.rows,x[20]=k,x[21]=g,x[22]=v,x[23]=p):p=x[23],x[24]!==S.cards||x[25]!==k||x[26]!==g||x[27]!==v?(h=S.cards?(0,a.jsx)(nS,{checked:v.showOnCards,label:`${k} on cards`,onChange:e=>g({...v,showOnCards:e}),text:"Cards"}):null,x[24]=S.cards,x[25]=k,x[26]=g,x[27]=v,x[28]=h):h=x[28],x[29]!==I.attributes||x[30]!==_||x[31]!==p||x[32]!==h||x[33]!==r||x[34]!==c||x[35]!==u?(f=(0,a.jsxs)("div",{className:r,ref:_,...I.attributes,children:[c,u,p,h]}),x[29]=I.attributes,x[30]=_,x[31]=p,x[32]=h,x[33]=r,x[34]=c,x[35]=u,x[36]=f):f=x[36],f}function nS(e){let t,n,i,r=(0,s.c)(9),{checked:l,label:o,onChange:c,text:u}=e;return r[0]!==u?(t=(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:u}),r[0]=u,r[1]=t):t=r[1],r[2]!==l||r[3]!==o||r[4]!==c?(n=(0,a.jsx)(eQ.Switch,{"aria-label":o,checked:l,onCheckedChange:c,size:"sm"}),r[2]=l,r[3]=o,r[4]=c,r[5]=n):n=r[5],r[6]!==t||r[7]!==n?(i=(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[t,n]}),r[6]=t,r[7]=n,r[8]=i):i=r[8],i}function nk(e){let t,n,i,r,l=(0,s.c)(11),{initialName:o,onCancel:d,onCommit:c}=e,[u,p]=(0,m.useState)(o);l[0]!==u||l[1]!==c?(t=()=>c(u.trim()),l[0]=u,l[1]=c,l[2]=t):t=l[2];let h=t;return l[3]===Symbol.for("react.memo_cache_sentinel")?(n=e=>p(e.target.value),l[3]=n):n=l[3],l[4]!==h||l[5]!==d?(i=e=>{"Enter"===e.key?h():"Escape"===e.key&&d()},l[4]=h,l[5]=d,l[6]=i):i=l[6],l[7]!==h||l[8]!==u||l[9]!==i?(r=(0,a.jsx)(ey.Input,{autoFocus:!0,className:"h-6 flex-1",onBlur:h,onChange:n,onKeyDown:i,value:u}),l[7]=h,l[8]=u,l[9]=i,l[10]=r):r=l[10],r}function nw(e){let t,n,r,l,o,c,u=(0,s.c)(15),{onChange:m,properties:p}=e;u[0]!==m||u[1]!==p?(t=e=>{let{active:t,over:n}=e;if(!n)return;let a=function(e,t,n){let a=e.findIndex(e=>e.key===t),s=e.findIndex(e=>e.key===n);if(-1===a||-1===s||a===s)return;let i=[...e],[r]=i.splice(a,1);if(r)return i.splice(s,0,r),i}(p,String(t.id),String(n.id));a&&m(a)},u[0]=m,u[1]=p,u[2]=t):t=u[2];let h=t;return u[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(d.Text,{as:"span",className:"px-1.5",variant:"overline",children:"Properties"}),u[3]=n):n=u[3],u[4]!==p?(r=p.map(nC),u[4]=p,u[5]=r):r=u[5],u[6]!==m||u[7]!==
1p?(l=p.map(e=>(0,a.jsx)(n_,{onChange:e=>m(p.map(t=>t.key===e.key?e:t)),property:e},e.key)),u[6]=m,u[7]=p,u[8]=l):l=u[8],u[9]!==r||u[10]!==l?(o=(0,a.jsx)(tE.SortableContext,{items:r,strategy:tE.verticalListSortingStrategy,children:l}),u[9]=r,u[10]=l,u[11]=o):o=u[11],u[12]!==h||u[13]!==o?(c=(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[n,(0,a.jsx)(i.DndContext,{collisionDetection:i.closestCenter,onDragEnd:h,children:o})]}),u[12]=h,u[13]=o,u[14]=c):c=u[14],c}function nC(e){return e.key}var nT=e.i(439779);function nN(e){let t,n,i,r,l,d,c=(0,s.c)(14),{onCancel:u,onConfirm:m,open:p}=e;return c[0]!==u?(t=e=>e?void 0:u(),c[0]=u,c[1]=t):t=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(nT.DialogHeader,{children:(0,a.jsx)(nT.DialogTitle,{children:"This is a shared view. Are you sure you want to make this change for everyone?"})}),c[2]=n):n=c[2],c[3]!==u?(i=(0,a.jsx)(o.Button,{onClick:u,type:"button",variant:"ghost",children:"Cancel"}),c[3]=u,c[4]=i):i=c[4],c[5]!==m?(r=(0,a.jsx)(o.Button,{onClick:m,type:"button",children:"Yes"}),c[5]=m,c[6]=r):r=c[6],c[7]!==i||c[8]!==r?(l=(0,a.jsxs)(nT.DialogContent,{className:"max-w-sm",children:[n,(0,a.jsxs)(nT.DialogFooter,{children:[i,r]})]}),c[7]=i,c[8]=r,c[9]=l):l=c[9],c[10]!==p||c[11]!==t||c[12]!==l?(d=(0,a.jsx)(nT.Dialog,{onOpenChange:t,open:p,children:l}),c[10]=p,c[11]=t,c[12]=l,c[13]=d):d=c[13],d}function nD(e){let t,n,i,r,l,o,d,c,u=(0,s.c)(22),p=tC(e),h=tT(e),[f,x]=(0,m.useState)(null);u[0]!==p?(t=e=>{"shared"===p.mode?x({apply:e}):e()},u[0]=p,u[1]=t):t=u[1];let g=t;u[2]===Symbol.for("react.memo_cache_sentinel")?(n=()=>x(null),u[2]=n):n=u[2],u[3]!==f?(i=()=>{f?.apply(),x(null)},u[3]=f,u[4]=i):i=u[4];let v=null!==f;return u[5]!==i||u[6]!==v?(r=(0,a.jsx)(nN,{onCancel:n,onConfirm:i,open:v}),u[5]=i,u[6]=v,u[7]=r):r=u[7],u[8]!==h||u[9]!==g?(l=e=>g(()=>h?.setKanbanEnabled(e)),u[8]=h,u[9]=g,u[10]=l):l=u[10],u[11]!==h?(o=e=>h?.setMode(e),u[11]=h,u[12]=o):o=u[12],u[13]!==h||u[14]!==g?(d=e=>g(()=>h?.setProperties(e)),u[13]=h,u[14]=g,u[15]=d):d=u[15],u[16]!==r||u[17]!==l||u[18]!==o||u[19]!==d||u[20]!==p?(c={confirmDialog:r,setKanbanEnabled:l,setMode:o,setProperties:d,view:p},u[16]=r,u[17]=l,u[18]=o,u[19]=d,u[20]=p,u[21]=c):c=u[21],c}function nL(e,t){return e.getQuery(r.api.todo_lists.status_queries.getStatusOptions,{listId:t})??void 0}function nA(e,t,n){e.setQuery(r.api.todo_lists.status_queries.getStatusOptions,{listId:t},n)}function nP(e,t){let n=nL(e,t.listId);n&&nA(e,t.listId,{...n,defaultOptionByGroup:{...n.defaultOptionByGroup,[t.group]:t.optionId}})}function nO(e,t){let n=e.filter(e=>e.group===t);return 0===n.length?0:n.reduce((e,t)=>Math.max(e,t.sortOrder),-1)+1}function nE(e,t){let n=nL(e,t.listId);if(!n)return;let a=`${t.listId}_st_${t.group}_pending_${Date.now().toString(36)}`,s={group:t.group,id:a,name:t.name,sortOrder:nO(n.statusOptions,t.group)};nA(e,t.listId,{...n,statusOptions:[...n.statusOptions,s]})}function nM(e,t){let n=nL(e,t.listId);if(!n)return;let a=n.statusOptions.map(e=>e.id===t.optionId?{...e,glyph:t.glyph??e.glyph,name:t.name??e.name}:e);if(!t.group)return void nA(e,t.listId,{...n,statusOptions:a});let s=function(e){let t=e.options.find(t=>t.id===e.optionId);if(!t||t.group===e.targetGroup)return{defaults:e.defaults,options:e.options};let n=t.group,a=e.defaults;if(e.defaults[n]===t.id){let s=e.options.find(e=>e.group===n&&e.id!==t.id);s&&(a={...e.defaults,[n]:s.id})}let s=nO(e.options,e.targetGroup);return{defaults:a,options:e.options.map(n=>n.id===t.id?{...n,group:e.targetGroup,sortOrder:s}:n)}}({defaults:n.defaultOptionByGroup,optionId:t.optionId,options:a,targetGroup:t.group});nA(e,t.listId,{...n,defaultOptionByGroup:s.defaults,statusOptions:s.options})}function nR(e,t){let n=nL(e,t.listId);n&&(nA(e,t.listId,{...n,statusOptions:n.statusOptions.filter(e=>e.id!==t.optionId)}),function(e,t,n){for(let{args:a,value:s}of e.getAllQueries(r.api.todos.queries.getAll)){if(void 0===s)continue;let i=s.map(e=>e.statusId===t?{...e,statusId:n,updatedAt:Date.now()}:e);e.setQuery(r.api.todos.queries.getAll,a,i)}}(e,t.optionId,t.remapToOptionId))}function nz(e,t){let n=nL(e,t.listId);if(!n)return;let a=new Map(t.orderedIds.map((e,t)=>[e,t])),s=n.statusOptions.map(e=>{if(e.group!==t.group)return e;let n=a.get(e.id);return void 0===n?e:{...e,sortOrder:n}});nA(e,t.listId,{...n,statusOptions:s})}var nB=e.i(513270),nU=e.i(441266),nF=e.i(900280),nG=e.i(89016),nq=e.i(447945),n$=e.i(304358),nK=e.i(423903),nK=nK,nQ=e.i(613412),nQ=nQ;let nV={backlog:nq.CircleDashed,blocked:nQ.default,canceled:nU.Ban,done:nG.CircleCheck,in_progress:n$.CircleDot,in_review:nK.default,todo:nF.Circle},nW={backlog:"text-muted-foreground",blocked:"text-destructive",canceled:"text-muted-foreground",done:"text-success",in_progress:"text-warning",in_review:"text-chart-5",todo:"text-chart-1"};function nH(e){let t,n,i=(0,s.c)(5),{glyph:r}=e,l=nV[r],o=nW[r];return i[0]!==o?(t=(0,j.cn)("size-3.5 shrink-0",o),i[0]=o,i[1]=t):t=i[1],i[2]!==l||i[3]!==t?(n=(0,a.jsx)(l,{"aria-hidden":!0,
1className:t}),i[2]=l,i[3]=t,i[4]=n):n=i[4],n}function nY(e){return"complete"===e?"done":e}function nX(e){let t,n,i,r,l,c,u,p,h,f,x,g,v,b=(0,s.c)(36),{open:y,option:j,candidates:I,onCancel:_,onConfirm:S}=e,[k,w]=(0,m.useState)(I[0]?.id);if(b[0]!==_?(t=e=>e?void 0:_(),b[0]=_,b[1]=t):t=b[1],b[2]!==j.name?(n=(0,a.jsxs)(nT.DialogTitle,{children:['Delete "',j.name,'"?']}),b[2]=j.name,b[3]=n):n=b[3],b[4]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(nT.DialogDescription,{children:"Reassign its tasks to another status in this group."}),b[4]=i):i=b[4],b[5]!==n?(r=(0,a.jsxs)(nT.DialogHeader,{children:[n,i]}),b[5]=n,b[6]=r):r=b[6],b[7]!==I.length?(l=0===I.length?(0,a.jsx)(d.Text,{variant:"bodyMuted",children:"Add another status in this group before deleting this one."}):null,b[7]=I.length,b[8]=l):l=b[8],b[9]!==I||b[10]!==k){let e;b[12]!==k?(e=e=>(0,a.jsxs)(o.Button,{"aria-pressed":e.id===k,className:"justify-start",onClick:()=>w(e.id),type:"button",variant:e.id===k?"selected":"ghost",children:[(0,a.jsx)(nH,{glyph:e.glyph??nY(e.group)}),e.name]},e.id),b[12]=k,b[13]=e):e=b[13],c=I.map(e),b[9]=I,b[10]=k,b[11]=c}else c=b[11];b[14]!==l||b[15]!==c?(u=(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[l,c]}),b[14]=l,b[15]=c,b[16]=u):u=b[16],b[17]!==_?(p=(0,a.jsx)(o.Button,{onClick:_,type:"button",variant:"ghost",children:"Cancel"}),b[17]=_,b[18]=p):p=b[18];let C=!k||0===I.length;return b[19]!==S||b[20]!==k?(h=()=>{k&&S(k)},b[19]=S,b[20]=k,b[21]=h):h=b[21],b[22]!==h||b[23]!==C?(f=(0,a.jsx)(o.Button,{disabled:C,onClick:h,type:"button",variant:"destructive",children:"Delete and remap"}),b[22]=h,b[23]=C,b[24]=f):f=b[24],b[25]!==f||b[26]!==p?(x=(0,a.jsxs)(nT.DialogFooter,{children:[p,f]}),b[25]=f,b[26]=p,b[27]=x):x=b[27],b[28]!==x||b[29]!==r||b[30]!==u?(g=(0,a.jsxs)(nT.DialogContent,{children:[r,u,x]}),b[28]=x,b[29]=r,b[30]=u,b[31]=g):g=b[31],b[32]!==y||b[33]!==t||b[34]!==g?(v=(0,a.jsx)(nT.Dialog,{onOpenChange:t,open:y,children:g}),b[32]=y,b[33]=t,b[34]=g,b[35]=v):v=b[35],v}var nJ=e.i(279593),nZ=e.i(708737),n0=e.i(547523);function n1(e){let t,n,i,r,l,d=(0,s.c)(9),c=`Edit ${e.option.name}`;return d[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(o.Button,{size:"icon-sm",variant:"ghost"}),n=(0,a.jsx)(n0.ChevronRight,{}),d[0]=t,d[1]=n):(t=d[0],n=d[1]),d[2]!==c?(i=(0,a.jsx)(eL.PopoverTrigger,{"aria-label":c,render:t,children:n}),d[2]=c,d[3]=i):i=d[3],d[4]!==e?(r=(0,a.jsx)(eL.PopoverContent,{align:"start",className:"w-72",side:"right",children:(0,a.jsx)(n2,{...e})}),d[4]=e,d[5]=r):r=d[5],d[6]!==i||d[7]!==r?(l=(0,a.jsxs)(eL.Popover,{children:[i,r]}),d[6]=i,d[7]=r,d[8]=l):l=d[8],l}function n2(e){let t,n,i,r,l,o,d,c,u,m,p,h,f,x,g,v=(0,s.c)(32),{option:b,isDefault:y,onGlyphChange:j,onGroupChange:I,onNameChange:_,onSetDefault:S}=e;return v[0]!==_||v[1]!==b.name?(t=(0,a.jsx)(n8,{initialName:b.name,onCommit:_}),v[0]=_,v[1]=b.name,v[2]=t):t=v[2],v[3]!==S?(n=e=>{e&&S()},v[3]=S,v[4]=n):n=v[4],v[5]!==y||v[6]!==n?(i=(0,a.jsx)(n7,{label:"Default",children:(0,a.jsx)(eQ.Switch,{checked:y,disabled:y,onCheckedChange:n})}),v[5]=y,v[6]=n,v[7]=i):i=v[7],v[8]===Symbol.for("react.memo_cache_sentinel")?(r=nB.STATUS_GROUPS.map(n6),v[8]=r):r=v[8],v[9]!==I?(l=e=>{if(null===e)return;let t=nB.STATUS_GROUPS.find(t=>t===e);t&&I(t)},v[9]=I,v[10]=l):l=v[10],v[11]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsx)(nZ.SelectTrigger,{className:"w-36",children:(0,a.jsx)(nZ.SelectValue,{})}),v[11]=o):o=v[11],v[12]===Symbol.for("react.memo_cache_sentinel")?(d=(0,a.jsx)(nZ.SelectContent,{children:nB.STATUS_GROUPS.map(n5)}),v[12]=d):d=v[12],v[13]!==b.group||v[14]!==l?(c=(0,a.jsx)(n7,{label:"Group",children:(0,a.jsxs)(nZ.Select,{items:r,onValueChange:l,value:b.group,children:[o,d]})}),v[13]=b.group,v[14]=l,v[15]=c):c=v[15],v[16]===Symbol.for("react.memo_cache_sentinel")?(u=nB.STATUS_GLYPHS.map(n4),v[16]=u):u=v[16],v[17]!==j?(m=e=>{if(null===e)return;let t=nB.STATUS_GLYPHS.find(t=>t===e);t&&j(t)},v[17]=j,v[18]=m):m=v[18],v[19]!==b.glyph||v[20]!==b.group?(p=b.glyph??nY(b.group),v[19]=b.glyph,v[20]=b.group,v[21]=p):p=v[21],v[22]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":"Status glyph",className:"w-36",children:(0,a.jsx)(nZ.SelectValue,{})}),v[22]=h):h=v[22],v[23]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)(nZ.SelectContent,{children:nB.STATUS_GLYPHS.map(n3)}
1),v[23]=f):f=v[23],v[24]!==m||v[25]!==p?(x=(0,a.jsx)(n7,{label:"Glyph",children:(0,a.jsxs)(nZ.Select,{items:u,onValueChange:m,value:p,children:[h,f]})}),v[24]=m,v[25]=p,v[26]=x):x=v[26],v[27]!==t||v[28]!==x||v[29]!==i||v[30]!==c?(g=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[t,i,c,x]}),v[27]=t,v[28]=x,v[29]=i,v[30]=c,v[31]=g):g=v[31],g}function n3(e){return(0,a.jsxs)(nZ.SelectItem,{value:e,children:[(0,a.jsx)(nH,{glyph:e}),e.replace("_"," ")]},e)}function n4(e){return{label:e,value:e}}function n5(e){return(0,a.jsx)(nZ.SelectItem,{value:e,children:nB.STATUS_GROUP_LABELS[e]},e)}function n6(e){return{label:nB.STATUS_GROUP_LABELS[e],value:e}}function n7(e){let t,n,i=(0,s.c)(5),{children:r,label:l}=e;return i[0]!==l?(t=(0,a.jsx)(d.Text,{as:"span",variant:"label",children:l}),i[0]=l,i[1]=t):t=i[1],i[2]!==r||i[3]!==t?(n=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-2 py-1",children:[t,r]}),i[2]=r,i[3]=t,i[4]=n):n=i[4],n}function n8(e){let t,n,i,r,l=(0,s.c)(11),{initialName:o,onCommit:d}=e,[c,u]=(0,m.useState)(o);l[0]!==o||l[1]!==c||l[2]!==d?(t=()=>{let e=c.trim();e&&e!==o&&d(e)},l[0]=o,l[1]=c,l[2]=d,l[3]=t):t=l[3];let p=t;return l[4]===Symbol.for("react.memo_cache_sentinel")?(n=e=>u(e.target.value),l[4]=n):n=l[4],l[5]!==p?(i=e=>{"Enter"===e.key&&p()},l[5]=p,l[6]=i):i=l[6],l[7]!==p||l[8]!==c||l[9]!==i?(r=(0,a.jsx)(ey.Input,{autoFocus:!0,onBlur:p,onChange:n,onKeyDown:i,placeholder:"Status name",value:c}),l[7]=p,l[8]=c,l[9]=i,l[10]=r):r=l[10],r}function n9(e){let t,n,i,r,l,c,u,m,p,h,f,x,g=(0,s.c)(40);g[0]!==e.option.id?(t={id:e.option.id},g[0]=e.option.id,g[1]=t):t=g[1];let v=(0,tE.useSortable)(t);g[2]!==v.setNodeRef||g[3]!==v.transform||g[4]!==v.transition?(n={setNodeRef:v.setNodeRef,transform:v.transform,transition:v.transition},g[2]=v.setNodeRef,g[3]=v.transform,g[4]=v.transition,g[5]=n):n=g[5];let b=nI(n),y=v.isDragging&&"opacity-50";return g[6]!==y?(i=(0,j.cn)("group flex items-center gap-1.5 rounded-md px-1.5 py-1 hover:bg-surface-hover",y),g[6]=y,g[7]=i):i=g[7],g[8]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(nj.GripVertical,{}),g[8]=r):r=g[8],g[9]!==v.listeners?(l=(0,a.jsx)(o.Button,{"aria-label":"Drag to reorder",size:"icon-xs",tabIndex:-1,type:"button",variant:"ghost",...v.listeners,children:r}),g[9]=v.listeners,g[10]=l):l=g[10],g[11]!==e.option.glyph||g[12]!==e.option.group?(c=e.option.glyph??nY(e.option.group),g[11]=e.option.glyph,g[12]=e.option.group,g[13]=c):c=g[13],g[14]!==c?(u=(0,a.jsx)(nH,{glyph:c}),g[14]=c,g[15]=u):u=g[15],g[16]!==e?(m=e.isEditing?(0,a.jsx)(ae,{initialName:e.option.name,onCancel:()=>e.onEditingChange(!1),onCommit:t=>{e.onNameChange(t),e.onEditingChange(!1)}}):(0,a.jsxs)(o.Button,{className:"min-w-0 flex-1 justify-start",onClick:()=>e.onEditingChange(!0),size:"sm",type:"button",variant:"ghost",children:[(0,a.jsx)(d.Text,{as:"span",className:"truncate",variant:"label",children:e.option.name}),e.isDefault?(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:"default"}):null]}),g[16]=e,g[17]=m):m=g[17],g[18]!==e.isDefault||g[19]!==e.onGlyphChange||g[20]!==e.onGroupChange||g[21]!==e.onNameChange||g[22]!==e.onSetDefault||g[23]!==e.option?(p=(0,a.jsx)(n1,{isDefault:e.isDefault,onGlyphChange:e.onGlyphChange,onGroupChange:e.onGroupChange,onNameChange:e.onNameChange,onSetDefault:e.onSetDefault,option:e.option}),g[18]=e.isDefault,g[19]=e.onGlyphChange,g[20]=e.onGroupChange,g[21]=e.onNameChange,g[22]=e.onSetDefault,g[23]=e.option,g[24]=p):p=g[24],g[25]!==e.isDefault||g[26]!==e.onDelete?(h=(0,a.jsx)(eu.DropdownMenuItem,{disabled:e.isDefault,onClick:e.onDelete,children:"Delete"}),g[25]=e.isDefault,g[26]=e.onDelete,g[27]=h):h=g[27],g[28]!==e.option.name||g[29]!==h?(f=(0,a.jsx)(nJ.RowOptionsMenu,{name:e.option.name,size:"icon-xs",children:h}),g[28]=e.option.name,g[29]=h,g[30]=f):f=g[30],g[31]!==v.attributes||g[32]!==b||g[33]!==f||g[34]!==i||g[35]!==l||g[36]!==u||g[37]!==m||g[38]!==p?(x=(0,a.jsxs)("div",{className:i,ref:b,...v.attributes,children:[l,u,m,p,f]}),g[31]=v.attributes,g[32]=b,g[33]=f,g[34]=i,g[35]=l,g[36]=u,g[37]=m,g[38]=p,g[39]=x):x=g[39],x}function ae(e){let t,n,i,r,l=(0,s.c)(12),{initialName:o,onCancel:d,onCommit:c}=e,[u,p]=(0,m.useState)(o);l[0]!==u||l[1]!==d||l[2]!==c?(t=()=>{let e=u.trim();e?c(e):d()},l[0]=u,l[1]=d,l[2]=c,l[3]=t):t=l[3];let h=t;return l[4]===Symbol.for("react.memo_cache_sentinel")?(n=e=>p(e.target.value),l[4]=n):n=l[4],l[5]!==h||l[6]!==d?(i=e=>{"Enter"===e.key?h():"Escape"===e.key&&d()},l[5]=h,l[6]=d,l[7]=i):i=l[7],l[8]!==h||l[9]!==u||l[10]!==i?(r=(0,a.jsx)(ey.Input,{autoFocus:!0,className:"h-6 flex-1",onBlur:h,onChange:n,onKeyDown:i,placeholder:"New status",value:u}),l[8]=h,l[9]=u,l[10]=i,l[11]=r):r=l[11],r}function at(e){let t,n,r,l,c,u,p,h,f,x,g,v,b=(0,s.c)(44),{group:y,options:j,defaultId:I,onCommitNewOption:_,onDelete:S,onGlyphChange:k,onGroupChange:w,onNameChange:C,onReorder:T,onSetDefault:N}=e,[D,L]=(0,m.useState)(null),[A,P]=(0,m.useState)(!1);b[0]!==T||b[1]!==j?(t=e=>{let{active:t,over:n}=e;if(!n||t.id===n.id)return;let a=function(e,t,n){let a=e.findIndex(e=>e.id===t),s=e.findIndex(e=>e.id===n);if(-1===a||-1===s||a===s)return;let i=[...e],[r]=i.splice(a,1);if(r)return i.splice(s,0,r),i.map(e=>e.id)}(j,String(t.id),String(n.id));a&&T(a)},b[0]=T,b[1]=j,b[2]=t):t=b[2];let O=t,E=nB.STATUS_GROUP_LABELS[y];b[3]!==E?(n=(0,a.jsx)(d.Text,{as:"span",variant:"overline",children:E}),b[3]=E,b[4]=n):n=b[4];let M=`Add option to ${nB.STATUS_GROUP_LABELS[y]}`;if(b[5]===Symbol.for("react.memo_cache_sentinel")?(r=()=>P(!0),b[5]=r):r=b[5],b[6]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(ef.Plus,{className:"h-3.5 w-3.5"}),b[6]=l):l=b[6],b[7]!==M?(c=(0,a.jsx)(o.Button,{"aria-label":M,onClick:r,size:"icon",type:"button",variant:"ghost",children:l}),b[7]=M,b[8]=c):c=b[8],b[9]!==n||b[10]!==c?(u=(0,a.jsxs)("div",{className:"flex items-center justify-between px-1.5",children:[n,c]}
1),b[9]=n,b[10]=c,b[11]=u):u=b[11],b[12]!==j?(p=j.map(an),b[12]=j,b[13]=p):p=b[13],b[14]!==I||b[15]!==D||b[16]!==S||b[17]!==k||b[18]!==w||b[19]!==C||b[20]!==N||b[21]!==j){let e;b[23]!==I||b[24]!==D||b[25]!==S||b[26]!==k||b[27]!==w||b[28]!==C||b[29]!==N?(e=e=>(0,a.jsx)(n9,{isDefault:I===e.id,isEditing:D===e.id,onDelete:()=>S(e.id),onEditingChange:t=>L(t?e.id:null),onGlyphChange:t=>k(e.id,t),onGroupChange:t=>w(e.id,t),onNameChange:t=>C(e.id,t),onSetDefault:()=>N(e.id),option:e},e.id),b[23]=I,b[24]=D,b[25]=S,b[26]=k,b[27]=w,b[28]=C,b[29]=N,b[30]=e):e=b[30],h=j.map(e),b[14]=I,b[15]=D,b[16]=S,b[17]=k,b[18]=w,b[19]=C,b[20]=N,b[21]=j,b[22]=h}else h=b[22];return b[31]!==h||b[32]!==p?(f=(0,a.jsx)(tE.SortableContext,{items:p,strategy:tE.verticalListSortingStrategy,children:h}),b[31]=h,b[32]=p,b[33]=f):f=b[33],b[34]!==O||b[35]!==f?(x=(0,a.jsx)(i.DndContext,{collisionDetection:i.closestCenter,onDragEnd:O,children:f}),b[34]=O,b[35]=f,b[36]=x):x=b[36],b[37]!==A||b[38]!==_?(g=A&&(0,a.jsx)(aa,{onCancel:()=>P(!1),onCommit:e=>{_(e),P(!1)}}),b[37]=A,b[38]=_,b[39]=g):g=b[39],b[40]!==x||b[41]!==g||b[42]!==u?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[u,x,g]}),b[40]=x,b[41]=g,b[42]=u,b[43]=v):v=b[43],v}function an(e){return e.id}function aa(e){let t,n,i,r,l,o=(0,s.c)(13),{onCancel:d,onCommit:c}=e,[u,p]=(0,m.useState)("");o[0]!==u||o[1]!==d||o[2]!==c?(t=()=>{let e=u.trim();0===e.length?d():c(e)},o[0]=u,o[1]=d,o[2]=c,o[3]=t):t=o[3];let h=t;return o[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(nH,{glyph:"todo"}),o[4]=n):n=o[4],o[5]===Symbol.for("react.memo_cache_sentinel")?(i=e=>p(e.target.value),o[5]=i):i=o[5],o[6]!==h||o[7]!==d?(r=e=>{"Enter"===e.key?h():"Escape"===e.key&&d()},o[6]=h,o[7]=d,o[8]=r):r=o[8],o[9]!==h||o[10]!==u||o[11]!==r?(l=(0,a.jsxs)("div",{className:"flex items-center gap-1.5 rounded-md px-1.5 py-1",children:[n,(0,a.jsx)(ey.Input,{"aria-label":"New status name",autoFocus:!0,className:"h-6 flex-1",onBlur:h,onChange:i,onKeyDown:r,placeholder:"New status",value:u})]}),o[9]=h,o[10]=u,o[11]=r,o[12]=l):l=o[12],l}function as(e,t){return e.filter(e=>e.group===t).sort((e,t)=>e.sortOrder-t.sortOrder)}function ai(e){let t,n,i,r,l=(0,s.c)(17),{options:o,defaults:d,actions:c}=e,[u,p]=(0,m.useState)(null);if(l[0]!==c||l[1]!==d||l[2]!==o||l[3]!==u){let e;l[7]!==u?(e=e=>e.id===u,l[7]=u,l[8]=e):e=l[8];let s=o.find(e);t="flex flex-col gap-3",l[9]!==c||l[10]!==d||l[11]!==o?(n=nB.STATUS_GROUPS.map(e=>(0,a.jsx)(at,{defaultId:d[e],group:e,onCommitNewOption:t=>c.addOption(e,t),onDelete:e=>p(e),onGlyphChange:(e,t)=>
1c.updateOption(e,{glyph:t}),onGroupChange:(e,t)=>c.updateOption(e,{group:t}),onNameChange:(e,t)=>c.updateOption(e,{name:t}),onReorder:t=>c.reorderOptions(e,t),onSetDefault:t=>c.setDefault(e,t),options:as(o,e)},e)),l[9]=c,l[10]=d,l[11]=o,l[12]=n):n=l[12],i=s&&(0,a.jsx)(nX,{candidates:as(o,s.group).filter(e=>e.id!==s.id),onCancel:()=>p(null),onConfirm:e=>{c.deleteOption(s.id,e),p(null)},open:!0,option:s}),l[0]=c,l[1]=d,l[2]=o,l[3]=u,l[4]=t,l[5]=n,l[6]=i}else t=l[4],n=l[5],i=l[6];return l[13]!==t||l[14]!==n||l[15]!==i?(r=(0,a.jsxs)("div",{className:t,children:[n,i]}),l[13]=t,l[14]=n,l[15]=i,l[16]=r):r=l[16],r}var ar=e.i(433992);function al(e){let t,n,i,o,c=(0,s.c)(11),{teamId:u}=e;c[0]!==u?(t={teamId:u},c[0]=u,c[1]=t):t=c[1];let m=(0,l.useQuery)(r.api.task_identifiers.queries.getSettings,t),p=(0,l.useMutation)(r.api.task_identifiers.mutations.setPrefix);c[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)(ar.Label,{htmlFor:"task-prefix",children:"Task prefix"}),(0,a.jsx)(d.Text,{variant:"caption",children:"Used for identifiers such as TEKA-143"})]}),c[2]=n):n=c[2];let h=m?.prefix,f=m?.prefix??"unset";return c[3]!==p||c[4]!==m?.prefix||c[5]!==u?(i=async e=>{let t=e.target.value.trim();t&&t!==m?.prefix&&await p({prefix:t,teamId:u})},c[3]=p,c[4]=m?.prefix,c[5]=u,c[6]=i):i=c[6],c[7]!==h||c[8]!==f||c[9]!==i?(o=(0,a.jsxs)("div",{className:"flex items-end justify-between gap-3 border-border border-b pb-3",children:[n,(0,a.jsx)(ey.Input,{className:"w-20",defaultValue:h,id:"task-prefix",maxLength:5,minLength:2,onBlur:i,placeholder:"TEKA"},f)]}),c[7]=h,c[8]=f,c[9]=i,c[10]=o):o=c[10],o}function ao(e,t){nM(e,t)}function ad(e,t){nP(e,t)}function ac(e,t){nz(e,t)}function au(e,t){nR(e,t)}function am(e,t){nE(e,t)}function ap(e){let t,n,i,o,c,u,m,p,h,x,g,v,b,y,j,I,_,S,k=(0,s.c)(16),{listId:w}=e,{gate:C}=(0,f.useGuestGate)();k[0]!==C||k[1]!==w?(t=C({listId:w}),k[0]=C,k[1]=w,k[2]=t):t=k[2];let T=(0,l.useQuery)(r.api.todo_lists.status_queries.getStatusOptions,t),N=(b=(0,s.c)(16),y=(0,l.useMutation)(r.api.todo_lists.status_mutations.addStatusOption),b[0]!==y?(m=y.withOptimisticUpdate(am),b[0]=y,b[1]=m):m=b[1],j=(0,l.useMutation)(r.api.todo_lists.status_mutations.deleteStatusOption),b[2]!==j?(p=j.withOptimisticUpdate(au),b[2]=j,b[3]=p):p=b[3],I=(0,l.useMutation)(r.api.todo_lists.status_mutations.reorderStatusOptions),b[4]!==I?(h=I.withOptimisticUpdate(ac),b[4]=I,b[5]=h):h=b[5],_=(0,l.useMutation)(r.api.todo_lists.status_mutations.setDefaultStatusOption),b[6]!==_?
1(x=_.withOptimisticUpdate(ad),b[6]=_,b[7]=x):x=b[7],S=(0,l.useMutation)(r.api.todo_lists.status_mutations.updateStatusOption),b[8]!==S?(g=S.withOptimisticUpdate(ao),b[8]=S,b[9]=g):g=b[9],b[10]!==m||b[11]!==p||b[12]!==h||b[13]!==x||b[14]!==g?(v={addStatusOption:m,deleteStatusOption:p,reorderStatusOptions:h,setDefaultStatusOption:x,updateStatusOption:g},b[10]=m,b[11]=p,b[12]=h,b[13]=x,b[14]=g,b[15]=v):v=b[15],v);if(k[3]!==w||k[4]!==N)n={addOption:(e,t)=>{N.addStatusOption({group:e,listId:w,name:t}).catch(console.error)},deleteOption:(e,t)=>{N.deleteStatusOption({listId:w,optionId:e,remapToOptionId:t}).catch(console.error)},reorderOptions:(e,t)=>{N.reorderStatusOptions({group:e,listId:w,orderedIds:t}).catch(console.error)},setDefault:(e,t)=>{N.setDefaultStatusOption({group:e,listId:w,optionId:t}).catch(console.error)},updateOption:(e,t)=>{N.updateStatusOption({listId:w,optionId:e,...t}).catch(console.error)}},k[3]=w,k[4]=N,k[5]=n;else n=k[5];let D=n,L=nD(w);return k[6]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(eL.PopoverTrigger,{"aria-label":"List settings",className:"inline-flex size-7 shrink-0 cursor-pointer select-none items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,a.jsx)(ny.Settings,{className:"h-4 w-4"})}),k[6]=i):i=k[6],k[7]!==T?(o=void 0===T&&(0,a.jsx)("div",{className:"flex justify-center py-4"}),k[7]=T,k[8]=o):o=k[8],k[9]!==D||k[10]!==T||k[11]!==L?(c=T&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(al,{teamId:T.teamId}),(0,a.jsx)(nw,{onChange:L.setProperties,properties:L.view.properties}),L.confirmDialog,(0,a.jsx)(d.Text,{as:"span",className:"px-1.5",variant:"overline",children:"Statuses"}),(0,a.jsx)(ai,{actions:D,defaults:T.defaultOptionByGroup,options:T.statusOptions})]}),k[9]=D,k[10]=T,k[11]=L,k[12]=c):c=k[12],k[13]!==o||k[14]!==c?(u=(0,a.jsxs)(eL.Popover,{children:[i,(0,a.jsxs)(eL.PopoverContent,{align:"end",className:"max-h-[70vh] w-80 overflow-y-auto",children:[o,c]})]}),k[13]=o,k[14]=c,k[15]=u):u=k[15],u}var ah=e.i(308402),af=e.i(329268),ax=e.i(304784);function ag(e){let t,n,i,r,l,d,c=(0,s.c)(16),{mode:u,onChange:m}=e,p="shared"===u,h=p?"unique":"shared",f=p?"Unique view":"Shared view",x=p?"Unique: only your screen changes.":"Shared: everyone on this list sees what you change.";c[0]!==h||c[1]!==m?(t=()=>m(h),c[0]=h,c[1]=m,c[2]=t):t=c[2];let g=(0,tr.useEvent)(t);return c[3]!==f||c[4]!==g?(n=(0,a.jsx)(o.Button,{"aria-label":f,onClick:g,size:"icon-sm",type:"button",variant:"ghost"}),c[3]=f,c[4]=g,c[5]=n):n=c[5],c[6]!==p?(i=p?(0,a.jsx)(af.User,{className:"size-3.5"}):(0,a.jsx)(ax.Users,{className:"size-3.5"}),c[6]=p,c[7]=i):i=c[7],c[8]!==n||c[9]!==i?(r=(0,a.jsx)(ah.TooltipTrigger,{render:n,children:i}),c[8]=n,c[9]=i,c[10]=r):r=c[10],c[11]!==x?(l=(0,a.jsx)(ah.TooltipContent,{children:x}),c[11]=x,c[12]=l):l=c[12],c[13]!==r||c[14]!==l?(d=(0,a.jsxs)(ah.Tooltip,{children:[r,l]}),c[13]=r,c[14]=l,c[15]=d):d=c[15],d}var av=e.i(684442),ab=e.i(656848);function ay(e){let t,n,i,r,l,d,c=(0,s.c)(16),{kanbanEnabled:u,onChange:m}=e,p=u?"List view":"Board view";c[0]!==u||c[1]!==m?(t=()=>m(!u),c[0]=u,c[1]=m,c[2]=t):t=c[2];let h=(0,tr.useEvent)(t);return c[3]!==p||c[4]!==h?(n=(0,a.jsx)(o.Button,{"aria-label":p,onClick:h,size:"icon-sm",type:"button",variant:"ghost"}),c[3]=p,c[4]=h,c[5]=n):n=c[5],c[6]!==u?(i=u?(0,a.jsx)(ab.List,{className:"size-3.5"}):(0,a.jsx)(av.Columns3,{className:"size-3.5"}),c[6]=u,c[7]=i):i=c[7],c[8]!==n||c[9]!==i?(r=(0,a.jsx)(ah.TooltipTrigger,{render:n,children:i}),c[8]=n,c[9]=i,c[10]=r):r=c[10],c[11]!==p?(l=(0,a.jsx)(ah.TooltipContent,{children:p}),c[11]=p,c[12]=l):l=c[12],c[13]!==r||c[14]!==l?(d=(0,a.jsxs)(ah.Tooltip,{children:[r,l]}),c[13]=r,c[14]=l,c[15]=d):d=c[15],d}function aj(e){let t,n,i,r=(0,s.c)(10),{listId:l}=e,o=nD(l);return r[0]!==o.setKanbanEnabled||r[1]!==o.view.kanbanEnabled?(t=(0,a.jsx)(ay,{kanbanEnabled:o.view.kanbanEnabled,onChange:o.setKanbanEnabled}),r[0]=o.setKanbanEnabled,r[1]=o.view.kanbanEnabled,r[2]=t):t=r[2],r[3]!==o.setMode||r[4]!==o.view.mode?(n=(0,a.jsx)(ag,{mode:o.view.mode,onCh
1ange:o.setMode}),r[3]=o.setMode,r[4]=o.view.mode,r[5]=n):n=r[5],r[6]!==o.confirmDialog||r[7]!==t||r[8]!==n?(i=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[t,n,o.confirmDialog]}),r[6]=o.confirmDialog,r[7]=t,r[8]=n,r[9]=i):i=r[9],i}var aI=e.i(717706),a_=e.i(271944),aS=e.i(829396),aS=aS,ak=e.i(25873);function aw(e){let t,n,i,r,l,o,c=(0,s.c)(14),{open:u,onOpenChange:m,title:p,onDelete:h}=e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(ak.AlertDialogTitle,{children:"Delete list?"}),c[0]=t):t=c[0],c[1]!==p?(n=(0,a.jsxs)(ak.AlertDialogHeader,{children:[t,(0,a.jsxs)(ak.AlertDialogDescription,{children:["Are you sure you want to delete"," ",(0,a.jsx)(d.Text,{as:"span",variant:"label",children:p}),"? All tasks in this list will be deleted. This cannot be undone."]})]}),c[1]=p,c[2]=n):n=c[2],c[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(ak.AlertDialogCancel,{children:"Cancel"}),c[3]=i):i=c[3],c[4]!==h||c[5]!==m?(r=(0,a.jsxs)(ak.AlertDialogFooter,{children:[i,(0,a.jsx)(ak.AlertDialogAction,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{h?.(),m(!1)},children:"Delete"})]}),c[4]=h,c[5]=m,c[6]=r):r=c[6],c[7]!==n||c[8]!==r?(l=(0,a.jsxs)(ak.AlertDialogContent,{children:[n,r]}),c[7]=n,c[8]=r,c[9]=l):l=c[9],c[10]!==m||c[11]!==u||c[12]!==l?(o=(0,a.jsx)(ak.AlertDialog,{onOpenChange:m,open:u,children:l}),c[10]=m,c[11]=u,c[12]=l,c[13]=o):o=c[13],o}function aC(e){let t,n,i,r,l,o,c=(0,s.c)(14),{open:u,onOpenChange:m,title:p,onDeleteAll:h}=e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(ak.AlertDialogTitle,{children:"Clear list?"}),c[0]=t):t=c[0],c[1]!==p?(n=(0,a.jsxs)(ak.AlertDialogHeader,{children:[t,(0,a.jsxs)(ak.AlertDialogDescription,{children:["Are you sure you want to clear all tasks from"," ",(0,a.jsx)(d.Text,{as:"span",variant:"label",children:p}),"? This cannot be undone."]})]}),c[1]=p,c[2]=n):n=c[2],c[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(ak.AlertDialogCancel,{children:"Cancel"}),c[3]=i):i=c[3],c[4]!==h||c[5]!==m?(r=(0,a.jsxs)(ak.AlertDialogFooter,{children:[i,(0,a.jsx)(ak.AlertDialogAction,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{h?.(),m(!1)},children:"Clear list"})]}),c[4]=h,c[5]=m,c[6]=r):r=c[6],c[7]!==n||c[8]!==r?(l=(0,a.jsxs)(ak.AlertDialogContent,{children:[n,r]}),c[7]=n,c[8]=r,c[9]=l):l=c[9],c[10]!==m||c[11]!==u||c[12]!==l?(o=(0,a.jsx)(ak.AlertDialog,{onOpenChange:m,open:u,children:l}),c[10]=m,c[11]=u,c[12]=l,c[13]=o):o=c[13],o}var aT=e.i(737618),aN=e.i(833462);let aD="My Tasks",aL="New list...";function aA(e,t){let n=[],a=new Map;for(let s of e)if(void 0===s.teamId)n.push(s);else{let e=a.get(s.teamId);if(e)e.parentLists.push(s);else{let e=t.find(e=>e._id===s.teamId);a.set(s.teamId,{label:e?.name??"Space",parentLists:[s]})}}let s=[];for(let[e,{label:t,parentLists:i}]of(n.length>0&&s.push({label:aD,teamId:void 0,parentLists:n}),a))s.push({label:t,teamId:e,parentLists:i});for(let e of t)a.has(e._id)||s.push({label:e.name,teamId:e._id,parentLists:[]});return s}function aP(e){let t,n,i,r,l,o,c,u,m,p,h,f,x=(0,s.c)(51),{allParentLists:g,teams:v,currentParentId:b,currentTeamId:y,onSelect:j,onSelectSpace:I,onCreateParentList:_}=e,S=void 0===b&&!y;if(x[0]!==g||x[1]!==b||x[2]!==y||x[3]!==S||x[4]!==_||x[5]!==j||x[6]!==I||x[7]!==v){let e,s,c,u,m,p,h=aA(g,v);x[14]!==S||x[15]!==j?(e=()=>{S||j(void 0)},x[14]=S,x[15]=j,x[16]=e):e=x[16];let f=e;x[17]!==b||x[18]!==j?(s=e=>{b!==e&&j(e)},x[17]=b,x[18]=j,x[19]=s):s=x[19];let k=s;x[20]!==_||x[21]!==j?(c=async()=>{let e=await _();void 0!==e&&j(e)},x[20]=_,x[21]=j,x[22]=c):c=x[22],i=c,n=eu.DropdownMenuSub,x[23]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsxs)(eu.DropdownMenuSubTrigger,{children:[(0,a.jsx)(aN.FolderOpen,{className:"mr-2 h-3.5 w-3.5"}),"Move to..."]}),x[23]=o):o=x[23],t=eu.DropdownMenuSubContent,x[24]!==f?(u=e=>{e.stopPropagation(),f()},x[24]=f,x[25]=u):u=x[25],x[26]!==S?(m=S?(0,a.jsx)(ep.Check,{className:"mr-2 h-3.5 w-3.5"}):(0,a.jsx)("span",{className:"mr-[22px]"}),x[26]=S,x[27]=m):m=x[27],x[28]!==u||x[29]!==m?(r=(0,a.jsxs)(eu.DropdownMenuItem,{onClick:u,children:[m,aD]}),x[28]=u,x[29]=m,x[30]=r):r=x[30],x[31]!==b||x[32]!==y||x[33]!==k||x[34]!==I?(p=e=>{let t=e.teamId,n=void 0!==t&&void 0===b&&y===t,s=void 0!==t&&void 0!==I;return(0,a.jsxs)("div",{children:[(0,a.jsx)(eu.DropdownMenuSeparator,{}),s?(0,a.jsxs)(eu.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),n||I(t)},children:[n?(0,a.jsx)(ep.Check,{className:"mr-2 h-3.5 w-3.5"}):(0,a.jsx)("span",{className:"mr-[22px]"}),e.label]}):(0,a.jsx)(d.Text,{className:"px-2 py-1",variant:"caption",children:e.label}),e.parentLists.map(e=>{let t=b===e._id;return(0,a.jsxs)(eu.DropdownMenuItem,{onClick:t=>{t.stopPropagation(),k(e._id)},children:[t?(0,a.jsx)(ep.Check,{className:"mr-2 h-3.5 w-3.5"}):(0,a.jsx)("span",{className:"mr-[22px]"}),e.name]},e._id)}),0===e.parentLists.length&&!s&&(0,a.jsx)(d.Text,{className:"px-4 py-1 text-muted-foreground
1/60 italic",variant:"caption",children:"No lists"})]},e.teamId??"personal")},x[31]=b,x[32]=y,x[33]=k,x[34]=I,x[35]=p):p=x[35],l=h.map(p),x[0]=g,x[1]=b,x[2]=y,x[3]=S,x[4]=_,x[5]=j,x[6]=I,x[7]=v,x[8]=t,x[9]=n,x[10]=i,x[11]=r,x[12]=l,x[13]=o}else t=x[8],n=x[9],i=x[10],r=x[11],l=x[12],o=x[13];return x[36]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(eu.DropdownMenuSeparator,{}),x[36]=c):c=x[36],x[37]!==i?(u=e=>{e.stopPropagation(),i().catch(aO)},x[37]=i,x[38]=u):u=x[38],x[39]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ef.Plus,{className:"mr-2 h-3.5 w-3.5"}),x[39]=m):m=x[39],x[40]!==u?(p=(0,a.jsxs)(eu.DropdownMenuItem,{onClick:u,children:[m,aL]}),x[40]=u,x[41]=p):p=x[41],x[42]!==t||x[43]!==r||x[44]!==l||x[45]!==p?(h=(0,a.jsxs)(t,{children:[r,l,c,p]}),x[42]=t,x[43]=r,x[44]=l,x[45]=p,x[46]=h):h=x[46],x[47]!==n||x[48]!==o||x[49]!==h?(f=(0,a.jsxs)(n,{children:[o,h]}),x[47]=n,x[48]=o,x[49]=h,x[50]=f):f=x[50],f}function aO(e){e3.toast.error(e instanceof Error?e.message:"Failed to create list")}function aE(e){let t,n,i,r,l,o,c,u,m,p,h,f,x=(0,s.c)(51),{allParentLists:g,teams:v,currentParentId:b,currentTeamId:y,onSelect:j,onSelectSpace:I,onCreateParentList:_}=e,S=void 0===b&&!y;if(x[0]!==g||x[1]!==b||x[2]!==y||x[3]!==S||x[4]!==_||x[5]!==j||x[6]!==I||x[7]!==v){let e,s,c,u,m,p,h=aA(g,v);x[14]!==S||x[15]!==j?(e=()=>{S||j(void 0)},x[14]=S,x[15]=j,x[16]=e):e=x[16];let f=e;x[17]!==b||x[18]!==j?(s=e=>{b!==e&&j(e)},x[17]=b,x[18]=j,x[19]=s):s=x[19];let k=s;x[20]!==_||x[21]!==j?(c=async()=>{let e=await _();void 0!==e&&j(e)},x[20]=_,x[21]=j,x[22]=c):c=x[22],i=c,n=aT.ContextMenuSub,x[23]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsxs)(aT.ContextMenuSubTrigger,{children:[(0,a.jsx)(aN.FolderOpen,{className:"mr-2 h-3.5 w-3.5"}),"Move to..."]}),x[23]=o):o=x[23],t=aT.ContextMenuSubContent,x[24]!==f?(u=e=>{e.stopPropagation(),f()},x[24]=f,x[25]=u):u=x[25],x[26]!==S?(m=S?(0,a.jsx)(ep.Check,{className:"mr-2 h-3.5 w-3.5"}):(0,a.jsx)("span",{className:"mr-[22px]"}),x[26]=S,x[27]=m):m=x[27],x[28]!==u||x[29]!==m?(r=(0,a.jsxs)(aT.ContextMenuItem,{onClick:u,children:[m,aD]}),x[28]=u,x[29]=m,x[30]=r):r=x[30],x[31]!==b||x[32]!==y||x[33]!==k||x[34]!==I?(p=e=>{let t=e.teamId,n=void 0!==t&&void 0===b&&y===t,s=void 0!==t&&void 0!==I;return(0,a.jsxs)("div",{children:[(0,a.jsx)(aT.ContextMenuSeparator,{}),s?(0,a.jsxs)(aT.ContextMenuItem,{onClick:e=>{e.stopPropagation(),n||I(t)},children:[n?(0,a.jsx)(ep.Check,{className:"mr-2 h-3.5 w-3.5"}):(0,a.jsx)("span",{className:"mr-[22px]"}),e.label]}):(0,a.jsx)(d.Text,{className:"px-2 py-1",variant:"caption",children:e.label}),e.parentLists.map(e=>{let t=b===e._id;return(0,a.jsxs)(aT.ContextMenuItem,{onClick:t=>{t.stopPropagation(),k(e._id)},children:[t?(0,a.jsx)(ep.Check,{className:"mr-2 h-3.5 w-3.5"}):(0,a.jsx)("span",{className:"mr-[22px]"}),e.name]},e._id)}),0===e.parentLists.length&&!s&&(0,a.jsx)(d.Text,{className:"px-4 py-1 text-muted-foreground/60 italic",variant:"caption",children:"No lists"})]},e.teamId??"personal")},x[31]=b,x[32]=y,x[33]=k,x[34]=I,x[35]=p):p=x[35],l=h.map(p),x[0]=g,x[1]=b,x[2]=y,x[3]=S,x[4]=_,x[5]=j,x[6]=I,x[7]=v,x[8]=t,x[9]=n,x[10]=i,x[11]=r,x[12]=l,x[13]=o}else t=x[8],n=x[9],i=x[10],r=x[11],l=x[12],o=x[13];return x[36]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(aT.ContextMenuSeparator,{}),x[36]=c):c=x[36],x[37]!==i?(u=e=>{e.stopPropagation(),i().catch(aM)},x[37]=i,x[38]=u):u=x[38],x[39]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ef.Plus,{className:"mr-2 h-3.5 w-3.5"}),x[39]=m):m=x[39],x[40]!==u?(p=(0,a.jsxs)(aT.ContextMenuItem,{onClick:u,children:[m,aL]}),x[40]=u,x[41]=p):p=x[41],x[42]!==t||x[43]!==r||x[44]!==l||x[45]!==p?(h=(0,a.jsxs)(t,{children:[r,l,c,p]}),x[42]=t,x[43]=r,x[44]=l,x[45]=p,x[46]=h):h=x[46],x[47]!==n||x[48]!==o||x[49]!==h?(f=(0,a.jsxs)(n,{children:[o,h]}),x[47]=n,x[48]=o,x[49]=h,x[50]=f):f=x[50],f}function aM(e){e3.toast.error(e instanceof Error?e.message:"Failed to create list")}function aR(e){let t,n=(0,s.c)(4),{icon:i,label:r,onSelect:l}=e;return n[0]!==i||n[1]!==r||n[2]!==l?(t=(0,a.jsxs)(eu.DropdownMenuItem,{onClick:l,children:[i,r]}),n[0]=i,n[1]=r,n[2]=l,n[3]=t):t=n[3],t}function az(e){let t,n=(0,s.c)(8),{onCreateParentList:i,onMoveToParentList:r}=e;return r&&i?(n[0]!==i||n[1]!==r||n[2]!==e.allParentLists||n[3]!==e.currentParentId||n[4]!==e.currentTeamId||n[5]!==e.onMoveToSpace||n[6]!==e.team
1s?(t=(0,a.jsx)(aP,{allParentLists:e.allParentLists,currentParentId:e.currentParentId,currentTeamId:e.currentTeamId,onCreateParentList:i,onSelect:r,onSelectSpace:e.onMoveToSpace,teams:e.teams}),n[0]=i,n[1]=r,n[2]=e.allParentLists,n[3]=e.currentParentId,n[4]=e.currentTeamId,n[5]=e.onMoveToSpace,n[6]=e.teams,n[7]=t):t=n[7],t):null}function aB(e){let t,n,i,r,l,o,d,c,u,p,h,f,x=(0,s.c)(34),[g,v]=(0,m.useState)(!1),[b,y]=(0,m.useState)(!1);x[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>v(!0),x[0]=t):t=x[0];let j=t;x[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>y(!0),x[1]=n):n=x[1];let I=n;return x[2]!==e?(i=(0,a.jsx)(az,{...e}),x[2]=e,x[3]=i):i=x[3],x[4]!==e.onUncheckAll?(r=e.onUncheckAll?(0,a.jsx)(aR,{icon:(0,a.jsx)(aI.CheckSquare,{}),label:"Uncheck all",onSelect:e.onUncheckAll}):null,x[4]=e.onUncheckAll,x[5]=r):r=x[5],x[6]!==e.onDeleteAll?(l=e.onDeleteAll?(0,a.jsx)(aR,{icon:(0,a.jsx)(aS.default,{}),label:"Clear list",onSelect:I}):null,x[6]=e.onDeleteAll,x[7]=l):l=x[7],x[8]!==e.onDuplicate?(o=e.onDuplicate?(0,a.jsx)(aR,{icon:(0,a.jsx)(a_.Copy,{}),label:"Duplicate list",onSelect:e.onDuplicate}):null,x[8]=e.onDuplicate,x[9]=o):o=x[9],x[10]!==e.onLock?(d=e.onLock?(0,a.jsx)(aR,{icon:(0,a.jsx)(tU.Lock,{}),label:"Lock list",onSelect:e.onLock}):null,x[10]=e.onLock,x[11]=d):d=x[11],x[12]!==e.onDelete?(c=e.onDelete?(0,a.jsx)(eu.DropdownMenuItem,{onClick:j,children:"Delete"}):null,x[12]=e.onDelete,x[13]=c):c=x[13],x[14]!==e.title||x[15]!==i||x[16]!==r||x[17]!==l||x[18]!==o||x[19]!==d||x[20]!==c?(u=(0,a.jsxs)(nJ.RowOptionsMenu,{name:e.title,size:"icon-sm",children:[i,r,l,o,d,c]}),x[14]=e.title,x[15]=i,x[16]=r,x[17]=l,x[18]=o,x[19]=d,x[20]=c,x[21]=u):u=x[21],x[22]!==g||x[23]!==e.onDelete||x[24]!==e.title?(p=(0,a.jsx)(aw,{onDelete:e.onDelete,onOpenChange:v,open:g,title:e.title}),x[22]=g,x[23]=e.onDelete,x[24]=e.title,x[25]=p):p=x[25],x[26]!==b||x[27]!==e.onDeleteAll||x[28]!==e.title?(h=(0,a.jsx)(aC,{onDeleteAll:e.onDeleteAll,onOpenChange:y,open:b,title:e.title}),x[26]=b,x[27]=e.onDeleteAll,x[28]=e.title,x[29]=h):h=x[29],x[30]!==h||x[31]!==u||x[32]!==p?(f=(0,a.jsxs)(a.Fragment,{children:[u,p,h]}),x[30]=h,x[31]=u,x[32]=p,x[33]=f):f=x[33],f}var aU=e.i(451276),aF=e.i(880698);function aG(){let e,t,n,a=(0,s.c)(13),i=(0,J.useMoveUndoToRedo)(),o=(0,J.useMoveRedoToUndo)(),d=(0,J.useCanUndoDeletion)(),c=(0,J.useCanRedoDeletion)(),u=(0,l.useMutation)(r.api.todos.trash_mutations.restoreTodo),m=(0,l.useMutation)(r.api.todo_lists.trash_mutations.restoreList),p=(0,l.useMutation)(r.api.todos.mutations.deleteTodo),h=(0,l.useMutation)(r.api.todo_lists.mutations.deleteList);a[0]!==i||a[1]!==m||a[2]!==u?(e=()=>{let e=i();e&&("task"===e.kind?u({id:e.id}).catch(console.error):m({id:e.id}).catch(console.error))},a[0]=i,a[1]=m,a[2]=u,a[3]=e):e=a[3];let f=e;a[4]!==h||a[5]!==p||a[6]!==o?(t=()=>{let e=o();e&&("task"===e.kind?p({id:e.id}).catch(console.error):h({id:e.id}).catch(console.error))},a[4]=h,a[5]=p,a[6]=o,a[7]=t):t=a[7];let x=t;return a[8]!==c||a[9]!==d||a[10]!==x||a[11]!==f?(n={undo:f,redo:x,canUndo:d,canRedo:c},a[8]=c,a[9]=d,a[10]=x,a[11]=f,a[12]=n):n=a[12],n}var aq=e.i(253393),a$=e.i(939923);function aK(e){let t,n,i,r,l,c,u,p,h,f,x,g,v,b,y,j,I,_,S,k,w,C,T,N,D,L=(0,s.c)(60),{presentation:A}=e,P=void 0===A?"labelled":A;L[0]!==P?(t=(0,nt.adaptiveTrigger)(P),L[0]=P,L[1]=t):t=L[1];let O=t,E=(0,J.useSavedTaskViews)(),M=(0,J.useSelectedSavedTaskViewId)(),R=(0,J.useApplySavedTaskView)(),z=(0,J.useDeleteSavedTaskView)(),B=(0,J.useResetTaskView)(),U=(0,J.useSaveTaskView)(),[F,G]=(0,m.useState)("");if(L[2]!==M||L[3]!==E){let e;L[5]!==M?(e=e=>e.id===M,L[5]=M,L[6]=e):e=L[6],n=E.find(e),L[2]=M,L[3]=E,L[4]=n}else n=L[4];let q=n;L[7]!==F||L[8]!==U?(i=()=>{F.trim()&&(U(F),G(""))},L[7]=F,L[8]=U,L[9]=i):i=L[9];let $=i;L[10]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(aq.Bookmark,{}),L[10]=r):r=L[10];let K=O.labelled?q?.name??"Views":null;L[11]!==K||L[12]!==O.className||L[13]!==O.size?(l=(0,a.jsx)(eL.PopoverTrigger,{render:(0,a.jsxs)(o.Button,{"aria-label":"Saved views",className:O.className,size:O.size,variant:"ghost",children:[r,K]})}),L[11]=K,L[12]=O.className,L[13]=O.size,L[14]=l):l=L[14],L[15]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(d.Text,{variant:"caption",children:"Saved views"}),L[15]=c):c=L[15],L[16]===Symbol.for("react.memo_cache_sentinel")?(u={label:"Current view",value:"current"},L[16]=u):u=L[16],L[17]!==E?(p=[u,...E.map(aV)],L[17]=E,L[18]=p):p=L[18],L[19]!==R||L[20]!==B?(h=e=>{e&&"current"!==e?R(e):B()},L[19]=R,L[20]=B,L[21]=h):h=L[21];let Q=M??"current";L[22]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":"Choose saved task view",className:"flex-1",children:(0,a.jsx)(nZ.SelectValue,{})}),L[22]=f):f=L[22],L[23]===Symbol.for("react.memo_cache_sentinel")?(x=(0,a.jsx)(nZ.SelectItem,{value:"current",children:"Current view"}),L[23]=x):x=L[23],L[24]!==E?(g=E.map(aQ),L[24]=E,L[25]=g):g=L[25],L[26]!==g?(v=(0,a.jsxs)(nZ.SelectContent,{children:[x,g]}),L[26]=g,L[27]=v):v=L[27],L[28]!==p||L[29]!==h||L[30]!==Q||L[31]!==v?(b=(0,a.jsxs)(nZ.Select,{items:p,onValueChange:h,value:Q,children:[f,v]}),L[28]=p,L[29]=h,L[30]=Q,L[31]=v,L[32]=b):b=L[32],L[33]!==z||L[34]!==q?(y=q?(0,a.jsx)(nJ.RowOptionsMenu,{name:q.name,size:"icon-sm",children:(0,a.jsx)(eu.DropdownMenuItem,{onClick:()=>z(q.id),children:"Delete"})}):null,L[33]=z,L[34]=q,L[35]=y):y=L[35],L[36]!==b||L[37]!==y?(j=(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[b,y]}),L[36]=b,L[37]=y,L[38]=j):j=L[38],L[39]===Symbol.for("react.memo_cache_sentinel")?(I=e=>G(e.target.value),L[39]=I):I=L[39],L[40]!==$?(_=e=>{"Enter"===e.key&&$()},L[40]=$,L[41]=_):_=L[41],L[42]!==F||L[43]!==_?(S=(0,a.jsx)(ey.Input,{"aria-label":"Saved view n
1ame",onChange:I,onKeyDown:_,placeholder:"Name this view",value:F}),L[42]=F,L[43]=_,L[44]=S):S=L[44],L[45]!==F?(k=F.trim(),L[45]=F,L[46]=k):k=L[46];let V=!k;return L[47]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsx)(a$.Save,{}),L[47]=w):w=L[47],L[48]!==$||L[49]!==V?(C=(0,a.jsx)(o.Button,{"aria-label":"Save current view",disabled:V,onClick:$,size:"icon",variant:"ghost",children:w}),L[48]=$,L[49]=V,L[50]=C):C=L[50],L[51]!==S||L[52]!==C?(T=(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[S,C]}),L[51]=S,L[52]=C,L[53]=T):T=L[53],L[54]!==j||L[55]!==T?(N=(0,a.jsx)(eL.PopoverContent,{align:"end",className:"w-64",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[c,j,T]})}),L[54]=j,L[55]=T,L[56]=N):N=L[56],L[57]!==N||L[58]!==l?(D=(0,a.jsxs)(eL.Popover,{children:[l,N]}),L[57]=N,L[58]=l,L[59]=D):D=L[59],D}function aQ(e){return(0,a.jsx)(nZ.SelectItem,{value:e.id,children:e.name},e.id)}function aV(e){return{label:e.name,value:e.id}}var aW=e.i(506420),aH=e.i(757799),aH=aH,aY=e.i(816295);let aX={high:na.ChevronUp,low:eh.ChevronDown,medium:aY.Minus,urgent:aH.default};function aJ(e){let t,n=(0,s.c)(2),{priority:i}=e,r=aX[i];return n[0]!==r?(t=(0,a.jsx)(r,{"aria-hidden":"true"}),n[0]=r,n[1]=t):t=n[1],t}var aZ=e.i(439537);let a0=[{label:"Any due date",value:"all"},{label:"Scheduled",value:"scheduled"},{label:"Overdue",value:"overdue"},{label:"No due date",value:"no_due"}];function a1(e){let t,n,i,r,l,d,c,u,m,p,h,f,x,g,v,b,y,j,I,_,S,k,w,C,T,N,D,L,A,P,O,E,M,R,z,B,U,F,G,q=(0,s.c)(85),{config:$,onChange:K,presentation:Q,resources:V}=e,W=void 0===Q?"labelled":Q;if(q[0]!==$||q[1]!==W){var H;t=[$.statusId,$.priority,$.assigneeId,$.projectId,$.labelId,"all"===$.due?void 0:$.due].filter(
1Boolean).length,i=(0,nt.adaptiveTrigger)(W),H=t,n=i.labelled?H>0?`Filters ${H}`:"Filters":H>0?String(H):"",q[0]=$,q[1]=W,q[2]=t,q[3]=n,q[4]=i}else t=q[2],n=q[3],i=q[4];let Y=n,X=t>0?`Filters, ${t} active`:"Filters",J=Y?"sm":i.size;q[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(aW.ListFilter,{}),q[5]=r):r=q[5],q[6]!==X||q[7]!==J||q[8]!==i.className||q[9]!==Y?(l=(0,a.jsx)(eL.PopoverTrigger,{render:(0,a.jsxs)(o.Button,{"aria-label":X,className:i.className,size:J,variant:"ghost",children:[r,Y]})}),q[6]=X,q[7]=J,q[8]=i.className,q[9]=Y,q[10]=l):l=q[10],q[11]===Symbol.for("react.memo_cache_sentinel")?(d=(0,a.jsx)(se,{text:"Status"}),q[11]=d):d=q[11],q[12]===Symbol.for("react.memo_cache_sentinel")?(c={label:"All statuses",value:"all"},q[12]=c):c=q[12],q[13]!==V.statuses?(u=[c,...V.statuses.map(a9)],q[13]=V.statuses,q[14]=u):u=q[14],q[15]!==K?(m=e=>K({statusId:e&&"all"!==e?e:void 0}),q[15]=K,q[16]=m):m=q[16];let Z=$.statusId??"all";q[17]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":"Filter by status",children:(0,a.jsx)(nZ.SelectValue,{})}),q[17]=p):p=q[17],q[18]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsx)(nZ.SelectItem,{value:"all",children:"All statuses"}),q[18]=h):h=q[18],q[19]!==V.statuses?(f=V.statuses.map(a8),q[19]=V.statuses,q[20]=f):f=q[20],q[21]!==f?(x=(0,a.jsxs)(nZ.SelectContent,{children:[h,f]}),q[21]=f,q[22]=x):x=q[22],q[23]!==Z||q[24]!==x||q[25]!==u||q[26]!==m?(g=(0,a.jsxs)(nZ.Select,{items:u,onValueChange:m,value:Z,children:[p,x]}),q[23]=Z,q[24]=x,q[25]=u,q[26]=m,q[27]=g):g=q[27],q[28]===Symbol.for("react.memo_cache_sentinel")?(v=(0,a.jsx)(se,{text:"Priority"}),q[28]=v):v=q[28],q[29]===Symbol.for("react.memo_cache_sentinel")?(b=[{label:"Any priority",value:"all"},...aZ.TASK_PRIORITIES.map(a7)],q[29]=b):b=q[29],q[30]!==K?(y=e=>K({priority:aZ.TASK_PRIORITIES.find(t=>t===e)}),q[30]=K,q[31]=y):y=q[31];let ee=$.priority??"all";return q[32]===Symbol.for("react.memo_cache_sentinel")?(j=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":"Filter by priority",children:(0,a.jsx)(nZ.SelectValue,{})}),q[32]=j):j=q[32],q[33]===Symbol.for("react.memo_cache_sentinel")?(I=(0,a.jsxs)(nZ.SelectContent,{children:[(0,a.jsx)(nZ.SelectItem,{value:"all",children:"Any priority"}),aZ.TASK_PRIORITIES.map(a6)]}),q[33]=I):I=q[33],q[34]!==y||q[35]!==ee?(_=(0,a.jsxs)(nZ.Select,{items:b,onValueChange:y,value:ee,children:[j,I]}),q[34]=y,q[35]=ee,q[36]=_):_=q[36],q[37]!==K?(S=e=>K({assigneeId:e}),q[37]=K,q[38]=S):S=q[38],q[39]!==$.assigneeId||q[40]!==S?(k={configValue:$.assigneeId,label:"Assignee",onChange:S},q[39]=$.assigneeId,q[40]=S,q[41]=k):k=q[41],q[42]!==V.assignees?(w=V.assignees.map(a5),q[42]=V.assignees,q[43]=w):w=q[43],q[44]!==k||q[45]!==w?(C=(0,a.jsx)(st,{filter:k,options:w}),q[44]=k,q[45]=w,q[46]=C):C=q[46],q[47]!==K?(T=e=>K({projectId:e}),q[47]=K,q[48]=T):T=q[48],q[49]!==$.projectId||q[50]!==T?(N={configValue:$.projectId,label:"Project",onChange:T},q[49]=$.projectId,q[50]=T,q[51]=N):N=q[51],q[52]!==V.projects?(D=V.projects.map(a4),q[52]=V.projects,q[53]=D):D=q[53],q[54]!==N||q[55]!==D?(L=(0,a.jsx)(st,{filter:N,options:D}),q[54]=N,q[55]=D,q[56]=L):L=q[56],q[57]!==K?(A=e=>K({labelId:e}),q[57]=K,q[58]=A):A=q[58],q[59]!==$.labelId||q[60]!==A?(P={configValue:$.labelId,label:"Label",onChange:A},q[59]=$.labelId,q[60]=A,q[61]=P):P=q[61],q[62]!==V.labels?(O=V.labels.map(a3),q[62]=V.labels,q[63]=O):O=q[63],q[64]!==P||q[65]!==O?(E=(0,a.jsx)(st,{filter:P,options:O}),q[64]=P,q[65]=O,q[66]=E):E=q[66],q[67]===Symbol.for("react.memo_cache_sentinel")?(M=(0,a.jsx)(se,{text:"Due"}),q[67]=M):M=q[67],q[68]!==K?(R=e=>{let t=e?a0.find(t=>t.value===e)?.value:void 0;t&&K({due:t})},q[68]=K,q[69]=R):R=q[69],q[70]===Symbol.for("react.memo_cache_sentinel")?(z=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":"Filter by due date",children:(0,a.jsx)(nZ.SelectValue,{})}),q[70]=z):z=q[70],q[71]===Symbol.for("react.memo_cache_sentinel")?(B=(0,a.jsx)(nZ.SelectContent,{children:a0.map(a2)}),q[71]=B):B=q[71],q[72]!==$.due||q[73]!==R?(U=(0,a.jsxs)(nZ.Select,{items:a0,onValueChange:R,value:$.due,children:[z,B]}),q[72]=$.due,q[73]=R,q[74]=U):U=q[74],q[75]!==g||q[76]!==_||q[77]!==C||q[78]!==L||q[79]!==E||q[80]!==U?(F=(0,a.jsx)(eL.PopoverContent,{align:"end",className:"w-64",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[d,g,v,_,C,L,E,M,U]})}),q[75]=g,q[76]=_,q[77]=C,q[78]=L,q[79]=E,q[80]=U,q[81]=F):F=q[81],q[82]!==F||q[83]!==l?(G=(0,a.jsxs)(eL.Popover,{children:[l,F]}),q[82]=F,q[83]=l,q[84]=G):G=q[84],G}function a2(e){return(0,a.jsx)(nZ.SelectItem,{value:e.value,children:e.label},e.value)}function a3(e){return{label:e.name,value:e._id}}function a4(e){return{label:e.name,value:e._id}}function a5(e){return{label:e.displayName??e.userId,value:e.userId}}function a6(e){return(0,a.jsxs)(nZ.SelectItem,{value:e,children:[(0,a.jsx)(aJ,{priority:e}),(0,aZ.taskPriorityLabel)(e)]},e)}function a7(e){return{label:(0,aZ.taskPriorityLabel)(e),value:e}}function a8(e){return(0,a.jsxs)(nZ.SelectItem,{value:e.id,children:[(0,a.jsx)(nH,{glyph:e.glyph??nY(e.group)}),e.name]},e.id)}function a9(e){return{label:e.name,value:e.id}}function se(e){let t,n=(0,s.c)(2),{text:i}=e;return n[0]!==i?(t=(0,a.jsx)(d.Text,{variant:"caption",children:i}),n[0]=i,n[1]=t):t=n[1],t}function st(e){let t,n,i,r,l,o,d,c,u,m,p,h,f,x,g=(0,s.c)(34),{filter:v,options:b}=e,{configValue:y,label:j,onChange:I}=v;g[0]!==j?(t=(0,a.jsx)(se,{text:j}),g[0]=j,g[1]=t):t=g[1],g[2]!==j?(n=j.toLowerCase(),g[2]=j,g[3]=n):n=g[3];let _=`Any ${n}`;g[4]!==_?(i={label:_,value:"all"},g[4]=_,g[5]=i):i=g[5],g[6]!==b||g[7]!==i?(r=[i,...b],g[6]=b,g[7]=i,g[8]=r):r=g[8],g[9]!==I?(l=e=>I(e&&"all"!==e?e:void 0),g[9]=I,g[10]=l):l=g[10];let S=y??"all";g[11]!==j?(o=j.toLowerCase(),g[11]=j,g[12]=o):o=g[12];let k=`Filter by ${o}`;return g[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,a.jsx)(nZ.SelectValue,{}),g[13]=d):d=g[13],g[14]!==k?(c=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":k,children:d}),g[14]=k,g[15]=c):c=g[15],g[16]!==j?(u=j.toLowerCase(),g[16]=j,g[17]=u):u=g[17],g[18]!==u?(m=(0,a.jsxs)(nZ.SelectItem,{value:"all",children:["Any ",u]}),g[18]=u,g[19]=m):m=g[19],g[20]!==b?(p=b.map(sn),g[20]=b,g[21]=p):p=g[21],g[22]!==m||g[23]!==p?(h=(0,a.jsxs)(nZ.SelectContent,{children:[m,p]}),g[22]=m,g[23]=p,g[24]=h):h=g[24],g[25]!==c||g[26]!==h||g[27]!==r||g[28]!==l||g[29]!==S?(f=(0,a.jsxs)(nZ.Select,{items:r,onValueChange:l,value:S,children:[c,h]}
1),g[25]=c,g[26]=h,g[27]=r,g[28]=l,g[29]=S,g[30]=f):f=g[30],g[31]!==t||g[32]!==f?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[t,f]}),g[31]=t,g[32]=f,g[33]=x):x=g[33],x}function sn(e){return(0,a.jsx)(nZ.SelectItem,{value:e.value,children:e.label},e.value)}var sa=e.i(827154);let ss=[{label:"No grouping",value:"none"},{label:"Status",value:"status"},{label:"Assignee",value:"assignee"},{label:"Project",value:"project"},{label:"Label",value:"label"}],si=[{label:"Manual",value:"manual"},{label:"Newest created",value:"created_newest"},{label:"Due soonest",value:"due_soonest"},{label:"Priority",value:"priority"},{label:"Title",value:"title"}];function sr(e){let t,n,i,r,l,c,u,m,p,h,f,x,g,v,b,y=(0,s.c)(29),{config:j,onChange:I,presentation:_}=e,S=void 0===_?"labelled":_;y[0]!==S?(t=(0,nt.adaptiveTrigger)(S),y[0]=S,y[1]=t):t=y[1];let k=t;y[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(sa.ArrowUpDown,{}),y[2]=n):n=y[2];let w=k.labelled?"Layout":null;return y[3]!==w||y[4]!==k.className||y[5]!==k.size?(i=(0,a.jsx)(eL.PopoverTrigger,{render:(0,a.jsxs)(o.Button,{"aria-label":"Layout",className:k.className,size:k.size,variant:"ghost",children:[n,w]})}),y[3]=w,y[4]=k.className,y[5]=k.size,y[6]=i):i=y[6],y[7]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(d.Text,{variant:"caption",children:"Group by"}),y[7]=r):r=y[7],y[8]!==I?(l=e=>{let t=e?ss.find(t=>t.value===e)?.value:void 0;t&&I({groupBy:t})},y[8]=I,y[9]=l):l=y[9],y[10]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":"Group tasks",children:(0,a.jsx)(nZ.SelectValue,{})}),y[10]=c):c=y[10],y[11]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)(nZ.SelectContent,{children:ss.map(so)}),y[11]=u):u=y[11],y[12]!==j.groupBy||y[13]!==l?(m=(0,a.jsxs)(nZ.Select,{items:ss,onValueChange:l,value:j.groupBy,children:[c,u]}),y[12]=j.groupBy,y[13]=l,y[14]=m):m=y[14],y[15]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(d.Text,{variant:"caption",children:"Sort by"}),y[15]=p):p=y[15],y[16]!==I?(h=e=>{let t=e?si.find(t=>t.value===e)?.value:void 0;t&&I({sortBy:t})},y[16]=I,y[17]=h):h=y[17],y[18]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":"Sort tasks",children:(0,a.jsx)(nZ.SelectValue,{})}),y[18]=f):f=y[18],y[19]===Symbol.for("react.memo_cache_sentinel")?(x=(0,a.jsx)(nZ.SelectContent,{children:si.map(sl)}),y[19]=x):x=y[19],y[20]!==j.sortBy||y[21]!==h?(g=(0,a.jsxs)(nZ.Select,{items:si,onValueChange:h,value:j.sortBy,children:[f,x]}),y[20]=j.sortBy,y[21]=h,y[22]=g):g=y[22],y[23]!==m||y[24]!==g?(v=(0,a.jsx)(eL.PopoverContent,{align:"end",className:"w-56",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[r,m,p,g]})}),y[23]=m,y[24]=g,y[25]=v):v=y[25],y[26]!==v||y[27]!==i?(b=(0,a.jsxs)(eL.Popover,{children:[i,v]}),y[26]=v,y[27]=i,y[28]=b):b=y[28],b}function sl(e){return(0,a.jsx)(nZ.SelectItem,{value:e.value,children:e.label},e.value)}function so(e){return(0,a.jsx)(nZ.SelectItem,{value:e.value,children:e.label},e.value)}var sd=e.i(367906);function sc(e){let t,n,i,r,l,d,c=(0,s.c)(15),{config:u,onChange:m,presentation:p}=e,h=void 0===p?"labelled":p;c[0]!==h?(t=(0,nt.adaptiveTrigger)(h,"icon"),c[0]=h,c[1]=t):t=c[1];let f=t;c[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(sd.Search,{}),c[2]=n):n=c[2];let x=f.labelled?"Search tasks":null;return c[3]!==x||c[4]!==f.className||c[5]!==f.size?(i=(0,a.jsx)(eL.PopoverTrigger,{render:(0,a.jsxs)(o.Button,{"aria-label":"Search tasks",className:f.className,size:f.size,title:"Search tasks",variant:"ghost",children:[n,x]})}),c[3]=x,c[4]=f.className,c[5]=f.size,c[6]=i):i=c[6],c[7]!==m?(r=e=>m({search:e.target.value}),c[7]=m,c[8]=r):r=c[8],c[9]!==u.search||c[10]!==r?(l=(0,a.jsx)(eL.PopoverContent,{align:"end",className:"w-72",children:(0,a.jsx)(ey.Input,{"aria-label":"Search task title, identifier, project, or label",autoFocus:!0,onChange:r,placeholder:"Search tasks...",value:u.search})}),c[9]=u.search,c[10]=r,c[11]=l):l=c[11],c[12]!==i||c[13]!==l?(d=(0,a.jsxs)(eL.Popover,{children:[i,l]}),c[12]=i,c[13]=l,c[14]=d):d=c[14],d}let su={assignees:[],labels:[],projects:[],statuses:[]},sm=[];function sp(e){let t,n,i=(0,s.c)(11),{disabled:r,icon:l,label:d,onClick:c,presentation:u,title:m}=e;i[0]!==u?(t=(0,nt.adaptiveTrigger)(u,"icon"),i[0]=u,i[1]=t):t=i[1];let p=t,h=p.labelled?d:null;return i[2]!==r||i[3]!==l||i[4]!==d||i[5]!==c||i[6]!==h||i[7]!==m||i[8]!==p.className||i[9]!==p.size?(n=(0,a.jsxs)(o.Button,{"aria-label":d,className:p.className,disabled:r,onClick:c,size:p.size,title:m,variant:"ghost",children:[l,h]}),i[2]=r,i[3]=l,i[4]=d,i[5]=c,i[6]=h,i[7]=m,i[8]=p.className,i[9]=p.size,i[10]=n):n=i[10],n}function sh(e){return(0,a.jsx)(aK,{presentation:e})}function sf(e,t){return{key:e,pinned:!0,priority:0,render:t}}function sx(e){let t,n=(0,s.c)(2),i=function(e){let t,n,i=(0,s.c)(22),{isListPublic:o,kanbanEnabled:d,listId:c}=e,[u,p]=(0,m.useState)(!1),h=!d;
1i[0]!==c||i[1]!==h?(t={listId:c,showViewControls:h},i[0]=c,i[1]=h,i[2]=t):t=i[2];let x=function(e){let t,n,i=(0,s.c)(35),{listId:o,showViewControls:d}=e,{undo:c,redo:u,canUndo:m,canRedo:p}=aG(),h=(0,J.useTaskViewConfig)(),x=(0,J.useUpdateTaskViewConfig)(),g=function(e){let t,n,a,i,o,d,c,u,m=(0,s.c)(22),{gate:p}=(0,f.useGuestGate)();m[0]!==p||m[1]!==e?(t=e?p({id:e}):"skip",m[0]=p,m[1]=e,m[2]=t):t=m[2];let h=(0,l.useQuery)(r.api.todo_lists.queries.getById,t);m[3]!==p||m[4]!==h?(n=h?p({teamId:h.teamId}):"skip",m[3]=p,m[4]=h,m[5]=n):n=m[5];let x=n;m[6]!==p||m[7]!==e?(a=e?p({listId:e}):"skip",m[6]=p,m[7]=e,m[8]=a):a=m[8];let g=(0,l.useQuery)(r.api.todos.assignments.getAssignableMembers,a),v=(0,l.useQuery)(r.api.task_labels.queries.list,x),b=(0,l.useQuery)(r.api.projects.queries.listForTaskScope,x);return h?(m[9]!==g?(i=g??[],m[9]=g,m[10]=i):i=m[10],m[11]!==v?(o=v??[],m[11]=v,m[12]=o):o=m[12],m[13]!==b?(d=b??[],m[13]=b,m[14]=d):d=m[14],m[15]!==h.statusOptions?(c=h.statusOptions??[],m[15]=h.statusOptions,m[16]=c):c=m[16],m[17]!==i||m[18]!==o||m[19]!==d||m[20]!==c?(u={assignees:i,labels:o,projects:d,statuses:c},m[17]=i,m[18]=o,m[19]=d,m[20]=c,m[21]=u):u=m[21],u):su}(o),v=!o;if(i[0]!==p||i[1]!==m||i[2]!==h||i[3]!==u||i[4]!==g||i[5]!==d||i[6]!==v||i[7]!==c||i[8]!==x){n=Symbol.for("react.early_return_sentinel");e:{let e,s;if(v){n=sm;break e}if(i[11]!==m||i[12]!==c?(e={key:"undo",priority:7,render:e=>(0,a.jsx)(sp,{disabled:!m,icon:(0,a.jsx)(aF.Undo2,{}),label:"Undo delete",onClick:c,presentation:e,title:"Undo delete (⌘Z)"})},i[11]=m,i[12]=c,i[13]=e):e=i[13],i[14]!==p||i[15]!==u?(s={key:"redo",priority:6,render:e=>(0,a.jsx)(sp,{disabled:!p,icon:(0,a.jsx)(aU.Redo2,{}),label:"Redo delete",onClick:u,presentation:e,title:"Redo delete (⇧⌘Z)"})},i[14]=p,i[15]=u,i[16]=s):s=i[16],i[17]!==h||i[18]!==g||i[19]!==d||i[20]!==e||i[21]!==s||i[22]!==x){let r,l,o,c;if(t=[e,s],!d){n=t;break e}i[24]!==h||i[25]!==x?(r={key:"search",priority:2,render:e=>(0,a.jsx)(sc,{config:h,onChange:x,presentation:e})},i[24]=h,i[25]=x,i[26]=r):r=i[26],i[27]!==h||i[28]!==g||i[29]!==x?(l={key:"filters",priority:3,render:e=>(0,a.jsx)(a1,{config:h,onChange:x,presentation:e,resources:g})},i[27]=h,i[28]=g,i[29]=x,i[30]=l):l=i[30],i[31]!==h||i[32]!==x?(o={key:"layout",priority:4,render:e=>(0,a.jsx)(sr,{config:h,onChange:x,presentation:e})},i[31]=h,i[32]=x,i[33]=o):o=i[33],i[34]===Symbol.for("react.memo_cache_sentinel")?(c={key:"views",priority:5,render:sh},i[34]=c):c=i[34],t.push(r,l,o,c),i[17]=h,i[18]=g,i[19]=d,i[20]=e,i[21]=s,i[22]=x,i[23]=t}else t=i[23]}i[0]=p,i[1]=m,i[2]=h,i[3]=u,i[4]=g,i[5]=d,i[6]=v,i[7]=c,i[8]=x,i[9]=t,i[10]=n}else t=i[9],n=i[10];return n!==Symbol.for("react.early_return_sentinel")?n:t}(t);if(i[3]!==o||i[4]!==u||i[5]!==c||i[6]!==e||i[7]!==x){if(n=[...x],c){let e;i[9]!==c?(e=sf("presence",()=>(0,a.jsx)(nn.ObjectPresenceStack,{objectId:c,objectType:"todoList"})),i[9]=c,i[10]=e):e=i[10],n.push(e)}if(c){let e,t;i[11]!==c?(e=sf("view",()=>(0,a.jsx)(aj,{listId:c})),i[11]=c,i[12]=e):e=i[12],i[13]!==c?(t=sf("settings",()=>(0,a.jsx)(ap,{listId:c})),i[13]=c,i[14]=t):t=i[14],n.push(e,t)}if(c&&e.onToggleListVisibility){let t,s=e.onToggleListVisibility;i[15]!==o||i[16]!==u||i[17]!==c||i[18]!==s?(t=sf("share",()=>(0,a.jsx)(nb,{isPublic:o??!1,listId:c,onOpenChange:p,onToggleVisibility:s,open:u})),i[15]=o,i[16]=u,i[17]=c,i[18]=s,i[19]=t):t=i[19],n.push(t)}if(e.onDelete||e.onDuplicate||e.onMoveToParentList||e.onUncheckAll||e.onDeleteAll||e.onLock){let t;i[20]!==e?(t=sf("options",()=>(0,a.jsx)(aB,{...e})),i[20]=e,i[21]=t):t=i[21],n.push(t)}i[3]=o,i[4]=u,i[5]=c,i[6]=e,i[7]=x,i[8]=n}else n=i[8];return n}(e);return n[0]!==i?(t=(0,a.jsx)(nt.PriorityOverflowBar,{itemNoun:"task actions",items:i,reserve:200}),n[0]=i,n[1]=t):t=n[1],t}var sg=e.i(155493),sv=e.i(383366),sb=e.i(625923),sy=e.i(729531);function sj(e){let t,n,i=(0,s.c)(12),{current:r}=e,{uploadedImages:l,onUploadImage:o,onDeleteImage:d,onTouchImage:c}=(0,sy.useIconUpload)(),u=r.onIconChange;if(!u)return null;let m=`Change ${r.title} icon`,p=r.iconData??ex;return i[0]!==p?(t=(0,a.jsx)(em.IconDisplay,{size:12,value:p}),i[0]=p,i[1]=t):t=i[1],i[2]!==r.iconData||i[3]!==r.listId||i[4]!==d||i[5]!==u||i[
16]!==c||i[7]!==o||i[8]!==m||i[9]!==t||i[10]!==l?(n=(0,a.jsx)(sb.IconPicker,{ariaLabel:m,onChange:u,onDeleteImage:d,onTouchImage:c,onUploadImage:o,triggerClassName:"size-8",uploadedImages:l,value:r.iconData,children:t},r.listId),i[2]=r.iconData,i[3]=r.listId,i[4]=d,i[5]=u,i[6]=c,i[7]=o,i[8]=m,i[9]=t,i[10]=l,i[11]=n):n=i[11],n}function sI(e){let t,n=(0,s.c)(5),{current:i}=e;if(i.isMyTasks){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(eg.MyTasksIcon,{size:12}),n[0]=e):e=n[0],e}if(i.onIconChange){let e;return n[1]!==i?(e=(0,a.jsx)(sj,{current:i}),n[1]=i,n[2]=e):e=n[2],e}let r=i.iconData??ex;return n[3]!==r?(t=(0,a.jsx)(em.IconDisplay,{size:12,value:r}),n[3]=r,n[4]=t):t=n[4],t}function s_(e){let t,n,i,r=(0,s.c)(9),{current:l}=e,c=function(e){let t,n,a,i,r=(0,s.c)(11),[l,o]=(0,m.useState)(null);r[0]!==e||r[1]!==l?(t=()=>{if(null===l)return;o(null);let t=l.trim();t&&t!==e.title&&e.onRename?.(t)},r[0]=e,r[1]=l,r[2]=t):t=r[2];let d=t;r[3]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{"Enter"===e.key&&(e.preventDefault(),e.currentTarget.blur()),"Escape"===e.key&&(e.preventDefault(),o(null))},r[3]=n):n=r[3];let c=n,u=l??e.title,p=null!==l;return r[4]!==e?(a=()=>o(e.title),r[4]=e,r[5]=a):a=r[5],r[6]!==d||r[7]!==u||r[8]!==p||r[9]!==a?(i={changeDraft:o,commit:d,draft:u,handleKeyDown:c,isEditing:p,startEditing:a},r[6]=d,r[7]=u,r[8]=p,r[9]=a,r[10]=i):i=r[10],i}(l);return r[0]!==l?(t=(0,a.jsx)(sI,{current:l}),r[0]=l,r[1]=t):t=r[1],r[2]!==l.onRename||r[3]!==l.title||r[4]!==c?(n=c.isEditing?(0,a.jsx)(ey.Input,{"aria-label":`Rename ${l.title}`,autoFocus:!0,className:"w-40",onBlur:c.commit,onChange:e=>c.changeDraft(e.target.value),onKeyDown:c.handleKeyDown,size:"sm",value:c.draft,variant:"ghost"}):l.onRename?(0,a.jsx)(o.Button,{onClick:c.startEditing,size:"sm",variant:"ghost",children:l.title}):l.title,r[2]=l.onRename,r[3]=l.title,r[4]=c,r[5]=n):n=r[5],r[6]!==t||r[7]!==n?(i=(0,a.jsxs)(d.Text,{"aria-current":"page",as:"span",className:"flex h-8 min-w-0 items-center gap-0",variant:"bodySmall",children:[t,n]}),r[6]=t,r[7]=n,r[8]=i):i=r[8],i}function sS(e){let t=(0,s.c)(8),{current:n}=e;switch(n.kind){case"list":{let e;return t[0]!==n?(e=(0,a.jsx)(s_,{current:n}),t[0]=n,t[1]=e):e=t[1],e}case"label":{let e,s;return t[2]!==n.iconData||t[3]!==n.isMyTasks?(e=n.isMyTasks?(0,a.jsx)(eg.MyTasksIcon,{size:12}):n.iconData?(0,a.jsx)(em.IconDisplay,{size:12,value:n.iconData}):null,t[2]=n.iconData,t[3]=n.isMyTasks,t[4]=e):e=t[4],t[5]!==n.label||t[6]!==e?(s=(0,a.jsxs)(sg.BreadcrumbPage,{className:"flex h-8 items-center gap-1.5 px-2",children:[e,n.label]}),t[5]=n.label,t[6]=e,t[7]=s):s=t[7],s}}}function sk(e){let t,n,i,r=(0,s.c)(7),{ancestors:l,current:o}=e;return r[0]!==l?(t=l.map(e=>({icon:e.isMyTasks?(0,a.jsx)(eg.MyTasksIcon,{size:12}):(0,a.jsx)(em.IconDisplay,{size:12,value:e.iconData??ex}),key:e.label,label:e.label,onSelect:e.onClick})),r[0]=l,r[1]=t):t=r[1],r[2]!==o?(n=(0,a.jsx)(sS,{current:o}),r[2]=o,r[3]=n):n=r[3],r[4]!==t||r[5]!==n?(i=(0,a.jsx)(sv.CollapsingBreadcrumb,{crumbs:t,separator:"<",trailing:n}),r[4]=t,r[5]=n,r[6]=i):i=r[6],i}let sw=[],sC=[];function sT(e){let t,n,i,r=(0,s.c)(25),{allParentLists:l,breadcrumbs:o,current:d,currentParentId:c,currentTeamId:u,isListPublic:m,kanbanEnabled:p,onCreateParentList:h,onDelete:f,onDeleteAll:x,onDuplicate:g,onLock:v,onMoveToParentList:b,onMoveToSpace:y,onToggleListVisibility:j,onUncheckAll:I,scopeTabs:_,teams:S}=e,k=void 0===l?sw:l,w=void 0!==p&&p,C=void 0===S?sC:S;r[0]!==o||r[1]!==d?(t=d?(0,a.jsx)(sk,{ancestors:o,current:d}):null,r[0]=o,r[1]=d,r[2]=t):t=r[2];let T=d?.listId,N=d?.title??"List";return r[3]!==k||r[4]!==c||r[5]!==u||r[6]!==m||r[7]!==w||r[8]!==h||r[9]!==f||r[10]!==x||r[11]!==g||r[12]!==v||r[13]!==b||r[14]!==y||r[15]!==j||r[16]!==I||r[17]!==T||r[18]!==N||r[19]!==C?(n=(0,a.jsx)(sx,{allParentLists:k,currentParentId:c,currentTeamId:u,isListPublic:m,kanbanEnabled:w,listId:T,onCreateParentList:h,onDelete:f,onDeleteAll:x,onDuplicate:g,onLock:v,onMoveToParentList:b,onMoveToSpace:y,onToggleListVisibility:j,onUncheckAll:I,teams:C,title:N}),r[3]=k,r[4]=c,r[5]=u,r[6]=m,r[7]=w,r[8]=h,r[9]=f,r[10]=x,r[11]=g,r[12]=v,r[13]=b,r[14]=y,r[15]=j,r[16]=I,r[17]=T,r[18]=N,r[19]=C,r[20]=n):n=r[20],r[21]!==_||r[22]!==t||r[23]!==n?(i=(0,a.jsx)("div",{className:"px-3 py-2",children:(0,a.jsxs)(ne.AdaptiveRow,{className:"gap-2",children:[t,_,n]})}),r[21]=_,r[22]=t,r[23]=n,r[24]=i):i=r[24],i}function sN(e){let t,n,i=(0,s.c)(5),r=t8();return i[0]!==e?(t=(0,a.jsx)(sT,{...e}),i[0]=e,i[1]=t):t=i[1],i[2]!==r||i[3]!==t?(n=r(t),i[2]=r,i[3]=t,i[4]=n):n=i[4],n}var sD=e.i(812652);let sL=[],sA=(0,m.createContext)({handsOn:()=>sL,setEditingTaskId:()=>void 0});function sP(){return(0,m.useContext)(sA)}function sO(e){let t,n,i,r,l=(0,s.c)(10),{children:o,listId:d}=e,[c,u]=(0,m.useState)(void 0);l[0]!==c||l[1]!==d?(t={blockId:c,objectId:d,objectType:"todoList"},l[0]=c,l[1]=d,l[2]=t):t=l[2];let p=(0,sD.useObjectPresence)(t);l[3]!==p?(n=e=>p.filter(t=>t.blockId===e&&!("person"===t.kind&&t.isSelf)),l[3]=p,l[4]=n):n=l[4];let h=n;return l[5]!==h?(i={handsOn:h,setEditingTaskId:u},l[5]=h,l[6]=i):i=l[6],l[7]!==o||l[8]!==i?(r=(0,a.jsx)(sA.Provider,{value:i,children:o}),l[7]=o,l[8]=i,l[9]=r):r=l[9],r}var sE=e.i(950420);function sM(e){let t,n,i,r,l=(0,s.c)(11),{children:o,className:d,onClearSelection:c}=e;l[0]!==c?(t=e=>{(0,sE.isEmptySpace)(e.target)&&c?.()},l[0]=c,l[1]=t):t=l[1];let u=t;l[2]!==c?(n=e=>{"Escape"===e.key&&c?.()},l[2]=c,l[3]=n):n=l[3];let m=n;return l[4]!==d?(i=(0,j.cn)("sticky top-0 flex h-full min-h-0 min-w-0 flex-1 items-stretch gap-3 overflow-x-auto overflow-y-hidden p-2",d),l[4]=d,l[5]=i):i=l[5],l[6]!==o||l[7]!==m||l[8]!==u||l[9]!==i?(r=(0,a.jsx)("div",{className:i,"data-slot":"board-shell",onKeyDown:m,onPointerDown:u,children:o}),l[6]=o,l[7]=m,l[8]=u,l[9]=i,l[10]=r):r=l[10],r}var sR=e.i(101161);let sz={"data-kanban-card":""};function sB({placement:e,todos:t}){if("top"===e){let[e]=t;return void 0===e?void 0:(e.sortOrder??0)-1e3}let n=t.at(-1);return void 0===n?void 0:(n.sortOrder??0)+1e3}function sU(e){let t,n,a,i,r,l,o=(0,s.c)(15),[d,c]=(0,m.useState)("top"),[u,p]=(0,m.useState)(!1),[h,f]=(0,m.useState)(0),[x,g]=(0,m.useState)("");o[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{c(e),g(""),p(!0),f(sF)},o[0]=t):t=o[0];let v=t;return o[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{p(!1),g("")},o[1]=n):n=o[1],o[2]!==e||o[3]!==d?(a=t=>{e?.({placement:d,text:t}),g("")},o[2]=e,o[3]=d,o[4]=a):a=o[4],o[5]!==e?(i=t=>{let{target:n}=t;!e||n instanceof Element&&n.closest("[role='option'], [data-kanban-card]")||v("bottom")},o[5]=e,o[6]=i):i=o[6],o[7]===Symbol.for("react.memo_cache_sentinel")?(r=()=>v("top"),o[7]=r):r=o[7],o[8]!==h||o[9]!==u||o[10]!==d||o[11]!==a||o[12]!==i||o[13]!==x?(l={cancel:n,commit:a,draftKey:h,handleEmptySp
1aceDoubleClick:i,isActive:u,placement:d,setText:g,start:r,text:x},o[8]=h,o[9]=u,o[10]=d,o[11]=a,o[12]=i,o[13]=x,o[14]=l):l=o[14],l}function sF(e){return e+1}var sG=e.i(766872);let sq=e=>{let t=(0,i.pointerWithin)(e);if(t.length>0)return t;let n=(0,i.rectIntersection)(e);return n.length>0?n:(0,i.closestCorners)(e)};var s$=e.i(602288),sK=e.i(51436),sQ=e.i(559636),sV=e.i(282640);function sW(e){let t,n,i,r,l=(0,s.c)(11),{className:o,taskId:d}=e,c=sP();if(l[0]!==o||l[1]!==c||l[2]!==d){i=Symbol.for("react.early_return_sentinel");e:{let e=c.handsOn(d);if(0===e.length){i=null;break e}l[6]!==o?(t=(0,j.cn)("flex shrink-0 items-center gap-1",o),l[6]=o,l[7]=t):t=l[7],n=e.map(sH)}l[0]=o,l[1]=c,l[2]=d,l[3]=t,l[4]=n,l[5]=i}else t=l[3],n=l[4],i=l[5];return i!==Symbol.for("react.early_return_sentinel")?i:(l[8]!==t||l[9]!==n?(r=(0,a.jsx)("span",{className:t,children:n}),l[8]=t,l[9]=n,l[10]=r):r=l[10],r)}function sH(e){return(0,a.jsx)(sV.PresenceHandChip,{hand:e},e.userId)}function sY(e,t){let n,a,i,r=(0,s.c)(8),l=(0,J.useCurrentListId)(),o=tC(e??l);r[0]!==t||r[1]!==o.properties?(n=tI(o.properties,t),r[0]=t,r[1]=o.properties,r[2]=n):n=r[2];let d=n;return r[3]!==d?(a=e=>d.some(t=>t.key===e),r[3]=d,r[4]=a):a=r[4],r[5]!==d||r[6]!==a?(i={ordered:d,shows:a},r[5]=d,r[6]=a,r[7]=i):i=r[7],i}let sX=(0,m.createContext)(!0),sJ=sX.Provider;function sZ(){return(0,m.useContext)(sX)}function s0(e){let t,n=(0,s.c)(6),{emptyClassName:i,listId:r,todoId:l,selectedAssignees:o,tooltip:d}=e;return r?(n[0]!==i||n[1]!==r||n[2]!==o||n[3]!==l||n[4]!==d?(t=(0,a.jsx)(s1,{emptyClassName:i,listId:r,selectedAssignees:o,todoId:l,tooltip:d}),n[0]=i,n[1]=r,n[2]=o,n[3]=l,n[4]=d,n[5]=t):t=n[5],t):null}function s1(e){let t,n,i,o,d,c,u,m,p,h,x=(0,s.c)(35),{emptyClassName:g,listId:v,selectedAssignees:b,todoId:y,tooltip:I}=e,_=sZ(),{gate:S}=(0,f.useGuestGate)();x[0]!==S||x[1]!==v?(t=S({listId:v}),x[0]=S,x[1]=v,x[2]=t):t=x[2];let k=(0,l.useQuery)(r.api.todos.assignments.getAssignableMembers,t),w=(0,l.useMutation)(r.api.todos.assignments.assignTodo);if(x[3]!==k||x[4]!==w){let e;x[6]!==k?(e=(e,t)=>{let n=new Map((k??[]).map(s3)),a=t.userIds.map(e=>n.get(e)??{userId:e});(0,ee.applyTodoAssignmentChange)(e,{todoId:t.todoId,assignees:a})},x[6]=k,x[7]=e):e=x[7],n=w.withOptimisticUpdate(e),x[3]=k,x[4]=w,x[5]=n}else n=x[5];let C=n;x[8]!==b?(i=b.map(s2),x[8]=b,x[9]=i):i=x[9];let T=i;x[10]!==C||x[11]!==T||x[12]!==y?(o=e=>{C({todoId:y,userIds:T.includes(e)?T.filter(t=>t!==e):[...T,e]}).catch(console.error)},x[10]=C,x[11]=T,x[12]=y,x[13]=o):o=x[13];let N=o,D=0===b.length;if(!_){let e;return x[14]!==D||x[15]!==b?(e=D?null:(0,a.jsx)(eB,{assignees:b,size:"sm"}),x[14]=D,x[15]=b,x[16]=e):e=x[16],e}let L=D&&g;return x[17]!==L?(d=(0,j.cn)("inline-flex h-7 min-w-7 shrink-0 cursor-pointer select-none items-center justify-center rounded-md px-1 text-muted-foreground outline-none transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",L),x[17]=L,x[18]=d):d=x[18],x[19]!==D||x[20]!==b?(c=D?(0,a.jsx)(eA.UserPlus,{className:"h-3.5 w-3.5"}):(0,a.jsx)(eB,{assignees:b,size:"sm"}),x[19]=D,x[20]=b,x[21]=c):c=x[21],x[22]!==d||x[23]!==c||x[24]!==I?(u=(0,a.jsx)(eL.PopoverTrigger,{"aria-label":"Assign members",className:d,title:I,children:c}),x[22]=d,x[23]=c,x[24]=I,x[25]=u):u=x[25],x[26]!==k?(m=k??[],x[26]=k,x[27]=m):m=x[27],x[28]!==N||x[29]!==T||x[30]!==m?(p=(0,a.jsx)(eL.PopoverContent,{align:"end",children:(0,a.jsx)(eU,{members:m,onToggle:N,selectedIds:T})}),x[28]=N,x[29]=T,x[30]=m,x[31]=p):p=x[31],x[32]!==p||x[33]!==u?(h=(0,a.jsxs)(eL.Popover,{children:[u,p]}),x[32]=p,x[33]=u,x[34]=h):h=x[34],h}function s2(e){return e.userId}function s3(e){return[e.userId,e]}let s4={name:"SquareCheck",type:"lucide"};function s5(e,t){let n,a,i=(0,s.c)(7),{gate:o}=(0,f.useGuestGate)();i[0]!==o||i[1]!==e||i[2]!==t?(n=t&&!e?o({id:t}):"skip",i[0]=o,i[1]=e,i[2]=t,i[3]=n):n=i[3];let d=(0,l.useQuery)(r.api.todo_lists.queries.getById,n);return i[4]!==e||i[5]!==d?.iconData?(a=(0,eI.fromConvexIconData)(e)??(0,eI.fromConvexIconData)(d?.iconData)??s4,i[4]=e,i[5]=d?.iconData,i[6]=a):a=i[6],a}function s6(e){let t,n,i,r=(0,s.c)(7),{className:l,iconData:o,listId:d}=e,c=s5(o,d);return r[0]!==l?(t=(0,j.cn)("flex size-4 shrink-0 items-center justify-center",l),r[0]=l,r[1]=t):t=r[1],r[2]!==c?(n=(0,a.jsx)(em.IconDisplay,{className:"shrink-0",size:16,value:c}),r[2]=c,r[3]=n):n=r[3],r[4]!==t||r[5]!==n?(i=(0,a.jsx)("div",{className:t,children:n}),r[4]=t,r[5]=n,r[6]=i):i=r[6],i}let s7="relative box-content flex h-[1lh] shrink-0 items-center justify-center py-1 after:absolute after:-inset-2";function s8(e){let t,n,i,r,l=(0,s.c)(11),{action:o,children:d,className:c,lead:u}=e;return l[0]!==c?(t=(0,j.cn)("flex min-w-0 items-start gap-2",c),l[0]=c,l[1]=t):t=l[1],l[2]!==d?(n=(0,a.jsx)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:d}),l[2]=d,l[3]=n):n=l[3],l[4]!==o?(i=o?(0,a.jsx)("div",{className:"shrink-0",children:o}):null,l[4]=o,l[5]=i):i=l[5],l[6]!==u||l[7]!==t||l[8]!==n||l[9]!==i?(r=(0,a.jsxs)("div",{className:t,children:[u,n,i]}),l[6]=u,l[7]=t,l[8]=n,l[9]=i,l[10]=r):r=l[10],r}var s9=e.i(964852),ie=e.i(484660);function it(e){e3.toast.error((0,ie.userFacingErrorMessage)(e,"The task was not deleted."))}let ia={closed:"red",draft:"gray",merged:"purple",open:"green"};function is(e){return 1===e.count&&void 0!==e.number?`#${e.number}`:`${e.count} PRs`}function ii(e){let t,n,i,r,l,o,d=(0,s.c)(16),{todo:c}=e,u=c.pullRequestCount??0;if(0===u)return null;if(d[0]!==u||d[1]!==c.pullRequestNumber||d[2]!==c.pullRequestState){var m;let e,a={count:u,number:c.pullRequestNumber,state:c.pullRequestState};t=nr.Badge,(e=is(a),n=a.state?`Linked work ${e}, ${a.state}`:`Linked work ${e}`,i="xs",d[8]!==c.pullRequestState)?(r=(m=c.pullRequestState)?ia[m]:"outline",d[8]=c.pullRequestState,d[9]=r):r=d[9],l=is(a),d[0]=u,d[1]=c.pullRequestNumber,d[2]=c.pullRequestState,d[3]=t,d[4]=n,d[5]=i,d[6]=r,d[7]=l}else t=d[3],n=d[4],i=d[5],r=d[6],l=d[7];return d[10]!==t||d[11]!==n||d[12]!==i||d[13]!==r||d[14]!==l?(o=(0,a.jsx)(t,{"aria-label":n,size:i,variant:r,children:l}),d[10]=t,d[11]=n,d[12]=i,d[13]=r,d[14]=l,d[15]=o):o=d[15],o}function ir(e,t=Date.now()){return(0,A.startOfLocalDayInstant)(e)<(0,A.startOfLocalDayInstant)(t)}function il(e,t=Date.now()){return(0,A.startOfLocalDayInstant)(e)<(0,A.startOfLocalDayInstant)(t)?(0,A.formatDueRelative)((0,A.startOfLocalDayInstant)(e),{now:t}):(0,A.formatDate)(e,{variant:"day"})}let io=["gray","red","orange","green","blue","purple"],id={blue:"fill-chart-1 text-chart-1",gray:"fill-muted-foreground text-muted-foreground",green:"fill-chart-2 text-chart-2",orange:"fill-chart-3 text-chart-3",purple:"fill-chart-4 text-chart-4",red:"fill-destructive text-destructive"},ic={blue:"Blue",gray:"Gray",green:"Green",orange:"Orange",purple:"Purple",red:"Red"};function iu(e){let t,n,i=(0,s.c)(5),{label:r}=e;return i[0]!==r.color?(t=(0,a.jsx)(im,{color:r.color}),i[0]=r.color,i[1]=t):t=i[1],i[2]!==r.name||i[3]!==t?(n=(0,a.jsxs)(nr.Badge,{size:"xs",variant:"outline",children:[t,r.n
1ame]}),i[2]=r.name,i[3]=t,i[4]=n):n=i[4],n}function im(e){let t,n=(0,s.c)(2),{color:i}=e,r=id[i];return n[0]!==r?(t=(0,a.jsx)(nF.Circle,{className:r}),n[0]=r,n[1]=t):t=n[1],t}let ip=new Intl.DateTimeFormat("en",{day:"numeric",month:"short"}),ih=()=>null,ix={assignee:ih,created:({todo:e})=>(0,a.jsxs)(d.Text,{as:"span",variant:"caption",children:["Created ",ip.format(e.createdAt)]}),due:({todo:e})=>(0,a.jsx)(iv,{completed:e.completed,dueDate:e.dueDate}),estimate:({todo:e})=>void 0===e.estimatedMinutes?null:(0,a.jsxs)(nr.Badge,{size:"xs",variant:"outline",children:[e.estimatedMinutes,"m"]}),identifier:ih,images:ih,labels:({todo:e})=>e.labels?.map(e=>(0,a.jsx)(iu,{label:e},e.name)),linkedWork:({todo:e})=>(0,a.jsx)(ii,{todo:e}),list:({showListChip:e,todo:t})=>e&&t.listName?(0,a.jsx)(nr.Badge,{size:"xs",variant:"outline",children:t.listName}):null,priority:({todo:e})=>e.priority?(0,a.jsxs)(nr.Badge,{"aria-label":`${(0,aZ.taskPriorityLabel)(e.priority)} priority`,size:"xs",variant:"outline",children:[(0,a.jsx)(aJ,{priority:e.priority}),(0,aZ.taskPriorityLabel)(e.priority)]}):null,project:({todo:e})=>e.projectName?(0,a.jsx)(nr.Badge,{size:"xs",variant:"outline",children:e.projectName}):null,status:ih,updated:({todo:e})=>(0,a.jsx)(ib,{todo:e})};function ig(e){let t,n,i=(0,s.c)(9),{properties:r,showListChip:l,todo:o}=e;if(i[0]!==r||i[1]!==l||i[2]!==o){let e;i[4]!==l||i[5]!==o?(e=e=>(0,a.jsx)(m.Fragment,{children:ix[e.key]({showListChip:!0===l,todo:o})},e.key),i[4]=l,i[5]=o,i[6]=e):e=i[6],t=r.map(e),i[0]=r,i[1]=l,i[2]=o,i[3]=t}else t=i[3];return i[7]!==t?(n=(0,a.jsx)(a.Fragment,{children:t}),i[7]=t,i[8]=n):n=i[8],n}function iv(e){let t,n,i=(0,s.c)(5),{completed:r,dueDate:l}=e;if(void 0===l)return null;let o=!0!==r&&ir(l)?"destructive":"outline";return i[0]!==l?(t=il(l),i[0]=l,i[1]=t):t=i[1],i[2]!==o||i[3]!==t?(n=(0,a.jsx)(nr.Badge,{size:"xs",variant:o,children:t}),i[2]=o,i[3]=t,i[4]=n):n=i[4],n}function ib(e){var t,n;let i,r,l=(0,s.c)(4),{todo:o}=e,{updatedAt:d}=o;if(void 0===d||!(!(t={completed:!0===o.completed,updatedAt:d}).completed&&void 0!==t.updatedAt&&(t.now??Date.now())-t.updatedAt>=6048e5))return null;if(l[0]!==d){let e;e=Math.floor((((n={updatedAt:d}).now??Date.now())-n.updatedAt)/864e5),i=`Untouched ${e} days`,l[0]=d,l[1]=i}else i=l[1];return l[2]!==i?(r=(0,a.jsx)(nr.Badge,{size:"xs",variant:"ghost",children:i}),l[2]=i,l[3]=r):r=l[3],r}let iy="min-h-24",ij=(0,j.cn)(iy,"cursor-grab active:cursor-grabbing");function iI(e){let t,n=(0,s.c)(2),{todo:i}=e;return n[0]!==i?(t=(0,a.jsx)(nl.Card,{className:iy,variant:"glass",children:(0,a.jsx)(i_,{todo:i})}),n[0]=i,n[1]=t):t=n[1],t}function i_(e){let t,n,i,r,l,o,c,u,m,p,h,f,x,g,v=(0,s.c)(42),{action:b,hidden:y,showListChip:I,todo:_}=e;v[0]!==_.assignees?(t=_.assignees??[],v[0]=_.assignees,v[1]=t):t=v[1];let S=t,k=sY(_.listId,"cards"),w=y&&"invisible";v[2]!==w?(n=(0,j.cn)(w),v[2]=w,v[3]=n):n=v[3],v[4]!==k||v[5]!==_.identifier?(i=k.shows("identifier")&&(0,a.jsx)(d.Text,{className:"whitespace-nowrap",variant:"captionNumeric",children:_.identifier??"Task"}),v[4]=k,v[5]=_.identifier,v[6]=i):i=v[6],v[7]!==_.iconData||v[8]!==_.listId?(r=(0,a.jsx)(s6,{iconData:_.iconData,listId:_.listId}),v[7]=_.iconData,v[8]=_.listId,v[9]=r):r=v[9],v[10]!==_.text?(l=(0,a.jsx)(d.Text,{as:"span",className:"min-w-0",title:_.text,variant:"cardTitle",children:_.text}),v[10]=_.text,v[11]=l):l=v[11],v[12]!==r||v[13]!==l?(o=(0,a.jsx)(nl.CardTitle,{children:(0,a.jsx)(s8,{lead:r,children:l})}),v[12]=r,v[13]=l,v[14]=o):o=v[14],v[15]!==_._id?(c=(0,a.jsx)(sW,{taskId:_._id}),v[15]=_._id,v[16]=c):c=v[16],v[17]!==S||v[18]!==k||v[19]!==_?(u=k.shows("assignee")&&(0,a.jsx)(ik,{assignees:S,todo:_}),v[17]=S,v[18]=k,v[19]=_,v[20]=u):u=v[20],v[21]!==b||v[22]!==c||v[23]!==u?(m=(0,a.jsxs)(nl.CardAction,{className:"flex items-center gap-1",children:[c,u,b]}),v[21]=b,v[22]=c,v[23]=u,v[24]=m):m=v[24],v[25]!==m||v[26]!==n||v[27]!==i||v[28]!==o?(p=(0,a.jsxs)(nl.CardHeader,{className:n,children:[i,o,m]}),v[25]=m,v[26]=n,v[27]=i,v[28]=o,v[29]=p):p=v[29];let C=y&&"invisible";return v[30]!==C?(h=(0,j.cn)("flex flex-wrap items-center gap-1.5",C),v[30]=C,v[31]=h):h=v[31],v[32]!==k.ordered||v[33]!==I||v[34]!==_?(f=(0,a.jsx)(ig,{properties:k.ordered,showListChip:I,todo:_}),v[32]=k.ordered,v[33]=I,v[34]=_,v[35]=f):f=v[35],v[36]!==h||v[37]!==f?(x=(0,a.jsx)(nl.CardContent,{className:h,children:f}),v[36]=h,v[37]=f,v[38]=x):x=v[38],v[39]!==p||v[40]!==x?(g=(0,a.jsxs)(a.Fragment,{children:[p,x]}),v[39]=p,v[40]=x,v[41]=g):g=v[41],g}let iS=e=>e.stopPropagation();function ik(e){let t,n=(0,s.c)(7),{assignees:i,todo:r}=e;if(!r.listId){let e;return n[0]!==i?(e=i.length>0?(0,a.jsx)(eB,{assignees:i,size:"sm"}):null,n[0]=i,n[1]=e):e=n[1],e}return n[2]!==i||n[3]!==r._id||n[4]!==r.listId||n[5]!==r.teamId?(t=(0,a.jsx)("span",{className:"inline-flex",onClick:iS,onKeyDown:iS,onPointerDown:iS,role:"presentation",children:(0,a.jsx)(s0,{listId:r.listId,selectedAssignees:i,teamId:r.teamId,todoId:r._id,tooltip:"Assign members"})}),n[2]=i,n[3]=r._id,n[4]=r.listId,n[5]=r.teamId,n[6]=t):t=n[6],t}function iw(e){let t,n,i,o,d,c,u,m,p=(0,s.c)(25),{interaction:h,showIndicator:f,showListChip:x,todo:g}=e;p[0]!==h.onOpen||p[1]!==g?(t={onOpen:h.onOpen,todo:g},p[0]=h.onOpen,p[1]=g,p[2]=t):t=p[2];let v=function(e){let t,n,i,o,d,c,u=(0,s.c)(20),{onOpen:m,todo:p}=e,h=(0,l.useMutation)(r.api.todos.mutations.toggle),f=(0,l.useMutation)(r.api.todos.mutations.deleteTodo),x=(0,J.useRecordDeletion)(),g=p.completed??!1;u[0]!==m?(t={label:"Open",onSelect:m},u[0]=m,u[1]=t):t=u[1],u[2]!==g?(n=g?(0,a.jsx)(s9.RotateCcw,{}):(0,a.jsx)(ep.Check,{}),u[2]=g,u[3]=n):n=u[3];let v=g?"Mark as not done":"Mark as done";return u[4]!==g||u[5]!==p._id||u[6]!==h?(i=()=>{h({completed:!g,id:p._id}).catch(e=>{e3.toast.error((0,ie.userFacingErrorMessage)(e,g?"The task is still done. Try again.":"The task was not marked done. Try again."))})},u[4]=g,u[5]=p._id,u[6]=h,u[7]=i):i=u[7],u[8]!==n||u[9]!==v||u[10]!==i?(o={icon:n,label:v,onSelect:i},u[8]=n,u[9]=v,u[10]=i,u[11]=o):o=u[11],u[12]!==f||u[13]!==x||u[14]!==p._id?(d={label:"Delete",onSelect:()=>{f({id:p._id}).then(()=>x({id:p._id,kind:"task"})).catch(it)}},u[12]=f,u[13]=x,u[14]=p._id,u[15]=d):d=u[15],u[16]!==t||u[17]!==o||u[18]!==d?(c=[t,o,d],u[16]=t,u[17]=o,u[18]=d,u[19]=c):c=u[19],c}(t);p[3]!==f?(n="before"===f&&(0,a.jsx)(sK.BoardPlacementLine,{}),p[3]=f,p[4]=n):n=p[4];let b=`Open task ${g.text}`,y=`Actions for task ${g.text}`;return p[5]!==v||p[6]!==y?(i={actions:v,label:y},p[5]=v,p[6]=y,p[7]=i):i=p[7],p[8]!==b||p[9]!==i||p[10]!==g._id?(o={className:ij,id:g._id,label:b,menu:i,roleDescription:"task card",size:"default"},p[8]=b,p[9]=i,p[10]=g._id,p[11]=o):o=p[11],p[12]!==x||p[13]!==g?(d=e=>{let{action:t,isDragging:n}=e;return(0,a.jsx)(i_,{action:t,hidden:n,showListChip:x,todo:g})}
1,p[12]=x,p[13]=g,p[14]=d):d=p[14],p[15]!==h||p[16]!==o||p[17]!==d?(c=(0,a.jsx)(sQ.BoardCardShell,{card:o,interaction:h,children:d}),p[15]=h,p[16]=o,p[17]=d,p[18]=c):c=p[18],p[19]!==f?(u="after"===f&&(0,a.jsx)(sK.BoardPlacementLine,{}),p[19]=f,p[20]=u):u=p[20],p[21]!==n||p[22]!==c||p[23]!==u?(m=(0,a.jsxs)(a.Fragment,{children:[n,c,u]}),p[21]=n,p[22]=c,p[23]=u,p[24]=m):m=p[24],m}function iC(e){return{_id:e._id,assignees:e.assignees,completed:e.completed,createdAt:e.createdAt,date:e.date,dueDate:e.dueDate,endTime:e.endTime,estimatedMinutes:e.estimatedMinutes,iconData:e.iconData,identifier:e.identifier,imageUrls:e.imageUrls,labels:e.labels,listId:e.listId,listName:e.listName,note:e.note,priority:e.priority,projectName:e.projectName,pullRequestCount:e.pullRequestCount,pullRequestNumber:e.pullRequestNumber,startTime:e.startTime,teamId:e.teamId,text:e.text,updatedAt:e.updatedAt}}function iT(e){let t,n,i=(0,s.c)(7),{interaction:r,showIndicator:l,showListChip:o,todo:d}=e;return i[0]!==d?(t=iC(d),i[0]=d,i[1]=t):t=i[1],i[2]!==r||i[3]!==l||i[4]!==o||i[5]!==t?(n=(0,a.jsx)(iw,{interaction:r,showIndicator:l,showListChip:o,todo:t}),i[2]=r,i[3]=l,i[4]=o,i[5]=t,i[6]=n):n=i[6],n}let iN=`${s$.BOARD_LANE_WIDTH} cursor-grabbing`;function iD(e){let t,n,i=(0,s.c)(5),{activeTodo:r}=e,l=(0,v.usePortalContainer)()??void 0;return i[0]!==r?(t=r?(0,a.jsx)("div",{className:iN,children:(0,a.jsx)(iI,{todo:r})}):null,i[0]=r,i[1]=t):t=i[1],i[2]!==l||i[3]!==t?(n=(0,a.jsx)(x.ScaledDragOverlay,{container:l,dropAnimation:x.DRAG_SETTLE_ANIMATION,lift:!0,children:t}),i[2]=l,i[3]=t,i[4]=n):n=i[4],n}function iL(e){let t,n,i=(0,s.c)(5),{activeTodo:r}=e,l=(0,v.usePortalContainer)()??void 0;return i[0]!==r?(t=r?(0,a.jsx)("div",{className:iN,children:(0,a.jsx)(iI,{todo:iC(r)})}):null,i[0]=r,i[1]=t):t=i[1],i[2]!==l||i[3]!==t?(n=(0,a.jsx)(x.ScaledDragOverlay,{container:l,dropAnimation:x.DRAG_SETTLE_ANIMATION,lift:!0,children:t}),i[2]=l,i[3]=t,i[4]=n):n=i[4],n}function iA(e){let t,n,a,i,r,l,o,d,c=(0,s.c)(15),{lookup:u,onDrop:p,columnIdPrefix:h}=e,f=h??"status:",[x,g]=(0,m.useState)(null);c[0]===Symbol.for("react.memo_cache_sentinel")?(t={atEnd:!1},c[0]=t):t=c[0];let[v,b]=(0,m.useState)(t);c[1]===Symbol.for("react.memo_cache_sentinel")?(n={atEnd:!1},c[1]=n):n=c[1];let y=(0,m.useRef)(n),j=(0,m.useRef)(null);c[2]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{y.current=e,b(e)},c[2]=a):a=c[2];let I=a;c[3]===Symbol.for("react.memo_cache_sentinel")?(i=e=>{let t,n;g(String(e.active.id)),I({atEnd:!1}),t=e=>{j.current=e.clientY},n=()=>{j.current=null,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n),document.removeEventListener("pointercancel",n)},document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerup",n),document.addEventListener("pointercancel",n)},c[3]=i):i=c[3];let _=i;c[4]!==u||c[5]!==f?(r=e=>{let{active:t,over:n}=e;n?I(function(e){var t;let n,a=function(e){let t=function(e,t){if(e.startsWith(t))return e.slice(t.length)}(e.overId,e.prefix);if(t)return{overIsColumn:!0,statusId:t};let n=e.lookup.statusByTodoId.get(e.overId);if(n)return{overIsColumn:!1,statusId:n}}({lookup:e.lookup,overId:e.overId,prefix:e.prefix});if(!a)return{atEnd:!1};let s=e.lookup.todosByStatus[a.statusId]??[],i=s.filter(t=>t._id!==e.activeId),r=-1===(n=(t={overId:e.overId,visible:i}).visible.findIndex(e=>e._id===t.overId))?.5:(0,sG.boardPlacementSplitRatio)(n,t.visible.length),l=function(e,t,n){let a,s=e.over?.rect;if(!s)return!1;let i=(a=e.activatorEvent)instanceof MouseEvent||a instanceof PointerEvent?a.clientY:"u">typeof TouchEvent&&a instanceof TouchEvent&&a.touches.length>0?a.touches[0]?.clientY??null:null,r=t??(null===i?null:i+e.delta.y),l=s.top+s.height*n;if(null!==r)return r>l;let o=e.active.rect.current.translated;return!!o&&o.top+o.height/2>l}(e.event,e.livePointerY,r),o=function(e){let t=e.columnTodos.filter(t=>t._id!==e.activeId);if(e.overIsColumn)return{insertIndex:t.length};let n=t.findIndex(t=>t._id===e.overId);return -1===n?{insertIndex:t.length}:e.pointerBelowMidpoint?{insertIndex:n+1,overTodoId:e.overId,position:"after"}:{insertIndex:n,overTodoId:e.overId,position:"before"}}({activeId:e.activeId,columnTodos:s,overId:e.overId,overIsColumn:a.overIsColumn,pointerBelowMidpoint:l}),d=s.filter(t=>t._id!==e.activeId),c="after"===o.position,u=c?o.overTodoId:void 0;return{afterId:u,atEnd:o.insertIndex>=d.length&&!u,beforeId:c?void 0:o.overTodoId,insertIndex:o.insertIndex,statusId:a.statusId}}({activeId:String(t.id),event:e,livePointerY:j.current,lookup:u,overId:String(n.id),prefix:f})):I({atEnd:!1})},c[4]=u,c[5]=f,c[6]=r):r=c[6];let S=r;c[7]!==p?(l=e=>{let t=y.current,{active:n,over:a}=e;g(null),I({atEnd:!1}),j.current=null,a&&p({activeId:String(n.id),drop:t})},c[7]=p,c[8]=l):l=c[8];let k=l;c[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{g(null),I({atEnd:!1}),j.current=null},c[9]=o):o=c[9];let w=o;return c[10]!==x||c[11]!==v||c[12]!==k||c[13]!==S?(d={activeId:x,drop:v,handleDragCancel:w,handleDragEnd:k,handleDragOver:S,handleDragStart:_},c[10]=x,c[11]=v,c[12]=k,c[13]=S,c[14]=d):d=c[14],d}e.i(972063);var iP=e.i(259199);function iO(e){let t,n=(0,s.c)(4),{children:i,label:r,onEmptySpaceDoubleClick:l}=e,o=`${r} tasks`;return n[0]!==i||n[1]!==l||n[2]!==o?(t=(0,a.jsx)("section",{"aria-label":o,className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto",onDoubleClick:l,children:i}),n[0]=i,n[1]=l,n[2]=o,n[3]=t):t=n[3],t}let iE=()=>void 0;function iM(e){let t,n,i,r,l=(0,s.c)(16),{children:o,className:d,draft:c,header:u,isOver:m,label:p,onEmptySpaceDoubleClick:h,ref:f}=e,x=void 0===h?iE:h,g=m&&"bg-surface-hover/50";l[0]!==d||l[1]!==g?(t=(0,j.cn)("flex h-full min-h-0 shrink-0 flex-col gap-2 border-border border-r p-2 transition-colors",s$.BOARD_LANE_WIDTH,g,d),l[0]=d,l[1]=g,l[2]=t):t=l[2],l[3]!==u?(n=(0,a.jsx)("div",{className:"shrink-0","data-slot":"board-column-header",children:u}),l[3]=u,l[4]=n):n=l[4];let v=c?.placement==="top"?c.card:null,b=c?.placement==="bottom"?c.card:null;return l[5]!==o||l[6]!==p||l[7]!==x||l[8]!==v||l[9]!==b?(i=(0,a.jsxs)(iO,{label:p,onEmptySpaceDoubleClick:x,children:[v,o,b]}),l[5]=o,l[6]=p,l[7]=x,l[8]=v,l[9]=b,l[10]=i):i=l[10],l[11]!==f||l[12]!==t||l[13]!==n||l[14]!==i?(r=(0,a.jsxs)("div",{className:t,"data-slot":"board-column",ref:f,children:[n,i]}),l[11]=f,l[12]=t,l[13]=n,l[14]=i,l[15]=r):r=l[15],r}var iR=e.i(118484);function iz(e){let t,n,i,r,l,c,u,m=(0,s.c)(20),{count:p,glyph:h,name:f,onAddTask:x}=e;return m[0]!==h?(t=(0,a.jsx)(nH,{glyph:h}),m[0]=h,m[1]=t):t=m[1],m[2]!==f?(n=(0,a.jsx)(d.Text,{as:"span",className:"truncate",variant:"label",children:f}),m[2]=f,m[3]=n):n=m[3],m[4]!==p?(i=(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:p}),m[4]=p,m[5]=i):i=m[5],m[6]!==f||m[7]!==x?(r=x?(0,a.jsxs)(eu.DropdownMenu,{children:[(0,a.jsx)(eu.DropdownMenuTrigger,{"aria-label":`${f} options`,render:(0,a.jsx)(o.Button,{size:"icon-sm",variant:"ghost"}),children:(0,a.jsx)(iR.MoreHorizontal,{})}),(0,a.jsx)(eu.DropdownMenuContent,{align:"end",children:(0,a.jsxs)(eu.DropdownMenuItem,{onClick:x,children:[(0,a.jsx)(ef.Plus,{}),"Create task"]})})]}):null,m[6]=f,m[7]=x,m[8]=r):r=m[8],m[9]!==f||m[10]!==x?(l=x?(0,a.jsx)(o.Button,{"aria-label":`Add task to ${f}`,onClick:x,size:"icon-sm",variant:"ghost",children:(0,a.jsx)(ef.Plus,{})}):null,m[9]=f,m[10]=x,m[11]=l):l=m[11],m[12]!==r||m[13]!==l?(c=(0,a.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[r,l]}),m[12]=r,m[13]=l,m[14]=c):c=m[14],m[15]!==t||m[16]!==n||m[17]!==i||m[18]!==c?(u=(0,a.jsxs)("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-1 py-0.5",children:[t,n,i,c]}),m[15]=t,m[16]=n,m[17]=i,m[18]=c,m[19]=u):u=m[19],u}var iB=e.i(550647),iU=e.i(276153);function iF(e="normal"){return(0,j.cn)((0,iU.getInlineEditFieldClasses)(e),"min-h-[1.5rem] flex-1 overflow-y-auto")}let iG=[.22,1,.36,1];function iq(e){let t,n,i,r,l,o,d,c,u,p,h,f=(0,s.c)(27),{autoFocus:x,onCancel:g,onCommit:v,text:b,onTextChange:y}=e,_=void 0===x||x,S=(0,m.useRef)(null),k=(0,iB.useReducedMotion)()??!1;
1f[0]!==_?(t=function(){_&&S.current?.focus()},n=[_],f[0]=_,f[1]=t,f[2]=n):(t=f[1],n=f[2]),(0,m.useEffect)(t,n),f[3]!==g||f[4]!==v||f[5]!==b?(i=()=>{let e=b.trim();e.length>0?v(e):g()},f[3]=g,f[4]=v,f[5]=b,f[6]=i):i=f[6];let w=i;return f[7]===Symbol.for("react.memo_cache_sentinel")?(r={opacity:1,scale:1},f[7]=r):r=f[7],f[8]!==k?(l=!k&&{opacity:0,scale:.98},f[8]=k,f[9]=l):l=f[9],f[10]!==k?(o=k?{duration:0}:{duration:.18,ease:iG},f[10]=k,f[11]=o):o=f[11],f[12]===Symbol.for("react.memo_cache_sentinel")?(d=(0,j.cn)(iF("normal"),"pl-1"),f[12]=d):d=f[12],f[13]!==y?(c=e=>y(L(e.target)),f[13]=y,f[14]=c):c=f[14],f[15]!==w||f[16]!==g?(u=e=>{if("Enter"===e.key&&!e.shiftKey){e.preventDefault(),w();return}"Escape"===e.key&&(e.preventDefault(),g())},f[15]=w,f[16]=g,f[17]=u):u=f[17],f[18]!==w||f[19]!==u||f[20]!==c||f[21]!==b?(p=(0,a.jsx)(nl.Card,{className:"flex flex-col gap-1.5 overflow-visible rounded-lg border-primary/30 p-4 ring-1 ring-primary/20",children:(0,a.jsx)(I.Textarea,{className:d,onBlur:w,onChange:c,onKeyDown:u,placeholder:"New task",ref:S,rows:1,value:b,variant:"ghost"})}),f[18]=w,f[19]=u,f[20]=c,f[21]=b,f[22]=p):p=f[22],f[23]!==p||f[24]!==l||f[25]!==o?(h=(0,a.jsx)(e1.motion.div,{animate:r,initial:l,transition:o,...sz,children:p}),f[23]=p,f[24]=l,f[25]=o,f[26]=h):h=f[26],h}var i$=e.i(506399);function iK(e){let t,n,a=(0,s.c)(6),i=(0,i$.useBoardFocus)(e),r=(0,J.useSetOpenTaskId)();return a[0]!==i||a[1]!==r?(t=e=>({laneIndex:e,navigate:i.navigate,open:e=>{i.clear(),r((0,Z.assertId)(e))},register:i.register,select:i.setSelectedId,selectedId:i.selectedId}),a[0]=i,a[1]=r,a[2]=t):t=a[2],a[3]!==i.clear||a[4]!==t?(n={clear:i.clear,lane:t},a[3]=i.clear,a[4]=t,a[5]=n):n=a[5],n}function iQ(e,t){return{isSelected:e.selectedId===t.id,onNavigate:n=>e.navigate({cardIndex:t.cardIndex,key:n,laneIndex:e.laneIndex}),onOpen:()=>e.open(t.id),onSelect:()=>e.select(t.id),register:n=>e.register(t.id,n)}}function iV(e){let t,n,r,l,o,d,c,u,m,p,h=(0,s.c)(46),{focus:f,option:x,todos:g,onCreateTask:v,indicatorBeforeId:b,indicatorAfterId:y,indicatorAtEnd:j,isDestination:I}=e,_=`status:${x.id}`;h[0]!==_?(t={id:_},h[0]=_,h[1]=t):t=h[1];let{setNodeRef:S}=(0,i.useDroppable)(t),k=(0,iP.useIsMobile)(),w=sU(v);h[2]!==w.cancel||h[3]!==w.commit||h[4]!==w.draftKey||h[5]!==w.isActive||h[6]!==w.setText||h[7]!==w.text||h[8]!==k?(n=w.isActive?(0,a.jsx)(iq,{autoFocus:!k,onCancel:w.cancel,onCommit:w.commit,onTextChange:w.setText,text:w.text},w.draftKey):null,h[2]=w.cancel,h[3]=w.commit,h[4]=w.draftKey,h[5]=w.isActive,h[6]=w.setText,h[7]=w.text,h[8]=k,h[9]=n):n=h[9];let C=n;h[10]!==w.placement||h[11]!==C?(r={card:C,placement:w.placement},h[10]=w.placement,h[11]=C,h[12]=r):r=h[12],h[13]!==x.glyph||h[14]!==x.group?(l=x.glyph??nY(x.group),h[13]=x.glyph,h[14]=x.group,h[15]=l):l=h[15],h[16]!==w.start||h[17]!==x.name||h[18]!==l||h[19]!==g.length?(o=(0,a.jsx)(iz,{count:g.length,glyph:l,name:x.name,onAddTask:w.start}),h[16]=w.start,h[17]=x.name,h[18]=l,h[19]=g.length,h[20]=o):o=h[20];let T=I??!1,N=x.name,D=w.handleEmptySpaceDoubleClick;if(h[21]!==g?(d=g.map(iW),h[21]=g,h[22]=d):d=h[22],h[23]!==f||h[24]!==y||h[25]!==b||h[26]!==g){let e;h[28]!==f||h[29]!==y||h[30]!==b?(e=(e,t)=>{let n;return b===e._id?n="before":y===e._id&&(n="after"),(0,a.jsx)(iw,{interaction:iQ(f,{cardIndex:t,id:e._id}),showIndicator:n,todo:e},e._id)},h[28]=f,h[29]=y,h[30]=b,h[31]=e):e=h[31],c=g.map(e),h[23]=f,h[24]=y,h[25]=b,h[26]=g,h[27]=c}else c=h[27];return h[32]!==j?(u=j?(0,a.jsx)(sK.BoardPlacementLine,{}):null,h[32]=j,h[33]=u):u=h[33],h[34]!==d||h[35]!==c||h[36]!==u?(m=(0,a.jsxs)(tE.SortableContext,{items:d,strategy:tE.verticalListSortingStrategy,children:[c,u]}),h[34]=d,h[35]=c,h[36]=u,h[37]=m):m=h[37],h[38]!==w.handleEmptySpaceDoubleClick||h[39]!==x.name||h[40]!==S||h[41]!==m||h[42]!==r||h[43]!==o||h[44]!==T?(p=(0,a.jsx)(iM,{draft:r,header:o,isOver:T,label:N,onEmptySpaceDoubleClick:D,ref:S,children:m}),h[38]=w.handleEmptySpaceDoubleClick,h[39]=x.name,h[40]=S,h[41]=m,h[42]=r,h[43]=o,h[44]=T,h[45]=p):p=h[45],p}function iW(e){return e._id}var iH=e.i(222850);let iY=[{cards:[72,56,88],key:"backlog"}
1,{cards:[64,80],key:"in-progress"},{cards:[76,60,68],key:"done"}];function iX(){let e,t=(0,s.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{"aria-hidden":!0,className:"flex h-full min-h-0 overflow-hidden",children:(0,a.jsx)(sM,{children:iY.map(iJ)})}),t[0]=e):e=t[0],e}function iJ(e){return(0,a.jsx)(iM,{header:(0,a.jsxs)("div",{className:"flex items-center gap-2 px-1 py-0.5",children:[(0,a.jsx)(iH.Skeleton,{className:"size-4 shrink-0 rounded"}),(0,a.jsx)(iH.Skeleton,{className:"h-3.5 w-24"})]}),label:e.key,children:(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:e.cards.map(t=>(0,a.jsx)("div",{className:"min-h-24 rounded-lg border border-border p-4",children:(0,a.jsx)(iH.Skeleton,{className:"h-3.5",style:{width:`${t}%`}})},`${e.key}-${t}`))})},e.key)}function iZ(e){return{_id:e._id,assignees:tZ(e),completed:e.completed,createdAt:e.createdAt,date:e.date,dueDate:e.dueDate,endTime:e.endTime,estimatedMinutes:e.estimatedMinutes,iconData:e.iconData,identifier:e.identifier,imageUrls:e.imageUrls,labels:e.labels,listId:e.listId,note:e.note,priority:e.priority,projectName:e.projectName,pullRequestCount:e.pullRequestCount,pullRequestNumber:e.pullRequestNumber,sortOrder:e.sortOrder,startTime:e.startTime,statusId:e.statusId,teamId:e.teamId,text:e.text,updatedAt:e.updatedAt}}function i0(e){return e.includes("-")}function i1(e){let t,n,o,d,c,u,m,p,h=(0,s.c)(31),{listId:x,teamId:v}=e,{gate:b}=(0,f.useGuestGate)();h[0]!==b||h[1]!==x?(t=b({listId:x}),h[0]=b,h[1]=x,h[2]=t):t=h[2];let y=(0,l.useQuery)(r.api.todo_lists.status_queries.getStatusOptions,t);h[3]!==x||h[4]!==v?(n={listId:x,teamId:v},h[3]=x,h[4]=v,h[5]=n):n=h[5];let{todos:j,isLoading:I}=function(e){let t,n,a,i,o,d=(0,s.c)(12),{listId:c,teamId:u}=e,{gate:m,isGuest:p}=(0,f.useGuestGate)();if(d[0]!==m||d[1]!==u){let e=u?{teamId:u}:{};t=l.useQuery,n=r.api.todos.queries.getAll,a=m(e),d[0]=m,d[1]=u,d[2]=t,d[3]=n,d[4]=a}else t=d[2],n=d[3],a=d[4];let h=t(n,a);d[5]!==p||d[6]!==c||d[7]!==h?(i=p?[]:(h??[]).filter(e=>e.listId===c).map(iZ),d[5]=p,d[6]=c,d[7]=h,d[8]=i):i=d[8];let x=i,g=!(p||void 0!==h);return d[9]!==g||d[10]!==x?(o={isLoading:g,todos:x},d[9]=g,d[10]=x,d[11]=o):o=d[11],o}(n),_=(0,l.useMutation)(r.api.todos.reorder_mutations.reorderTodos).withOptimisticUpdate(i7);h[6]!==x?(o=(e,t)=>{let n=e.getQuery(r.api.todo_lists.status_queries.getStatusOptions,{listId:x}),a=n?.statusOptions.find(e=>e.id===t.statusId)?.group;(0,ee.applyTodoReorder)(e,{moveToStatus:{completed:(0,ee.deriveCompletedFromGroup)(a),statusId:t.statusId},orderedIds:t.orderedIds})},h[6]=x,h[7]=o):o=h[7];let S=(0,l.useMutation)(r.api.todos.reorder_mutations.moveAndReorder).withOptimisticUpdate(o),w=(0,l.useMutation)(r.api.todos.mutations.create).withOptimisticUpdate(i6),C=(0,sR.useBoardSensors)(),{modifiers:T}=(0,g.useScaledDnd)(),N=y?[...y.statusOptions].sort((e,t)=>{let n=nB.STATUS_GROUPS.indexOf(e.group)-nB.STATUS_GROUPS.indexOf(t.group);return 0!==n?n:e.sortOrder-t.sortOrder}):[],D=y?function(e,t){let n={};for(let a of e){let e=a.statusId??t,s=n[e]??[];s.push(a),n[e]=s}for(let e of Object.keys(n))n[e]=(n[e]??[]).sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0));return n}(j,y.defaultOptionByGroup.todo??`${x}_st_todo`):{},L=iK(N.map(e=>(D[e.id]??[]).map(i5))),A=iA({lookup:{statusByTodoId:function(e){let t=new Map;for(let[n,a]of Object.entries(e))for(let e of a)t.set(e._id,n);return t}(D),todosByStatus:D},onDrop:e=>{let{activeId:t,drop:n}=e,a=j.find(e=>e._id===t),s=function(e){var t;if(!(e.drop.statusId&&void 0!==e.drop.insertIndex))return;let n=e.bucketed[e.drop.statusId]??[];if(e.sourceStatusId===e.drop.statusId){let t=n.map(e=>e._id),a=t.indexOf(e.activeId);if(-1===a)return;let s=function(e){if(e.drop.beforeId){let t=e.columnIds.indexOf(e.drop.beforeId);return -1===t?void 0:t}if(e.drop.afterId){let t=e.columnIds.indexOf(e.drop.afterId);if(-1===t)return;return e.oldIndex<t?t:t+1}return e.columnIds.length-1}({columnIds:t,drop:e.drop,oldIndex:a});if(void 0===s)return;let i=(0,tE.arrayMove)(t,a,s),r=i.indexOf(e.activeId);return{orderedIds:i.map(e=>(0,Z.assertId)(e)),sortOrder:1e3*r}}let a=(t={activeId:e.activeId,columnTodos:n,insertIndex:e.drop.insertIndex},(0,sG.placedKeys)({draggedKey:t.activeId,index:t.insertIndex,keys:t.columnTodos.map(e=>e._id)})),s=a.indexOf(e.activeId);return{orderedIds:a.map(e=>(0,Z.assertId)(e)),sortOrder:1e3*s}}({activeId:t,bucketed:D,drop:n,sourceStatusId:a?.statusId});!(a&&n.statusId&&s)||s.orderedIds.some(i0)||(a.statusId!==n.statusId?S({listId:x,orderedIds:s.orderedIds,statusId:n.statusId}).catch(i4):_({listId:x,orderedIds:s.orderedIds,statusId:n.statusId}).catch(i3))}});if(I||!y){let e;return h[8]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(iX,{}),h[8]=e):e=h[8],e}h[9]!==A.activeId||h[10]!==j?(d=A.activeId?j.find(e=>e._id===A.activeId):void 0,h[9]=A.activeId,h[10]=j,h[11]=d):d=h[11];let P=d,O=i.DndContext;h[12]===Symbol.for("react.memo_cache_sentinel")?(c={threshold:{x:.15,y:.2}},h[12]=c):c=h[12];let E=A.handleDragCancel,M=A.handleDragEnd,R=A.handleDragOver,z=A.handleDragStart,B=L.clear,U=N.map((e,t)=>{let n=A.drop.statusId===e.id,s=D[e.id]??[];return(0,a.jsx)(iV,{focus:L.lane(t),indicatorAfterId:n?A.drop.afterId:void 0,indicatorAtEnd:n&&A.drop.atEnd,indicatorBeforeId:n?A.drop.beforeId:void 0,isDestination:n,onCreateTask:t=>{let{placement:n,text:a}=t;w({listId:x,sortOrder:sB({placement:n,todos:s}),statusId:e.id,teamId:v,text:a}).catch(i2),(0,k.trackEvent)(k.ANALYTICS_EVENTS.todoCreated)},option:e,todos:s},e.id)});return h[13]!==sM||h[14]!==L.clear||h[15]!==U?(u=(0,a.jsx)(sM,{onClearSelection:B,children:U}),h[13]=sM,h[14]=L.clear,h[15]=U,h[16]=u):u=h[16],h[17]!==P?(m=(0,a.jsx)(iD,{activeTodo:P}),h[17]=P,h[18]=m):m=h[18],h[19]!==O||h[20]!==A.handleDragCancel||h[21]!==A.handleDragEnd||h[22]!==A.handleDragOver||h[23]!==A.handleDragStart||h[24]!==T||h[25]!==C||h[26]!==u||h[27]!==m||h[28]!==c||h[29]!==sq?(p=(0,a.jsxs)(O,{autoScroll:c,collisionDetection:sq,modifiers:T,onDragCancel:E,onDragEnd:M,onDragOver:R,onDragStart:z,sensors:C,children:[u,m]}),h[19]=O,h[20]=A.handleDragCancel,h[21]=A.handleDragEnd,h[22]=A.handleDragOver,h[23]=A.handleDragStart,h[24]=T,h[25]=C,h[26]=u,h[27]=m,h[28]=c,h[29]=sq,h[30]=p):p=h[30],p}function i2(){}function i3(){}function i4(){}function i5(e){return e._id}function i6(e,t){let n=Date.now(),a={_creationTime:n,_id:(0,Z.assertId)(crypto.randomUUID()),completed:!1,createdAt:n,listId:t.listId,sortOrder:t.sortOrder??n,statusId:t.statusId,teamId:t.teamId,text:t.text,updatedAt:n};for(let{args:n,value:s}of e.getAllQueries(r.api.todos.queries.getAll))void 0!==s&&n.teamId===t.teamId&&e.setQuery(r.api.todos.queries.getAll,n,[...s,a])}function i7(e,t){(0,ee.applyTodoReorder)(e,{orderedIds:t.orderedIds})}let i8=[76,58,84,49,67,72,55];function i9(e){let t,n,i=(0,s.c)(4),{rows:r}=e,l=void 0===r?6:r;return i[0]!==l?(t=i8.slice(0,l).map(re),i[0]=l,i[1]=t):t=i[1],i[2]!==t?(n=(0,a.jsx)("div",{"aria-hidden":!0,
1className:"flex w-full flex-col",children:t}),i[2]=t,i[3]=n):n=i[3],n}function re(e){return(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-1.5 rounded-lg p-2",children:[(0,a.jsx)(iH.Skeleton,{className:"size-5 shrink-0 rounded"}),(0,a.jsx)(iH.Skeleton,{className:"my-[3px] h-3.5",style:{width:`${e}%`}})]},e)}function rt(e){let t=(0,s.c)(6),{scope:n,state:i}=e,{currentListId:r,effectiveTeamId:l}=n,{hasItems:o,isLoading:c,kanbanEnabled:u,noMatches:m}=i;if(u&&r){let e,n=l??void 0;return t[0]!==r||t[1]!==n?(e=(0,a.jsx)(i1,{listId:r,teamId:n}),t[0]=r,t[1]=n,t[2]=e):e=t[2],e}if(!u&&c){let e;return t[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(i9,{}),t[3]=e):e=t[3],e}if(!(u||c||o)){let e,n=m?"No tasks match this view":"Add a task in the input bar below";return t[4]!==n?(e=(0,a.jsx)("div",{className:"flex h-full flex-1 flex-col items-center justify-center text-muted-foreground opacity-33",children:(0,a.jsx)(d.Text,{variant:"bodySmall",children:n})}),t[4]=n,t[5]=e):e=t[5],e}return null}var rn=e.i(762519);e.i(123737);var ra=e.i(260597),rs=e.i(783715),ri=e.i(819344);let rr="task",rl="select",ro=[{key:rl,label:"Select",pinned:!0,resizable:!1,width:44},{key:rr,label:"Task",resizable:!1}];function rd(){let e,t=(0,s.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(nr.Badge,{size:"xs",variant:"secondary",children:"Context"}),t[0]=e):e=t[0],e}function rc(e){let t,n,i,r,l,c,u,m=(0,s.c)(20),{actions:p,count:h,failedCount:f,onRetry:x}=e;if(0===h)return null;let g=`${h} selected`;return m[0]!==g?(t=(0,a.jsx)(d.Text,{as:"span",variant:"label",children:g}),m[0]=g,m[1]=t):t=m[1],m[2]!==f?(n=f>0?(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:`${f} couldn't be saved`}):null,m[2]=f,m[3]=n):n=m[3],m[4]!==p.onComplete?(i=(0,a.jsx)(o.Button,{onClick:p.onComplete,size:"sm",variant:"secondary",children:"Complete"}),m[4]=p.onComplete,m[5]=i):i=m[5],m[6]!==p.onDelete?(r=(0,a.jsx)(o.Button,{onClick:p.onDelete,size:"sm",variant:"secondary",children:"Delete"}),m[6]=p.onDelete,m[7]=r):r=m[7],m[8]!==f||m[9]!==x?(l=f>0?(0,a.jsx)(o.Button,{onClick:x,size:"sm",variant:"secondary",children:"Retry"}):null,m[8]=f,m[9]=x,m[10]=l):l=m[10],m[11]!==p.onClear?(c=(0,a.jsx)(o.Button,{className:"ml-auto",onClick:p.onClear,size:"sm",variant:"ghost",children:"Clear"}),m[11]=p.onClear,m[12]=c):c=m[12],m[13]!==t||m[14]!==n||m[15]!==i||m[16]!==r||m[17]!==l||m[18]!==c?(u=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border bg-card p-3",children:[t,n,i,r,l,c]}),m[13]=t,m[14]=n,m[15]=i,m[16]=r,m[17]=l,m[18]=c,m[19]=u):u=m[19],u}function ru(e){let t,n,i,r,l,o,d,c,u,m,p,h,f,x,g=(0,s.c)(50),{actions:v,groups:b,render:y}=e;g[0]!==v||g[1]!==b?(t={actions:v,groups:b},g[0]=v,g[1]=b,g[2]=t):t=g[2];let I=function(e){let{actions:t,groups:n}=e,a={columns:ro,recordId:e=>e._id,write:{commit:({record:e,value:n})=>t.onToggleCompleted(e,n),isReadOnly:(e,n)=>e!==rr||!t.canWrite(n),revision:e=>e.updatedAt??0}},s=(0,rs.listRows)(n,a),i=(0,ri.useListCollection)({adapter:a,onClose:t.onClose,onOpen:t.onOpen,rows:s}),r=[],l=new Set;for(let e of s)"record"!==e.kind||e.record.isContext||l.has(e.recordId)||(l.add(e.recordId),r.push(e.record));let o=r.filter(e=>i.selection.has(e._id));return{adapter:a,collection:i,rows:s,selectable:r,selected:o}}(t),{collection:_}=I,{selection:S}=_;g[3]!==v||g[4]!==_.bulk||g[5]!==I.selected||g[6]!==S?(n=async()=>{let e=await _.bulk.run({apply:e=>{let t=I.selected.find(t=>t._id===e);return t?v.onToggleCompleted(t,!0):Promise.resolve()},columnKey:"task",recordIds:I.selected.map(rh)});S.select(e.failed.map(rp))},g[3]=v,g[4]=_.bulk,g[5]=I.selected,g[6]=S,g[7]=n):n=g[7];let k=n;g[8]!==v||g[9]!==I.selected||g[10]!==S?(i=async()=>{await v.onDelete(I.selected),S.clear()},g[8]=v,g[9]=I.selected,g[10]=S,g[11]=i):i=g[11];let w=i;g[12]!==y||g[13]!==S?(r=(e,t)=>{if("record"!==e.kind)return null;let n=e.record;return t!==rl?y.task(n):n.isContext?(0,a.jsx)(rd,{}):(0,a.jsx)(rn.Checkbox,{"aria-label":`Select ${n.text}`,checked:S.has(n._id),onCheckedChange:()=>S.toggle(n._id)})},g[12]=y,g[13]=S,g[14]=r):r=g[14];let C=r;g[15]!==_||g[16]!==S?(l=e=>{if("group"===e.kind)return{"aria-label":`${e.group.label} ${e.group.records.length}`,className:"sticky top-0 z-20 h-auto"};let t=_.activeId===e.recordId;return{"aria-selected":t,className:(0,j.cn)("h-auto min-h-11",t&&"bg-surface-hover"),"data-state":S.has(e.recordId)?"selected":void 0,onClick:t=>_.onRowClick(t,e.record),onFocus:()=>_.setActive(e.recordId),onKeyDown:_.onKeyDown,ref:t=>_.registerRow(e.recordId,t),tabIndex:0}},g[15]=_,g[16]=S,g[17]=l):l=g[17];let T=l,N=I.selectable.length>0&&I.selected.length===I.selectable.length;g[18]!==I.selectable||g[19]!==S?(o=()=>S.toggleAll(I.selectable.map(rm)),g[18]=I.selectable,g[19]=S,g[20]=o):o=g[20];let D=o;g[21]!==_.bulk?(d=()=>{_.bulk.retry()},g[21]=_.bulk,g[22]=d):d=g[22];let L=d;g[23]!==y?(c=e=>"group"===e.kind?y.groupHeading(e.group):null,g[23]=y,g[24]=c):c=g[24];let A=c;g[25]!==N||g[26]!==D?(u=e=>e.key===rl?(0,a.jsx)(rn.Checkbox,{"aria-label":"Select every task",checked:N,onCheckedChange:D}):null,g[25]=N,g[26]=D,g[27]=u):u=g[27];let P=u;g[28]!==C?(m=(e,t)=>C(e,t.key),g[28]=C,g[29]=m):m=g[29];let O=m;g[30]!==k||g[31]!==w||g[32]!==S.clear?(p={onClear:S.clear,onComplete:k,onDelete:w}
1,g[30]=k,g[31]=w,g[32]=S.clear,g[33]=p):p=g[33];let E=p;g[34]!==O||g[35]!==_.revealKey||g[36]!==A||g[37]!==P||g[38]!==I.adapter.columns||g[39]!==I.rows||g[40]!==T?(h=(0,a.jsx)(ra.ListGrid,{className:"min-w-0",columns:I.adapter.columns,density:"compact",groupCell:A,headCell:P,recordCell:O,revealKey:_.revealKey,rowProps:T,rows:I.rows}),g[34]=O,g[35]=_.revealKey,g[36]=A,g[37]=P,g[38]=I.adapter.columns,g[39]=I.rows,g[40]=T,g[41]=h):h=g[41];let M=_.bulk.outcome?.failed.length??0;return g[42]!==E||g[43]!==I.selected.length||g[44]!==L||g[45]!==M?(f=(0,a.jsx)(rc,{actions:E,count:I.selected.length,failedCount:M,onRetry:L}),g[42]=E,g[43]=I.selected.length,g[44]=L,g[45]=M,g[46]=f):f=g[46],g[47]!==h||g[48]!==f?(x=(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[h,f]}),g[47]=h,g[48]=f,g[49]=x):x=g[49],x}function rm(e){return e._id}function rp(e){return e.recordId}function rh(e){return e._id}let rf=["todo","in_progress","in_review","complete"];function rx(e){let t,n,i,r,l,c,u=(0,s.c)(18),{collapsed:m,count:p,label:h,onCreate:f,onToggle:x}=e,g=m?n0.ChevronRight:eh.ChevronDown,v=!m;return u[0]!==g?(t=(0,a.jsx)(g,{}),u[0]=g,u[1]=t):t=u[1],u[2]!==h?(n=(0,a.jsx)(d.Text,{as:"span",variant:"overline",children:h}),u[2]=h,u[3]=n):n=u[3],u[4]!==p?(i=(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:p}),u[4]=p,u[5]=i):i=u[5],u[6]!==x||u[7]!==v||u[8]!==t||u[9]!==n||u[10]!==i?(r=(0,a.jsxs)(o.Button,{"aria-expanded":v,className:"min-w-0 gap-1.5 px-1",onClick:x,size:"sm",type:"button",variant:"ghost",children:[t,n,i]}),u[6]=x,u[7]=v,u[8]=t,u[9]=n,u[10]=i,u[11]=r):r=u[11],u[12]!==h||u[13]!==f?(l=f?(0,a.jsx)(o.Button,{"aria-label":`Add task to ${h}`,className:"ml-auto",onClick:f,size:"icon-xs",type:"button",variant:"ghost",children:(0,a.jsx)(ef.Plus,{})}):null,u[12]=h,u[13]=f,u[14]=l):l=u[14],u[15]!==r||u[16]!==l?(c=(0,a.jsxs)("div",{className:"mb-0.5 flex items-center gap-1 px-2 pt-3 pb-0.5",children:[r,l]}),u[15]=r,u[16]=l,u[17]=c):c=u[17],c}function rg(e,t){let n=e.findIndex(e=>e._id===t);if(n<=0)return;let a=e[n];if(a)for(let t=n-1;t>=0;t--){let n=e[t];if(n){if(n.depth===a.depth&&n.parentId===a.parentId)return n._id;if(n.depth<a.depth)break}}}function rv(e,t){let n=e.findIndex(e=>e._id===t);if(-1===n)return null;let a=e[n];if(!a||0===a.depth)return null;if(!a.parentId)return;let s=e.find(e=>e._id===a.parentId);return s?.parentId}var rb=e.i(556053),ry=e.i(568364);let rj="The connection dropped before it reached the server.",rI=/[.!?]$/;function r_(e){if("u">typeof navigator&&!1===navigator.onLine)return"You are offline.";if((0,ry.isAuthPendingError)(e))return"Your sign-in expired.";let t=function(e){if("object"!=typeof e||null===e||!("data"in e))return null;let{data:t}=e;if("string"==typeof t)return t;if("object"==typeof t&&null!==t&&"message"in t){let{message:e}=t;return"string"==typeof e?e:null}return null}(e);if(t){let e;return e=t.trim(),rI.test(e)?e:`${e}.`}return(0,ry.isConvexFunctionError)(e)?"The server refused the change.":"The change did not reach the server."}function rS(e){return"saving"===e.kind||"failed"===e.kind}function rk(e){let t,n,a=(0,s.c)(3);a[0]!==e?(t=function(){if(e)return window.addEventListener("beforeunload",rw),(
1)=>window.removeEventListener("beforeunload",rw)},n=[e],a[0]=e,a[1]=t,a[2]=n):(t=a[1],n=a[2]),(0,m.useEffect)(t,n)}function rw(e){e.preventDefault()}let rC=new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"});function rT(e){let t=(0,s.c)(17),{onRetry:n,state:i}=e;switch(i.kind){case"idle":return null;case"saving":{let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:"Saving"}),t[0]=e):e=t[0],e}case"saved":{let e,n,s;return t[1]!==i.at?(e=new Date(i.at).toISOString(),t[1]=i.at,t[2]=e):e=t[2],t[3]!==i.at?(n=rC.format(i.at),t[3]=i.at,t[4]=n):n=t[4],t[5]!==e||t[6]!==n?(s=(0,a.jsxs)(d.Text,{as:"span",variant:"caption",children:["Saved"," ",(0,a.jsx)("time",{dateTime:e,children:n})]}),t[5]=e,t[6]=n,t[7]=s):s=t[7],s}case"failed":{let e,s,r;return t[8]!==i.reason?(e=(0,a.jsxs)(d.Text,{as:"span",variant:"captionDestructive",children:["Could not save. ",i.reason]}),t[8]=i.reason,t[9]=e):e=t[9],t[10]!==n?(s=(0,a.jsx)(o.Button,{onClick:n,size:"sm",variant:"ghost",children:"Retry"}),t[10]=n,t[11]=s):s=t[11],t[12]!==e||t[13]!==s?(r=(0,a.jsxs)(a.Fragment,{children:[e,s]}),t[12]=e,t[13]=s,t[14]=r):r=t[14],r}default:{let e;return t[15]!==i?(e=(0,rb.assertNever)(i),t[15]=i,t[16]=e):e=t[16],e}}}function rN(e){let t,n=(0,s.c)(3),{onRetry:i,state:r}=e;return n[0]!==i||n[1]!==r?(t=(0,a.jsx)("span",{"aria-live":"polite",className:"flex items-center gap-1",role:"status",children:(0,a.jsx)(rT,{onRetry:i,state:r})}),n[0]=i,n[1]=r,n[2]=t):t=n[2],t}var rD=e.i(689388),rL=e.i(132836);let rA={};function rP(e,t,n){if(!t||t.overId!==e._id)return rA;if(t.activeId===t.overId)return"task"!==e.type||t.depth===e.depth?rA:{depth:t.depth,position:"above"};let a=n.findIndex(e=>e._id===t.activeId),s=n.findIndex(e=>e._id===t.overId);return{depth:t.depth,position:a>s?"above":"below"}}function rO(e){let t,n,i,r,l=(0,s.c)(8),{depth:o,position:d}=e,c="above"===d?"-top-px":"-bottom-px";l[0]!==c?(t=(0,j.cn)("pointer-events-none absolute right-2 z-10 h-[2.5px] rounded-full bg-foreground",c),l[0]=c,l[1]=t):t=l[1];let u=`${24*o+36}px`;return l[2]!==u?(n={left:u},l[2]=u,l[3]=n):n=l[3],l[4]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)("div",{className:"absolute top-1/2 left-0 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground"}),l[4]=i):i=l[4],l[5]!==t||l[6]!==n?(r=(0,a.jsx)("div",{className:t,style:n,children:i}),l[5]=t,l[6]=n,l[7]=r):r=l[7],r}var rE=e.i(451482),rM=e.i(591479);function rR(e){let t,n,i,r,l,o,d,c=(0,s.c)(26),{canIndent:u,canUnindent:m,hasDate:p,offset:h,onClose:f,onDateClick:x,onDelete:g,onIndent:v,onUnindent:b}=e,y=h>0?"z-20":"z-0 hidden";c[0]!==y?(t=(0,j.cn)("absolute top-0 right-0 bottom-0 flex items-start justify-end gap-1 rounded-r-lg pt-1 pr-0.5 transition-opacity duration-150 md:hidden",y),c[0]=y,c[1]=t):t=c[1];let I=Math.min(1,Math.max(0,(h-12)/20));return c[2]!==I?(n={opacity:I},c[2]=I,c[3]=n):n=c[3],c[4]!==p||c[5]!==f||c[6]!==x?(i=!p&&(0,a.jsx)("button",{"aria-label":"Set date",className:"flex size-5 items-center justify-center rounded text-muted-foreground",onClick:()=>{f(),x?.()},type:"button",children:(0,a.jsx)(e$.Calendar,{className:"size-4"})}),c[4]=p,c[5]=f,c[6]=x,c[7]=i):i=c[7],c[8]!==f||c[9]!==g?(r=(0,a.jsx)("button",{className:"flex h-5 items-center justify-center rounded px-1 font-medium text-destructive/[0.69] text-xs","data-task-delete":!0,onClick:()=>{f(),g()},type:"button",children:"Delete"}),c[8]=f,c[9]=g,c[10]=r):r=c[10],c[11]!==t||c[12]!==n||c[13]!==i||c[14]!==r?(l=(0,a.jsxs)("div",{"aria-hidden":!0,className:t,"data-task-delete":!0,style:n,children:[i,r]}),c[11]=t,c[12]=n,c[13]=i,c[14]=r,c[15]=l):l=c[15],c[16]!==u||c[17]!==m||c[18]!==h||c[19]!==f||c[20]!==v||c[21]!==b?(o=(u||m)&&(0,a.jsxs)("div",{"aria-hidden":!0,className:(0,j.cn)("absolute top-0 bottom-0 left-0 flex items-start gap-2 rounded-l-lg pt-0.5 pl-2 transition-opacity duration-150 md:hidden",h<0?"z-20":"z-0 hidden"),style:{opacity:Math.min(1,Math.max(0,(-h-12)/20))},children:[m&&(0,a.jsx)("button",{"aria-label":"Un-indent task",className:"relative flex size-5 items-center justify-center rounded text-muted-foreground before:absolute before:inset-[-12px] before:content-[''] hover:text-foreground",onClick:()=>{f(),b?.()},type:"button",children:(0,a.jsx)(rE.ArrowLeft,{className:"size-4"})}),u&&(0,a.jsx)("button",{"aria-label":"Indent task",className:"relative flex size-5 items-center justify-center rounded text-muted-foreground before:absolute before:inset-[-12px] before:content-[''] hover:text-foreground",onClick:()=>{f(),v?.()},type:"button",children:(0,a.jsx)(rM.ArrowRight,{className:"size-4"})})]}),c[16]=u,c[17]=m,c[18]=h,c[19]=f,c[20]=v,c[21]=b,c[22]=o):o=c[22],c[23]!==l||c[24]!==o?(d=(0,a.jsxs)(a.Fragment,{children:[l,o]}),c[23]=l,c[24]=o,c[25]=d):d=c[25],d}var rz=e.i(788831),rB=e.i(336623);let rU=e4.z.object({storageId:e4.z.string()});function rF(e){let t,n,i,r,l,o,d,c,u,p,h,f=(0,s.c)(24),{imageUrls:x,isFileDragOver:g,onDragOver:v,onDrop:b,onUpdateImages:y,pendingUploads:j,readonly:I}=e,[_,S]=(0,m.useState)(null),k=(0,m.useRef)(null),w=(0,m.useRef)(new Map),[C,T]=(0,m.useState)(x);f[0]!==x?(t=function(){T(x)},n=[x],f[0]=x,f[1]=t,f[2]=n):(t=f[1],n=f[2]),(0,m.useEffect)(t,n),f[3]!==v||f[4]!==b?(i=function(){let e=k.current;if(!e)return;let t=e=>v?.(e),n=e=>b?.(e);return e.addEventListener("dragover",t),e.addEventListener("drop",n),()=>{e.removeEventListener("dragover",t),e.removeEventListener("drop",n)}},r=[v,b],f[3]=v,f[4]=b,f[5]=i,f[6]=r):(i=f[5],r=f[6]),(0,m.useEffect)(i,r),f[7]!==C||f[8]!==y?(l=e=>
1{let t=C.filter((t,n)=>n!==e);T(t),y(t)},f[7]=C,f[8]=y,f[9]=l):l=f[9];let N=l,D=j&&j.length>0;if(0===C.length&&!g&&!D)return null;let L=C.map((e,t)=>(0,a.jsxs)("div",{className:"group/tile relative",children:[(0,a.jsx)("button",{className:"block overflow-hidden rounded-md border border-border/50 bg-muted/30 transition-shadow hover:shadow-sm",onClick:()=>S({mimeType:w.current.get(e)??"",name:`Attachment ${t+1}`,url:e}),type:"button",children:(0,a.jsx)(rq,{index:t,onDetectedMimeType:t=>w.current.set(e,t),url:e})}),!I&&(0,a.jsx)("button",{className:"absolute -top-1.5 -right-1.5 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-background text-muted-foreground opacity-0 shadow-sm ring-1 ring-border transition-opacity hover:text-foreground group-hover/tile:opacity-100",onClick:e=>{e.stopPropagation(),N(t)},type:"button",children:(0,a.jsx)(eC.XIcon,{className:"h-2.5 w-2.5"})})]},e));return f[10]!==j?(o=j?.map(rG),f[10]=j,f[11]=o):o=f[11],f[12]!==g?(d=g&&(0,a.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-md border-2 border-border border-dashed bg-muted text-muted-foreground",children:(0,a.jsx)("span",{className:"text-lg",children:"+"})}),f[12]=g,f[13]=d):d=f[13],f[14]!==L||f[15]!==o||f[16]!==d?(c=(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5 pt-1",ref:k,children:[L,o,d]}),f[14]=L,f[15]=o,f[16]=d,f[17]=c):c=f[17],f[18]===Symbol.for("react.memo_cache_sentinel")?(u=e=>{e||S(null)},f[18]=u):u=f[18],f[19]!==_?(p=(0,a.jsx)(rz.FilePreviewDialog,{file:_,onOpenChange:u}),f[19]=_,f[20]=p):p=f[20],f[21]!==c||f[22]!==p?(h=(0,a.jsxs)(a.Fragment,{children:[c,p]}),f[21]=c,f[22]=p,f[23]=h):h=f[23],h}function rG(e){let t=e.mimeType.startsWith("image/")||e.previewUrl.startsWith("data:image/");return(0,a.jsxs)("div",{className:"relative h-16 w-16 shrink-0",children:[(0,a.jsx)("div",{className:"h-16 w-16 overflow-hidden rounded-md border border-border/50 bg-muted/30",children:t?(0,a.jsx)("img",{alt:"",className:"h-full w-full object-cover opacity-50",height:64,src:e.previewUrl,width:64}):(0,a.jsx)("div",{className:"flex h-full w-full items-center justify-center opacity-50",children:(0,a.jsx)(ew.FileTextIcon,{className:"h-6 w-6 text-muted-foreground"})})}),(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center rounded-md bg-background/40"})]},e.id)}function rq({url:e,index:t,onDetectedMimeType:n}){let[s,i]=(0,m.useState)("loading"),r=(0,m.useRef)(n);return(r.current=n,(0,m.useEffect)(function(){let t=!1,n=new Image;return n.src=e,n.onload=()=>{t||(i("image"),r.current?.("image/png"))},n.onerror=()=>{t||fetch(e,{method:"HEAD"}).then(e=>{if(t)return;let n=e.headers.get("content-type")??"";r.current?.(n),n.includes("pdf")?i("pdf"):i("other")}).catch(()=>{t||i("other")})},()=>{t=!0}},[e]),"image"===s)?(0,a.jsx)("img",{alt:`Attachment ${t+1}`,className:"h-16 w-16 object-cover",height:64,src:e,width:64}):"pdf"===s?(0,a.jsxs)("div",{className:"relative h-16 w-16 overflow-hidden",children:[(0,a.jsx)(rB.PdfThumbnail,{height:64,url:e,width:64}),(0,a.jsx)("div",{className:"absolute bottom-0.5 left-0.5 rounded bg-black/50 px-1 py-px font-semibold text-[8px] text-white leading-none",children:"PDF"})]}):"other"===s?(0,a.jsx)("div",{className:"flex h-16 w-16 items-center justify-center text-muted-foreground",children:(0,a.jsx)(ew.FileTextIcon,{className:"h-6 w-6"})}):(0,a.jsx)("div",{className:"flex h-16 w-16 items-center justify-center text-muted-foreground"})}function r$(e){let t,n,i,r,l=(0,s.c)(16),{editNote:o,noteRef:d,onCloseSwipes:c,onNoteBlur:u,onNoteKeyDown:m,onPaste:p,onRetrySave:h,saveState:f,setEditNote:x}=e;return l[0]!==x?(t=e=>x(L(e.target)),l[0]=x,l[1]=t):t=l[1],l[2]!==o||l[3]!==d||l[4]!==c||l[5]!==u||l[6]!==m||l[7]!==p||l[8]!==t?(n=(0,a.jsx)(I.Textarea,{"aria-label":"Task note",className:"max-h-[120px] min-h-0 w-full select-text resize-none overflow-y-auto bg-transparent p-0 text-muted-foreground text-sm outline-none hover:bg-transparent focus-visible:bg-transparent","data-task-note":!0,onBlur:u,onChange:t,onFocus:c,onKeyDown:m,onPaste:p,placeholder:"Add a note...",ref:d,value:o,variant:"ghost"}),l[2]=o,l[3]=d,l[4]=c,l[5]=u,l[6]=m,l[7]=p,l[8]=t,l[9]=n):n=l[9],l[10]!==h||l[11]!==f?(i=(0,a.jsx)(rN,{onRetry:h,state:f}),l[10]=h,l[11]=f,l[12]=i):i=l[12],l[13]!==n||l[14]!==i?(r=(0,a.jsxs)("div",{className:"mt-1 flex flex-col items-start gap-0.5 pl-[3.25rem]",children:[n,i]}),l[13]=n,l[14]=i,l[15]=r):r=l[15],r}let rK="flex h-7 w-6 shrink-0 items-center justify-center",rQ="h-7 shrink-0 items-center";function rV(e){let t,n,i=(0,s.c)(5),{children:r,className:l}=e;return i[0]!==l?(t=(0,j.cn)(rK,l),i[0]=l,i[1]=t):t=i[1],i[2]!==r||i[3]!==t?(n=(0,a.jsx)("div",{className:t,children:r}),i[2]=r,i[3]=t,i[4]=n):n=i[4],n}var rW=e.i(63853);let rH=tI(tj(),"rows");function rY(e){let t,n,i=(0,s.c)(3),{identifier:r}=e;i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,j.cn)(rK,"w-28 shrink-0 whitespace-nowrap","justify-start"),i[0]=t):t=i[0];let l=r??"";return i[1]!==l?(n=(0,a.jsx)(d.Text,{as:"span",className:t,variant:"captionNumeric",children:l}),i[1]=l,i[2]=n):n=i[2],n}function rX(e){let t,n,i,r=(0,s.c)(10),{properties:l,showListChip:o,todo:d}=e,c=l??rH;if(r[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,j.cn)(rQ,"ml-auto hidden gap-1 lg:flex"),r[0]=t):t=r[0],r[1]!==o||r[2]!==d||r[3]!==c){let e;r[5]!==o||r[6]!==d?(e=e=>(0,a.jsx)(m.Fragment,{children:rZ[e.key]({showListChip:!0===o,todo:d})}
1,e.key),r[5]=o,r[6]=d,r[7]=e):e=r[7],n=c.map(e),r[1]=o,r[2]=d,r[3]=c,r[4]=n}else n=r[4];return r[8]!==n?(i=(0,a.jsx)("div",{className:t,children:n}),r[8]=n,r[9]=i):i=r[9],i}let rJ=()=>null,rZ={assignee:({todo:e})=>e.assignees?.length?(0,a.jsx)(eB,{assignees:e.assignees,size:"sm"}):null,created:rJ,due:({todo:e})=>(0,a.jsx)(r1,{completed:e.completed,dueDate:e.dueDate}),estimate:({todo:e})=>void 0===e.estimatedMinutes?null:(0,a.jsxs)(nr.Badge,{size:"xs",variant:"outline",children:[e.estimatedMinutes,"m"]}),identifier:rJ,images:({todo:e})=>(0,a.jsx)(r0,{count:e.imageUrls?.length??0}),labels:({todo:e})=>e.labels?.map(e=>(0,a.jsx)(iu,{label:e},e.name)),linkedWork:({todo:e})=>(0,a.jsx)(ii,{todo:e}),list:({showListChip:e,todo:t})=>e&&t.listName?(0,a.jsx)(nr.Badge,{size:"xs",variant:"outline",children:t.listName}):null,priority:rJ,project:({todo:e})=>e.projectName?(0,a.jsx)(nr.Badge,{size:"xs",variant:"outline",children:e.projectName}):null,status:rJ,updated:rJ};function r0(e){let t,n,i=(0,s.c)(4),{count:r}=e;if(0===r)return null;let l=`${r} attached images`;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(rW.ImageIcon,{}),i[0]=t):t=i[0],i[1]!==r||i[2]!==l?(n=(0,a.jsxs)(nr.Badge,{"aria-label":l,size:"xs",variant:"outline",children:[t,r]}),i[1]=r,i[2]=l,i[3]=n):n=i[3],n}function r1(e){let t,n,i=(0,s.c)(5),{completed:r,dueDate:l}=e;if(void 0===l)return null;let o=!r&&ir(l)?"destructive":"outline";return i[0]!==l?(t=il(l),i[0]=l,i[1]=t):t=i[1],i[2]!==o||i[3]!==t?(n=(0,a.jsx)(nr.Badge,{size:"xs",variant:o,children:t}),i[2]=o,i[3]=t,i[4]=n):n=i[4],n}function r2(e){let t,n,i,r,l,d,c,u,p,h,f=(0,s.c)(25),{group:x,onCycle:g,onLongPress:v,disabled:b,className:y,"aria-label":j}=e,I=void 0!==b&&b,_=(0,m.useRef)(!1),S=(0,m.useRef)(null);f[0]===Symbol.for("react.memo_cache_sentinel")?(t=function(){return()=>{S.current&&clearTimeout(S.current)}},n=[],f[0]=t,f[1]=n):(t=f[0],n=f[1]),(0,m.useEffect)(t,n),f[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{S.current&&(clearTimeout(S.current),S.current=null)},f[2]=i):i=f[2];let k=i;f[3]!==I||f[4]!==v?(r=e=>{I||(_.current=!1,v&&(e.currentTarget.setPointerCapture?.(e.pointerId),S.current=setTimeout(()=>{_.current=!0,v()},400)))},f[3]=I,f[4]=v,f[5]=r):r=f[5];let w=r;f[6]!==I||f[7]!==x||f[8]!==g?(l=()=>{if(k(),!I){if(_.current){_.current=!1;return}g("complete"===x?"todo":"complete")}},f[6]=I,f[7]=x,f[8]=g,f[9]=l):l=f[9];let C=l;if(f[10]!==x)d="complete"===x?"true":"in_progress"===x?"mixed":"false",f[10]=x,f[11]=d;else d=f[11];let T=j??"Task status";return f[12]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{k(),_.current=!0},f[12]=c):c=f[12],f[13]!==x?(u=nY(x),f[13]=x,f[14]=u):u=f[14],f[15]!==u?(p=(0,a.jsx)(nH,{glyph:u}),f[15]=u,f[16]=p):p=f[16],f[17]!==y||f[18]!==I||f[19]!==C||f[20]!==w||f[21]!==p||f[22]!==d||f[23]!==T?(h=(0,a.jsx)(o.Button,{"aria-checked":d,"aria-label":T,className:y,disabled:I,onClick:C,onPointerCancel:c,onPointerDown:w,onPointerLeave:k,onPointerUp:k,role:"checkbox",size:"icon-xs",variant:"ghost",children:p}),f[17]=y,f[18]=I,f[19]=C,f[20]=w,f[21]=p,f[22]=d,f[23]=T,f[24]=h):h=f[24],h}var r3=e.i(599554);function r4(e,t,n){let a=e.split("-"),[s,i]=t.split(":").map(Number),[r,l]=n.split(":").map(Number),o=Number(a[0]),d=Number(a[1])-1,c=Number(a[2]);return{endTime:new Date(o,d,c,r,l).getTime(),startTime:new Date(o,d,c,s,i).getTime()}}function r5(e){let t=e.split("-"),n=Number(t[0]),a=Number(t[1])-1,s=Number(t[2]);return{endTime:new Date(n,a,s,23,59,59,999).getTime(),startTime:new Date(n,a,s).getTime()}}function r6(e){let t,n,i,d,c,u,p,h,f,x,g,v,b,y,j,I,_,S=(0,s.c)(85),{taskId:k,date:w,completed:C,startTime:T,endTime:N,className:D,emptyClassName:L,isOpen:O,onOpenChange:M,onRemoveDate:z,tooltip:B}=e,U=void 0!==C&&C,F=sZ(),[G,q]=(0,m.useState)(!1),$=O??G,K=M??q,Q=(0,iP.useIsMobile)(),V=(0,l.useMutation)(r.api.todos.scheduling_mutations.setDate),W=(0,l.useMutation)(r.api.calendar.event_mutations.updateEvent),H=void 0!==T&&void 0!==N,[Y,X]=(0,m.useState)(H);S[0]!==T?(t=void 0===T?"09:00":E(T),S[0]=T,S[1]=t):t=S[1];let[J,ee]=(0,m.useState)(t);S[2]!==N?(n=void 0===N?"10:00":E(N),S[2]=N,S[3]=n):n=S[3];let[et,en]=(0,m.useState)(n);if(S[4]!==U||S[5]!==w){var ea,es;i=w?!(es=ea={completed:U,date:w}).completed&&es.date&&(0,A.startOfLocalDayInstant)(P(es.date))<(0,A.startOfLocalDayInstant)(es.now??Date.now())?{overdue:!0,label:(0,A.formatDueRelative)((0,A.startOfLocalDayInstant)(P(ea.date)),{now:ea.now})}:{overdue:!1,label:R(ea.date)}
1:void 0,S[4]=U,S[5]=w,S[6]=i}else i=S[6];let ei=i;S[7]!==k?(d=k.startsWith("cal:")?k.slice(4):void 0,S[7]=k,S[8]=d):d=S[8];let er=d;S[9]!==w||S[10]!==er||S[11]!==V||S[12]!==k||S[13]!==W?(c=(e,t)=>{if(!w)return;let n=r4(w,e,t);er?W({eventId:(0,Z.assertId)(er),...n,allDay:!1}):V({date:w,taskId:(0,Z.assertId)(k),...n})},S[9]=w,S[10]=er,S[11]=V,S[12]=k,S[13]=W,S[14]=c):c=S[14];let el=c;S[15]!==et||S[16]!==er||S[17]!==V||S[18]!==K||S[19]!==Y||S[20]!==J||S[21]!==k||S[22]!==W?(u=async e=>{if(er){if(e){let t=Y?{...r4(e,J,et),allDay:!1}:{...r5(e),allDay:!0};await W({eventId:(0,Z.assertId)(er),...t})}K(!1);return}Y&&e?await V({date:e,taskId:(0,Z.assertId)(k),...r4(e,J,et)}):await V({date:e,endTime:void 0,startTime:void 0,taskId:(0,Z.assertId)(k)}),K(!1)},S[15]=et,S[16]=er,S[17]=V,S[18]=K,S[19]=Y,S[20]=J,S[21]=k,S[22]=W,S[23]=u):u=S[23];let eo=u;S[24]!==w||S[25]!==et||S[26]!==er||S[27]!==el||S[28]!==V||S[29]!==J||S[30]!==k||S[31]!==W?(p=e=>{if(X(e),w){if(e)return void el(J,et);if(er)return void W({eventId:(0,Z.assertId)(er),...r5(w),allDay:!0});V({date:w,endTime:void 0,startTime:void 0,taskId:(0,Z.assertId)(k)})}},S[24]=w,S[25]=et,S[26]=er,S[27]=el,S[28]=V,S[29]=J,S[30]=k,S[31]=W,S[32]=p):p=S[32];let ed=p;S[33]!==K?(h=()=>K(!1),S[33]=K,S[34]=h):h=S[34],S[35]!==el||S[36]!==J?(f=e=>{en(e),el(J,e)},S[35]=el,S[36]=J,S[37]=f):f=S[37],S[38]!==et||S[39]!==el?(x=e=>{ee(e),el(e,et)},S[38]=et,S[39]=el,S[40]=x):x=S[40],S[41]!==w||S[42]!==et||S[43]!==eo||S[44]!==ed||S[45]!==z||S[46]!==Y||S[47]!==J||S[48]!==f||S[49]!==x||S[50]!==h?(g=(0,a.jsx)(eY,{date:w,endTimeStr:et,onClose:h,onDateChange:eo,onEndTimeChange:f,onRemoveDate:z,onStartTimeChange:x,onTimeToggle:ed,showTime:Y,startTimeStr:J}),S[41]=w,S[42]=et,S[43]=eo,S[44]=ed,S[45]=z,S[46]=Y,S[47]=J,S[48]=f,S[49]=x,S[50]=h,S[51]=g):g=S[51];let ec=g;S[52]!==F||S[53]!==ei||S[54]!==D||S[55]!==L||S[56]!==K||S[57]!==B?(v=ei?(0,a.jsx)(o.Button,{"aria-label":ei.overdue?ei.label:`Date: ${ei.label}`,className:D,disabled:!F,onClick:()=>K(!0),size:"sm",title:B,variant:"ghost",children:ei.label}):(0,a.jsx)(o.Button,{"aria-label":"Set date",className:L??D,disabled:!F,onClick:()=>K(!0),size:"icon-sm",title:B,variant:"ghost",children:(0,a.jsx)(e$.Calendar,{className:"h-3.5 w-3.5"})}),S[52]=F,S[53]=ei,S[54]=D,S[55]=L,S[56]=K,S[57]=B,S[58]=v):v=S[58];let eu=v;if(!F)return eu;if(Q){let e,t,n;return S[59]!==ec?(e=(0,a.jsx)(nT.DialogContent,{className:"w-auto p-0 sm:max-w-fit",showCloseButton:!1,variant:"floating",children:(0,a.jsx)("div",{className:"rounded-lg bg-card shadow-lg",children:ec})}),S[59]=ec,S[60]=e):e=S[60],S[61]!==$||S[62]!==K||S[63]!==e?(t=(0,a.jsx)(nT.Dialog,{onOpenChange:K,open:$,children:e}),S[61]=$,S[62]=K,S[63]=e,S[64]=t):t=S[64],S[65]!==t||S[66]!==eu?(n=(0,a.jsxs)(a.Fragment,{children:[eu,t]}),S[65]=t,S[66]=eu,S[67]=n):n=S[67],n}return S[68]!==ei||S[69]!==D||S[70]!==L||S[71]!==B?(b=ei?(0,a.jsx)(o.Button,{"aria-label":ei.overdue?ei.label:`Date: ${ei.label}`,className:D,size:"sm",title:B,variant:"ghost"}):(0,a.jsx)(o.Button,{"aria-label":"Set date",className:L??D,size:"icon-sm",title:B,variant:"ghost"}),S[68]=ei,S[69]=D,S[70]=L,S[71]=B,S[72]=b):b=S[72],S[73]!==ei?(y=ei?ei.label:(0,a.jsx)(e$.Calendar,{className:"h-3.5 w-3.5"}),S[73]=ei,S[74]=y):y=S[74],S[75]!==b||S[76]!==y?(j=(0,a.jsx)(eL.PopoverTrigger,{render:b,children:y}),S[75]=b,S[76]=y,S[77]=j):j=S[77],S[78]!==ec?(I=(0,a.jsx)(eL.PopoverContent,{align:"end",className:"w-auto p-0",side:"top",children:ec}),S[78]=ec,S[79]=I):I=S[79],S[80]!==$||S[81]!==K||S[82]!==j||S[83]!==I?(_=(0,a.jsxs)(eL.Popover,{onOpenChange:K,open:$,children:[j,I]}),S[80]=$,S[81]=K,S[82]=j,S[83]=I,S[84]=_):_=S[84],_}function r7(e){var t;let n,i,r,l,d,c,u,m,p,h,f,x,g,v,b,y,I,_,k,w,C=(0,s.c)(61),{assignees:T,completed:N,date:D,datePickerOpen:L,endTime:A,hasNote:P,isNoteE
1xpanded:O,listId:E,onCloseSwipes:M,onDatePickerOpenChange:R,onDelete:z,onOpenDetail:B,onOpenFilePicker:U,onRemoveDate:F,onToggleNote:G,startTime:q,taskId:$,taskName:K,teamId:Q}=e,V=void 0!==N&&N;C[0]!==T?(n=T??[],C[0]=T,C[1]=n):n=C[1];let W=n;C[2]!==E||C[3]!==$?(i=E?(0,Z.assertId)($):void 0,C[2]=E,C[3]=$,C[4]=i):i=C[4];let H=i;C[5]!==P||C[6]!==O?(t=P,r=O?"Hide note":t?"Show note":"Add note",C[5]=P,C[6]=O,C[7]=r):r=C[7];let Y=r;C[8]===Symbol.for("react.memo_cache_sentinel")?(l=(0,j.cn)(rQ,"pointer-events-auto flex gap-0.5"),C[8]=l):l=C[8],C[9]!==M||C[10]!==B?(d=B&&(0,a.jsx)("div",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100 max-md:hidden",children:(0,a.jsx)(o.Button,{"aria-label":"Open task",onClick:()=>{M(),B()},size:"icon-sm",tabIndex:-1,title:"Open task",variant:"ghost",children:(0,a.jsx)(r3.Maximize2,{className:"h-3.5 w-3.5"})})}),C[9]=M,C[10]=B,C[11]=d):d=C[11],C[12]!==W||C[13]!==E||C[14]!==Q||C[15]!==H?(c=E&&H&&(0,a.jsx)(s0,{listId:E,selectedAssignees:W,teamId:Q,todoId:H,tooltip:"Assign members"}),C[12]=W,C[13]=E,C[14]=Q,C[15]=H,C[16]=c):c=C[16];let X=!D&&"opacity-0 transition-opacity duration-150 group-hover:opacity-100 max-md:hidden";C[17]!==X?(u=(0,j.cn)(X),C[17]=X,C[18]=u):u=C[18],C[19]!==V||C[20]!==D||C[21]!==L||C[22]!==A||C[23]!==R||C[24]!==F||C[25]!==q||C[26]!==$?(m=(0,a.jsx)(r6,{completed:V,date:D,endTime:A,isOpen:L,onOpenChange:R,onRemoveDate:F,startTime:q,taskId:$,tooltip:"Set date"}),C[19]=V,C[20]=D,C[21]=L,C[22]=A,C[23]=R,C[24]=F,C[25]=q,C[26]=$,C[27]=m):m=C[27],C[28]!==m||C[29]!==u?(p=(0,a.jsx)("div",{className:u,children:m}),C[28]=m,C[29]=u,C[30]=p):p=C[30];let J=!P&&"opacity-0 transition-opacity duration-150 group-hover:opacity-100 max-md:hidden";return C[31]!==J?(h=(0,j.cn)(J),C[31]=J,C[32]=h):h=C[32],C[33]!==M||C[34]!==G?(f=()=>{M(),G()},C[33]=M,C[34]=G,C[35]=f):f=C[35],C[36]===Symbol.for("react.memo_cache_sentinel")?(x=(0,a.jsx)(eZ.StickyNote,{className:"h-3.5 w-3.5"}),C[36]=x):x=C[36],C[37]!==Y||C[38]!==f?(g=(0,a.jsx)(o.Button,{"aria-label":Y,onClick:f,size:"icon-sm",tabIndex:-1,title:Y,variant:"ghost",children:x}),C[37]=Y,C[38]=f,C[39]=g):g=C[39],C[40]!==h||C[41]!==g?(v=(0,a.jsx)("div",{className:h,children:g}),C[40]=h,C[41]=g,C[42]=v):v=C[42],C[43]!==M||C[44]!==U?(b=()=>{M(),U()},C[43]=M,C[44]=U,C[45]=b):b=C[45],C[46]===Symbol.for("react.memo_cache_sentinel")?(y=(0,a.jsx)(S.Paperclip,{className:"h-3.5 w-3.5"}),C[46]=y):y=C[46],C[47]!==b?(I=(0,a.jsx)("div",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100 max-md:hidden",children:(0,a.jsx)(o.Button,{"aria-label":"Add attachment",onClick:b,size:"icon-sm",tabIndex:-1,title:"Add attachment",variant:"ghost",children:y})}),C[47]=b,C[48]=I):I=C[48],C[49]!==z?(_=(0,a.jsx)(eu.DropdownMenuItem,{onClick:z,children:"Delete"}),C[49]=z,C[50]=_):_=C[50],C[51]!==_||C[52]!==K?(k=(0,a.jsx)("div",{className:"opacity-0 transition-opacity duration-150 focus-within:opacity-100 group-hover:opacity-100 max-md:hidden",children:(0,a.jsx)(nJ.RowOptionsMenu,{name:K,size:"icon-sm",children:_})}),C[51]=_,C[52]=K,C[53]=k):k=C[53],C[54]!==p||C[55]!==v||C[56]!==I||C[57]!==k||C[58]!==d||C[59]!==c?(w=(0,a.jsx)("div",{className:l,children:(0,a.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[d,c,p,v,I,k]})}),C[54]=p,C[55]=v,C[56]=I,C[57]=k,C[58]=d,C[59]=c,C[60]=w):w=C[60],w}var r8=e.i(768957);function r9(e){let t,n,i,r,l,o,c,u,p=(0,s.c)(28),{actions:h,inputRef:f,state:x}=e,[g,v]=(0,m.useState)(!1);p[0]!==g||p[1]!==x.editText?(t=!g&&(0,r8.scanInlineReferences)(x.editText).length>0,p[0]=g,p[1]=x.editText,p[2]=t):t=p[2];let b=t;p[3]!==h||p[4]!==b||p[5]!==x.editText?(n=b?(0,a.jsx)(d.Text,{as:"div",className:"pointer-events-auto absolute inset-0 z-10 cursor-text truncate pt-1",onClick:e=>{e.target instanceof Element&&e.target.closest("a, button")||h.onOpenDetail?.()},variant:"bodySmall",children:(0,a.jsx)(r8.InlineReferenceText,{text:x.editText})}):null,p[3]=h,p[4]=b,p[5]=x.editText,p[6]=n):n=p[6];let y=x.completed?"text-muted-foreground line-through":"text-foreground",_=b&&"sr-only";return p[7]!==y||p[8]!==_?(i=(0,j.cn)("no-scrollbar pointer-events-auto min-h-[1.5rem] w-full min-w-0 resize-none overflow-x-auto whitespace-nowrap rounded-none border-none bg-transparent px-0 pt-1 pb-0 text-sm outline-none transition-colors duration-200 hover:bg-transparent focus-visible:bg-transparent",y,_),p[7]=y,p[8]=_,p[9]=i):i=p[9],p[10]!==h?(r=e=>{v(!1),h.onBlur(e)},l=e=>h.setEditText(L(e.target)),p[10]=h,p[11]=r,p[12]=l):(r=p[11],l=p[12]),p[13]!==h?(o=()=>{v(!0),h.onFocus()}
1,p[13]=h,p[14]=o):o=p[14],p[15]!==h.onKeyDown||p[16]!==h.onOpenDetail||p[17]!==h.onPaste||p[18]!==f||p[19]!==x.editText||p[20]!==i||p[21]!==r||p[22]!==l||p[23]!==o?(c=(0,a.jsx)(I.Textarea,{className:i,"data-task-input":!0,onBlur:r,onChange:l,onClick:h.onOpenDetail,onFocus:o,onKeyDown:h.onKeyDown,onPaste:h.onPaste,placeholder:"Empty task",ref:f,rows:1,value:x.editText,variant:"ghost",wrap:"off"}),p[15]=h.onKeyDown,p[16]=h.onOpenDetail,p[17]=h.onPaste,p[18]=f,p[19]=x.editText,p[20]=i,p[21]=r,p[22]=l,p[23]=o,p[24]=c):c=p[24],p[25]!==n||p[26]!==c?(u=(0,a.jsxs)("div",{className:"relative flex min-h-[1.5rem] min-w-0 flex-1 flex-col",children:[n,c]}),p[25]=n,p[26]=c,p[27]=u):u=p[27],u}function le(e){let t,n,i,r=(0,s.c)(7),{priority:l}=e;if(!l)return null;r[0]!==l?(t=(0,aZ.taskPriorityLabel)(l),r[0]=l,r[1]=t):t=r[1];let o=`${t} priority`;return r[2]!==l?(n=(0,a.jsx)(aJ,{priority:l}),r[2]=l,r[3]=n):n=r[3],r[4]!==o||r[5]!==n?(i=(0,a.jsx)(d.Text,{"aria-label":o,as:"span",variant:"caption",children:n}),r[4]=o,r[5]=n,r[6]=i):i=r[6],i}function lt(e){let t,n,i,r,l,d,c,u,m,p,h,f,x,g,v=(0,s.c)(69),{ariaCheckboxLabel:b,checkboxGroup:y,datePickerOpen:I,editText:_,hasNote:S,inputRef:k,isNoteExpanded:w,listeners:C,onCloseSwipes:T,onCycleStatus:N,onDelete:D,onLongPressStatus:L,onOpenDetail:A,onOpenFilePicker:P,onRemoveDate:O,onSetDatePickerOpen:E,onTextareaBlur:M,onTextareaKeyDown:R,onTextareaPaste:z,onToggleNote:B,setEditText:U,showListChip:F,todo:G}=e,q=sY(G.listId,"rows");return v[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(nj.GripVertical,{}),v[0]=t):t=v[0],v[1]!==C?(n=(0,a.jsx)(rV,{children:(0,a.jsx)(o.Button,{"aria-label":"Drag to reorder task",className:"pointer-events-auto",size:"icon-xs",tabIndex:-1,type:"button",variant:"ghost",...C,children:t})}),v[1]=C,v[2]=n):n=v[2],v[3]!==q||v[4]!==G.priority?(i=q.shows("priority")&&(0,a.jsx)(rV,{children:(0,a.jsx)(le,{priority:G.priority})}),v[3]=q,v[4]=G.priority,v[5]=i):i=v[5],v[6]!==q||v[7]!==G.identifier?(r=q.shows("identifier")&&(0,a.jsx)(rY,{identifier:G.identifier}),v[6]=q,v[7]=G.identifier,v[8]=r):r=v[8],v[9]!==b||v[10]!==y||v[11]!==N||v[12]!==L||v[13]!==q?(l=q.shows("status")&&(0,a.jsx)(rV,{children:(0,a.jsx)(r2,{"aria-label":b,className:"pointer-events-auto",group:y,onCycle:N,onLongPress:L})}),v[9]=b,v[10]=y,v[11]=N,v[12]=L,v[13]=q,v[14]=l):l=v[14],v[15]!==G.iconData||v[16]!==G.listId?(d=(0,a.jsx)(rV,{children:(0,a.jsx)(s6,{iconData:G.iconData,listId:G.listId})}),v[15]=G.iconData,v[16]=G.listId,v[17]=d):d=v[17],v[18]!==T||v[19]!==A||v[20]!==M||v[21]!==R||v[22]!==z||v[23]!==U?(c={onBlur:M,onFocus:T,onKeyDown:R,onOpenDetail:A,onPaste:z,setEditText:U},v[18]=T,v[19]=A,v[20]=M,v[21]=R,v[22]=z,v[23]=U,v[24]=c):c=v[24],v[25]!==_||v[26]!==G.completed?(u={completed:G.completed,editText:_},v[25]=_,v[26]=G.completed,v[27]=u):u=v[27],v[28]!==k||v[29]!==c||v[30]!==u?(m=(0,a.jsx)(r9,{actions:c,inputRef:k,state:u}),v[28]=k,v[29]=c,v[30]=u,v[31]=m):m=v[31],v[32]!==q.ordered||v[33]!==F||v[34]!==G?(p=(0,a.jsx)(rX,{properties:q.ordered,showListChip:F,todo:G}),v[32]=q.ordered,v[33]=F,v[34]=G,v[35]=p):p=v[35],v[36]===Symbol.for("react.memo_cache_sentinel")?(h=(0,j.cn)(rQ,"flex"),v[36]=h):h=v[36],v[37]!==G._id?(f=(0,a.jsx)(sW,{className:h,taskId:G._id}),v[37]=G._id,v[38]=f):f=v[38],v[39]!==I||v[40]!==S||v[41]!==w||v[42]!==T||v[43]!==D||v[44]!==A||v[45]!==P||v[46]!==O||v[47]!==E||v[48]!==B||v[49]!==G._id||v[50]!==G.assignees||v[51]!==G.completed||v[52]!==G.date||v[53]!==G.endTime||v[54]!==G.listId||v[55]!==G.startTime||v[56]!==G.teamId||v[57]!==G.text?(x=(0,a.jsx)(r7,{assignees:G.assignees,completed:G.completed,date:G.date,datePickerOpen:I,endTime:G.endTime,hasNote:S,isNoteExpanded:w,listId:G.listId,onCloseSwipes:T,onDatePickerOpenChange:E,onDelete:D,onOpenDetail:A,onOpenFilePicker:P,onRemoveDate:O,onToggleNote:B,startTime:G.startTime,taskId:G._id,taskName:G.text,teamId:G.teamId}),v[39]=I,v[40]=S,v[41]=w,v[42]=T,v[43]=D,v[44]=A,v[45]=P,v[46]=O,v[47]=E,v[48]=B,v[49]=G._id,v[50]=G.assignees,v[51]=G.completed,v[52]=G.date,v[53]=G.endTime,v[54]=G.listId,v[55]=G.startTime,v[56]=G.teamId,v[57]=G.text,v[58]=x):x=v[58],v[59]!==p||v[60]!==f||v[61]!==x||v[62]!==n||v[63]!==i||v[64]!==r||v[65]!==l||v[66]!==d||v[67]!==m?(g=(0,a.jsxs)(a.Fragment,{children:[n,i,r,l,d,m,p,f,x]}),v[59]=p,v[60]=f,v[61]=x,v[62]=n,v[63]=i,v[64]=r,v[65]=l,v[66]=d,v[67]=m,v[68]=g):g=v[68],g}function ln(e){let t=document.querySelectorAll("[data-task-input], [data-task-note]"),n=document.activeElement,a=-1;t.forEach((e,t)=>{e===n&&(a=t)});let s=document.querySelector("[data-global-task-input]");"prev"===e?a>0?t[a-1]?.focus():s?.focus():a>=0&&a<t.length-1?t[a+1]?.focus():s?.focus()}function la(e){let t,n,a=(0,s.c)(6),{fieldRef:i,hold:r,serverValue:l,setDraft:o}=e,d=void 0!==r&&r;a[0]!==i||a[1]!==d||a[2]!==l||a[3]!==o?(t=function(){d||document.activeElement===i.current||o(l)},n=[d,l,i,o],a[0]=i,a[1]=d,a[2]=l,a[3]=o,a[4]=t,a[5]=n):(t=a[4],n=a[5]),(0,m.useEffect)(t,n)}function ls(e){let t,n,i,d,c,u,p,h,f,x,g,v,y,I,_,S,k,C,T,N,D,L,A,P,O,E,M,R,z,B,U=(0,s.c)(170),{todo:F,canIndent:G,canUnindent:q,depth:$,dragDisabled:K,dropIndicatorDepth:Q,dropIndicatorPosition:V,isNoteExpanded:W,isProjectedParent:H,onToggle:Y,onDelete:X,onIndent:J,onUpdate:ee,onUpdateImages:et,onUpdateNote:en,onCreateBelow:ea,onMergeIntoPrevious:es,onDeleteAndFocusPrevious:ei,onNoteExpandedChange:er,onRemoveDate:el,onUnindent:eo,onCycleStatus:ed,onLongPressStatus:ec,onOpenDetail:eu,shouldFocus:em,showListChip:ep,focusCursorPosition:eh,focusWithText:ef,onFocused:ex,onFocusInput:eg}=e,ev=void 0===$?0:$,eb=void 0!==K&&K,ey=function(e){let t,n,a,i,r,l,o,d,c=(0,s.c)(14);c[0]===Symbol.for("react.memo_cache_sentinel")?(t={kind:"idle"},c[0]=t):t=c[0];let[u,p]=(0,m.useState)(t),h=(0,m.useRef)(null),f=(0,m.useRef)(0),x=(0,m.useRef)(void 0);c[1]!==u?(n=rS(u),c[1]=u,c[2]=n):n=c[2],rk(n),c[3]===Symbol.for("react.memo_cache_sentinel")?(a=function(){return()=>clearTimeout(x.current)},i=[],c[3]=a,c[4]=i):(a=c[3],i=c[4]),(0,m.useEffect)(a,i),c[5]===Symbol.for("react.memo_cache_sentinel")?(r=(e,t)=>
1{f.current===e&&(clearTimeout(x.current),p(t))},c[5]=r):r=c[5];let g=r;c[6]!==e?(l=t=>{h.current={value:t},f.current=f.current+1;let{current:n}=f;p({kind:"saving"}),clearTimeout(x.current),x.current=setTimeout(()=>{f.current===n&&p({kind:"failed",reason:rj})},1e4),e(t).then(()=>g(n,{at:Date.now(),kind:"saved"}),e=>g(n,{kind:"failed",reason:r_(e)}))},c[6]=e,c[7]=l):l=c[7];let v=l;c[8]!==v?(o=()=>{h.current&&v(h.current.value)},c[8]=v,c[9]=o):o=c[9];let b=o;return c[10]!==b||c[11]!==v||c[12]!==u?(d={retry:b,save:v,state:u},c[10]=b,c[11]=v,c[12]=u,c[13]=d):d=c[13],d}(en);U[0]!==ey.state?(t=rS(ey.state),U[0]=ey.state,U[1]=t):t=U[1],U[2]!==eh||U[3]!==ef||U[4]!==W||U[5]!==ex||U[6]!==er||U[7]!==em||U[8]!==t||U[9]!==F?(n={focusCursorPosition:eh,focusWithText:ef,holdNote:t,isNoteExpandedProp:W,onFocused:ex,onNoteExpandedChange:er,shouldFocus:em,todo:F},U[2]=eh,U[3]=ef,U[4]=W,U[5]=ex,U[6]=er,U[7]=em,U[8]=t,U[9]=F,U[10]=n):n=U[10];let{editText:ej,setEditText:eI,editNote:e_,setEditNote:eS,isNoteExpanded:ek,setExpanded:ew,inputRef:eC,noteRef:eT,skipBlurSaveRef:eN}=function(e){var t,n,a,i;let r,l,o,d,c,u,p,h,f,x,g,v=(0,s.c)(18),{todo:b,holdNote:y,isNoteExpandedProp:j,onNoteExpandedChange:I,shouldFocus:_,focusCursorPosition:S,focusWithText:k,onFocused:C}=e,[T,N]=(0,m.useState)(b.text),[D,L]=(0,m.useState)(!1),[A,P]=(0,m.useState)(b.note??""),O=void 0!==I,E=O?j??!1:D;v[0]!==O||v[1]!==I?(p=e=>O?I?.(e):L(e),v[0]=O,v[1]=I,v[2]=p):p=v[2];let M=p,R=(0,m.useRef)(null),z=(0,m.useRef)(null),B=(0,m.useRef)(!1);v[3]!==b.text?(h={fieldRef:R,serverValue:b.text,setDraft:N},v[3]=b.text,v[4]=h):h=v[4],la(h);let U=b.note??"";return v[5]!==y||v[6]!==U?(f={fieldRef:z,hold:y,serverValue:U,setDraft:P},v[5]=y,v[6]=U,v[7]=f):f=v[7],la(f),v[8]!==S||v[9]!==k||v[10]!==C||v[11]!==_?(x={focusCursorPosition:S,focusWithText:k,inputRef:R,onFocused:C,setEditText:N,shouldFocus:_},v[8]=S,v[9]=k,v[10]=C,v[11]=_,v[12]=x):x=v[12],function(e){let t,n,a=(0,s.c)(8),{inputRef:i,shouldFocus:r,focusCursorPosition:l,focusWithText:o,onFocused:d,setEditText:c}=e;a[0]!==l||a[1]!==o||a[2]!==i||a[3]!==d||a[4]!==c||a[5]!==r?(t=function(){if(!(r&&i.current))return;void 0!==o&&c(o),i.current.focus();let e=Math.min(l??0,i.current.value.length);i.current.setSelectionRange(e,e),w(i.current),d?.()},n=[r,l,o,d,i,c],a[0]=l,a[1]=o,a[2]=i,a[3]=d,a[4]=c,a[5]=r,a[6]=t,a[7]=n):(t=a[6],n=a[7]),(0,m.useEffect)(t,n)}(x),t=R,(o=(0,s.c)(3))[0]!==t?(r=function(){document.activeElement===t.current&&t.current&&w(t.current)},l=[t],o[0]=t,o[1]=r,o[2]=l):(r=o[1],l=o[2]),(0,m.useEffect)(r,l),n=z,a=E,i=b.completed,(u=(0,s.c)(5))[0]!==i||u[1]!==a||u[2]!==n?(d=function(){a&&!i&&n.current?.focus()},c=[a,i,n],u[0]=i,u[1]=a,u[2]=n,u[3]=d,u[4]=c):(d=u[3],c=u[4]),(0,m.useEffect)(d,c),v[13]!==A||v[14]!==T||v[15]!==E||v[16]!==M?(g={editNote:A,editText:T,inputRef:R,isNoteExpanded:E,noteRef:z,setEditNote:P,setEditText:N,setExpanded:M,skipBlurSaveRef:B},v[13]=A,v[14]=T,v[15]=E,v[16]=M,v[17]=g):g=v[17],g}(n),{setEditingTaskId:eD}=sP(),eL=F._id;U[11]!==eD||U[12]!==eL?(i=()=>eD(eL),U[11]=eD,U[12]=eL,U[13]=i):i=U[13];let eA=i;U[14]!==eD?(d=()=>eD(null),U[14]=eD,U[15]=d):d=U[15];let eP=d;U[16]!==F.imageUrls?(c=F.imageUrls??[],U[16]=F.imageUrls,U[17]=c):c=U[17];let eO=c,{handlePaste:eE,handleDrop:eM,handleDragOver:eR,openFilePicker:ez,pendingUploads:eB}=function(e,t,n){let a,i,o=(0,l.useMutation)(r.api.files.uploads.generateUploadUrl),d=(0,l.useMutation)(r.api.files.uploads.getStorageUrl),[c,u]=(0,m.useState)([]),p=((i=(0,s.c)(2))[0]!==n?(a=e=>n?e.byTodoId.get(n)??e8:e8,i[0]=n,i[1]=a):a=i[1],e7(a)),h=(0,m.useRef)(e);h.current=e;let f=async e=>{if(e.size>0xa00000)return e3.toast.error("File is too large. Maximum size is 10 MB."),null;try{let t=await (0,e6.convertHeicIfNeeded)(e),n=await o(),a=await fetch(n,{body:t,headers:{"Content-Type":t.type},method:"POST"});if(!a.ok)throw Error("Upload failed");let{storageId:s}=rU.parse(await a.json()),i=await d({storageId:(0,Z.assertId)(s)});if(!i)throw Error("Could not retrieve file URL");return i}catch{return e3.toast.error("Failed to upload file. Please try again."),null}},x=async(e,n)=>{let a=[];for(let t=0;t<e.length;t++){let s=e[t],i=n[t];if(!(s&&i))continue;let r=await f(s);r&&a.push(r),i.previewUrl.startsWith("blob:")&&URL.revokeObjectURL(i.previewUrl);let l=i.id;u(e=>e.filter(e=>e.id!==l))}a.length>
10&&t([...h.current,...a])},g=async e=>{if(0===e.length)return;let t=e.map(e=>({id:crypto.randomUUID(),mimeType:e.type,previewUrl:URL.createObjectURL(e)}));u(e=>[...e,...t]);for(let n=0;n<e.length;n++){let a=e[n],s=t[n];a&&s&&(0,e5.isPdfFile)(a)&&(0,e5.getPdfPreviewDataUrl)(a).then(e=>{e&&u(t=>t.map(t=>t.id===s.id?{...t,previewUrl:e}:t))})}await x(e,t)},v=(0,m.useRef)(null),b=(0,m.useRef)(g);return b.current=g,(0,m.useEffect)(function(){return()=>{v.current?.remove(),v.current=null}},[]),{handleDragOver:e=>{e.dataTransfer&&Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),e.stopPropagation())},handleDrop:e=>{let t=Array.from(e.dataTransfer?.files??[]);t.length>0&&(e.preventDefault(),e.stopPropagation(),g(t))},handlePaste:e=>{let t=Array.from(e.clipboardData.items).map(e=>e.getAsFile()).filter(e=>null!==e);t.length>0&&(e.preventDefault(),g(t))},openFilePicker:()=>{if(!v.current){let e=document.createElement("input");e.type="file",e.accept="image/*,.pdf,application/pdf",e.multiple=!0,e.style.display="none",e.addEventListener("change",()=>{let t=Array.from(e.files??[]);t.length>0&&b.current(t),e.value=""}),document.body.appendChild(e),v.current=e}v.current.click()},pendingUploads:p.length>0?[...c,...p]:c}}(eO,et,F._id),eU=(0,iP.useIsMobile)(),[eF,eG]=(0,m.useState)(!1),eq=48*(+!!G+ +!!q);U[18]!==eq?(u={revealLeftWidth:56,revealRightWidth:eq},U[18]=eq,U[19]=u):u=U[19];let e$=(0,rL.useSwipeToReveal)(F._id,u),eK=(0,b.useSwipeToRevealContext)();U[20]!==eK?(p=()=>eK?.closeAll(),U[20]=eK,U[21]=p):p=U[21];let eQ=p,eV=(0,m.useRef)(null);U[22]!==eb||U[23]!==F._id?(h={disabled:eb,id:F._id},U[22]=eb,U[23]=F._id,U[24]=h):h=U[24];let{attributes:eW,listeners:eH,setNodeRef:eY,transform:eX,transition:eJ,isDragging:eZ}=(0,tE.useSortable)(h),e0=(0,m.useRef)(null);U[25]!==eY||U[26]!==eX||U[27]!==eJ?(f={setNodeRef:eY,transform:eX,transition:eJ},U[25]=eY,U[26]=eX,U[27]=eJ,U[28]=f):f=U[28];let e1=nI(f);U[29]!==e1?(x=e=>{e1(e),e0.current=e},U[29]=e1,U[30]=x):x=U[30];let e2=x;U[31]!==eR||U[32]!==eM||U[33]!==F.completed?(g={containerRef:e0,onDragOver:eR,onDrop:eM,skip:F.completed},U[31]=eR,U[32]=eM,U[33]=F.completed,U[34]=g):g=U[34];let{isFileDragOver:e4}=function(e){let t,n,a,i=(0,s.c)(8),{containerRef:r,onDragOver:l,onDrop:o,skip:d}=e,[c,u]=(0,m.useState)(!1),p=(0,m.useRef)(0);return i[0]!==r||i[1]!==l||i[2]!==o||i[3]!==d?(t=function(){let e=r.current;if(!e||d)return;let t=e=>{var t;(t=e.dataTransfer)&&Array.from(t.types).includes("Files")&&(p.current=p.current+1,u(!0))},n=()=>{p.current=p.current-1,p.current<=0&&(p.current=0,u(!1))},a=e=>{p.current=0,u(!1),o(e)};return e.addEventListener("dragenter",t),e.addEventListener("dragleave",n),e.addEventListener("dragover",l),e.addEventListener("drop",a),()=>{e.removeEventListener("dragenter",t),e.removeEventListener("dragleave",n),e.removeEventListener("dragover",l),e.removeEventListener("drop",a)}},n=[r,l,o,d],i[0]=r,i[1]=l,i[2]=o,i[3]=d,i[4]=t,i[5]=n):(t=i[4],n=i[5]),(0,m.useEffect)(t,n),i[6]!==c?(a={isFileDragOver:c},i[6]=c,i[7]=a):a=i[7],a}(g);U[35]!==eU||U[36]!==e$?(v={enabled:eU,rowRef:eV,swipe:e$},U[35]=eU,U[36]=e$,U[37]=v):v=U[37],(0,rD.useSwipeGestures)(v),U[38]!==e_||U[39]!==ej||U[40]!==ek||U[41]!==eT||U[42]!==ee||U[43]!==ew||U[44]!==eN||U[45]!==F.text?(y={editNote:e_,editText:ej,isNoteExpanded:ek,noteRef:eT,onUpdate:ee,setExpanded:ew,skipBlurSaveRef:eN,todoText:F.text},U[38]=e_,U[39]=ej,U[40]=ek,U[41]=eT,U[42]=ee,U[43]=ew,U[44]=eN,U[45]=F.text,U[46]=y):y=U[46];let e9=function({editNote:e,editText:t,isNoteExpanded:n,noteRef:a,onUpdate:s,setExpanded:i,skipBlurSaveRef:r,todoText:l}){return o=>{var d,c;if(r.current){r.current=!1;return}t!==l&&s(t),n&&""===e.trim()&&(d=a.current,!((c=o.relatedTarget)instanceof Node&&d?.contains(c)||c instanceof Element&&null!==c.closest("[data-task-delete]")))&&i(!1)}}(y);U[47]!==e_||U[48]!==ej||U[49]!==eC||U[50]!==eT||U[51]!==ea||U[52]!==X||U[53]!==ei||U[54]!==eg||U[55]!==es||U[56]!==Y||U[57]!==ee||U[58]!==en||U[59]!==eS||U[60]!==eI||U[61]!==ew||U[62]!==eN||U[63]!==F.note||U[64]!==F.text?(I={editNote:e_,editText:ej,inputRef:eC,noteRef:eT,onCreateBelow:ea,onDelete:X,onDeleteAndFocusPrevious:ei,onFocusInput:eg,onMergeIntoPrevious:es,onToggle:Y,onUpdate:ee,onUpdateNote:en,setEditNote:e
1S,setEditText:eI,setExpanded:ew,skipBlurSaveRef:eN,todoNote:F.note,todoText:F.text},U[47]=e_,U[48]=ej,U[49]=eC,U[50]=eT,U[51]=ea,U[52]=X,U[53]=ei,U[54]=eg,U[55]=es,U[56]=Y,U[57]=ee,U[58]=en,U[59]=eS,U[60]=eI,U[61]=ew,U[62]=eN,U[63]=F.note,U[64]=F.text,U[65]=I):I=U[65];let{handleKeyDown:te,handleNoteKeyDown:tt}=function({editText:e,editNote:t,inputRef:n,noteRef:a,skipBlurSaveRef:s,todoText:i,todoNote:r,onUpdate:l,onUpdateNote:o,onCreateBelow:d,onDelete:c,onDeleteAndFocusPrevious:u,onMergeIntoPrevious:m,onFocusInput:p,onToggle:h,setEditText:f,setEditNote:x,setExpanded:g}){let v=e=>{e.preventDefault(),ln(e.shiftKey?"prev":"next")};return{handleKeyDown:t=>{let a;if("Tab"===t.key)return void v(t);let r=function(e){if(e.cursorStart===e.cursorEnd){if("ArrowUp"===e.key&&0===e.cursorStart)return"prev";if("ArrowDown"===e.key&&e.cursorStart===e.textLength)return"next"}}({key:t.key,cursorStart:t.currentTarget.selectionStart,cursorEnd:t.currentTarget.selectionEnd,textLength:e.length});if(r){t.preventDefault(),ln(r);return}if((t.metaKey||t.ctrlKey)&&"Enter"===t.key){t.preventDefault(),h();return}if("Enter"===t.key){if(t.shiftKey)return;t.preventDefault(),(()=>{s.current=!0;let t=n.current,a=t?.selectionStart??e.length,i=e.slice(0,a),r=e.slice(a);if(l(i),f(i),""===r&&p){p(),n.current?.blur();return}d(r),n.current?.blur()})();return}"Backspace"===t.key?(t=>{let a=n.current?.selectionStart??0;if(""===e){t.preventDefault(),s.current=!0,(u??c)();return}0===a&&m&&(t.preventDefault(),s.current=!0,m(e))})(t):"Escape"===t.key&&(s.current=!0,f(i),(a=n.current)&&w(a),n.current?.blur())},handleNoteKeyDown:e=>{if("Tab"===e.key)return void v(e);if((e.metaKey||e.ctrlKey)&&"Enter"===e.key){e.preventDefault(),h();return}"Escape"===e.key&&(x(r??""),g(!1),n.current?.focus())}}}(I);U[66]!==e_||U[67]!==ey||U[68]!==ew||U[69]!==F.note?(_=()=>{e_!==(F.note??"")&&ey.save(e_),""===e_.trim()&&ew(!1)},U[66]=e_,U[67]=ey,U[68]=ew,U[69]=F.note,U[70]=_):_=U[70];let tn=_;U[71]!==ek||U[72]!==ew?(S=()=>{ew(!ek)},U[71]=ek,U[72]=ew,U[73]=S):S=U[73];let ta=S;U[74]!==eQ||U[75]!==ed||U[76]!==Y?(k=e=>{(eQ(),ed)?ed(e):Y()},U[74]=eQ,U[75]=ed,U[76]=Y,U[77]=k):k=U[77];let ts=k;U[78]!==ev||U[79]!==e_||U[80]!==eZ||U[81]!==e4||U[82]!==eU||U[83]!==H||U[84]!==eB.length||U[85]!==e$.offset||U[86]!==F?(C={depth:ev,editNote:e_,isDragging:eZ,isFileDragOver:e4,isMobile:eU,isProjectedParent:H,pendingUploadCount:eB.length,swipeOffset:e$.offset,todo:F},U[78]=ev,U[79]=e_,U[80]=eZ,U[81]=e4,U[82]=eU,U[83]=H,U[84]=eB.length,U[85]=e$.offset,U[86]=F,U[87]=C):C=U[87];let{ariaCheckboxLabel:ti,checkboxGroup:tr,hasNote:tl,indentPadding:to,showImageTiles:td,swipeRowStyle:tc,wrapperClassName:tu}=function(e){let t,n,a,i,r,l,o=(0,s.c)(22),{depth:d,editNote:c,isDragging:u,isFileDragOver:m,isMobile:p,isProjectedParent:h,pendingUploadCount:f,swipeOffset:x,todo:g}=e,v=tP();if(o[0]!==v||o[1]!==g){let e=v.resolve(g.listId,g.statusId);t=g.completed?"Task completed":"Task not completed",n=g.completed?"complete":e&&"complete"!==e?e:g.statusGroup??"todo",o[0]=v,o[1]=g,o[2]=t,o[3]=n}else t=o[2],n=o[3];let b=(c||g.note)??"";o[4]!==b?(a=b.trim(),o[4]=b,o[5]=a):a=o[5];let y=""!==a,I=d>0?`${24*d}px`:void 0,_=m||f>0;o[6]!==p||o[7]!==x?(i=p?{transform:`translateX(${-x}px)`}:void 0,o[6]=p,o[7]=x,o[8]=i):i=o[8];let S=g.completed&&"opacity-50",k=u&&"opacity-30",w=h&&"bg-surface-hover",C=m&&"rounded-lg ring-2 ring-ring ring-inset";return o[9]!==k||o[10]!==w||o[11]!==C||o[12]!==S?(r=(0,j.cn)("group relative mb-1 flex select-none items-center gap-1.5 rounded-lg p-2 transition-opacity duration-200",S,k,w,C),o[9]=k,o[10]=w,o[11]=C,o[12]=S,o[13]=r):r=o[13],o[14]!==t||o[15]!==r||o[16]!==n||o[17]!==y||o[18]!==I||o[19]!==_||o[20]!==i?(l={ariaCheckboxLabel:t,checkboxGroup:n,hasNote:y,indentPadding:I,showImageTiles:_,swipeRowStyle:i,wrapperClassName:r},o[14]=t,o[15]=r,o[16]=n,o[17]=y,o[18]=I,o[19]=_,o[20]=i,o[21]=l):l=o[21],l}(C),tm=ek||"failed"===ey.state.kind;U[88]!==e$?(T=()=>{e$.close(),eG(!0)},U[88]=e$,U[89]=T):T=U[89];let tp=T;U[90]!==to?(N={paddingLeft:to},U[90]=to,U[91]=N):N=U[91],U[92]!==Q||U[93]!==V?(D=void 0!==Q&&V&&(0,a.jsx)(rO,{depth:Q,position:V}),U[92]=Q,U[93]=V,U[94]=D):D=U[94];let th=!!F.date;return U[95]!==G||U[96]!==q||U[97]!==tp||U[98]!==X||U[99]!==J||U[100]!==eo||U[101]!==e$.close||U[102]!==e$.offset||U[103]!==th?(L=(0,a.jsx)(rR,{canIndent:G,canUnindent:q,hasDate:th,offset:e$.offset,onClose:e$.close,onDateClick:tp,onDelete:X,onIndent:J,onUnindent:eo}),U[95]=G,U[96]=q,U[97]=tp,U[98]=X,U[99]=J,U[100]=eo,U[101]=e$.close,U[102]=e$.offset,U[103]=th,U[104]=L):L=U[104],U[105]!==eQ||U[106]!==eu||U[107]!==F.text?(A=eu?(0,a.jsx)(o.Button,{"aria-label":`Open task ${F.text}`,className:"absolute inset-0 h-auto w-full",onClick:()=>{eQ(),eu()},type:"button",variant:"ghost"}):null,U[105]=eQ,U[106]=eu,U[107]=F.text,U[108]=A):A=U[108],U[109]!==ti||U[110]!==tr||U[111]!==eF||U[112]!==e
1j||U[113]!==e9||U[114]!==eQ||U[115]!==ts||U[116]!==te||U[117]!==eE||U[118]!==ta||U[119]!==tl||U[120]!==eC||U[121]!==ek||U[122]!==eH||U[123]!==X||U[124]!==ec||U[125]!==eu||U[126]!==el||U[127]!==ez||U[128]!==eI||U[129]!==ep||U[130]!==F?(P=(0,a.jsx)(lt,{ariaCheckboxLabel:ti,checkboxGroup:tr,datePickerOpen:eF,editText:ej,hasNote:tl,inputRef:eC,isNoteExpanded:ek,listeners:eH,onCloseSwipes:eQ,onCycleStatus:ts,onDelete:X,onLongPressStatus:ec,onOpenDetail:eu,onOpenFilePicker:ez,onRemoveDate:el,onSetDatePickerOpen:eG,onTextareaBlur:e9,onTextareaKeyDown:te,onTextareaPaste:eE,onToggleNote:ta,setEditText:eI,showListChip:ep,todo:F}),U[109]=ti,U[110]=tr,U[111]=eF,U[112]=ej,U[113]=e9,U[114]=eQ,U[115]=ts,U[116]=te,U[117]=eE,U[118]=ta,U[119]=tl,U[120]=eC,U[121]=ek,U[122]=eH,U[123]=X,U[124]=ec,U[125]=eu,U[126]=el,U[127]=ez,U[128]=eI,U[129]=ep,U[130]=F,U[131]=P):P=U[131],U[132]!==tc||U[133]!==P?(O=(0,a.jsx)("div",{"aria-label":"Task row, swipe to reveal actions",className:"pointer-events-none relative z-10 flex w-full min-w-full shrink-0 items-start gap-1.5 rounded-lg bg-transparent transition-transform duration-200",ref:eV,role:"application",style:tc,children:P}),U[132]=tc,U[133]=P,U[134]=O):O=U[134],U[135]!==L||U[136]!==A||U[137]!==O?(E=(0,a.jsxs)("div",{className:"relative flex min-w-0 flex-1 overflow-hidden",children:[L,A,O]}),U[135]=L,U[136]=A,U[137]=O,U[138]=E):E=U[138],U[139]!==e_||U[140]!==eQ||U[141]!==tn||U[142]!==tt||U[143]!==eE||U[144]!==eT||U[145]!==ey.retry||U[146]!==ey.state||U[147]!==eS||U[148]!==tm?(M=tm?(0,a.jsx)(r$,{editNote:e_,noteRef:eT,onCloseSwipes:eQ,onNoteBlur:tn,onNoteKeyDown:tt,onPaste:eE,onRetrySave:ey.retry,saveState:ey.state,setEditNote:eS}):null,U[139]=e_,U[140]=eQ,U[141]=tn,U[142]=tt,U[143]=eE,U[144]=eT,U[145]=ey.retry,U[146]=ey.state,U[147]=eS,U[148]=tm,U[149]=M):M=U[149],U[150]!==eO||U[151]!==e4||U[152]!==et||U[153]!==eB||U[154]!==td||U[155]!==F.completed?(R=td?(0,a.jsx)("div",{className:"pl-[3.25rem]",children:(0,a.jsx)(rF,{imageUrls:eO,isFileDragOver:e4,onUpdateImages:et,pendingUploads:eB,readonly:F.completed})}):null,U[150]=eO,U[151]=e4,U[152]=et,U[153]=eB,U[154]=td,U[155]=F.completed,U[156]=R):R=U[156],U[157]!==E||U[158]!==M||U[159]!==R?(z=(0,a.jsxs)("div",{className:"relative flex min-w-0 flex-1 flex-col overflow-hidden",children:[E,M,R]}),U[157]=E,U[158]=M,U[159]=R,U[160]=z):z=U[160],U[161]!==eW||U[162]!==e2||U[163]!==eP||U[164]!==eA||U[165]!==N||U[166]!==D||U[167]!==z||U[168]!==tu?(B=(0,a.jsxs)("div",{ref:e2,style:N,...eW,className:tu,onBlur:eP,onFocus:eA,children:[D,z]}),U[161]=eW,U[162]=e2,U[163]=eP,U[164]=eA,U[165]=N,U[166]=D,U[167]=z,U[168]=tu,U[169]=B):B=U[169],B}function li(e){let t,n,i=(0,s.c)(5),{activeItem:r}=e,l=(0,v.usePortalContainer)()??void 0;return i[0]!==r?(t=r&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[(0,a.jsx)(nj.GripVertical,{className:"h-3 w-3 text-muted-foreground/50"}),(0,a.jsx)(d.Text,{as:"span",className:"max-w-52 truncate text-foreground/50",variant:"bodySmall",children:r.text||"Empty task"})]}),i[0]=r,i[1]=t):t=i[1],i[2]!==l||i[3]!==t?(n=(0,a.jsx)(x.ScaledDragOverlay,{container:l,children:t}),i[2]=l,i[3]=t,i[4]=n):n=i[4],n}function lr(e){let t,n,o,c,u,m,p,h,x,g,v,b,y,j,I=(0,s.c)(51),{activeItem:_,currentListId:S,dnd:w,listItems:C,modifiers:T,newTaskSentinelRef:N,projection:D,setNoteExpanded:L,setOpenTaskId:A,view:P}=e,{groups:O,heading:E}=function(e){let t,n,i,o,c,u,m=(0,s.c)(22),{listItems:p,view:h}=e,x=tP(),g=(0,J.useExpandedSections)(),v=(0,J.useToggleSection)(),b=function(e){let t,n,a=(0,s.c)(8),{gate:i}=(0,f.useGuestGate)();a[0]!==i||a[1]!==e?(t=e?i({id:e}):"skip",a[0]=i,a[1]=e,a[2]=t):t=a[2];let o=(0,l.useQuery)(r.api.todo_lists.queries.getById,t),d=(0,l.useMutation)(r.api.todos.mutations.create);if(e)return a[3]!==d||a[4]!==o?.defaultOptionByGroup||a[5]!==o?.teamId||a[6]!==e?(n=t=>{let n=o?.defaultOptionByGroup?.[t]??`${e}_st_${t}`;(0,k.trackEvent)(k.ANALYTICS_EVENTS.todoCreated),d({listId:e,statusId:n,teamId:o?.teamId,text:""}).catch(console.error)},a[3]=d,a[4]=o?.defaultOptionByGroup,a[5]=o?.teamId,a[6]=e,a[7]=n):n=a[7],n}(e.currentListId);if(m[0]!==g?(t=e=>!1===g[e],m[0]=g,m[1]=t):t=m[1],m[2]!==x?(n=e=>x.resolve(e.listId,e.statusId)??(e.completed?"complete":"todo"),m[2]=x,m[3]=n):n=m[3],m[4]!==p||m[5]!==t||m[6]!==n||m[7]!==h.sectionScopeKey){var y,j;let e,a,s;e=function(e,t){let n=new Map,a="todo";for(let s of e){0===s.depth&&(a=t(s));let e=n.get(a);e?e.push(s):n.set(a,[s])}return n}((j={items:(y={isCollapsed:t,items:p,resolveGroup:n,scopeKey:h.sectionScopeKey}).items,resolveGroup:y.resolveGroup}).items,j.resolveGroup),a=nB.STATUS_GROUPS.flatMap(t=>{let n=e.get(t)??[];return 0!==n.length||rf.includes(t)?[{group:t,items:n,label:nB.STATUS_GROUP_LABELS[t]}]:[]}),s=new Map,i={groups:a.map(e=>{var t;let n=(t={group:e.group,scopeKey:y.scopeKey},`tasks:${t.scopeKey}:${t.group}`);return s.set(n,e),{key:n,label:e.label,records:y.isCollapsed(n)?[]:e.items}}),sections:s},m[4]=p,m[5]=t,m[6]=n,m[7]=h.sectionScopeKey,m[8]=i}else i=m[8];let I=i;m[9]!==b||m[10]!==g||m[11]!==I||m[12]!==v?(o=e=>{let t=I.sections.get(e.key);return t?(0,a.jsx)(rx,{collapsed:!1===g[e.key],count:t.items.length,label:t.label,onCreate:b?()=>b(t.group):void 0,onToggle:()=>v(e.key)}):(0,a.jsx)(d.Text,{variant:"overline",children:e.label})},m[9]=b,m[10]=g,m[11]=I,m[12]=v,m[13]=o):o=m[13];let _=o;return m[14]!==p||m[15]!==I||m[16]!==h.boundaries||m[17]!==h.sectioned?(c=h.sectioned?I.groups:function(e){let t=new Map(e.boundaries.map(e=>[e.firstTaskId,e])),n=[],a=[],s=(e,t)=>{let a={key:e,...void 0===t?{}:{label:t},records:[]};return n.push(a),a};for(let i of e.items){if(i.isContext){a.push(i);continue}let e=t.get(i._id);e&&s(e.key,e.label),(n.at(-1)??s("all")).records.push(...a,i),a.length=0}return a.length>0&&(n.at(-1)??s("all")).records.push(...a),n}({boundaries:h.boundaries,items:p}),m[14]=p,m[15]=I,m[16]=h.boundaries,m[17]=h.sectioned,m[18]=c):c=m[18],m[19]!==_||m[20]!==c?(u={groups:c,heading:_},m[19]=_,m[20]=c,m[21]=u):u=m[21],u}(e);I[0]!==C?(t=C.filter(lo).map(ll),I[0]=C,I[1]=t):t=I[1];let M=t;I[2]!==S||I[3]!==C||I[4]!==D||I[5]!==e||I[6]!==L||I[7]!==A||I[8]!==P?(n=t=>{let n=rP(t,D,C),s=rg(C,t._id),i=rv(C,t._id),r=!(P.dragDisabled||t.isContext);return(0,a.jsx)(ls,{canIndent:r&&void 0!==s,canUnindent:r&&null!==i,depth:t.depth,dragDisabled:!r,dropIndicatorDepth:n.depth,dropIndicatorPosition:n.position,focusCursorPosition:e.focusCursorPosition,focusWithText:e.focu
1sWithText,isNoteExpanded:!!S&&e.expandedNoteIds.includes(t._id),isProjectedParent:t._id===e.projectedParentId,onCreateBelow:n=>e.createBelow(t._id,n,{parentId:t.parentId}),onDelete:()=>e.deleteTodo(t._id),onDeleteAndFocusPrevious:()=>e.deleteAndFocusPrevious(t._id),onFocused:e.clearFocus,onFocusInput:e.requestFocusInput,onIndent:r&&void 0!==s?()=>e.updateParentId(t._id,s):void 0,onMergeIntoPrevious:n=>e.mergeIntoPrevious(t._id,n),onNoteExpandedChange:S?e=>L(S,t._id,e):void 0,onOpenDetail:()=>A((0,Z.assertId)(t._id)),onToggle:()=>e.toggleTodo(t._id,!t.completed),onUnindent:r&&null!==i?()=>e.updateParentId(t._id,i??void 0):void 0,onUpdate:n=>e.updateTodo(t._id,n),onUpdateImages:n=>e.updateImages(t._id,n),onUpdateNote:n=>e.updateNote(t._id,n),shouldFocus:t._id===e.focusTodoId,showListChip:P.showListChip,todo:t})},I[2]=S,I[3]=C,I[4]=D,I[5]=e,I[6]=L,I[7]=A,I[8]=P,I[9]=n):n=I[9];let R=n;return I[10]!==P?(o=()=>P.canWrite,I[10]=P,I[11]=o):o=I[11],I[12]!==A?(c=()=>A(null),I[12]=A,I[13]=c):c=I[13],I[14]!==e?(u=t=>{for(let n of t)e.deleteTodo(n._id);return Promise.resolve()},I[14]=e,I[15]=u):u=I[15],I[16]!==A?(m=e=>A((0,Z.assertId)(e._id)),I[16]=A,I[17]=m):m=I[17],I[18]!==e?(p=(t,n)=>(e.toggleTodo(t._id,n),Promise.resolve()),I[18]=e,I[19]=p):p=I[19],I[20]!==o||I[21]!==c||I[22]!==u||I[23]!==m||I[24]!==p?(h={canWrite:o,onClose:c,onDelete:u,onOpen:m,onToggleCompleted:p},I[20]=o,I[21]=c,I[22]=u,I[23]=m,I[24]=p,I[25]=h):h=I[25],I[26]!==E||I[27]!==R?(x={groupHeading:E,task:R},I[26]=E,I[27]=R,I[28]=x):x=I[28],I[29]!==O||I[30]!==h||I[31]!==x?(g=(0,a.jsx)(ru,{actions:h,groups:O,render:x}),I[29]=O,I[30]=h,I[31]=x,I[32]=g):g=I[32],I[33]!==M||I[34]!==g?(v=(0,a.jsx)(tE.SortableContext,{items:M,strategy:tE.verticalListSortingStrategy,children:g}),I[33]=M,I[34]=g,I[35]=v):v=I[35],I[36]!==N?(b=(0,a.jsx)("div",{"aria-hidden":!0,className:"h-0 shrink-0 max-md:h-5",ref:N}),I[36]=N,I[37]=b):b=I[37],I[38]!==_?(y=(0,a.jsx)(li,{activeItem:_}),I[38]=_,I[39]=y):y=I[39],I[40]!==w.handleDragCancel||I[41]!==w.handleDragEnd||I[42]!==w.handleDragMove||I[43]!==w.handleDragOver||I[44]!==w.handleDragStart||I[45]!==w.sensors||I[46]!==T||I[47]!==v||I[48]!==b||I[49]!==y?(j=(0,a.jsxs)(i.DndContext,{collisionDetection:i.closestCenter,modifiers:T,onDragCancel:w.handleDragCancel,onDragEnd:w.handleDragEnd,onDragMove:w.handleDragMove,onDragOver:w.handleDragOver,onDragStart:w.handleDragStart,sensors:w.sensors,children:[v,b,y]}),I[40]=w.handleDragCancel,I[41]=w.handleDragEnd,I[42]=w.handleDragMove,I[43]=w.handleDragOver,I[44]=w.handleDragStart,I[45]=w.sensors,I[46]=T,I[47]=v,I[48]=b,I[49]=y,I[50]=j):j=I[50],j}function ll(e){return e._id}function lo(e){return!e.isContext}function ld(e){let t,n,i,r,l,o=(0,s.c)(21),{currentListId:d,effectiveTeamId:c,isLoading:u,kanbanEnabled:m,listItems:p,rows:h}=e,f=!(m||u)&&p.length>0;o[0]!==d||o[1]!==c?(t={currentListId:d,effectiveTeamId:c},o[0]=d,o[1]=c,o[2]=t):t=o[2];let x=p.length>0;o[3]!==u||o[4]!==m||o[5]!==h.view.hasActiveFilters||o[6]!==x?(n={hasItems:x,isLoading:u,kanbanEnabled:m,noMatches:h.view.hasActiveFilters},o[3]=u,o[4]=m,o[5]=h.view.hasActiveFilters,o[6]=x,o[7]=n):n=o[7],o[8]!==t||o[9]!==n?(i=(0,a.jsx)(rt,{scope:t,state:n}),o[8]=t,o[9]=n,o[10]=i):i=o[10];let g=i;return o[11]!==d||o[12]!==m||o[13]!==p||o[14]!==h||o[15]!==f||o[16]!==g?(r=m?(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:g}):(0,a.jsxs)(a.Fragment,{children:[g,f?(0,a.jsx)(lr,{...h,currentListId:d,listItems:p}):null]}),o[11]=d,o[12]=m,o[13]=p,o[14]=h,o[15]=f,o[16]=g,o[17]=r):r=o[17],o[18]!==d||o[19]!==r?(l=(0,a.jsx)(sO,{listId:d,children:r}),o[18]=d,o[19]=r,o[20]=l):l=o[20],l}function lc(){let e,t,n,i,o,d,c,u,h,x,v,b,y,j,I,_,S,k,w,C,T,N,L,A=(0,s.c)(135),{isAuthenticated:P}=(0,f.useGuestGate)(),O=(0,J.useCurrentListId)(),E=(0,J.useLastSelectedListIconData)(),M=(0,J.useLastSelectedListName)(),R=(0,J.useSetCurrentListId)(),z=(0,J.useSetOpenTaskId)(),B=(0,J.useCurrentParentListId)(),U=(0,J.useTeamId)(),F=(0,l.useQuery)(r.api.todo_lists.queries.getById,function(e){let t,n=(0,s.c)(3),{gate:a,isGuest:i}=(0,f.useGuestGate)();return e&&!i?(n[0]!==e||n[1]!==a?(t=a({id:e}),n[0]=e,n[1]=a,n[2]=t):t=n[2],t):"skip"}(O)),G=F?.parentId??B??void 0,q=F?.teamId??U??void 0,$=tL(G,q),{myTasksListId:K}=(0,D.useMyTasksListId)(),Q=O===K&&null!==K,V=O??void 0;A[0]!==q||A[1]!==Q||A[2]!==V?(e={listId:V,myTasks:Q,teamId:q},A[0]=q,A[1]=Q,A[2]=V,A[3]=e):e=A[3];let{displayTodos:W,focusTodoId:H,focusCursorPosition:Y,focusWithText:X,clearFocus:Z,createBelow:et,deleteTodo:ea,deleteAndFocusPrevious:es,mergeIntoPrevious:ei,updateTodo:er,updateNote:el,updateImages:eo,toggleTodo:ed,reorderTodo:ec,updateParentId:eu,uncheckAllInList:em,deleteAllInList:ep,isLoading:eh}=t6(e);A[4]!==W||A[5]!==Q?(t={enabled:Q,todos:W},A[4]=W,A[5]=Q,A[6]=t):t=A[6];let ef=function(e){let t,n,a,i,o=(0,s.c)(20),d=function(e){let t,n,a=(0,s.c)(5),{gate:i}=(0,f.useGuestGate)();a[0]!==e||a[1]!==i?(t=e?i({}):"skip",a[0]=e,a[1]=i,a[2]=t):t=a[2];let o=(0,l.useQuery)(r.api.todo_lists.queries.getAllAccessible,t);return a[3]!==o?(n=new Map((o??[]).map(tg)),a[3]=o,a[4]=n):n=a[4],n}(e.enabled),c=(0,J.useSelectedScopeIds)(),u=(0,J.useToggleScopeId)();if(!e.enabled){let t,n,a,s;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],n=[],o[0]=t,o[1]=n):(t=o[0],n=o[1]),o[2]!==e.todos?(a=[...e.todos],o[2]=e.todos,o[3]=a):a=o[3],o[4]!==a||o[5]!==u?(s={selectedIds:t,tabs:n,todos:a,toggle:u},o[4]=a,o[5]=u,o[6]=s):s=o[6],s}if(o[7]!==e.todos||o[8]!==d||o[9]!==c){let s;o[13]!==d?(s=e=>({...e,listName:e.listId?d.get(e.listId):void 0}),o[13]=d,o[14]=s):s=o[14];let i=e.todos.map(s);t=c,n=(0,th.buildTaskScopeTabs)({listNames:d,todos:i}),a=(0,th.filterTasksByScope)(i,c),o[7]=e.todos,o[8]=d,o[9]=c,o[10]=t,o[11]=n,o[12]=a}else t=o[10],n=o[11],a=o[12];return o[15]!==t||o[16]!==n||o[17]!==a||o[18]!==u?(i={selectedIds:t,tabs:n,todos:a,toggle:u},o[15]=t,o[16]=n,o[17]=a,o[18]=u,o[19]=i):i=o[19],i}(t),ex=tC(O);A[7]!==ef.todos||A[8]!==ex.kanbanEnabled?(n={kanbanEnabled:ex.kanbanEnabled,todos:ef.todos},A[7]=ef.todos,A[8]=ex.kanbanEnabled,A[9]=n):n=A[9];let eg=function(e){let t,n,a,i,r=(0,s.c)(24),l=(0,J.useTaskViewConfig)(),o=tP();if(r[0]!==e.todos||r[1]!==o||r[2]!==l){let n;r[4]!==o?(n=e=>({...e,statusGroup:o.resolve(e.listId,e.statusId)??(e.completed?"complete":"todo")}),r[4]=o,r[5]=n):n=r[5];let a=e.todos.map(n);t=(0,tA.deriveTaskView)(a,l),r[0]=e.todos,r[1]=o,r[2]=l,r[3]=t}else t=r[3];let d=t;r[6]!==l.assigneeId||r[7]!==l.due||r[8]!==l.labelId||r[9]!==l.priority||r[10]!==l.projectId||r[11]!==l.search||r[12]!==l.statusId?(n=l.search.trim().length>0||void 0!==l.statusId||void 0!==l.priority||void 0!==l.assigneeId||void 0!==l.projectId||void 0!==l.labelId||l.due!==tA.DEFAULT_TASK_VIEW.due,r[6]=l.assigneeId,r[7]=l.due,r[8]=l.labelId,r[9]=l.priority,r[10]=l.projectId,r[11]=l.search,r[12]=l.statusId,r[13]=n):n=r[13];let c=n,u=c||l.groupBy!==tA.DEFAULT_TASK_VIEW.groupBy||l.sortBy!==tA.DEFAULT_TASK_VIEW.sortBy,m=l.groupBy===tA.DEFAULT_TASK_VIEW.groupBy;return r[14]!==e.kanbanEnabled||r[15]!==e.todos||r[16]!==d.items?(a=e.kanbanEnabled?[...e.todos]:d.items,r[14]=e.kanbanEnabled,r[15]=e.todos,r[16]=d.items,r[17]=a):a=r[17],r[18]!==d.groups||r[19]!==c||r[20]!==m||r[21]!==a||r[22]!==u?(i={boundaries:d.groups,hasActiveFilters:c,sectioned:m,viewTransformsRows:u,visibleTodos:a},r[18]=d.groups,r[19]=c,r[20]=m,r[21]=a,r[22]=u,r[23]=i):i=r[23],i}(n),ev=tu({all:ef.todos,matched:eg.visibleTodos}),{sensors:eb,projection:ey,handleDragStart:ej,handleDragMove:e_,handleDragOver:eS,handleDragEnd:ek,handleDragCancel:ew}=tB({listItems:ev,onReorder:ec,onUpdateParentId:eu}),{modifiers:eC}=(0,g.useScaledDnd)();A[10]!==eC?(i=[...eC,tl],A[10]=eC,A[11]=i):i=A[11];let eT=i,eN=(0,J.useSelectList)(),eD=(0,J.useRequestFocusInput)(),eL=(0,J.useExpandedNoteIds)(O),eA=(0,J.useSetNoteExpanded)(),eP=tO(O);A[12]!==eP?(o=e=>{eP(e?.querySelector("[data-slot='scroll-area-viewport']")??null)},A[12]=eP,A[13]=o):o=A[13];let eO=o,eE=(0,J.useScrollToNewTaskKey)(),eM=(0,m.useRef)(null),eR=F?.name;A[14]!==O||A[15]!==q||A[16]!==eN||A[17]!==R||A[18]!==eR?(d={currentListId:O,effectiveTeamId:q,listName:eR,selectList:eN,setCurrentListId:R},A[14]=O,A[15]=q,A[16]=eN,A[17]=R,A[18]=eR,A[19]=d):d=A[19];let{allParentLists:ez,teamsForMove:eB,isListPublic:eU,toggleListVisibility:eF,handleMoveToParentList:eG,handleMoveToSpace:eq,handleCreateParentListForMove:e$,handleDeleteList:eK,handleRenameList:eQ,handleIconChange:eV,handleDuplicateList:eW}=function({currentListId:e,listName:t,effectiveTeamId:n,setCurrentListId:a,selectList:s}){let{gate:i}=(0,f.useGuestGate)(),o=(0,l.useMutation)(r.api.todo_lists.mutations.deleteList),d=(0,l.useMutation)(r.api.todo_lists.mutations.duplicateList),
1c=(0,l.useMutation)(r.api.todo_lists.mutations.update).withOptimisticUpdate((e,t)=>{let n=(0,ee.buildListUpdatePatch)(t);(0,ee.applyListPatchToQueries)(e,t.id,n)}),u=(0,l.useMutation)(r.api.todo_lists.list_organization.moveList),m=(0,l.useMutation)(r.api.todo_lists.mutations.create),{isPublic:p,toggleVisibility:h}=nf(e),x=(0,l.useQuery)(r.api.todo_lists.queries.getAllAccessible,i({}))??[],g=((0,l.useQuery)(r.api.teams.queries.getAll,i({}))??[]).filter(e=>null!=e),v=async n=>{if(e&&t)try{await u({id:e,parentId:n});let a=void 0===n?"My Tasks":x.find(e=>e._id===n)?.name??"List";e3.toast.success(`Moved "${t}" to "${a}"`)}catch(e){e3.toast.error(e instanceof Error?e.message:"Failed to move list")}},b=async n=>{if(e&&t)try{await u({id:e,teamId:n});let a=g.find(e=>e._id===n)?.name??"Space";e3.toast.success(`Moved "${t}" to "${a}"`)}catch(e){e3.toast.error(e instanceof Error?e.message:"Failed to move list")}};return{allParentLists:x,teamsForMove:g,isListPublic:p,toggleListVisibility:h,handleMoveToParentList:v,handleMoveToSpace:b,handleCreateParentListForMove:async()=>{let e=await m({name:"New list",teamId:n});return e?._id},handleDeleteList:async()=>{e&&(await o({id:e}),a(null))},handleRenameList:async t=>{e&&await c({id:e,name:t})},handleIconChange:async n=>{e&&t&&await c({id:e,name:t,iconData:void 0===n?null:(0,eI.toConvexIconData)(n)})},handleDuplicateList:async()=>{if(e)try{let n=await d({id:e});n&&(s(n._id,n.parentId,n.teamId,n.name,n.iconData),e3.toast.success(`Duplicated "${t}"`))}catch(e){e3.toast.error(e instanceof Error?e.message:"Failed to duplicate list")}}}}(d),eH=(0,to.useTogglePublic)();A[20]!==eU||A[21]!==eF||A[22]!==eH?(c=()=>eH({isPublic:eU,kind:"list",toggle:eF}),A[20]=eU,A[21]=eF,A[22]=eH,A[23]=c):c=A[23];let eY=c,eX=O??void 0;A[24]!==q||A[25]!==Q||A[26]!==F||A[27]!==eX?(u={isMyTasks:Q,list:F,listId:eX,teamId:q},A[24]=q,A[25]=Q,A[26]=F,A[27]=eX,A[28]=u):u=A[28];let eJ=function(e){let t,n,a,i,r=(0,s.c)(14),{isMyTasks:l,list:o,listId:d,teamId:c}=e,[u,p]=(0,m.useState)(!1),h=tW(d??""),f=d??null,x=c??null;r[0]!==f||r[1]!==x?(t={listId:f,teamId:x},r[0]=f,r[1]=x,r[2]=t):t=r[2];let{todos:g}=en(t);r[3]===Symbol.for("react.memo_cache_sentinel")?(n=()=>p(!0),r[3]=n):n=r[3];let v=n;r[4]!==o||r[5]!==d||r[6]!==h||r[7]!==g?(a=async(e,t)=>{if(!(o&&d))return;let n={statusOptions:o.statusOptions,defaultOptionByGroup:o.defaultOptionByGroup,kanbanEnabled:o.kanbanEnabled};await h.lock(e,n,g,t)},r[4]=o,r[5]=d,r[6]=h,r[7]=g,r[8]=a):a=r[8];let b=a,y=o?.isLocked===!0,j=null!=o&&null!=d&&void 0===c&&!0!==o.isPublic&&!(l||y),I=y&&null!=d?d:null,_=j?v:void 0;return r[9]!==u||r[10]!==b||r[11]!==I||r[12]!==_?(i={lockedListId:I,onLock:_,setShowLockDialog:p,showLockDialog:u,submitLock:b},r[9]=u,r[10]=b,r[11]=I,r[12]=_,r[13]=i):i=r[13],i}(u),{kanbanEnabled:eZ}=ex,e0=F?.name??M??"List";A[29]!==E||A[30]!==F?(h=F?(0,eI.fromConvexIconData)(F.iconData):E,A[29]=E,A[30]=F,A[31]=h):h=A[31];let e1=h,e2=F&&!Q?eV:void 0,e4=Q?void 0:eQ,e5=Q?void 0:eK,e6=Q?void 0:eW;A[32]!==O||A[33]!==e2||A[34]!==e4||A[35]!==Q||A[36]!==e0||A[37]!==e1?(x=O?{...e1&&{iconData:e1},...Q&&{isMyTasks:!0},kind:"list",listId:O,...e2&&{onIconChange:e2},...e4&&{onRename:e4},title:e0}:void 0,A[32]=O,A[33]=e2,A[34]=e4,A[35]=Q,A[36]=e0,A[37]=e1,A[38]=x):x=A[38];let e7=x;A[39]!==O||A[40]!==ep?(v=O?()=>ep(O):void 0,A[39]=O,A[40]=ep,A[41]=v):v=A[41];let e8=v;A[42]!==O||A[43]!==em?(b=O?()=>em(O):void 0,A[42]=O,A[43]=em,A[44]=b):b=A[44];let e9=b,te=ey?ev.find(e=>e._id===ey.activeId):void 0,tt=ey?.parentId;A[45]!==eE?(y=function(){eE>0&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{eM.current?.scrollIntoView({behavior:"smooth",block:"end"})})})},j=[eE],A[45]=eE,A[46]=y,A[47]=j):(y=A[46],j=A[47]),(0,m.useEffect)(y,j);let tn=F?.parentId,ta=F?.teamId;A[48]!==ef.selectedIds||A[49]!==ef.tabs||A[50]!==ef.toggle?(I=(0,a.jsx)(tf,{onToggle:ef.toggle,selectedIds:ef.selectedIds,tabs:ef.tabs}),A[48]=ef.selectedIds,A[49]=ef.tabs,A[50]=ef.toggle,A[51]=I):I=A[51],A[52]!==ez||A[53]!==$||A[54]!==e7||A[55]!==e8||A[56]!==e5||A[57]!==e6||A[58]!==e$||A[59]!==eG||A[60]!==eq||A[61]!==eY||A[62]!==eU||A[63]!==eZ||A[64]!==eJ.onLock||A[65]!==tn||A[66]!==ta||A[67]!==I||A[68]!==eB||A[69]!==e9?(_=(0,a.jsx)(sN,{allParentLists:ez,breadcrumbs:$,current:e7,currentParentId:tn,currentTeamId:ta,isListPublic:eU,kanbanEnabled:eZ,onCreateParentList:e$,onDelete:e5,onDeleteAll:e8,onDuplicate:e6,onLock:eJ.onLock,onMoveToParentList:eG,onMoveToSpace:eq,onToggleListVisibility:eY,onUncheckAll:e9,scopeTabs:I,teams:eB}),A[52]=ez,A[53]=$,A[54]=e7,A[55]=e8,A[56]=e5,A[57]=e6,A[58]=e$,A[59]=eG,A[60]=eq,A[61]=eY,A[62]=eU,A[63]=eZ,A[64]=eJ.onLock,A[65]=tn,A[66]=ta,A[67]=I,A[68]=eB,A[69]=e9,A[70]=_):_=A[70];let ts=_;if(eJ.lockedListId){let e,t;return A[71]!==eJ.lockedListId?(e=(0,a.jsx)(p.AppContentBody,{classNameViewport:"p-2 max-md:pb-[calc(var(--mobile-bottom-bar-height,4rem)+env(safe-area-inset-bottom,0px))]",maskBottom:!1,children:(0,a.jsx)(tH,{listId:eJ.lockedListId})}),A[71]=eJ.lockedListId,A[72]=e):e=A[72],A[73]!==ts||A[74]!==eO||A[75]!==e?(t=(0,a.jsxs)("div",{className:"relative flex h-full flex-col",ref:eO,children:[ts,e]}),A[73]=ts,A[74]=eO,A[75]=e,A[76]=t):t=A[76],t}A[77]!==ew||A[78]!==ek||A[79]!==e_||A[80]!==eS||A[81]!==ej||A[82]!==eb?(S={handleDragCancel:ew,handleDragEnd:ek,handleDragMove:e_,handleDragOver:eS,handleDragStart:ej,sensors:eb},A[77]=ew,A[78]=ek,A[79]=e_,A[80]=eS,A[81]=ej,A[82]=eb,A[83]=S):S=A[83];let ti=O??"inbox";A[84]!==eg.boundaries||A[85]!==eg.hasActiveFilters||A[86]!==eg.sectioned||A[87]!==eg.viewTransformsRows||A[88]!==P||A[89]!==Q||A[90]!==ti?(k={boundaries:eg.boundaries,canWrite:P,dragDisabled:eg.viewTransformsRows,hasActiveFilters:eg.hasActiveFilters,sectioned:eg.sectioned,sectionScopeKey:ti,showListChip:Q},A[84]=eg.boundaries,A[85]=eg.hasActiveFilters,A[86]=eg.sectioned,A[87]=eg.viewTransformsRows,A[88]=P,A[89]=Q,A[90]=ti,A[91]=k):k=A[91],A[92]!==te||A[93]!==Z||A[94]!==et||A[95]!==es||A[96]!==ea||A[97]!==eL||A[98]!==Y||A[99]!==H||A[100]!==X||A[101]!==ei||A[102]!==eT||A[103]!==tt||A[104]!==ey||A[105]!==eD||A[106]!==eA||A[107]!==z||A[108]!==S||A[109]!==k||A[110]!==ed||A[111]!==eo||A[112]!==el||A[113]!==eu||A[114]!==er?(w={activeItem:te,clearFocus:Z,createBelow:et,deleteAndFocusPrevious:es,deleteTodo:ea,dnd:S,exp
1andedNoteIds:eL,focusCursorPosition:Y,focusTodoId:H,focusWithText:X,mergeIntoPrevious:ei,modifiers:eT,newTaskSentinelRef:eM,projectedParentId:tt,projection:ey,requestFocusInput:eD,setNoteExpanded:eA,setOpenTaskId:z,toggleTodo:ed,updateImages:eo,updateNote:el,updateParentId:eu,updateTodo:er,view:k},A[92]=te,A[93]=Z,A[94]=et,A[95]=es,A[96]=ea,A[97]=eL,A[98]=Y,A[99]=H,A[100]=X,A[101]=ei,A[102]=eT,A[103]=tt,A[104]=ey,A[105]=eD,A[106]=eA,A[107]=z,A[108]=S,A[109]=k,A[110]=ed,A[111]=eo,A[112]=el,A[113]=eu,A[114]=er,A[115]=w):w=A[115],A[116]!==O||A[117]!==q||A[118]!==eh||A[119]!==eZ||A[120]!==ev||A[121]!==w?(C=(0,a.jsx)(ld,{currentListId:O,effectiveTeamId:q,isLoading:eh,kanbanEnabled:eZ,listItems:ev,rows:w}),A[116]=O,A[117]=q,A[118]=eh,A[119]=eZ,A[120]=ev,A[121]=w,A[122]=C):C=A[122];let tr=C;return A[123]!==eZ||A[124]!==tr?(T=eZ?tr:(0,a.jsx)(p.AppContentBody,{classNameViewport:"p-2 max-md:pb-[calc(var(--mobile-bottom-bar-height,4rem)+env(safe-area-inset-bottom,0px))]",mask:["left","right"],children:tr}),A[123]=eZ,A[124]=tr,A[125]=T):T=A[125],A[126]!==eJ.setShowLockDialog||A[127]!==eJ.showLockDialog||A[128]!==eJ.submitLock?(N=(0,a.jsx)(td.LockPasscodeDialog,{noun:"list",onOpenChange:eJ.setShowLockDialog,onSubmit:eJ.
1submitLock,open:eJ.showLockDialog}),A[126]=eJ.setShowLockDialog,A[127]=eJ.showLockDialog,A[128]=eJ.submitLock,A[129]=N):N=A[129],A[130]!==ts||A[131]!==eO||A[132]!==T||A[133]!==N?(L=(0,a.jsxs)("div",{className:"relative flex h-full flex-col",ref:eO,children:[ts,T,N]}),A[130]=ts,A[131]=eO,A[132]=T,A[133]=N,A[134]=L):L=A[134],L}var lu=e.i(864421);function lm(e){console.warn("Unable to save the Lists section state",e)}function lp(e){return!e}function lh(e,t){let n=(e.getQuery(r.api.preferences.queries.getCollapsedListSections,{})??[]).filter(e=>e!==t.sectionKey);e.setQuery(r.api.preferences.queries.getCollapsedListSections,{},t.collapsed?[...n,t.sectionKey]:n)}var lf=e.i(897059),lx=e.i(379383);function lg(e,t,n){let a=t.trim().toLowerCase();return a?e.filter(e=>e.name.toLowerCase().includes(a)||n?.has(e._id)):[...e]}function lv(e,t){return[...e].sort((e,n)=>(0,lx.compareBySort)(e,n,t))}function lb(e){let t,n,i,o,c,u,p,h,f,x,g,v,b,y,j,I,_,S,k,w,C,T,N,D=(0,s.c)(65),{children:L,className:A,listId:P,listName:O,parentId:E,allParentLists:M,teams:R,onCreateParentList:z,onMoveToParentList:B,onDelete:U,onSelectList:F,teamId:G}=e,q=void 0===A?"block w-full min-w-0":A,[$,K]=(0,m.useState)(!1),Q=(0,J.useAddTab)(),V=(0,J.useRecordDeletion)(),W=(0,l.useMutation)(r.api.todo_lists.list_organization.moveList),H=(0,l.useMutation)(r.api.todo_lists.mutations.deleteList),Y=(0,l.useMutation)(r.api.todo_lists.mutations.duplicateList);D[0]!==P||D[1]!==W||D[2]!==B?(t=e=>{W({id:P,parentId:e}).catch(lI),B?.(e)},D[0]=P,D[1]=W,D[2]=B,D[3]=t):t=D[3];let X=t;D[4]!==P||D[5]!==W||D[6]!==B?(n=e=>{W({id:P,teamId:e}).catch(lj),B?.(void 0)},D[4]=P,D[5]=W,D[6]=B,D[7]=n):n=D[7];let Z=n;D[8]!==Y||D[9]!==P||D[10]!==F?(i=async()=>{try{let e=await Y({id:P});e&&F(e._id,e.parentId,e.teamId,e.name,(0,eI.fromConvexIconData)(e.iconData))}catch(e){e3.toast.error(e instanceof Error?e.message:"Failed to duplicate list")}},D[8]=Y,D[9]=P,D[10]=F,D[11]=i):i=D[11];let ee=i;D[12]!==H||D[13]!==P||D[14]!==U||D[15]!==V?(o=()=>{V({kind:"list",id:P}),H({id:P}).catch(ly),U?.(),K(!1)},D[12]=H,D[13]=P,D[14]=U,D[15]=V,D[16]=o):o=D[16];let et=o;return D[17]!==L||D[18]!==q?(c=(0,a.jsx)(aT.ContextMenuTrigger,{className:q,children:L}),D[17]=L,D[18]=q,D[19]=c):c=D[19],D[20]!==Q||D[21]!==P||D[22]!==O||D[23]!==E||D[24]!==G?(u=()=>Q(P,E??null,G??null,O),D[20]=Q,D[21]=P,D[22]=O,D[23]=E,D[24]=G,D[25]=u):u=D[25],D[26]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(nd.ExternalLink,{className:"mr-2 h-3.5 w-3.5"}),D[26]=p):p=D[26],D[27]!==u?(h=(0,a.jsxs)(aT.ContextMenuItem,{onClick:u,children:[p,"Open in new tab"]}),D[27]=u,D[28]=h):h=D[28],D[29]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)(aT.ContextMenuSeparator,{}),D[29]=f):f=D[29],D[30]!==M||D[31]!==X||D[32]!==Z||D[33]!==z||D[34]!==E||D[35]!==G||D[36]!==R?(x=(0,a.jsx)(aE,{allParentLists:M,currentParentId:E,currentTeamId:G,onCreateParentList:z,onSelect:X,onSelectSpace:Z,teams:R}),D[30]=M,D[31]=X,D[32]=Z,D[33]=z,D[34]=E,D[35]=G,D[36]=R,D[37]=x):x=D[37],D[38]===Symbol.for("react.memo_cache_sentinel")?(g=(0,a.jsx)(a_.Copy,{className:"mr-2 h-3.5 w-3.5"}),D[38]=g):g=D[38],D[39]!==ee?(v=(0,a.jsxs)(aT.ContextMenuItem,{onClick:ee,children:[g,"Duplicate list"]}),D[39]=ee,D[40]=v):v=D[40],D[41]===Symbol.for("react.memo_cache_sentinel")?(b=(0,a.jsx)(aT.ContextMenuSeparator,{}),D[41]=b):b=D[41],D[42]===Symbol.for("react.memo_cache_sentinel")?(y=(0,a.jsx)(aT.ContextMenuItem,{onClick:()=>K(!0),children:"Delete"}),D[42]=y):y=D[42],D[43]!==x||D[44]!==v||D[45]!==h?(j=(0,a.jsxs)(aT.ContextMenuContent,{className:"w-56",children:[h,f,x,v,b,y]}),D[43]=x,D[44]=v,D[45]=h,D[46]=j):j=D[46],D[47]!==j||D[48]!==c?(I=(0,a.jsxs)(aT.ContextMenu,{children:[c,j]}),D[47]=j,D[48]=c,D[49]=I):I=D[49],D[50]===Symbol.for("react.memo_cache_sentinel")?(_=(0,a.jsx)(ak.AlertDialogTitle,{children:"Delete list?"}),D[50]=_):_=D[50],D[51]!==O?(S=(0,a.jsxs)(ak.AlertDialogHeader,{children:[_,(0,a.jsxs)(ak.AlertDialogDescription,{children:["Are you sure you want to delete"," ",(0,a.jsx)(d.Text,{as:"span",variant:"label",children:O}),"? All tasks in this list will be deleted. This cannot be undone."]})]}),D[51]=O,D[52]=S):S=D[52],D[53]===Symbol.for("react.memo_cache_sentinel")?(k=(0,a.jsx)(ak.AlertDialogCancel,{children:"Cancel"}),D[53]=k):k=D[53],D[54]!==et?(w=(0,a.jsxs)(ak.AlertDialogFooter,{children:[k,(0,a.jsx)(ak.AlertDialogAction,{onClick:et,variant:"destructive-solid",children:"Delete"})]}),D[54]=et,D[55]=w):w=D[55],D[56]!==S||D[57]!==w?(C=(0,a.jsxs)(ak.AlertDialogContent,{children:[S,w]}),D[56]=S,D[57]=w,D[58]=C):C=D[58],D[59]!==$||D[60]!==C?(T=(0,a.jsx)(ak.AlertDialog,{onOpenChange:K,open:$,children:C}),D[59]=$,D[60]=C,D[61]=T):T=D[61],D[62]!==I||D[63]!==T?(N=(0,a.jsxs)(a.Fragment,{children:[I,T]}),D[62]=I,D[63]=T,D[64]=N):N=D[64],N}function ly(e){e3.toast.error(e instanceof Error?e.message:"Failed to delete list")}function lj(e){e3.toast.error(e instanceof Error?e.message:"Failed to move list")}function lI(e){e3.toast.error(e instanceof Error?e.message:"Failed to move list")}var l_=e.i(317773);let lS="group relative flex h-40 w-full min-w-0 flex-col items-center justify-center gap-2 rounded-xl border border-border bg-surface px-3 py-4 text-center transition-colors hover:bg-surface-hover";function lk(e){let t,n,i,r=(0,s.c)(9),{className:l,icon:o,meta:d,title:c}=e;return r[0]!==l?(t=(0,j.cn)("flex w-full min-w-0 flex-col items-center gap-2 text-center",l),r[0]=l,r[1]=t):t=r[1],r[2]!==o?(n=(0,a.jsx)("span",{"aria-hidden":"true",className:"flex size-8 shrink-0 items-center justify-center",children:o}),r[2]=o,r[3]=n):n=r[3],r[4]!==d||r[5]!==t||r[6]!==n||r[7]!==c?(i=(0,a.jsxs)("div",{className:t,children:[n,c,d]}),r[4]=d,r[5]=t,r[6]=n,r[7]=c,r[8]=i):i=r[8],i}function lw(e){let t,n,r,l,o,c,u,m,p,h,f,x,g,v,b,y,_,S,k,w=(0,s.c)(60),{list:C,isEditing:T,editingName:N,onEditingNameChange:D,onStartEdit:L,onSaveEdit:A,onCancelEdit:P,onSelect:O,onDelete:E,onDuplicate:M,onMoveToParentList:R,onMoveToSpace:z,onCreateParentList:
1B,allParentLists:U,teams:F,currentParentId:G}=e,q=C.totalTaskCount,$=C.completedTaskCount,K=q>0?$/q*100:0,{attributes:Q,listeners:V,setNodeRef:W,isDragging:H}=((k=(0,s.c)(7))[0]!==C._id||k[1]!==C.name||k[2]!==C.parentId?(_={currentParentId:C.parentId,listId:C._id,listName:C.name,type:"list"},k[0]=C._id,k[1]=C.name,k[2]=C.parentId,k[3]=_):_=k[3],k[4]!==C._id||k[5]!==_?(S={data:_,id:C._id},k[4]=C._id,k[5]=_,k[6]=S):S=k[6],(0,i.useDraggable)(S)),Y=H&&"opacity-50";w[0]!==Y?(t=(0,j.cn)(lS,"cursor-pointer [&_[data-slot=progress-track]]:bg-surface-hover",Y),w[0]=Y,w[1]=t):t=w[1],w[2]!==T||w[3]!==C.name||w[4]!==O||w[5]!==L?(n=!T&&(0,a.jsx)("button",{"aria-label":`Open ${C.name}`,className:"absolute inset-0 z-0 cursor-pointer rounded-xl border-0 bg-transparent p-0",onClick:O,onDoubleClick:e=>{e.preventDefault(),L()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),O())},type:"button"}),w[2]=T,w[3]=C.name,w[4]=O,w[5]=L,w[6]=n):n=w[6],w[7]!==U||w[8]!==G||w[9]!==C.teamId||w[10]!==B||w[11]!==R||w[12]!==z||w[13]!==F?(r=(0,a.jsx)(aP,{allParentLists:U,currentParentId:G,currentTeamId:C.teamId,onCreateParentList:B,onSelect:R,onSelectSpace:z,teams:F}),w[7]=U,w[8]=G,w[9]=C.teamId,w[10]=B,w[11]=R,w[12]=z,w[13]=F,w[14]=r):r=w[14],w[15]!==M?(l=e=>{e.stopPropagation(),M()},w[15]=M,w[16]=l):l=w[16],w[17]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsx)(a_.Copy,{className:"mr-2 h-3.5 w-3.5"}),w[17]=o):o=w[17],w[18]!==l?(c=(0,a.jsxs)(eu.DropdownMenuItem,{onClick:l,children:[o,"Duplicate list"]}),w[18]=l,w[19]=c):c=w[19],w[20]!==E?(u=(0,a.jsx)(eu.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),E()},children:"Delete"}),w[20]=E,w[21]=u):u=w[21],w[22]!==C.name||w[23]!==r||w[24]!==c||w[25]!==u?(m=(0,a.jsx)("div",{className:"absolute top-1 right-1 z-20",children:(0,a.jsxs)(nJ.RowOptionsMenu,{name:C.name,children:[r,c,u]})}),w[22]=C.name,w[23]=r,w[24]=c,w[25]=u,w[26]=m):m=w[26];let X=!T&&"pointer-events-none";w[27]!==X?(p=(0,j.cn)("relative z-10",X),w[27]=X,w[28]=p):p=w[28];let J=C.iconData??ex;w[29]!==J?(h=(0,a.jsx)(em.IconDisplay,{size:28,value:J}),w[29]=J,w[30]=h):h=w[30],w[31]!==$||w[32]!==q?(f=(0,a.jsxs)(d.Text,{variant:"caption",children:[$,"/",q," tasks"]}),w[31]=$,w[32]=q,w[33]=f):f=w[33],w[34]!==N||w[35]!==T||w[36]!==C.name||w[37]!==P||w[38]!==D||w[39]!==A?(x=T?(0,a.jsx)(I.Textarea,{autoFocus:!0,className:iF("medium"),onBlur:A,onChange:e=>D(e.target.value),onFocus:lC,onKeyDown:e=>{"Enter"===e.key&&A(),"Escape"===e.key&&P()},rows:1,value:N,variant:"ghost"}):(0,a.jsx)(d.Text,{as:"span",variant:"cardTitle",children:C.name}),w[34]=N,w[35]=T,w[36]=C.name,w[37]=P,w[38]=D,w[39]=A,w[40]=x):x=w[40],w[41]!==p||w[42]!==h||w[43]!==f||w[44]!==x?(g=(0,a.jsx)(lk,{className:p,icon:h,meta:f,title:x}),w[41]=p,w[42]=h,w[43]=f,w[44]=x,w[45]=g):g=w[45];let Z=0===q&&"invisible";return w[46]!==Z?(v=(0,j.cn)("h-1.5 w-full",Z),w[46]=Z,w[47]=v):v=w[47],w[48]!==K||w[49]!==v?(b=(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-3 bottom-3 z-10",children:(0,a.jsx)(l_.Progress,{className:v,value:K})}),w[48]=K,w[49]=v,w[50]=b):b=w[50],w[51]!==Q||w[52]!==V||w[53]!==W||w[54]!==g||w[55]!==b||w[56]!==t||w[57]!==n||w[58]!==m?(y=(0,a.jsxs)("div",{className:t,ref:W,...V,...Q,children:[n,m,g,b]}
1),w[51]=Q,w[52]=V,w[53]=W,w[54]=g,w[55]=b,w[56]=t,w[57]=n,w[58]=m,w[59]=y):y=w[59],y}function lC(e){return e.target.select()}function lT(e){let t,n,i,r,l,o=(0,s.c)(11),{parentList:c,onSelect:u}=e,m=c.iconData??ex;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,j.cn)(lS,"cursor-pointer"),o[0]=t):t=o[0],o[1]!==m?(n=(0,a.jsx)(em.IconDisplay,{size:28,value:m}),o[1]=m,o[2]=n):n=o[2],o[3]!==c.name?(i=(0,a.jsx)(d.Text,{as:"span",variant:"cardTitle",children:c.name}),o[3]=c.name,o[4]=i):i=o[4],o[5]!==n||o[6]!==i?(r=(0,a.jsx)(lk,{icon:n,title:i}),o[5]=n,o[6]=i,o[7]=r):r=o[7],o[8]!==u||o[9]!==r?(l=(0,a.jsx)("button",{className:t,onClick:u,type:"button",children:r}),o[8]=u,o[9]=r,o[10]=l):l=o[10],l}function lN({parentLists:e,onSelectParentList:t}){return e.map(e=>(0,a.jsx)(lT,{onSelect:()=>t(e),parentList:e},e._id))}function lD({contextMenuConfig:e,listItemProps:t,lists:n}){return n.map(n=>(0,a.jsx)(lb,{allParentLists:e.allParentLists,listId:n._id,listName:n.name,onCreateParentList:e.onCreateParentList,onSelectList:e.onSelectList,parentId:n.parentId,teamId:n.teamId,teams:e.teams,children:(0,a.jsx)(lw,{...t(n)})},n._id))}function lL(e){let t,n,i,r,l=(0,s.c)(7),{label:o,onCreate:c}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,j.cn)(lS,"cursor-pointer"),l[0]=t):t=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(ef.Plus,{className:"size-6 text-muted-foreground"}),l[1]=n):n=l[1],l[2]!==o?(i=(0,a.jsx)(lk,{icon:n,title:(0,a.jsx)(d.Text,{as:"span",variant:"cardTitle",children:o})}),l[2]=o,l[3]=i):i=l[3],l[4]!==c||l[5]!==i?(r=(0,a.jsx)("button",{className:t,onClick:c,type:"button",children:i}),l[4]=c,l[5]=i,l[6]=r):r=l[6],r}let lA={lists:{createLabel:"New list",noun:"lists",searchLabel:"Search lists",title:"Lists"},"sub-lists":{createLabel:"New sub-list",noun:"sub-lists",searchLabel:"Search sub-lists",title:"Sub-lists"}};function lP(e){let t,n,i,r,l=(0,s.c)(14),{collapse:c,copy:u,search:m}=e;return l[0]!==c||l[1]!==u.title?(t=c?(0,a.jsx)(o.Button,{"aria-expanded":!c.isCollapsed,"aria-label":c.isCollapsed?`Expand ${u.title}`:`Collapse ${u.title}`,onClick:c.toggle,size:"icon-sm",variant:"ghost",children:(0,a.jsx)(n0.ChevronRight,{className:(0,j.cn)("size-3.5 transition-transform",c.isCollapsed?"rotate-0":"rotate-90")})}):null,l[0]=c,l[1]=u.title,l[2]=t):t=l[2],l[3]!==u.title?(n=(0,a.jsx)(d.Text,{className:"shrink-0",variant:"overline",children:u.title}),l[3]=u.title,l[4]=n):n=l[4],l[5]!==u.searchLabel||l[6]!==m.onCh
1ange||l[7]!==m.totalCount||l[8]!==m.value?(i=m.totalCount>0?(0,a.jsx)("div",{className:"flex min-w-0 flex-1 justify-end",children:(0,a.jsx)(lf.HomeFilterField,{label:u.searchLabel,onChange:m.onChange,persistent:!0,value:m.value})}):null,l[5]=u.searchLabel,l[6]=m.onChange,l[7]=m.totalCount,l[8]=m.value,l[9]=i):i=l[9],l[10]!==t||l[11]!==n||l[12]!==i?(r=(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[t,n,i]}),l[10]=t,l[11]=n,l[12]=i,l[13]=r):r=l[13],r}function lO(e){let t,n,i,r,l,o,d,c=(0,s.c)(24),{collapse:u,content:p,onCreate:h}=e,[f,x]=(0,m.useState)(""),g=lA[p.kind];c[0]!==p||c[1]!==f?(t=function(e,t){if("lists"===e.kind){let n=lg(e.parentLists,t);return{matchCount:n.length,node:(0,a.jsx)(lN,{onSelectParentList:e.onSelectParentList,parentLists:n}),totalCount:e.parentLists.length}}let n=lg(e.lists,t);return{matchCount:n.length,node:(0,a.jsx)(lD,{contextMenuConfig:e.contextMenuConfig,listItemProps:e.listItemProps,lists:n}),totalCount:e.lists.length}}(p,f),c[0]=p,c[1]=f,c[2]=t):t=c[2];let{matchCount:v,node:b,totalCount:y}=t;c[3]!==f?(n=f.trim(),c[3]=f,c[4]=n):n=c[4];let j=n.length>0;c[5]===Symbol.for("react.memo_cache_sentinel")?(i=()=>x(""),c[5]=i):i=c[5];let I=i;if("sub-lists"===p.kind&&p.listsLoading)return null;c[6]!==f||c[7]!==y?(r={onChange:x,totalCount:y,value:f},c[6]=f,c[7]=y,c[8]=r):r=c[8],c[9]!==u||c[10]!==g||c[11]!==r?(l=(0,a.jsx)(lP,{collapse:u,copy:g,search:r}),c[9]=u,c[10]=g,c[11]=r,c[12]=l):l=c[12];let _=l;return u?.isCollapsed?_:(c[13]!==g.createLabel||c[14]!==g.noun||c[15]!==j||c[16]!==v||c[17]!==b||c[18]!==h||c[19]!==f?(o=j&&0===v?(0,a.jsx)(lf.HomeFilterEmpty,{noun:g.noun,onClear:I,query:f}):(0,a.jsxs)("div",{className:"grid max-h-84 grid-cols-2 gap-2 overflow-y-auto overscroll-contain sm:grid-cols-3",children:[b,(0,a.jsx)(lL,{label:g.createLabel,onCreate:h})]}),c[13]=g.createLabel,c[14]=g.noun,c[15]=j,c[16]=v,c[17]=b,c[18]=h,c[19]=f,c[20]=o):o=c[20],c[21]!==_||c[22]!==o?(d=(0,a.jsxs)(a.Fragment,{children:[_,o]}),c[21]=_,c[22]=o,c[23]=d):d=c[23],d)}function lE(e){let t,n=(0,s.c)(4),{collapse:i,section:r}=e;return n[0]!==i||n[1]!==r.content||n[2]!==r.onCreate?(t=(0,a.jsx)(lO,{collapse:i,content:r.content,onCreate:r.onCreate}),n[0]=i,n[1]=r.content,n[2]=r.onCreate,n[3]=t):t=n[3],t}function lM(e){let t,n,i,r,l=(0,s.c)(12),{current:o}=e,d=(0,J.useTeamId)(),c=tL(void 0,d??void 0);if(o){let e;return l[0]!==c||l[1]!==o?(e=(0,a.jsx)(sk,{ancestors:c,current:o}),l[0]=c,l[1]=o,l[2]=e):e=l[2],e}let[u]=c;return d&&u?(l[3]===Symbol.for("react.memo_cache_sentinel")?(t=[],l[3]=t):t=l[3],l[4]!==u.iconData?(n=u.iconData&&{iconData:u.iconData},l[4]=u.iconData,l[5]=n):n=l[5],l[6]!==u.isMyTasks?(i=u.isMyTasks&&{isMyTasks:!0}
1,l[6]=u.isMyTasks,l[7]=i):i=l[7],l[8]!==u.label||l[9]!==n||l[10]!==i?(r=(0,a.jsx)(sk,{ancestors:t,current:{...n,...i,kind:"label",label:u.label}}),l[8]=u.label,l[9]=n,l[10]=i,l[11]=r):r=l[11],r):null}function lR(e){let t,n,i,c,u,m,p,h,x,g,v=(0,s.c)(24),{onOpenChange:b,open:y,teamId:j}=e,{gate:I,isGuest:_}=(0,f.useGuestGate)();v[0]!==I||v[1]!==_||v[2]!==j?(t=_?"skip":I({teamId:j}),v[0]=I,v[1]=_,v[2]=j,v[3]=t):t=v[3];let S=(0,l.useQuery)(r.api.todo_lists.share_queries.getSpaceAccessForSpace,t),k=y?"Close share menu":"Open share menu",w=y?"secondary":"ghost";return v[4]!==k||v[5]!==w?(n=(0,a.jsx)(o.Button,{"aria-label":k,size:"icon-xs",variant:w}),v[4]=k,v[5]=w,v[6]=n):n=v[6],v[7]!==y?(i=y?(0,a.jsx)(na.ChevronUp,{className:"h-3 w-3"}):(0,a.jsx)(eh.ChevronDown,{className:"h-3 w-3"}),v[7]=y,v[8]=i):i=v[8],v[9]!==n||v[10]!==i?(c=(0,a.jsx)(eL.PopoverTrigger,{render:n,children:i}),v[9]=n,v[10]=i,v[11]=c):c=v[11],v[12]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)("div",{className:"border-b px-3 py-2.5",children:(0,a.jsx)(d.Text,{variant:"label",children:"Share"})}),v[12]=u):u=v[12],v[13]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(d.Text,{className:"mb-1.5",variant:"caption",children:"General access"}),v[13]=m):m=v[13],v[14]!==S?(p=S?(0,a.jsx)(nh.SpaceAccessSummaryRow,{access:S}):(0,a.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg px-1 py-1.5",children:[(0,a.jsx)("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-muted",children:(0,a.jsx)(tU.Lock,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,a.jsx)(d.Text,{variant:"label",children:"Only you"})]}),v[14]=S,v[15]=p):p=v[15],v[16]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsx)(d.Text,{variant:"caption",children:"Publish a single list from its own share menu."}),v[16]=h):h=v[16],v[17]!==p?(x=(0,a.jsxs)(eL.PopoverContent,{align:"end",className:"w-[calc(100vw-2rem)] gap-0 p-0 sm:w-96",sideOffset:8,children:[u,(0,a.jsxs)("div",{className:"space-y-3 p-3",children:[m,p,h]})]}),v[17]=p,v[18]=x):x=v[18],v[19]!==b||v[20]!==y||v[21]!==x||v[22]!==c?(g=(0,a.jsxs)(eL.Popover,{onOpenChange:b,open:y,children:[c,x]}),v[19]=b,v[20]=y,v[21]=x,v[22]=c,v[23]=g):g=v[23],g}function lz(e,t){nM(e,t)}function lB(e,t){nP(e,t)}function lU(e,t){nz(e,t)}function lF(e,t){nR(e,t)}function lG(e,t){nE(e,t)}function lq(e){let t,n,i,o,c,u,m,p,h,x,g,v,b,y,j,I,_,S,k,w=(0,s.c)(20),{listId:C,onOpenChange:T,open:N}=e,{gate:D}=(0,f.useGuestGate)();w[0]!==D||w[1]!==C?(t=D({listId:C}),w[0]=D,w[1]=C,w[2]=t):t=w[2];let L=(0,l.useQuery)(r.api.todo_lists.status_queries.getStatusOptions,t),A=(y=(0,s.c)(16),j=(0,l.useMutation)(r.api.todo_lists.status_mutations.addStatusOption),y[0]!==j?(p=j.withOptimisticUpdate(lG),y[0]=j,y[1]=p):p=y[1],I=(0,l.useMutation)(r.api.todo_lists.status_mutations.deleteStatusOption),y[2]!==I?(h=I.withOptimisticUpdate(lF),y[2]=I,y[3]=h):h=y[3],_=(0,l.useMutation)(r.api.todo_lists.status_mutations.reorderStatusOptions),y[4]!==_?(x=_.withOptimisticUpdate(lU),y[4]=_,y[5]=x):x=y[5],S=(0,l.useMutation)(r.api.todo_lists.status_mutations.setDefaultStatusOption),y[6]!==S?(g=S.withOptimisticUpdate(lB),y[6]=S,y[7]=g):g=y[7],k=(0,l.useMutation)(r.api.todo_lists.status_mutations.updateStatusOption),y[8]!==k?(v=k.withOptimisticUpdate(lz),y[8]=k,y[9]=v):v=y[9],y[10]!==p||y[11]!==h||y[12]!==x||y[13]!==g||y[14]!==v?(b={addStatusOption:p,deleteStatusOption:h,reorderStatusOptions:x,setDefaultStatusOption:g,updateStatusOption:v},y[10]=p,y[11]=h,y[12]=x,y[13]=g,y[14]=v,y[15]=b):b=y[15],b);if(w[3]!==C||w[4]!==A)n={addOption:(e,t)=>{A.addStatusOption({group:e,listId:C,name:t}).catch(console.error)},deleteOption:(e,t)=>{A.deleteStatusOption({listId:C,optionId:e,remapToOptionId:t}).catch(console.error)},reorderOptions:(e,t)=>{A.reorderStatusOptions({group:e,listId:C,orderedIds:t}).catch(console.error)},setDefault:(e,t)=>{A.setDefaultStatusOption({group:e,listId:C,optionId:t}).catch(console.error)},updateOption:(e,t)=>{A.updateStatusOption({listId:C,optionId:e,...t}).catch(console.error)}},w[3]=C,w[4]=A,w[5]=n;else n=w[5];let P=n,O=nD(C);return w[6]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(nT.DialogHeader,{children:(0,a.jsx)(nT.DialogTitle,{children:"List settings"})}),w[6]=i):i=w[6],w[7]!==L?(o=void 0===L&&(0,a.jsx)("div",{className:"flex justify-center py-4"}),w[7]=L,w[8]=o):o=w[8],w[9]!==P||w[10]!==L||w[11]!==O?(c=L&&(0,a.jsxs)("div",{className:"flex max-h-[70vh] flex-col gap-3 overflow-y-auto",children:[(0,a.jsx)(al,{teamId:L.teamId}),(0,a.jsx)(nw,{onChange:O.setProperties,properties:O.view.properties}),O.confirmDialog,(0,a.jsx)(d.Text,{as:"span",className:"px-1.5",variant:"overline",children:"Statuses"}),(0,a.jsx)(ai,{actions:P,defaults:L.defaultOptionByGroup,options:L.statusOptions})]}),w[9]=P,w[10]=L,w[11]=O,w[12]=c):c=w[12],w[13]!==o||w[14]!==c?(u=(0,a.jsxs)(nT.DialogContent,{className:"max-w-md",children:[i,o,c]}),w[13]=o,w[14]=c,w[15]=u):u=w[15],w[16]!==T||w[17]!==N||w[18]!==u?(m=(0,a.jsx)(nT.Dialog,{onOpenChange:T,open:N,children:u}),w[16]=T,w[17]=N,w[18]=u,w[19]=m):m=w[19],m}function l$(e){let t,n=(0,s.c)(11),{currentParentListId:i,isListPublic:r,isMyTasksView:l,onShareOpenChange:d,onToggleListVisibility:c,shareOpen:u,spaceRootTeamId:m}=e;if(l){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsxs)(ah.Tooltip,{children:[(0,a.jsx)(ah.TooltipTrigger,{render:(0,a.jsx)(o.Button,{className:"pointer-events-auto cursor-default",size:"icon-xs",variant:"ghost"}),children:(0,a.jsx)(ni.EyeClosed,{className:"h-3 w-3"})}),(0,a.jsx)(ah.TooltipContent,{children:"My Tasks is only visible to you."})]}),n[0]=e):e=n[0],e}if(!d)return null;if(m&&!i){let e,t=u??!1;return n[1]!==d||n[2]!==m||n[3]!==t?(e=(0,a.jsx)(lR,{onOpenChange:d,open:t,teamId:m}),n[1]=d,n[2]=m,n[3]=t,n[4]=e):e=n[4],e}if(!(i&&c))return null;let p=r??!1,h=u??!1;return n[5]!==i||n[6]!==d||n[7]!==c||n[8]!==p||n[9]!==h?(t=(0,a.jsx)(nb,{isPublic:p,listId:i,onOpenChange:d,onToggleVisibility:c,open:h}),n[5]=i,n[6]=d,n[7]=c,n[8]=p,n[9]=h,n[10]=t):t=n[10],t}let lK=e=>{let t,n,i,r,l,o,d,c=(0,s.c)(32),{headerTitle:u,currentParentListId:p,canDeleteParentList:h,displayParentListName:f,isListPublic:x,isMyTasksView:g,kanbanEnabled:v,onDeleteParentList:b,onShareOpenChange:y,onToggleKanban:j,onToggleListVisibility:I,parentListName:_,shareOpen:S,spaceRootTeamId:k}=e,[w,C]=(0,m.useState)(!1);return c[0]!==p?(t=p?(0,a.jsx)(nn.ObjectPresenceStack,{objectId:p,objectType:"todoList"}):null,c[0]=p,c[1]=t):t=c[1],c[2]!==p||c[3]!==v||c[4]!==j?(n=p?(0,a.jsx)(aj,{listId:p}):j&&(0,a.jsx)(ay,{kanbanEnabled:v??!1,onChange:j}
1),c[2]=p,c[3]=v,c[4]=j,c[5]=n):n=c[5],c[6]!==p||c[7]!==x||c[8]!==g||c[9]!==y||c[10]!==I||c[11]!==S||c[12]!==k?(i=(0,a.jsx)(l$,{currentParentListId:p,isListPublic:x,isMyTasksView:g,onShareOpenChange:y,onToggleListVisibility:I,shareOpen:S,spaceRootTeamId:k}),c[6]=p,c[7]=x,c[8]=g,c[9]=y,c[10]=I,c[11]=S,c[12]=k,c[13]=i):i=c[13],c[14]!==h||c[15]!==p||c[16]!==f||c[17]!==b||c[18]!==_?(r=h&&p?(0,a.jsxs)(nJ.RowOptionsMenu,{name:f??_??"List",size:"icon-sm",children:[(0,a.jsxs)(eu.DropdownMenuItem,{onClick:()=>C(!0),children:[(0,a.jsx)(ny.Settings,{className:"mr-2 h-3.5 w-3.5"}),"List settings"]}),(0,a.jsx)(eu.DropdownMenuSeparator,{}),(0,a.jsx)(eu.DropdownMenuItem,{onClick:()=>b({id:p,name:f??_??"List"}),children:"Delete"})]}):(0,a.jsx)("div",{"aria-hidden":!0,className:"size-7 shrink-0"}),c[14]=h,c[15]=p,c[16]=f,c[17]=b,c[18]=_,c[19]=r):r=c[19],c[20]!==t||c[21]!==n||c[22]!==i||c[23]!==r?(l=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[t,n,i,r]}),c[20]=t,c[21]=n,c[22]=i,c[23]=r,c[24]=l):l=c[24],c[25]!==p||c[26]!==w?(o=p&&(0,a.jsx)(lq,{listId:p,onOpenChange:C,open:w}),c[25]=p,c[26]=w,c[27]=o):o=c[27],c[28]!==u||c[29]!==l||c[30]!==o?(d=(0,a.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 px-3 py-2",children:[u,l,o]}),c[28]=u,c[29]=l,c[30]=o,c[31]=d):d=c[31],d};function lQ(e){let t,n,i=(0,s.c)(5),r=t8();return i[0]!==e?(t=(0,a.jsx)(lK,{...e}),i[0]=e,i[1]=t):t=i[1],i[2]!==r||i[3]!==t?(n=r(t),i[2]=r,i[3]=t,i[4]=n):n=i[4],n}function lV(e){let t,n,i,r,l,o,c,u=(0,s.c)(15),{onClose:m,onDelete:p,target:h}=e;u[0]!==m?(t=e=>!e&&m(),u[0]=m,u[1]=t):t=u[1];let f=null!=h;u[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(ak.AlertDialogTitle,{children:"Delete list?"}),u[2]=n):n=u[2];let x=h?.name;return u[3]!==x?(i=(0,a.jsxs)(ak.AlertDialogHeader,{children:[n,(0,a.jsxs)(ak.AlertDialogDescription,{children:["Are you sure you want to delete"," ",(0,a.jsx)(d.Text,{as:"span",variant:"label",children:x}),"? All tasks in this list will be deleted. This cannot be undone."]})]}),u[3]=x,u[4]=i):i=u[4],u[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(ak.AlertDialogCancel,{children:"Cancel"}),u[5]=r):r=u[5],u[6]!==p?(l=(0,a.jsxs)(ak.AlertDialogFooter,{children:[r,(0,a.jsx)(ak.AlertDialogAction,{onClick:p,variant:"destructive-solid",children:"Delete"})]}),u[6]=p,u[7]=l):l=u[7],u[8]!==i||u[9]!==l?(o=(0,a.jsxs)(ak.AlertDialogContent,{children:[i,l]}),u[8]=i,u[9]=l,u[10]=o):o=u[10],u[11]!==t||u[12]!==f||u[13]!==o?(c=(0,a.jsx)(ak.AlertDialog,{onOpenChange:t,open:f,children:o}),u[11]=t,u[12]=f,u[13]=o,u[14]=c):c=u[14],c}var lW=e.i(119798);function lH(e){let t,n,i,o,c,u,p,h,f,x,g=(0,s.c)(27),{target:v,listCount:b,onClose:y,onDeleted:j}=e,I=b>0,[_,S]=(0,m.useState)("delete"),k=(0,l.useMutation)(r.api.todo_lists.mutations.deleteList);g[0]!==y?(t=e=>{e||(S("delete"),y())},g[0]=y,g[1]=t):t=g[1];let w=t;g[2]!==k||g[3]!==_||g[4]!==y||g[5]!==j||g[6]!==v?(n=async()=>{v&&(await k({id:v.id,deleteLists:"delete"===_}),y(),j())},g[2]=k,g[3]=_,g[4]=y,g[5]=j,g[6]=v,g[7]=n):n=g[7];let C=n,T=null!=v;g[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(ak.AlertDialogTitle,{children:"Delete list?"}),g[8]=i):i=g[8];let N=v?.name;return g[9]!==N?(o=(0,a.jsxs)(ak.AlertDialogDescription,{children:["Are you sure you want to delete"," ",(0,a.jsx)(d.Text,{as:"span",variant:"label",children:N}),"? This cannot be undone."]}),g[9]=N,g[10]=o):o=g[10],g[11]!==I||g[12]!==_?(c=I&&(0,a.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,a.jsx)(d.Muted,{children:"What should happen to lists in this list?"}),(0,a.jsxs)(lW.RadioGroup,{className:"gap-2",onValueChange:e=>{("delete"===e||"move"===e)&&S(e)},value:_,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(lW.RadioGroupItem,{id:"delete-lists",value:"delete"}),(0,a.jsx)(ar.Label,{className:"cursor-pointer font-normal",htmlFor:"delete-lists",children:"Delete all lists and their tasks"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(lW.RadioGroupItem,{id:"move-lists",value:"move"}),(0,a.jsx)(ar.Label,{className:"cursor-pointer font-normal",htmlFor:"move-lists",children:"Move lists to My Tasks"})]})]})]}),g[11]=I,g[12]=_,g[13]=c):c=g[13],g[14]!==o||g[15]!==c?(u=(0,a.jsxs)(ak.AlertDialogHeader,{children:[i,o,c]}),g[14]=o,g[15]=c,g[16]=u):u=g[16],g[17]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(ak.AlertDialogCancel,{children:"Cancel"}),g[17]=p):p=g[17],g[18]!==C?(h=(0,a.jsxs)(ak.AlertDialogFooter,{children:[p,(0,a.jsx)(ak.AlertDialogAction,{onClick:C,variant:"destructive-solid",children:"Delete"})]}
1),g[18]=C,g[19]=h):h=g[19],g[20]!==h||g[21]!==u?(f=(0,a.jsxs)(ak.AlertDialogContent,{children:[u,h]}),g[20]=h,g[21]=u,g[22]=f):f=g[22],g[23]!==w||g[24]!==f||g[25]!==T?(x=(0,a.jsx)(ak.AlertDialog,{onOpenChange:w,open:T,children:f}),g[23]=w,g[24]=f,g[25]=T,g[26]=x):x=g[26],x}function lY(e){let t,n,i,r,l,o,d,c,u,p,h,f=(0,s.c)(39),{iconData:x,isMyTasks:g,listId:v,onIconChange:b,onRename:y,title:I}=e,{uploadedImages:_,onUploadImage:S,onDeleteImage:k,onTouchImage:w}=(0,sy.useIconUpload)(),[C,T]=(0,m.useState)(I),[N,D]=(0,m.useState)(!1),L=(0,m.useRef)(null);f[0]!==N||f[1]!==I?(t=function(){N||T(I)},n=[I,N],f[0]=N,f[1]=I,f[2]=t,f[3]=n):(t=f[2],n=f[3]),(0,m.useEffect)(t,n),f[4]!==C||f[5]!==y||f[6]!==I?(i=()=>{D(!1);let e=C.trim();e&&e!==I?y?.(e):T(I)},f[4]=C,f[5]=y,f[6]=I,f[7]=i):i=f[7];let A=i;f[8]!==I?(r=e=>{"Enter"===e.key&&(e.preventDefault(),L.current?.blur()),"Escape"===e.key&&(e.preventDefault(),T(I),L.current?.blur())},f[8]=I,f[9]=r):r=f[9];let P=r,O=!!b;if(g){let e;f[10]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(eg.MyTasksIcon,{size:28}),f[10]=e):e=f[10],l=e}else if(O&&b){let e,t,n=x??ex;f[11]!==n?(e=(0,a.jsx)(em.IconDisplay,{size:28,value:n}),f[11]=n,f[12]=e):e=f[12],f[13]!==x||f[14]!==v||f[15]!==k||f[16]!==b||f[17]!==w||f[18]!==S||f[19]!==e||f[20]!==_?
1(t=(0,a.jsx)(sb.IconPicker,{disabled:!1,onChange:b,onDeleteImage:k,onTouchImage:w,onUploadImage:S,triggerSize:28,uploadedImages:_,value:x,children:e},v),f[13]=x,f[14]=v,f[15]=k,f[16]=b,f[17]=w,f[18]=S,f[19]=e,f[20]=_,f[21]=t):t=f[21],l=t}else{let e,t=x??ex;f[22]!==t?(e=(0,a.jsx)(em.IconDisplay,{size:28,value:t}),f[22]=t,f[23]=e):e=f[23],l=e}f[24]!==l?(o=(0,a.jsx)("div",{className:"flex h-[2rem] shrink-0 items-center max-md:h-[1.75rem]",children:l}),f[24]=l,f[25]=o):o=f[25];let E=y?"cursor-text":"cursor-default";f[26]!==E?(d=(0,j.cn)("no-scrollbar block h-[2rem] w-full resize-none overflow-x-auto whitespace-nowrap border-none bg-transparent p-0 font-[inherit] font-semibold text-[1.5rem] text-foreground leading-[2rem] outline-none placeholder:text-muted-foreground max-md:h-[1.75rem] max-md:text-[1.25rem] max-md:leading-[1.75rem]",E),f[26]=E,f[27]=d):d=f[27];let M=!y;return f[28]===Symbol.for("react.memo_cache_sentinel")?(u=e=>T(e.target.value),c=()=>D(!0),f[28]=c,f[29]=u):(c=f[28],u=f[29]),f[30]!==A||f[31]!==P||f[32]!==C||f[33]!==d||f[34]!==M?(p=(0,a.jsx)("div",{className:"min-w-0 flex-1",children:(0,a.jsx)("textarea",{className:d,disabled:M,onBlur:A,onChange:u,onFocus:c,onKeyDown:P,placeholder:"Untitled",ref:L,rows:1,value:C,wrap:"off"})}),f[30]=A,f[31]=P,f[32]=C,f[33]=d,f[34]=M,f[35]=p):p=f[35],f[36]!==p||f[37]!==o?(h=(0,a.jsxs)("div",{className:"flex items-start gap-3 px-2 pt-3 pb-1",children:[o,p]}),f[36]=p,f[37]=o,f[38]=h):h=f[38],h}function lX(e){let t,n,r,l,o,c,u=(0,s.c)(13),{noteExpansionKey:p,optimisticTodosArgs:h}=e,f=(0,J.useExpandedNoteIdsByKey)(p),x=(0,J.useSetNoteExpandedByKey)(),v=(0,J.useSetOpenTaskId)(),b=(0,J.useRequestFocusInput)(),y=(0,J.useScrollToNewTaskKey)(),j=(0,m.useRef)(null),{displayTodos:I,focusTodoId:_,focusCursorPosition:S,focusWithText:k,clearFocus:w,createBelow:C,deleteTodo:T,deleteAndFocusPrevious:N,mergeIntoPrevious:D,updateTodo:L,updateNote:A,updateImages:P,toggleTodo:O,reorderTodo:E,updateParentId:M,isLoading:R}=t6(h),z=tu({all:I,matched:[...I].sort((e,t)=>e.sortOrder-t.sortOrder)}),{sensors:B,projection:U,handleDragStart:F,handleDragMove:G,handleDragOver:q,handleDragEnd:$,handleDragCancel:K}=tB({listItems:z,onReorder:E,onUpdateParentId:M}),{modifiers:Q}=(0,g.useScaledDnd)();u[0]!==Q?(t=[...Q,tl],u[0]=Q,u[1]=t):t=u[1];let V=t,W=z.map(lJ),H=U?z.find(e=>e._id===U.activeId):void 0;u[2]!==y?(n=function(){y>0&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{j.current?.scrollIntoView({behavior:"smooth",block:"end"})})})},r=[y],u[2]=y,u[3]=n,u[4]=r):(n=u[3],r=u[4]),(0,m.useEffect)(n,r),u[5]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(d.Text,{className:"mb-2",variant:"overline",children:"Tasks"}),u[5]=l):l=u[5],u[6]!==R?(o=R&&(0,a.jsx)(i9,{rows:3}),u[6]=R,u[7]=o):o=u[7];let Y=!R&&0===z.length&&(0,a.jsx)("div",{className:"flex h-16 flex-col items-center justify-center rounded-lg border border-dashed text-muted-foreground opacity-33",children:(0,a.jsx)(d.Text,{variant:"bodySmall",children:"Add a task in the input bar below"})}),X=!R&&z.length>0&&(0,a.jsxs)(i.DndContext,{collisionDetection:i.closestCenter,modifiers:V,onDragCancel:K,onDragEnd:$,onDragMove:G,onDragOver:q,onDragStart:F,sensors:B,children:[(0,a.jsx)(tE.SortableContext,{items:W,strategy:tE.verticalListSortingStrategy,children:(0,a.jsx)("div",{className:"flex flex-col gap-0 rounded-lg border bg-muted/30",children:z.map(e=>{let t=rP(e,U,z),n=rg(z,e._id),s=rv(z,e._id);return(0,a.jsx)(ls,{canIndent:void 0!==n,canUnindent:null!==s,depth:e.depth,dropIndicatorDepth:t.depth,dropIndicatorPosition:t.position,focusCursorPosition:S,focusWithText:k,isNoteExpanded:f.includes(e._id),isProjectedParent:e._id===U?.parentId,onCreateBelow:t=>C(e._id,t,{parentId:e.parentId}),onDelete:()=>T(e._id),onDeleteAndFocusPrevious:()=>N(e._id),onFocused:w,onFocusInput:b,onIndent:void 0===n?void 0:()=>M(e._id,n),onMergeIntoPrevious:t=>D(e._id,t),onNoteExpandedChange:t=>x(p,e._id,t),onOpenDetail:()=>v((0,Z.assertId)(e._id)),onToggle:()=>O(e._id,!e.completed),onUnindent:null===s?void 0:()=>M(e._id,s??void 0),onUpdate:t=>L(e._id,t),onUpdateImages:t=>P(e._id,t),onUpdateNote:t=>A(e._id,t),shouldFocus:e._id===_,todo:e},e._id)})})}
1),(0,a.jsx)("div",{"aria-hidden":!0,className:"h-0 shrink-0 max-md:h-5",ref:j}),(0,a.jsx)(li,{activeItem:H})]});return u[8]!==l||u[9]!==o||u[10]!==Y||u[11]!==X?(c=(0,a.jsxs)("div",{className:"mt-6",children:[l,o,Y,X]}),u[8]=l,u[9]=o,u[10]=Y,u[11]=X,u[12]=c):c=u[12],c}function lJ(e){return e._id}let lZ=/_st_(backlog|todo|in_progress|in_review|blocked|complete|canceled)$/;function l0(e,t){let n=e.listId?t.byId.get(e.listId):void 0,a=n?.statusOptions?.find(t=>t.id===e.statusId);if(a)return a.group;let s=e.statusId?.match(lZ);return s?nB.STATUS_GROUPS.find(e=>e===s[1]):e.completed?"complete":"todo"}function l1(e){let t,n,r,l,o,d,c,u,m,p,h=(0,s.c)(47),{focus:f,group:x,todos:g,indicatorAtEnd:v,indicatorBeforeId:b,indicatorAfterId:y,isDestination:j,onCreateTask:I,showListChip:_}=e,S=`agg-status:${x}`;h[0]!==S?(t={id:S},h[0]=S,h[1]=t):t=h[1];let{setNodeRef:k}=(0,i.useDroppable)(t),w=(0,iP.useIsMobile)(),C=sU(I),T=nB.STATUS_GROUP_LABELS[x];h[2]!==C.cancel||h[3]!==C.commit||h[4]!==C.draftKey||h[5]!==C.isActive||h[6]!==C.setText||h[7]!==C.text||h[8]!==w?(n=C.isActive?(0,a.jsx)(iq,{autoFocus:!w,onCancel:C.cancel,onCommit:C.commit,onTextChange:C.setText,text:C.text},C.draftKey):null,h[2]=C.cancel,h[3]=C.commit,h[4]=C.draftKey,h[5]=C.isActive,h[6]=C.setText,h[7]=C.text,h[8]=w,h[9]=n):n=h[9];let N=n;h[10]!==C.placement||h[11]!==N?(r={card:N,placement:C.placement},h[10]=C.placement,h[11]=N,h[12]=r):r=h[12];let D=g.length;h[13]!==x?(l=nY(x),h[13]=x,h[14]=l):l=h[14];let L=I?C.start:void 0;h[15]!==T||h[16]!==l||h[17]!==L||h[18]!==g.length?(o=(0,a.jsx)(iz,{count:D,glyph:l,name:T,onAddTask:L}),h[15]=T,h[16]=l,h[17]=L,h[18]=g.length,h[19]=o):o=h[19];let A=j??!1,P=C.handleEmptySpaceDoubleClick;if(h[20]!==g?(d=g.map(l2),h[20]=g,h[21]=d):d=h[21],h[22]!==f||h[23]!==y||h[24]!==b||h[25]!==_||h[26]!==g){let e;h[28]!==f||h[29]!==y||h[30]!==b||h[31]!==_?(e=(e,t)=>{let n;return b===e._id?n="before":y===e._id&&(n="after"),(0,a.jsx)(iT,{interaction:iQ(f,{cardIndex:t,id:e._id}),showIndicator:n,showListChip:_,todo:e},e._id)},h[28]=f,h[29]=y,h[30]=b,h[31]=_,h[32]=e):e=h[32],c=g.map(e),h[22]=f,h[23]=y,h[24]=b,h[25]=_,h[26]=g,h[27]=c}else c=h[27];return h[33]!==v?(u=v?(0,a.jsx)(sK.BoardPlacementLine,{}):null,h[33]=v,h[34]=u):u=h[34],h[35]!==d||h[36]!==c||h[37]!==u?(m=(0,a.jsxs)(tE.SortableContext,{items:d,strategy:tE.verticalListSortingStrategy,children:[c,u]}),h[35]=d,h[36]=c,h[37]=u,h[38]=m):m=h[38],h[39]!==C.handleEmptySpaceDoubleClick||h[40]!==T||h[41]!==k||h[42]!==m||h[43]!==r||h[44]!==o||h[45]!==A?(p=(0,a.jsx)(iM,{draft:r,header:o,isOver:A,label:T,onEmptySpaceDoubleClick:P,ref:k,children:m}),h[39]=C.handleEmptySpaceDoubleClick,h[40]=T,h[41]=k,h[42]=m,h[43]=r,h[44]=o,h[45]=A,h[46]=p):p=h[46],p}function l2(e){return e._id}function l3(e){let t,n,o,d,c,u,m,p=(0,s.c)(25),{listIds:h,personalInbox:x,teamId:v}=e,{gate:b}=(0,f.useGuestGate)();if(p[0]!==b||p[1]!==v){let e=v?{teamId:v}:{};t=l.useQuery,n=r.api.todos.queries.getAll,o=b(e),p[0]=b,p[1]=v,p[2]=t,p[3]=n,p[4]=o}else t=p[2],n=p[3],o=p[4];let y=t(n,o),j=(0,l.useQuery)(r.api.todo_lists.queries.getAllAccessible,b({}))??[],I=(0,l.useMutation)(r.api.todos.reorder_mutations.reorderTodos).withOptimisticUpdate(l8),_=(0,l.useMutation)(r.api.todos.mutations.setStatus).withOptimisticUpdate(l7),S=(0,l.useMutation)(r.api.todos.mutations.toggle),w=(0,l.useMutation)(r.api.todos.mutations.create).withOptimisticUpdate(l6),C=(0,sR.useBoardSensors)(),{modifiers:T}=(0,g.useScaledDnd)(),N={byId:new Map(j.map(e=>[e._id,e]))},D=function(e,t,n){if(void 0===e)return[];if(n&&0===t.length)return e.filter(e=>void 0===e.listId);let a=new Set(t);return e.filter(e=>void 0!==e.listId&&a.has(e.listId))}(y,h,x),L=function(e,t){let n={backlog:[],blocked:[],canceled:[],complete:[],in_progress:[],in_review:[],todo:[]};for(let a of e)n[l0(a,t)??"todo"].push(function(e,t){let n=e.listId?t.byId.get(e.listId):void 0;return{_id:e._id,assignees:tZ(e),completed:e.completed,createdAt:e.createdAt,date:e.date,dueDate:e.dueDate,endTime:e.endTime,estimatedMinutes:e.estimatedMinutes,iconData:e.iconData,identifier:e.identifier,imageUrls:e.imageUrls,labels:e.labels,listId:e.listId,listName:n?.name,note:e.note,priority:e.priority,projectName:e.projectName,pullRequestCount:e.pullRequestCount,pullRequestNumber:e.pullRequestNumber,sortOrder:e.sortOrder,startTime:e.startTime,statusId:e.statusId,teamId:e.teamId,text:e.text,updatedAt:e.updatedAt}}(a,t));for(let e of nB.STATUS_GROUPS)n[e].sort((e,t)=>
1(e.sortOrder??0)-(t.sortOrder??0));return n}(D,N),A=iK(nB.STATUS_GROUPS.map(e=>L[e].map(l5))),P=iA({columnIdPrefix:"agg-status:",lookup:{statusByTodoId:function(e){let t=new Map;for(let n of nB.STATUS_GROUPS)for(let a of e[n])t.set(a._id,n);return t}(L),todosByStatus:L},onDrop:e=>{let{activeId:t,drop:n}=e;!function(e){if(e.activeId.includes("-"))return;let t=nB.STATUS_GROUPS.find(t=>t===e.drop.statusId),n=e.filtered.find(t=>t._id===e.activeId);if(!(n&&t))return;let a=nB.STATUS_GROUPS.find(e=>e===t);if(!a)return;let s=l0(n,e.lookup)!==t;if(!n.listId){s&&("todo"===t||"complete"===t)&&e.toggle({completed:"complete"===t,id:n._id}).catch(()=>e3.toast.error("The card did not move. Try again."));return}let i=e.lookup.byId.get(n.listId),r=i?.defaultOptionByGroup?.[a]??`${n.listId}_st_${a}`;if(s)return e.setStatus({id:n._id,statusId:r}).catch(()=>e3.toast.error("The card did not move. Try again."));let l=function(e){let t=e.columnCards.filter(t=>t.listId===e.listId).map(e=>e._id);if(e.isCrossGroup)return function(e,t,n){let a=e.length;if(n.beforeId){let t=e.indexOf((0,Z.assertId)(n.beforeId));-1!==t&&(a=t)}else if(n.afterId){let t=e.indexOf((0,Z.assertId)(n.afterId));-1!==t&&(a=t+1)}return[...e.slice(0,a),t,...e.slice(a)]}(t,e.activeId,e.drop);let n=t.indexOf(e.activeId);if(-1===n)return;let a=function(e,t,n){if(n.beforeId){let t=e.indexOf((0,Z.assertId)(n.beforeId));return -1===t?e.length-1:t}if(n.afterId){let a=e.indexOf((0,Z.assertId)(n.afterId));if(-1===a)return;return t<a?a:a+1}if(n.atEnd)return e.length-1}(t,n,e.drop);if(void 0!==a)return(0,tE.arrayMove)(t,n,a)}({activeId:n._id,columnCards:e.buckets[t],drop:e.drop,isCrossGroup:s,listId:n.listId});l&&e.reorderTodos({listId:n.listId,orderedIds:l}).catch(()=>e3.toast.error("The card did not move. Try again."))}({activeId:t,buckets:L,drop:n,filtered:D,lookup:N,reorderTodos:I,setStatus:_,toggle:S})}});if(void 0===y){let e;return p[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(iX,{}),p[5]=e):e=p[5],e}let O=P.activeId?nB.STATUS_GROUPS.flatMap(e=>L[e]).find(e=>e._id===P.activeId):void 0,E=i.DndContext;p[6]===Symbol.for("react.memo_cache_sentinel")?(d={threshold:{x:.15,y:.2}},p[6]=d):d=p[6];let M=P.handleDragCancel,R=P.handleDragEnd,z=P.handleDragOver,B=P.handleDragStart,U=A.clear,F=nB.STATUS_GROUPS.map((e,t)=>{let n=P.drop.statusId===e,s=L[e];return(0,a.jsx)(l1,{focus:A.lane(t),group:e,indicatorAfterId:n?P.drop.afterId:void 0,indicatorAtEnd:n&&P.drop.atEnd,indicatorBeforeId:n?P.drop.beforeId:void 0,isDestination:n,onCreateTask:t=>{let{placement:n,text:a}=t,{listId:i,statusId:r}=function(e){let[t]=e.listIds;if(!t)return{};let n=e.lookup.byId.get(t),a=n?.defaultOptionByGroup?.[e.group]??`${t}_st_${e.group}`;return{listId:t,statusId:a}}({group:e,listIds:h,lookup:N});(0,k.trackEvent)(k.ANALYTICS_EVENTS.todoCreated),w({listId:i,sortOrder:sB({placement:n,todos:s}),statusId:r,teamId:v,text:a}).then(t=>{if("complete"===e&&t?._id)return S({completed:!0,id:t._id})}).catch(l4)},showListChip:h.length>1,todos:s},e)});return p[7]!==sM||p[8]!==A.clear||p[9]!==F?(c=(0,a.jsx)(sM,{onClearSelection:U,children:F}),p[7]=sM,p[8]=A.clear,p[9]=F,p[10]=c):c=p[10],p[11]!==O?(u=(0,a.jsx)(iL,{activeTodo:O}),p[11]=O,p[12]=u):u=p[12],p[13]!==E||p[14]!==P.handleDragCancel||p[15]!==P.handleDragEnd||p[16]!==P.handleDragOver||p[17]!==P.handleDragStart||p[18]!==T||p[19]!==C||p[20]!==c||p[21]!==u||p[22]!==d||p[23]!==sq?(m=(0,a.jsxs)(E,{autoScroll:d,collisionDetection:sq,modifiers:T,onDragCancel:M,onDragEnd:R,onDragOver:z,onDragStart:B,sensors:C,children:[c,u]}),p[13]=E,p[14]=P.handleDragCancel,p[15]=P.handleDragEnd,p[16]=P.handleDragOver,p[17]=P.handleDragStart,p[18]=T,p[19]=C,p[20]=c,p[21]=u,p[22]=d,p[23]=sq,p[24]=m):m=p[24],m}function l4(){}function l5(e){return e._id}function l6(e,t){let n=Date.now(),a={_creationTime:n,_id:(0,Z.assertId)(crypto.randomUUID()),completed:!1,createdAt:n,listId:t.listId,sortOrder:t.sortOrder??n,statusId:t.statusId,teamId:t.teamId,text:t.text,updatedAt:n};for(let{args:n,value:s}of e.getAllQueries(r.api.todos.queries.getAll))void 0!==s&&n.teamId===t.teamId&&e.setQuery(r.api.todos.queries.getAll,n,[...s,a])}function l7(e,t){let n=(e.getQuery(r.api.todo_lists.queries.getAllAccessible,{})??[]).find(e=>e.statusOptions?.some(e=>e.id===t.statusId)),a=n?.statusOptions?.find(e=>e.id===t.statusId)?.group;(0,ee.applyTodoStatusChange)(e,{completed:(0,ee.deriveCompletedFromGroup)(a),statusId:t.statusId,todoId:t.id})}function l8(e,t){(0,ee.applyTodoReorder)(e,{orderedIds:t.orderedIds})}function l9(e){let t,n,i=(0,s.c)(22),{currentParentListId:r,kanbanEnabled:l,listIds:o,teamId:d}=e;if(null!=r){let e,t;if(l){let e,t=d??void 0;return i[0]!==o||i[1]!==t?(e=(0,a.jsx)(l3,{listIds:o,teamId:t}),i[0]=o,i[1]=t,i[2]=e):e=i[2],e}let n=`parent-list:${r}`,s=d??void 0;return i[3]!==o||i[4]!==s?(e={listIds:o,teamId:s},i[3]=o,i[4]=s,i[5]=e):e=i[5],i[6]!==n||i[7]!==e?(t=(0,a.jsx)(lX,{noteExpansionKey:n,optimisticTodosArgs:e}
1),i[6]=n,i[7]=e,i[8]=t):t=i[8],t}if(null==d){let e;if(l){let e,t=0===o.length;return i[9]!==o||i[10]!==t?(e=(0,a.jsx)(l3,{listIds:o,personalInbox:t}),i[9]=o,i[10]=t,i[11]=e):e=i[11],e}return i[12]!==o?(e=(0,a.jsx)(lX,{noteExpansionKey:"personal-inbox",optimisticTodosArgs:o.length>0?{listIds:o,teamId:void 0}:{personalInbox:!0}}),i[12]=o,i[13]=e):e=i[13],e}if(l){let e,t;return i[14]===Symbol.for("react.memo_cache_sentinel")?(e=[],i[14]=e):e=i[14],i[15]!==d?(t=(0,a.jsx)(l3,{listIds:e,personalInbox:!0,teamId:d}),i[15]=d,i[16]=t):t=i[16],t}let c=`team-inbox:${d}`;return i[17]!==d?(t={personalInbox:!0,teamId:d},i[17]=d,i[18]=t):t=i[18],i[19]!==c||i[20]!==t?(n=(0,a.jsx)(lX,{noteExpansionKey:c,optimisticTodosArgs:t}),i[19]=c,i[20]=t,i[21]=n):n=i[21],n}var oe=e.i(1736);function ot(e,t){let n=e.getQuery(r.api.teams.queries.getAll,{});n&&e.setQuery(r.api.teams.queries.getAll,{},n.map(e=>e._id===t.teamId?{...e,kanbanEnabled:t.enabled}:e))}function on(e,t){let n=(0,ee.buildListUpdatePatch)(t);(0,ee.applyListPatchToQueries)(e,t.id,n)}function oa(){let e,t,n,i,o,d,c,u,p,h,x,g,b,j,I,_,S,k,w,C,N,L,A,P,O,E=(0,s.c)(118),{currentParentListId:M,teamId:R,editingListId:z,editingListName:B,setEditingListId:U,setEditingListName:F,selectListAction:G,selectParentList:q,lists:$,listsLoading:K,teamParentLists:Q,allParentLists:V,teamsForMove:W,deleteTarget:H,setDeleteTarget:Y,deleteParentListTarget:X,setDeleteParentListTarget:Z,handleCreateList:ee,handleSaveListName:et,handleDeleteList:en,handleMoveToParentList:ea,handleMoveToSpace:es,handleCreateParentListForMove:ei,handleCreateParentListForTeam:er,handleDuplicateList:el,handleDeleteParentListComplete:eo,listIdsForTasks:ed}=(()=>{let{gate:e}=(0,f.useGuestGate)(),{runGuestWrite:t}=(0,oe.useGuestFirstWrite)(),n=(0,J.useCurrentParentListId)(),a=(0,J.useTeamId)(),{myTasksListId:s}=(0,D.useMyTasksListId)(),{rootLists:i}=(0,y.useFeatureLimits)(),o=(0,v.useOnOpenApp)(),d=!i.canCreate,c=(0,J.useSelectList)(),u=(0,J.useSetEditingListId)(),p=(0,J.useEditingListId)(),h=(0,J.useSelectParentList)(),x=(0,J.useSelectMyTasks)(),g=(0,J.useSelectTeam)(),b=null==n&&null==a,j={};null!=n?j={parentId:n}:null!=a?j={teamId:a}:null!=s&&(j={parentId:s});let{lists:I,isLoading:_,updateList:S,deleteList:k,moveList:w}=(0,ek.useTodoListsWithCounts)(j),C=(0,l.useMutation)(r.api.todo_lists.mutations.create),T=(0,l.useMutation)(r.api.todo_lists.mutations.duplicateList),N=(0,l.useQuery)(r.api.todo_lists.queries.getAll,a?e({teamId:a}):"skip")??[],L=(0,l.useQuery)(r.api.todo_lists.queries.getAllAccessible,e({}))??[],A=((0,l.useQuery)(r.api.teams.queries.getAll,e({}))??[]).filter(e=>null!=e),[P,O]=(0,m.useState)(""),[E,M]=(0,m.useState)(null),[R,z]=(0,m.useState)(null),B=async()=>{let e=n??(b?s??void 0:void 0);null==e&&null==a&&d?eS(()=>o?.("settings",{activeTab:"billing"})):await t(async()=>{try{let t=await C({name:"New list",parentId:e,teamId:a??void 0,iconData:(0,eI.toConvexIconData)(ex)});t?._id&&c(t._id,t.parentId,t.teamId,t.name,t.iconData)}catch{e3.toast.error("Couldn't create list.")}})},U=async e=>{let t=P.trim();t&&await S({id:e,name:t}),u(null),O("")},F=async()=>{E&&(await k({id:E.id}),M(null))},G=async(e,t,n)=>{try{await w({id:e,parentId:n});let a=void 0===n?"My Tasks":L.find(e=>e._id===n)?.name??"List";e3.toast.success(`Moved "${t}" to "${a}"`)}catch(e){e3.toast.error(e instanceof Error?e.message:"Failed to move list")}},q=async(e,t,n)=>{try{await w({id:e,teamId:n});let a=A.find(e=>e._id===n)?.name??"Space";e3.toast.success(`Moved "${t}" to "${a}"`)}catch(e){e3.toast.error(e instanceof Error?e.message:"Failed to move list")}},$=async()=>{if(null==a&&d)return void eS(()=>o?.("settings",{activeTab:"billing"}));let e=await C({name:"New list",teamId:a??void 0,iconData:(0,eI.toConvexIconData)(ex)});return e?._id},K=async e=>{try{let t=await T({id:e});t&&(c(t._id,t.parentId,t.teamId,t.name,t.iconData),e3.toast.success("List duplicated"))}catch(e){e3.toast.error(e instanceof Error?e.message:"Failed to duplicate list")}},Q=async()=>{if(!a)return;let e=await C({name:"New list",teamId:a,iconData:(0,eI.toConvexIconData)(ex)});e?._id&&h(e._id,a)},V=b&&s?[s]:b?[]:n?[n]:I.map(e=>e._id);return{currentParentListId:n,isMyTasksView:b,listIdsForTasks:V,myTasksListId:s,teamId:a,editingListId:p,editingListName:P,setEditingListId:u,setEditingListName:O,selectParentList:h,selectListAction:c,lists:I,listsLoading:_,teamParentLists:N,allParentLists:L,teamsForMove:A,deleteTarget:E,setDeleteTarget:M,deleteParentListTarget:R,setDeleteParentListTarget:z,handleCreateList:B,handleSaveListName:U,handleDeleteList:F,handleMoveToParentList:G,handleMoveToSpace:q,handleCreateParentListForMove:$,handleCreateParentListForTeam:Q,handleDuplicateList:K,handleDeleteParentListComplete:()=>{a?g(a):x()}}})(),{currentParentList:ec,displayParentListName:eu}=function(e){let t,n,a,i,o,d,c=(0,s.c)(25),{gate:u,isGuest:p}=(0,f.useGuestGate)();c[0]!==e||c[1]!==u||c[2]!==p?(t=e&&!p?u({id:e}):"skip",c[0]=e,c[1]=u,c[2]=p,c[3]=t):t=c[3];let h=(0,l.useQuery)(r.api.todo_lists.queries.getById,t),x=h?.name??null,g=null!=e&&null!=h,[v,b]=(0,m.useState)(null),[y,j]=(0,m.useState)(""),[I,_]=(0,m.useState)(null),S=(0,l.useMutation)(r.api.todo_lists.mutations.update),k=null!==I&&null!==x&&x!==I?I:x,w=null!=v&&v===e;c[4]!==e||c[5]!==k?(n=()=>{e&&k&&(b(e),j(k))},c[4]=e,c[5]=k,c[6]=n):n=c[6];let C=n;c[7]!==v||c[8]!==y||c[9]!==S?(a=async()=>
1{if(!v)return;let e=y.trim();e&&(_(e),await S({id:v,name:e})),b(null),j("")},c[7]=v,c[8]=y,c[9]=S,c[10]=a):a=c[10];let T=a;return c[11]!==x||c[12]!==I?(i=()=>{null!==I&&x===I&&_(null)},o=[I,x],c[11]=x,c[12]=I,c[13]=i,c[14]=o):(i=c[13],o=c[14]),(0,m.useEffect)(i,o),c[15]!==g||c[16]!==h||c[17]!==x||c[18]!==k||c[19]!==v||c[20]!==y||c[21]!==T||c[22]!==C||c[23]!==w?(d={currentParentList:h,currentParentListName:x,displayParentListName:k,canRenameParentList:g,editingParentListId:v,editingParentListName:y,isEditingCurrentParentList:w,handleStartEditParentList:C,handleSaveParentListName:T,setEditingParentListId:b,setEditingParentListName:j},c[15]=g,c[16]=h,c[17]=x,c[18]=k,c[19]=v,c[20]=y,c[21]=T,c[22]=C,c[23]=w,c[24]=d):d=c[24],d}(M),{label:em}=T(),{myTasksListId:ep,ensure:eh}=(0,D.useMyTasksListId)(),{gate:ef,isGuest:eg}=(0,f.useGuestGate)();E[0]!==ef||E[1]!==eg||E[2]!==ep?(e=ep&&!eg?ef({id:ep}):"skip",E[0]=ef,E[1]=eg,E[2]=ep,E[3]=e):e=E[3];let ev=(0,l.useQuery)(r.api.todo_lists.queries.getById,e);E[4]!==eh||E[5]!==ep?(t=function(){null==ep&&eh().catch(os)},n=[ep,eh],E[4]=eh,E[5]=ep,E[6]=t,E[7]=n):(t=E[6],n=E[7]),(0,m.useEffect)(t,n),E[8]!==V||E[9]!==ec||E[10]!==M?(i=null==M?null:V.find(e=>e._id===M)??ec,E[8]=V,E[9]=ec,E[10]=M,E[11]=i):i=E[11];let eb=i;E[12]!==M||E[13]!==eb?(o={currentParentListId:M,parentListForDisplay:eb},E[12]=M,E[13]=eb,E[14]=o):o=E[14];let{handleParentListIconChange:ey,handleRenameParentList:ej}=function(e){let t,n,a,i,o=(0,s.c)(13),{currentParentListId:d,parentListForDisplay:c}=e,u=(0,l.useMutation)(r.api.todo_lists.mutations.update);o[0]!==u?(t=u.withOptimisticUpdate(on),o[0]=u,o[1]=t):t=o[1];let m=t;o[2]!==d||o[3]!==c||o[4]!==m?(n=async e=>{d&&c?.name&&await m({id:d,name:c.name,iconData:void 0===e?null:(0,eI.toConvexIconData)(e)})},o[2]=d,o[3]=c,o[4]=m,o[5]=n):n=o[5];let p=n;o[6]!==d||o[7]!==c||o[8]!==m?(a=async e=>{d&&c&&await m({id:d,name:e,iconData:c.iconData??null})},o[6]=d,o[7]=c,o[8]=m,o[9]=a):a=o[9];let h=a;return o[10]!==p||o[11]!==h?(i={handleParentListIconChange:p,handleRenameParentList:h},o[10]=p,o[11]=h,o[12]=i):i=o[12],i}(o);E[15]!==M||E[16]!==ey||E[17]!==ej||E[18]!==eb?(d=M&&eb?{...(0,lu.isIconValue)(eb.iconData)&&{iconData:eb.iconData},kind:"list",listId:M,onIconChange:ey,onRename:ej,title:eb.name}:void 0,E[15]=M,E[16]=ey,E[17]=ej,E[18]=eb,E[19]=d):d=E[19];let e_=d,ew=null==M&&null==R,eC=null!=R&&null==M;E[20]!==M||E[21]!==ew||E[22]!==R?(c={currentParentListId:M,isMyTasksView:ew,teamId:R},E[20]=M,E[21]=ew,E[22]=R,E[23]=c):c=E[23];let{kanbanEnabled:eT,onToggleKanban:eN}=function(e){let t,n=(0,s.c)(12),{currentParentListId:a,isMyTasksView:i,teamId:o}=e,{gate:d}=(0,f.useGuestGate)(),c=(0,J.useInboxKanbanEnabled)(),u=(0,J.useSetInboxKanbanEnabled)(),m=tC(a),p=tT(a),h=function(e){let t,n,a=(0,s.c)(5),i=(0,l.useMutation)(r.api.teams.mutations.setKanbanEnabled);a[0]!==i?(t=i.withOptimisticUpdate(ot),a[0]=i,a[1]=t):t=a[1];let o=t;if(e)return a[2]!==o||a[3]!==e?(n=t=>{o({teamId:e,enabled:t}).catch(console.error)},a[2]=o,a[3]=e,a[4]=n):n=a[4],n}(o),x=(0,l.useQuery)(r.api.teams.queries.getAll,d({}))??[];if(i){let e;return n[0]!==c||n[1]!==u?(e={kanbanEnabled:c,onToggleKanban:u},n[0]=c,n[1]=u,n[2]=e):e=n[2],e}if(null===a&&null!==o){let e,t;n[3]!==o||n[4]!==x?(e=x.find(e=>e._id===o)?.kanbanEnabled,n[3]=o,n[4]=x,n[5]=e):e=n[5];let a=!0===e;return n[6]!==h||n[7]!==a?(t={kanbanEnabled:a,onToggleKanban:h},n[6]=h,n[7]=a,n[8]=t):t=n[8],t}let g=p?.setKanbanEnabled;return n[9]!==m.kanbanEnabled||n[10]!==g?(t={kanbanEnabled:m.kanbanEnabled,onToggleKanban:g},n[9]=m.kanbanEnabled,n[10]=g,n[11]=t):t=n[11],t}(c),eD=`dashboard:${R??""}:${M??"my-tasks"}`,eL=tO(eD);E[24]!==M||E[25]!==R?(u=function({currentParentListId:e,teamId:t}){return e?`parent:${e}`:t?`space:${t}`:"my-tasks"}({currentParentListId:M,teamId:R}),E[24]=M,E[25]=R,E[26]=u):u=E[26];let eA=function(e){let t,n,a,i,o,d=(0,s.c)(18),{gate:c,isGuest:u}=(0,f.useGuestGate)();d[0]!==c||d[1]!==u?(t=u?"skip":c({}),d[0]=c,d[1]=u,d[2]=t):t=d[2];let p=(0,l.useQuery)(r.api.preferences.queries.getCollapsedListSections,t),h=(0,l.useMutation)(r.api.preferences.mutations.setListSectionCollapsed);d[3]!==h?(n=h.withOptimisticUpdate(lh),d[3]=h,d[4]=n):n=d[4];let x=n,[g,v]=(0,m.useState)(!1);if(u){let e,t;return d[5]===Symbol.for("react.memo_cache_sentinel")?(e=()=>v(lp),d[5]=e):e=d[5],d[6]!==g?(t={isCollapsed:g,toggle:e},d[6]=g,d[7]=t):t=d[7],t}d[8]!==p||d[9]!==e?(a=p?.includes(e)??!1,d[8]=p,d[9]=e,d[10]=a):a=d[10];let b=a;return d[11]!==b||d[12]!==e||d[13]!==x?(i=()=>{x({collapsed:!b,sectionKey:e}).catch(lm)},d[11]=b,d[12]=e,d[13]=x,d[14]=i):i=d[14],d[15]!==b||d[16]!==i?(o={isCollapsed:b,toggle:i},d[15]=b,d[16]=i,d[17]=o):o=d[17],o}(u);E[27]!==e_?(p=(0,a.jsx)(lM,{current:e_}),E[27]=e_,E[28]=p):p=E[28];let eP=p;E[29]!==V||E[30]!==ei||E[31]!==G||E[32]!==W?(h={allParentLists:V,onCreateParentList:ei,onSelectList:G,teams:W},E[29]=V,E[30]=ei,E[31]=G,E[32]=W,E[33]=h):h=E[33];let eO=h,{isPublic:eE,toggleVisibility:eM}=nf(ew?null:M),[eR,ez]=(0,m.useState)(!1),eB=(0,to.useTogglePublic)(),eU=null!=M;E[34]!==eE||E[35]!==eM||E[36]!==eB?(x=()=>eB({isPublic:eE,kind:"list",toggle:eM}),E[34]=eE,E[35]=eM,E[36]=eB,E[37]=x):x=E[37];let eF=ec?.name,eG=eC?R:null;E[38]!==M||E[39]!==eu||E[40]!==eP||E[41]!==ew||E[42]!==eE||E[43]!==eT||E[44]!==eN||E[45]!==eR||E[46]!==Z||E[47]!==eU||E[48]!==x||E[49]!==eF||E[50]!==eG?(g={canDeleteParentList:eU,currentParentListId:M,displayParentListName:eu,headerTitle:eP,isListPublic:eE,isMyTasksView:ew,kanbanEnabled:eT,onDeleteParentList:Z,onShareOpenChange:ez,onToggleKanban:eN,onToggleListVisibility:x,parentListName:eF,shareOpen:eR,spaceRootTeamId:eG},E[38]=M,E[39]=eu,E[40]=eP,E[41]=ew,E[42]=eE,E[43]=eT,E[44]=eN,E[45]=eR,E[46]=Z,E[47]=eU,E[48]=x,E[49]=eF,E[50]=eG,E[51]=g):g=E[51];let eq=g;E[52]!==V||E[53]!==z||E[54]!==B||E[55]!==ei||E[56]!==el||E[57]!==ea||E[58]!==es||E[59]!==et||E[60]!==G||E[61]!==Y||E[62]!==U||E[63]!==F||E[64]!==W?(b=e=>({allParentLists:V,currentParentId:e.parentId,editingName:B,isEditing:z===e._id,list:e,onCancelEdit:()=>{U(null),F("")},onCreateParentList:ei,onDelete:()=>Y({id:e._id,name:e.name}),onDuplicate:()=>el(e._id),onEditingNameChange:F,onMoveToParentList:t=>ea(e._id,e.name,t),onMoveToSpace:t=>es(e._id,e.name,t),onSaveEdit:()=>et(e._id),onSelect:()=>G(e._id,e.parentId,e.teamId,e.name,e.iconData),onStartEdit:()=>{U(e._id),F(e.name)},teams:W}),E[52]=V,E[53]=z,E[54]=B,E[55]=ei,E[56]=el,E[57]=ea,E[58]=es,E[59]=et,E[60]=G,E[61]=Y,E[62]=U,E[63]=F,E[64]=W,E[65]=b):b=E[65];let e$=b;E[66]!==ew||E[67]!==em||E[68]!==ev||E[69]!==ep?(j=function({isMyTasksView:e,myTasksLabel:t,myTasksList:n,myTasksListId:s}){return e&&s?(0,a.jsx)(lY,{iconData:(0,lu.isIconValue)(n?.iconData)?n.iconData:void 0,isMyTasks:!0,listId:s,title:t}):null}({isMyTasksView:ew,myTasksLabel:em,myTasksList:ev,myTasksListId:ep}),E[66]=ew,E[67]=em,E[68]=ev,E[69]=ep,E[70]=j):j=E[70];let eK=j;E[71]!==eO||E[72]!==ee||E[73]!==er||E[74]!==eC||E[75]!==e$||E[76]!==$||E[77]!==K||E[78]!==q||E[79]!==Q?(I=eC?{content:{kind:"lists",onSelectParentList:e=>q(e._id,e.teamId),parentLists:Q},onCreate:er}:{content:{contextMenuConfig:eO,kind:"sub-lists",listItemProps:e$,lists:$,listsLoading:K},onCreate:ee},E[71]=eO,E[72]=ee,E[73]=er,E[74]=eC,E[75]=e$,E[76]=$,E[77]=K,E[78]=q,E[79]=Q,E[80]=I):I=E[80];let eQ=I,eV=`${eD}:${eQ.content.kind}`;E[81]!==eA||E[82]!==eQ||E[83]!==eV?(_=(0,a.jsx)(lE,{collapse:eA,section:eQ}
1,eV),E[81]=eA,E[82]=eQ,E[83]=eV,E[84]=_):_=E[84],E[85]!==eK||E[86]!==_?(S=(0,a.jsxs)(a.Fragment,{children:[eK,_]}),E[85]=eK,E[86]=_,E[87]=S):S=E[87];let eW=S;E[88]!==M||E[89]!==eT||E[90]!==ed||E[91]!==R?(k=(0,a.jsx)(l9,{currentParentListId:M,kanbanEnabled:eT,listIds:ed,teamId:R}),E[88]=M,E[89]=eT,E[90]=ed,E[91]=R,E[92]=k):k=E[92];let eH=k;return E[93]!==eq?(w=(0,a.jsx)(lQ,{...eq}),E[93]=eq,E[94]=w):w=E[94],E[95]!==eT||E[96]!==eW||E[97]!==eL||E[98]!==eH?(C=eT?(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,a.jsx)("div",{className:"shrink-0 px-3 pt-2",children:eW}),eH]}):(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto overscroll-contain px-3 pt-2 pb-8",ref:eL,children:[eW,eH]})}),E[95]=eT,E[96]=eW,E[97]=eL,E[98]=eH,E[99]=C):C=E[99],E[100]!==Y?(N=()=>Y(null),E[100]=Y,E[101]=N):N=E[101],E[102]!==H||E[103]!==en||E[104]!==N?(L=(0,a.jsx)(lV,{onClose:N,onDelete:en,target:H}),E[102]=H,E[103]=en,E[104]=N,E[105]=L):L=E[105],E[106]!==Z?(A=()=>Z(null),E[106]=Z,E[107]=A):A=E[107],E[108]!==X||E[109]!==eo||E[110]!==$.length||E[111]!==A?(P=(0,a.jsx)(lH,{listCount:$.length,onClose:A,onDeleted:eo,target:X}),E[108]=X,E[109]=eo,E[110]=$.length,E[111]=A,E[112]=P):P=E[112],E[113]!==w||E[114]!==C||E[115]!==L||E[116]!==P?(O=(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[w,C,L,P]}),E[113]=w,E[114]=C,E[115]=L,E[116]=P,E[117]=O):O=E[117],O}function os(){}var oi=e.i(65725);function or(e,t){oo(e,t.id,{completed:t.completed})}function ol(e,t){(0,ee.applyTodoUpdate)(e,t),oo(e,t.id,t)}function oo(e,t,n){let a=e.getQuery(r.api.todos.queries.getById,{id:t});if(!a)return;let{iconData:s,priority:i,...l}=n;e.setQuery(r.api.todos.queries.getById,{id:t},{...a,...l,...void 0!==s&&{iconData:s??void 0},...void 0!==i&&{priority:i??void 0},updatedAt:Date.now()})}var od=e.i(94021),oc=e.i(950248);let ou=new Map([["assigned","Changed the assignee"],["completed","Completed the task"],["created","Created this task"],["linked","Linked work to the task"],["moved","Moved the task"],["status_changed","Changed the status"],["unassigned","Changed the assignee"],["unlinked","Removed a link"]]),om=[70,55,62];function op(e){let t,n,i,o,c,u,m,p,h,f=(0,s.c)(24),{createdAt:x,taskId:g}=e;f[0]!==g?(t={sourceObjectId:g},f[0]=g,f[1]=t):t=f[1];let v=(0,l.useQuery)(r.api.feed.item_queries.getForSource,t);if(void 0===v){let e,t;return f[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.Text,{variant:"overline",children:"Activity"}),f[2]=e):e=f[2],f[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e,(0,a.jsx)("div",{className:"flex flex-col gap-1",children:om.map(ox)})]}),f[3]=t):t=f[3],t}f[4]!==v?(n=v.find(of)??v.at(-1),f[4]=v,f[5]=n):n=f[5];let b=n;if(f[6]!==v||f[7]!==x){var y;i=void 0!==(y={earliestEventAt:v.at(-1)?.createdAt,taskCreatedAt:x}).taskCreatedAt&&(void 0===y.earliestEventAt||y.taskCreatedAt<y.earliestEventAt),f[6]=v,f[7]=x,f[8]=i}else i=f[8];let j=i;return f[9]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsx)(d.Text,{variant:"overline",children:"Activity"}),f[9]=o):o=f[9],f[10]!==v.length||f[11]!==j?(c=0!==v.length||j?null:(0,a.jsx)(d.Text,{variant:"caption",children:"No activity yet"}),f[10]=v.length,f[11]=j,f[12]=c):c=f[12],f[13]!==v?(u=v.length>0?(0,a.jsx)("div",{className:"flex flex-col gap-1",children:v.map(oh)}):null,f[13]=v,f[14]=u):u=f[14],f[15]!==j?(m=j?(0,a.jsx)(d.Text,{variant:"caption",children:"History begins today"}):null,f[15]=j,f[16]=m):m=f[16],f[17]!==b?(p=b?(0,a.jsx)(od.CommentSection,{commentCount:b.commentCount,itemId:b._id}):null,f[17]=b,f[18]=p):p=f[18],f[19]!==c||f[20]!==u||f[21]!==m||f[22]!==p?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[o,c,u,m,p]}),f[19]=c,f[20]=u,f[21]=m,f[22]=p,f[23]=h):h=f[23],h}function oh(e){return(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)(d.Text,{variant:"bodySmall",children:function(e){let t=ou.get(e);if(t)return t;let n=e.replaceAll("_"," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):"Updated the task"}(e.eventType??"updated")}),(0,a.jsx)(d.Text,{variant:"caption",children:(0,oc.formatRelativeTime)(e.createdAt)})]},e._id)}function of(e){return"created"===e.eventType}function ox(e){return(0,a.jsx)(iH.Skeleton,{className:"h-3.5",style:{width:`${e}%`}},e)}
1var og=e.i(600567),ov=e.i(626209),ob=e.i(882912);let oy=(0,m.createContext)(null);function oj(e){return Array.from(e.dataTransfer?.types??[]).includes("Files")}function oI(e){let t,n,i,o,d,c,u,p,h=(0,s.c)(19),{children:f,className:x,taskId:g}=e,v=sZ(),{pending:b,upload:y}=function(e){let t=(0,l.useMutation)(r.api.files.uploads.generateUploadUrl),n=(0,l.useMutation)(r.api.task_attachments.mutations.add),[a,s]=(0,m.useState)([]),i=(0,m.useCallback)(async a=>{if(a.size>og.MAX_FILE_UPLOAD_BYTES)return void e3.toast.error(`${a.name} is larger than the 500 MB per-file limit`);let i=crypto.randomUUID();s(e=>[...e,{id:i,name:a.name,progress:0}]);try{let r=await (0,ob.uploadBytesWithRetry)(a,(0,ov.resolveUploadMimeType)(a),()=>t(),e=>s(t=>t.map(t=>t.id===i?{...t,progress:e}:t)));await n({name:a.name,storageId:r,taskId:e})}catch(e){e3.toast.error((0,ov.uploadRejectionMessage)(e)??`Couldn't attach ${a.name}`)}finally{s(e=>e.filter(e=>e.id!==i))}},[n,t,e]);return{pending:a,upload:(0,m.useCallback)(async e=>{await Promise.all(e.map(i))},[i])}}(g),[j,I]=(0,m.useState)(!1),_=(0,m.useRef)(0);h[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{oj(e)&&(e.preventDefault(),_.current=_.current+1,I(!0))},h[0]=t):t=h[0];let S=t;h[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{oj(e)&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",I(!0))},h[1]=n):n=h[1];let k=n;h[2]===Symbol.for("react.memo_cache_sentinel")?(i=e=>{oj(e)&&(_.current=Math.max(0,_.current-1),0===_.current&&I(!1))},h[2]=i):i=h[2];let w=i;h[3]!==y?(o=e=>{if(!oj(e))return;e.preventDefault(),_.current=0,I(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&y(t)},h[3]=y,h[4]=o):o=h[4];let C=o;return h[5]!==j||h[6]!==b||h[7]!==y?(d={dragActive:j,pending:b,upload:y},h[5]=j,h[6]=b,h[7]=y,h[8]=d):d=h[8],h[9]!==v||h[10]!==C?(c=v&&{onDragEnter:S,onDragLeave:w,onDragOver:k,onDrop:C},h[9]=v,h[10]=C,h[11]=c):c=h[11],h[12]!==f||h[13]!==x||h[14]!==c?(u=(0,a.jsx)("div",{className:x,...c,children:f}),h[12]=f,h[13]=x,h[14]=c,h[15]=u):u=h[15],h[16]!==d||h[17]!==u?(p=(0,a.jsx)(oy.Provider,{value:d,children:u}),h[16]=d,h[17]=u,h[18]=p):p=h[18],p}var o_=e.i(52084);function oS(e){let t,n,i,c,u,p,h,f,x=(0,s.c)(24),{taskId:g}=e;x[0]!==g?(t={taskId:g},x[0]=g,x[1]=t):t=x[1];let v=(0,l.useQuery)(r.api.task_attachments.queries.listForTask,t),b=sZ(),{dragActive:y,pending:j,upload:I}=function(){let e=(0,m.useContext)(oy);if(!e)throw Error("useTaskAttachmentDrop needs a TaskAttachmentDropArea");return e}(),_=(0,m.useRef)(null),k=(0,m.useId)();return x[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(d.Text,{variant:"overline",children:"Attachments"}),x[2]=n):n=x[2],x[3]!==v?(i=void 0===v?(0,a.jsx)(iH.Skeleton,{className:"h-8 w-full"}):null,x[3]=v,x[4]=i):i=x[4],x[5]!==v?.length||x[6]!==j.length?(c=v?.length===0&&0===j.length?(0,a.jsx)(d.Text,{variant:"caption",children:"No files attached"}):null,x[5]=v?.length,x[6]=j.length,x[7]=c):c=x[7],x[8]!==v||x[9]!==b?(u=v?.map(e=>(0,a.jsx)(ow,{attachment:e,canEdit:b},e._id)),x[8]=v,x[9]=b,x[10]=u):u=x[10],x[11]!==j?(p=j.map(ok),x[11]=j,x[12]=p):p=x[12],x[13]!==b||x[14]!==y||x[15]!==k||x[16]!==I?(h=b?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{"aria-hidden":!0,className:"sr-only",multiple:!0,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value="",t.length>0&&I(t)},ref:_,tabIndex:-1,type:"file"}),(0,a.jsx)("span",{className:"sr-only",id:k,children:"Or drop a file anywhere on the task"}),(0,a.jsxs)(o.Button,{"aria-describedby":k,className:"w-full","data-drop-active":y,onClick:()=>_.current?.click(),size:"sm",variant:"dashed",children:[(0,a.jsx)(S.Paperclip,{}),y?"Drop to attach":"Add file"]})]}):null,x[13]=b,x[14]=y,x[15]=k,x[16]=I,x[17]=h):h=x[17],x[18]!==i||x[19]!==c||x[20]!==u||x[21]!==p||x[22]!==h?(f=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[n,i,c,u,p,h]}),x[18]=i,x[19]=c,x[20]=u,x[21]=p,x[22]=h,x[23]=f):f=x[23],f}function ok(e){return(0,a.jsx)(oN,{entry:e},e.id)}function ow(e){let t,n,i,c,u,p=(0,s.c)(19),{attachment:h,canEdit:f}=e,[x,g]=(0,m.useState)(!1),v=(0,l.useMutation)(r.api.task_attachments.mutations.rename),b=(0,l.useMutation)(r.api.task_attachments.mutations.remove);p[0]!==h._id||p[1]!==h.name||p[2]!==v?(t=e=>{g(!1);let t=e.trim();t&&t!==h.name&&v({attachmentId:h._id,name:t}).catch(oT)},p[0]=h._id,p[1]=h.name,p[2]=v,p[3]=t):t=p[3];let y=t;return p[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(S.Paperclip,{}),p[4]=n):n=p[4],p[5]!==h.name||p[6]!==h.size||p[7]!==h.url||p[8]!==y||p[9]!==x?(i=x?(0,a.jsx)(ey.Input,{"aria-label":"File name",autoFocus:!0,defaultValue:h.name,onBlur:e=>y(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key?e.currentTarget.blur():"Escape"===e.key&&g(!1)}}):(0,a.jsxs)(o.Button,{className:"min-w-0 flex-1 justify-start",disabled:!h.url,nativeButton:!1,render:(0,a.jsx)("a",{download:h.name,href:h.url??void 0,rel:"noopener noreferrer",target:"_blank"}),variant:"ghost",children:[(0,a.jsx)(d.Text,{as:"span",className:"truncate",variant:"bodySmall",children:h.name}),(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:(0,o_.formatBytes)(h.size)})]}),p[5]=h.name,p[6]=h.size,p[7]=h.url,p[8]=y,p[9]=x,p[10]=i):i=p[10],p[11]!==h._id||p[12]!==h.name||p[13]!==f||p[14]!==b?(c=f?(0,a.jsxs)(nJ.RowOptionsMenu,{name:h.name,children:[(0,a.jsx)(eu.DropdownMenuItem,{onClick:()=>g(!0),children:"Rename"}),(0,a.jsx)(eu.DropdownMenuItem,{onClick:()=>b({attachmentId:h._id}).catch(oC),children:"Remove"})]}):null,p[11]=h._id,p[12]=h.name,p[13]=f,p[14]=b,p[15]=c):c=p[15],p[16]!==i||p[17]!==c?(u=(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n,i,c]}),p[16]=i,p[17]=c,p[18]=u):u=p[18],u}function oC(){return e3.toast.error("Couldn't remove the file")}function oT(){return e3.toast.error("Couldn't rename the file")}function oN(e){let t,n,i,r,l,o=(0,s.c)(11),{entry:c}=e;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(iH.Skeleton,{className:"size-4"}),o[0]=t):t=o[0],o[1]!==c.name?(n=(0,a.jsx)(d.Text,{as:"span",className:"truncate",variant:"caption",children:c.name}),o[1]=c.name,o[2]=n):n=o[2];let u=`Uploading ${c.name}`;return o[3]!==c.progress?(i=Math.round(100*c.progress),o[3]=c.progress,o[4]=i):i=o[4],o[5]!==u||o[6]!==i?(r=(0,a.jsx)(l_.Progress,{"aria-label":u,value:i}),o[5]=u,o[6]=i,o[7]=r):r=o[7],o[8]!==n||o[9]!==r?(l=(0,a.jsxs)("div",{"aria-busy":!0,className:"flex items-center gap-2",children:[t,(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[n,r]})]}),o[8]=n,o[9]=r,o[10]=l):l=o[10],l}function oD(e){let t,n,i,d,c=(0,s.c)(13),{onClose:u,task:p}=e,h=function(e){let t,n,a,i,o,d,c,u,m=(0,s.c)(24),{gate:p}=(0,f.useGuestGate)();if(m[0]!==p||m[1]!==e){let s=function(e){switch(e.kind){case"loading":return;case"ready":return e.listId}}(e);t=l.useQuery,n=r.api.todo_lists.queries.getById,a=s?p({id:s}):"skip",m[0]=p,m[1]=e,m[2]=t,m[3]=n,m[4]=a}else t=m[2],n=m[3],a=m[4];let h=t(n,a),x=tL(h?.parentId,h?.teamId,!!h),g=(0,J.useSelectList)();if(!h){let e;return m[5]===Symbol.for("react.memo_cache_sentinel")?(e=[],m[5]=e):e
1=m[5],e}m[6]!==h.iconData?(i=(0,eI.fromConvexIconData)(h.iconData),m[6]=h.iconData,m[7]=i):i=m[7];let v=i;return m[8]!==v?(o=v&&{iconData:v},m[8]=v,m[9]=o):o=m[9],m[10]!==v||m[11]!==h._id||m[12]!==h.name||m[13]!==h.parentId||m[14]!==h.teamId||m[15]!==g?(d=()=>g(h._id,h.parentId,h.teamId,h.name,v),m[10]=v,m[11]=h._id,m[12]=h.name,m[13]=h.parentId,m[14]=h.teamId,m[15]=g,m[16]=d):d=m[16],m[17]!==h.name||m[18]!==o||m[19]!==d?(c={...o,label:h.name,onClick:d},m[17]=h.name,m[18]=o,m[19]=d,m[20]=c):c=m[20],m[21]!==x||m[22]!==c?(u=[...x,c],m[21]=x,m[22]=c,m[23]=u):u=m[23],u}(p),x=function(e){let t,n,a=(0,s.c)(5),[i,r]=(0,m.useState)(!1);a[0]!==e?(t=async()=>{var t,n;let a,s=window.location.origin,i=`${s}/task/${(t=function(e){switch(e.kind){case"loading":return null;case"ready":return e.text}}(e),n=e.id,a=(t??"").toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-|-$/g,"").slice(0,50)||"task",`${a}_${n}`)}`;await navigator.clipboard.writeText(i),r(!0),e3.toast.success("Task link copied"),setTimeout(()=>r(!1),2e3)},a[0]=e,a[1]=t):t=a[1];let l=t;return a[2]!==i||a[3]!==l?(n={copied:i,run:l},a[2]=i,a[3]=l,a[4]=n):n=a[4],n}(p);c[0]!==h||c[1]!==u||c[2]!==p?(t=(0,a.jsx)(oL,{breadcrumbs:h,onClose:u,task:p}),c[0]=h,c[1]=u,c[2]=p,c[3]=t):t=c[3];let g=x.copied?"Task link copied":"Copy task link";return c[4]!==x.copied?(n=x.copied?(0,a.jsx)(ep.Check,{className:"size-4 text-success"}):(0,a.jsx)(nu.Link2,{className:"size-4"}),c[4]=x.copied,c[5]=n):n=c[5],c[6]!==x.run||c[7]!==g||c[8]!==n?(i=(0,a.jsx)(o.Button,{"aria-label":g,onClick:x.run,size:"icon",variant:"ghost",children:n}),c[6]=x.run,c[7]=g,c[8]=n,c[9]=i):i=c[9],c[10]!==t||c[11]!==i?(d=(0,a.jsxs)(ne.AdaptiveRow,{className:"nodrag h-10 shrink-0 justify-between gap-2 px-2",children:[t,i]}),c[10]=t,c[11]=i,c[12]=d):d=c[12],d}function oL(e){let t,n,i=(0,s.c)(8),{breadcrumbs:r,onClose:l,task:d}=e;if("ready"===d.kind&&r.length>0){let e,t,n=d.identifier??"Task";return i[0]!==n?(e={kind:"label",label:n},i[0]=n,i[1]=e):e=i[1],i[2]!==r||i[3]!==e?(t=(0,a.jsx)(sk,{ancestors:r,current:e}),i[2]=r,i[3]=e,i[4]=t):t=i[4],t}return i[5]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(rE.ArrowLeft,{className:"size-4"}),i[5]=t):t=i[5],i[6]!==l?(n=(0,a.jsxs)(o.Button,{"aria-label":"Back",className:"gap-1.5",onClick:l,size:"sm",variant:"ghost",children:[t,"Back"]}),i[6]=l,i[7]=n):n=i[7],n}var oA=e.i(483678),oP=e.i(84167);function oO(e){let t,n,i,c,u,m,p,h,f=(0,s.c)(22),{taskId:x}=e;f[0]!==x?(t={todoId:x},f[0]=x,f[1]=t):t=f[1];let g=(0,l.useQuery)(r.api.todo_links.queries.getForTask,t),b=sZ(),y=(0,l.useMutation)(r.api.todo_links.mutations.unlink),j=(0,v.useOnOpenApp)();return f[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(d.Text,{variant:"overline",children:"Linked work"}),f[2]=n):n=f[2],f[3]!==b||f[4]!==x?(i=b?(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(oE,{taskId:x}),(0,a.jsx)(oM,{taskId:x})]}):null,f[3]=b,f[4]=x,f[5]=i):i=f[5],f[6]!==i?(c=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[n,i]}),f[6]=i,f[7]=c):c=f[7],f[8]!==g?(u=void 0===g?(0,a.jsx)(d.Text,{variant:"caption",children:"Loading links..."}):null,f[8]=g,f[9]=u):u=f[9],f[10]!==g?.length?(m=g?.length===0?(0,a.jsx)(d.Text,{variant:"caption",children:"No linked Pages or pull requests"}):null,f[10]=g?.length,f[11]=m):m=f[11],f[12]!==b||f[13]!==g||f[14]!==j||f[15]!==y?(p=g?.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:["page"===e.kind?(0,a.jsx)(oA.FileText,{}):(0,a.jsx)(oP.GitBranch,{}),(0,a.jsx)(o.Button,{className:"min-w-0 flex-1 justify-start",onClick:()=>{"page"===e.kind&&e.pageId?j?.("pages",{selectedPageId:e.pageId}):e.url&&window.open(e.url,"_blank","noopener,noreferrer")},variant:"ghost",children:(0,a.jsx)(d.Text,{as:"span",className:"truncate",variant:"bodySmall",children:e.label})}),b?(0,a.jsx)(nJ.RowOptionsMenu,{name:e.label,children:(0,a.jsx)(eu.DropdownMenuItem,{onClick:()=>y({id:e._id}),children:"Remove"})}):null]},e._id)),f[12]=b,f[13]=g,f[14]=j,f[15]=y,f[16]=p):p=f[16],f[17]!==c||f[18]!==u||f[19]!==m||f[20]!==p?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[c,u,m,p]}),f[17]=c,f[18]=u,f[19]=m,f[20]=p,f[21]=h):h=f[21],h}function oE(e){let t,n,i,c,u,p,h,f=(0,s.c)(19),{taskId:x}=e,[g,v]=(0,m.useState)(!1),[b,y]=(0,m.useState)(""),j=(0,l.useQuery)(r.api.pages.pages.queries.searchPages,g?{limit:12,query:b}:"skip")??[],I=(0,l.useMutation)(r.api.todo_links.mutations.link);if(f[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(eL.PopoverTrigger,{render:(0,a.jsxs)(o.Button,{size:"sm",variant:"ghost",children:[(0,a.jsx)(ef.Plus,{}),"Page"]})}),f[0]=t):t=f[0],f[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>y(e.target.value),f[1]=n):n=f[1],f[2]!==b?(i=(0,a.jsx)(ey.Input,{onChange:n,placeholder:"Search Pages",value:b}),f[2]=b,f[3]=i):i=f[3],f[4]!==I||f[5]!==j||f[6]!==x){let e;f[8]!==I||f[9]!==x?(e=e=>(0,a.jsxs)(o.Button,{className:"justify-start",onClick:async()=>{await I({kind:"page",pageId:e._id,todoId:x}),v(!1)},variant:"ghost",children:[(0,a.jsx)(oA.FileText,{}),(0,a.jsx)(d.Text,{as:"span",className:"truncate",variant:"bodySmall",children:e.title})]},e._id),f[8]=I,f[9]=x,f[10]=e):e=f[10],c=j.map(e),f[4]=I,f[5]=j,f[6]=x,f[7]=c}else c=f[7];return f[11]!==c?(u=(0,a.jsx)("div",{className:"flex max-h-64 flex-col gap-1 overflow-y-auto",children:c}),f[11]=c,f[12]=u):u=f[12],f[13]!==i||f[14]!==u?(p=(0,a.jsx)(eL.PopoverContent,{align:"end",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[i,u]})}),f[13]=i,f[14]=u,f[15]=p):p=f[15],f[16]!==g||f[17]!==p?(h=(0,a.jsxs)(eL.Popover,{onOpenChange:v,open:g,children:[t,p]}),f[16]=g,f[17]=p,f[18]=h):h=f[18],h}function oM(e){let t,n,i,d,c,u,p,h,f=(0,s.c)(19),{taskId:x}=e,[g,v]=(0,m.useState)(!1),[b,y]=(0,m.useState)(""),j=(0,l.useMutation)(r.api.todo_links.mutations.link);f[0]!==j||f[1]!==x||f[2]!==b?(t=async()=>{let e=function(e){try{return new URL(e).pathname.includes("/tree/")?"branch":"pull_request"}catch{return"pull_request"}}(b);await j({kind:e,todoId:x,url:b}),y(""),v(!1)},f[0]=j,f[1]=x,f[2]=b,f[3]=t):t=f[3];let I=t;f[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(eL.PopoverTrigger,{render:(0,a.jsxs)(o.Button,{size:"sm",variant:"ghost",children:[(0,a.jsx)(ef.Plus,{}),"GitHub"]})}),f[4]=n):n=f[4],f[5]===Symbol.for("react.memo_cache_sentinel")?(i=e=>y(e.target.value),f[5]=i):i=f[5],f[6]!==b?(d=(0,a.jsx)(ey.Input,{"aria-label":"GitHub pull request or branch URL",onChange:i,placeholder:"GitHub pull request or branch URL",value:b}),f[6]=b,f[7]=d):d=f[7],f[8]!==b?(c=b.trim(),f[8]=b,f[9]=c):c=f[9];let _=0===c.length;return f[10]!==I||f[11]!==_?(u=(0,a.jsx)(o.Button,{disabled:_,onClick:I,children:"Link GitHub"}),f[10]=I,f[11]=_,f[12]=u):u=f[12],f[13]!==d||f[14]!==u?(p=(0,a.jsx)(eL.PopoverContent,{align:"end",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[d,u]})}),f[13]=d,f[14]=u,f[15]=p):p=f[15],f[16]!==g||f[17]!==p?(h=(0,a.jsxs)(eL.Popover,{onOpenChange:v,open:g,children:[n,p]}),f[16]=g,f[17]=p,f[18]=h):h=f[18],h}function oR(e,t){return`${e}_st_${t}`}let oz=(n="standard",t=[{glyph:"backlog",group:"backlog",name:"Backlog"},{glyph:"todo",group:"todo",name:"Todo"},{glyph:"in_progress",group:"in_progress",name:"In Progress"},{glyph:"in_review",group:"in_review",name:"In Review"},{glyph:"blocked",group:"blocked",name:"Blocked"},{glyph:"done",group:"complete",name:"Done"},{glyph:"canceled",group:"canceled",name:"Canceled"}].map(e=>({...e,id:oR(n,e.group),sortOrder:0})),{defaultOptionByGroup:{backlog:oR(n,"backlog"),blocked:oR(n,"blocked"),canceled:oR(n,"canceled"),complete:oR(n,"complete"),in_progress:oR(n,"in_progress"),in_review:oR(n,"in_review"),todo:oR(n,"todo")},statusOptions:t});function oB(e){let t,n,i,d,c,u,m,p,h,f,x,g,v,b,y,j,I,_,S=(0,s.c)(50),{completed:k,listId:w,statusId:C,taskId:T}=e;S[0]!==w?(t=w?{id:w}:"skip",S[0]=w,S[1]=t):t=S[1];let N=(0,l.useQuery)(r.api.todo_lists.queries.getById,t),D=sZ(),L=(0,l.useMutation)(r.api.todos.mutations.setStatus);if(S[2]!==D||S[3]!==k||S[4]!==N?.statusOptions||S[5]!==w||S[6]!==C){let e,t;if(u=w?N?.statusOptions??[]:oz.statusOptions,S[17]!==k||S[18]!==w||S[19]!==C)e=w?C:oz.statusOptions.some(e=>e.id===C)&&C?C:oz.defaultOptionByGroup[k?"complete":"todo"],S[17]=k,S[18]=w,S[19]=C,S[20]=e;else e=S[20];let a=e;S[21]!==a?(t=e=>e.id===a,S[21]=a,S[22]=t):t=S[22],m=u.find(t),c=eu.DropdownMenu,d=eu.DropdownMenuTrigger,i=o.Button,h=!D,f="sm",x="ghost",n=nH,p=m?.glyph??nY(m?.group??"todo"),S[2]=D,S[3]=k,S[4]=N?.statusOptions,S[5]=w,S[
16]=C,S[7]=n,S[8]=i,S[9]=d,S[10]=c,S[11]=u,S[12]=m,S[13]=p,S[14]=h,S[15]=f,S[16]=x}else n=S[7],i=S[8],d=S[9],c=S[10],u=S[11],m=S[12],p=S[13],h=S[14],f=S[15],x=S[16];S[23]!==n||S[24]!==p?(g=(0,a.jsx)(n,{glyph:p}),S[23]=n,S[24]=p,S[25]=g):g=S[25];let A=m?.name??"Todo";S[26]!==i||S[27]!==h||S[28]!==f||S[29]!==x||S[30]!==g||S[31]!==A?(v=(0,a.jsxs)(i,{disabled:h,size:f,variant:x,children:[g,A]}),S[26]=i,S[27]=h,S[28]=f,S[29]=x,S[30]=g,S[31]=A,S[32]=v):v=S[32],S[33]!==d||S[34]!==v?(b=(0,a.jsx)(d,{render:v}),S[33]=d,S[34]=v,S[35]=b):b=S[35],S[36]!==u||S[37]!==L||S[38]!==T?(y=e=>{let t=u.find(t=>t.id===e);t&&L({id:T,statusId:t.id})},S[36]=u,S[37]=L,S[38]=T,S[39]=y):y=S[39];let P=m?.id;return S[40]!==u?(j=u.map(oU),S[40]=u,S[41]=j):j=S[41],S[42]!==y||S[43]!==P||S[44]!==j?(I=(0,a.jsx)(eu.DropdownMenuContent,{align:"start",children:(0,a.jsx)(eu.DropdownMenuRadioGroup,{onValueChange:y,value:P,children:j})}),S[42]=y,S[43]=P,S[44]=j,S[45]=I):I=S[45],S[46]!==c||S[47]!==I||S[48]!==b?(_=(0,a.jsxs)(c,{children:[b,I]}),S[46]=c,S[47]=I,S[48]=b,S[49]=_):_=S[49],_}function oU(e){return(0,a.jsxs)(eu.DropdownMenuRadioItem,{value:e.id,children:[(0,a.jsx)(nH,{glyph:e.glyph??nY(e.group)}),e.name]},e.id)}let oF=["none",...aZ.TASK_PRIORITIES];function oG(e){let t,n,i,d,c,u,m,p=(0,s.c)(18),{priority:h,taskId:f}=e,x=sZ(),g=(0,l.useMutation)(r.api.todos.mutations.update),v=!x;p[0]!==h?(t=h?(0,a.jsx)(aJ,{priority:h}):null,p[0]=h,p[1]=t):t=p[1],p[2]!==h?(n=h?(0,aZ.taskPriorityLabel)(h):"No priority",p[2]=h,p[3]=n):n=p[3],p[4]!==v||p[5]!==t||p[6]!==n?(i=(0,a.jsx)(eu.DropdownMenuTrigger,{render:(0,a.jsxs)(o.Button,{disabled:v,size:"sm",variant:"ghost",children:[t,n]})}),p[4]=v,p[5]=t,p[6]=n,p[7]=i):i=p[7],p[8]!==f||p[9]!==g?(d=e=>{oF.some(t=>t===e)&&g({id:f,priority:"none"===e?null:e})},p[8]=f,p[9]=g,p[10]=d):d=p[10];let b=h??"none";return p[11]===Symbol.for("react.memo_cache_sentinel")?(c=oF.map(oq),p[11]=c):c=p[11],p[12]!==d||p[13]!==b?(u=(0,a.jsx)(eu.DropdownMenuContent,{align:"start",children:(0,a.jsx)(eu.DropdownMenuRadioGroup,{onValueChange:d,value:b,children:c})}),p[12]=d,p[13]=b,p[14]=u):u=p[14],p[15]!==i||p[16]!==u?(m=(0,a.jsxs)(eu.DropdownMenu,{children:[i,u]}),p[15]=i,p[16]=u,p[17]=m):m=p[17],m}function oq(e){return(0,a.jsxs)(eu.DropdownMenuRadioItem,{value:e,children:["none"===e?null:(0,a.jsx)(aJ,{priority:e}),"none"===e?"No priority":(0,aZ.taskPriorityLabel)(e)]},e)}function o$(e){let t,n,i,d,c,u,p,h,f,x,g,v,b=(0,s.c)(20),{labels:y,taskId:j,teamId:I}=e,_=sZ(),S=(0,l.useQuery)(r.api.task_labels.queries.list,{teamId:I})??[],k=(0,l.useMutation)(r.api.task_labels.mutations.assign),w=(0,l.useMutation)(r.api.task_labels.mutations.create),[C,T]=(0,m.useState)(""),[N,D]=(0,m.useState)("blue"),L=y.map(oV),A=async()=>{let e=await w({color:N,name:C,teamId:I});await k({labelIds:[...L,e],todoId:j}),T("")},P=!_;if(b[0]!==_||b[1]!==y.length){var O;O=y.length,t=O>0?`${O} labels`:_?"Add label":"No labels",b[0]=_,b[1]=y.length,b[2]=t}else t=b[2];b[3]!==P||b[4]!==t?(n=(0,a.jsx)(eL.PopoverTrigger,{render:(0,a.jsx)(o.Button,{disabled:P,size:"sm",variant:"ghost",children:t})}),b[3]=P,b[4]=t,b[5]=n):n=b[5],b[6]===Symbol.for("react.memo_cache_sentinel")?(i=e=>T(e.target.value),b[6]=i):i=b[6],b[7]!==C?(d=(0,a.jsx)(ey.Input,{onChange:i,placeholder:"New label",value:C}),b[7]=C,b[8]=d):d=b[8],b[9]!==C?(c=C.trim(),b[9]=C,b[10]=c):c=b[10],b[11]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)(ef.Plus,{}),b[11]=u):u=b[11],b[12]===Symbol.for("react.memo_cache_sentinel")?(p=io.map(oQ),h=e=>{if(null===e)return;let t=io.find(t=>t===e);t&&D(t)},b[12]=p,b[13]=h):(p=b[12],h=b[13]),b[14]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)(nZ.SelectTrigger,{"aria-label":"Label dot color",children:(0,a.jsx)(nZ.SelectValue,{})}),b[14]=f):f=b[14],b[15]===Symbol.for("react.memo_cache_sentinel")?(x=(0,a.jsx)(nZ.SelectContent,{children:io.map(oK)}),b[15]=x):x=b[15],b[16]!==N?(g=(0,a.jsxs)(nZ.Select,{items:p,onValueChange:h,value:N,children:[f,x]}),b[16]=N,b[17]=g):g=b[17];let E=S.map(e=>(0,a.jsx)(o.Button,{className:"justify-start",onClick:()=>{var t;return t=e._id,k({labelIds:L.includes(t)?L.filter(e=>e!==t):[...L,t],todoId:j})},variant:L.includes(e._id)?"secondary":"ghost",children:(0,a.jsx)(iu,{label:e})},e._id));return b[18]!==E?(v=(0,a.jsx)("div",{className:"flex max-h-52 flex-col gap-1 overflow-y-auto",children:E}),b[18]=E,b[19]=v):v=b[19],(0,a.jsxs)(eL.Popover,{children:[n,(0,a.jsx)(eL.PopoverContent,{align:"start",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex gap-1",children:[d,(0,a.jsx)(o.Button,{"aria-label":"Create label",disabled:0===c.length,onClick:A,size:"icon",variant:"ghost",children:u})]}),g,v]})})]})}function oK(e){return(0,a.jsxs)(nZ.SelectItem,{value:e,children:[(0,a.jsx)(im,{color:e}),ic[e]]},e)}function oQ(e){return{label:ic[e],value:e}}function oV(e){return e._id}function oW(e){let t,n,i,d,c,u,m,p,h=(0,s.c)(22),{projectId:f,taskId:x,teamId:g}=e,v=sZ();h[0]!==g?(t={teamId:g},h[0]=g,h[1]=t):t=h[1];let b=(0,l.useQuery)(r.api.projects.queries.listForTaskScope,t),y=(0,l.useMutation)(r.api.todos.mutations.update);h[2]!==f||h[3]!==b?(n=b?.find(e=>e._id===f),h[2]=f,h[3]=b,h[4]=n):n=h[4];let j=n,I=!v,_=j?.name??"No project";h[5]!==I||h[6]!==_?(i=(0,a.jsx)(eu.DropdownMenuTrigger,{render:(0,a.jsx)(o.Button,{disabled:I,size:"sm",variant:"ghost",children:_})}
1),h[5]=I,h[6]=_,h[7]=i):i=h[7],h[8]!==b||h[9]!==x||h[10]!==y?(d=e=>{let t=b?.find(t=>t._id===e);y({id:x,projectId:t?._id??null})},h[8]=b,h[9]=x,h[10]=y,h[11]=d):d=h[11];let S=f??"none";return h[12]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(eu.DropdownMenuRadioItem,{value:"none",children:"No project"}),h[12]=c):c=h[12],h[13]!==b?(u=b?.map(oH),h[13]=b,h[14]=u):u=h[14],h[15]!==d||h[16]!==S||h[17]!==u?(m=(0,a.jsx)(eu.DropdownMenuContent,{align:"start",children:(0,a.jsxs)(eu.DropdownMenuRadioGroup,{onValueChange:d,value:S,children:[c,u]})}),h[15]=d,h[16]=S,h[17]=u,h[18]=m):m=h[18],h[19]!==m||h[20]!==i?(p=(0,a.jsxs)(eu.DropdownMenu,{children:[i,m]}),h[19]=m,h[20]=i,h[21]=p):p=h[21],p}function oH(e){return(0,a.jsx)(eu.DropdownMenuRadioItem,{value:e._id,children:e.name},e._id)}function oY(e){let t,n,i,o=(0,s.c)(9),{dueDate:d,taskId:c}=e,u=sZ(),m=(0,l.useMutation)(r.api.todos.mutations.update);o[0]!==d?(t=d?new Date(d).toISOString().slice(0,10):"",o[0]=d,o[1]=t):t=o[1];let p=t;o[2]!==c||o[3]!==m?(n=e=>{let t=e.target.value;m({dueDate:t?new Date(`${t}T23:59:59`).getTime():null,id:c})},o[2]=c,o[3]=m,o[4]=n):n=o[4];let h=!u;return o[5]!==n||o[6]!==h||o[7]!==p?(i=(0,a.jsx)(ey.Input,{"aria-label":"Due date",onChange:n,readOnly:h,type:"date",value:p}),o[5]=n,o[6]=h,o[7]=p,o[8]=i):i=o[8],i}function oX(e){let t,n,i=(0,s.c)(7),{estimatedMinutes:o,taskId:d}=e,c=sZ(),u=(0,l.useMutation)(r.api.todos.mutations.update);i[0]!==d||i[1]!==u?(t=e=>{let t=Number(e.target.value);u({estimatedMinutes:Number.isFinite(t)&&t>0?t:null,id:d})},i[0]=d,i[1]=u,i[2]=t):t=i[2];let m=!c;return i[3]!==o||i[4]!==t||i[5]!==m?(n=(0,a.jsx)(ey.Input,{"aria-label":"Estimate in minutes",defaultValue:o,min:0,onBlur:t,placeholder:"Minutes",readOnly:m,type:"number"}),i[3]=o,i[4]=t,i[5]=m,i[6]=n):n=i[6],n}var oJ=e.i(346144),oZ=e.i(538100);function o0(e){let t,n,i,o,c,u,p,h,f,x,g,v,b=(0,s.c)(30),{taskId:y}=e;b[0]!==y?(t={id:y},b[0]=y,b[1]=t):t=b[1];let j=(0,l.useQuery)(r.api.todos.visibility_mutations.getTaskVisibility,t),I=(0,l.useMutation)(r.api.todos.visibility_mutations.publish),_=(0,l.useMutation)(r.api.todos.visibility_mutations.unpublish),[S,k]=(0,m.useState)(!1);if(!j)return null;let w="task"===j.source;b[2]!==y||b[3]!==_?(n=e=>{e?k(!0):_({id:y}).then(o4).catch(o3)},b[2]=y,b[3]=_,b[4]=n):n=b[4];let C=n;b[5]!==I||b[6]!==y?(i=()=>{k(!1),I({id:y}).then(o2).catch(o1)},b[5]=I,b[6]=y,b[7]=i):i=b[7];let T=i;return b[8]!==C||b[9]!==w?(o=(0,a.jsx)(eQ.Switch,{"aria-label":"Share this task with anyone who has the link",checked:w,onCheckedChange:C}),b[8]=C,b[9]=w,b[10]=o):o=b[10],b[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(d.Text,{as:"span",className:"text-muted-foreground",variant:"bodySmall",children:"Anyone with the link"}),b[11]=c):c=b[11],b[12]!==y?(u=(0,oJ.taskPermalinkPath)(y),b[12]=y,b[13]=u):u=b[13],b[14]!==u?(p=(0,a.jsx)(oZ.ShareLinkButtons,{className:"flex gap-1",shareUrl:u}),b[14]=u,b[15]=p):p=b[15],b[16]!==o||b[17]!==p?(h=(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[o,c,p]}),b[16]=o,b[17]=p,b[18]=h):h=b[18],b[19]!==j.conflictsWithList||b[20]!==j.source?(f=(0,a.jsx)(o5,{conflictsWithList:j.conflictsWithList,source:j.source}),b[19]=j.conflictsWithList,b[20]=j.source,b[21]=f):f=b[21],b[22]===Symbol.for("react.memo_cache_sentinel")?(x=()=>k(!1),b[22]=x):x=b[22],b[23]!==T||b[24]!==S?(g=(0,a.jsx)(o6,{onCancel:x,onConfirm:T,open:S}),b[23]=T,b[24]=S,b[25]=g):g=b[25],b[26]!==g||b[27]!==h||b[28]!==f?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[h,f,g]}),b[26]=g,b[27]=h,b[28]=f,b[29]=v):v=b[29],v}function o1(){return e3.toast.error("Could not share this task")}function o2(){return e3.toast.success("Anyone with the link can now view this task")}function o3(){return e3.toast.error("Could not update sharing")}function o4(){return e3.toast.success("Task link turned off")}function o5(e){let t,n=(0,s.c)(4),{source:i,conflictsWithList:r}=e;if(r){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.Text,{className:"text-muted-foreground",variant:"caption",children:"This task has its own link. Its list stays private. Nothing else in the list is visible."}),n[0]=e):e=n[0],e}if("list"===i){let e;return n[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.Text,{className:"text-muted-foreground",variant:"caption",children:"Shared because its list is shared. Turn this on to give the task a link of its own."}),n[1]=e):e=n[1],e}if("task"===i){let e;return n[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.Text,{className:"text-muted-foreground",variant:"caption",children:"Anyone with the link can view this task."}),n[2]=e):e=n[2],e}return n[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(d.Text,{className:"text-muted-foreground",variant:"caption",children:"Only you and people you share the list with can see this."}),n[3]=t):t=n[3],t}function o6(e){let t,n,i,r,l,o=(0,s.c)(10),{open:d,onCancel:c,onConfirm:u}=e;return o[0]!==c?(t=e=>!e&&c(),o[0]=c,o[1]=t):t=o[1],o[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsxs)(ak.AlertDialogHeader,{children:[(0,a.jsx)(ak.AlertDialogTitle,{children:"Share this task?"}),(0,a.jsx)(ak.AlertDialogDescription,{children:"Anyone with the link will be able to view this task. Your list and everything else in it stay private. You can turn this off any time."})]}),o[2]=n):n=o[2],o[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(ak.AlertDialogCancel,{children:"Cancel"}),o[3]=i):i=o[3],o[4]!==u?(r=(0,a.jsxs)(ak.AlertDialogContent,{children:[n,(0,a.jsxs)(ak.AlertDialogFooter,{children:[i,(0,a.jsx)(ak.AlertDialogAction,{onClick:u,children:"Share task"})]})]}),o[4]=u,o[5]=r):r=o[5],o[6]!==d||o[7]!==t||o[8]!==r?(l=(0,a.jsx)(ak.AlertDialog,{onOpenChange:t,open:d,children:r}),o[6]=d,o[7]=t,o[8]=r,o[9]=l):l=o[9],l}function o7(e){var t;let n,i,r,l,o,c,u,m,p,h,f,x,g,v,b,y,j,I,_,S,k,w,C,T,N,D,L,A,P,O,E,M,R,z,B,U,F,G,q,$,K=(0,s.c)(111),{onToggleComplete:Q,task:V}=e,W=(t=V.listId,q=(0,s.c)(2),$=tC(t),q[0]!==$.properties?(G=e=>{let t=$.properties.find(t=>t.key===e);return t?t_(t):tb[e].name},q[0]=$.properties,q[1]=G):G=q[1],G);K[0]!==W?(n=W("identifier"),K[0]=W,K[1]=n):n=K[1];let H=V.identifier??"Assigning...";K[2]!==H?(i=(0,a.jsx)(d.Text,{as:"span",variant:"bodySmall",children:H}),K[2]=H,K[3]=i):i=K[3],K[4]!==n||K[5]!==i?(r=(0,a.jsx)(o9,{label:n,children:i}),K[4]=n,K[5]=i,K[6]=r):r=K[6],K[7]!==W?(l=W("status"),K[7]=W,K[8]=l):l=K[8],K[9]!==V._id||K[10]!==V.completed||K[11]!==V.listId||K[12]!==V.statusId?(o=(0,a.jsx)(oB,{completed:V.completed,listId:V.listId,statusId:V.statusId,taskId:V._id}),K[9]=V._id,K[10]=V.completed,K[11]=V.listId,K[12]=V.statusId,K[13]=o):o=K[13],K[14]!==l||K[15]!==o?(c=(0,a.jsx)(o9,{label:l,children:o}),K[14]=l,K[15]=o,K[16]=c):c=K[16],K[17]!==Q||K[18]!==V.completed?(u=(0,a.jsx)(o9,{label:"Completed",children:(0,a.jsx)(o8,{completed:V.completed,onToggleComplete:Q})}),K[17]=Q,K[18]=V.completed,K[19]=u):u=K[19],K[20]!==W?(m=W("priority"),K[20]=W,K[21]=m):m=K[21],K[22]!==V._id||K[23]!==V.priority?(p=(0,a.jsx)(oG,{priority:V.priority,taskId:V._id}),K[22]=V._id,K[23]=V.priority,K[24]=p):p=K[24],K[25]!==p||K[26]!==m?(h=(0,a.jsx)(o9,{label:m,children:p}),K[25]=p,K[26]=m,K[27]=h):h=K[27],K[28]!==W?(f=W("assignee"),K[28]=W,K[29]=f):f=K[29],K[30]!==V.assignees?(x=V.assignees??[],K[30]=V.assignees,K[31]=x):x=K[31],K[32]!==x||K[33]!==V._id||K[34]!==V.listId||K[35]!==V.teamId?(g=(0,a.jsx)(s0,{listId:V.listId,selectedAssignees:x,teamId:V.teamId,todoId:V._id,tooltip:"Assign members"}),K[32]=x,K[33]=V._id,K[34]=V.listId,K[35]=V.teamId,K[36]=g):g=K[36],K[37]!==f||K[38]!==g?(v=(0,a.jsx)(o9,{label:f,children:g}),K[37]=f,K[38]=g,K[39]=v):v=K[39],K[40]!==W?(b=W("labels"),K[40]=W,K[41]=b):b=K[41],K[42]!==V.labels?(y=V.labels??[],K[42]=V.labels,K[43]=y):y=K[43],K[44]!==y||K[45]!==V._id||K[46]!==V.teamId?(j=(0,a.jsx)(o$,{labels:y,taskId:V._id,teamId:V.teamId}),K[44]=y,K[45]=V._id,K[46]=V.teamId,K[47]=j):j=K[47],K[48]!==b||K[49]!==j?(I=(0,a.jsx)(o9,{label:b,children:j}),K[48]=b,K[49]=j,K[50]=I):I=K[50],K[51]!==W?(_=W("project"),K[51]=W,K[52]=_):_=K[52],K[53]!==V._id||K[54]!==V.projectId||K[55]!==V.teamId?(S=(0,a.jsx)(oW,{projectId:V.projectId,taskId:V._id,teamId:V.teamId}),K[53]=V._id,K[54]=V.projectId,K[55]=V.teamId,K[56]=S):S=K[56],K[57]!==_||K[58]!==S?(k=(0,a.jsx)(o9,{label:_,children:S}),K[57]=_,K[58]=S,K[59]=k):k=K[59],K[60]!==W?(w=W("list"),K[60]=W,K[61]=w):w=K[61],K[62]!==V.listId?(C=(0,a.jsx)(de,{listId:V.listId}),K[62]=V.listId,K[63]=C):C=K[63],K[64]!==w||K[65]!==C?(T=(0,a.jsx)(o9,{label:w,children:C}),K[64]=w,K[65]=C,K[66]=T):T=K[66],K[67]!==V._id||K[68]!==V.date?(N=(0,a.jsx)(o9,{label:"Schedule",children:(0,a.jsx)(r6,{date:V.date,taskId:V._id})}),K[67]=V._id,K[68]=V.date,K[69]=N):N=K[69],K[70]!==W?(D=W("due"),K[70]=W,K[71]=D):D=K[71],K[72]!==V._id||K[73]!==V.dueDate?(L=(0,a.jsx)(oY,{dueDate:V.dueDate,taskId:V._id}),K[72]=V._id,K[73]=V.dueDate,K[74]=L):L=K[74],K[75]!==D||K[76]!==L?(A=(0,a.jsx)(o9,{label:D,children:L}),K[75]=D,K[76]=L,K[77]=A):A=K[77],K[78]!==W?(P=W("estimate"),K[78]=W,K[79]=P):P=K[79],K[80]!==V._id||K[81]!==V.estimatedMinutes?(O=(0,a.jsx)(oX,{estimatedMinutes:V.estimatedMinutes,taskId:V._id}),K[80]=V._id,K[81]=V.estimatedMinutes,K[82]=O):O=K[82],K[83]!==P||K[84]!==O?(E=(0,a.jsx)(o9,{label:P,children:O}),K[83]=P,K[84]=O,K[85]=E):E=K[85],K[86]!==W?(M=W("updated"),K[86]=W,K[87]=M):M=K[87];let Y=V.completedAt??V.updatedAt;return K[88]!==Y?(R=(0,oc.formatRelativeTime)(Y),K[88]=Y,K[89]=R):R=K[89],K[90]!==R?(z=(0,a.jsx)(d.Text,{as:"span",variant:"bodySmall",children:R}),K[90]=R,K[91]=z):z=K[91],K[92]!==M||K[93]!==z?(B=(0,a.jsx)(o9,{label:M,children:z}),K[92]=M,K[93]=z,K[94]=B):B=K[94],K[95]!==V._id?(U=(0,a.jsx)(o9,{label:"Share",children:(0,a.jsx)(o0,{taskId:V._id})}),K[95]=V._id,K[96]=U):U=K[96],K[97]!==h||K[98]!==v||K[99]!==I||K[100]!==k||K[101]!==T||K[102]!==N||K[103]!==A||K[104]!==E||K[105]!==B||K[106]!==U||K[107]!==r||K[108]!==c||K[109]!==u?(F=(0,a.jsxs)("div",{className:"flex flex-col gap-2.5 border-border border-t border-b py-4",children:[r,c,u,h,v,I,k,T,N,A,E,B,U]}),K[97]=h,K[98]=v,K[99]=I,K[100]=k,K[101]=T,K[102]=N,K[103]=A,K[104]=E,K[105]=B,K[106]=U,K[107]=r,K[108]=c,K[109]=u,K[110]=F):F=K[110],F}function o8(e){let t,n,i=(0,s.c)(7),{completed:r,onToggleComplete:l}=e,o=sZ(),d=r?"Mark task incomplete":"Mark task complete",c=!o;return i[0]!==l?(t=e=>l(!0===e),i[0]=l,i[1]=t):t=i[1],i[2]!==r||i[3]!==d||i[4]!==c||i[5]!==t?(n=(0,a.jsx)(rn.Checkbox,{"aria-label":d,checked:r,disabled:c,onCheckedChange:t}),i[2]=r,i[3]=d,i[4]=c,i[5]=t,i[6]=n):n=i[6],n}function o9(e){let t,n,i,r=(0,s.c)(7),{label:l,children:o}=e;return r[0]!==l?(t=(0,a.jsx)(d.Text,{as:"span",className:"w-20 shrink-0",variant:"caption",children:l}),r[0]=l,r[1]=t):t=r[1],r[2]!==o?(n=(0,a.jsx)("div",{className:"flex min-w-0 flex-1 items-center",children:o}),r[2]=o,r[3]=n):n=r[3],r[4]!==t||r[5]!==n?(i=(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[t,n]}),r[4]=t,r[5]=n,r[6]=i):i=r[6],i}function de(e){let t,n,i,u,m,p,h,f=(0,s.c)(17),{listId:x}=e,g=(0,J.useSetCurrentListId)();f[0]!==x?(t=x?{id:x}:"skip",f[0]=x,f[1]=t):t=f[1];let v=(0,l.useQuery)(r.api.todo_lists.queries.getById,t);if(!x){let e;return f[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.Text,{as:"span",variant:"bodySmall",children:"Inbox"}),f[2]=e):e=f[2],e}f[3]!==x||f[4]!==g?(n=()=>g(x),f[3]=x,f[4]=g,f[5]=n):n=f[5],f[6]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(c.ListTodo,{}),f[6]=i):i=f[6];let b=v?.iconData;f[7]!==b?(u=(0,eI.fromConvexIconData)(b),f[7]=b,f[8]=u):u=f[8],f[9]!==u?(m=(0,a.jsx)(em.IconDisplay,{fallback:i,size:14,value:u}),f[9]=u,f[10]=m):m=f[10];let y=v?.name??"List";return f[11]!==y?(p=(0,a.jsx)(d.Text,{as:"span",className:"truncate",children:y}),f[11]=y,f[12]=p):p=f[12],f[13]!==n||f[14]!==m||f[15]!==p?(h=(0,a.jsxs)(o.Button,{className:"justify-start",onClick:n,size:"sm",variant:"ghost",children:[m,p]}),f[13]=n,f[14]=m,f[15]=p,f[16]=h):h=f[16],h}e.i(565843);var dt=e.i(729754),dn=e.i(609606);function da(e,t){return`the-cloud:task-note-draft:${t}:${e}`}function ds(e,t,n){console.error(`[tasks] unsaved note localStorage ${e} failed`,{error:n,key:t})}function di(e,t,n){let a=da(e,t);try{window.localStorage.setItem(a,n)}catch(e){ds("write",a,e)}}function dr(e,t){let n=da(e,t);try{window.localStorage.removeItem(n)}catch(e){ds("clear",n,e)}}function dl({commit:e,field:t,serverValue:n,taskId:a}){let[s,i]=(0,m.useState)({kind:"idle"}),[r,l]=(0,m.useState)(null),o=(0,m.useRef)(0),d=(0,m.useRef)(void 0),c=(0,m.useRef)(n);c.current=n,rk(null!==r),(0,m.useEffect)(function(){return()=>clearTimeout(d.current)},[]),(0,m.useEffect)(function(){let e=function(e,t){let n=da(e,t);try{return window.localStorage.getItem(n)}catch(e){return ds("read",n,e),null}}(a,t);
1if(null===e||e===c.current){null!==e&&dr(a,t),l(null),i({kind:"idle"});return}l(e),i({kind:"failed",reason:"Kept in this browser from your last visit."})},[a,t]);let u=n=>{di(a,t,n),l(n),o.current+=1;let{current:s}=o;i({kind:"saving"}),clearTimeout(d.current),d.current=setTimeout(()=>{o.current===s&&i({kind:"failed",reason:rj})},1e4),e(n).then(()=>{o.current===s&&(clearTimeout(d.current),dr(a,t),l(null),i({at:Date.now(),kind:"saved"}))},e=>{o.current===s&&(clearTimeout(d.current),i({kind:"failed",reason:r_(e)}))})};return{retry:()=>{null!==r&&u(r)},save:u,saveOnClose:async n=>{di(a,t,n),await e(n),dr(a,t)},state:s,unsaved:r}}let dd=e4.z.custom(function e(t){return!!("object"==typeof t&&null!==t&&!Array.isArray(t))&&(void 0===t.type||"string"==typeof t.type)&&(void 0===t.text||"string"==typeof t.text)&&(void 0===t.content||Array.isArray(t.content)&&t.content.every(e))}).refine(e=>"doc"===e.type,"Task description must be a TipTap document"),dc={content:[{type:"paragraph"}],type:"doc"};function du(e){let t,n,i,r,l,o,d,c,u,p,h,f,x,g=(0,s.c)(39),{descriptionJson:v,legacyNote:b,onUpdateDescription:y,onUpdatePrivateNote:j,privateNote:I,showPrivateNote:_,taskId:S}=e,k=sZ(),w=v??"";g[0]!==y||g[1]!==w||g[2]!==S?(t={commit:y,field:"shared",serverValue:w,taskId:S},g[0]=y,g[1]=w,g[2]=S,g[3]=t):t=g[3];let C=dl(t),T=(0,m.useRef)(!1);g[4]===Symbol.for("react.memo_cache_sentinel")?(n=function(){return T.current=!1,()=>{T.current=!0}},i=[],g[4]=n,g[5]=i):(n=g[4],i=g[5]),(0,m.useEffect)(n,i),g[6]!==S?(r={kind:"task",taskId:S},g[6]=S,g[7]=r):r=g[7],g[8]!==k||g[9]!==r?(l={canEdit:k,createPlacementId:dp,hostRef:r,onOpen:dm,surface:"task-note"},g[8]=k,g[9]=r,g[10]=l):l=g[10];let N=(0,dn.usePlacedObjectHost)(l);g[11]!==C.retry||g[12]!==C.state?(o=(0,a.jsx)(df,{label:"Shared note",onRetry:C.retry,state:C.state}),g[11]=C.retry,g[12]=C.state,g[13]=o):o=g[13],g[14]!==N?(d=[N],g[14]=N,g[15]=d):d=g[15];let D=C.unsaved??v;g[16]!==b||g[17]!==D?(c=function(e,t){if(e)try{let t=JSON.parse(e),n=dd.safeParse(t);if(n.success)return n.data}catch(e){if(!(e instanceof SyntaxError))throw e}return t?.trim()?{content:[{content:[{text:t,type:"text"}],type:"paragraph"}],type:"doc"}:dc}(D,b),g[16]=b,g[17]=D,g[18]=c):c=g[18],g[19]!==C||g[20]!==S?(u=e=>{let t=JSON.stringify(dd.parse(e));T.current?dh(C.saveOnClose,t,{label:"Shared note",taskId:S}):C.save(t)},g[19]=C,g[20]=S,g[21]=u):u=g[21];let L=k?"Everyone with access sees this":"";return g[22]!==k||g[23]!==c||g[24]!==u||g[25]!==L||g[26]!==d?(p=(0,a.jsx)(dt.MinimalTiptapEditor,{additionalExtensions:d,autolink:!0,editable:k,externalContent:c,onContentChange:u,placeholder:L}),g[22]=k,g[23]=c,g[24]=u,g[25]=L,g[26]=d,g[27]=p):p=g[27],g[28]!==p||g[29]!==o?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[o,p]}),g[28]=p,g[29]=o,g[30]=h):h=g[30],g[31]!==j||g[32]!==I||g[33]!==_||g[34]!==S?(f=_?(0,a.jsx)(dx,{onUpdate:j,privateNote:I,taskId:S}):null,g[31]=j,g[32]=I,g[33]=_,g[34]=S,g[35]=f):f=g[35],g[36]!==h||g[37]!==f?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[h,f]}),g[36]=h,g[37]=f,g[38]=x):x=g[38],x}function dm(e){"page"===e.kind&&window.open(`/p/${e.pageId}`,"_blank","noopener,noreferrer")}function dp(){return crypto.randomUUID()}function dh(e,t,{label:n,taskId:a}){e(t).catch(e=>{console.error(`${n} for task ${a} did not save on close`,e)})}function df(e){let t,n,i,r=(0,s.c)(8),{label:l,onRetry:o,state:c}=e;return r[0]!==l?(t=(0,a.jsx)(d.Text,{as:"span",variant:"caption",children:l}),r[0]=l,r[1]=t):t=r[1],r[2]!==o||r[3]!==c?(n=(0,a.jsx)(rN,{onRetry:o,state:c}),r[2]=o,r[3]=c,r[4]=n):n=r[4],r[5]!==t||r[6]!==n?(i=(0,a.jsxs)("div",{className:"flex min-h-7 items-center justify-between gap-2",children:[t,n]}),r[5]=t,r[6]=n,r[7]=i):i=r[7],i}function dx({onUpdate:e,privateNote:t,taskId:n}){let s=(0,m.useRef)(null),[i,r]=(0,m.useState)(t??""),{retry:l,save:o,saveOnClose:d,state:c,unsaved:u}=dl({commit:e,field:"private",serverValue:t??"",taskId:n}),p=u??t??"";la({fieldRef:s,serverValue:p,setDraft:r});let h=(0,m.useRef)({draft:i,landed:p,saveOnClose:d,taskId:n});return h.current={draft:i,landed:p,saveOnClose:d,taskId:n},(0,m.useEffect)(function(){return()=>{let e=h.current;e.draft!==e.landed&&dh(e.saveOnClose,e.draft,{label:"Private note",taskId:e.taskId})}},[]),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)(df,{label:"Private note",onRetry:l,state:c}),(0,a.jsx)(I.Textarea,{"aria-label":"Private note",onBlur:()=>{i!==p&&o(i)},onChange:e=>r(e.target.value),placeholder:"Only you see this",ref:s,rows:3,value:i})]})}function dg(e){let t,n,i,c,u,p,h=(0,s.c)(26),{listId:f,parentId:x,teamId:g}=e,v=sZ(),b=(0,l.useQuery)(r.api.todos.queries.getSubtasks,{parentId:x})??[],y=(0,l.useMutation)(r.api.todos.mutations.create),j=(0,l.useMutation)(r.api.todos.mutations.toggle),I=(0,J.useSetOpenTaskId)(),[_,S]=(0,m.useState)("");h[0]!==y||h[1]!==f||h[2]!==x||h[3]!==g||h[4]!==_?(t=async()=>{let e=_.trim();e&&(await y({listId:f,parentId:x,teamId:g,text:e}),S(""))},h[0]=y,h[1]=f,h[2]=x,h[3]=g,h[4]=_,h[5]=t):t=h[5];let k=t;if(h[6]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(d.Text,{variant:"overline",children:"Sub-tasks"}),h[6]=n):n=h[6],h[7]!==b.length?(i=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[n,(0,a.jsx)(d.Text,{variant:"caption",children:b.length})]}),h[7]=b.length,h[8]=i):i=h[8],h[9]!==v||h[10]!==I||h[11]!==b||h[12]!==j){let e;h[14]!==v||h[15]!==I||h[16]!==j?(e=e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r2,{"aria-label":e.completed?"Mark task incomplete":"Mark task complete",disabled:!v,group:e.completed?"complete":"todo",onCycle:()=>j({completed:!e.completed,id:e._id})}),(0,a.jsxs)(o.Button,{className:"min-w-0 flex-1 justify-start",onClick:()=>I(e._id),variant:"ghost",children:[(0,a.jsx)(d.Text,{as:"span",className:"shrink-0",variant:"caption",children:e.identifier??"Task"}),(0,a.jsx)(d.Text,{as:"span",className:"truncate",variant:"bodySmall",children:e.text})]})]},e._id),h[14]=v,h[15]=I,h[16]=j,h[17]=e):e=h[17],c=b.map(e),h[9]=v,h[10]=I,h[11]=b,h[12]=j,h[13]=c}else c=h[13];
1return h[18]!==k||h[19]!==v||h[20]!==_?(u=v?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(ey.Input,{"aria-label":"Sub-task title",onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),k())},placeholder:"Add a sub-task",value:_}),(0,a.jsx)(o.Button,{"aria-label":"Add sub-task",disabled:0===_.trim().length,onClick:k,size:"icon",variant:"ghost",children:(0,a.jsx)(ef.Plus,{})})]}):null,h[18]=k,h[19]=v,h[20]=_,h[21]=u):u=h[21],h[22]!==i||h[23]!==c||h[24]!==u?(p=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[i,c,u]}),h[22]=i,h[23]=c,h[24]=u,h[25]=p):p=h[25],p}function dv(e){let t,n,i,o,c,u,m,h,x,g,v,b,y,j,I=(0,s.c)(68),{taskId:_,onClose:S}=e,{canEdit:k,isOwner:w,task:C,isLoading:T,updateText:N,updateDescription:D,updateIcon:L,updatePrivateNote:A,toggleComplete:P}=function(e){let t,n,a,i,o,d,c,u,m,p,h,x=(0,s.c)(31),{gate:g}=(0,f.useGuestGate)();x[0]!==g||x[1]!==e?(t=g({id:e}),x[0]=g,x[1]=e,x[2]=t):t=x[2];let v=(0,l.useQuery)(r.api.todos.queries.getById,t);x[3]!==g||x[4]!==e?(n=g({ref:e}),x[3]=g,x[4]=e,x[5]=n):n=x[5];let b=(0,l.useQuery)(r.api.todos.shared.getTaskPermalinkAccess,n),y=(0,l.useQuery)(r.api.auth_setup.getCurrentUser),j=(0,l.useMutation)(r.api.todos.mutations.update);x[6]!==j?(a=j.withOptimisticUpdate(ol),x[6]=j,x[7]=a):a=x[7];let I=a,_=(0,l.useMutation)(r.api.todos.mutations.toggle);x[8]!==_?(i=_.withOptimisticUpdate(or),x[8]=_,x[9]=i):i=x[9];let S=i,k=b?.access==="public"&&b.canEdit,w=void 0===v,C=!!(v&&y&&v.userId===y._id),T=v??null;return x[10]!==e||x[11]!==S?(o=t=>
1S({completed:t,id:e}),x[10]=e,x[11]=S,x[12]=o):o=x[12],x[13]!==e||x[14]!==I?(d=t=>I({descriptionJson:t,id:e}),c=t=>I({iconData:t,id:e}),u=t=>I({id:e,note:t}),m=t=>I({id:e,privateNote:t}),p=t=>I({id:e,text:t}),x[13]=e,x[14]=I,x[15]=d,x[16]=c,x[17]=u,x[18]=m,x[19]=p):(d=x[15],c=x[16],u=x[17],m=x[18],p=x[19]),x[20]!==o||x[21]!==d||x[22]!==c||x[23]!==u||x[24]!==m||x[25]!==p||x[26]!==k||x[27]!==w||x[28]!==C||x[29]!==T?(h={canEdit:k,isLoading:w,isOwner:C,task:T,toggleComplete:o,updateDescription:d,updateIcon:c,updateNote:u,updatePrivateNote:m,updateText:p},x[20]=o,x[21]=d,x[22]=c,x[23]=u,x[24]=m,x[25]=p,x[26]=k,x[27]=w,x[28]=C,x[29]=T,x[30]=h):h=x[30],h}(_);if(T){let e,t,n,s;return I[0]!==_?(e={id:_,kind:"loading"},I[0]=_,I[1]=e):e=I[1],I[2]!==S||I[3]!==e?(t=(0,a.jsx)(oD,{onClose:S,task:e}),I[2]=S,I[3]=e,I[4]=t):t=I[4],I[5]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(oi.PanelSkeleton,{className:"flex-1"}),I[5]=n):n=I[5],I[6]!==t?(s=(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[t,n]}),I[6]=t,I[7]=s):s=I[7],s}if(!C){let e,t,n,s;return I[8]!==_?(e={id:_,kind:"loading"},I[8]=_,I[9]=e):e=I[9],I[10]!==S||I[11]!==e?(t=(0,a.jsx)(oD,{onClose:S,task:e}),I[10]=S,I[11]=e,I[12]=t):t=I[12],I[13]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center gap-1 text-muted-foreground",children:(0,a.jsx)(d.Text,{variant:"bodySmall",children:"This task is no longer available"})}),I[13]=n):n=I[13],I[14]!==t?(s=(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[t,n]}),I[14]=t,I[15]=s):s=I[15],s}return I[16]!==C.identifier?(t=C.identifier&&{identifier:C.identifier},I[16]=C.identifier,I[17]=t):t=I[17],I[18]!==C.listId?(n=C.listId&&{listId:C.listId},I[18]=C.listId,I[19]=n):n=I[19],I[20]!==t||I[21]!==n||I[22]!==C.text||I[23]!==_?(i={id:_,...t,kind:"ready",...n,text:C.text},I[20]=t,I[21]=n,I[22]=C.text,I[23]=_,I[24]=i):i=I[24],I[25]!==S||I[26]!==i?(o=(0,a.jsx)(oD,{onClose:S,task:i}),I[25]=S,I[26]=i,I[27]=o):o=I[27],I[28]!==C||I[29]!==L||I[30]!==N?(c=(0,a.jsx)(db,{onUpdateIcon:L,onUpdateText:N,task:C}),I[28]=C,I[29]=L,I[30]=N,I[31]=c):c=I[31],I[32]!==C||I[33]!==P?(u=(0,a.jsx)(o7,{onToggleComplete:P,task:C}),I[32]=C,I[33]=P,I[34]=u):u=I[34],I[35]!==w||I[36]!==C._id||I[37]!==C.descriptionJson||I[38]!==C.note||I[39]!==C.privateNote||I[40]!==D||I[41]!==A?(m=(0,a.jsx)(du,{descriptionJson:C.descriptionJson,legacyNote:C.note,onUpdateDescription:D,onUpdatePrivateNote:A,privateNote:C.privateNote,showPrivateNote:w,taskId:C._id},C._id),I[35]=w,I[36]=C._id,I[37]=C.descriptionJson,I[38]=C.note,I[39]=C.privateNote,I[40]=D,I[41]=A,I[42]=m):m=I[42],I[43]!==C._id||I[44]!==C.listId||I[45]!==C.teamId?(h=(0,a.jsx)(dg,{listId:C.listId,parentId:C._id,teamId:C.teamId}),I[43]=C._id,I[44]=C.listId,I[45]=C.teamId,I[46]=h):h=I[46],I[47]!==C._id?(g=(0,a.jsx)(oO,{taskId:C._id}),x=(0,a.jsx)(oS,{taskId:C._id}),I[47]=C._id,I[48]=x,I[49]=g):(x=I[48],g=I[49]),I[50]!==C._id||I[51]!==C.createdAt?(v=(0,a.jsx)(op,{createdAt:C.createdAt,taskId:C._id}),I[50]=C._id,I[51]=C.createdAt,I[52]=v):v=I[52],I[53]!==x||I[54]!==v||I[55]!==c||I[56]!==u||I[57]!==m||I[58]!==h||I[59]!==g?(b=(0,a.jsx)(p.AppContentBody,{classNameViewport:"px-5 py-4 sm:px-8 max-md:pb-[calc(var(--mobile-bottom-bar-height,4rem)+env(safe-area-inset-bottom,0px))]",maskBottom:!1,children:(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-5",children:[c,u,m,h,g,x,v]})}),I[53]=x,I[54]=v,I[55]=c,I[56]=u,I[57]=m,I[58]=h,I[59]=g,I[60]=b):b=I[60],I[61]!==b||I[62]!==o||I[63]!==_?(y=(0,a.jsxs)(oI,{className:"flex h-full flex-col",taskId:_,children:[o,b]}),I[61]=b,I[62]=o,I[63]=_,I[64]=y):y=I[64],I[65]!==k||I[66]!==y?(j=(0,a.jsx)(sJ,{value:k,children:y}),I[65]=k,I[66]=y,I[67]=j):j=I[67],j}function db(e){let t,n,i,r,l,o,c,u,p,h,f=(0,s.c)(21),{onUpdateIcon:x,onUpdateText:g,task:v}=e,b=sZ(),[y,j]=(0,m.useState)(v.text),_=(0,m.useRef)(null);(h=(0,s.c)(3))[0]!==_?(u=function(){let e=e=>{let{target:t}=e,n=t instanceof HTMLElement&&(t.isContentEditable||"INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName);"e"!==e.key.toLowerCase()||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||n||(e.preventDefault(),_.current?.focus())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},p=[_],h[0]=_,h[1]=u,h[2]=p):(u=h[1],p=h[2]),(0,m.useEffect)(u,p),f[0]!==v.text?(t=function(){j(v.text)},n=[v.text],f[0]=v.text,f[1]=t,f[2]=n):(t=f[1],n=f[2]),(0,m.useEffect)(t,n),f[3]!==y||f[4]!==g||f[5]!==v.text?(i=()=>{let e=y.trim();e&&e!==v.text?g(e):e||j(v.text)},f[3]=y,f[4]=g,f[5]=v.text,f[6]=i):i=f[6];let S=i;f[7]!==b||f[8]!==x||f[9]!==v.iconData||f[10]!==v.listId?(r=(0,a.jsx)(dj,{canEdit:b,iconData:v.iconData,listId:v.listId,onUpdateIcon:x}),f[7]=b,f[8]=x,f[9]=v.iconData,f[10]=v.listId,f[11]=r):r=f[11],f[12]===Symbol.for("react.memo_cache_sentinel")?(l=e=>j(e.target.value),f[12]=l):l=f[12];let k=!b,w=b?"Edit task (E)":void 0;return f[13]!==S||f[14]!==y||f[15]!==k||f[16]!==w?(o=(0,a.jsx)(I.Textarea,{className:"w-full",onBlur:S,onChange:l,onKeyDown:dy,placeholder:"Task title",readOnly:k,ref:_,rows:1,size:"title",title:w,value:y,variant:"flush"}),f[13]=S,f[14]=y,f[15]=k,f[16]=w,f[17]=o):o=f[17],f[18]!==r||f[19]!==o?(c=(0,a.jsx)(s8,{className:d.PAGE_TITLE_TEXT_CLASS,lead:r,children:o}),f[18]=r,f[19]=o,f[20]=c):c=f[20],c}function dy(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),e.currentTarget.blur())}function dj(e){let t,n,i,r,l=(0,s.c)(12),{canEdit:o,iconData:d,listId:c,onUpdateIcon:u}=e,m=s5(d,c);l[0]!==m?(t=(0,a.jsx)("span",{className:"flex size-[0.72em] items-center justify-center [&_*]:size-full!",children:(0,a.jsx)(em.IconDisplay,{size:17,value:m})}),l[0]=m,l[1]=t):t=l[1];let p=t;if(!o){let e;return l[2]!==p?(e=(0,a.jsx)("span",{className:s7,children:p}),l[2]=p,l[3]=e):e=l[3],e}return l[4]!==u?(n=e=>u((0,eI.toConvexIconData)(e)??null),l[4]=u,l[5]=n):n=l[5],l[6]!==d?(i=(0,eI.fromConvexIconData)(d),l[6]=d,l[7]=i):i=l[7],l[8]!==p||l[9]!==n||l[10
1]!==i?(r=(0,a.jsx)(sb.IconPicker,{onChange:n,triggerClassName:s7,value:i,children:p}),l[8]=p,l[9]=n,l[10]=i,l[11]=r):r=l[11],r}var dI=e.i(990574),d_=e.i(214259),dS=e.i(600493);function dk(e,t,n){for(let[a,s]of t)if(n(s).some(t=>t._id===e))return a}function dw(e,t,n){return void 0===e?[]:n(t.get(e)??[])}async function dC(e){let{activeId:t,getChildLists:n,insertIndex:a,listsByParent:s,moveList:i,reorderLists:r,selectParentList:l,selectMyTasks:o,sortedParentLists:d,sourceParent:c,sourceParentId:u,targetParentId:m}=e;await i({id:t,parentId:m});let p=dw(c,s,n).filter(e=>e._id!==t).map(e=>e._id);await r({parentId:u,listIds:p});let h=n(void 0===m?s.get("default")??[]:s.get(m)??[]),f=[...h.slice(0,a).map(e=>e._id),t,...h.slice(a).map(e=>e._id)];if(await r({parentId:m,listIds:f}),void 0===m)o();else{let e=d.find(e=>e._id===m);l(m,e?.teamId)}}function dT(e){return e._id}function dN(e){let t,n,a,r,l,o,d,c=(0,s.c)(13),{items:u,onReorder:p}=e,[h,f]=(0,m.useState)(null),[x,g]=(0,m.useState)(null),v=(0,m.useRef)(null),b=(0,m.useRef)(null);c[0]===Symbol.for("react.memo_cache_sentinel")?(t={activationConstraint:{distance:8}},c[0]=t):t=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{delay:200,tolerance:5}},c[1]=n):n=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:tE.sortableKeyboardCoordinates},c[2]=a):a=c[2];let y=(0,i.useSensors)((0,i.useSensor)(i.PointerSensor,t),(0,i.useSensor)(i.TouchSensor,n),(0,i.useSensor)(i.KeyboardSensor,a));c[3]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{let t,n=String(e.active.id),a={activeId:n,overId:n};v.current=a,f(n),g(a),b.current=(t=e.activatorEvent)&&"clientY"in t?t.clientY:null},c[3]=r):r=c[3];let j=r;c[4]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let t;if(!e.over)return;let n=String(e.over.id),a="rect"in e.over?e.over.rect:null,s=b.current;a&&null!==s&&(t=s+e.delta.y<a.top+a.height/2?"above":"below");let i={activeId:String(e.active.id),overId:n,...void 0!==t&&{insertPosition:t}};v.current=i,g(i)},c[4]=l):l=c[4];let I=l;c[5]!==u||c[6]!==p?(o=async e=>{let{active:t,over:n}=e,a=v.current;v.current=null,b.current=null,f(null),g(null);let s=a?.overId??(n&&String(n.id))??null;if(!s||t.id===s)return;let i=u.findIndex(e=>e._id===t.id),r=u.findIndex(e=>e._id===s);if(-1===i||-1===r)return;let l=Math.max(0,Math.min("above"===(a?.insertPosition??(i>r?"above":"below"))?r:r+1,u.length)),o=(0,tE.arrayMove)(u,i,l);await p(o.map(dD))},c[5]=u,c[6]=p,c[7]=o):o=c[7];let _=o;return c[8]!==h||c[9]!==_||c[10]!==x||c[11]!==y?(d={activeId:h,handleDragEnd:_,handleDragOver:I,handleDragStart:j,projection:x,sensors:y},c[8]=h,c[9]=_,c[10]=x,c[11]=y,c[12]=d):d=c[12],d}function dD(e){return e._id}function dL(e){return null!=e}function dA(e,t){return null===t?e:t}function dP(){let e,t,n,a,i,o,d,c,u,m,p=(0,s.c)(41),{gate:h}=(0,f.useGuestGate)(),{myTasksListId:x}=(0,D.useMyTasksListId)(),{rootLists:g}=(0,y.useFeatureLimits)(),b=(0,v.useOnOpenApp)(),j=!g.canCreate,I=(0,J.useSelectParentList)(),_=(0,J.useSelectList)(),S=(0,J.useEditingParentListName)(),k=(0,J.useSetEditingParentListId)(),w=(0,J.useSetEditingParentListName)(),C=(0,l.useQuery)(r.api.todo_lists.queries.getAllPersonalForSidebar,h({}))??[];if(p[0]!==x||p[1]!==C){let t;p[3]!==x?(t=e=>null==e.parentId&&null==e.teamId&&(null==x||e._id!==x),p[3]=x,p[4]=t):t=p[4],e=C.filter(t),p[0]=x,p[1]=C,p[2]=e}else e=p[2];let T=e,N=(0,l.useQuery)(r.api.teams.queries.getAll,h({}))??[];p[5]!==N?(t=N.filter(dM),p[5]=N,p[6]=t):t=p[6];let L=t,{createList:A,updateList:P}=(0,ek.useTodoLists)(),O=(0,l.useMutation)(r.api.todo_lists.mutations.create),E=(0,l.useMutation)(r.api.todo_lists.list_organization.reorderLists);p[7]!==E?(n=E.withOptimisticUpdate(dE),p[7]=E,p[8]=n):n=p[8];let M=n,R=(0,l.useMutation)(r.api.todo_lists.mutations.update);p[9]!==R?(a=R.withOptimisticUpdate(dO),p[9]=R,p[10]=a):a=p[10];let z=a;p[11]!==S||p[12]!==k||p[13]!==w||p[14]!==z?(i={editingParentListName:S,setEditingParentListId:k,setEditingParentListName:w,updateParentList:z},p[11]=S,p[12]=k,p[13]=w,p[14]=z,p[15]=i):i=p[15];let{handleParentListKeyDown:B,handleSaveParentListName:U}
1=function({editingParentListName:e,setEditingParentListId:t,setEditingParentListName:n,updateParentList:a}){let s=async s=>{let i=e.trim();t(null),n(""),i&&await a({id:s,name:i})};return{handleParentListKeyDown:async(e,a)=>{" "===e.key?e.stopPropagation():("Enter"===e.key&&(e.preventDefault(),await s(a).catch(console.error)),"Escape"===e.key&&(t(null),n("")))},handleSaveParentListName:s}}(i);p[16]!==z?(o=async(e,t,n)=>{await z({id:e,name:t,iconData:void 0===n?null:(0,eI.toConvexIconData)(n)})},p[16]=z,p[17]=o):o=p[17];let F=o;p[18]!==O||p[19]!==j||p[20]!==b||p[21]!==I?(d=async()=>{if(j)return void eS(()=>b?.("settings",{activeTab:"billing"}));let e=await O({name:"New list",iconData:(0,eI.toConvexIconData)(ex)});if(e?._id)return I(e._id,e.teamId),e._id},p[18]=O,p[19]=j,p[20]=b,p[21]=I,p[22]=d):d=p[22];let G=d;p[23]!==A||p[24]!==_?(c=async(e,t)=>{let n=await A({name:"New list",parentId:e,teamId:t??void 0,iconData:(0,eI.toConvexIconData)(ex)});n?._id&&_(n._id,n.parentId,n.teamId,n.name,n.iconData)},p[23]=A,p[24]=_,p[25]=c):c=p[25];let q=c;p[26]!==k||p[27]!==w?(u=(e,t)=>{k(e),w(t)},p[26]=k,p[27]=w,p[28]=u):u=p[28];let $=u;return p[29]!==O||p[30]!==G||p[31]!==q||p[32]!==F||p[33]!==B||p[34]!==U||p[35]!==T||p[36]!==M||p[37]!==$||p[38]!==L||p[39]!==P?(m={createParentList:O,parentLists:T,handleAddParentList:G,handleAddSubList:q,handleParentListIconChange:F,handleParentListKeyDown:B,handleSaveParentListName:U,reorderLists:M,startEditParentList:$,teams:L,updateList:P},p[29]=O,p[30]=G,p[31]=q,p[32]=F,p[33]=B,p[34]=U,p[35]=T,p[36]=M,p[37]=$,p[38]=L,p[39]=P,p[40]=m):m=p[40],m}function dO(e,t){let n=(0,ee.buildListUpdatePatch)(t);(0,ee.applyListPatchToQueries)(e,t.id,n)}function dE(e,t){(0,ee.applyListReorderToQueries)(e,t)}function dM(e){return null!=e}function dR(e){let t,n,i,r,l,o=(0,s.c)(12),{list:d,onSelect:u}=e,{myTasksListId:m}=(0,D.useMyTasksListId)(),p=d._id===m;o[0]!==d.iconData?(t=(0,eI.fromConvexIconData)(d.iconData)??ex,o[0]=d.iconData,o[1]=t):t=o[1];let h=t;o[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,j.cn)("relative flex min-h-14 w-24 shrink-0 cursor-pointer snap-start flex-col items-center gap-1.5 rounded-lg px-2 py-2 max-md:w-28 max-md:gap-2 max-md:px-3 max-md:py-2.5","bg-card transition-colors hover:bg-surface-hover"),o[2]=n):n=o[2],o[3]!==h||o[4]!==p?(i=(0,a.jsx)("span",{className:"flex h-7 w-7 items-center justify-center text-lg max-md:h-8 max-md:w-8",children:p?(0,a.jsx)(eg.MyTasksIcon,{size:16}):(0,a.jsx)(em.IconDisplay,{fallback:(0,a.jsx)(c.ListTodo,{className:"h-4 w-4 text-muted-foreground"}),size:16,value:h})}),o[3]=h,o[4]=p,o[5]=i):i=o[5];let f=d.name||"Untitled";return o[6]!==f?(r=(0,a.jsx)("span",{className:"w-full truncate text-center text-[10px] text-muted-foreground leading-tight max-md:text-xs",children:f}),o[6]=f,o[7]=r):r=o[7],o[8]!==u||o[9]!==i||o[10]!==r?(l=(0,a.jsxs)("button",{className:n,onClick:u,type:"button",children:[i,r]}),o[8]=u,o[9]=i,o[10]=r,o[11]=l):l=o[11],l}function dz(){let e,t=(0,s.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(a.Fragment,{children:Array.from({length:3},dB)}),t[0]=e):e=t[0],e}function dB(e,t){return(0,a.jsxs)("div",{className:"flex min-h-14 w-24 shrink-0 snap-start flex-col items-center gap-1.5 rounded-lg bg-foreground
1/5 px-2 py-2 max-md:w-28 max-md:gap-2 max-md:px-3 max-md:py-2.5",children:[(0,a.jsx)("div",{className:"h-7 w-7"}),(0,a.jsx)("div",{className:"h-2.5 w-14"})]},`skeleton-${String(t)}`)}function dU(e){let t,n,i,r,l,o,d=(0,s.c)(20),{allLists:c,lists:u,isLoading:p,onSelectList:h}=e,{parentLists:f,handleAddParentList:x,teams:g}=dP(),v=(0,J.useSelectList)(),b=(0,m.useRef)(null),y=(0,m.useRef)("");d[0]!==c?(t=c.map(dF).join("|"),d[0]=c,d[1]=t):t=d[1];let j=t;return(d[2]!==p||d[3]!==u.length||d[4]!==j?(n=function(){if(p||0===u.length)return;let e=y.current,t=e.length>0&&e!==j;if(y.current=j,!t)return;let n=b.current;n&&n.scrollTo({left:0,behavior:"smooth"})},i=[p,u.length,j],d[2]=p,d[3]=u.length,d[4]=j,d[5]=n,d[6]=i):(n=d[5],i=d[6]),(0,m.useEffect)(n,i),p||0!==u.length)?(d[7]!==p?(r=p&&(0,a.jsx)(dz,{}),d[7]=p,d[8]=r):r=d[8],d[9]!==x||d[10]!==p||d[11]!==u||d[12]!==h||d[13]!==f||d[14]!==v||d[15]!==g?(l=!p&&u.length>0&&u.map(e=>(0,a.jsx)(lb,{allParentLists:[...f],className:"shrink-0",listId:e._id,listName:e.name,onCreateParentList:x,onSelectList:v,parentId:e.parentId,teamId:e.teamId,teams:[...g],children:(0,a.jsx)(dR,{list:e,onSelect:()=>h(e._id,e.parentId,e.teamId,e.name,(0,eI.fromConvexIconData)(e.iconData))})},e._id)),d[9]=x,d[10]=p,d[11]=u,d[12]=h,d[13]=f,d[14]=v,d[15]=g,d[16]=l):l=d[16],d[17]!==r||d[18]!==l?(o=(0,a.jsx)("div",{className:"space-y-1.5",children:(0,a.jsx)(tm.ScrollArea,{classNameViewport:"snap-x snap-proximity scroll-smooth py-1",viewportRef:b,children:(0,a.jsxs)("div",{className:"flex gap-1.5",children:[r,l]})})}),d[17]=r,d[18]=l,d[19]=o):o=d[19],o):null}function dF(e){return`${e._id}:${String(e.updatedAt)}`}function dG(e){let t,n,i,r,l,d,c,u,m=(0,s.c)(49),{editingParentListName:p,parentList:h,hasLists:f,isActive:x,isEditing:g,isExpanded:v,onAddSubList:b,onBlur:y,onEditingParentListNameChange:I,onIconChange:_,onKeyDown:S,onSelectParentList:k,onToggleExpand:w}=e,{uploadedImages:C,onUploadImage:T,onDeleteImage:N,onTouchImage:D}=(0,sy.useIconUpload)(),L=h.iconData??ex,A=!!_;m[0]!==L||m[1]!==N||m[2]!==_||m[3]!==D||m[4]!==T||m[5]!==h.iconData||m[6]!==A||m[7]!==C?(t=A&&_?(0,a.jsx)(sb.IconPicker,{disabled:!1,onChange:_,onDeleteImage:N,onTouchImage:D,onUploadImage:T,triggerSize:16,uploadedImages:C,value:h.iconData,children:(0,a.jsx)(em.IconDisplay,{size:16,value:L})}):(0,a.jsx)(em.IconDisplay,{size:16,value:L}),m[0]=L,m[1]=N,m[2]=_,m[3]=D,m[4]=T,m[5]=h.iconData,m[6]=A,m[7]=C,m[8]=t):t=m[8];let P=t;
1if(g){let e,t,n,s,i,r,l,o=x&&"bg-foreground/8 text-foreground";return m[9]!==o?(e=(0,j.cn)("nodrag flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 transition-colors hover:bg-surface-hover",o),m[9]=o,m[10]=e):e=m[10],m[11]!==L?(t=(0,a.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:(0,a.jsx)(em.IconDisplay,{size:16,value:L})}),m[11]=L,m[12]=t):t=m[12],m[13]===Symbol.for("react.memo_cache_sentinel")?(n=iF("normal"),m[13]=n):n=m[13],m[14]!==I?(s=e=>I(e.target.value),m[14]=I,m[15]=s):s=m[15],m[16]!==S||m[17]!==h._id?(i=e=>S(e,h._id),m[16]=S,m[17]=h._id,m[18]=i):i=m[18],m[19]!==p||m[20]!==y||m[21]!==s||m[22]!==i?(r=(0,a.jsx)(ey.Input,{autoFocus:!0,className:n,onBlur:y,onChange:s,onFocus:dq,onKeyDown:i,size:"sm",value:p,variant:"ghost"}),m[19]=p,m[20]=y,m[21]=s,m[22]=i,m[23]=r):r=m[23],m[24]!==e||m[25]!==t||m[26]!==r?(l=(0,a.jsxs)("div",{className:e,children:[t,r]}),m[24]=e,m[25]=t,m[26]=r,m[27]=l):l=m[27],l}let O=x&&"bg-foreground/8 text-foreground";return m[28]!==O?(n=(0,j.cn)("group/row flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 transition-colors hover:bg-surface-hover",O),m[28]=O,m[29]=n):n=m[29],m[30]!==P?(i=(0,a.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:P}),m[30]=P,m[31]=i):i=m[31],m[32]!==h.name?(r=(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:h.name}),m[32]=h.name,m[33]=r):r=m[33],m[34]!==k||m[35]!==r?(l=(0,a.jsx)(o.Button,{className:"min-w-0 flex-1 cursor-pointer justify-start rounded-md border-0 bg-transparent px-0 py-0 text-start font-normal text-sm hover:bg-transparent dark:hover:bg-transparent",onClick:k,variant:"ghost",children:r}),m[34]=k,m[35]=r,m[36]=l):l=m[36],m[37]!==b?(d=b&&(0,a.jsxs)(ah.Tooltip,{children:[(0,a.jsx)(ah.TooltipTrigger,{render:(0,a.jsx)(o.Button,{"aria-label":"Add sub-list",className:"h-5 w-5 shrink-0 text-muted-foreground opacity-0 transition-opacity hover:bg-transparent group-hover/row:opacity-100 max-md:opacity-100 dark:hover:bg-transparent [&_svg]:transition-transform [&_svg]:duration-200 hover:[&_svg]:scale-110 active:[&_svg]:scale-110",onClick:e=>{e.stopPropagation(),b()},size:"icon",variant:"ghost",children:(0,a.jsx)(ef.Plus,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(ah.TooltipContent,{children:"Add sub-list"})]}),m[37]=b,m[38]=d):d=m[38],m[39]!==f||m[40]!==v||m[41]!==w?(c=f&&(0,a.jsx)(o.Button,{"aria-expanded":v,"aria-label":v?"Collapse":"Expand",className:"h-6 w-6 shrink-0 rounded hover:bg-transparent aria-expanded:bg-transparent dark:aria-expanded:bg-transparent dark:hover:bg-transparent",onClick:e=>{e.preventDefault(),e.stopPropagation(),w(e)},size:"icon",title:v?"Collapse":"Expand",variant:"ghost",children:v?(0,a.jsx)(eh.ChevronDown,{className:"h-3.5 w-3.5"}):(0,a.jsx)(n0.ChevronRight,{className:"h-3.5 w-3.5"})}),m[39]=f,m[40]=v,m[41]=w,m[42]=c):c=m[42],m[43]!==n||m[44]!==i||m[45]!==l||m[46]!==d||m[47]!==c?(u=(0,a.jsxs)("div",{className:n,children:[i,l,d,c]}),m[43]=n,m[44]=i,m[45]=l,m[46]=d,m[47]=c,m[48]=u):u=m[48],u}function dq(e){return e.target.select()}function d$(e){let t,n,r=(0,s.c)(4),{children:l}=e;r[0]===Symbol.for("react.memo_cache_sentinel")?(t={id:"my-tasks",data:{type:"my-tasks"}},r[0]=t):t=r[0];let{setNodeRef:o}=(0,i.useDroppable)(t);return r[1]!==l||r[2]!==o?(n=(0,a.jsx)("div",{className:"w-full min-w-0 rounded-md",ref:o,children:l}),r[1]=l,r[2]=o,r[3]=n):n=r[3],n}function dK(e){let t,n,r,l,o=(0,s.c)(22),{editingParentListName:d,parentList:c,isActive:u,isEditing:m,onBlur:p,onEditingParentListNameChange:h,onIconChange:f,onAddSubList:x,onKeyDown:g,onSelectParentList:v,onToggleExpand:b,hasLists:y,isExpanded:j}=e;o[0]!==c._id?(t={type:"parent-list",parentId:c._id},o[0]=c._id,o[1]=t):t=o[1],o[2]!==c._id||o[3]!==t?(n={id:c._id,data:t},o[2]=c._id,o[3]=t,o[4]=n):n=o[4];let{setNodeRef:I}=(0,i.useDroppable)(n);return o[5]!==d||o[6]!==y||o[7]!==u||o[8]!==m||o[9]!==j||o[10]!==x||o[11]!==p||o[12]!==h||o[13]!==f||o[14]!==g||o[15]!==v||o[16]!==b||o[17]!==c?(r=(0,a.jsx)(dG,{editingParentListName:d,hasLists:y,isActive:u,isEditing:m,isExpanded:j,onAddSubList:x,onBlur:p,onEditingParentListNameChange:h,onIconChange:f,onKeyDown:g,onSelectParentList:v,onToggleExpand:b,parentList:c}),o[5]=d,o[6]=y,o[7]=u,o[8]=m,o[9]=j,o[10]=x,o[11]=p,o[12]=h,o[13]=f,o[14]=g,o[15]=v,o[16]=b,o[17]=c,o[18]=r):r=o[18],o[19]!==I||o[20]!==r?(l=(0,a.jsx)("div",{className:"w-full min-w-0 rounded-md",ref:I,children:r}),o[19]=I,o[20]=r,o[21]=l):l=o[21],l}let dQ={};function dV(e,t,n){if(!t||t.overId!==e)return dQ;let a=n.indexOf(t.overId);return -1===a?dQ:{position:t.insertPosition??(n.indexOf(t.activeId)>a?"above":"below")}}function dW(e){let t,n,i,r=(0,s.c)(5),{position:l}=e,o="above"===l?"-top-px":"-bottom-px";return r[0]!==o?(t=(0,j.cn)("pointer-events-none absolute right-2 left-2 z-10 h-[2.5px] rounded-full bg-primary",o),r[0]=o,r[1]=t):t=r[1],r[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)("div",{className:"absolute top-1/2 left-0 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 roun
1ded-full bg-primary"}),r[2]=n):n=r[2],r[3]!==t?(i=(0,a.jsx)("div",{className:t,children:n}),r[3]=t,r[4]=i):i=r[4],i}function dH(e){let t,n,i,r,l,d,c=(0,s.c)(22),{list:u,isActive:m,onIconChange:p,onSelectList:h}=e,{uploadedImages:f,onUploadImage:x,onDeleteImage:g,onTouchImage:v}=(0,sy.useIconUpload)(),b=u.iconData??ex,y=!!p;c[0]!==y||c[1]!==b||c[2]!==u.iconData||c[3]!==g||c[4]!==p||c[5]!==v||c[6]!==x||c[7]!==f?(t=y&&p?(0,a.jsx)("span",{"data-list-sidebar-icon":!0,children:(0,a.jsx)(sb.IconPicker,{disabled:!1,onChange:p,onDeleteImage:g,onTouchImage:v,onUploadImage:x,triggerSize:16,uploadedImages:f,value:u.iconData,children:(0,a.jsx)(em.IconDisplay,{size:16,value:b})})}):(0,a.jsx)(em.IconDisplay,{size:16,value:b}),c[0]=y,c[1]=b,c[2]=u.iconData,c[3]=g,c[4]=p,c[5]=v,c[6]=x,c[7]=f,c[8]=t):t=c[8];let I=t,_=m&&"bg-foreground/8 text-foreground";return c[9]!==_?(n=(0,j.cn)("flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 transition-colors hover:bg-surface-hover",_),c[9]=_,c[10]=n):n=c[10],c[11]!==I?(i=(0,a.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:I}),c[11]=I,c[12]=i):i=c[12],c[13]!==u.name?(r=(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:u.name}),c[13]=u.name,c[14]=r):r=c[14],c[15]!==h||c[16]!==r?(l=(0,a.jsx)(o.Button,{className:"min-w-0 flex-1 cursor-pointer justify-start rounded-md border-0 bg-transparent px-0 py-0 text-start font-normal text-sm hover:bg-transparent dark:hover:bg-transparent",onClick:h,variant:"ghost",children:r}),c[15]=h,c[16]=r,c[17]=l):l=c[17],c[18]!==n||c[19]!==i||c[20]!==l?(d=(0,a.jsxs)("div",{className:n,children:[i,l]}),c[18]=n,c[19]=i,c[20]=l,c[21]=d):d=c[21],d}function dY(e){let t,n,i,r,l,o,d,c,u=(0,s.c)(26),{dropIndicator:m,list:p,isActive:h,onIconChange:f,onSelectList:x}=e;u[0]!==p._id?(t={animateLayoutChanges:dX,id:p._id},u[0]=p._id,u[1]=t):t=u[1];let{attributes:g,listeners:v,setNodeRef:b,transform:y,transition:I,isDragging:_}=(0,tE.useSortable)(t);u[2]!==_||u[3]!==y?(n=_?tr.CSS.Transform.toString(y):void 0,u[2]=_,u[3]=y,u[4]=n):n=u[4];let S=_?.5:1;u[5]!==n||u[6]!==S||u[7]!==I?(i={transform:n,transition:I,opacity:S},u[5]=n,u[6]=S,u[7]=I,u[8]=i):i=u[8];let k=i;return u[9]!==m?(r=m?.position&&(0,a.jsx)(dW,{position:m.position}),u[9]=m,u[10]=r):r=u[10],u[11]===Symbol.for("react.memo_cache_sentinel")?(l=(0,j.cn)("cursor-grab active:cursor-grabbing","[&_[data-list-sidebar-icon]]:cursor-default [&_[data-list-sidebar-icon]]:active:cursor-default"),u[11]=l):l=u[11],u[12]!==h||u[13]!==p||u[14]!==f||u[15]!==x?(o=(0,a.jsx)(dH,{isActive:h,list:p,onIconChange:f,onSelectList:x}),u[12]=h,u[13]=p,u[14]=f,u[15]=x,u[16]=o):o=u[16],u[17]!==g||u[18]!==v||u[19]!==b||u[20]!==k||u[21]!==o?(d=(0,a.jsx)("div",{ref:b,style:k,...g,...v,className:l,children:o}),u[17]=g,u[18]=v,u[19]=b,u[20]=k,u[21]=o,u[22]=d):d=u[22],u[23]!==r||u[24]!==d?(c=(0,a.jsxs)("div",{className:"relative",children:[r,d]}),u[23]=r,u[24]=d,u[25]=c):c=u[25],c}function dX(){return!1}function dJ(e){let t,n,i,r,l,o,d,c,u,m=(0,s.c)(41),{list:p,listIds:h,listProjection:f,sortable:x}=e,g=void 0!==x&&x,v=(0,J.useCurrentListId)(),b=(0,J.useTeamId)(),y=(0,J.useSelectList)(),{parentLists:j,handleAddParentList:I,teams:_,updateList:S}=dP();m[0]!==p._id||m[1]!==h||m[2]!==f||m[3]!==g?(t=g?dV(p._id,f,h):{},m[0]=p._id,m[1]=h,m[2]=f,m[3]=g,m[4]=t):t=m[4];let k=t;m[5]!==j?(n=[...j],m[5]=j,m[6]=n):n=m[6],m[7]!==_?(i=[..._],m[7]=_,m[8]=i):i=m[8],m[9]!==I||m[10]!==p._id||m[11]!==p.name||m[12]!==p.parentId||m[13]!==p.teamId||m[14]!==y||m[15]!==n||m[16]!==i?(r={allParentLists:n,parentId:p.parentId,listId:p._id,listName:p.name,onCreateParentList:I,onSelectList:y,teams:i,teamId:p.teamId},m[9]=I,m[10]=p._id,m[11]=p.name,m[12]=p.parentId,m[13]=p.teamId,m[14]=y,m[15]=n,m[16]=i,m[17]=r):r=m[17];let w=r,C=v===p._id&&!b;m[18]!==p._id||m[19]!==p.name||m[20]!==S?(l=async e=>{await S({id:p._id,name:p.name,iconData:void 0===e?null:(0,eI.toConvexIconData)(e)})},m[18]=p._id,m[19]=p.name,m[20]=S,m[21]=l):l=m[21],m[22]!==p._id||m[23]!==p.iconData||m[24]!==p.name||m[25]!==p.parentId||m[26]!==p.teamId||m[27]!==y?(o=()=>y(p._id,p.parentId,p.teamId,p.name,(0,eI.fromConvexIconData)(p.iconData)),m[22]=p._id,m[23]=p.iconData,m[24]=p.name,m[25]=p.parentId,m[26]=p.teamId,m[27]=y,m[28]=o):o=m[28],m[29]!==p||m[30]!==C||m[31]!==l||m[32]!==o?(d={isActive:C,list:p,onIconChange:l,onSelectList:o},m[29]=p,m[30]=C,m[31]=l,m[32]=o,m[33]=d):d=m[33];let T=d;return m[34]!==k||m[35]!==T||m[36]!==g?(c=g?(0,a.jsx)(dY,{dropIndicator:k,...T}):(0,a.jsx)(dH,{...T}),m[34]=k,m[35]=T,m[36]=g,m[37]=c):c=m[37],m[38]!==w||m[39]!==c?(u=(0,a.jsx)(lb,{...w,children:c}),m[38]=w,m[39]=c,m[40]=u):u=m[40],u}function dZ({canDrag:e=!1,filteredDefaultLists:t,hasMyTasksLists:n,isMyTasksActive:s,isMyTasksExpanded:r,listProjection:l,myTasksLabel:d,onAddSubList:c,onCloseMobileSidebar:u,onReorderLists:p,onSelectMyTasks:h,onToggleExpand:f}){let[x,g]=(0,m.useOptimistic)(t,(e,t)=>null===t?e:t),v=async e=>{let t=e.map(e=>x.find(t=>t._id===e)).filter(e=>null!=e);if(t.length===e.length){g(t);try{await p?.(e)}catch{g(null)}}},b=void 0!==l,{handleDragEnd:y,handleDragOver:I,handleDragStart:_,projection:S,sensors:k}=dN({items:x,onReorder:e=>v(e)}),w=b?l:S,{myTasksListId:C}=(0,D.useMyTasksListId)(),T=(0,J.useAddTab)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d$,{children:(0,a.jsxs)(aT.ContextMenu,{children:[(0,a.jsx)(aT.ContextMenuTrigger,{className:"block w-full min-w-0",children:(0,a.jsxs)("div",{className:(0,j.cn)("group/row flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 transition-colors hover:bg-surface-hover",s&&"bg-foreground
1/8 text-foreground"),children:[(0,a.jsxs)(o.Button,{className:"min-w-0 flex-1 cursor-pointer justify-between gap-2 rounded-md border-0 bg-transparent px-0 py-0 text-start font-normal text-sm hover:bg-transparent dark:hover:bg-transparent",onClick:()=>{h(),u()},variant:"ghost",children:[(0,a.jsx)(eg.MyTasksIcon,{size:16}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:d})]}),c&&(0,a.jsxs)(ah.Tooltip,{children:[(0,a.jsx)(ah.TooltipTrigger,{render:(0,a.jsx)(o.Button,{"aria-label":"Add sub-list",className:"h-5 w-5 shrink-0 text-muted-foreground opacity-0 transition-opacity hover:bg-transparent group-hover/row:opacity-100 max-md:opacity-100 dark:hover:bg-transparent [&_svg]:transition-transform [&_svg]:duration-200 hover:[&_svg]:scale-110 active:[&_svg]:scale-110",onClick:e=>{e.stopPropagation(),c()},size:"icon",variant:"ghost",children:(0,a.jsx)(ef.Plus,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(ah.TooltipContent,{children:"Add sub-list"})]}),n&&(0,a.jsx)(o.Button,{"aria-expanded":r,"aria-label":r?"Collapse":"Expand",className:"h-6 w-6 shrink-0 rounded hover:bg-transparent aria-expanded:bg-transparent dark:aria-expanded:bg-transparent dark:hover:bg-transparent",onClick:e=>{e.preventDefault(),e.stopPropagation(),f()},size:"icon",title:r?"Collapse":"Expand",variant:"ghost",children:r?(0,a.jsx)(eh.ChevronDown,{className:"h-3.5 w-3.5"}):(0,a.jsx)(n0.ChevronRight,{className:"h-3.5 w-3.5"})})]})}),(0,a.jsx)(aT.ContextMenuContent,{className:"w-56",children:(0,a.jsxs)(aT.ContextMenuItem,{disabled:!C,onClick:()=>{C&&T(C,null,null,d)},children:[(0,a.jsx)(nd.ExternalLink,{className:"mr-2 h-3.5 w-3.5"}),"Open in new tab"]})})]})}),r&&n&&(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5 pl-3",children:[e&&p&&b&&w?.overId==="my-tasks"&&(0,a.jsx)("div",{className:"relative h-0",children:(0,a.jsx)(dW,{position:"below"})}),e&&p&&b&&(0,a.jsx)(tE.SortableContext,{items:x.map(e=>e._id),strategy:tE.verticalListSortingStrategy,children:x.map(e=>(0,a.jsx)(dJ,{list:e,listIds:x.map(e=>e._id),listProjection:w,sortable:!0},e._id))}),e&&p&&!b&&(0,a.jsx)(i.DndContext,{collisionDetection:i.closestCenter,onDragEnd:y,onDragOver:I,onDragStart:_,sensors:k,children:(0,a.jsx)(tE.SortableContext,{items:x.map(e=>e._id),strategy:tE.verticalListSortingStrategy,children:x.map(e=>(0,a.jsx)(dJ,{list:e,listIds:x.map(e=>e._id),listProjection:w,sortable:!0},e._id))})}),!(e&&p)&&t.map(e=>(0,a.jsx)(dJ,{list:e,listIds:t.map(e=>e._id),listProjection:null},e._id))]})]})}var d0=e.i(386073);function d1(e){let t,n,i,o,c,u,p,h,f,x,g,v,b,y,j,I,_,S=(0,s.c)(39),{children:k,parentListId:w,parentListName:C,onStartRename:T,onAfterDelete:N,teamId:D}=e,[L,A]=(0,m.useState)(!1),P=(0,l.useMutation)(r.api.todo_lists.mutations.deleteList),O=(0,J.useAddTab)();S[0]!==P||S[1]!==N||S[2]!==w?(t=()=>{P({id:w,deleteLists:!0}).then(()=>{N?.()}).catch(d2),A(!1)},S[0]=P,S[1]=N,S[2]=w,S[3]=t):t=S[3];let E=t;return S[4]!==k?(n=(0,a.jsx)(aT.ContextMenuTrigger,{className:"block w-full min-w-0",children:k}),S[4]=k,S[5]=n):n=S[5],S[6]!==O||S[7]!==w||S[8]!==C||S[9]!==D?(i=()=>O(w,null,D??null,C),S[6]=O,S[7]=w,S[8]=C,S[9]=D,S[10]=i):i=S[10],S[11]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsx)(nd.ExternalLink,{className:"mr-2 h-3.5 w-3.5"}),S[11]=o):o=S[11],S[12]!==i?(c=(0,a.jsxs)(aT.ContextMenuItem,{onClick:i,children:[o,"Open in new tab"]}),S[12]=i,S[13]=c):c=S[13],S[14]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)(aT.ContextMenuSeparator,{}),S[14]=u):u=S[14],S[15]!==T?(p=T&&(0,a.jsxs)(aT.ContextMenuItem,{onClick:T,children:[(0,a.jsx)(d0.Pencil,{className:"mr-2 h-3.5 w-3.5"}),"Rename"]}),S[15]=T,S[16]=p):p=S[16],S[17]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsx)(aT.ContextMenuItem,{onClick:()=>A(!0),children:"Delete"}),S[17]=h):h=S[17],S[18]!==c||S[19]!==p?(f=(0,a.jsxs)(aT.ContextMenuContent,{className:"w-56",children:[c,u,p,h]}),S[18]=c,S[19]=p,S[20]=f):f=S[20],S[21]!==n||S[22]!==f?(x=(0,a.jsxs)(aT.ContextMenu,{children:[n,f]}),S[21]=n,S[22]=f,S[23]=x):x=S[23],S[24]===Symbol.for("react.memo_cache_sentinel")?(g=(0,a.jsx)(ak.AlertDialogTitle,{children:"Delete list?"}),S[24]=g):g=S[24],S[25]!==C?(v=(0,a.jsxs)(ak.AlertDialogHeader,{children:[g,(0,a.jsxs)(ak.AlertDialogDescription,{children:["Are you sure you want to delete"," ",(0,a.jsx)(d.Text,{as:"span",variant:"label",children:C}),"? You can choose to delete all lists in this list or move them to My Tasks."]})]}),S[25]=C,S[26]=v):v=S[26],S[27]===Symbol.for("react.memo_cache_sentinel")?(b=(0,a.jsx)(ak.AlertDialogCancel,{children:"Cancel"}),S[27]=b):b=S[27],S[28]!==E?(y=(0,a.jsxs)(ak.AlertDialogFooter,{children:[b,(0,a.jsx)(ak.AlertDialogAction,{onClick:E,variant:"destructive-solid",children:"Delete"})]}),S[28]=E,S[29]=y):y=S[29],S[30]!==v||S[31]!==y?(j=(0,a.jsxs)(ak.AlertDialogContent,{children:[v,y]}),S[30]=v,S[31]=y,S[32]=j):j=S[32],S[33]!==L||S[34]!==j?(I=(0,a.jsx)(ak.AlertDialog,{onOpenChange:A,open:L,children:j}),S[33]=L,S[34]=j,S[35]=I):I=S[35],S[36]!==x||S[37]!==I?(_=(0,a.jsxs)(a.Fragment,{children:[x,I]}),S[36]=x,S[37]=I,S[38]=_):_=S[38],_}function d2(e){e3.toast.error(e instanceof Error?e.message:"Failed to delete list")}function d3(e){let t,n,i,r,l,o,d,c,u=(0,s.c)(28),{canDrag:m,children:p,dropIndicator:h,parentList:f}=e,x=!m;u[0]!==f._id||u[1]!==x?(t={animateLayoutChanges:d4,disabled:x,id:f._id},u[0]=f._id,u[1]=x,u[2]=t):t=u[2];let{attributes:g,listeners:v,setNodeRef:b,transform:y,transition:I,isDragging:_}=(0,tE.useSortable)(t);u[3]!==_||u[4]!==y?(n=_?tr.CSS.Transform.toString(y):void 0,u[3]=_,u[4]=y,u[5]=n):n=u[5];let S=_?.5:1;u[6]!==n||u[7]!==S||u[8]!==I?(i={transform:n,transition:I,opacity:S},u[6]=n,u[7]=S,u[8]=I,u[9]=i):i=u[9];let k=i,w=f._id;u[10]!==h?(r=h?.position&&(0,a.jsx)(dW,{position:h.position}
1),u[10]=h,u[11]=r):r=u[11],u[12]!==g||u[13]!==m||u[14]!==v?(l=m?{...g,...v}:{},u[12]=g,u[13]=m,u[14]=v,u[15]=l):l=u[15];let C=m&&"cursor-grab active:cursor-grabbing";return u[16]!==C?(o=(0,j.cn)(C),u[16]=C,u[17]=o):o=u[17],u[18]!==p||u[19]!==b||u[20]!==k||u[21]!==o||u[22]!==l?(d=(0,a.jsx)("div",{ref:b,style:k,...l,className:o,children:p}),u[18]=p,u[19]=b,u[20]=k,u[21]=o,u[22]=l,u[23]=d):d=u[23],u[24]!==f._id||u[25]!==d||u[26]!==r?(c=(0,a.jsxs)(dS.AppSidebarSection,{className:"relative min-w-0",children:[r,d]},w),u[24]=f._id,u[25]=d,u[26]=r,u[27]=c):c=u[27],c}function d4(){return!1}function d5({canDrag:e=!1,dropIndicator:t,parentList:n,parentListLists:s,isExpanded:r,listProjection:l,onAddSubList:o,onReorderLists:d}){let c=(0,J.useCurrentParentListId)(),u=(0,J.useCurrentListId)(),p=(0,J.useTeamId)(),h=(0,J.useEditingParentListId)(),f=(0,J.useEditingParentListName)(),x=(0,J.useSetEditingParentListName)(),g=(0,J.useSelectParentList)(),v=(0,J.useSelectMyTasks)(),b=(0,J.useToggleSection)(),{handleParentListIconChange:y,handleParentListKeyDown:j,handleSaveParentListName:I,startEditParentList:_}=dP(),[S,k]=(0,m.useOptimistic)(s,(e,t)=>null===t?e:t),w=async e=>{let t=e.map(e=>S.find(t=>t._id===e)).filter(e=>null!=e);if(t.length===e.length){k(t);try{await d?.(n._id,e)}catch{k(null)}}},C=void 0!==l,{handleDragEnd:T,handleDragOver:N,handleDragStart:D,projection:L,sensors:A}=dN({items:S,onReorder:e=>w(e)}),P=C?l:L,O=s.length>0,E=c===n._id&&!p&&!u,M=h===n._id,R=(0,a.jsx)(d1,{onAfterDelete:v,onStartRename:()=>_(n._id,n.name),parentListId:n._id,parentListName:n.name,teamId:n.teamId,children:(0,a.jsx)(dK,{editingParentListName:f,hasLists:O,isActive:E,isEditing:M,isExpanded:r,onAddSubList:o,onBlur:()=>I(n._id),onEditingParentListNameChange:x,onIconChange:e=>y(n._id,n.name,e),onKeyDown:j,onSelectParentList:()=>g(n._id,n.teamId),onToggleExpand:e=>{e.stopPropagation(),b(n._id)},parentList:n})});return(0,a.jsxs)(d3,{canDrag:e,dropIndicator:t,parentList:n,children:[R,r&&O&&(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5 pl-3",children:[e&&d&&C&&P?.overId===n._id&&(0,a.jsx)("div",{className:"relative h-0",children:(0,a.jsx)(dW,{position:"below"})}),e&&d&&C&&(0,a.jsx)(tE.SortableContext,{items:S.map(e=>e._id),strategy:tE.verticalListSortingStrategy,children:S.map(e=>(0,a.jsx)(dJ,{list:e,listIds:S.map(e=>e._id),listProjection:P,sortable:!0},e._id))}),e&&d&&!C&&(0,a.jsx)(i.DndContext,{collisionDetection:i.closestCenter,onDragEnd:T,onDragOver:N,onDragStart:D,sensors:A,children:(0,a.jsx)(tE.SortableContext,{items:S.map(e=>e._id),strategy:tE.verticalListSortingStrategy,children:S.map(e=>(0,a.jsx)(dJ,{list:e,listIds:S.map(e=>e._id),listProjection:P,sortable:!0},e._id))})}),!(e&&d)&&s.map(e=>(0,a.jsx)(dJ,{list:e,listIds:s.map(e=>e._id),listProjection:null},e._id))]})]})}function d6(e){let t,n=(0,s.c)(16),{canDrag:i,getParentListLists:r,parentListsProjection:l,handleAddSubList:o,hasSearchQuery:d,listProjection:c,listsByParent:u,sortedParentLists:m}=e,p=(0,J.useExpandedSections)(),{reorderLists:h}=dP();n[0]!==i||n[1]!==p||n[2]!==r||n[3]!==o||n[4]!==d||n[5]!==c||n[6]!==u||n[7]!==l||n[8]!==h||n[9]!==m?(t=m.map(e=>{let t=r(u.get(e._id)??[]),n=d&&t.length>0||(p[e._id]??!1),s=m.map(d8),f=dV(e._id,l,s);return(0,a.jsx)(d5,{canDrag:i,dropIndicator:f,isExpanded:n,listProjection:c,onAddSubList:()=>
1o(e._id,e.teamId??void 0),onReorderLists:i?(e,t)=>h({parentId:e,listIds:t}):void 0,parentList:e,parentListLists:t},e._id)}),n[0]=i,n[1]=p,n[2]=r,n[3]=o,n[4]=d,n[5]=c,n[6]=u,n[7]=l,n[8]=h,n[9]=m,n[10]=t):t=n[10];let f=t;if(i){let e,t;return n[11]!==m?(e=m.map(d7),n[11]=m,n[12]=e):e=n[12],n[13]!==f||n[14]!==e?(t=(0,a.jsx)(tE.SortableContext,{items:e,strategy:tE.verticalListSortingStrategy,children:f}),n[13]=f,n[14]=e,n[15]=t):t=n[15],t}return f}function d7(e){return e._id}function d8(e){return e._id}let d9=[{value:"manual",label:"Manual"},{value:"newest",label:"Newest first"},{value:"oldest",label:"Oldest first"},{value:"lastEdited",label:"Last edited"}],ce=e=>{let t,n,i,r,l,d,c,u=(0,s.c)(15),{onSearchChange:m,onSortChange:p,searchQuery:h,sortBy:f}=e;return u[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(sd.Search,{className:"absolute top-1/2 left-2.5 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),u[0]=t):t=u[0],u[1]!==m?(n=e=>m(e.target.value),u[1]=m,u[2]=n):n=u[2],u[3]!==h||u[4]!==n?(i=(0,a.jsx)(ey.Input,{className:"h-8 pr-8 pl-8",onChange:n,placeholder:"Search",value:h,variant:"ghost"}),u[3]=h,u[4]=n,u[5]=i):i=u[5],u[6]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(eu.DropdownMenuTrigger,{render:(0,a.jsx)(o.Button,{"aria-label":"Sort lists",className:"absolute top-1/2 right-2 h-7 w-7 -translate-y-1/2 hover:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent [&_svg]:transition-transform [&_svg]:duration-200 hover:[&_svg]:scale-110 active:[&_svg]:scale-110",size:"icon",variant:"ghost"}),children:(0,a.jsx)(aW.ListFilter,{className:"size-[11.2px] shrink-0 text-muted-foreground opacity-50"})}),u[6]=r):r=u[6],u[7]!==p||u[8]!==f?(l=d9.map(e=>(0,a.jsxs)(eu.DropdownMenuItem,{className:"flex justify-between gap-4",onClick:()=>p(e.value),children:[e.label,(0,a.jsx)("span",{className:"ml-auto shrink-0",children:f===e.value?(0,a.jsx)(ep.Check,{className:"size-3.5"}):null})]},e.value)),u[7]=p,u[8]=f,u[9]=l):l=u[9],u[10]!==l?(d=(0,a.jsxs)(eu.DropdownMenu,{children:[r,(0,a.jsx)(eu.DropdownMenuContent,{align:"end",className:"w-auto min-w-[7.5rem]",children:l})]}),u[10]=l,u[11]=d):d=u[11],u[12]!==i||u[13]!==d?(c=(0,a.jsxs)("div",{className:"relative",children:[t,i,d]}),u[12]=i,u[13]=d,u[14]=c):c=u[14],c};var ct=e.i(700809),cn=e.i(662400),ca=e.i(768125),cs=e.i(68669);function ci(){let e,t,n,i,u,p,h,x,g,v,b,y,j,I,_=(0,s.c)(42),{trashedTasks:S,trashedLists:k,trashCount:w,isLoading:C,restoreTask:T,deleteTaskForever:N,restoreList:D,deleteListForever:L}=function(){let e,t,n,a,i,o,d,c=(0,s.c)(21),{gate:u}=(0,f.useGuestGate)(),m=(0,J.useTeamId)(),p=m?{teamId:m}:{},h=(0,l.useQuery)(r.api.todos.trash_queries.getTrashedTasks,u(p)),x=(0,l.useQuery)(r.api.todo_lists.trash_queries.getTrashedLists,u(p)),g=(0,l.useMutation)(r.api.todos.trash_mutations.restoreTodo).withOptimisticUpdate((e,t)=>{let n=e.getQuery(r.api.todos.trash_queries.getTrashedTasks,p);n&&e.setQuery(r.api.todos.trash_queries.getTrashedTasks,p,n.filter(e=>e._id!==t.id))}),v=(0,l.useMutation)(r.api.todos.trash_mutations.permanentlyDeleteTodo).withOptimisticUpdate((e,t)=>{let n=e.getQuery(r.api.todos.trash_queries.getTrashedTasks,p);n&&e.setQuery(r.api.todos.trash_queries.getTrashedTasks,p,n.filter(e=>e._id!==t.id))}),b=(0,l.useMutation)(r.api.todo_lists.trash_mutations.restoreList).withOptimisticUpdate((e,t)=>{let n=e.getQuery(r.api.todo_lists.trash_queries.getTrashedLists,p);n&&e.setQuery(r.api.todo_lists.trash_queries.getTrashedLists,p,n.filter(e=>e._id!==t.id))}),y=(0,l.useMutation)(r.api.todo_lists.trash_mutations.permanentlyDeleteList).withOptimisticUpdate((e,t)=>{let n=e.getQuery(r.api.todo_lists.trash_queries.getTrashedLists,p);n&&e.setQuery(r.api.todo_lists.trash_queries.getTrashedLists,p,n.filter(e=>e._id!==t.id))});c[0]!==h?(e=h??[],c[0]=h,c[1]=e):e=c[1],c[2]!==x?(t=x??[],c[2]=x,c[3]=t):t=c[3];let j=void 0===h||void 0===x,I=(h?.length??0)+(x?.length??0);return c[4]!==g?(n=e=>g({id:e}),c[4]=g,c[5]=n):n=c[5],c[6]!==v?(a=e=>v({id:e}),c[6]=v,c[7]=a):a=c[7],c[8]!==b?(i=e=>b({id:e}),c[8]=b,c[9]=i):i=c[9],c[10]!==y?(o=e=>y({id:e}),c[10]=y,c[11]=o):o=c[11],c[12]!==e||c[13]!==t||c[14]!==j||c[15]!==I||c[16]!==n||c[17]!==a||c[18]!==i||c[19]!==o?(d={trashedTasks:e,trashedLists:t,isLoading:j,trashCount:I,restoreTask:n,deleteTaskForever:a,restoreList:i,deleteListForever:o},c[12]=e,c[13]=t,c[14]=j,c[15]=I,c[16]=n,c[17]=a,c[18]=i,c[19]=o,c[20]=d):d=c[20],d}(),[A,P]=(0,m.useState)(!1);_[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{}),_[0]=e):e=_[0],_[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(ca.Tras
1h2,{className:"h-4 w-4"}),_[1]=t):t=_[1],_[2]!==w?(n=w>0?(0,a.jsx)(d.Text,{as:"span",className:"ml-auto rounded-full bg-muted px-1.5 py-0.5 font-medium",variant:"caption",children:w}):null,_[2]=w,_[3]=n):n=_[3],_[4]!==n?(i=(0,a.jsx)(eL.PopoverTrigger,{className:"w-full",nativeButton:!1,render:e,children:(0,a.jsxs)(o.Button,{className:"w-full justify-start gap-2 text-muted-foreground",size:"sm",variant:"ghost",children:[t,"Trash",n]})}),_[4]=n,_[5]=i):i=_[5],_[6]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsxs)("div",{className:"border-b px-3 py-2",children:[(0,a.jsx)(d.H3,{variant:"compact",children:"Trash"}),(0,a.jsx)(d.Text,{className:"truncate",variant:"caption",children:"Items in trash over 30 days are automatically deleted."})]}),_[6]=u):u=_[6];let O=S.length>0?` (${S.length})`:"";_[7]!==O?(p=(0,a.jsxs)(no.TabsTrigger,{value:"tasks",children:["Tasks",O]}),_[7]=O,_[8]=p):p=_[8];let E=k.length>0?` (${k.length})`:"";if(_[9]!==E?(h=(0,a.jsxs)(no.TabsTrigger,{value:"lists",children:["Lists",E]}),_[9]=E,_[10]=h):h=_[10],_[11]!==p||_[12]!==h?(x=(0,a.jsxs)(no.TabsList,{className:"w-full",children:[p,h]}),_[11]=p,_[12]=h,_[13]=x):x=_[13],_[14]!==N||_[15]!==T||_[16]!==S){let e;_[18]!==N||_[19]!==T?(e=e=>({id:e._id,title:e.text||"Untitled task",deletedAt:e.deletedAt,icon:(0,a.jsx)(c.ListTodo,{className:"h-4 w-4 text-muted-foreground"}),onRestore:()=>T(e._id),onDeleteForever:()=>N(e._id)}),_[18]=N,_[19]=T,_[20]=e):e=_[20],g=S.map(e),_[14]=N,_[15]=T,_[16]=S,_[17]=g}else g=_[17];if(_[21]!==C||_[22]!==g?(v=(0,a.jsx)(no.TabsContent,{value:"tasks",children:(0,a.jsx)(cr,{emptyLabel:"No tasks in trash",isLoading:C,items:g})}),_[21]=C,_[22]=g,_[23]=v):v=_[23],_[24]!==L||_[25]!==D||_[26]!==k){let e;_[28]!==L||_[29]!==D?(e=e=>({id:e._id,title:e.name||"Untitled list",deletedAt:e.deletedAt,icon:(0,a.jsx)(em.IconDisplay,{fallback:(0,a.jsx)(c.ListTodo,{className:"h-4 w-4"}),size:16,value:e.iconData}),onRestore:()=>D(e._id),onDeleteForever:()=>L(e._id)}),_[28]=L,_[29]=D,_[30]=e):e=_[30],b=k.map(e),_[24]=L,_[25]=D,_[26]=k,_[27]=b}else b=_[27];return _[31]!==C||_[32]!==b?(y=(0,a.jsx)(no.TabsContent,{value:"lists",children:(0,a.jsx)(cr,{emptyLabel:"No lists in trash",isLoading:C,items:b})}),_[31]=C,_[32]=b,_[33]=y):y=_[33],_[34]!==v||_[35]!==y||_[36]!==x?(j=(0,a.jsxs)(eL.PopoverContent,{align:"start",className:"w-80 p-0",side:"right",children:[u,(0,a.jsxs)(no.Tabs,{defaultValue:"tasks",children:[x,v,y]})]}),_[34]=v,_[35]=y,_[36]=x,_[37]=j):j=_[37],_[38]!==A||_[39]!==j||_[40]!==i?(I=(0,a.jsxs)(eL.Popover,{onOpenChange:P,open:A,children:[i,j]}),_[38]=A,_[39]=j,_[40]=i,_[41]=I):I=_[41],I}function cr(e){let t,n,i,r,l=(0,s.c)(15),{items:o,isLoading:d,emptyLabel:c}=e;l[0]!==o?(t=e=>{let t=o.find(t=>t.id===e);return t?t.onDeleteForever():Promise.resolve()},l[0]=o,l[1]=t):t=l[1],l[2]!==o||l[3]!==t?(n={items:o,getId:cl,onDelete:t,errorMessage:"Couldn't delete that. It's back in your trash."},l[2]=o,l[3]=t,l[4]=n):n=l[4];let{visible:u,poof:m}=(0,cn.usePoofDelete)(n);if(d){let e;return l[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(oi.ListSkeleton,{className:"px-1 py-2",rows:3,size:"sm",withLeading:!0}),l[5]=e):e=l[5],e}if(0===o.length){let e;return l[6]!==c?(e=(0,a.jsx)("div",{className:"px-3 py-6 text-center text-muted-foreground text-xs",children:c}),l[6]=c,l[7]=e):e=l[7],e}if(l[8]!==m||l[9]!==u){let e;l[11]!==m?(e=e=>(0,a.jsx)(co,{item:e,onDeleteForever:()=>m(e.id)},e.id),l[11]=m,l[12]=e):e=l[12],i=u.map(e),l[8]=m,l[9]=u,l[10]=i}else i=l[10];return l[13]!==i?(r=(0,a.jsx)("div",{className:"max-h-80 overflow-y-auto",children:(0,a.jsx)(ct.PoofPresence,{children:i})}),l[13]=i,l[14]=r):r=l[14],r}function cl(e){return e.id}function co(e){let t,n,i,r,l,c,u,m,p,h,f,x,g,v,b=(0,s.c)(31),{item:y,onDeleteForever:j}=e;b[0]!==y.deletedAt?(t=y.deletedAt?(0,cs.computeDaysAgo)(y.deletedAt):0,b[0]=y.deletedAt,b[1]=t):t=b[1];let I=t;b[2]!==y.deletedAt?(n=y.deletedAt?(0,cs.computeDaysRemaining)(y.deletedAt):30,b[2]=y.deletedAt,b[3]=n):n=b[3];let _=n;b[4]!==y?(i=async e=>{e.stopPropagation(),await y.onRestore()},b[4]=y,b[5]=i):i=b[5];let S=i;b[6]!==j?(r=e=>{e.stopPropagation(),j()},b[6]=j,b[7]=r):r=b[7];let k=r;b[8]!==y.icon?(l=(0,a.jsx)("span",{className:"flex shrink-0 items-center",children:y.icon}),b[8]=y.icon,b[9]=l):l=b[9],b[10]!==y.title?(c=(0,a.jsx)(d.Text,{className:"truncate",variant:"bodySmall",children:y.title}),b[10]=y.title,b[11]=c):c=b[11];let w=0===I?"Deleted today":`Deleted ${I}d ago`;return b[12]!==_||b[13]!==w?(u=(0,a.jsxs)(d.Text,{variant:"caption",children:[w," · ",_,"d remaining"]}),b[12]=_,b[13]=w,b[14]=u):u=b[14],b[15]!==c||b[16]!==u?(m=(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[c,u]}
1),b[15]=c,b[16]=u,b[17]=m):m=b[17],b[18]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(s9.RotateCcw,{className:"h-3.5 w-3.5"}),b[18]=p):p=b[18],b[19]!==S?(h=(0,a.jsx)(o.Button,{onClick:S,size:"icon",title:"Restore",variant:"ghost",children:p}),b[19]=S,b[20]=h):h=b[20],b[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)(ca.Trash2,{className:"h-3.5 w-3.5"}),b[21]=f):f=b[21],b[22]!==k?(x=(0,a.jsx)(o.Button,{className:"text-[#ED5954] hover:bg-[#ED5954]/10 hover:text-[#ED5954]",onClick:k,size:"icon",title:"Delete permanently",variant:"ghost",children:f}),b[22]=k,b[23]=x):x=b[23],b[24]!==h||b[25]!==x?(g=(0,a.jsxs)("div",{className:"flex shrink-0 gap-1 opacity-0 group-hover:opacity-100",children:[h,x]}),b[24]=h,b[25]=x,b[26]=g):g=b[26],b[27]!==g||b[28]!==l||b[29]!==m?(v=(0,a.jsxs)(ct.PoofItem,{className:"group flex w-full items-center gap-2 border-b px-3 py-2 text-left last:border-b-0 hover:bg-accent/50",children:[l,m,g]}),b[27]=g,b[28]=l,b[29]=m,b[30]=v):v=b[30],v}function cd(e){return e.parentId}function cc(e){return null!=e.parentId}function cu(e){return e.parentId}function cm(e){return null!=e.parentId}function cp(e){let t,n,r,l,o,d,c=(0,s.c)(28),{children:u,editingParentListName:m,parentList:p,hasLists:h,isEditing:f,isExpanded:x,isParentListActive:g,onAddSubList:v,onBlur:b,onEditingParentListNameChange:y,onIconChange:I,onKeyDown:_,onSelectParentList:S,onToggleExpand:k}=e;c[0]!==p._id?(t={type:"parentList",parentId:p._id},c[0]=p._id,c[1]=t):t=c[1],c[2]!==p._id||c[3]!==t?(n={id:p._id,data:t},c[2]=p._id,c[3]=t,c[4]=n):n=c[4];let{isOver:w,setNodeRef:C}=(0,i.useDroppable)(n),T=w&&"ring-2 ring-primary/50";return c[5]!==T?(r=(0,j.cn)("w-full min-w-0 rounded-md transition-shadow",T),c[5]=T,c[6]=r):r=c[6],c[7]!==m||c[8]!==h||c[9]!==f||c[10]!==x||c[11]!==g||c[12]!==v||c[13]!==b||c[14]!==y||c[15]!==I||c[16]!==_||c[17]!==S||c[18]!==k||c[19]!==p?(l=(0,a.jsx)(dG,{editingParentListName:m,hasLists:h,isActive:g,isEditing:f,isExpanded:x,onAddSubList:v,onBlur:b,onEditingParentListNameChange:y,onIconChange:I,onKeyDown:_,onSelectParentList:S,onToggleExpand:k,parentList:p}),c[7]=m,c[8]=h,c[9]=f,c[10]=x,c[11]=g,c[12]=v,c[13]=b,c[14]=y,c[15]=I,c[16]=_,c[17]=S,c[18]=k,c[19]=p,c[20]=l):l=c[20],c[21]!==C||c[22]!==r||c[23]!==l?(o=(0,a.jsx)("div",{className:r,ref:C,children:l}),c[21]=C,c[22]=r,c[23]=l,c[24]=o):o=c[24],c[25]!==u||c[26]!==o?(d=(0,a.jsxs)("div",{className:"w-full min-w-0",children:[o,u]}),c[25]=u,c[26]=o,c[27]=d):d=c[27],d}function ch(e,t,n){let a=t.trim().toLowerCase();return a?e.filter(e=>e.name.toLowerCase().includes(a)||n?.has(e._id)):e}function cf(e){let t,n=(0,s.c)(75),{team:i,isExpanded:d,isTeamRootActive:c,listIdsWithMatchingTasks:u,onToggleExpand:m,searchQuery:p}=e,h=(0,J.useCurrentParentListId)(),x=(0,J.useCurrentListId)(),g=(0,J.useTeamId)(),v=(0,J.useEditingParentListId)(),b=(0,J.useEditingParentListName)(),y=(0,J.useSetEditingParentListName)(),I=(0,J.useSelectParentList)(),_=(0,J.useSelectList)(),S=(0,J.useSelectTeam)(),k=(0,J.useExpandedSections)(),w=(0,J.useToggleSection)(),{parentLists:C,createParentList:T,handleAddSubList:N,handleParentListIconChange:D,handleParentListKeyDown:L,handleSaveParentListName:A,startEditParentList:P,teams:O,updateList:E}=dP(),{listsByParent:M,parentLists:R}=function(e){let{gate:t}=(0,f.useGuestGate)(),n=(0,l.useQuery)(r.api.todo_lists.queries.getAllTeamForSidebar,e?t({teamId:e}):"skip")??[],a=new Map;a.set("uncategorized",[]);let s=new Set(n.filter(cm).map(cu));for(let e of n.filter(e=>s.has(e._id)))a.set(e._id,[]);for(let e of n){if(s.has(e._id))continue;let t=e.parentId??"uncategorized",n=a.get(t);n&&n.push(e)}let i=new Set(n.filter(cc).map(cd));return{listsByParent:a,parentLists:n.filter(e=>i.has(e._id))}}(i._id);if(n[0]!==C||n[1]!==T||n[2]!==x||n[3]!==h||n[4]!==v||n[5]!==b||n[6]!==k||n[7]!==N||n[8]!==D||n[9]!==L||n[10]!==A||n[11]!==d||n[12]!==c||n[13]!==u||n[14]!==M||n[15]!==m||n[16]!==p||n[17]!==_||n[18]!==I||n[19]!==S||n[20]!==y||n[21]!==P||n[22]!==i._id||n[23]!==i.iconData||n[24]!==i.name||n[25]!==g||n[26]!==R||n[27]!==O||n[28]!==w||n[29]!==E){let e,s,r,l,f,z,B,U,F,G,q,$,K,Q,V,W,H=M.get("uncategorized")??[],Y=p?.trim()?ch(H,p,u):H,X=Y.length>0;n[31]!==u||n[32]!==M||n[33]!==p?(e=e=>{let t=M.get(e)??[];return p?.trim()?ch(t,p,u):t},n[31]=u,n[32]=M,n[33]=p,n[34]=e):e=n[34];let J=e;n[35]!==J||n[36]!==X||n[37]!==R?(s=X||R.length>0||R.some(e=>J(e._id).length>0),n[35]=J,n[36]=X,n[37]=R,n[38]=s):s=n[38];let Z=s;
1n[39]!==T||n[40]!==I||n[41]!==i._id?(r=async()=>{let e=await T({name:"New list",teamId:i._id,iconData:(0,eI.toConvexIconData)(ex)});if(e?._id)return I(e._id,i._id),e._id},n[39]=T,n[40]=I,n[41]=i._id,n[42]=r):r=n[42];let ee=r,et=c&&"bg-foreground/8 text-foreground";n[43]!==et?(l=(0,j.cn)("group/row flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 transition-colors hover:bg-surface-hover",et),n[43]=et,n[44]=l):l=n[44],n[45]!==S||n[46]!==i._id?(f=()=>S(i._id),n[45]=S,n[46]=i._id,n[47]=f):f=n[47],n[48]!==i.iconData?(z=i.iconData??{type:"lucide",name:"users"},n[48]=i.iconData,n[49]=z):z=n[49],n[50]!==z?(B=(0,a.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:(0,a.jsx)(em.IconDisplay,{size:16,value:z})}),n[50]=z,n[51]=B):B=n[51],n[52]!==i.name?(U=(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:i.name}),n[52]=i.name,n[53]=U):U=n[53],n[54]!==U||n[55]!==f||n[56]!==B?(F=(0,a.jsxs)(o.Button,{className:"min-w-0 flex-1 cursor-pointer justify-start gap-2 rounded-md border-0 bg-transparent px-0 py-0 text-start font-normal text-sm hover:bg-transparent dark:hover:bg-transparent",onClick:f,variant:"ghost",children:[B,U]}),n[54]=U,n[55]=f,n[56]=B,n[57]=F):F=n[57],n[58]!==ee?(G=e=>{e.preventDefault(),e.stopPropagation(),ee()},n[58]=ee,n[59]=G):G=n[59],n[60]===Symbol.for("react.memo_cache_sentinel")?(q=(0,a.jsx)(ef.Plus,{className:"h-3.5 w-3.5"}),n[60]=q):q=n[60],n[61]!==G?($=(0,a.jsx)(ah.TooltipTrigger,{render:(0,a.jsx)(o.Button,{"aria-label":"Create new list",className:"h-6 w-6 shrink-0 rounded text-muted-foreground opacity-0 transition-opacity hover:bg-transparent group-hover/row:opacity-100 max-md:opacity-100 dark:hover:bg-transparent [&_svg]:transition-transform [&_svg]:duration-200 hover:[&_svg]:scale-110 active:[&_svg]:scale-110",onClick:G,size:"icon",variant:"ghost",children:q})}),n[61]=G,n[62]=$):$=n[62],n[63]===Symbol.for("react.memo_cache_sentinel")?(K=(0,a.jsx)(ah.TooltipContent,{children:"Create new list"}),n[63]=K):K=n[63],n[64]!==$?(Q=(0,a.jsxs)(ah.Tooltip,{children:[$,K]}),n[64]=$,n[65]=Q):Q=n[65],n[66]!==Z||n[67]!==d||n[68]!==m?(V=Z&&(0,a.jsx)(o.Button,{"aria-expanded":d,"aria-label":d?"Collapse":"Expand",className:"h-6 w-6 shrink-0 rounded hover:bg-transparent aria-expanded:bg-transparent dark:aria-expanded:bg-transparent dark:hover:bg-transparent",onClick:e=>{e.preventDefault(),e.stopPropagation(),m()},size:"icon",title:d?"Collapse":"Expand",variant:"ghost",children:d?(0,a.jsx)(eh.ChevronDown,{className:"h-3.5 w-3.5"}):(0,a.jsx)(n0.ChevronRight,{className:"h-3.5 w-3.5"})}),n[66]=Z,n[67]=d,n[68]=m,n[69]=V):V=n[69],n[70]!==F||n[71]!==Q||n[72]!==V||n[73]!==l?(W=(0,a.jsxs)("div",{className:l,children:[F,Q,V]}),n[70]=F,n[71]=Q,n[72]=V,n[73]=l,n[74]=W):W=n[74],t=(0,a.jsxs)(dS.AppSidebarSection,{className:"min-w-0",children:[W,d&&(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5 pl-3",children:[X&&Y.map(e=>(0,a.jsx)(lb,{allParentLists:C,listId:e._id,listName:e.name,onCreateParentList:ee,onSelectList:_,parentId:e.parentId,teamId:e.teamId,teams:O,children:(0,a.jsx)(dH,{isActive:x===e._id&&g===i._id&&null===h,list:e,onIconChange:async t=>{await E({id:e._id,name:e.name,iconData:void 0===t?null:(0,eI.toConvexIconData)(t)})},onSelectList:()=>_(e._id,e.parentId,e.teamId,e.name,(0,eI.fromConvexIconData)(e.iconData))})},e._id)),R.map(e=>{let t=J(e._id),n=t.length>0,s=p?.trim()&&n||(k[e._id]??!1),r=h===e._id&&g===i._id&&!x,l=v===e._id;return(0,a.jsx)(d1,{onAfterDelete:()=>S(i._id),onStartRename:()=>P(e._id,e.name),parentListId:e._id,parentListName:e.name,teamId:e.teamId,children:(0,a.jsx)(cp,{editingParentListName:b,hasLists:n,isEditing:l,isExpanded:s,isParentListActive:r,onAddSubList:()=>N(e._id,e.teamId),onBlur:()=>A(e._id),onEditingParentListNameChange:y,onIconChange:t=>D(e._id,e.name,t),onKeyDown:L,onSelectParentList:()=>I(e._id,i._id),onToggleExpand:t=>{t.stopPropagation(),w(e._id)},parentList:e,children:s&&n&&(0,a.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pl-3",children:t.map(e=>(0,a.jsx)(lb,{allParentLists:C,listId:e._id,listName:e.name,onCreateParentList:ee,onSelectList:_,parentId:e.parentId,teamId:e.teamId,teams:O,children:(0,a.jsx)(dH,{isActive:x===e._id&&g===i._id,list:e,onIconChange:async t=>{await E({id:e._id,name:e.name,iconData:void 0===t?null:(0,eI.toConvexIconData)(t)})},onSelectList:()=>_(e._id,e.parentId,e.teamId,e.name,(0,eI.fromConvexIconData)(e.iconData))})},e._id))})},e._id)},e._id)})]})]}),n[0]=C,n[1]=T,n[2]=x,n[3]=h,n[4]=v,n[5]=b,n[6]=k,n[7]=N,n[8]=D,n[9]=L,n[10]=A,n[
111]=d,n[12]=c,n[13]=u,n[14]=M,n[15]=m,n[16]=p,n[17]=_,n[18]=I,n[19]=S,n[20]=y,n[21]=P,n[22]=i._id,n[23]=i.iconData,n[24]=i.name,n[25]=g,n[26]=R,n[27]=O,n[28]=w,n[29]=E,n[30]=t}else t=n[30];return t}let cx="my-tasks",cg=[{value:"all",label:"All Activity"},{value:"justMe",label:"Just Me"}];function cv(){let e=(0,J.useCurrentParentListId)(),t=(0,J.useCurrentListId)(),n=(0,J.useTeamId)(),d=(0,J.useSelectMyTasks)(),{close:c}=(0,h.useAppSidebarMobile)(),u=(0,J.useSelectParentList)(),p=(0,J.useExpandedSections)(),x=(0,J.useToggleSection)(),{rootLists:g}=(0,y.useFeatureLimits)(),v=!g.canCreate,b=(0,J.useSelectList)(),[j,I]=(0,m.useState)(""),[_,S]=(0,m.useState)("manual"),[k,w]=(0,m.useState)(()=>{try{let e=localStorage.getItem("tasks-recents-filter");return"justMe"===e?"justMe":"all"}catch{return"all"}}),{currentUserId:C,lists:N,isLoading:L}=function(){let{gate:e}=(0,f.useGuestGate)(),t=(0,l.useQuery)(r.api.todo_lists.queries.getRecentLists,e({limit:20})),n=(0,l.useQuery)(r.api.auth_setup.getCurrentUser,e({})),a=(0,m.useRef)(t);void 0!==t&&(a.current=t);let s=t??a.current,i=void 0===t&&void 0===a.current;return{currentUserId:n?._id??null,lists:s??[],isLoading:i}}(),A=(0,m.useMemo)(()=>"justMe"===k&&C?N.filter(e=>!e.lastEditedBy||e.lastEditedBy===C):N,[N,k,C]),P=(0,m.useMemo)(()=>[...A].sort((e,t)=>t.updatedAt-e.updatedAt),[A]),{myTasksListId:O,ensure:E}=(0,D.useMyTasksListId)(),{gate:M}=(0,f.useGuestGate)(),{parentLists:R,handleAddParentList:z,handleAddSubList:B,reorderLists:U,teams:F}=dP();(0,m.useEffect)(()=>{null==O&&E().catch(()=>{})},[O,E]);let G=(0,l.useQuery)(r.api.todos.queries.searchListIdsByTaskText,j.trim()?M({query:j}):"skip"),q=null==G?void 0:new Set(G.listIds),$=null==G?void 0:new Set(G.teamIds),K=function(e){let t=(0,s.c)(2),{gate:n}=(0,f.useGuestGate)(),a=(0,l.useQuery)(r.api.todo_lists.queries.getAllPersonalForSidebar,n({}))??[],i=new Map;for(let e of(i.set("default",[]),a))if(null!=e.parentId){let t=e.parentId,n=i.get(t)??[];n.push(e),i.set(t,n)}if(null!=e){let n;t[0]!==e?(n=t=>t.parentId===e,t[0]=e,t[1]=n):n=t[1];let s=a.filter(n);i.set("default",[...s])}return i}(O),{moveList:Q}=(0,ek.useTodoLists)(),{label:V}=T(),W=!(e||n||t),{filteredDefaultLists:H,filteredTeams:Y,getChildLists:X,hasMyTasksLists:Z,hasNoSearchResults:ee,showMyTasks:et,sortedParentLists:en}=function({defaultLists:e,listIdsWithMatchingTasks:t,listsByParent:n,myTasksLabel:a,parentLists:s,searchQuery:i,sortBy:r,teamIdsWithMatchingTasks:l,teams:o}){let d,c,u=i.trim().toLowerCase(),m=u.length>0,p=m?lv(lg([...e],i,t),r):lv([...e],r),h=m&&a.toLowerCase().includes(u),f=p.length>0,x=!m||h||p.length>0,g=lv(m?(d=i.trim().toLowerCase())?s.filter(e=>!!e.name.toLowerCase().includes(d)||(n.get(e._id)??[]).some(e=>e.name.toLowerCase().includes(d)||t?.has(e._id))):[...s]:s,r),v=m?(c=i.trim().toLowerCase())?o.filter(e=>
1e.name.toLowerCase().includes(c)||null!=e._id&&l?.has(e._id)):[...o]:o,b=m&&!x&&0===g.length&&0===v.length;return{filteredDefaultLists:p,filteredTeams:v,getChildLists:function(e){return m?lv(lg([...e],i,t),r):lv([...e],r)},hasMyTasksLists:f,hasNoSearchResults:b,showMyTasks:x,sortedParentLists:g}}({defaultLists:K.get("default")??[],parentLists:R,listIdsWithMatchingTasks:q,listsByParent:K,myTasksLabel:V,searchQuery:j,sortBy:_,teamIdsWithMatchingTasks:$,teams:F}),ea=j.trim().length>0,es=(0,iP.useIsMobile)(),ei="manual"===_&&!es,{optimisticParentLists:er,parentListsProjection:el,listProjection:eo,listSensors:ed,handleCombinedDragStart:ec,handleCombinedDragOver:em,handleCombinedDragEnd:eh}=function(e){let t,n,a,r,l,o,d,c,u,p=(0,s.c)(39),{sortedParentLists:h,reorderLists:f,getChildLists:x,listsByParent:g,moveList:v,selectParentList:b,selectMyTasks:y}=e,[j,I]=(0,m.useOptimistic)(h,dA);p[0]!==I||p[1]!==j||p[2]!==f?(t=async e=>{let t=e.map(e=>j.find(t=>t._id===e)).filter(dL);if(t.length===e.length){(0,m.startTransition)(()=>{I(t)});try{await f({listIds:e})}catch{(0,m.startTransition)(()=>{I(null)})}}},p[0]=I,p[1]=j,p[2]=f,p[3]=t):t=p[3];let _=t;p[4]!==_?(n=e=>_(e),p[4]=_,p[5]=n):n=p[5],p[6]!==j||p[7]!==n?(a={items:j,onReorder:n},p[6]=j,p[7]=n,p[8]=a):a=p[8];let{handleDragEnd:S,handleDragOver:k,handleDragStart:w,projection:C}=dN(a);p[9]!==x||p[10]!==g||p[11]!==v||p[12]!==j||p[13]!==f||p[14]!==y||p[15]!==b?(r={getChildLists:x,listsByParent:g,moveList:v,reorderLists:f,selectParentList:b,selectMyTasks:y,sortedParentLists:j},p[9]=x,p[10]=g,p[11]=v,p[12]=j,p[13]=f,p[14]=y,p[15]=b,p[16]=r):r=p[16];let{handleDragEnd:T,handleDragOver:N,handleDragStart:D,projection:L,sensors:A}=function(e){let t,n,a,r,l,o,d,c=(0,s.c)(17),{getChildLists:u,listsByParent:p,moveList:h,reorderLists:f,selectParentList:x,selectMyTasks:g,sortedParentLists:v}=e,[b,y]=(0,m.useState)(null),j=(0,m.useRef)(null),I=(0,m.useRef)(null);c[0]===Symbol.for("react.memo_cache_sentinel")?(t={activationConstraint:{distance:8}},c[0]=t):t=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{delay:200,tolerance:5}},c[1]=n):n=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:tE.sortableKeyboardCoordinates},c[2]=a):a=c[2];let _=(0,i.useSensors)((0,i.useSensor)(i.PointerSensor,t),(0,i.useSensor)(i.TouchSensor,n),(0,i.useSensor)(i.KeyboardSensor,a));c[3]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{let t,n=String(e.active.id),a={activeId:n,overId:n};j.current=a,y(a),I.current=(t=e.activatorEvent)&&"clientY"in t?t.clientY:null},c[3]=r):r=c[3];let S=r;c[4]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let t;if(!e.over)return;let n=String(e.over.id),a="rect"in e.over?e.over.rect:null,s=I.current;a&&null!==s&&(t=s+e.delta.y<a.top+a.height/2?"above":"below");let i={activeId:String(e.active.id),overId:n,...void 0!==t&&{insertPosition:t}};j.current=i,y(i)},c[4]=l):l=c[4];let k=l;c[5]!==u||c[6]!==p||c[7]!==h||c[8]!==f||c[9]!==g||c[10]!==x||c[11]!==v?(o=async e=>{let{active:t,over:n}=e,a=j.current;j.current=null,I.current=null,y(null);let s=a?.overId??(n&&String(n.id))??null;if(!s||t.id===s)return;let i=t.id,r=dk(i,p,u);if(void 0===r)return;let l=function(e,t,n,a,s,i){if("my-tasks"===t)return{targetParentId:void 0,insertIndex:0};let r=a.find(e=>e._id===t);if(r)return{targetParentId:r._id,insertIndex:0};let l=dk(t,s,i);if(void 0===l)return null;let o="default"===l?void 0:l,d=dw(l,s,i),c=d.findIndex(e=>e._id===t);if(-1===c)return null;let u=d.findIndex(t=>t._id===e);return{targetParentId:o,insertIndex:"above"===(n??(u>c?"above":"below"))?c:c+1}}(i,s,a?.insertPosition,v,p,u);if(!l)return;let{targetParentId:o,insertIndex:d}=l,c="default"===r?void 0:r;if(void 0===c&&void 0===o||c===o){let e=dw(r,p,u),t=e.findIndex(e=>e._id===i);if(-1===t)return;let n=(0,tE.arrayMove)(e,t,d);await f({parentId:c,listIds:n.map(dT)});return}await dC({activeId:i,getChildLists:u,insertIndex:d,listsByParent:p,moveList:h,reorderLists:f,selectParentList:x,selectMyTasks:g,sortedParentLists:v,sourceParent:r,sourceParentId:c,targetParentId:o})},c[5]=u,c[6]=p,c[7]=h,c[8]=f,c[9]=g,c[10]=x,c[11]=v,c[12]=o):o=c[12];let w=o;
1return c[13]!==w||c[14]!==b||c[15]!==_?(d={handleDragEnd:w,handleDragOver:k,handleDragStart:S,projection:b,sensors:_},c[13]=w,c[14]=b,c[15]=_,c[16]=d):d=c[16],d}(r);p[17]!==j?(l=e=>j.some(t=>t._id===e),p[17]=j,p[18]=l):l=p[18];let P=l;p[19]!==D||p[20]!==w||p[21]!==P?(o=e=>{P(String(e.active.id))?w(e):D(e)},p[19]=D,p[20]=w,p[21]=P,p[22]=o):o=p[22];let O=o;p[23]!==N||p[24]!==k||p[25]!==P?(d=e=>{P(String(e.active.id))?k(e):N(e)},p[23]=N,p[24]=k,p[25]=P,p[26]=d):d=p[26];let E=d;p[27]!==T||p[28]!==S||p[29]!==P?(c=async e=>{P(String(e.active.id))?S(e):await T(e)},p[27]=T,p[28]=S,p[29]=P,p[30]=c):c=p[30];let M=c;return p[31]!==M||p[32]!==E||p[33]!==O||p[34]!==L||p[35]!==A||p[36]!==j||p[37]!==C?(u={optimisticParentLists:j,parentListsProjection:C,listProjection:L,listSensors:A,handleCombinedDragStart:O,handleCombinedDragOver:E,handleCombinedDragEnd:M},p[31]=M,p[32]=E,p[33]=O,p[34]=L,p[35]=A,p[36]=j,p[37]=C,p[38]=u):u=p[38],u}({sortedParentLists:en,reorderLists:U,getChildLists:X,listsByParent:K,moveList:Q,selectParentList:u,selectMyTasks:d}),ex=ea&&(H.length>0||V.toLowerCase().includes(j.trim().toLowerCase()))||(p[cx]??!1);return(0,a.jsxs)(dI.AppSidebar,{children:[(0,a.jsx)(d_.AppSidebarMobileHeaderActions,{children:(0,a.jsx)(o.Button,{"aria-label":v?"List limit reached":"New list",className:"nodrag shrink-0 text-muted-foreground [&_svg]:stroke-[2.5]",onClick:e=>{e.stopPropagation(),z()},size:"icon",variant:"ghost",children:(0,a.jsx)(ef.Plus,{className:"h-5 w-5"})})}),(0,a.jsx)(dI.AppSidebarHeader,{className:"pt-2","data-hide-mobile-drawer":!0,children:(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,a.jsx)(dI.AppSidebarToggle,{}),(0,a.jsxs)(ah.Tooltip,{children:[(0,a.jsx)(ah.TooltipTrigger,{render:(0,a.jsx)(o.Button,{"aria-label":v?"List limit reached":"New list",className:"nodrag ml-auto shrink-0 text-muted-foreground [&_svg]:stroke-[2.5]",onClick:e=>{e.stopPropagation(),z()},onMouseDown:e=>e.stopPropagation(),onPointerDownCapture:e=>e.stopPropagation(),size:"icon",variant:"ghost",children:(0,a.jsx)(ef.Plus,{className:"h-4 w-4"})})}),(0,a.jsx)(ah.TooltipContent,{children:v?"List limit reached — upgrade to create more":"Create new list"})]})]})}),(0,a.jsx)(dI.AppSidebarHeader,{className:"py-1",children:(0,a.jsx)(dS.AppSidebarSection,{collapsible:!0,defaultOpen:!0,headerExtra:(0,a.jsxs)(eu.DropdownMenu,{children:[(0,a.jsx)(eu.DropdownMenuTrigger,{render:(0,a.jsx)(o.Button,{"aria-label":"Filter recents",className:"!h-5 !w-5 !min-w-0 !p-0 shrink-0 text-muted-foreground opacity-0 transition-opacity hover:bg-transparent focus-visible:opacity-100 group-hover/header:opacity-100 max-md:opacity-100 dark:hover:bg-transparent [&_svg]:transition-transform [&_svg]:duration-200 hover:[&_svg]:scale-110 active:[&_svg]:scale-110",size:"icon",variant:"ghost"}),children:(0,a.jsx)(aW.ListFilter,{className:"size-[11.2px] shrink-0 text-muted-foreground opacity-50"})}),(0,a.jsx)(eu.DropdownMenuContent,{align:"end",className:"w-auto min-w-[7.5rem]",children:cg.map(e=>(0,a.jsxs)(eu.DropdownMenuItem,{className:"flex justify-between gap-4",onClick:()=>(e=>{w(e);try{localStorage.setItem("tasks-recents-filter",e)}catch{}})(e.value),children:[e.label,(0,a.jsx)("span",{className:"ml-auto shrink-0",children:k===e.value?(0,a.jsx)(ep.Check,{className:"size-3.5"}):null})]},e.value))})]}),hideHeaderWhenOpen:!0,persistKey:"tasks-recents",title:"Recents",titleCase:!0,children:(0,a.jsx)(dU,{allLists:N,isLoading:L,lists:P,onSelectList:b})})}),(0,a.jsx)(dI.AppSidebarHeader,{className:"pt-3 pb-1.5",children:(0,a.jsx)(ce,{onSearchChange:I,onSortChange:S,searchQuery:j,sortBy:_})}),(0,a.jsx)(dI.AppSidebarBody,{children:(()=>{if(ee)return(0,a.jsx)("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"No lists or tasks match your search"});let s=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(dS.AppSidebarSection,{className:"min-w-0",children:et&&(0,a.jsx)(dZ,{canDrag:ei,filteredDefaultLists:H,hasMyTasksLists:Z,isMyTasksActive:W,isMyTasksExpanded:ex,listProjection:ei?eo:void 0,myTasksLabel:V,onAddSubList:()=>
1B(O??void 0),onCloseMobileSidebar:c,onReorderLists:ei&&O?e=>U({listIds:e,parentId:O}):void 0,onSelectMyTasks:d,onToggleExpand:()=>x(cx)})}),(0,a.jsx)(d6,{canDrag:ei,getParentListLists:X,handleAddSubList:B,hasSearchQuery:ea,listProjection:ei?eo:void 0,listsByParent:K,parentListsProjection:el,sortedParentLists:er}),Y.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(dI.AppSidebarDivider,{className:"my-2 border-0 border-border border-b"}),(0,a.jsx)(dS.AppSidebarSection,{className:"min-w-0",title:"Spaces",titleCase:!0,children:Y.map(s=>{var i;let r=(i=s._id,`team-${i}`),l=ea||(p[r]??!1),o=n===s._id&&null===e&&!t;return(0,a.jsx)(cf,{isExpanded:l,isTeamRootActive:o,listIdsWithMatchingTasks:q,onToggleExpand:()=>x(r),searchQuery:j,team:s},s._id)})})]})]});return ei?(0,a.jsx)(i.DndContext,{collisionDetection:i.closestCenter,onDragEnd:eh,onDragOver:em,onDragStart:ec,sensors:ed,children:s}):s})()}),(0,a.jsx)(d_.AppSidebarFooter,{className:"border-t px-2 py-1.5",children:(0,a.jsx)(ci,{})})]})}var cb=e.i(97852);function cy(e){return e.listId??""}function cj(e){let t,n,i=(0,s.c)(4),{isMyTasksList:r,liveIconData:l}=e;if(r){let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(eg.MyTasksIcon,{size:12}),i[0]=e):e=i[0],e}return i[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(c.ListTodo,{className:"h-3 w-3 text-muted-foreground"}),i[1]=t):t=i[1],i[2]!==l?(n=(0,a.jsx)(em.IconDisplay,{fallback:t,size:12,value:l}),i[2]=l,i[3]=n):n=i[3],n}function cI({tab:e,isActive:t,canDrag:n,onSelect:i,onClose:o}){let d=function(e){let t,n=(0,s.c)(4),{gate:a,isGuest:i}=(0,f.useGuestGate)();return n[0]!==a||n[1]!==i||n[2]!==e?(t=e&&!i?a({id:e}):"skip",n[0]=a,n[1]=i,n[2]=e,n[3]=t):t=n[3],(0,l.useQuery)(r.api.todo_lists.queries.getById,t)}(e.listId),{myTasksListId:c}=(0,D.useMyTasksListId)(),u=(0,m.useRef)(null);d?.name&&(u.current=d.name);let p=d?.name??e.title??u.current??"…",h=void 0!==e.listId&&e.listId===c,x=e.iconData;d&&(x=(0,eI.fromConvexIconData)(d.iconData));let{attributes:g,listeners:v,setNodeRef:b,transform:y,transition:I,isDragging:_}=(0,tE.useSortable)({disabled:!n,id:cy(e)}),S={opacity:_?.5:1,transform:tr.CSS.Transform.toString(y),transition:I};return(0,a.jsxs)("div",{"aria-selected":t,className:(0,j.cn)("nodrag nopan group flex max-w-32 shrink-0 cursor-pointer select-none items-center gap-1 rounded-md px-2 py-1 text-xs transition-colors [-webkit-touch-callout:none]",t?"bg-surface-hover font-medium text-foreground":"text-muted-foreground hover:bg-card hover:text-foreground"),draggable:!1,onClick:e=>{e.stopPropagation(),i()},onDragStart:e=>e.preventDefault(),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),i())},ref:b,style:S,...n?{...g,...v}:{},role:"tab",tabIndex:0,children:[(0,a.jsxs)("button",{"aria-label":`Close ${p}`,className:"nodrag flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded transition-colors hover:bg-muted-foreground/20",onClick:e=>{e.stopPropagation(),o(e)},type:"button",children:[(0,a.jsx)("span",{className:"group-hover:hidden",children:(0,a.jsx)(cj,{isMyTasksList:h,liveIconData:x})}),(0,a.jsx)(ej.X,{className:"hidden h-3 w-3 group-hover:block",strokeWidth:2})]}),(0,a.jsx)("span",{className:"min-w-0 select-none truncate",children:p})]})}function c_(e){let t,n,r,l,o,d,c,u,m,p=(0,s.c)(31),{windowId:h}=e,f=(0,J.useOpenTabs)(),x=(0,J.useSelectTab)(),v=(0,J.useCloseTab)(),b=(0,J.useReorderTabs)(),y=(0,J.useCurrentListId)(),{modifiers:j}=(0,g.useScaledDnd)();p[0]===Symbol.for("react.memo_cache_sentinel")?(t={activationConstraint:{distance:8}},p[0]=t):t=p[0],p[1]===Symbol.for("react.memo_cache_sentinel")?(n={coordinateGetter:tE.sortableKeyboardCoordinates},p[1]=n):n=p[1];let I=(0,i.useSensors)((0,i.useSensor)(i.PointerSensor,t),(0,i.useSensor)(i.KeyboardSensor,n)),_=(0,cb.usePortalTargetById)(`todo-list-title-bar-${h}`);if(!_||0===f.length)return null;let S=f.length>1;p[2]!==f?(r=f.map(cy),p[2]=f,p[3]=r):r=p[3];let k=r;p[4]!==f||p[5]!==b?(l=e=>{let{active:t,over:n}=e;if(!n||t.id===n.id)return;let a=f.findIndex(e=>cy(e)===t.id),s=f.findIndex(e=>cy(e)===n.id);-1!==a&&-1!==s&&b(a,s)},p[4]=f,p[5]=b,p[6]=l):l=p[6];let w=l;if(p[7]!==S||p[8]!==v||p[9]!==y||p[10]!==f||p[11]!==x){let e;p[13]!==S||p[14]!==v||p[15]!==y||p[16]!==x?(e=(e,t)=>(0,a.jsx)(cI,{canDrag:S,isActive:e.listId===y,onClose:e=>{e.stopPropagation(),v(t)},onSelect:()=>x(t),tab:e},cy(e)),p[13]=S,p[14]=v,p[15]=y,p[16]=x,p[17]=e):e=p[17],o=f.map(e),p[7]=S,p[8]=v,p[9]=y,p[10]=f,p[11]=x,p[12]=o}else o=p[12];p[18]!==o?(d=(0,a.jsx)(tm.ScrollArea,{className:"[&>[data-orientation=horizontal]]:!h-0.5 flex w-full min-w-0 select-none",classNameViewport:"flex",scrollbars:"horizontal",children:(0,a.jsx)("div",{className:"flex w-max flex-nowrap items-center justify-start gap-1",onWheel:cS,children:o})}),p[18]=o,p[19]=d):d=p[19],p[20]!==d||p[21]!==k?(c=(0,a.jsx)(tE.SortableContext,{items:k,strategy:tE.horizontalListSortingStrategy,children:d}),p[20]=d,p[21]=k,p[22]=c):c=p[22],p[23]!==w||p[24]!==j||p[25]!==I||p[26]!==c?(u=(0,a.jsx)(i.DndContext,{collisionDetection:i.closestCenter,modifiers:j,onDragEnd:w,sensors:I,children:c}),p[23]=w,p[24]=j,p[25]=I,p[26]=c,p[27]=u):u=p[27];let C=u;return p[28]!==_||p[29]!==C?(m=(0,t7.createPortal)(C,_),p[28]=_,p[29]=C,p[30]=m):m=p[30],m}function cS(e){0!==e.deltaX&&e.stopPropagation()}function ck(e){return null!=e&&"object"==typeof e&&"type"in e&&"list"===e.type&&"listId"in e&&"string"==typeof e.listId&&"listName"in e&&"string"==typeof e.listName}var cw=e.i(6861);function cC(e){let t,n,i,r,l,d=(0,s.c)(8),{setSidebarOpen:c}=e;return d[0]!==c?(t=()=>c(!0),d[0]=c,d[1]=t):t=d[1],d[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(u.PanelLeft,{className:"h-4 w-4"}),d[2]=n):n=d[2],d[3]!==t?(i=(0,a.jsx)(o.Button,{"aria-label":"Open sidebar",onClick:t,size:"icon",variant:"ghost",children:n}),d[3]=t,d[4]=i):i=d[4],d[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden",id:"tasks-collapsed-header-slot"}),d[5]=r):r=d[5],d[6]!==i?(l=(0,a.jsxs)("div",{className:"nodrag flex h-10 shrink-0 items-center justify-between gap-2 px-2",children:[i,r]}),d[6]=i,d[7]=l):l=d[7],l}let cT="tasks-last-view";function cN(e){var t;let n,o,u,y,j,I,_,S,k,w,C,T,N,D,L,A,P,O,E,M,R=(0,s.c)(50),{windowId:z}=e,B=(0,J.useCurrentListId)(),U=(0,J.useOpenTaskId)(),F=(0,J.useSetOpenTaskId)(),G=(0,J.useIsSidebarOpen)(),q=(0,J.useSetSidebarOpen)(),[$,K]=(0,m.useState)(208),{gate:Q}=(0,f.useGuestGate)();R[0]!==Q?(n=Q({}),R[0]=Q,R[1]=n):n=R[1],(0,l.useQuery)(r.api.todos.queries.getAll,n);let V=(0,l.useMutation)(r.api.todo_lists.list_organization.moveList),W=(0,l.useQuery)(r.api.todo_lists.queries.getAllAccessible,Q({}))??[];R[2]!==V||R[3]!==W?(o={moveList:V,parentLists:W},R[2]=V,R[3]=W,R[4]=o):o=R[4];let{sensors:H,activeItem:Y,handleDragStart:X,handleDragEnd:Z}=function(e){let t,n,a,r,l,o,d=(0,s.c)(11),{moveList:c,parentLists:u}=e,[p,h]=(0,m.useState)(null);d[0]===Symbol.for("react.memo_cache_sentinel")?(t={activationConstraint:{distance:8}},d[0]=t):t=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{delay:200,tolerance:5}},d[1]=n):n=d[1],d[2]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:tE.sortableKeyboardCoordinates},d[2]=a):a=d[2];let f=(0,i.useSensors)((0,i.useSensor)(i.PointerSensor,t),(0,i.use
1Sensor)(i.TouchSensor,n),(0,i.useSensor)(i.KeyboardSensor,a));d[3]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{let t=e.active.data.current;ck(t)&&h(t)},d[3]=r):r=d[3];let x=r;if(d[4]!==c||d[5]!==u){let e=async(e,t)=>{let n=void 0===t?"My Tasks":u.find(e=>e._id===t)?.name??"List";try{await c({id:e.listId,parentId:t}),e3.toast.success(`Moved "${e.listName}" to "${n}"`)}catch(e){e3.toast.error(e instanceof Error?e.message:"Failed to move list")}};l=async t=>{var n;let{active:a,over:s}=t;if(h(null),!s||a.id===s.id)return;let i=a.data.current,r=s.data.current;if(!(ck(i)&&null!=r&&"object"==typeof r&&"type"in r&&("my-tasks"===r.type||"parent-list"===r.type&&"parentId"in r&&"string"==typeof r.parentId)))return;let l=function(e){if("my-tasks"!==e.type)return e.parentId}(r);n=i.currentParentId,(void 0!==n||void 0!==l)&&(void 0===n||void 0===l||n!==l)&&await e(i,l)},d[4]=c,d[5]=u,d[6]=l}else l=d[6];let g=l;return d[7]!==p||d[8]!==g||d[9]!==f?(o={sensors:f,activeItem:p,handleDragStart:x,handleDragEnd:g},d[7]=p,d[8]=g,d[9]=f,d[10]=o):o=d[10],o}(o),{modifiers:ee}=(0,g.useScaledDnd)(),et=(0,v.usePortalContainer)();t=!U,E=(0,s.c)(4),M=(0,J.useRequestFocusInput)(),E[0]!==t||E[1]!==M?(P=function(){if(!t)return;let e=e=>{var t;"c"!==e.key.toLowerCase()||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(t=e.target)instanceof HTMLElement&&(t.isContentEditable||"INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName)||(e.preventDefault(),M())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},O=[t,M],E[0]=t,E[1]=M,E[2]=P,E[3]=O):(P=E[2],O=E[3]),(0,m.useEffect)(P,O),function(e){let t,n,a=(0,s.c)(4),{undo:i,redo:r}=e;a[0]!==r||a[1]!==i?(t=function(){let e=e=>{!(e.metaKey||e.ctrlKey)||"z"!==e.key.toLowerCase()||function(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||e.isContentEditable}(e.target)||(e.preventDefault(),e.shiftKey?r():i())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},n=[i,r],a[0]=r,a[1]=i,a[2]=t,a[3]=n):(t=a[2],n=a[3]),(0,m.useEffect)(t,n)}(aG());let en=!!U,ea=!en&&!!B,es=!(en||ea);R[5]!==z?(u=(0,a.jsx)(c_,{windowId:z}),R[5]=z,R[6]=u):u=R[6];let ei=!G;R[7]===Symbol.for("react.memo_cache_sentinel")?(y=(0,a.jsx)(cv,{}),R[7]=y):y=R[7],R[8]!==G||R[9]!==q?(j=!G&&(0,a.jsx)(cC,{setSidebarOpen:q}),R[8]=G,R[9]=q,R[10]=j):j=R[10],R[11]!==U||R[12]!==F||R[13]!==en?(I=en&&U&&(0,a.jsx)(dv,{onClose:()=>F(null),taskId:U}),R[11]=U,R[12]=F,R[13]=en,R[14]=I):I=R[14],R[15]!==ea?(_=ea&&(0,a.jsx)(lc,{}),R[15]=ea,R[16]=_):_=R[16],R[17]!==es?(S=es&&(0,a.jsx)(oa,{}),R[17]=es,R[18]=S):S=R[18],R[19]!==I||R[20]!==_||R[21]!==S?(k=(0,a.jsxs)("div",{className:"min-h-0 flex-1 overflow-hidden",children:[I,_,S]}),R[19]=I,R[20]=_,R[21]=S,R[22]=k):k=R[22],R[23]!==en?(w=!en&&(0,a.jsx)(tt,{}),R[23]=en,R[24]=w):w=R[24],R[25]!==k||R[26]!==w||R[27]!==j?(C=(0,a.jsx)(b.SwipeToRevealProvider,{children:(0,a.jsxs)(p.AppContent,{className:"relative flex flex-col",children:[j,k,w]})}),R[25]=k,R[26]=w,R[27]=j,R[28]=C):C=R[28],R[29]!==G||R[30]!==q||R[31]!==$||R[32]!==C||R[33]!==ei?(T=(0,a.jsxs)(h.AppSidebarLayout,{appProvidesReopen:ei,minSidebarWidth:208,onSidebarOpenChange:q,onSidebarWidthChange:K,sidebarOpen:G,sidebarWidth:$,children:[y,C]}),R[29]=G,R[30]=q,R[31]=$,R[32]=C,R[33]=ei,R[34]=T):T=R[34];let er=et??void 0;return R[35]!==Y?(N=Y&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-background px-3 py-2 shadow-lg ring-1 ring-border",children:[(0,a.jsx)(c.ListTodo,{className:"h-5 w-5 text-muted-foreground"}),(0,a.jsx)(d.Text,{as:"span",className:"max-w-32 truncate",variant:"bodySmall",children:Y.listName})]}),R[35]=Y,R[36]=N):N=R[36],R[37]!==er||R[38]!==N?(D=(0,a.jsx)(x.ScaledDragOverlay,{container:er,children:N}),R[37]=er,R[38]=N,R[39]=D):D=R[39],R[40]!==Z||R[41]!==X||R[42]!==ee||R[43]!==H||R[44]!==T||R[45]!==D?(L=(0,a.jsxs)(i.DndContext,{modifiers:ee,onDragEnd:Z,onDragStart:X,sensors:H,children:[T,D]}),R[40]=Z,R[41]=X,R[42]=ee,R[43]=H,R[44]=T,R[45]=D,R[46]=L):L=R[46],R[47]!==L||R[48]!==u?(A=(0,a.jsxs)(a.Fragment,{children:[u,L]}),R[47]=L,R[48]=u,R[49]=A):A=R[49],A}e.s(["TodoListApp",0,function(e){let t,n,i,r,l,o=(0,s.c)(13),{onOpenApp:d,savedAppState:c,onAppStateChange:u,windowId:m}=e;o[0]!==c?(t=c&&Object.keys(c).length>0?c:function(){try{let e=localStorage.getItem(cT);if(!e)return;let t=JSON.parse(e);return"object"!=typeof t||null===t||Array.isArray(t)?void 0:t}catch(e){console.warn("Unable to read the saved Tasks view",e)}}(),o[0]=c,o[1]=t):t=o[1];let p=t;o[2]!==u?(n=e=>{u?.(e);try{localStorage.setItem(cT,JSON.stringify(e))}catch(e){console.warn("Unable to save the Tasks view",e)}},o[2]=u,o[3]=n):n=o[3];let h=n;return o[4]!==m?(i=(0,a.jsx)(cN,{windowId:m}),o[4]=m,o[5]=i):i=o[5],o[6]!==h||o[7]!==p||o[8]!==i?(r=(0,a.jsx)(cw.TasksProvider,{initialState:p,onAppStateChange:h,children:i}),o[6]=h,o[7]=p,o[8]=i,o[9]=r):r=o[9],o[10]!==d||o[11]!==r?(l=(0,a.jsx)(v.AppPropsProvider,{onOpenApp:d,children:r}),o[10]=d,o[11]=r,o[12]=l):l=o[12],l}],392576)}]);

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.