1import{r as h,j as e,af as se,dx as at,dy as nt,cq as st,Q as Ge,dz as rt,a9 as it,au as Ie,X as lt,D as Se,aC as ot,z as ct,ay as dt,L as mt,aP as $e,aO as ut,al as ht,aD as xt}from"./react-vendor-4YRa2s_z.js";import{s as W,B as N,C as Xe,Y as pt,c as q,e as Je,aV as gt,u as Ze,d as ie,b as ft,S as bt,t as V}from"./index-DZis4BhX.js";import{u as yt}from"./ClientContext-CrE4I_Sk.js";import{u as jt}from"./HelpCardContext-CV1GDk4t.js";import{m as et}from"./teamService-B4PiPLxm.js";import{p as le,f as Y,o as ge,b as fe,v as _t,y as wt}from"./date-vendor-DFlaJNMG.js";import{P as vt}from"./PageSectionHeader-CV_ZaWFq.js";import{T as Nt}from"./tool-info-card-dhilKT1k.js";import{a as kt}from"./urlUtils-WRQucguB.js";import{A as be,a as ye,b as je}from"./avatar-B4lXnb_J.js";import{C as _e}from"./checkbox-xQfbvPBN.js";import{I as Q}from"./input-7Hx0az1B.js";import{a as Fe,b as Oe,c as Ue,T as Le}from"./tooltip-BMREYJY1.js";import{D as Ae,a as Ce,b as De,c as Me,d as Te,e as Ee}from"./dialog-CZSrocdd.js";import{T as we}from"./textarea-C6YuCnJA.js";import{L as R}from"./label-u4XokumS.js";import{S as Pe,a as qe,b as Be,c as Re,d as H}from"./select-V03c1WxC.js";import{b as St}from"./workflowService-BhA8ou3K.js";import{A as At,a as Ct,b as Dt,c as Mt,d as Tt,e as Et,f as It,g as $t}from"./alert-dialog-CPHz3EYf.js";import{S as Ft}from"./switch-BmDC9jdf.js";import{T as Ot,a as Ut,b as Lt,c as Pt}from"./tabs-DeuK0LDw.js";import{a as qt,b as Bt,c as Rt,D as We}from"./dropdown-menu-DpQr_LMi.js";import"./supabase-vendor-LPZzPchk.js";import"./router-vendor-DbhFwP6h.js";import"./useMutation-CpXffuWa.js";import"./useSubscription-CF2cxNke.js";const Z="marketing_actions";async function Wt(t){const{data:r,error:s}=await W.from(Z).select("*").eq("client_id",t).order("sort_order",{ascending:!0}).order("created_at",{ascending:!0});if(s)throw s;const p=r??[];if(p.length===0)return p;const{data:d,error:n}=await W.from("marketing_action_sub_actions").select("*").in("action_id",p.map(u=>u.id)).order("sort_order",{ascending:!0}).order("created_at",{ascending:!0});if(n)throw n;const m=new Map;for(const u of d??[]){const k=m.get(u.action_id)??[];k.push(u),m.set(u.action_id,k)}return p.map(u=>({...u,sub_actions:m.get(u.id)??[]}))}async function zt(t,r,s){const{data:{user:p}}=await W.auth.getUser();if(!p)throw new Error("User not authenticated");const{data:d,error:n}=await W.from(Z).insert({...r,client_id:t,user_id:p.id,sort_order:s}).select().single();if(n)throw n;return d}async function Vt(t,r){if(r.length===0)return[];const{data:{user:s}}=await W.auth.getUser();if(!s)throw new Error("User not authenticated");const{data:p,error:d}=await W.from(Z).insert(r.map(({input:n,sortOrder:m})=>({...n,client_id:t,user_id:s.id,sort_order:m}))).select();if(d)throw d;return p??[]}async function re(t,r){const{data:s,error:p}=await W.from(Z).update(r).eq("id",t).select().single();if(p)throw p;return s}async function Ht(t,r){return re(t,{status:r})}async function Qt(t){const{error:r}=await W.from(Z).delete().eq("id",t);if(r)throw r}async function Kt(t,r,s){const{data:p,error:d}=await W.from("marketing_action_sub_actions").insert({action_id:t,title:r.trim(),sort_order:s}).select().single();if(d)throw d;return p}async function ze(t,r){const s=r.title===void 0?r:{...r,title:r.title.trim()},{data:p,error:d}=await W.from("marketing_action_sub_actions").update(s).eq("id",t).select().single();if(d)throw d;return p}async function Yt(t){const{error:r}=await W.from("marketing_action_sub_actions").delete().eq("id",t);if(r)throw r}const oe=(t=new Date)=>Y(t,"yyyy-MM-dd"),ve=(t,r,s=1,p=1)=>{const d=le(t),n=Number.isInteger(s)&&s>0?s:1,m=Number.isInteger(p)&&p>0?p:1,u=r==="daily"?ge(d,m):r==="weekly"?_t(d,n*m):r==="monthly"?fe(d,n*m):r==="quarterly"?fe(d,3*m):wt(d,m);return Y(u,"yyyy-MM-dd")},Gt=(t,r,s=1,p=oe())=>{let d=1,n=ve(t,r,s,d);for(;n<=p;)d+=1,n=ve(t,r,s,d);return n},Xt=(t,r=oe())=>!!(t.next_maintenance_date&&t.next_maintenance_date<=r),Ne=t=>[...t].sort((r,s)=>!r.next_maintenance_date&&!s.next_maintenance_date?r.sort_order-s.sort_order:r.next_maintenance_date?s.next_maintenance_date?r.next_maintenance_date.localeCompare(s.next_maintenance_date)||r.sort_order-s.sort_order:1:-1),Jt=(t,r=oe())=>{const s=le(r),p=Y(ge(s,3),"yyyy-MM-dd"),d=Y(ge(s,7),"yyyy-MM-dd"),n=Y(fe(s,1),"yyyy-MM-dd"),m={unscheduled:[],today:[],inThreeDays:[],inOneWeek:[],inOneMonth:[],moreThanOneMonth:[]};for(const u of Ne(t))u.next_maintenance_date?u.next_maintenance_date<=r?m.today.push(u):u.next_maintenance_date<=p?m.inThreeDays.push(u):u.next_maintenance_date<=d?m.inOneWeek.push(u):u.next_maintenance_date<=n?m.inOneMonth.push(u):m.moreThanOneMonth.push(u):m.unscheduled.push(u);return m},Zt=t=>t.filter(r=>r.data.columnType==="marketing_actions");function ea({open:t,onOpenChange:r,actionTitle:s,notes:p,onSave:d}){const[n,m]=h.useState(p),[u,k]=h.useState(!1),[L,y]=h.useState("");h.useEffect(()=>{t&&(m(p),y(""))},[t,p]);const F=async()=>
1{if(!u){k(!0),y("");try{await d(n.trim()),r(!1)}catch{y("Could not save this note. Please try again.")}finally{k(!1)}}};return e.jsx(Ae,{open:t,onOpenChange:r,children:e.jsxs(Ce,{className:"max-h-[90vh] overflow-y-auto sm:max-w-md",children:[e.jsxs(De,{children:[e.jsx(Me,{children:"Action Note"}),e.jsxs(Te,{children:["Add or edit the private note for â",s,"â."]})]}),e.jsx(we,{value:n,onChange:b=>m(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),F())},rows:6,className:"font-nunito text-base md:text-sm",placeholder:"Enter a note for this Action","aria-label":`Note for ${s}`,autoFocus:!0}),L?e.jsx("p",{className:"text-sm text-destructive",children:L}):null,e.jsxs(Ee,{children:[e.jsx(N,{type:"button",variant:"outline",onClick:()=>r(!1),disabled:u,children:"Cancel"}),e.jsx(N,{type:"button",onClick:()=>void F(),disabled:u,children:u?"Savingâ¦":"Save"})]})]})})}const Ve={new:"New",run:"Run",pause:"Pause",stop:"Stop"},He=[{value:"new",icon:se},{value:"run",icon:at},{value:"pause",icon:nt},{value:"stop",icon:st}];function ta({action:t,onEdit:r,onDelete:s,onStatusChange:p,onMarkMaintained:d,onAddSubAction:n,onToggleSubAction:m,onUpdateSubAction:u,onDeleteSubAction:k,onUpdateNotes:L,condensed:y=!1}){var J;const[F,b]=h.useState(""),[U,P]=h.useState(!1),[S,E]=h.useState(!1),[w,$]=h.useState(!1),[A,z]=h.useState(!1),[c,j]=h.useState(null),[C,B]=h.useState(""),x=h.useRef(!1),_=h.useRef(!1),v=Xt(t),D=t.dashboard_link.trim()?kt(t.dashboard_link):"",M=t.sub_actions??[],ce=h.useMemo(()=>[...M].sort((l,a)=>Number(a.is_completed)-Number(l.is_completed)||l.title.localeCompare(a.title,void 0,{sensitivity:"base",numeric:!0})||l.sort_order-a.sort_order),[M]),X=M.filter(l=>l.is_completed).length,de=((J=He.find(({value:l})=>l===t.status))==null?void 0:J.icon)??se,ee=S||w&&M.length>0,me=!y||ee,te=()=>{b(""),E(!1),M.length===0&&$(!1)},ue=()=>{w&&(b(""),E(!1)),$(!w)},he=async l=>{l.preventDefault(),l.stopPropagation();const a=F.trim();if(a){P(!0);try{await n(a),b(""),E(!1),$(!0)}finally{P(!1)}}},xe=l=>{_.current=!1,j(l.id),B(l.title)},ae=async l=>{if(_.current){_.current=!1;return}if(x.current)return;const a=C.trim();if(!a||a===l.title){j(null);return}x.current=!0;try{await u(l,a),j(null)}catch{}finally{x.current=!1}},pe=()=>{_.current=!0,j(null),B("")};return e.jsxs(Xe,{className:q("group flex h-full flex-col border-border/70 shadow-none transition",t.status==="run"&&"border-primary/60 shadow-sm ring-1 ring-primary/45 hover:border-primary/75",v&&"border-destructive/60 ring-destructive/35"),children:[e.jsx(pt,{className:y?"space-y-0 p-2.5":"space-y-2 p-4 pb-2",children:e.jsxs("div",{className:q("flex gap-2",y?"min-h-7 items-center":"items-start"),children:[e.jsxs("div",{className:q("flex min-w-0 flex-1 gap-1",y?"items-center":"items-start"),children:[e.jsx("h3",{className:q("min-w-0 font-nunito text-sm font-semibold leading-snug",y&&"truncate"),children:t.title}),M.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"shrink-0 font-nunito text-xs text-muted-foreground","aria-label":`${X} of ${M.length} sub-actions running`,children:["(",X,"/",M.length,")"]}),e.jsx(N,{type:"button",variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0 text-muted-foreground",onClick:ue,"aria-expanded":w,"aria-label":`${w?"Collapse":"Expand"} sub-actions for ${t.title}`,children:e.jsx(Ge,{className:q("h-3.5 w-3.5 transition-transform",w&&"rotate-90")})})]}):null]}),y&&t.assignees.length>0?e.jsx(Fe,{delayDuration:200,children:e.jsxs("div",{className:"flex shrink-0 -space-x-1","aria-label":`Assignees: ${t.assignees.map(l=>l.label).join(", ")}`,children:[t.assignees.slice(0,3).map(l=>e.jsxs(Oe,{children:[e.jsx(Ue,{asChild:!0,children:e.jsx("div",{children:e.jsxs(be,{className:"h-5 w-5 shrink-0 border border-border/60",children:[l.avatarUrl?e.jsx(ye,{src:l.avatarUrl,alt:""}):null,e.jsx(je,{className:q(l.initials.length===1?"text-[10px]":"text-[8px]","font-semibold"),children:l.initials})]})})}),e.jsx(Le,{children:l.label})]},l.id)),t.assignees.length>3?e.jsxs("div",{className:"relative flex h-5 w-5 items-center justify-center rounded-full border border-border/60 bg-muted text-[8px] font-semibold text-muted-foreground",children:["+",t.assignees.length-3]}):null]})}):null,y&&t.assignees.length>0?e.jsx("span",{className:"h-4 w-px shrink-0 bg-border","aria-hidden":"true"}):null,e.jsx(N,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>z(!0),"aria-label":t.notes?`Edit note for ${t.title}`:`Add note to ${t.title}`,children:e.jsxs("span",{className:"relative",children:[e.jsx(rt,{className:q("h-3.5 w-3.5",t.notes&&"text-primary")}),t.notes?e.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 rounded-full bg-primary"}):null]})}),D?e.jsx(N,{asChild:!0,variant:"default",size:"icon",className:"h-7 w-7 shrink-0",children:e.jsx("a",{href:D,target:"_blank",rel:"noopener noreferrer",draggable:!1,onDragStart:l=>l.stopPropagation(),"aria-label":"Open dashboard in a new tab",children:e.jsx(it,{className:"h-3.5 w-3.5"})})}):null]})}),me?e.jsxs(Je,{className:q("text-xs",y?"space-y-2 px-2.5 pb-2.5 pt-0":"flex-1 space-y-3 p-4 pt-2"),children:[y?null:e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-muted-foreground",children:[e.jsxs("div",{children:[e.jsx("span",{className:"block text-[10px] uppercase tracking-wide",children:"Last maintenance"}),e.jsx("span",{className:"text-foreground",children:t.last_maintenance_date?Y(le(t.last_maintenance_date),"M/d/yyyy"):"â"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"block text-[10px] uppercase tracking-wide",children:"Next maintenance"}),e.jsx("span",{className:q("text-foreground",v&&"font-semibold text-destructive"),children:t.next_maintenance_date?Y(le(t.next_maintenance_date),"M/d/yyyy"):"â"})]})]}),!y&&t.assignees.length>0?e.jsxs("div",{children:[e.jsx("span",{className:"mb-1 block text-[10px] uppercase tracking-wide text-muted-foreground",children:"Assignees"}),e.jsx(Fe,{delayDuration:200,children:e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:t.assignees.map(l
1=>e.jsxs(Oe,{children:[e.jsx(Ue,{asChild:!0,children:e.jsxs("div",{className:"inline-flex items-center gap-1 rounded-full border bg-background py-0.5 pl-0.5 pr-2",children:[e.jsxs(be,{className:"h-5 w-5",children:[l.avatarUrl?e.jsx(ye,{src:l.avatarUrl,alt:""}):null,e.jsx(je,{className:"text-[9px]",children:l.initials})]}),e.jsx("span",{className:"max-w-24 truncate",children:l.label})]})}),e.jsx(Le,{children:l.label})]},l.id))})})]}):null,ee?e.jsxs("div",{className:"space-y-1.5 rounded-md border border-border/60 p-2",draggable:!1,onDragStart:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Sub-actions"}),M.length>0?e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[X,"/",M.length," running"]}):null]}),M.length>0?e.jsx("div",{className:"space-y-0.5",children:ce.map(l=>e.jsxs("div",{className:"group flex items-center gap-1.5 rounded-sm py-0.5",children:[e.jsx(_e,{checked:l.is_completed,onCheckedChange:()=>m(l),"aria-label":`${l.is_completed?"Stop running":"Mark as running"}: ${l.title}`,className:"h-3.5 w-3.5"}),c===l.id?e.jsx(Q,{autoFocus:!0,value:C,onChange:a=>B(a.target.value),onBlur:()=>void ae(l),onKeyDown:a=>{a.key==="Enter"?(a.preventDefault(),ae(l)):a.key==="Escape"&&(a.preventDefault(),pe())},onClick:a=>a.stopPropagation(),className:"h-7 min-w-0 flex-1 px-1.5 text-xs",maxLength:300,"aria-label":`Edit sub-action ${l.title}`}):e.jsx("span",{className:q("min-w-0 flex-1 cursor-text break-words text-xs leading-5",l.is_completed&&"font-medium text-foreground"),onDoubleClick:()=>xe(l),title:"Double-click to edit",children:l.title}),e.jsx(N,{type:"button",variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0 text-muted-foreground opacity-70 hover:text-destructive sm:opacity-0 sm:group-hover:opacity-100 sm:focus-visible:opacity-100",onClick:()=>k(l),"aria-label":`Delete sub-action ${l.title}`,children:e.jsx(Ie,{className:"h-3 w-3"})})]},l.id))}):null,S?e.jsxs("form",{className:"flex items-center gap-1",onSubmit:he,children:[e.jsx(Q,{autoFocus:!0,value:F,onChange:l=>b(l.target.value),onKeyDown:l=>{l.key==="Escape"&&te()},placeholder:"Add a sub-actionâ¦",maxLength:300,className:"h-7 text-xs","aria-label":`New sub-action for ${t.title}`}),e.jsx(N,{type:"submit",variant:"outline",size:"icon",className:"h-7 w-7 shrink-0",disabled:!F.trim()||U,"aria-label":"Save sub-action",children:e.jsx(se,{className:"h-3.5 w-3.5"})}),e.jsx(N,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground",onClick:te,"aria-label":"Cancel adding sub-action",children:e.jsx(lt,{className:"h-3.5 w-3.5"})})]}):null]}):null]}):null,e.jsxs(gt,{className:q("flex flex-wrap gap-1 border-t",y?"mt-auto p-2":"p-2.5"),children:[e.jsxs("div",{className:"relative",draggable:!1,onDragStart:l=>l.stopPropagation(),children:[e.jsx(de,{className:"pointer-events-none absolute left-2 top-1/2 z-10 h-3.5 w-3.5 -translate-y-1/2"}),e.jsx("select",{value:t.status,onChange:l=>p(l.target.value),onPointerDown:l=>l.stopPropagation(),className:"h-7 appearance-none rounded-md border border-input bg-background py-0 pl-7 pr-7 font-nunito text-xs text-foreground outline-none transition-colors hover:border-primary/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","aria-label":`Status: ${Ve[t.status]}`,children:He.map(({value:l})=>e.jsx("option",{value:l,children:Ve[l]},l))}),e.jsx(Se,{className:"pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"})]}),v?e.jsxs(N,{size:"sm",variant:"outline",className:"h-7 px-2 text-xs",onClick:d,children:[e.jsx(ot,{className:"mr-1 h-3.5 w-3.5"}),"Mark maintained"]}):null,e.jsxs("div",{className:"ml-auto flex sm:opacity-0 sm:transition-opacity sm:group-hover:opacity-100 sm:group-focus-within:opacity-100",children:[e.jsx(N,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{$(!0),E(!0)},disabled:S,"aria-label":`Add a sub-action to ${t.title}`,children:e.jsx(se,{className:"h-3.5 w-3.5"})}),e.jsx(N,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,"aria-label":`Edit ${t.title}`,children:e.jsx(ct,{className:"h-3.5 w-3.5"})}),e.jsx(N,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:s,"aria-label":`Delete ${t.title}`,children:e.jsx(Ie,{className:"h-3.5 w-3.5"})})]})]}),e.jsx(ea,{open:A,onOpenChange:z,actionTitle:t.title,notes:t.notes,onSave:L})]})}const Qe={title:"",description:"",dashboard_link:"",notes:"",status:"new",maintenance_mode:"none",maintenance_cadence:null,maintenance_interval:1,last_maintenance_date:null,next_maintenance_date:null,assignees:[]},aa=t=>
1t.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>{var s;return(s=r[0])==null?void 0:s.toUpperCase()}).join("")||"U";function na({open:t,onOpenChange:r,action:s,onSubmit:p}){const{user:d}=Ze(),[n,m]=h.useState(Qe),[u,k]=h.useState(!1),[L,y]=h.useState(!1),[F,b]=h.useState(""),{data:U=[],isLoading:P}=ie({queryKey:["action-assignees",d==null?void 0:d.id],queryFn:et,enabled:t&&!!d,staleTime:5*60*1e3}),S=h.useMemo(()=>{var C,B,x,_,v;const c=String(((C=d==null?void 0:d.user_metadata)==null?void 0:C.nickname)||((B=d==null?void 0:d.user_metadata)==null?void 0:B.first_name)||((x=d==null?void 0:d.user_metadata)==null?void 0:x.full_name)||((_=d==null?void 0:d.email)==null?void 0:_.split("@")[0])||"You").trim();return[...d?[{id:`self:${d.id}`,label:c,avatarUrl:(v=d.user_metadata)==null?void 0:v.avatar_url,initials:aa(c),source:"self"}]:[],...U.filter(D=>D.userId!==(d==null?void 0:d.id)).map(D=>({id:D.id,label:D.label,avatarUrl:D.avatarUrl,initials:D.initials,source:D.source}))]},[U,d]),E=h.useMemo(()=>n.maintenance_mode==="recurring"&&n.maintenance_cadence&&n.last_maintenance_date?ve(n.last_maintenance_date,n.maintenance_cadence,n.maintenance_interval):null,[n.last_maintenance_date,n.maintenance_cadence,n.maintenance_interval,n.maintenance_mode]),w=E??n.next_maintenance_date;h.useEffect(()=>{t&&(m(s?{title:s.title,description:s.description,dashboard_link:s.dashboard_link,notes:s.notes,status:s.status,maintenance_mode:s.maintenance_mode,maintenance_cadence:s.maintenance_cadence,maintenance_interval:s.maintenance_interval??1,last_maintenance_date:s.last_maintenance_date,next_maintenance_date:s.next_maintenance_date,assignees:s.assignees??[],workflow_node_id:s.workflow_node_id,workflow_card_id:s.workflow_card_id}:Qe),k(!1),b(""))},[s,t]);const $=c=>{m(j=>({...j,maintenance_mode:c,maintenance_cadence:c==="recurring"?j.maintenance_cadence??"monthly":null,maintenance_interval:c==="recurring"&&j.maintenance_interval||1,next_maintenance_date:c==="none"?null:j.next_maintenance_date}))},A=c=>{m(j=>({...j,assignees:j.assignees.some(C=>C.id===c.id)?j.assignees.filter(C=>C.id!==c.id):[...j.assignees,c]}))},z=async c=>{c.preventDefault();const j=n.title.trim();if(!j){b("Title is required.");return}if(n.maintenance_mode!=="none"&&!w){b("Choose the next maintenance date.");return}if(n.maintenance_mode==="recurring"&&(!Number.isInteger(n.maintenance_interval)||n.maintenance_interval<1||n.maintenance_interval>999)){b("The maintenance interval must be between 1 and 999.");return}y(!0),b("");try{await p({...n,title:j,description:n.description.trim(),dashboard_link:n.dashboard_link.trim(),notes:n.notes.trim(),next_maintenance_date:w}),r(!1)}catch(C){console.error("Failed to save marketing action:",C),b("Could not save this action. Please try again.")}finally{y(!1)}};return e.jsx(Ae,{open:t,onOpenChange:r,children:e.jsxs(Ce,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:[e.jsxs(De,{children:[e.jsx(Me,{children:s?"Edit Action":"Add Action"}),e.jsx(Te,{children:"Keep the activity, ownership, and maintenance schedule in one place."})]}),e.jsxs("form",{onSubmit:z,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"action-title",children:"Title"}),e.jsx(Q,{id:"action-title",value:n.title,onChange:c=>m({...n,title:c.target.value}),placeholder:"Enter an Action name",autoFocus:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"action-description",children:"Description"}),e.jsx(we,{id:"action-description",value:n.description,onChange:c=>m({...n,description:c.target.value}),placeholder:"What this action does and where it runs.",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"action-link",children:"Dashboard link"}),e.jsx(Q,{id:"action-link",type:"text",inputMode:"url",value:n.dashboard_link,onChange:c=>m({...n,dashboard_link:c.target.value}),placeholder:"https://â¦"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{children:"Assignees"}),e.jsxs(N,{type:"button",variant:"outline",className:"h-auto min-h-9 w-full justify-between py-2 font-normal",onClick:()=>k(c=>!c),children:[e.jsx("span",{className:"truncate text-left",children:n.assignees.length>0?n.assignees.map(c=>c.label).join(", "):"No assignees"}),e.jsx(Se,{className:q("h-4 w-4 shrink-0 transition-transform",u&&"rotate-180")}
1)]}),u?e.jsxs("div",{className:"max-h-40 overflow-y-auto rounded-md border p-1",children:[P?e.jsx("p",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"Loading assigneesâ¦"}):null,!P&&S.length===0?e.jsx("p",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No assignees available."}):null,S.map(c=>{const j=n.assignees.some(C=>C.id===c.id);return e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-xs hover:bg-muted",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:()=>A(c),className:"h-3.5 w-3.5 shrink-0 accent-primary","aria-label":`Assign ${c.label}`}),e.jsxs(be,{className:"h-5 w-5 border",children:[c.avatarUrl?e.jsx(ye,{src:c.avatarUrl,alt:""}):null,e.jsx(je,{className:"text-[9px]",children:c.initials})]}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:c.label})]},c.id)})]}):null]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"maintenance-mode",children:"Maintenance"}),e.jsxs(Pe,{value:n.maintenance_mode,onValueChange:c=>$(c),children:[e.jsx(qe,{id:"maintenance-mode",children:e.jsx(Be,{})}),e.jsxs(Re,{children:[e.jsx(H,{value:"none",children:"No maintenance"}),e.jsx(H,{value:"recurring",children:"Recurring"}),e.jsx(H,{value:"one_time",children:"One-time date"})]})]})]}),n.maintenance_mode==="recurring"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"maintenance-cadence",children:"Cadence"}),e.jsxs(Pe,{value:n.maintenance_cadence??"monthly",onValueChange:c=>m({...n,maintenance_cadence:c,maintenance_interval:c==="weekly"||c==="monthly"?n.maintenance_interval:1}),children:[e.jsx(qe,{id:"maintenance-cadence",children:e.jsx(Be,{})}),e.jsxs(Re,{children:[e.jsx(H,{value:"daily",children:"Daily"}),e.jsx(H,{value:"weekly",children:"Every X weeks"}),e.jsx(H,{value:"monthly",children:"Every X months"}),e.jsx(H,{value:"quarterly",children:"Quarterly"}),e.jsx(H,{value:"yearly",children:"Yearly"})]})]}),n.maintenance_cadence==="weekly"||n.maintenance_cadence==="monthly"?e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(R,{htmlFor:"maintenance-interval",className:"shrink-0 text-xs font-normal text-muted-foreground",children:"Repeat every"}),e.jsx(Q,{id:"maintenance-interval",type:"number",min:1,max:999,step:1,value:n.maintenance_interval,onChange:c=>m({...n,maintenance_interval:Number(c.target.value)}),className:"h-8 w-20"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n.maintenance_cadence==="weekly"?"weeks":"months"})]}):null]}):null,e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"last-maintenance",children:"Last maintenance"}),e.jsx(Q,{id:"last-maintenance",type:"date",value:n.last_maintenance_date??"",onChange:c=>m({...n,last_maintenance_date:c.target.value||null})})]}),n.maintenance_mode!=="none"?e.jsxs("div",{className:"space-y-2",children:[e.jsxs(R,{htmlFor:"next-maintenance",children:["Next maintenance",E?" (automatic)":""]}),e.jsx(Q,{id:"next-maintenance",type:"date",value:w??"",readOnly:!!E,onChange:c=>m({...n,next_maintenance_date:c.target.value||null}),className:E?"bg-muted/50":void 0})]}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"action-notes",children:"Notes"}),e.jsx(we,{id:"action-notes",value:n.notes,onChange:c=>m({...n,notes:c.target.value}),placeholder:"Private context, setup details, or reminders.",rows:4})]}),F?e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:F}):null,e.jsxs(Ee,{children:[e.jsx(N,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(N,{type:"submit",disabled:L,children:L?"Savingâ¦":s?"Save Changes":"Add Action"})]})]})]})})}function sa({open:t,onOpenChange:r,clientId:s,existingActions:p,onImport:d}){const[n,m]=h.useState(""),[u,k]=h.useState([]),[L,y]=h.useState(!1),[F,b]=h.useState(""),{data:U,isLoading:P,isError:S}=ie({queryKey:["workflow-board",s],queryFn:()=>St(s),enabled:t&&!!s}),E=h.useMemo(()=>new Set(p.map(x=>x.workflow_node_id).filter(Boolean)),[p]),w=h.useMemo(()=>Zt((U==null?void 0:U.flow_data.nodes)??[]),[U]),$=h.useMemo(()=>{const x=n.trim().toLowerCase();return x?w.filter(_=>[_.data.label,_.data.subtitle,_.data.note].some(v=>v==null?void 0:v.toLowerCase().includes(x))):w},[w,n]),A=h.useMemo(()=>$.filter(x=>!E.has(x.id)).map(x=>x.id),[E,$]),z=A.filter(x=>u.includes(x)).length,c=A.length>0&&z===A.length,j=z>0&&!c;h.useEffect(()=>{t&&(m(""),k([]),b(""))},[t]);const C=async()=>
1{if(u.length===0)return;const x=new Set(u),_=w.filter(v=>x.has(v.id));if(_.length!==u.length){b("Some selected actions are no longer available. Reopen the importer and try again.");return}y(!0),b("");try{await d(_),r(!1)}catch(v){console.error("Failed to import Workflow actions:",v),b("Could not import the selected actions. Please try again.")}finally{y(!1)}},B=()=>{k(x=>{const _=new Set(A);return c?x.filter(v=>!_.has(v)):Array.from(new Set([...x,...A]))})};return e.jsx(Ae,{open:t,onOpenChange:r,children:e.jsxs(Ce,{className:"max-h-[90vh] overflow-y-auto sm:max-w-xl",children:[e.jsxs(De,{children:[e.jsx(Me,{children:"Import from Workflow"}),e.jsx(Te,{children:"Select cards from the Marketing Actions column. Each import becomes an independent Action."})]}),e.jsxs("div",{className:"relative",children:[e.jsx(dt,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(Q,{value:n,onChange:x=>m(x.target.value),placeholder:"Search marketing actionsâ¦",className:"pl-9"})]}),e.jsxs("div",{className:"max-h-80 space-y-1 overflow-y-auto rounded-md border p-1",children:[P?e.jsx("p",{className:"p-4 text-center text-sm text-muted-foreground",children:"Loading Workflowâ¦"}):null,S?e.jsx("p",{className:"p-4 text-center text-sm text-destructive",children:"Could not load the Workflow."}):null,!P&&!S&&$.length>0?e.jsxs("label",{className:`flex items-center gap-3 rounded-sm border-b px-3 py-2.5 text-sm font-medium ${A.length>0?"cursor-pointer hover:bg-muted":"cursor-not-allowed opacity-50"}`,children:[e.jsx(_e,{checked:c?!0:j?"indeterminate":!1,disabled:A.length===0,onCheckedChange:B,"aria-label":c?"Clear visible selection":"Select all visible actions"}),e.jsx("span",{children:c?"Clear visible selection":n.trim()?`Select all results (${A.length})`:`Select all (${A.length})`})]}):null,!P&&!S&&$.length===0?e.jsx("p",{className:"p-4 text-center text-sm text-muted-foreground",children:w.length===0?"No cards are in the Marketing Actions column yet.":"No matching actions."}):null,$.map(x=>{const _=E.has(x.id),v=u.includes(x.id);return e.jsxs("label",{className:`flex items-start gap-3 rounded-sm p-3 ${_?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-muted"}`,children:[e.jsx(_e,{checked:v||_,disabled:_,onCheckedChange:()=>k(D=>v?D.filter(M=>M!==x.id):[...D,x.id]),"aria-label":`Import ${x.data.label}`}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-sm font-medium",children:x.data.label}),x.data.subtitle?e.jsx("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:x.data.subtitle}):null,_?e.jsx("span",{className:"mt-1 block text-[11px] font-medium text-primary",children:"Already imported"}):null]})]},x.id)})]}),F?e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:F}):null,e.jsxs(Ee,{children:[e.jsx(N,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(N,{onClick:C,disabled:u.length===0||L,children:L?"Importingâ¦":`Import${u.length?` (${u.length})`:""}`})]})]})})}const ke=[{value:"new",label:"New"},{value:"run",label:"Run"},{value:"pause",label:"Pause"},{value:"stop",label:"Stop"}],Ke=[{value:"all",label:"All"},...ke],G=t=>["marketing-actions",t],Ye={today:!1,inThreeDays:!1,inOneWeek:!0,inOneMonth:!0,moreThanOneMonth:!0};function Ta(){const{user:t}=Ze(),{selectedClient:r}=yt(),s=(r==null?void 0:r.id)??"",{isHelpCardVisible:p,hideHelpCard:d,showHelpCard:n}=jt(),m=ft(),[u,k]=h.useState("all"),[L,y]=h.useState(!1),[F,b]=h.useState(!1),[U,P]=h.useState(null),[S,E]=h.useState(null),[w,$]=h.useState({...Ye}),[A,z]=h.useState(()=>typeof window>"u"?!0:window.localStorage.getItem("actions-condensed-mode")!=="false");h.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("actions-condensed-mode",String(A))},[A]),h.useEffect(()=>{$({...Ye})},[u]);const{data:c=[],isLoading:j}=ie({queryKey:G(s),queryFn:()=>Wt(s),enabled:!!s}),{data:C=[]}=ie({queryKey:["action-assignees",t==null?void 0:t.id],queryFn:et,enabled:!!t,staleTime:5*60*1e3}),B=h.useMemo(()=>{var o,i,f,I,T;const a=C.map(O=>[O.id,{id:O.id,label:O.label,avatarUrl:O.avatarUrl,initials:O.initials,source:O.source}]);if(t){const O=String(((o=t.user_metadata)==null?void 0:o.nickname)||((i=t.user_metadata)==null?void 0:i.first_name)||((f=t.user_metadata)==null?void 0:f.full_name)||((I=t.email)==null?void 0:I.split("@")[0])||"You").trim();a.push([`self:${t.id}`,{id:`self:${t.id}`,label:O,avatarUrl:(T=t.user_metadata)==null?void 0:T.avatar_url,initials:O.split(/\s+/).slice(0,2).map(ne=>{var g;return(g=ne[0])==null?void 0:g.toUpperCase()}).join("")||"U",source:"self"}])}return new Map(a)},[C,t]),x=h.useMemo(()=>c.map(a=>({...a,assignees:a.assignees.map(o=>B.get(o.id)??o)})),[c,B]),_=h.useMemo(()=>Ne(u==="all"?x:x.filter(a=>a.status===u)),[u,x]),v=h.useMemo(()=>({all:c.length,...Object.fromEntries(ke.map(({value:a})=>[a,c.filter(o=>o.status===a).length]))}),[c]),D=h.useCallback(a=>{m.setQueryData(G(s),(o=[])=>o.map(i=>i.id===a.id?{...a,sub_actions:a.sub_actions??i.sub_actions??[]}:i))},[s,m]),M=h.useCallback((a,o)=>{m.setQueryData(G(s),(i=[])=>i.map(f=>f.id===a?{...f,sub_actions:o(f.sub_actions??[])}:f))},[s,m]),ce=async a=>{if(U){D(await re(U.id,a));return}const o=await zt(s,a,c.length);m.setQueryData(G(s),(i=[])=>[...i,o]),k("new")},X=async(a,o)=>
1{if(a.status!==o)try{D(await Ht(a.id,o))}catch(i){console.error("Failed to update action status:",i),V.error("Could not update the action status.")}},de=async a=>{const o=oe();try{D(await re(a.id,{last_maintenance_date:o,next_maintenance_date:a.maintenance_mode==="recurring"&&a.maintenance_cadence?Gt(a.next_maintenance_date??o,a.maintenance_cadence,a.maintenance_interval,o):null}))}catch(i){console.error("Failed to mark action maintained:",i),V.error("Could not update maintenance.")}},ee=async()=>{if(S)try{await Qt(S.id),m.setQueryData(G(s),(a=[])=>a.filter(o=>o.id!==S.id)),E(null)}catch(a){console.error("Failed to delete marketing action:",a),V.error("Could not delete this action.")}},me=async(a,o)=>{var i;try{const f=await Kt(a.id,o,((i=a.sub_actions)==null?void 0:i.length)??0);M(a.id,I=>[...I,f])}catch(f){throw console.error("Failed to create sub-action:",f),V.error("Could not add the sub-action."),f}},te=async(a,o)=>{try{const i=await ze(o.id,{is_completed:!o.is_completed});M(a.id,f=>f.map(I=>I.id===i.id?i:I))}catch(i){console.error("Failed to update sub-action:",i),V.error("Could not update the sub-action.")}},ue=async(a,o,i)=>{try{const f=await ze(o.id,{title:i});M(a.id,I=>I.map(T=>T.id===f.id?f:T))}catch(f){throw console.error("Failed to edit sub-action:",f),V.error("Could not edit the sub-action."),f}},he=async(a,o)=>{try{await Yt(o.id),M(a.id,i=>i.filter(f=>f.id!==o.id))}catch(i){console.error("Failed to delete sub-action:",i),V.error("Could not delete the sub-action.")}},xe=async(a,o)=>{try{D(await re(a.id,{notes:o}))}catch(i){throw console.error("Failed to update action note:",i),V.error("Could not save the action note."),i}},ae=async a=>{const o=await Vt(s,a.map((i,f)=>({input:{title:i.data.label,description:i.data.subtitle??"",dashboard_link:"",notes:i.data.note??"",status:"new",maintenance_mode:"none",maintenance_cadence:null,maintenance_interval:1,last_maintenance_date:null,next_maintenance_date:null,assignees:[],workflow_node_id:i.id,workflow_card_id:i.data.cardId},sortOrder:c.length+f})));if(o.length!==a.length)throw new Error(`Expected to import ${a.length} Actions, but imported ${o.length}.`);m.setQueryData(G(s),(i=[])=>[...i,...o.map(f=>({...f,sub_actions:[]}))]),k("new")},pe=()=>{var ne;if(x.length===0)return;const a=g=>{var K;return((K=ke.find(tt=>tt.value===g))==null?void 0:K.label)??g},o=g=>g.maintenance_mode==="none"?"None":g.maintenance_mode==="one_time"?"One-time":g.maintenance_cadence?g.maintenance_cadence==="weekly"?`Every ${g.maintenance_interval} week${g.maintenance_interval===1?"":"s"}`:g.maintenance_cadence==="monthly"?`Every ${g.maintenance_interval} month${g.maintenance_interval===1?"":"s"}`:g.maintenance_cadence.charAt(0).toUpperCase()+g.maintenance_cadence.slice(1):"Recurring",i=[`# ${(r==null?void 0:r.name)??"Brand"} Actions`,""];for(const g of x){if(i.push(`## ${g.title}`,"",`- Status: ${a(g.status)}`),g.dashboard_link&&i.push(`- Dashboard: ${g.dashboard_link}`),g.assignees.length>0&&i.push(`- Assignees: ${g.assignees.map(K=>K.label).join(", ")}`),i.push(`- Maintenance: ${o(g)}`),g.last_maintenance_date&&i.push(`- Last maintenance: ${g.last_maintenance_date}`),g.next_maintenance_date&&i.push(`- Next maintenance: ${g.next_maintenance_date}`),g.description&&i.push("",g.description),(ne=g.sub_actions)!=null&&ne.length){i.push("","### Sub-actions","");for(const K of g.sub_actions)i.push(`- ${K.is_completed?"Running":"Not running"}: ${K.title}`)}g.notes&&i.push("","### Note","",g.notes),i.push("")}const f=new Blob([i.join(` 2`)],{type:"text/markdown;charset=utf-8"}),I=URL.createObjectURL(f),T=document.createElement("a"),O=((r==null?void 0:r.name)??"brand").trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"brand";T.href=I,T.download=`${O}-actions.md`,document.body.appendChild(T),T.click(),T.remove(),URL.revokeObjectURL(I)},J=a=>e.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:a.map(o=>e.jsx(ta,{action:o,onEdit:()=>{P(o),y(!0)},onDelete:()=>E(o),onStatusChange:i=>void X(o,i),onMarkMaintained:()=>void de(o),onAddSubAction:i=>me(o,i),onToggleSubAction:i=>
2void te(o,i),onUpdateSubAction:(i,f)=>ue(o,i,f),onDeleteSubAction:i=>void he(o,i),onUpdateNotes:i=>xe(o,i),condensed:A},o.id))}),l=a=>{const o=Jt(a),i=(f,I,T)=>I.length>0?e.jsxs("section",{className:"space-y-3",children:[e.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-1 py-1 text-left transition-colors hover:bg-muted/30",onClick:()=>$(O=>({...O,[T]:!O[T]})),"aria-expanded":!w[T],"aria-label":`${w[T]?"Expand":"Collapse"} ${f}`,children:[e.jsx("h2",{className:"font-nunito text-lg font-semibold text-foreground",children:f}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[I.length," ",I.length===1?"Action":"Actions"]}),e.jsx("span",{className:"ml-auto flex h-8 w-8 items-center justify-center text-muted-foreground",children:w[T]?e.jsx(Ge,{className:"h-4 w-4"}):e.jsx(Se,{className:"h-4 w-4"})})]}),w[T]?null:J(I)]}):null;return e.jsxs("div",{className:"space-y-6",children:[o.unscheduled.length>0?J(o.unscheduled):null,i("Today",o.today,"today"),i("In 3 days",o.inThreeDays,"inThreeDays"),i("In a week",o.inOneWeek,"inOneWeek"),i("In a month",o.inOneMonth,"inOneMonth"),i("More than a month",o.moreThanOneMonth,"moreThanOneMonth")]})};return e.jsxs("div",{className:"space-y-6 max-w-6xl mx-auto",children:[e.jsx(vt,{icon:mt,title:"Actions",titleSuffix:p?void 0:e.jsx(N,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8 text-muted-foreground sm:hidden","aria-label":"Show Actions help",children:e.jsx($e,{className:"h-4 w-4"})}),description:"See what is running, who owns it, and what needs maintenance.",actions:e.jsxs(e.Fragment,{children:[p?null:e.jsx(N,{variant:"ghost",size:"icon",onClick:n,className:"hidden h-8 w-8 text-muted-foreground sm:inline-flex","aria-label":"Show Actions help",children:e.jsx($e,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex h-8 items-center gap-2 rounded-md border border-border bg-background px-2",children:[e.jsx(R,{htmlFor:"actions-condensed-mode",className:"cursor-pointer whitespace-nowrap font-nunito text-xs font-normal text-muted-foreground",children:"Condensed"}),e.jsx(Ft,{id:"actions-condensed-mode",checked:A,onCheckedChange:z,"aria-label":"Toggle condensed Actions view",className:"h-5 w-9 [&>span]:h-4 [&>span]:w-4 [&>span]:data-[state=checked]:translate-x-4"})]}),e.jsxs(qt,{children:[e.jsx(Bt,{asChild:!0,children:e.jsx(N,{variant:"outline",size:"icon",className:"h-8 w-8","aria-label":"Import or export Actions",children:e.jsx(ut,{className:"h-4 w-4"})})}),e.jsxs(Rt,{align:"end",children:[e.jsxs(We,{onSelect:a=>{a.preventDefault(),b(!0)},children:[e.jsx(ht,{className:"mr-2 h-4 w-4"}),"Import from Workflow"]}),e.jsxs(We,{onSelect:pe,disabled:x.length===0,children:[e.jsx(xt,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),e.jsx(N,{size:"sm",className:"h-8 btn-gradient font-nunito",onClick:()=>{P(null),y(!0)},children:"+ New Action"})]})}),p?e.jsx(Nt,{onClose:d,children:"Track ongoing marketing activities independently from Workflow. Use statuses to show what is new, running, paused, or stopped; assign people for visibility; and mark due maintenance complete to schedule the next recurring date."}):null,j?e.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:Array.from({length:3}).map((a,o)=>e.jsx(bt,{className:"h-64 rounded-xl"},o))}):e.jsxs(Ot,{value:u,onValueChange:a=>k(a),children:[e.jsx(Ut,{className:"grid h-auto w-full grid-cols-3 sm:grid-cols-5",children:Ke.map(({value:a,label:o})=>e.jsxs(Lt,{value:a,className:"gap-1 px-2 text-xs sm:text-sm",children:[o,e.jsxs("span",{children:["(",v[a],")"]})]},a))}),Ke.map(({value:a,label:o})=>e.jsx(Pt,{value:a,className:"mt-4",children:_.length>0?l(_):e.jsx(Xe,{className:"border-dashed shadow-none",children:e.jsxs(Je,{className:"py-12 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:a==="all"?"No actions":`No ${o.toLowerCase()} actions`}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Create an Action or import one from Workflow."})]})})},a))]}),e.jsx(na,{open:L,onOpenChange:y,action:U,onSubmit:ce}),e.jsx(sa,{open:F,onOpenChange:b,clientId:s,existingActions:c,onImport:ae}),e.jsx(At,{open:!!S,onOpenChange:a=>{a||E(null)},children:e.jsxs(Ct,{className:"max-h-[90vh] overflow-y-auto",children:[e.jsxs(Dt,{children:[e.jsx(Mt,{children:"Delete this Action?"}),e.jsxs(Tt,{children:["This permanently deletes â",S==null?void 0:S.title,"â. Its Workflow source is not affected."]})]}),e.jsxs(Et,{children:[e.jsx(It,{children:"Cancel"}),e.jsx($t,{onClick:()=>void ee(),children:"Delete Action"})]})]})})]})}export{Ta as default};
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.