1import{e as N,g as I,j as e,L as R}from"./index-Coffe9l2.js";import{d as x,u as k,B as h,e as _,T as j,f as w,g as T,h as v,S as y,i as g,M as D}from"./main-layout-Dbki62dp.js";import{L as A,D as B,u as L,E as P,I as M,F as U,a as V,b as q,c as E}from"./fixed-floating-bar-DWK_WvrH.js";import{r as p,R as z}from"./sentry-mRMuYElZ.js";import{u as Q,a as $,C as b}from"./comfirm-button-BcK6ZWyN.js";import{i as f,I as H,a as C,b as S}from"./instagram-follow-button-CS1imwun.js";import{u as G,C as K}from"./common-list-queue-controls-CgVEy7VM.js";import{B as d}from"./badge-BwvzfThI.js";import{T as O}from"./trash-2-BnTY2R8S.js";import"./mixpanel-V3zn34re.js";import"./dayjs-B2iisHW2.js";import"./chevrons-up-down-B4Gt6hIx.js";import"./index-BEWrzVOL.js";import"./popover-DVT0ujvD.js";import"./user-plus-DcCuQujk.js";function J(){const a=N(x(r=>r.instagramAuthUser)),o=a?.id||"",l=I(x(r=>r.records[o]?.list)),t=r=>(l?.data.reverse()||[]).some(i=>i.id===r.id);return G({id:a?.id||"",storeName:"instagram-followers.store",queueFn:async({cursor:r})=>{const i=await f.getFollowersList({cursor:r}),n=i.data.map(c=>c.id),s=await f.getFriendshipsStatuses({userIds:n}),m=i.data.map(c=>({...c,...s.friendship_statuses[c.id]})).filter(c=>!t(c));return{...i,data:m}}})}function W(){const a=N(x(t=>t.instagramAuthUser)),o=I();return{...Q(async t=>{await f.removeFollower({userId:t.id}),o.removeItems(a.id,r=>r.id===t.id)})}}const F=({users:a,disabled:o})=>{const{t:l}=k(),t=W(),r=p.useMemo(()=>{let n=`${a.slice(0,3).map(s=>s.full_name).join(", ")}`;return a.length>3&&(n+=`... and ${a.length-3} others`),n},[a]);return t.state.isProcessing?e.jsxs("div",{className:"flex flex-row items-center justify-center gap-1",children:[e.jsxs("div",{className:"relative w-fit",children:[e.jsx(A,{className:"animate-spin",size:42}),e.jsxs("span",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-xs",children:[t.state.settledCount,"/",t.state.totalCount]})]}),e.jsx("span",{children:l("insta:removeFollowers")}),t.state.totalCount>1&&e.jsx(h,{variant:"outline",onClick:()=>t.stop(),children:l("common:cancel")})]}):e.jsx($,{id:"instagram-remove-followers-confirmation",tooltip:l("insta:removeFollowers"),title:l("insta:confirmRemoveFollowers",{name:r}),description:l("insta:confirmRemoveFollowersDescription",{name:r}),disabled:o,onConfirm:()=>t.processItems(a),children:e.jsx(O,{className:"text-destructive"})})};function X(){const{t:a}=k(),[o,l]=p.useState({}),t=J(),r=z.useMemo(()=>[{id:"select",meta:{headClassName:"w-[40px]"},header:({table:s})=>e.jsx(b,{checked:s.getIsAllPageRowsSelected()||s.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:m=>s.toggleAllPageRowsSelected(!!m),"aria-label":"Select all"}),cell:({row:s})=>e.jsx(b,{checked:s.getIsSelected(),onCheckedChange:m=>s.toggleSelected(!!m),"aria-label":"Select row"}),enableSorting:!1,enableHiding:!1},{accessorKey:"full_name",meta:{headClassName:"w-[300px]"},header:({column:s})=>e.jsx(B,{column:s,title:a("common:name")}),cell:({row:s})=>e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx(_,{url:s.original.profile_pic_url,alt:s.original.username}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{children:s.original.full_name}),e.jsx("span",{children:s.original.username})]})]})},{id:"statuses",header:()=>e.jsx(H,{className:"-ml-3 h-8",onValuesChange:s=>{i.resetPageIndex(),i.getColumn("statuses")?.setFilterValue(s)}}),cell:({row:s})=>e.jsxs("div",{className:" flex flex-row flex-wrap gap-1",children:[s.original.is_verified&&e.jsx(d,{className:"bg-blue-500 text-white dark:bg-blue-600",children:a("insta:friendshipStatuses.verified")}),s.original.is_private&&e.jsx(d,{className:"bg-gray-500 text-white dark:bg-gray-600",children:a("insta:friendshipStatuses.private")}),s.original.is_restricted&&e.jsx(d,{className:"bg-red-500 text-white dark:bg-red-600",children:a("insta:friendshipStatuses.restricted")}),s.original.is_bestie&&e.jsx(d,{className:"bg-pink-500 text-white dark:bg-pink-600",children:a("insta:friendshipStatuses.bestie")}),s.original.is_favorite&&e.jsx(d,{className:"bg-pink-400 text-white dark:bg-pink-500",children:a("insta:friendshipStatuses.favorite")})]}),filterFn:(s,m,c)=>Object.entries(c).filter(u=>u[1]!==void 0).every(u=>s.original[u[0]]===u[1])},{id:"actions",enableSorting:!1,enableResizing:!1,meta:{headClassName:"w-[160px]"},cell:({row:s})=>e.jsxs("div",{className:"flex flex-row justify-end gap-1 ml-auto",children:[e.jsxs(j,{children:[e.jsx(w,{asChild:!0,children:e.jsx(h,{variant:"ghost",asChild:!0,children:e.jsx(R,{to:"/features/instagram-lookup-export",search:{username:s.original.username},children:e.jsx(T,{})})})}),e.jsx(v,{children:a("common:lookupAndexport")})]}),e.jsxs(j,{children:[e.jsx(w,{asChild:!0,children:e.jsx(h,{variant:"ghost",asChild:!0,children:e.jsx("a",{href:`https://www.instagram.com/${s.original.username}`,target:"_blank",children:e.jsx(y,{color:"#FF0069",className:"size-4"})})})}),e.jsxs(v,{children:[a("common:view")," Instagram"]})]}),s.original.following?e.jsx(C,{users:[s.original]}):e.jsx(S,{users:[s.original]}),e.jsx(F,{users:[s.original]})]})}],[a]),i=L({columns:r,data:t.list.data,getRowId:s=>s.id,onRowSelectionChange:l,state:{rowSelection:o}}),n=p.useMemo(()=>t.list.data.filter(s=>o[s.id]),[t.list.data,o]);return e.jsxs("div",{className:"flex flex-col gap-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(K,{queue:t}),e.jsx(P,{data:t.list.data}),e.jsx(M,{placeholder:"Search...",defaultValue:i.getColumn("full_name")?.getFilterValue()??"",onChange:s=>{i.resetPageIndex(),i.getColumn("full_name")?.setFilterValue(s.target.value)},className:"max-w-xs ml-auto"})]}),e.jsxs(U,{open:!!i.getFilteredSelectedRowModel().rows.length,children:[e.jsx(V,{table:i}),e.jsx(g,{orientation:"vertical",className:"data-[orientation=vertical]:h-4"}),e.jsx(S,{users:n,disabled:n.some(s=>s.following)}),e.jsx(g,{orientation:"vertical",className:"data-[orientation=vertical]:h-4"}),e.jsx(C,{users:n,disabled:n.some(s=>!s.following)}),e.jsx(g,{orientation:"vertical",className:"data-[orientation=vertical]:h-4"}),e.jsx(F,{users:n})]}),e.jsx("div",{className:"rounded-md border",children:e.jsx(q,{table:i})}),e.jsx(E,{table:i})]})}function ge(){return e.jsx(D,{children:e.jsx(X,{})})}
1export{ge as component};
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.