1import{r as p,j as e}from"./vendor-ui-WeVI9Gyg.js";import{C as re}from"./CopyButton-BYHmQ6HY.js";import{C as le}from"./ConfirmDialog-BKZNsIgJ.js";import{c as ie,M as $,a as v,o as de,d1 as ee,B as m,Y as oe,a8 as ce,P as Q,aa as me,V as L,X as he}from"./index-DJ0sXiMx.js";import{C as S,b as Y,c as X,a as C}from"./card-C0eBQS6c.js";import{T as xe,a as ue,b as R,c as F}from"./tabs-CIz5CpBT.js";import{T as se,a as ae,b as T,c as f,d as te,e as j}from"./table-BY_M1FBY.js";import{b as D}from"./dateFormat-Y5uSd2WB.js";import{E as pe}from"./external-link-h-zu6cNV.js";import{D as J}from"./download-CNe80J5w.js";import{S as fe}from"./shield-alert-DnJ0n44p.js";import{K as je}from"./key-round-B24Lqpm2.js";import{R as ge}from"./rotate-cw-B6jgg_g2.js";import{T as be}from"./trash-2-0gS71b7X.js";import{T as ve}from"./trophy-CDPwIHSY.js";import{A as ke}from"./AdminPageShell-C0xWdz94.js";import"./vendor-utils-CDwmdUHh.js";import"./circle-alert-C4HH6aaN.js";import"./copy-Ck3sknV7.js";import"./alert-dialog-D-bUNv4j.js";import"./vendor-react-wqaWWKH3.js";import"./vendor-content-CGTVgW2_.js";import"./numberFormat-Cd0t8V0M.js";import"./useIsSmalkStaff-CzYgodII.js";import"./empty-DX6rXZ4v.js";import"./shield-off-CVwJSjDz.js";function ye(){return ie({queryKey:ee.all,queryFn:async()=>(await v.get("/smalk-scraper/admin/")).data})}async function Ne(t){return(await v.get(t,{responseType:"blob"})).data}function I(){const t=de();return()=>t.invalidateQueries({queryKey:ee.all})}function we(t){const r=I();return $({mutationFn:async i=>{const{data:o}=await v.post("/smalk-scraper/admin/installations/",{display_name:i});t(o)},onSuccess:r})}function _e(t){const r=I();return $({mutationFn:async i=>{const{data:o}=await v.post(`/smalk-scraper/admin/installations/${i}/rotate/`);t(o)},onSuccess:r})}function Se(t){const r=I();return $({mutationFn:async i=>{const{data:o}=await v.post(`/smalk-scraper/admin/installations/${i}/delete/`);t(o)},onSuccess:r})}function Ce(){const t=I();return $({mutationFn:async r=>{await v.post(`/smalk-scraper/admin/installations/${r}/revoke/`)},onSuccess:t})}const Te=Intl.DateTimeFormat().resolvedOptions().timeZone;function $e(t){return t==="pending_configuration"?"Awaiting configuration":t==="revoked"?"Revoked":"Active"}const Ie={no_submission:"never submitted",session_expired:"signed out",incomplete_stream:"stream cut",empty_answer:"empty answer",payload_mismatch:"payload mismatch",capture_error:"capture error"};function Ae(t){var o;if(t.forecast==="closed")return"Nothing waiting â today is closed.";const r=`${t.pending} waiting, ${((o=t.hours_left)==null?void 0:o.toFixed(1))??"?"} h left`;if(t.forecast==="unreadable")return`${r}. Nothing closed in the last hour, so the finish time cannot be read.`;const i=`${t.done_per_hour}/h`;return t.forecast==="on_track"?`${r} at ${i}. On track.`:`${r} at ${i}. NOT on track â open another browser.`}function Pe({fleet:t}){var w,N;const[r,i]=p.useState("24h"),[o,b]=p.useState(0),{jobs_today:l}=t,k=Object.entries(t.failures_24h),x=[...t.leaderboard].sort((s,d)=>r==="24h"?d.scraps_24h-s.scraps_24h||d.scraps_total-s.scraps_total||s.display_name.localeCompare(d.display_name):d.scraps_total-s.scraps_total||d.scraps_24h-s.scraps_24h||s.display_name.localeCompare(d.display_name)),h=5,g=Math.min(o,Math.max(0,Math.ceil(x.length/h)-1)),a=g*h,u=l.total?Math.min(100,l.done/l.total*100):0,y=Math.max(1,...t.hourly_activity.flatMap(s=>[s.sent,s.answered]));return e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"xl:col-span-2",children:e.jsxs(C,{className:"gap-4 py-5",children:[e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(18rem,0.8fr)]",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold",children:"Today's prompts"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Created today · UTC"})]}),e.jsxs("p",{className:"text-2xl font-semibold tabular-nums","aria-label":`${l.done} of ${l.total} prompts answered`,children:[l.done,e.jsxs("span",{className:"text-base font-normal text-muted-foreground",children:[" / ",l.total," answered"]})]})]}),e.jsx("div",{role:"progressbar","aria-label":"Prompts answered today","aria-valuemin":0,"aria-valuemax":l.total||1,"aria-valuenow":l.done,className:"h-2 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full rounded-full bg-emerald-500",style:{width:`${u}%`}})}),e.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1 text-sm tabular-nums",children:[e.jsxs("span",{children:[e.jsx("strong",{children:l.sent})," sent"]}),e.jsxs("span",{children:[e.jsx("strong",{children:l.in_progress})," in progress"]}),e.jsxs("span",{children:[e.jsx("strong",{children:l.to_send})," to send"]}),e.jsxs("span",{children:[e.jsx("strong",{children:l.expired})," expired"]})]}),e.jsx("p",{className:`text-xs ${l.forecast==="behind"?"font-medium text-destructive":"text-muted-foreground"}`,children:Ae(l)})]}),e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[e.jsxs("h3",{className:"font-medium",children:["Hourly activity ",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["· UTC day, ",Te," time"]})]}),e.jsxs("span",{className:"text-muted-foreground",children:[e.jsx("span",{className:"text-sky-500",children:"â"})," Sent ",e.jsx("span",{className:"ml-2 text-emerald-500",children:"â"})," Answered"]})]}),e.jsx("div",{className:"flex h-16 items-end gap-1 border-b border-border","aria-label":"Prompts sent and answered by hour",children:t.hourly_activity.map(s=>e.jsxs("div",{className:"flex h-full min-w-0 flex-1 items-end justify-center gap-px",title:`${D(s.start)}: ${s.sent}
1 sent, ${s.answered} answered`,children:[e.jsx("div",{className:"w-1/2 max-w-2 rounded-t-sm bg-sky-500",style:{height:`${s.sent/y*100}%`}}),e.jsx("div",{className:"w-1/2 max-w-2 rounded-t-sm bg-emerald-500",style:{height:`${s.answered/y*100}%`}})]},s.start))}),e.jsxs("div",{className:"flex justify-between text-[10px] tabular-nums text-muted-foreground",children:[e.jsx("span",{children:D((w=t.hourly_activity[0])==null?void 0:w.start)}),e.jsx("span",{children:D((N=t.hourly_activity.at(-1))==null?void 0:N.start)})]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-border pt-3 text-xs",children:[e.jsxs("span",{className:"font-medium tabular-nums",children:[t.workers_connected," / ",t.workers_total," workers connected ",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["· last ",t.connected_within_minutes," min"]})]}),k.length>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-muted-foreground",children:"Failures 24 h"}),k.map(([s,d])=>e.jsxs(L,{variant:"outline",className:"tabular-nums",children:[Ie[s]," ",d]},s))]})]})]})}),e.jsx(S,{children:e.jsxs(C,{className:"gap-4 py-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ve,{className:"h-4 w-4 text-amber-500"})," Scraper leaderboard"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connected, new or productive in the last 24 h"})]}),e.jsxs("div",{className:"flex gap-1","aria-label":"Rank workers by period",children:[e.jsx(m,{size:"sm",variant:r==="24h"?"default":"outline","aria-pressed":r==="24h",onClick:()=>{i("24h"),b(0)},children:"24 h"}),e.jsx(m,{size:"sm",variant:r==="all"?"default":"outline","aria-pressed":r==="all",onClick:()=>{i("all"),b(0)},children:"All time"})]})]}),x.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No recent active browser worker."}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:e.jsxs(se,{children:[e.jsx(ae,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Worker"}),e.jsx(f,{className:"text-right",children:"Scraps"}),e.jsx(f,{className:"text-right",children:"Ads"})]})}),e.jsx(te,{children:x.slice(a,a+h).map((s,d)=>e.jsxs(T,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold tabular-nums ${a+d===0?"bg-amber-500/15 text-amber-700 dark:text-amber-300":a+d===1?"bg-slate-400/15 text-slate-600 dark:text-slate-300":a+d===2?"bg-orange-500/15 text-orange-700 dark:text-orange-300":"bg-muted text-muted-foreground"}`,children:a+d+1}),e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${s.connected?"bg-emerald-500":"bg-muted-foreground/40"}`,"aria-label":s.connected?"Connected":"Not polling"}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.display_name}),e.jsx("span",{className:"block font-mono text-xs text-muted-foreground",children:s.extension_version?`v${s.extension_version}`:"Version unknown"})]}),s.paused&&e.jsx(L,{className:"bg-amber-100 text-amber-800 border-transparent dark:bg-amber-900/30 dark:text-amber-300",children:"paused"})]})}),e.jsxs(j,{className:"text-right tabular-nums",children:[e.jsx("span",{className:"block text-lg font-semibold",children:r==="24h"?s.scraps_24h:s.scraps_total}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:r==="24h"?`${s.scraps_total} total`:`${s.scraps_24h} in 24 h`})]}),e.jsxs(j,{className:"text-right tabular-nums",children:[e.jsx("span",{className:"block text-lg font-semibold",children:r==="24h"?s.ads_24h:s.ads_total}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:r==="24h"?`${s.ads_total} total`:`${s.ads_24h} in 24 h`})]})]},s.worker_id))})]})}),x.length>h&&e.jsxs("div",{className:"flex items-center justify-end gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[a+1,"â",Math.min(a+h,x.length)," of ",x.length]}),e.jsx(m,{size:"sm",variant:"outline",disabled:g===0,onClick:()=>b(g-1),children:"Previous"}),e.jsx(m,{size:"sm",variant:"outline",disabled:a+h>=x.length,onClick:()=>b(g+1),children:"Next"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Scraps have text, citations and sources. Ads include incomplete captures. The 24 h figures use the attempt time."})]})})]})}function Re(t){return t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t)):"â"}function Fe(){var z,U,K,W,H,V,q,G;const[t,r]=p.useState(""),[i,o]=p.useState(null),[b,l]=p.useState(!1),[k,x]=p.useState(!1),[h,g]=p.useState(!1),[a,u]=p.useState(null),[y,w]=p.useState(null),N=(n,_)=>{o({value:n,workerId:_}),l(!1)},s=ye(),d=we(n=>{N(n.api_key,n.installation.id),r("")}),B=_e(n=>{N(n.api_key,n.installation.id),u(null)}),E=Ce(),A=Se(n=>{w(n.outcome==="deleted"?"Installation deleted.":`Installation archived: it is off this list, and its ${n.measurements_kept} measurement(s) are kept.`),u(null)}),M=B.isPending||E.isPending||A.isPending,c=(z=s.data)==null?void 0:z.store_url,O=async()=>{var _;const n=(_=s.data)==null?void 0:_.build;
1if(!(!(n!=null&&n.download_url)||!n.version)){g(!0),x(!1);try{const ne=await Ne(n.download_url),Z=URL.createObjectURL(ne),P=document.createElement("a");P.href=Z,P.download=`smalk-scraper-v${n.version}.zip`,P.click(),URL.revokeObjectURL(Z)}catch{x(!0)}finally{g(!1)}}};return e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(20rem,1fr)]",children:[((U=s.data)==null?void 0:U.fleet)&&e.jsx(Pe,{fleet:s.data.fleet}),e.jsx("div",{className:"space-y-6",children:e.jsxs(S,{children:[e.jsx(Y,{children:e.jsx(X,{children:c?"Install smalk-scraper":"Download and install"})}),e.jsxs(C,{className:"gap-4 text-sm",children:[c&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-muted-foreground",children:"Install once from the private Chrome Web Store listing with a Google account approved by Smalk. Chrome and Brave then install published updates automatically in this browser profile."}),e.jsx(m,{asChild:!0,className:"self-start",children:e.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(pe,{"aria-hidden":!0}),"Open Chrome Web Store"]})})]}),!c&&((K=s.data)==null?void 0:K.build_error)&&e.jsxs("p",{className:"flex gap-2 text-destructive",children:[e.jsx(oe,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),s.data.build_error]}),!c&&s.data&&!s.data.build_error&&!s.data.build.version&&e.jsx("p",{className:"text-muted-foreground",children:"No extension build is available yet."}),!c&&((W=s.data)==null?void 0:W.build.download_url)&&e.jsxs(m,{className:"self-start",disabled:h,onClick:()=>void O(),children:[e.jsx(J,{"aria-hidden":!0}),h?"Verifyingâ¦":`Download v${s.data.build.version}`]}),!c&&k&&e.jsx("p",{className:"text-sm text-destructive",children:"The verified extension could not be downloaded."}),!c&&((H=s.data)==null?void 0:H.build.sha256)&&e.jsxs("p",{className:"break-all font-mono text-xs text-muted-foreground",children:["SHA-256: ",s.data.build.sha256]}),e.jsxs(xe,{defaultValue:"install",className:"gap-4",children:[e.jsxs(ue,{"aria-label":"Extension setup instructions",children:[e.jsx(R,{value:"install",children:"Install"}),e.jsx(R,{value:"update",children:"Update"}),c&&e.jsx(R,{value:"manual",children:"Manual ZIP"})]}),e.jsx(F,{value:"install",children:e.jsxs("ol",{className:"ml-5 list-decimal space-y-2 text-muted-foreground",children:[e.jsx("li",{children:"Create a dedicated Chrome or Brave profile and sign in to the company ChatGPT Free account."}),c?e.jsx("li",{children:"Sign in to the Chrome Web Store with an approved Google account, then open the link above and add the extension to this profile."}):e.jsxs(e.Fragment,{children:[e.jsx("li",{children:"Download and unzip the extension into a permanent folder."}),e.jsxs("li",{children:["Open ",e.jsx("code",{children:"chrome://extensions"})," or ",e.jsx("code",{children:"brave://extensions"}),", enable Developer mode, then choose ",e.jsx("strong",{children:"Load unpacked"}),"."]})]}),e.jsx("li",{children:"Open the extension Options, paste the one-time API key, then save."}),e.jsx("li",{children:"Keep the browser profile open. The worker polls Smalk every minute."})]})}),e.jsx(F,{value:"update",className:"space-y-3",children:c?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-muted-foreground",children:"Chrome and Brave update the Web Store installation automatically after each version is published and approved. Your API key and settings stay in the same profile."}),e.jsxs("p",{className:"text-muted-foreground",children:["To check the installed version or request an immediate check, open ",e.jsx("code",{children:"chrome://extensions"})," or ",e.jsx("code",{children:"brave://extensions"})," and use ",e.jsx("strong",{children:"Update"})," with Developer mode enabled."]}),e.jsx("p",{className:"rounded-md border border-border bg-muted p-3 text-muted-foreground",children:"An older âLoad unpackedâ installation cannot switch to store updates in place. Pause it, install the store version, configure it with a new or rotated API key, then remove the old copy."})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-muted-foreground",children:"Update each browser in
1its existing dedicated profile. Your API key and settings are kept when you reload the same installation."}),e.jsxs("ol",{className:"ml-5 list-decimal space-y-2 text-muted-foreground",children:[e.jsxs("li",{children:["In the extension panel, click ",e.jsx("strong",{children:"Pause worker"})," and wait for the current prompt to finish before replacing any files."]}),e.jsxs("li",{children:["Download the ZIP above and unzip it. Replace the files in the ",e.jsx("strong",{children:"same permanent folder"})," you originally loaded, keeping ",e.jsx("code",{children:"manifest.json"})," directly inside it, not in a nested folder."]}),e.jsxs("li",{children:["Open ",e.jsx("code",{children:"chrome://extensions"})," or ",e.jsx("code",{children:"brave://extensions"}),". With Developer mode enabled, click the ",e.jsx("strong",{children:"Reload"})," icon on the ",e.jsx("strong",{children:"smalk-scraper"})," card."]}),e.jsx("li",{children:"Reopen the extension panel. Check the version matches the download above and that ChatGPT and Smalk are connected."}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Resume worker"})," and keep the browser profile open."]})]}),e.jsx("p",{className:"rounded-md border border-border bg-muted p-3 text-muted-foreground",children:"Keep the existing extension installed. You do not need to create a new installation or generate a new API key."})]})}),c&&e.jsxs(F,{value:"manual",className:"space-y-3",children:[e.jsx("p",{className:"text-muted-foreground",children:"For development or a temporary fallback only. An unpacked extension will not update itself."}),e.jsxs("p",{className:"text-muted-foreground",children:["Download the ZIP, extract it into a permanent folder, then choose ",e.jsx("strong",{children:"Load unpacked"})," in ",e.jsx("code",{children:"chrome://extensions"})," or ",e.jsx("code",{children:"brave://extensions"}),". To update it later, replace files in that folder and click ",e.jsx("strong",{children:"Reload"}),"."]}),((V=s.data)==null?void 0:V.build_error)&&e.jsx("p",{className:"text-destructive",children:s.data.build_error}),((q=s.data)==null?void 0:q.build.download_url)&&e.jsxs(m,{disabled:h,onClick:()=>void O(),children:[e.jsx(J,{"aria-hidden":!0}),h?"Verifyingâ¦":`Download v${s.data.build.version}`]}),k&&e.jsx("p",{className:"text-destructive",children:"The verified extension could not be downloaded."}),((G=s.data)==null?void 0:G.build.sha256)&&e.jsxs("p",{className:"break-all font-mono text-xs text-muted-foreground",children:["SHA-256: ",s.data.build.sha256]})]})]}),e.jsxs("p",{className:"flex gap-2 rounded-md border border-border bg-muted p-3 text-muted-foreground",children:[e.jsx(fe,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),"Chromium shows a debugger permission banner while the extension drives its own ChatGPT work tab. This permission is expected for this internal worker."]})]})]})}),e.jsx("div",{className:"space-y-6 xl:col-span-2",children:e.jsxs(S,{children:[e.jsx(Y,{children:e.jsx(X,{children:"Browser installations"})}),e.jsxs(C,{className:"gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(ce,{htmlFor:"scraper-installation-name",children:"Installation name"}),e.jsx(Q,{id:"scraper-installation-name",value:t,onChange:n=>r(n.target.value),placeholder:"Antoine â Brave office",maxLength:120})]}),e.jsxs(m,{disabled:!t.trim()||d.isPending,onClick:()=>d.mutate(t.trim()),children:[e.jsx(me,{"aria-hidden":!0}),d.isPending?"Creatingâ¦":"Create installation"]})]}),d.isError&&e.jsx("p",{className:"text-sm text-destructive",children:"The installation could not be created."}),i&&e.jsxs("div",{className:"space-y-3 rounded-lg border border-amber-500/40 bg-amber-500/10 p-4",children:[e.jsxs("div",{className:"flex gap-2 text-sm text-foreground",children:[e.jsx(je,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),e.jsx("strong",{children:"Save this API key now. It will not be shown again."})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(Q,{"aria-label":"New Smalk Scraper API key",readOnly:!0,value:i.value,onFocus:n=>n.currentTarget.select(),className:"font-mono"}),e.jsx(re,{value:i.value,onCopyFailed:()=>l(!0),onCopySucceeded:()=>l(!1)})]}),b&&e.jsx("p",{className:"text-sm text-destructive",children:"Copy failed. Select the key in the field and copy it manually."}),e.jsx(m,{variant:"outline",size:"sm",onClick:()=>o(null),children:"I saved it"})]}),y&&e.jsx("p",{className:"text-sm text-muted-foreground",children:y}),A.isError&&e.jsx("p",{className:"text-sm text-destructive",children:"The installation could not be removed."}),s.isLoading&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading installationsâ¦"}),s.isError&&e.jsx("p",{className:"text-sm text-destructive",children:"Installations could not be loaded."}),s.data&&s.data.installations.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No browser installation has been registered for this account."}),s.data&&s.data.installations.length>0&&e.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:e.jsxs(se,{children:[e.jsx(ae,{children:e.jsxs(T,{children:[e.jsx(f,{children:"Name"}),e.jsx(f,{children:"Status"}),e.jsx(f,{children:"Browser"}),e.jsx(f,{children:"Version"}),e.jsx(f,{children:"Last seen"}),e.jsx(f,{className:"text-right",children:"Actions"})]})}),e.jsx(te,{children:s.data.installations.map(n=>e.jsxs(T,{children:[e.jsxs(j,{children:[e.jsx("div",{className:"font-medium",children:n.display_name}),e.jsx("div",{className:"font-mono text-xs text-muted-foreground",children:n.key_prefix?`${n.key_prefix}â¦`:"No active key"})]}),e.jsx(j,{children:e.jsx(L,{variant:n.state==="revoked"?"destructive":"secondary",children:$e(n.state)})}),e.jsx(j,{className:"capitalize",children:n.browser||"â"}),e.jsx(j,{children:n.extension_version||"â"}),e.jsx(j,{children:Re(n.last_seen_at)}),e.jsx(j,{children:e.jsxs("div",{className:"flex justify-end gap-1",children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>u({kind:"rotate",worker:n}),children:[e.jsx(ge,{"aria-hidden":!0}),"Rotate"]}),n.active&&e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>u({kind:"revoke",worker:n}),children:[e.jsx(be,{"aria-hidden":!0}),"Revoke"]}),e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>u({kind:"delete",worker:n}),children:[e.jsx(he,{"aria-hidden":!0}),"Delete"]})]})})]},n.id))})]})})]})]})}),e.jsx(le,{open:!!a,onOpenChange:n=>{!n&&!M&&u(null)},title:(a==null?void 0:a.kind)==="rotate"?`Rotate the key for ${a.worker.display_name}?`:(a==null?void 0:a.kind)==="delete"?`Remove ${a.worker.display_name} from this list?`:`Revoke ${(a==null?void 0:a.worker.display_name)??"this installation"}?`,description:(a==null?void 0:a.kind)==="rotate"?"The current key stops working immediately. Save the replacement key before leaving this page.":(a==null?void 0:a.kind)==="delete"?"Its key stops working immediately. An installation that never ran is deleted outright; one that already measured is archived instead, so its measurements are kept.":"The extension will stop receiving prompts and sending results immediately.",confirmLabel:(a==null?void 0:a.kind)==="rotate"?"Rotate key":(a==null?void 0:a.kind)==="delete"?"Remove installation":"Revoke installation",destructive:!0,busy:M,onConfirm:()=>{a&&(a.kind==="rotate"?B.mutate(a.worker.id):a.kind==="delete"?A.mutate(a.worker.id):E.mutate(a.worker.id,{onSuccess:()=>{(i==null?void 0:i.workerId)===a.worker.id&&o(null),u(null)}}))}})]})}function is(){return e.jsx(ke,{title:"Smalk Scraper",description:"Install a Chrome or Brave worker and manage one API key per browser installation.",backTo:"/admin/dashboard",children:e.jsx(Fe,{})})}
1export{is 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.