@camstack/addon-admin-ui 1.2.84 → 1.2.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddLocationWizard-CNcGS2EP.js → AddLocationWizard-CwreWITW.js} +1 -1
- package/dist/assets/{AddonCollectionPage-SG0XXnDN.js → AddonCollectionPage-B_yz8bA0.js} +1 -1
- package/dist/assets/{Addons-i2kGOrOA.js → Addons-ByS1wyLr.js} +1 -1
- package/dist/assets/{AdminTabs-Bml9sY2f.js → AdminTabs-BNPrEU-u.js} +1 -1
- package/dist/assets/{AiProfiles-Bkve7K-d.js → AiProfiles-BOhYahU1.js} +1 -1
- package/dist/assets/{BrokerForm-CBVRdxmh.js → BrokerForm-B45_C-11.js} +1 -1
- package/dist/assets/{Build-NxtOO0V2.js → Build-DBt1hX43.js} +4 -4
- package/dist/assets/{Capabilities-BROK90Se.js → Capabilities-D3ydTf8a.js} +1 -1
- package/dist/assets/{CapabilityBadges-CUituID7.js → CapabilityBadges-BsNvOYxI.js} +1 -1
- package/dist/assets/{Cluster-BrFa4n0G.js → Cluster-Be75yEy8.js} +1 -1
- package/dist/assets/{Data-G9jbwfOG.js → Data-DjH9RwP1.js} +1 -1
- package/dist/assets/DetectionIntelligence-Bxil3Kqd.js +1 -0
- package/dist/assets/{DeviceAggregateSection-SWBVkQZo.js → DeviceAggregateSection-CmeOZSZb.js} +1 -1
- package/dist/assets/{DeviceDetail-O6xEze8u.js → DeviceDetail-CLZxugdc.js} +2 -2
- package/dist/assets/{Devices-LRxw3I54.js → Devices-BiaI1wtk.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-kAcRRhLT.js → EmbedPlayerPage-BFMqluKF.js} +1 -1
- package/dist/assets/{Events-D5RYcT1o.js → Events-2Mew-AL7.js} +1 -1
- package/dist/assets/{FormBuilder-D5TM9i1v.js → FormBuilder-BDA9-uL2.js} +1 -1
- package/dist/assets/{Identity-BRBs5jpM.js → Identity-DYj1lU6G.js} +1 -1
- package/dist/assets/{IntegrationDetail-Bi2LK7OU.js → IntegrationDetail-DkP04o_o.js} +1 -1
- package/dist/assets/{Integrations-DGLN-Oxt.js → Integrations-DypneOCC.js} +1 -1
- package/dist/assets/{Integrations-qkldKVTw.js → Integrations-Q2IXumNM.js} +1 -1
- package/dist/assets/{Logs-gPb8NR8H.js → Logs-DCGZ4xft.js} +1 -1
- package/dist/assets/{MotionZonesSettings-DshKL17j.js → MotionZonesSettings-D2OfXg-s.js} +1 -1
- package/dist/assets/{MyAccess-X5GKXeQP.js → MyAccess-DiZ_NQ8Q.js} +1 -1
- package/dist/assets/{Network-D6gOeprQ.js → Network-D6Jjjglj.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-DQFTkg1Y.js → NodeAddonsSettingsPanel-iynDrGDY.js} +1 -1
- package/dist/assets/NodeInferenceDevices-kA005bIs.js +1 -0
- package/dist/assets/Notifications-3VV4lesM.js +1 -0
- package/dist/assets/Pipeline-Cvq_ZK2N.js +1 -0
- package/dist/assets/{Plates-ffuMaQFQ.js → Plates-Mq7_V44B.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-MMzNNe4D.js → PrivacyMaskSettings-DegFwke0.js} +1 -1
- package/dist/assets/{ProviderIcon-DYBwyw9a.js → ProviderIcon-BRIZHtNP.js} +1 -1
- package/dist/assets/{Recordings-C8wX8f22.js → Recordings-GWbTxHDj.js} +1 -1
- package/dist/assets/{ScanNetworkModal-loGcDZBw.js → ScanNetworkModal-h2wgb-9T.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-8DCu2vt2.js → SceneMonitorEditor-DtUM6j78.js} +1 -1
- package/dist/assets/{Scenes-0XwrxsM3.js → Scenes-CXbQ1BC3.js} +1 -1
- package/dist/assets/{Settings-ZUSTjvUu.js → Settings-CezuMxyz.js} +1 -1
- package/dist/assets/{Showroom-6YL7UJbf.js → Showroom-HltZNDXE.js} +1 -1
- package/dist/assets/{Terminal-ykCkur7X.js → Terminal-9BMEBt8x.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CmZvmCxO.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CLXUGt-W.js} +1 -1
- package/dist/assets/{bell-ring-B2rpaFtk.js → bell-ring-BOKJStq_.js} +1 -1
- package/dist/assets/{boxes-DFTZfyUt.js → boxes-BvnEYalC.js} +1 -1
- package/dist/assets/{build-cluster-graph-CLTUpmuN.js → build-cluster-graph-BVmcPlKM.js} +1 -1
- package/dist/assets/circle-check-big-H_sRGszZ.js +1 -0
- package/dist/assets/{circle-x-BBjSRoMP.js → circle-x-De9Atcex.js} +1 -1
- package/dist/assets/clock-DmdPTuLe.js +1 -0
- package/dist/assets/{copy-DWZC1oTP.js → copy-DPSVazs5.js} +1 -1
- package/dist/assets/{debounced-invalidate-CwLD5Weo.js → debounced-invalidate-CaNNRf1N.js} +1 -1
- package/dist/assets/{dist-Do647wcg.js → dist-DHHyyJUp.js} +1 -1
- package/dist/assets/dist-DtzZqioA.js +349 -0
- package/dist/assets/{download-CxGsHyPn.js → download-D0TL4kvK.js} +1 -1
- package/dist/assets/{face-bbox-BBED_iSc.js → face-bbox-DHOml3XL.js} +1 -1
- package/dist/assets/{hard-drive-mR1KIPtt.js → hard-drive-E6KB7P74.js} +1 -1
- package/dist/assets/{hostInit-COJyRwPi.js → hostInit-CJNRBgTm.js} +1 -1
- package/dist/assets/{index-D8DOnspM.js → index-BVmc_EOb.js} +3 -3
- package/dist/assets/{index-BppWvbJe.css → index-DR0aGe9s.css} +1 -1
- package/dist/assets/{key-round-Ds9BFc7u.js → key-round-DCkVCgVU.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-a5a42ace.js → mf-entry-bootstrap-0-b0b43084.js} +2 -2
- package/dist/assets/{pencil-LYk12AGI.js → pencil-CCigTGBs.js} +1 -1
- package/dist/assets/play-CAbyx0Ik.js +1 -0
- package/dist/assets/{player-overlays-BDAoS5mj.js → player-overlays-Cce7zLVf.js} +1 -1
- package/dist/assets/plus-CkMMGkZS.js +1 -0
- package/dist/assets/power-CFTIVgET.js +1 -0
- package/dist/assets/{radio-DOknapBC.js → radio-DH4YapvY.js} +1 -1
- package/dist/assets/{refresh-cw-aVMqVAXK.js → refresh-cw-7BWEDRql.js} +1 -1
- package/dist/assets/remoteEntry-ee3nHxW_.js +1 -0
- package/dist/assets/rotate-ccw-CvT7yFgt.js +1 -0
- package/dist/assets/rotate-cw-CHBtKezc.js +1 -0
- package/dist/assets/search-LiVSlZYd.js +1 -0
- package/dist/assets/{send-CStKcKMW.js → send-BxN-W44d.js} +1 -1
- package/dist/assets/{server-DpQquxi2.js → server-MPW5E9Je.js} +1 -1
- package/dist/assets/square-BGhxv6lU.js +1 -0
- package/dist/assets/{square-check-big-D_32NB3x.js → square-check-big-KUDADp7C.js} +1 -1
- package/dist/assets/src-BQU93IBQ.js +349 -0
- package/dist/assets/{src-BHAm1a2j.js → src-CLcW_gk2.js} +7 -7
- package/dist/assets/{star-CnMUDmNT.js → star-DgpioIxR.js} +1 -1
- package/dist/assets/{undo-2-Bu9cI3K3.js → undo-2-Dx5lBXZW.js} +1 -1
- package/dist/assets/{upload-DITj7pmV.js → upload-C_Z1HY8V.js} +1 -1
- package/dist/assets/{use-scenes-feed-ClYTNH65.js → use-scenes-feed-7qe4q2V7.js} +1 -1
- package/dist/assets/useEventInvalidation-B1u2ACO8.js +1 -0
- package/dist/assets/{video-D3MA7ngK.js → video-CDs4hw5_.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-PnuvqzUU.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BZfm1F7n.js} +2 -2
- package/dist/assets/{wifi-CmMg3Cu0.js → wifi-C6eU8xw2.js} +1 -1
- package/dist/assets/{zap-H6dvIirs.js → zap-CosjZI2Q.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/server/addon.js +108 -6
- package/package.json +1 -1
- package/dist/assets/DetectionIntelligence-DiGPeWhN.js +0 -1
- package/dist/assets/NodeInferenceDevices-Dp-l4FwP.js +0 -1
- package/dist/assets/Notifications-D1d2Q-ix.js +0 -1
- package/dist/assets/Pipeline-DcVa4THx.js +0 -1
- package/dist/assets/circle-check-big-BBxWSiDJ.js +0 -1
- package/dist/assets/clock-6MQBaiID.js +0 -1
- package/dist/assets/dist-DHSKR8rX.js +0 -345
- package/dist/assets/play-BSZQjLkZ.js +0 -1
- package/dist/assets/plus-DpCA4f3I.js +0 -1
- package/dist/assets/power-VPCWTEZu.js +0 -1
- package/dist/assets/remoteEntry-DBWzSJRP.js +0 -1
- package/dist/assets/rotate-ccw-D7VfDBtK.js +0 -1
- package/dist/assets/rotate-cw-1XMucssR.js +0 -1
- package/dist/assets/search-CcmIbGXi.js +0 -1
- package/dist/assets/square-BeUYnpBQ.js +0 -1
- package/dist/assets/src-B4-xc1-S.js +0 -345
- package/dist/assets/useEventInvalidation-CYexmqD-.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as e,Q as t,S as n,W as r,b as i,o as a,q as o,x as s,z as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{At as l,Br as u,Dt as d,Et as f,It as p,Lt as m,Ot as h,Pt as g,ai as _,ci as v,di as y,fi as b,ii as x,js as S,kt as C,li as w,ln as T,ni as E,oi as D,pi as O,ri as k,si as A,ti as j,ui as ee,wt as M}from"./src-BHAm1a2j.js";import{Pt as N}from"./src-B4-xc1-S.js";import{a as P,i as F,n as I,r as te,t as L}from"./face-bbox-BBED_iSc.js";import{a as ne,c as re,f as R,i as ie,l as ae,m as z,n as B,o as oe,p as V,r as se,s as ce,t as le,u as ue}from"./debounced-invalidate-CwLD5Weo.js";import{t as H}from"./pencil-LYk12AGI.js";import{t as U}from"./plus-DpCA4f3I.js";import{t as de}from"./refresh-cw-aVMqVAXK.js";import{t as W}from"./square-check-big-D_32NB3x.js";import{t as G}from"./square-BeUYnpBQ.js";import{t as K}from"./undo-2-Bu9cI3K3.js";import{C as q,I as J,K as fe,R as pe,h as me,i as Y,l as he,s as X,z as Z}from"./index-D8DOnspM.js";import{t as Q}from"./AdminPage-CCD07UMs.js";import{r as ge,t as _e}from"./authed-media-BPd_L9jr.js";var ve=fe(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]);t();var $=[[`faceGallery`]];function ye({identityId:e}){let t=a(),{data:r,isLoading:i}=A({identityId:e}),o=w();function c(n){o.mutate({identityId:e,sampleId:n.id},{onSettled:()=>{t.invalidateQueries({queryKey:$})}})}return i?n(`div`,{className:`flex items-center gap-2 py-3 text-xs text-foreground-subtle`,children:[s(q,{className:`h-3.5 w-3.5 animate-spin`}),`Loading samples…`]}):!r||r.length===0?s(`p`,{className:`py-2 text-xs text-foreground-subtle`,children:`No samples yet.`}):s(`div`,{className:`mt-2 grid grid-cols-4 gap-2 sm:grid-cols-6 md:grid-cols-8`,children:r.map(e=>n(`div`,{className:`group relative aspect-square overflow-hidden rounded-md border border-border bg-surface`,children:[e.base64?s(`img`,{src:`data:image/jpeg;base64,${e.base64}`,alt:`Sample`,className:`h-full w-full object-cover`}):s(`div`,{className:`flex h-full w-full items-center justify-center text-foreground-subtle`,children:s(ve,{className:`h-6 w-6`})}),s(`button`,{type:`button`,onClick:()=>c(e),disabled:o.isPending,className:`absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 transition-opacity group-hover:opacity-100 disabled:cursor-not-allowed`,"aria-label":`Remove sample`,children:s(Y,{className:`h-4 w-4 text-white`})})]},e.id))})}function be({identity:e,expanded:t,onToggle:r}){let c=a(),[u,_]=o(``),[v,y]=o(!1),[b,S]=o(!1),w=ee(),T=x();function E(){_(e.name),y(!0)}function D(){y(!1),_(``)}function O(){let t=u.trim();if(!t||t===e.name){D();return}w.mutate({id:e.id,name:t},{onSettled:()=>{c.invalidateQueries({queryKey:$}),D()}})}function k(){T.mutate({id:e.id},{onSettled:()=>{c.invalidateQueries({queryKey:$}),S(!1)}})}return n(`div`,{className:`rounded-md border border-border bg-surface`,children:[n(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[s(`div`,{className:`h-8 w-8 shrink-0 overflow-hidden rounded-full border border-border bg-surface-hover`,children:e.coverBase64?s(`img`,{src:`data:image/jpeg;base64,${e.coverBase64}`,alt:e.name,className:`h-full w-full object-cover`}):s(`div`,{className:`flex h-full w-full items-center justify-center`,children:s(ve,{className:`h-4 w-4 text-foreground-subtle`})})}),s(`div`,{className:`flex flex-1 min-w-0 items-center gap-2`,children:v?n(i,{children:[s(g,{value:u,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&O(),e.key===`Escape`&&D()},className:`h-6 text-xs`,autoFocus:!0}),s(`button`,{type:`button`,onClick:O,disabled:w.isPending,className:`text-success hover:text-success/80 disabled:opacity-50`,"aria-label":`Confirm rename`,children:s(Z,{className:`h-3.5 w-3.5`})}),s(`button`,{type:`button`,onClick:D,className:`text-foreground-subtle hover:text-foreground`,"aria-label":`Cancel rename`,children:s(Y,{className:`h-3.5 w-3.5`})})]}):s(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name})}),s(p,{variant:`default`,className:`text-[10px]`,children:e.sampleCount}),!v&&n(`div`,{className:`flex items-center gap-1`,children:[s(`button`,{type:`button`,onClick:E,className:`p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground`,"aria-label":`Rename`,children:s(H,{className:`h-3.5 w-3.5`})}),s(`button`,{type:`button`,onClick:()=>S(!0),className:`p-1 rounded hover:bg-danger/10 text-foreground-subtle hover:text-danger`,"aria-label":`Delete`,children:s(X,{className:`h-3.5 w-3.5`})})]}),s(`button`,{type:`button`,onClick:r,className:`p-1 rounded hover:bg-surface-hover text-foreground-subtle`,"aria-label":t?`Collapse`:`Expand`,children:s(t?pe:J,{className:`h-3.5 w-3.5`})})]}),t&&s(`div`,{className:`border-t border-border px-3 pb-3 pt-2`,children:s(ye,{identityId:e.id})}),s(M,{open:b,onOpenChange:e=>!e&&S(!1),children:n(f,{children:[n(C,{children:[s(l,{children:`Delete person`}),n(d,{children:[`Delete `,s(`strong`,{children:e.name}),` and all their samples? This cannot be undone.`]})]}),n(h,{children:[s(m,{variant:`secondary`,onClick:()=>S(!1),children:`Cancel`}),n(m,{variant:`danger`,onClick:k,disabled:T.isPending,children:[T.isPending?s(q,{className:`h-3.5 w-3.5 animate-spin`}):null,`Delete`]})]})]})})]})}function xe(){let e=a(),[t,r]=o(``),i=E();function c(){let n=t.trim();n&&i.mutate({name:n},{onSettled:()=>{e.invalidateQueries({queryKey:$}),r(``)}})}return n(`div`,{className:`flex items-center gap-2 pt-2`,children:[s(g,{placeholder:`New person name…`,value:t,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&c()},className:`h-7 text-xs flex-1`}),n(m,{variant:`primary`,size:`sm`,onClick:c,disabled:i.isPending||!t.trim(),children:[i.isPending?s(q,{className:`h-3.5 w-3.5 animate-spin`}):s(U,{className:`h-3.5 w-3.5`}),`Add`]})]})}function Se(){let{data:e,isLoading:t}=D(),[r,i]=o(null);function a(e){i(t=>t===e?null:e)}return t?n(`div`,{className:`flex items-center gap-2 py-4 text-xs text-foreground-subtle`,children:[s(q,{className:`h-4 w-4 animate-spin`}),`Loading people…`]}):n(`div`,{className:`space-y-2`,children:[(!e||e.length===0)&&s(`p`,{className:`py-2 text-xs text-foreground-subtle`,children:`No people enrolled yet. Add one below.`}),e?.map(e=>s(be,{identity:e,expanded:r===e.id,onToggle:()=>a(e.id)},e.id)),s(xe,{})]})}function Ce(e){let t=e.cropUrl!==void 0&&e.cropUrl.length>0,n=e.base64!==void 0&&e.base64.length>0;return!t&&!n}function we(e){return e.filter(Ce).map(e=>e.faceId)}function Te(e){let t=0;for(let n of e)Ce(n)&&(t+=1);return t}function Ee(e){return e==null?null:e.cropUrl!==void 0&&e.cropUrl.length>0?e.cropUrl:e.base64!==void 0&&e.base64.length>0?`data:image/jpeg;base64,${e.base64}`:null}t();var De=[[`faceGallery`]];function Oe({faceIds:e,identities:t,onDone:r}){let i=a(),c=j(),u=E(),[p,_]=o(``),[v,y]=o(!1),[b,x]=o(null),S=e!==null&&e.length>0,w=e?.length??0;function T(){y(!1),_(``),x(null)}function D(){T(),r()}function O(t){!e||e.length===0||c.mutate({faceIds:[...e],identityId:t},{onSettled:()=>{i.invalidateQueries({queryKey:De}),D()}})}function k(){!e||!p.trim()||u.mutate({name:p.trim()},{onSuccess:e=>{e?.id&&O(e.id)},onError:()=>{i.invalidateQueries({queryKey:De}),D()}})}let A=c.isPending||u.isPending;return s(M,{open:S,onOpenChange:e=>!e&&D(),children:n(f,{children:[n(C,{children:[s(l,{children:w>1?`Assign ${String(w)} faces to person`:`Assign face to person`}),s(d,{children:`Select an existing person or create a new one.`})]}),s(`div`,{className:`space-y-1 max-h-56 overflow-y-auto`,children:t.map(e=>n(`button`,{type:`button`,onClick:()=>x(e.id),className:`w-full rounded-md px-3 py-2 text-left text-xs transition-colors ${b===e.id?`bg-primary/12 text-primary`:`hover:bg-surface-hover text-foreground`}`,children:[s(`span`,{className:`font-medium`,children:e.name}),n(`span`,{className:`ml-2 text-foreground-subtle`,children:[e.sampleCount,` samples`]})]},e.id))}),v?s(`div`,{className:`flex items-center gap-2 pt-2 border-t border-border`,children:s(g,{placeholder:`New person name…`,value:p,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&k()},autoFocus:!0,className:`flex-1`})}):s(`button`,{type:`button`,onClick:()=>{x(null),y(!0)},className:`mt-2 w-full rounded-md border border-dashed border-border px-3 py-2 text-left text-xs text-foreground-subtle hover:border-primary hover:text-primary transition-colors`,children:`+ New person…`}),n(h,{children:[s(m,{variant:`secondary`,onClick:D,disabled:A,children:`Cancel`}),v?n(m,{variant:`primary`,onClick:k,disabled:A||!p.trim(),children:[A&&s(q,{className:`h-3.5 w-3.5 animate-spin`}),`Create & assign`]}):n(m,{variant:`primary`,onClick:()=>b&&O(b),disabled:A||!b,children:[A&&s(q,{className:`h-3.5 w-3.5 animate-spin`}),`Assign`,w>1?` ${String(w)}`:``]})]})]})})}t();function ke(e){let[t,n]=o(null),[r,i]=o(null),[a,s]=o(!1);return c(()=>{if(n(null),i(null),s(!1),!e)return;let t=!1,r=null;return(async()=>{try{let i=await ge(`${_e}/${encodeURIComponent(e)}`);if(t)return;r=URL.createObjectURL(i),n(r)}catch{t||s(!0)}})(),()=>{t=!0,r&&URL.revokeObjectURL(r)}},[e]),c(()=>{if(!t)return;let e=new Image;return e.onload=()=>i({width:e.naturalWidth,height:e.naturalHeight}),e.onerror=()=>s(!0),e.src=t,()=>{e.onload=null,e.onerror=null}},[t]),{frameSrc:t,naturalWidth:r?.width??null,naturalHeight:r?.height??null,failed:a}}function Ae(e){let t=e.filter(e=>e.base64.length>0);return t.length===0?null:t.find(e=>/crop|face/i.test(e.kind))??t[0]}function je({label:e,value:t}){return n(`div`,{className:`flex items-baseline justify-between gap-3 py-1.5 border-b border-border/60 last:border-0`,children:[s(`span`,{className:`shrink-0 text-[11px] uppercase tracking-wide text-foreground-subtle`,children:e}),s(`span`,{className:`min-w-0 truncate text-right text-xs font-medium text-foreground`,children:t})]})}function Me({box:e}){return s(`div`,{className:`pointer-events-none absolute rounded-[3px] border-2 border-primary shadow-[0_0_0_9999px_rgba(0,0,0,0.28)]`,style:{left:`${String(e.x*100)}%`,top:`${String(e.y*100)}%`,width:`${String(e.width*100)}%`,height:`${String(e.height*100)}%`},children:s(`span`,{className:`absolute -top-4 left-0 rounded bg-primary px-1 text-[9px] font-semibold uppercase tracking-wide text-white`,children:`Face`})})}function Ne({face:e,cameraName:t,onClose:i,onAssign:a,onUnassign:c,onDelete:l,actionsPending:u}){let{data:d,isFetching:p}=_({faceId:e?.faceId??``},{enabled:e!==null}),[h,g]=o(`frame`),{frameSrc:v,naturalWidth:y,naturalHeight:b,failed:x}=ke(e?.keyFrameMediaKey),S=r(()=>{let t=Ae(d??[]);return t?`data:image/jpeg;base64,${t.base64}`:Ee(e)},[d,e]),C=r(()=>!e?.faceBbox||y===null||b===null?null:L(e.faceBbox,y,b),[e?.faceBbox,y,b]);if(e===null)return null;let w=typeof e.keyFrameMediaKey==`string`&&e.keyFrameMediaKey.length>0&&!x,T=w&&h===`frame`,E=e.assigned?e.identityName??`Assigned`:e.recognizedIdentityId?`${e.identityName??`Recognized`} (suggested)`:`Unassigned`;return s(M,{open:!0,onOpenChange:e=>!e&&i(),children:n(f,{width:`lg`,placement:`sheet-on-mobile`,"aria-label":`Face detail`,className:`flex max-h-[92dvh] flex-col gap-0 overflow-hidden p-0 bottom-0 left-0 right-0 top-auto w-full max-w-full translate-x-0 translate-y-0 rounded-b-none md:bottom-auto md:left-1/2 md:right-auto md:top-1/2 md:w-[calc(100vw-2rem)] md:max-w-xl md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-lg md:max-h-[calc(100dvh-2rem)]`,children:[n(`header`,{className:`flex shrink-0 items-start justify-between gap-2 border-b border-border px-4 py-3`,children:[n(`div`,{className:`min-w-0`,children:[s(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:`Face detail`}),s(`div`,{className:`mt-0.5 truncate text-[11px] text-foreground-subtle`,children:t})]}),s(`button`,{type:`button`,onClick:i,className:`rounded p-1 text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,"aria-label":`Close`,children:s(Y,{className:`h-4 w-4`})})]}),n(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain px-4 py-3`,children:[w&&n(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5 text-xs`,children:[n(`button`,{type:`button`,onClick:()=>g(`frame`),className:`flex flex-1 items-center justify-center gap-1 rounded px-2 py-1 transition-colors ${h===`frame`?`bg-primary/12 font-medium text-primary`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[s(F,{className:`h-3.5 w-3.5`}),` Full frame`]}),n(`button`,{type:`button`,onClick:()=>g(`crop`),className:`flex flex-1 items-center justify-center gap-1 rounded px-2 py-1 transition-colors ${h===`crop`?`bg-primary/12 font-medium text-primary`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[s(P,{className:`h-3.5 w-3.5`}),` Crop`]})]}),T&&v?s(`div`,{className:`overflow-hidden rounded-lg border border-border bg-background`,children:s(B,{src:v,alt:`Full frame with detected face`,fit:`natural`,className:`w-full`,overlay:C?s(Me,{box:C}):void 0})}):S?n(`div`,{className:`relative aspect-square w-full overflow-hidden rounded-lg border border-border`,children:[s(B,{src:S,alt:`Detected face`,className:`h-full w-full`}),p&&s(`div`,{className:`absolute right-2 top-2 rounded-full bg-black/50 p-1 text-white`,children:s(q,{className:`h-3.5 w-3.5 animate-spin`})})]}):n(`div`,{className:`flex aspect-square w-full flex-col items-center justify-center gap-1.5 rounded-lg border border-border bg-warning/5 text-foreground-subtle`,children:[s(z,{className:`h-8 w-8 text-warning/70`}),s(`span`,{className:`text-[11px] font-medium uppercase tracking-wide text-warning/80`,children:`No image`}),s(`span`,{className:`px-6 text-center text-[10px] text-foreground-subtle`,children:`The crop media for this face could not be resolved (a pre-fix orphan). Safe to delete.`})]}),n(`div`,{className:`rounded-lg border border-border bg-surface px-3 py-1`,children:[s(je,{label:`Camera`,value:t}),s(je,{label:`Captured`,value:V(e.timestamp)}),s(je,{label:`Track`,value:e.trackId}),s(je,{label:`Identity`,value:E})]})]}),n(`footer`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-border px-4 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]`,children:[e.assigned?n(m,{variant:`secondary`,onClick:()=>c(e.faceId),disabled:u,children:[s(I,{className:`h-3.5 w-3.5`}),` Detach`]}):n(m,{variant:`primary`,onClick:()=>a(e.faceId),disabled:u,children:[s(te,{className:`h-3.5 w-3.5`}),` Assign`]}),n(m,{variant:`secondary`,onClick:()=>l(e.faceId),disabled:u,children:[s(X,{className:`h-3.5 w-3.5`}),` Delete`]})]})]})})}function Pe(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function Fe(e,t){return e.faceIds.filter(e=>!t.has(e))}function Ie(e,t){return e.faceIds.filter(e=>t(e))}t();var Le=[[`faceGallery`]],Re=20,ze=.3,Be=.9,Ve=.05,He=.5,Ue=2,We=10,Ge=2;function Ke({cluster:e,face:t,active:r,onSelect:i}){let a=Ee(t);return n(`button`,{type:`button`,onClick:i,className:`flex shrink-0 flex-col items-center gap-1.5 rounded-md border p-2 text-center transition-colors md:w-full md:flex-row md:gap-2.5 md:text-left ${r?`border-primary bg-primary/8`:`border-border bg-surface hover:bg-surface-hover`}`,children:[s(`div`,{className:`h-24 w-24 shrink-0 overflow-hidden rounded bg-surface-hover`,children:a===null?s(z,{className:`h-24 w-24 p-6 text-foreground-subtle`}):s(`img`,{src:a,alt:``,loading:`lazy`,decoding:`async`,className:`h-24 w-24 object-cover`})}),n(`span`,{className:`w-24 text-[11px] leading-tight text-foreground-subtle md:w-auto`,children:[e.size,` faces · `,Math.round(e.cohesion*100),`% alike`]})]})}function qe({face:e,cameraName:t,nowMs:r,excluded:i,onToggleExclude:a,onDelete:o,deletePending:c}){let l=Ee(e);return n(`div`,{className:`relative flex flex-col rounded-md border bg-surface overflow-hidden transition-opacity ${i?`border-border opacity-40 grayscale`:`border-border`}`,children:[n(`div`,{className:`aspect-square relative overflow-hidden bg-surface-hover`,children:[l===null?n(`div`,{className:`flex h-full w-full flex-col items-center justify-center gap-1 bg-warning/5 text-foreground-subtle`,children:[s(z,{className:`h-7 w-7 text-warning/70`}),s(`span`,{className:`text-[9px] font-medium uppercase tracking-wide text-warning/80`,children:`No crop`})]}):s(B,{src:l,alt:`Face from ${t}`,className:`h-full w-full`}),s(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a()},className:`absolute right-1 top-1 z-10 rounded-full bg-black/50 p-1.5 text-white hover:bg-black/70`,"aria-label":i?`Include face`:`Exclude face`,title:i?`Include`:`Exclude`,children:s(i?K:Y,{className:`h-3.5 w-3.5`})})]}),n(`div`,{className:`min-w-0 px-2 pt-1.5 space-y-0.5`,children:[s(`p`,{className:`text-[10px] font-medium text-foreground truncate`,title:t,children:t}),s(`p`,{className:`text-[10px] text-foreground-subtle truncate`,children:R(e.timestamp,r)})]}),s(`div`,{className:`mt-1 flex items-center justify-end border-t border-border/60 px-1 py-0.5`,children:s(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o()},disabled:c,className:`rounded p-1.5 text-foreground-subtle transition-colors hover:bg-danger/10 hover:text-danger disabled:opacity-40`,"aria-label":`Delete face`,title:`Delete face`,children:c?s(q,{className:`h-4 w-4 animate-spin`}):s(X,{className:`h-4 w-4`})})})]})}function Je({open:e,onClose:t,byId:l,cameraName:u,nowMs:d,identities:p,selectMany:h}){let g=a(),_=T(),v=k(),[b,x]=o(He),[S,C]=o(Ge),[w,E]=o(null),[D,O]=o({}),[A,j]=o(null),{data:ee,isFetching:N,refetch:P}=y({threshold:b,minClusterSize:S,limit:Re},{enabled:e}),F=ee??[];c(()=>{O({})},[b,S]),c(()=>{if(F.length===0){E(null);return}F.some(e=>e.representativeFaceId===w)||E(F[0]?.representativeFaceId??null)},[F]);let I=r(()=>F.find(e=>e.representativeFaceId===w)??null,[F,w]),L=I?D[I.representativeFaceId]??new Set:new Set,ne=r(()=>I?Ie(I,e=>l.has(e)):[],[I,l]),re=I?I.faceIds.length-ne.length:0,R=I?Fe({...I,faceIds:ne},L):[];function ie(e){if(!I)return;let t=I.representativeFaceId;O(n=>({...n,[t]:Pe(n[t]??new Set,e)}))}function ae(){g.invalidateQueries({queryKey:Le})}async function z(e){await _({title:`Delete face`,message:`Permanently deletes this face crop. This cannot be undone.`,confirmLabel:`Delete`,variant:`danger`})&&v.mutate({faceId:e},{onSettled:ae})}function B(){j(null),t()}function oe(){R.length!==0&&(h(R),B())}return n(M,{open:e,onOpenChange:e=>!e&&B(),children:[n(f,{placement:`sheet-on-mobile`,width:`lg`,"aria-label":`Look-alike groups`,className:`flex max-h-[92dvh] flex-col gap-0 overflow-hidden p-0 md:max-w-4xl`,children:[n(`header`,{className:`flex shrink-0 flex-col gap-2 border-b border-border px-4 py-3`,children:[n(`div`,{className:`flex items-center justify-between gap-2`,children:[n(`div`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[s(he,{className:`h-4 w-4 text-primary`}),` Look-alike groups`]}),s(`button`,{type:`button`,onClick:B,className:`rounded p-1 text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,"aria-label":`Close`,children:s(Y,{className:`h-4 w-4`})})]}),n(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[n(`label`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[`Threshold`,s(`input`,{type:`range`,min:ze,max:Be,step:Ve,value:b,onChange:e=>x(Number(e.target.value)),className:`h-1.5 w-28 cursor-pointer accent-primary`}),s(`span`,{className:`w-8 shrink-0 text-right font-mono text-[11px] tabular-nums text-foreground`,children:b.toFixed(2)})]}),n(`label`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[`Min size`,s(`input`,{type:`number`,min:Ue,max:We,step:1,value:S,onChange:e=>C(Math.min(We,Math.max(Ue,Number(e.target.value)||Ue))),className:`w-12 rounded border border-border bg-background px-1.5 py-0.5 text-xs text-foreground`})]}),n(m,{variant:`secondary`,onClick:()=>{O({}),P()},disabled:N,children:[N?s(q,{className:`h-3.5 w-3.5 animate-spin`}):s(de,{className:`h-3.5 w-3.5`}),`Re-analyze`]})]})]}),s(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden px-4 py-3 md:flex-row`,children:N&&F.length===0?n(`div`,{className:`flex flex-1 items-center justify-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(q,{className:`h-4 w-4 animate-spin`}),` Finding similar faces…`]}):F.length===0?s(`div`,{className:`flex flex-1 items-center justify-center py-8 text-xs text-foreground-subtle`,children:`No look-alike groups at this threshold.`}):n(i,{children:[s(`div`,{className:`flex gap-2 overflow-x-auto pb-1 md:hidden`,children:F.map(e=>s(Ke,{cluster:e,face:l.get(e.representativeFaceId),active:e.representativeFaceId===w,onSelect:()=>E(e.representativeFaceId)},e.representativeFaceId))}),s(`div`,{className:`hidden shrink-0 flex-col gap-2 overflow-y-auto md:flex md:w-56`,children:F.map(e=>s(Ke,{cluster:e,face:l.get(e.representativeFaceId),active:e.representativeFaceId===w,onSelect:()=>E(e.representativeFaceId)},e.representativeFaceId))}),s(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:I&&n(i,{children:[re>0&&n(`p`,{className:`mb-2 text-[11px] text-foreground-subtle`,children:[re,` not loaded — excluded from actions`]}),s(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(13rem,1fr))] gap-2`,children:ne.map(e=>{let t=l.get(e);return t?s(qe,{face:t,cameraName:u(t.deviceId),nowMs:d,excluded:L.has(e),onToggleExclude:()=>ie(e),onDelete:()=>void z(e),deletePending:v.isPending&&v.variables?.faceId===e},e):null})})]})})]})}),n(`footer`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-border px-4 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]`,children:[s(m,{variant:`secondary`,onClick:oe,disabled:R.length===0,children:`Select in gallery`}),n(m,{variant:`primary`,onClick:()=>j(R),disabled:R.length===0,children:[s(te,{className:`h-3.5 w-3.5`}),` Adopt (`,R.length,`)`]})]})]}),s(Oe,{faceIds:A,identities:p,onDone:()=>j(null)})]})}t();var Ye=[[`faceGallery`]],Xe=500,Ze=120;function Qe({face:e,cameraName:t,nowMs:r,selected:i,onToggleSelect:o,onAssign:c,onOpenDetail:l}){let u=a(),d=b(),f=k(),p=()=>{u.invalidateQueries({queryKey:Ye})},m=()=>l(e.faceId),h=Ee(e);return n(`div`,{className:`relative flex flex-col rounded-md border bg-surface overflow-hidden ${i?`border-primary ring-1 ring-primary`:`border-border`}`,children:[n(`div`,{className:`aspect-square relative overflow-hidden bg-surface-hover`,children:[h===null?n(`button`,{type:`button`,onClick:m,className:`flex h-full w-full flex-col items-center justify-center gap-1 bg-warning/5 text-foreground-subtle`,title:`No crop image — the face's crop media is missing (a pre-fix orphan). Safe to delete.`,children:[s(z,{className:`h-7 w-7 text-warning/70`}),s(`span`,{className:`text-[9px] font-medium uppercase tracking-wide text-warning/80`,children:`No crop`})]}):s(`img`,{src:h,alt:`Face from ${t}`,onClick:m,loading:`lazy`,decoding:`async`,className:`h-full w-full cursor-zoom-in object-cover`}),s(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),o(e.faceId)},className:`absolute left-0 top-0 z-10 rounded-br-md bg-black/50 p-1.5 text-white hover:bg-black/70`,"aria-label":i?`Deselect`:`Select`,children:i?s(W,{className:`h-4 w-4 text-primary`}):s(G,{className:`h-4 w-4`})})]}),n(`div`,{className:`min-w-0 px-2 pt-1.5 space-y-0.5`,children:[s(`p`,{className:`text-[10px] font-medium text-foreground truncate`,title:t,children:t}),s(`p`,{className:`text-[10px] text-foreground-subtle truncate`,children:R(e.timestamp,r)}),e.identityName&&s(`p`,{className:`text-[10px] font-medium text-primary truncate`,title:e.identityName,children:e.identityName})]}),n(`div`,{className:`mt-1 flex items-center gap-0.5 border-t border-border/60 px-1 py-0.5`,children:[e.assigned?s(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),d.mutate({faceId:e.faceId},{onSettled:p})},disabled:d.isPending,className:`rounded p-1.5 text-foreground-subtle transition-colors hover:bg-warning/10 hover:text-warning disabled:opacity-40`,"aria-label":`Detach face`,title:`Detach`,children:d.isPending?s(q,{className:`h-4 w-4 animate-spin`}):s(I,{className:`h-4 w-4`})}):s(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),c(e.faceId)},className:`rounded p-1.5 text-foreground-subtle transition-colors hover:bg-primary/10 hover:text-primary`,"aria-label":`Assign face to person`,title:`Assign to person`,children:s(te,{className:`h-4 w-4`})}),s(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),f.mutate({faceId:e.faceId},{onSettled:p})},disabled:f.isPending,className:`ml-auto rounded p-1.5 text-foreground-subtle transition-colors hover:bg-danger/10 hover:text-danger disabled:opacity-40`,"aria-label":`Delete face`,title:`Delete face`,children:f.isPending?s(q,{className:`h-4 w-4 animate-spin`}):s(X,{className:`h-4 w-4`})})]})]})}var $e=[{label:`All`,value:`all`},{label:`Unassigned`,value:`unassigned`},{label:`Recognized`,value:`recognized`}];function et(){let e=a(),[t,c]=o(`all`),[l,d]=o(ce),[f,p]=o(new Set),[h,g]=o(new Set),[_,y]=o(null),[x,S]=o(!1),[C,w]=o(null),{data:T,isLoading:E}=v({limit:Xe,filter:t,includeCrops:!1},{refetchInterval:3e4}),{data:A=[]}=D(),{data:ee}=u({}),M=j(),N=b(),P=O(),F=k(),L=Date.now(),R=T??[],B=r(()=>{let e=new Map;for(let t of ee??[])e.set(t.id,t.name);return e},[ee]),V=e=>B.get(e)??`Camera #${String(e)}`,le=r(()=>re(R).map(e=>({id:e,name:V(e)})).sort((e,t)=>e.name.localeCompare(t.name)),[R,B]),H=r(()=>ae(ue(R,l),f),[R,l,f]),U=oe(H,Ze,r(()=>JSON.stringify([t,l.fromMs,l.toMs,[...f].sort((e,t)=>e-t)]),[t,l.fromMs,l.toMs,f])),de=r(()=>new Map(R.map(e=>[e.faceId,e])),[R]),W=r(()=>Te(H),[H]),G=C===null?null:de.get(C)??null,K=()=>{e.invalidateQueries({queryKey:Ye})},J=()=>g(new Set);function fe(e){g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function pe(e){g(t=>{let n=new Set(t);for(let t of e)n.add(t);return n})}function me(){pe(we(H))}let Z=[...h],Q=M.isPending||P.isPending||F.isPending,ge=N.isPending||F.isPending;function _e(){Z.length!==0&&P.mutate({faceIds:Z},{onSettled:()=>{K(),J()}})}function ve(){Z.length!==0&&Promise.allSettled(Z.map(e=>F.mutateAsync({faceId:e}))).then(()=>{K(),J()})}function $(e){w(null),y([e])}function ye(e){N.mutate({faceId:e},{onSettled:K}),w(null)}function be(e){F.mutate({faceId:e},{onSettled:K}),w(null)}let xe=H.length!==R.length;return n(`div`,{className:`relative space-y-3`,children:[n(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[s(`div`,{className:`flex items-center gap-1`,children:$e.map(e=>s(`button`,{type:`button`,onClick:()=>c(e.value),className:`rounded-md px-2.5 py-1 text-xs transition-colors ${t===e.value?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:e.label},e.value))}),s(se,{onChange:d}),s(ie,{cameras:le,selected:f,onChange:p}),n(`button`,{type:`button`,onClick:()=>S(!0),className:`flex items-center gap-1 rounded-md px-2.5 py-1 text-xs transition-colors ${x?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[s(he,{className:`h-3.5 w-3.5`}),` Similar groups`]}),!E&&W>0&&n(`button`,{type:`button`,onClick:me,className:`ml-auto flex items-center gap-1 rounded-md px-2.5 py-1 text-xs text-warning/90 transition-colors hover:bg-warning/10`,title:`Select every visible face whose crop image is missing so you can delete the orphans in one pass`,children:[s(z,{className:`h-3.5 w-3.5`}),` Select `,W,` crop-less`]}),!E&&s(`span`,{className:`text-[10px] text-foreground-subtle ${W>0?`ml-2`:`ml-auto`}`,children:xe?`${String(H.length)} of ${String(R.length)} faces`:`${String(H.length)} face${H.length===1?``:`s`}`})]}),h.size>0&&n(`div`,{className:`flex flex-wrap items-center gap-2 rounded-md border border-primary/40 bg-primary/8 px-3 py-2`,children:[n(`span`,{className:`text-xs font-medium text-foreground`,children:[h.size,` selected`]}),n(`div`,{className:`ml-auto flex flex-wrap items-center gap-1.5`,children:[n(m,{variant:`primary`,onClick:()=>y(Z),disabled:Q,children:[s(te,{className:`h-3.5 w-3.5`}),` Assign`]}),n(m,{variant:`secondary`,onClick:_e,disabled:Q,children:[P.isPending?s(q,{className:`h-3.5 w-3.5 animate-spin`}):s(I,{className:`h-3.5 w-3.5`}),` `,`Detach`]}),n(m,{variant:`secondary`,onClick:ve,disabled:Q,children:[s(X,{className:`h-3.5 w-3.5`}),` Delete`]}),s(m,{variant:`ghost`,onClick:J,disabled:Q,children:s(Y,{className:`h-3.5 w-3.5`})})]})]}),E&&n(`div`,{className:`flex items-center gap-2 py-4 text-xs text-foreground-subtle`,children:[s(q,{className:`h-4 w-4 animate-spin`}),` Loading faces…`]}),!E&&H.length===0&&s(`p`,{className:`py-4 text-xs text-foreground-subtle`,children:R.length>0?`No faces match the current date / camera filters.`:`No faces found for this filter.`}),!E&&H.length>0&&n(i,{children:[s(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(6.5rem,1fr))] gap-2`,children:U.pageItems.map(e=>s(Qe,{face:e,cameraName:V(e.deviceId),nowMs:L,selected:h.has(e.faceId),onToggleSelect:fe,onAssign:e=>y([e]),onOpenDetail:w},e.faceId))}),s(ne,{currentPage:U.page,totalItems:U.totalItems,pageSize:U.pageSize,onPageChange:U.setPage,itemNoun:`faces`})]}),s(Ne,{face:G,cameraName:G?V(G.deviceId):``,onClose:()=>w(null),onAssign:$,onUnassign:ye,onDelete:be,actionsPending:ge}),s(Oe,{faceIds:_,identities:A,onDone:()=>{y(null),J()}}),s(Je,{open:x,onClose:()=>S(!1),byId:de,cameraName:V,nowMs:L,identities:A,selectMany:pe})]})}t();var tt=[[`faceGallery`]],nt=2e3;function rt(){let t=a(),n=e(t);n.current=t;let r=e(void 0);r.current||=le({delayMs:nt,invalidate:()=>{n.current.invalidateQueries({queryKey:tt})}}),c(()=>()=>r.current?.cancel(),[]),S(N.PipelineAnalyticsFaceGalleryChanged,()=>{r.current?.trigger()})}function it(){return rt(),s(Q,{icon:me,title:`Faces`,subtitle:`Manage enrolled identities and assign detected face crops to people.`,children:n(`section`,{className:`space-y-3`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground mb-1`,children:`People`}),s(`p`,{className:`text-xs text-foreground-subtle mb-3`,children:`Enrolled identities used for face recognition. Expand a row to view or remove training samples.`}),s(Se,{})]}),n(`div`,{className:`pt-4 border-t border-border`,children:[s(`h2`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Recent detected faces`}),s(`p`,{className:`text-xs text-foreground-subtle mb-3`,children:`Face crops captured by the detection pipeline. Assign them to a person to build recognition training data.`}),s(et,{})]})]})})}export{it as DetectionIntelligencePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as e,Q as t,S as n,W as r,b as i,o as a,q as o,x as s,z as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Br as l,Ir as u,It as d,Pr as f,Ra as p,Za as m,jt as h}from"./src-BHAm1a2j.js";import{t as g}from"./zap-H6dvIirs.js";import{I as _,K as v,N as y,S as b,a as x}from"./index-D8DOnspM.js";var S=v(`circuit-board`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M11 9h4a2 2 0 0 0 2-2V3`,key:`1ve2rv`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`M7 21v-4a2 2 0 0 1 2-2h4`,key:`1fwkro`}],[`circle`,{cx:`15`,cy:`15`,r:`2`,key:`3i40o0`}]]),C=v(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),w=v(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),T=v(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),E=v(`scale`,[[`path`,{d:`m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`7g6ntu`}],[`path`,{d:`m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`ijws7r`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2`,key:`3gwbw2`}]]),D=v(`usb`,[[`circle`,{cx:`10`,cy:`7`,r:`1`,key:`dypaad`}],[`circle`,{cx:`4`,cy:`20`,r:`1`,key:`22iqad`}],[`path`,{d:`M4.7 19.3 19 5`,key:`1enqfc`}],[`path`,{d:`m21 3-3 1 2 2Z`,key:`d3ov82`}],[`path`,{d:`M9.26 7.68 5 12l2 5`,key:`1esawj`}],[`path`,{d:`m10 14 5 2 3.5-3.5`,key:`v8oal5`}],[`path`,{d:`m18 12 1-1 1 1-1 1Z`,key:`1bh22v`}]]);t();function O(e){return l({addonId:e})}function k(e){return u({deviceId:e},{enabled:Number.isFinite(e)})}var A=3e4,j=2e3;function M(t){let n=e(0);return n.current===0&&(n.current=Date.now()),f({parentDeviceId:t},{enabled:Number.isFinite(t),staleTime:0,refetchOnMount:`always`,refetchInterval:e=>{let t=e.state.data;return t&&t.length>0||Date.now()-n.current>=A?!1:j}})}function N(e){let t={};for(let n of e){let e=Object.keys(n.steps).length>0;t[n.key]={enabled:n.enabled,weight:Math.max(1,n.weight),...n.maxSessions!==null&&n.maxSessions>0?{maxSessions:n.maxSessions}:{},...e?{steps:n.steps}:{}}}return t}t();function P(e,t,n){return Math.min(Math.max(e,t),n)}function F(e){let t=e.reduce((e,t)=>e+Math.max(t.weight,0),0);if(t<=0){let t=e.length>0?100/e.length:0;return Object.fromEntries(e.map(e=>[e.id,t]))}return Object.fromEntries(e.map(e=>[e.id,Math.max(e.weight,0)/t*100]))}function I(e,t,n,r,i){let a=i.filter(e=>e!==t&&r.has(e)).reduce((t,n)=>t+Math.max(e[n]??0,0),0),o=Math.max(0,100-a),s=i.filter(e=>e!==t&&!r.has(e)),c=s.length===0?o:P(n,0,o),l={...e,[t]:c};if(s.length>0){let e=Math.max(0,o-c)/s.length;for(let t of s)l[t]=e}return l}function L(e,t,n){let r={},i=0,a=[];for(let o of t){let t=Math.max(e[o]??0,0);if(n.has(o)){let e=Math.round(t);r[o]=e,i+=e}else{let e=Math.floor(t);r[o]=e,a.push({id:o,floor:e,frac:t-e})}}let o=Math.max(0,100-i)-a.reduce((e,t)=>e+t.floor,0),s=[...a].sort((e,t)=>t.frac-e.frac);for(let e=0;o>0&&s.length>0;e+=1)r[s[e%s.length].id]+=1,--o;let c=[...a].sort((e,t)=>e.frac-t.frac);for(let e=0;o<0&&c.length>0;e+=1){let t=c[e%c.length].id;r[t]>0&&(--r[t],o+=1)}return r}function R({nodes:e,pending:t,onCommitWeights:r,weightLabel:a=`Detection weight`,emptyHint:l,footnote:u}){let[d,f]=o(()=>F(e)),[p,m]=o(new Set);c(()=>{f(F(e)),m(t=>new Set([...t].filter(t=>e.some(e=>e.id===t))))},[e.map(e=>`${e.id}:${e.weight}`).join(`|`)]);let h=e.map(e=>e.id),g=e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},_=(e,t)=>{f(n=>I(n,e,t,p,h))},v=()=>{let t=L(d,h,p),n=e.filter(e=>(t[e.id]??0)!==e.weight).map(e=>e.id);if(n.length===0)return;let i=new Set([...n,...p]);r(e.filter(e=>i.has(e.id)).map(e=>({nodeId:e.id,weight:t[e.id]??0})))};if(e.length===0)return s(`p`,{className:`rounded-lg border border-dashed border-border bg-background px-4 py-6 text-center text-xs text-foreground-subtle`,children:l??`No detect-enabled nodes. Enable “Detect” on a node above to distribute detection weight.`});let y=e.length===1;return n(`div`,{className:`space-y-3`,children:[e.map(e=>{let r=d[e.id]??0,i=p.has(e.id);return n(`div`,{className:`flex items-center gap-3`,children:[s(`span`,{className:`w-28 shrink-0 truncate text-xs font-medium text-foreground`,title:e.name,children:e.name}),s(`input`,{"aria-label":`${a} for ${e.name}`,type:`range`,min:0,max:100,step:1,value:Math.round(r),disabled:t||i||y,onChange:t=>_(e.id,Number(t.target.value)),onPointerUp:()=>v(),onKeyUp:()=>v(),className:`h-1.5 flex-1 cursor-pointer accent-primary disabled:cursor-not-allowed disabled:opacity-50`}),n(`span`,{className:`w-10 shrink-0 text-right font-mono text-xs tabular-nums text-foreground`,children:[Math.round(r),`%`]}),s(`button`,{type:`button`,onClick:()=>g(e.id),disabled:t||y,"aria-pressed":i,title:i?`Unlock — allow rebalancing`:`Lock this share when others change`,className:`shrink-0 rounded p-1 hover:bg-surface-hover disabled:opacity-40 ${i?`text-amber-400`:`text-foreground-subtle`}`,children:s(i?b:w,{className:`h-3.5 w-3.5`})})]},e.id)}),s(`p`,{className:`text-[10px] leading-tight text-foreground-subtle`,children:u??s(i,{children:`Dragging one slider splits the rest equally across the unlocked nodes; lock a node to pin its share — locked nodes never move and the total always stays at 100%, so a drag is bounded by the room the unlocked nodes leave. Detection only distributes across nodes that can source a camera’s frames.`})})]})}t();function z(e){let t=e.backend.toLowerCase(),n=e.device.toLowerCase();return e.key===`cpu`||n===`cpu`?{label:`CPU`,Icon:y,hue:`slate`}:t===`openvino`&&n===`npu`?{label:`Intel NPU (AI Boost)`,Icon:g,hue:`sky`}:t===`openvino`&&(n===`gpu`||n===`igpu`)?{label:`Intel iGPU`,Icon:S,hue:`violet`}:t===`edgetpu`?{label:`Coral Edge TPU`,Icon:D,hue:`emerald`}:{label:`${e.backend} ${e.device}`.replace(/\b\w/g,e=>e.toUpperCase()).trim(),Icon:y,hue:`slate`}}var B={sky:`bg-sky-500/12 text-sky-400 ring-sky-500/25`,violet:`bg-violet-500/12 text-violet-400 ring-violet-500/25`,emerald:`bg-emerald-500/12 text-emerald-400 ring-emerald-500/25`,slate:`bg-surface-hover text-foreground-subtle ring-border`};function V({nodeId:e,nodeName:t,isOnline:l}){let u=a(),{data:f,isLoading:g}=p({nodeId:e},{refetchInterval:15e3}),v=m({onSettled:()=>{u.invalidateQueries({queryKey:[`pipelineOrchestrator`,`getNodeInferenceDevices`]})}}),y=f?.devices??[],b=f?.reachable??l,[S,w]=o({});c(()=>{w(Object.fromEntries(y.map(e=>[e.key,{enabled:e.enabled,weight:e.weight,maxSessions:e.maxSessions,steps:e.steps??{}}])))},[y.map(e=>`${e.key}:${e.enabled}:${e.weight}:${e.maxSessions}:${JSON.stringify(e.steps??{})}`).join(`|`)]);let T=r(()=>y.filter(e=>S[e.key]?.enabled??e.enabled).length,[y,S]),[D,O]=o(null),k=D??T>0,A=t=>{let n=y.map(e=>{let n=t[e.key]??j(e);return{key:e.key,enabled:n.enabled,weight:n.weight,maxSessions:n.maxSessions,steps:n.steps}});v.mutate({agentNodeId:e,inferenceDevices:N(n)})},j=e=>({enabled:e.enabled,weight:e.weight,maxSessions:e.maxSessions,steps:e.steps??{}}),M=e=>{if(!e.available)return;let t=S[e.key]??j(e),n={...S,[e.key]:{...t,enabled:!t.enabled}};w(n),A(n)},P=(e,t)=>{let n=S[e.key]??j(e),r={...S,[e.key]:{...n,maxSessions:t}};w(r),A(r)},F=r(()=>y.filter(e=>(S[e.key]?.enabled??e.enabled)&&e.available),[y,S]),I=r(()=>F.map(e=>({id:e.key,name:z(e).label,weight:S[e.key]?.weight??e.weight})),[F,S]);return n(`div`,{className:`rounded-lg border border-border bg-surface/60`,children:[n(`button`,{type:`button`,onClick:()=>O(!k),className:`flex w-full items-center gap-2.5 px-3.5 py-2.5 text-left`,"aria-expanded":k,children:[s(_,{className:`h-4 w-4 shrink-0 text-foreground-subtle transition-transform ${k?`rotate-90`:``}`}),s(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:t}),s(`span`,{className:`ml-auto flex items-center gap-2 text-[11px]`,children:b?T>=2?n(`span`,{className:`inline-flex items-center gap-1 text-emerald-400`,children:[s(C,{className:`h-3.5 w-3.5`}),T,` accelerators`]}):T===1?s(`span`,{className:`text-foreground-subtle`,children:`single default`}):s(`span`,{className:`text-foreground-subtle/70`,children:`auto default`}):n(`span`,{className:`inline-flex items-center gap-1 text-foreground-subtle`,children:[s(x,{className:`h-3.5 w-3.5`}),` unreachable`]})})]}),k&&n(`div`,{className:`space-y-3 border-t border-border px-3.5 py-3`,children:[b?g&&y.length===0?s(`p`,{className:`rounded-lg border border-dashed border-border bg-background px-4 py-6 text-center text-xs text-foreground-subtle`,children:`Probing accelerators…`}):y.length===0?s(`p`,{className:`rounded-lg border border-dashed border-border bg-background px-4 py-6 text-center text-xs text-foreground-subtle`,children:`No inference devices reported by this node's platform probe.`}):s(`ul`,{className:`space-y-2`,children:y.map(e=>{let t=z(e),r=S[e.key]??j(e),a=r.enabled&&e.available;return n(`li`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2.5 transition-colors ${e.available?a?`border-primary/40 bg-primary/[0.04] ring-1 ring-inset ring-primary/20`:`border-border bg-surface`:`border-border/60 bg-background opacity-55`}`,children:[s(`span`,{className:`grid h-9 w-9 shrink-0 place-items-center rounded-md ring-1 ring-inset ${B[t.hue]}`,children:s(t.Icon,{className:`h-4.5 w-4.5`})}),n(`div`,{className:`min-w-0 flex-1`,children:[n(`div`,{className:`flex items-center gap-2`,children:[s(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:t.label}),s(d,{variant:`default`,style:`outline`,className:`font-mono text-[9px]`,children:e.format}),!e.available&&s(d,{variant:`warning`,className:`text-[9px]`,children:`unavailable`})]}),n(`div`,{className:`mt-0.5 flex items-center gap-1.5 text-[10px] text-foreground-subtle`,children:[s(`span`,{className:`font-mono`,children:e.key}),!a&&n(i,{children:[s(`span`,{"aria-hidden":!0,children:`·`}),n(`span`,{children:[`default model`,` `,s(`span`,{className:`font-mono text-foreground/80`,children:e.defaultModelId})]})]})]})]}),a&&n(`label`,{className:`flex shrink-0 items-center gap-1 text-[10px] text-foreground-subtle`,children:[s(`span`,{className:`hidden @sm/clustertab:inline`,children:`cap`}),s(`input`,{type:`number`,min:1,placeholder:`∞`,value:r.maxSessions??``,onChange:t=>{let n=t.target.value.trim(),r=n===``?null:Number.parseInt(n,10);P(e,r!=null&&r>0?r:null)},disabled:v.isPending,"aria-label":`Max concurrent sessions for ${t.label}`,className:`w-14 rounded border border-border bg-background px-1.5 py-1 text-right font-mono text-[11px] text-foreground focus:border-primary focus:outline-none`})]}),s(h,{checked:a,onCheckedChange:()=>M(e),disabled:!e.available||v.isPending,"aria-label":`Enable ${t.label}`,className:e.available?``:`cursor-not-allowed opacity-50`})]},e.key)})}):s(H,{}),b&&F.length>=2&&n(`div`,{className:`space-y-3 rounded-lg border border-border bg-background/60 p-3.5`,children:[n(`h4`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-foreground-subtle`,children:[s(E,{className:`h-3.5 w-3.5`}),`Balancer weight`]}),s(R,{nodes:I,pending:v.isPending,onCommitWeights:e=>{let t={...S};for(let n of e){let e=t[n.nodeId];e&&(t[n.nodeId]={...e,weight:n.weight})}w(t),A(t)},weightLabel:`Balancer weight`,footnote:s(i,{children:`Drag to shift the share of detection sessions each accelerator handles; lock one to pin its share while the others rebalance. Shares always sum to 100%.`})})]}),v.isError&&n(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-3 py-2 text-[11px] text-danger`,children:[`Failed to save inference devices:`,` `,v.error instanceof Error?v.error.message:`unknown error`]})]})]})}function H(){return n(`div`,{className:`flex flex-col items-center gap-2 rounded-lg border border-dashed border-border bg-background px-4 py-8 text-center`,children:[s(x,{className:`h-6 w-6 text-foreground-subtle/60`}),s(`p`,{className:`text-xs font-medium text-foreground`,children:`Node unreachable`}),s(`p`,{className:`max-w-sm text-[11px] text-foreground-subtle`,children:`The platform probe couldn't be reached, so its live accelerator set is unavailable. Settings resume once the node reconnects.`})]})}export{k as a,T as c,N as i,C as l,z as n,M as o,R as r,O as s,V as t};
|