@camstack/addon-admin-ui 1.1.18 → 1.1.20

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.
Files changed (106) hide show
  1. package/dist/assets/{AddLocationWizard-BSAorNxx.js → AddLocationWizard-Brlh9UJ9.js} +1 -1
  2. package/dist/assets/AddonCollectionPage-Bg5OVL_9.js +1 -0
  3. package/dist/assets/Addons-2VeHH2Fx.js +1 -0
  4. package/dist/assets/{AdminPage-vtcsGqRq.js → AdminPage-BwmGKnRf.js} +1 -1
  5. package/dist/assets/{AdminTabs-m8tLAejz.js → AdminTabs-DVI3osLb.js} +1 -1
  6. package/dist/assets/{BrokerForm-D5X7ElT-.js → BrokerForm-CS__YhVd.js} +1 -1
  7. package/dist/assets/Capabilities-sR8ZG2Sp.js +1 -0
  8. package/dist/assets/{CapabilityBadges-DH4Q-Etp.js → CapabilityBadges-BtwEWtSB.js} +1 -1
  9. package/dist/assets/Cluster-BsMp1-aa.js +1 -0
  10. package/dist/assets/{Dashboard-99pp6GEH.js → Dashboard-cUXiEA9q.js} +1 -1
  11. package/dist/assets/Data-FggSTTQB.js +1 -0
  12. package/dist/assets/{DetectionIntelligence-PgT0GEOx.js → DetectionIntelligence-BG1dq_BC.js} +1 -1
  13. package/dist/assets/DeviceDetail-DD7tVaBH.js +2 -0
  14. package/dist/assets/{Devices-D3L0VfVU.js → Devices-DfYGm_-Y.js} +1 -1
  15. package/dist/assets/{EmbedPlayerPage-CG-ioO0R.js → EmbedPlayerPage-2oboqnId.js} +1 -1
  16. package/dist/assets/FormBuilder-B6OIFE8M.js +1 -0
  17. package/dist/assets/Identity-CiOHNQP2.js +1 -0
  18. package/dist/assets/IntegrationDetail-BVhsZAdC.js +1 -0
  19. package/dist/assets/{Integrations-DayJSTiK.js → Integrations-BOUUPSGH.js} +1 -1
  20. package/dist/assets/{Integrations-DTGXl1Ur.js → Integrations-CVCNKHh5.js} +1 -1
  21. package/dist/assets/{Logs-CpG3Oq7W.js → Logs-C_K69uCx.js} +1 -1
  22. package/dist/assets/{MaskShapeCanvas-CQ2SgaNa.js → MaskShapeCanvas-pGn6MKOi.js} +1 -1
  23. package/dist/assets/MotionZonesSettings-BnjJUOgY.js +1 -0
  24. package/dist/assets/MyAccess-BKZkUhvb.js +2 -0
  25. package/dist/assets/Network-Bu7lrlmc.js +1 -0
  26. package/dist/assets/{NodeAddonsSettingsPanel-DBNKikBW.js → NodeAddonsSettingsPanel-CsBUUhBI.js} +1 -1
  27. package/dist/assets/{NotificationTargets-ip8v0_gg.js → NotificationTargets-DlPYj2Ic.js} +1 -1
  28. package/dist/assets/Pipeline-CFOZ4ITe.js +1 -0
  29. package/dist/assets/PrivacyMaskSettings-RUAuOFuS.js +1 -0
  30. package/dist/assets/{ProviderIcon-r37coe5_.js → ProviderIcon-RCIWUZYh.js} +1 -1
  31. package/dist/assets/{ScanNetworkModal-BM4LZZGz.js → ScanNetworkModal-CVTAzCpc.js} +1 -1
  32. package/dist/assets/{SchemaTabBar-DRo5sGP1.js → SchemaTabBar-Lx0lVN3x.js} +1 -1
  33. package/dist/assets/{Settings-JgMgqfxb.js → Settings-BRGkGmWW.js} +1 -1
  34. package/dist/assets/{Showroom-DD4nO3bB.js → Showroom-nB3ihbXc.js} +1 -1
  35. package/dist/assets/{StatusBadge-BSsUNFG6.js → StatusBadge-Dcr2bw58.js} +1 -1
  36. package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CCEnK7l6.js +1 -0
  37. package/dist/assets/{_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js → _virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js} +1 -1
  38. package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DkcC9IVF.js +1 -0
  39. package/dist/assets/{_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-DcnMG4y9.js → _virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-D9-wIasd.js} +1 -1
  40. package/dist/assets/{_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-CUURKTLp.js → _virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DstpX0yz.js} +1 -1
  41. package/dist/assets/{_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-xmx-auwe.js → _virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-BBBrLLEa.js} +3 -3
  42. package/dist/assets/circle-check-big-DUVoa4K8.js +1 -0
  43. package/dist/assets/{copy-D905mbwE.js → copy-Dx6PkNh2.js} +1 -1
  44. package/dist/assets/dist-B40Mc3dp.js +6 -0
  45. package/dist/assets/{dist-LQLUbjed.js → dist-BcfEPpAI.js} +1 -1
  46. package/dist/assets/{download-CRt3yUK3.js → download-hTrdF0db.js} +1 -1
  47. package/dist/assets/{esm-B4H3LqM1.js → esm-CU8QwYlu.js} +3 -3
  48. package/dist/assets/{hostInit-qaKjJotG.js → hostInit-Bkxnbz6r.js} +1 -1
  49. package/dist/assets/index-DpDrVUWD.css +2 -0
  50. package/dist/assets/index-DvxZ6VPS.js +4 -0
  51. package/dist/assets/{key-round-p2A3Fbuu.js → key-round-CME-3JbN.js} +1 -1
  52. package/dist/assets/{mf-entry-bootstrap-0-dd1b0e8c.js → mf-entry-bootstrap-0-b91b99eb.js} +2 -2
  53. package/dist/assets/{pencil-CpJIJ9Uy.js → pencil-DJ_y_Wy8.js} +1 -1
  54. package/dist/assets/{player-overlays-BK-_BrgW.js → player-overlays-DEDwF8Uo.js} +1 -1
  55. package/dist/assets/plus-BgpJnRYz.js +1 -0
  56. package/dist/assets/{radio-RcoVZmtM.js → radio-C_HfliiA.js} +1 -1
  57. package/dist/assets/{refresh-cw-D6BYsgNx.js → refresh-cw-9oudg8kg.js} +1 -1
  58. package/dist/assets/remoteEntry-Buh8tQ2B.js +1 -0
  59. package/dist/assets/{rotate-ccw-wFxrc6l5.js → rotate-ccw-5_RfArHn.js} +1 -1
  60. package/dist/assets/rotate-cw-ClWkf91I.js +1 -0
  61. package/dist/assets/search-CxsQfiZy.js +1 -0
  62. package/dist/assets/{server-DOFYQi_I.js → server-CQ1LH5PQ.js} +1 -1
  63. package/dist/assets/{sparkles-DBG9vp4A.js → sparkles-DvV1ODWG.js} +1 -1
  64. package/dist/assets/square-CQY_D8K1.js +1 -0
  65. package/dist/assets/{square-check-big-rAJ2A2-o.js → square-check-big-64TOhDex.js} +1 -1
  66. package/dist/assets/src-50esl92F.js +61 -0
  67. package/dist/assets/src-BnbSKfdg.js +6 -0
  68. package/dist/assets/{upload-5GQoWO_K.js → upload-BgSvbRWR.js} +1 -1
  69. package/dist/assets/{useBodyScrollLock-B2OWVaf_.js → useBodyScrollLock-B_rtaBV1.js} +1 -1
  70. package/dist/assets/useDevice-BGpZXQ7x.js +1 -0
  71. package/dist/assets/useEventInvalidation-BTia6ZIb.js +1 -0
  72. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-Bj4tGzk2.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-tX1XrtZb.js} +2 -2
  73. package/dist/assets/{wifi-5-JmPgz2.js → wifi-Ctshxl91.js} +1 -1
  74. package/dist/assets/{zap--D6I-5eT.js → zap-BgTF9BOT.js} +1 -1
  75. package/dist/index.html +6 -6
  76. package/dist/server/addon.js +45 -2
  77. package/package.json +1 -1
  78. package/dist/assets/AddonCollectionPage-wr63l6CJ.js +0 -1
  79. package/dist/assets/Addons-CCu9KkD9.js +0 -1
  80. package/dist/assets/Capabilities-DC_JRuiW.js +0 -1
  81. package/dist/assets/Cluster-R47NhOdT.js +0 -1
  82. package/dist/assets/Data-CjGyMZA8.js +0 -1
  83. package/dist/assets/DeviceDetail-D5VfOgmh.js +0 -2
  84. package/dist/assets/FormBuilder-zyMCOhuI.js +0 -1
  85. package/dist/assets/Identity-D1JnXext.js +0 -1
  86. package/dist/assets/IntegrationDetail-BrPHapeM.js +0 -1
  87. package/dist/assets/MotionZonesSettings-DpdNJlNH.js +0 -1
  88. package/dist/assets/MyAccess-BfsppvsN.js +0 -2
  89. package/dist/assets/Network-CjIhXL12.js +0 -1
  90. package/dist/assets/Pipeline-DHnGCOi7.js +0 -1
  91. package/dist/assets/PrivacyMaskSettings-BaWtZUaS.js +0 -1
  92. package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DZuPeYa3.js +0 -1
  93. package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DqrXu-jG.js +0 -1
  94. package/dist/assets/circle-check-big-qiIAVDDz.js +0 -1
  95. package/dist/assets/dist-DK88lvvz.js +0 -6
  96. package/dist/assets/index-DP9bur77.css +0 -2
  97. package/dist/assets/index-NMHNU-e8.js +0 -4
  98. package/dist/assets/plus-OLMgcI14.js +0 -1
  99. package/dist/assets/remoteEntry-BYprJ3Bc.js +0 -1
  100. package/dist/assets/rotate-cw-CxsIcHYk.js +0 -1
  101. package/dist/assets/search-5vt1VPCs.js +0 -1
  102. package/dist/assets/square-BY1YswJx.js +0 -1
  103. package/dist/assets/src-1618avTR.js +0 -61
  104. package/dist/assets/src-D7qnpDWK.js +0 -6
  105. package/dist/assets/useDevice-DHi9vYPM.js +0 -1
  106. package/dist/assets/useEventInvalidation-orMzg97E.js +0 -1
@@ -1 +0,0 @@
1
- import{G as e,I as t,K as n,S as r,W as i,Z as a,b 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-CCjPq1YD.js";import{L as l,V as u,c as d,g as f,n as p,p as m,s as h}from"./player-overlays-BK-_BrgW.js";import{MaskShapeCanvas as ee}from"./MaskShapeCanvas-CQ2SgaNa.js";var g=f(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]);a();var _=110,v=`motion-zones`,y=0,b=[1,2,3],x=1,S=`rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,C=`rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors`;function w(e,t,n){let r=t*n,i=Array.from({length:r});for(let t=0;t<r;t+=1)i[t]=e[t]===!0;return i}function T(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function E(e,t){return Math.ceil(e/t)}function D(e,t,n){return Math.min(n-1,Math.floor((e+.5)/t*n))}function O(e,t,n,r){let i=E(t,r),a=E(n,r),o=Array.from({length:i*a},()=>!1);for(let r=0;r<n;r+=1){let s=D(r,n,a);for(let n=0;n<t;n+=1)e[r*t+n]===!0&&(o[s*i+D(n,t,i)]=!0)}return o}function k(e,t,n,r){let i=E(t,r),a=E(n,r),o=Array.from({length:t*n},()=>!1);for(let r=0;r<n;r+=1){let s=D(r,n,a);for(let n=0;n<t;n+=1)o[r*t+n]=e[s*i+D(n,t,i)]===!0}return o}function A({deviceId:a}){let f=d(m().trpcClient,a),[D,A]=n(null),[j,M]=n(!1),[N,P]=n(null),[F,I]=n(null),[L,R]=n(x),[z,B]=n(!1),[V,H]=n(!1),U=e(!1);c(()=>{if(!f)return;let e=!1;return U.current=!1,A(null),M(!1),P(null),I(null),R(x),H(!1),(async()=>{try{let t=await f.motionZones?.getOptions({});if(e)return;if(!t)throw Error(`device proxy not ready`);if(A(t),U.current)return;let n=await f.motionZones?.getStatus({});if(e)return;if(!n)throw Error(`device proxy not ready`);U.current=!0;let r=n.regions.find(e=>e.shape.kind===`grid`),i=w(r?r.shape.cells:[],t.grid.width,t.grid.height);I(i),P(O(i,t.grid.width,t.grid.height,x))}catch(t){if(e)return;u(t)?M(!0):console.error(`Motion Zones load failed`,t)}})(),()=>{e=!0}},[f]);let W=D?D.grid.width:0,G=D?D.grid.height:0,K=E(W,L),q=E(G,L),J=i(()=>N&&D?k(N,W,G,L):null,[N,D,W,G,L]),Y=i(()=>J!==null&&F!==null&&!T(J,F),[J,F]),te=i(()=>J?J.reduce((e,t)=>t?e+1:e,0):0,[J]),ne=W*G,X=K*q,Z=t(e=>{X>0&&P(Array.from({length:X},()=>e))},[X]),re=t(()=>{P(e=>e&&e.map(e=>!e))},[]),ie=t(()=>{F&&D&&P(O(F,W,G,L))},[F,D,W,G,L]),ae=t(e=>{e===L||!D||P(t=>{if(!t)return R(e),t;let n=O(k(t,W,G,L),W,G,e);return R(e),n})},[L,D,W,G]),Q=i(()=>D&&N?[{id:y,shape:{kind:`grid`,gridWidth:K,gridHeight:q,cells:[...N]}}]:[],[D,N,K,q]),$=t((e,t)=>{t.kind===`grid`&&P(t.cells)},[]),oe=t(async()=>{if(!(!f||!N||!D)){B(!0);try{let e=k(N,D.grid.width,D.grid.height,L),t={kind:`grid`,gridWidth:D.grid.width,gridHeight:D.grid.height,cells:e};await f.motionZones?.setZone({patch:{regions:[{id:y,enabled:!0,shape:t}]}});let n=await f.motionZones?.getStatus({});if(n){let e=n.regions.find(e=>e.shape.kind===`grid`),t=w(e?e.shape.cells:[],D.grid.width,D.grid.height);I(t),P(O(t,D.grid.width,D.grid.height,L))}}catch(e){console.error(`Motion Zones save failed`,e)}finally{B(!1)}}},[f,N,D,L]);return p(i(()=>V&&!j&&D&&N?{id:v,order:_,node:s(ee,{transparent:!0,items:Q,supportedShapes:[`grid`],grid:{width:K,height:q},selectedId:y,onSelect:()=>{},onShapeChange:$,onDrawComplete:()=>{},drawingKind:null})}:null,[V,j,D,N,Q,$,K,q])),f?s(h,{title:`Motion Zones`,icon:s(g,{className:`h-3.5 w-3.5 text-foreground-subtle`}),children:s(`div`,{className:`flex flex-col gap-3`,children:j?s(`p`,{className:`${l} leading-relaxed`,children:`This camera doesn't expose an on-board motion zones grid.`}):!j&&D!==null&&N!==null?r(o,{children:[r(`p`,{className:`${l} leading-relaxed`,children:[`Toggle `,s(`strong`,{className:`text-foreground`,children:`Edit grid`}),` to paint the region directly on the live frame, then `,s(`strong`,{className:`text-foreground`,children:`Save`}),` to push the mask to the camera. Pick a bigger`,` `,s(`strong`,{className:`text-foreground`,children:`Cell size`}),` for quicker, broad-stroke painting — it's resampled to the camera's native `,D.grid.width,`×`,D.grid.height,` grid on save (×1 is the finest).`]}),r(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[s(`button`,{type:`button`,onClick:()=>H(e=>!e),disabled:z,"aria-pressed":V,className:V?C:S,children:V?`Done editing`:`Edit grid`}),s(`button`,{type:`button`,onClick:()=>Z(!0),disabled:z,className:S,children:`All on`}),s(`button`,{type:`button`,onClick:()=>Z(!1),disabled:z,className:S,children:`All off`}),s(`button`,{type:`button`,onClick:re,disabled:z,className:S,children:`Invert`}),r(`div`,{className:`flex items-center gap-1 ml-1`,role:`group`,"aria-label":`Cell size`,children:[s(`span`,{className:`${l} mr-0.5`,children:`Cell size`}),b.map(e=>r(`button`,{type:`button`,onClick:()=>ae(e),disabled:z,"aria-pressed":L===e,title:e===1?`Camera grid ${W}×${G} (finest)`:`${E(W,e)}×${E(G,e)} painting grid · cells ×${e} bigger`,className:L===e?C:S,children:[`×`,e]},e))]}),r(`span`,{className:`${l} ml-1 tabular-nums`,children:[te,` / `,ne,` cells · `,D.grid.width,`×`,D.grid.height,L===1?``:` · paint ${K}×${q}`]}),s(`span`,{className:`flex-1`}),s(`button`,{type:`button`,onClick:ie,disabled:z||!Y,className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,children:`Revert`}),s(`button`,{type:`button`,onClick:()=>void oe(),disabled:z||!Y,className:C,children:z?`Saving…`:`Save`})]})]}):s(`p`,{className:`${l} leading-relaxed`,children:`Loading the camera's grid…`})})}):null}export{A as MotionZonesSettings};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-BHo8W_uH.js","assets/rolldown-runtime-Cyuzqnbw.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{t}from"./vite-preload-helper-zJ_50EbN.js";import"./src-1618avTR.js";import{K as n,S as r,W as i,Z as a,a as o,b as s,t as c,x as l,z as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js";import{p as d}from"./player-overlays-BK-_BrgW.js";import{t as f}from"./circle-check-big-qiIAVDDz.js";import{t as p}from"./copy-D905mbwE.js";import{t as m}from"./key-round-p2A3Fbuu.js";import{t as h}from"./pencil-CpJIJ9Uy.js";import{C as g,T as _,b as v,j as y,l as b,r as x,s as S,x as C,y as w}from"./index-NMHNU-e8.js";import{t as T}from"./AdminPage-vtcsGqRq.js";a();function E({value:i,size:a=192}){let[o,s]=n(null),[c,d]=n(null);if(u(()=>{let n=!1;return t(()=>import(`./browser-BHo8W_uH.js`).then(t=>e(t.default,1)).then(async e=>{if(n)return;let t=e.create;if(typeof t!=`function`){d(`qrcode.create() unavailable in installed version`);return}try{let e=t(i,{errorCorrectionLevel:`M`});n||s(e)}catch(e){n||d(e instanceof Error?e.message:`QR generation failed`)}}),__vite__mapDeps([0,1])).catch(()=>{n||d(`qrcode library not installed`)}),()=>{n=!0}},[i]),c)return l(`div`,{className:`flex items-center justify-center text-[10px] text-foreground-subtle text-center p-4`,style:{width:a,height:a},children:`QR rendering unavailable — use the secret below.`});if(!o)return l(`div`,{className:`flex items-center justify-center text-[10px] text-foreground-subtle animate-pulse`,style:{width:a,height:a},children:`Generating…`});let f=o.modules.size,p=a/f,m=[];for(let e=0;e<f;e++)for(let t=0;t<f;t++)o.modules.data[e*f+t]&&m.push(l(`rect`,{x:t*p,y:e*p,width:p,height:p,fill:`currentColor`},`${t}-${e}`));return r(`svg`,{width:a,height:a,viewBox:`0 0 ${a} ${a}`,className:`text-black`,children:[l(`rect`,{x:0,y:0,width:a,height:a,fill:`white`}),m]})}a();var D={view:{icon:_,cls:`bg-foreground-subtle/15 text-foreground-subtle`},create:{icon:h,cls:`bg-primary/15 text-primary`},delete:{icon:S,cls:`bg-danger/15 text-danger`}};function O(){let{user:e,logout:t}=x();if(!e)return l(T,{children:l(`div`,{className:`text-xs text-foreground-subtle`,children:`Not signed in.`})});let n=e.isAdmin,i=e.scopes??[];return r(T,{children:[r(`div`,{className:`rounded-lg border border-border bg-surface px-4 py-3 flex items-center gap-3`,children:[l(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-primary/10 text-primary font-semibold text-base`,children:e.username.slice(0,1).toUpperCase()}),r(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-sm font-semibold text-foreground truncate`,children:e.username}),r(`div`,{className:`text-[11px] text-foreground-subtle`,children:[n?`Administrator`:`User`,` · session id`,` `,r(`span`,{className:`font-mono`,children:[e.id.slice(0,8),`…`]})]})]})]}),n&&r(`div`,{className:`rounded-lg border border-primary/30 bg-primary/5 px-4 py-3 text-xs text-foreground flex items-start gap-2.5`,children:[l(g,{className:`h-4 w-4 text-primary mt-0.5 shrink-0`}),r(`div`,{children:[l(`div`,{className:`font-semibold text-foreground`,children:`Unrestricted access`}),l(`p`,{className:`text-foreground-subtle mt-0.5`,children:`Admin sessions bypass the per-call scope check. Every protected endpoint is reachable regardless of the list below.`})]})]}),l(k,{}),l(j,{username:e.username}),i.length>0&&r(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`px-4 py-2 border-b border-border`,children:[l(`div`,{className:`text-xs font-semibold text-foreground`,children:`Granted scopes`}),l(`div`,{className:`text-[10px] text-foreground-subtle`,children:`Baked into your session token at login; sign out + back in to refresh after changes.`})]}),r(`div`,{className:`grid grid-cols-[100px_1fr_240px] gap-3 px-4 py-2 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:[l(`div`,{children:`Type`}),l(`div`,{children:`Target`}),l(`div`,{children:`Access`})]}),l(`ul`,{className:`divide-y divide-border`,children:i.map((e,t)=>r(`li`,{className:`grid grid-cols-[100px_1fr_240px] gap-3 px-4 py-2.5 items-center text-xs`,children:[l(`span`,{className:`font-mono text-foreground-subtle`,children:e.type}),l(`span`,{className:`font-mono text-foreground`,children:e.type===`device`?e.targets.join(`, `):e.target}),l(`div`,{className:`flex items-center gap-1`,children:[`view`,`create`,`delete`].map(t=>{let n=e.access.includes(t),{icon:i,cls:a}=D[t];return r(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium ${n?a:`bg-transparent text-foreground-subtle/40 line-through`}`,title:n?`Can ${t}`:`Cannot ${t}`,children:[l(i,{className:`h-3 w-3`}),t]},t)})})]},t))})]}),l(`div`,{className:`flex justify-end`,children:r(`button`,{onClick:t,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-foreground-subtle/10 hover:text-foreground transition-colors`,children:[l(w,{className:`h-3 w-3`}),`Sign out`]})})]})}function k(){let e=d(),[t,i]=n(``),[a,o]=n(``),[s,u]=n(``),[p,h]=n(null),g=c({mutationFn:t=>e.changeOwnPassword(t),onSuccess:()=>{h({kind:`success`,msg:`Password updated.`}),i(``),o(``),u(``)},onError:e=>{h({kind:`error`,msg:e instanceof Error?e.message:`Update failed`})}}),_=a.length>0&&s.length>0&&a!==s,b=a.length>0&&a.length<8,x=t.length>=1&&a.length>=8&&a===s;return r(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center gap-2`,children:[l(m,{className:`h-3.5 w-3.5 text-foreground-subtle`}),l(`div`,{className:`text-xs font-semibold text-foreground`,children:`Change password`})]}),r(`div`,{className:`p-4 space-y-3`,children:[l(A,{label:`Current password`,value:t,onChange:i,autoComplete:`current-password`}),l(A,{label:`New password`,value:a,onChange:o,autoComplete:`new-password`,hint:`At least 8 characters.`}),l(A,{label:`Confirm new password`,value:s,onChange:u,autoComplete:`new-password`}),(_||b)&&l(`div`,{className:`text-[11px] text-danger`,children:_?`Passwords do not match.`:`New password must be at least 8 characters.`}),p&&r(`div`,{className:`text-[11px] flex items-center gap-1 ${p.kind===`success`?`text-emerald-500`:`text-danger`}`,children:[p.kind===`success`?l(f,{className:`h-3 w-3`}):l(y,{className:`h-3 w-3`}),p.msg]}),l(`div`,{className:`flex justify-end`,children:r(`button`,{onClick:()=>{h(null),g.mutate({currentPassword:t,newPassword:a})},disabled:!x||g.isPending,className:`inline-flex items-center gap-1 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[g.isPending?l(C,{className:`h-3 w-3 animate-spin`}):l(v,{className:`h-3 w-3`}),`Update password`]})})]})]})}function A({label:e,value:t,onChange:n,autoComplete:i,hint:a}){return r(`div`,{className:`space-y-1`,children:[l(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:e}),l(`input`,{type:`password`,value:t,onChange:e=>n(e.target.value),autoComplete:i,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`}),a&&l(`div`,{className:`text-[10px] text-foreground-subtle`,children:a})]})}function j({username:e}){let t=d(),a=o({queryKey:[`auth`,`getOwnTotpStatus`],queryFn:()=>t.getOwnTotpStatus()}),m=a.data,[h,g]=n(null),[_,v]=n(``),[x,S]=n(null),[w,T]=n(!1),D=c({mutationFn:()=>t.setupOwnTotp(),onSuccess:e=>{g({secret:e.secret,otpauthUrl:e.otpauthUrl}),v(``),S(null)},onError:e=>S(e instanceof Error?e.message:`Setup failed`)}),O=c({mutationFn:e=>t.confirmOwnTotp(e),onSuccess:()=>{g(null),v(``),S(null),a.refetch()},onError:e=>S(e instanceof Error?e.message:`Confirmation failed — code did not match`)}),k=c({mutationFn:()=>t.disableOwnTotp(),onSuccess:()=>{S(null),a.refetch()},onError:e=>S(e instanceof Error?e.message:`Disable failed`)});u(()=>{if(!w)return;let e=setTimeout(()=>T(!1),1500);return()=>clearTimeout(e)},[w]);let A=i(()=>a.isLoading?`loading`:h?`setup_in_progress`:m?.enabled?`enrolled`:`not_enrolled`,[a.isLoading,m?.enabled,h]);return r(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center gap-2`,children:[l(b,{className:`h-3.5 w-3.5 text-foreground-subtle`}),l(`div`,{className:`text-xs font-semibold text-foreground`,children:`Two-factor authentication`})]}),r(`div`,{className:`p-4 space-y-3`,children:[A===`loading`&&r(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[l(C,{className:`h-3.5 w-3.5 animate-spin`}),`Checking status…`]}),A===`not_enrolled`&&r(s,{children:[l(`div`,{className:`text-xs text-foreground-subtle`,children:`2FA isn't active on your account. Enable it to require a 6-digit code from your authenticator app at every login.`}),l(`div`,{className:`flex justify-end`,children:r(`button`,{onClick:()=>{S(null),D.mutate()},disabled:D.isPending,className:`inline-flex items-center gap-1 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[D.isPending?l(C,{className:`h-3 w-3 animate-spin`}):l(b,{className:`h-3 w-3`}),`Enable 2FA`]})})]}),A===`setup_in_progress`&&h&&r(s,{children:[r(`div`,{className:`text-[11px] text-foreground-subtle`,children:[`Scan the QR code (or enter the secret manually) into your authenticator app for`,` `,l(`span`,{className:`font-mono`,children:e}),`, then enter the 6-digit code below to confirm.`]}),r(`div`,{className:`flex flex-col items-center gap-3`,children:[l(`div`,{className:`rounded-lg border border-border bg-white p-3`,children:l(E,{value:h.otpauthUrl,size:180})}),r(`div`,{className:`w-full`,children:[l(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle mb-1`,children:`Secret (manual entry)`}),r(`div`,{className:`flex items-center gap-2 rounded border border-border bg-surface-hover/30 px-2 py-1.5`,children:[l(`code`,{className:`text-[11px] font-mono text-foreground break-all flex-1`,children:h.secret}),r(`button`,{onClick:()=>{h&&navigator.clipboard.writeText(h.secret).then(()=>T(!0))},className:`inline-flex items-center gap-1 text-[10px] text-foreground-subtle hover:text-foreground`,children:[w?l(f,{className:`h-3 w-3 text-emerald-500`}):l(p,{className:`h-3 w-3`}),w?`Copied`:`Copy`]})]})]})]}),r(`div`,{className:`space-y-1`,children:[l(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`6-digit code`}),l(`input`,{type:`text`,inputMode:`numeric`,autoComplete:`one-time-code`,placeholder:`123456`,value:_,onChange:e=>v(e.target.value.replace(/\D/g,``).slice(0,6)),className:`w-full rounded-md border border-border bg-surface px-3 py-2 text-center text-lg font-mono tracking-widest text-foreground focus:outline-none focus:ring-2 focus:ring-primary`})]}),x&&r(`div`,{className:`text-[11px] text-danger flex items-center gap-1`,children:[l(y,{className:`h-3 w-3`}),x]}),r(`div`,{className:`flex justify-end gap-2`,children:[l(`button`,{onClick:()=>{g(null),S(null),v(``)},className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Cancel`}),r(`button`,{onClick:()=>{S(null),O.mutate({code:_})},disabled:O.isPending||_.length!==6,className:`inline-flex items-center gap-1 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[O.isPending?l(C,{className:`h-3 w-3 animate-spin`}):l(f,{className:`h-3 w-3`}),`Confirm`]})]})]}),A===`enrolled`&&m&&r(s,{children:[r(`div`,{className:`rounded-md border border-emerald-500/30 bg-emerald-500/5 px-3 py-2.5 flex items-start gap-2.5`,children:[l(f,{className:`h-4 w-4 mt-0.5 text-emerald-500 shrink-0`}),r(`div`,{className:`text-xs text-foreground space-y-0.5`,children:[l(`div`,{className:`font-medium`,children:`2FA is active`}),r(`div`,{className:`text-foreground-subtle`,children:[`Enrolled on`,` `,m.confirmedAt?new Date(m.confirmedAt).toLocaleString():`—`]})]})]}),x&&r(`div`,{className:`text-[11px] text-danger flex items-center gap-1`,children:[l(y,{className:`h-3 w-3`}),x]}),l(`div`,{className:`flex justify-end`,children:r(`button`,{onClick:()=>{S(null),k.mutate()},disabled:k.isPending,className:`rounded bg-danger px-3 py-1.5 text-xs font-medium text-white hover:bg-danger/90 disabled:opacity-50 inline-flex items-center gap-1`,children:[k.isPending?l(C,{className:`h-3 w-3 animate-spin`}):l(b,{className:`h-3 w-3`}),`Disable 2FA`]})})]})]})]})}export{O as MyAccessPage};
@@ -1 +0,0 @@
1
- import{Ui as e,ar as t,ba as n,bi as r,cr as i,hr as a,ir as o,lr as s,mr as c,na as l,nr as u,or as d,ot as f,pr as p,rr as m,sr as h,st as g,tr as ee,ur as _,xa as v,ya as y}from"./src-1618avTR.js";import{I as b,K as x,S,W as C,Z as w,b as T,o as E,x as D,z as te}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js";import{p as O}from"./player-overlays-BK-_BrgW.js";import{o as k,s as A}from"./src-D7qnpDWK.js";import{n as j,t as ne}from"./rotate-ccw-wFxrc6l5.js";import{t as M}from"./copy-D905mbwE.js";import{n as re,t as N}from"./AddonCollectionPage-wr63l6CJ.js";import{t as ie}from"./refresh-cw-D6BYsgNx.js";import{t as P}from"./server-DOFYQi_I.js";import{t as ae}from"./sparkles-DBG9vp4A.js";import{t as oe}from"./square-BY1YswJx.js";import{t as se}from"./wifi-5-JmPgz2.js";import{D as F,F as ce,V as I,_ as L,b as le,i as ue,o as R,w as z,x as B,y as V}from"./index-NMHNU-e8.js";import{t as H}from"./AdminPage-vtcsGqRq.js";import{t as U}from"./AdminTabs-m8tLAejz.js";var de=I(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),fe=I(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),W=I(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]);w();var G=5e3,pe={connected:!1,endpoint:null};function me(e){let t=new Map;for(let n of e){let e=n?.manifest;e?.id&&t.set(e.id,e.packageDisplayName??e.name??e.id)}return t}function he(){let e=E(),t=g({capName:`network-access`},{refetchInterval:G}),n=f(void 0,{refetchInterval:G}),r=C(()=>me(n.data??[]),[n.data]),i=C(()=>(t.data??[]).map(e=>({addonId:e.addonId,displayName:r.get(e.addonId)??e.addonId,isActive:e.isActive})),[t.data,r]),[o,s]=x(null),[l,u]=x({}),d=(t,n)=>{let r=n?.addonId;e.invalidateQueries({queryKey:[[`networkAccess`,`getStatus`],{input:{addonId:r},type:`query`}]}),s(null),u(e=>{if(r===void 0||!(r in e))return e;let t={...e};return delete t[r],t})},p=(e,t)=>{s(null);let n=t?.addonId;if(n===void 0)return;let r=e instanceof Error?e.message:String(e);u(e=>({...e,[n]:r}))},m=c({onSuccess:d,onError:p}),h=a({onSuccess:d,onError:p});return D(N,{title:`Remote Access`,subtitle:`Public-facing tunnels that expose this hub to the internet (Cloudflare Tunnel, ngrok, …). Settings, Logs and Events are docked under every provider.`,pageIcon:z,itemIcon:z,capability:`network-access`,installButtonLabel:`Add tunnel`,items:i,isLoading:t.isLoading,emptyTitle:`No remote-access providers installed`,emptyDescription:`Install a tunnel addon (e.g. @camstack/addon-cloudflare) to expose this hub publicly.`,renderStatusBadges:e=>D(ge,{addonId:e.addonId}),itemError:e=>l[e.addonId]??null,renderPrimaryAction:e=>D(_e,{addonId:e.addonId,busyId:o,onStart:e=>{s(e),m.mutate({addonId:e})},onStop:e=>{s(e),h.mutate({addonId:e})}})})}function K(e){let{data:t}=p({addonId:e},{refetchInterval:G,retry:!1}),n=t?A.safeParse(t):null;return n?.success?n.data:pe}function ge({addonId:e}){let t=K(e);return S(T,{children:[D(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${t.connected?`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`:`bg-foreground-subtle/15 text-foreground-subtle`}`,children:t.connected?`Connected`:`Disconnected`}),t.endpoint&&S(`a`,{href:t.endpoint.url,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`text-[10px] text-emerald-700 dark:text-emerald-300 hover:underline flex items-center gap-1`,children:[D(F,{className:`h-3 w-3`}),t.endpoint.url]})]})}function _e({addonId:e,busyId:t,onStart:n,onStop:r}){let i=K(e),a=t===e;return i.connected?S(v,{size:`sm`,variant:`secondary`,disabled:a,onClick:()=>r(e),children:[a?D(B,{className:`h-3 w-3 animate-spin`}):D(oe,{className:`h-3 w-3`}),`Stop`]}):S(v,{size:`sm`,variant:`primary`,disabled:a,onClick:()=>n(e),children:[a?D(B,{className:`h-3 w-3 animate-spin`}):D(re,{className:`h-3 w-3`}),`Start`]})}w();var q=3e4;function ve(e){let t=new Map;for(let n of e){let e=n?.manifest;e?.id&&t.set(e.id,e.packageDisplayName??e.name??e.id)}return t}function ye(e){let t=[];for(let n of e)typeof n.urls==`string`?t.push(n.urls):t.push(...n.urls);return t}function be(){let e=g({capName:`turn-provider`},{refetchInterval:q}),t=f(void 0,{refetchInterval:q}),n=r(),i=n.data??[],a=C(()=>ve(t.data??[]),[t.data]);return D(N,{title:`TURN Servers`,subtitle:`ICE servers used for WebRTC NAT traversal. Multiple providers can coexist — the WebRTC layer concatenates servers from all enabled providers per session.`,pageIcon:L,itemIcon:L,capability:`turn-provider`,installButtonLabel:`Add provider`,items:C(()=>(e.data??[]).map(e=>({addonId:e.addonId,displayName:a.get(e.addonId)??e.addonId,isActive:e.isActive})),[e.data,a]),isLoading:e.isLoading,emptyTitle:`No TURN providers installed`,emptyDescription:`Install a TURN addon (e.g. @camstack/addon-cloudflare) to enable WebRTC behind restrictive NATs.`,renderExpandedPanel:e=>D(xe,{addonId:e.addonId,enabled:e.isActive}),trailing:S(y,{children:[S(`div`,{className:`px-4 py-3 border-b border-border flex items-center justify-between`,children:[S(`div`,{children:[D(`div`,{className:`text-sm font-semibold`,children:`Combined ICE server list`}),D(`div`,{className:`text-xs text-foreground-subtle`,children:`What the WebRTC layer fetches per-session.`})]}),D(v,{size:`sm`,variant:`secondary`,onClick:()=>n.refetch(),disabled:n.isFetching,children:`Refresh`})]}),D(`div`,{className:`p-4`,children:i.length===0?D(`div`,{className:`text-xs text-foreground-subtle`,children:`No servers from enabled providers.`}):D(`div`,{className:`flex flex-col gap-3`,children:i.map((e,t)=>{let n=Array.isArray(e.urls)?e.urls:[e.urls];return S(`div`,{className:`rounded border border-border bg-surface`,children:[(e.username||e.credential)&&S(`div`,{className:`px-3 py-1.5 border-b border-border text-[10px] font-mono text-foreground-subtle flex items-center gap-3`,children:[e.username&&S(`span`,{children:[D(`span`,{className:`text-foreground-subtle`,children:`user:`}),` `,D(`span`,{className:`text-foreground`,children:e.username})]}),e.credential&&S(`span`,{children:[D(`span`,{className:`text-foreground-subtle`,children:`credential:`}),` `,D(`span`,{className:`text-foreground`,children:`••••••••`})]})]}),D(`ul`,{className:`divide-y divide-border`,children:n.map(e=>D(`li`,{className:`px-3 py-1.5 font-mono text-xs text-foreground break-all`,children:e},e))})]},t)})})})]})})}function xe({addonId:e,enabled:t}){let n=r({addonId:e},{enabled:t,retry:!1}),i=C(()=>ye(n.data??[]),[n.data]);return!t||i.length===0?null:S(`div`,{className:`rounded-lg border border-border bg-surface p-3`,children:[S(`div`,{className:`text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide mb-2`,children:[`Discovered ICE servers (`,i.length,`)`]}),D(`div`,{className:`flex flex-wrap gap-1`,children:i.map(e=>D(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] font-mono bg-foreground-subtle/10 text-foreground`,children:e},e))})]})}w();var Se={lan:L,wifi:se,docker:j,vpn:le,loopback:P,other:P},Ce={lan:`LAN`,wifi:`Wi-Fi`,docker:`Docker`,vpn:`VPN`,loopback:`Loopback`,other:`Other`},we=[`lan`,`wifi`,`vpn`,`docker`,`other`,`loopback`];function Te(e){let{interfaces:t,disabled:n,hideLoopback:r,ipv4Only:i,emptyMessage:a}=e,o=C(()=>t.filter(e=>!(r&&e.kind===`loopback`||i&&e.family!==`IPv4`)),[t,r,i]),s=C(()=>{let e=new Map;for(let t of o){let n=e.get(t.kind)??[];n.push(t),e.set(t.kind,n)}return we.filter(t=>e.has(t)).map(t=>({kind:t,items:e.get(t)}))},[o]),c=t=>e.mode===`single`?e.value===t:e.value.includes(t),l=t=>{if(n||t.kind===`loopback`)return;if(e.mode===`single`){e.onChange(e.value===t.address?null:t.address);return}let r=new Set(e.value);r.has(t.address)?r.delete(t.address):r.add(t.address),e.onChange([...r])};return o.length===0?D(`div`,{className:`text-xs text-foreground-subtle italic`,children:a??`No addresses available.`}):D(`div`,{className:`flex flex-col gap-3`,children:s.map(({kind:t,items:r})=>S(`div`,{className:`rounded-md border border-border overflow-hidden`,children:[S(`div`,{className:`flex items-center gap-2 px-3 py-1.5 bg-surface-hover/30 border-b border-border`,children:[D(Se[t]??P,{className:`h-3.5 w-3.5 text-foreground-subtle`}),D(`span`,{className:`text-[11px] font-semibold uppercase tracking-wide text-foreground-subtle`,children:Ce[t]??t}),S(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`· `,r.length]})]}),D(`ul`,{className:`divide-y divide-border`,children:r.map(t=>{let r=c(t.address),i=t.kind===`loopback`,a=!t.plausible&&!i;return S(`li`,{className:`flex items-center gap-3 px-3 py-2 ${i?`opacity-60 cursor-not-allowed`:n?`opacity-60`:a?`cursor-pointer hover:bg-surface-hover/30 bg-amber-500/[0.04]`:`cursor-pointer hover:bg-surface-hover/30`}`,onClick:()=>l(t),children:[D(`span`,{className:`flex items-center justify-center h-4 w-4 rounded ${e.mode===`single`?`rounded-full`:`rounded`} border ${r?`border-primary bg-primary text-primary-foreground`:`border-border bg-surface`}`,children:r&&D(ce,{className:`h-3 w-3`})}),S(`div`,{className:`flex-1 min-w-0 ${a?`text-foreground-subtle`:``}`,children:[S(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[D(`span`,{className:`font-mono text-xs font-semibold ${a?`text-foreground-subtle`:`text-foreground`}`,children:t.name}),D(`span`,{className:`text-[10px] rounded px-1.5 py-0.5 bg-foreground-subtle/10 text-foreground-subtle font-mono`,children:t.family}),t.preferred&&D(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium bg-primary/15 text-primary`,children:`Auto-preferred`}),i&&D(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium bg-foreground-subtle/15 text-foreground-subtle`,children:`Always included`}),a&&S(`span`,{className:`inline-flex items-center gap-1 text-[10px] rounded-full px-2 py-0.5 font-medium bg-amber-500/15 text-amber-700 dark:text-amber-300`,title:t.plausibleReason||void 0,children:[D(R,{className:`h-2.5 w-2.5`}),`Unlikely usable`]})]}),S(`div`,{className:`text-xs text-foreground-subtle mt-0.5 font-mono break-all`,children:[t.address,t.cidr&&t.cidr!==t.address?` (${t.cidr})`:``]})]})]},`${t.name}-${t.family}-${t.address}`)})})]},t))})}w();var J={"lan-ipv4":`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`,"lan-ipv6":`bg-violet-500/15 text-violet-700 dark:text-violet-300`,public:`bg-blue-500/15 text-blue-700 dark:text-blue-300`,loopback:`bg-foreground-subtle/15 text-foreground-subtle`};function Ee(){let e=E(),n=O(),r=m(void 0,{refetchInterval:3e4}),i=ee(void 0),a=t({onSuccess:()=>{e.invalidateQueries({queryKey:[[`localNetwork`]]})}}),s=o({onSuccess:t=>{f(t.addresses),e.invalidateQueries({queryKey:[[`localNetwork`]]})}}),c=C(()=>r.data?.interfaces??[],[r.data]),l=u({port:typeof window<`u`?Number(window.location.port)||(window.location.protocol===`https:`?443:80):4e3,scheme:typeof window<`u`&&window.location.protocol===`https:`?`https`:`http`},{refetchInterval:3e4}),[d,f]=x([]),[p,h]=x(!1);te(()=>{!p&&i.data&&(f(i.data.addresses),h(!0))},[i.data,p]);let g=i.data?.addresses??[],_=C(()=>{if(d.length!==g.length)return!0;let e=[...d].toSorted(),t=[...g].toSorted();return e.some((e,n)=>e!==t[n])},[d,g]),b=()=>{a.mutate({addresses:[...d]})},w=()=>{f(g)},T=()=>{f([])},k=()=>{r.refetch(),l.refetch(),i.refetch()},A=async()=>{try{let e=await n.raceConnectionEndpoints({perCandidateTimeoutMs:1500});console.info(`[network-addresses] race result`,e)}catch(e){console.warn(`[network-addresses] race failed`,e)}},j=l.data?.endpoints??[];return S(H,{children:[S(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[D(`p`,{className:`text-xs text-foreground-subtle max-w-2xl`,children:`Pick the local addresses SDK clients should race for the fastest path to this hub. Empty selection (auto) lets every non-loopback / non-link-local interface participate.`}),S(`div`,{className:`flex items-center gap-2 shrink-0`,children:[S(v,{size:`sm`,variant:`secondary`,onClick:k,disabled:r.isLoading,children:[D(ie,{className:`h-3 w-3 ${r.isLoading?`animate-spin`:``}`}),`Refresh`]}),D(v,{size:`sm`,variant:`secondary`,onClick:A,children:`Probe race`})]})]}),S(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[S(y,{children:[S(`div`,{className:`px-4 py-3 border-b border-border flex items-center justify-between`,children:[S(`div`,{children:[D(`div`,{className:`text-sm font-semibold`,children:`Allowed addresses`}),D(`div`,{className:`text-xs text-foreground-subtle`,children:d.length===0?`Auto — every non-loopback / non-link-local interface participates.`:`${d.length} pinned`})]}),S(`div`,{className:`flex items-center gap-1`,children:[S(v,{size:`sm`,variant:`secondary`,onClick:()=>s.mutate(void 0),disabled:s.isPending||a.isPending,title:`Re-run the auto-detection heuristic + overwrite the current allowlist with the best matches.`,children:[D(ae,{className:`h-3 w-3`}),s.isPending?`Detecting…`:`Best match`]}),S(v,{size:`sm`,variant:`secondary`,onClick:T,disabled:d.length===0||a.isPending,children:[D(ne,{className:`h-3 w-3`}),`Clear`]}),_&&D(v,{size:`sm`,variant:`secondary`,onClick:w,disabled:a.isPending,children:`Discard`}),S(v,{size:`sm`,variant:`primary`,onClick:b,disabled:!_||a.isPending,children:[D(fe,{className:`h-3 w-3`}),a.isPending?`Saving…`:`Save`]})]})]}),D(`div`,{className:`p-4`,children:D(Te,{mode:`multiple`,interfaces:c,value:d,onChange:f,disabled:a.isPending,emptyMessage:r.isLoading?`Loading interfaces…`:`No interfaces detected.`})})]}),S(y,{children:[S(`div`,{className:`px-4 py-3 border-b border-border`,children:[D(`div`,{className:`text-sm font-semibold`,children:`Connection endpoints — priority order`}),D(`div`,{className:`text-xs text-foreground-subtle`,children:`Live preview of the ranked candidate list the SDK would race against. Updates with each Save.`})]}),D(`div`,{className:`p-4`,children:j.length===0?D(`div`,{className:`text-xs text-foreground-subtle italic`,children:l.isLoading?`Loading…`:`No endpoints available.`}):D(`ul`,{className:`space-y-1 text-xs`,children:j.map(e=>S(`li`,{className:`flex items-center gap-2 flex-wrap ${e.plausible?``:`opacity-80`}`,children:[D(`span`,{className:`font-mono text-[10px] w-10 text-foreground-subtle`,children:String(e.priority).padStart(4,`0`)}),D(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${J[e.kind]??J.loopback}`,children:e.kind}),e.interfaceKind!==`lan`&&e.interfaceKind!==`public`&&D(`span`,{className:`text-[10px] rounded px-1.5 py-0.5 bg-foreground-subtle/10 text-foreground-subtle font-medium uppercase`,children:e.interfaceKind}),!e.plausible&&e.interfaceKind!==`loopback`&&S(`span`,{className:`inline-flex items-center gap-1 text-[10px] rounded-full px-2 py-0.5 font-medium bg-amber-500/15 text-amber-700 dark:text-amber-300`,title:e.plausibleReason||void 0,children:[D(R,{className:`h-2.5 w-2.5`}),`Unlikely usable`]}),D(`span`,{className:`font-mono break-all ${e.plausible?`text-foreground`:`text-foreground-subtle`}`,children:e.baseUrl}),S(`span`,{className:`text-foreground-subtle`,children:[`— `,e.label]})]},`${e.priority}-${e.baseUrl}`))})})]})]})]})}w();var De={mesh:`bg-violet-500/15 text-violet-700 dark:text-violet-300`,public:`bg-blue-500/15 text-blue-700 dark:text-blue-300`},Y=5e3,Oe=3e4,ke={joined:!1,meshIp:``,magicDnsHostname:``,peerCount:0,endpoints:[],tenantName:``,magicDnsSuffix:``,userLogin:null,controlPlaneUrl:``,keyExpiry:null};function Ae(e){let t=new Map;for(let n of e){let e=n?.manifest;e?.id&&t.set(e.id,e.packageDisplayName??e.name??e.id)}return t}function je(){let e=g({capName:`mesh-network`},{refetchInterval:Y}),t=f(void 0,{refetchInterval:Y}),n=C(()=>Ae(t.data??[]),[t.data]);return D(N,{title:`Mesh Networks`,subtitle:`Private VPN meshes that connect CamStack to your other devices (Tailscale, Headscale, …). Each provider can also expose this hub publicly via its ingress (Tailscale Funnel).`,pageIcon:j,itemIcon:L,capability:`mesh-network`,installButtonLabel:`Add mesh`,items:C(()=>(e.data??[]).map(e=>({addonId:e.addonId,displayName:n.get(e.addonId)??e.addonId,isActive:e.isActive})),[e.data,n]),isLoading:e.isLoading,emptyTitle:`No mesh-network providers installed`,emptyDescription:`Install a mesh addon (e.g. @camstack/addon-tailscale) to join this hub into a private VPN mesh.`,renderStatusBadges:e=>D(Me,{addonId:e.addonId}),renderPrimaryAction:e=>D(Z,{addonId:e.addonId}),renderExpandedPanel:e=>D(Ne,{addonId:e.addonId})})}function X(e){let{data:t,isLoading:n}=d({addonId:e},{refetchInterval:Y,retry:!1}),r=t?k.safeParse(t):null;return{status:r?.success?r.data:ke,isLoading:n}}function Me({addonId:e}){let{status:t}=X(e);return S(T,{children:[D(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${t.joined?`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`:`bg-foreground-subtle/15 text-foreground-subtle`}`,children:t.joined?`Joined`:`Not joined`}),t.joined&&S(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium bg-foreground-subtle/15 text-foreground-subtle`,children:[t.peerCount,` peer`,t.peerCount===1?``:`s`]})]})}function Z({addonId:e}){let t=E(),[n,r]=x(!1),[i,a]=x(null),o=O(),{status:c}=X(e),l=b(()=>{t.invalidateQueries({queryKey:[[`meshNetwork`]]})},[t]),u=_(),d=h({onSuccess:l}),f=s({onSuccess:l}),p=b(async()=>{r(!0);let t={cancelled:!1};a(t);try{let n=await u.mutateAsync({addonId:e});if(t.cancelled)return;n.loginUrl&&window.open(n.loginUrl,`_blank`,`noopener,noreferrer`);let r=Date.now();for(;!t.cancelled&&(await Re(2e3),!t.cancelled);){let t=await o.trpcClient.meshNetwork.getStatus.query({addonId:e}).catch(()=>null),n=t?k.safeParse(t):null;if(n?.success&&n.data.joined){l();break}if(Date.now()-r>6e5)break}}finally{r(!1),a(null)}},[e,l,u,o]),m=b(()=>{i&&(i.cancelled=!0),r(!1),a(null)},[i]);return D(T,{children:c.joined?S(T,{children:[S(v,{size:`sm`,variant:`secondary`,disabled:d.isPending,onClick:()=>d.mutate({addonId:e}),children:[d.isPending?D(B,{className:`h-3 w-3 animate-spin`}):D(V,{className:`h-3 w-3`}),`Disconnect`]}),S(v,{size:`sm`,variant:`ghost`,disabled:f.isPending,onClick:()=>f.mutate({addonId:e}),children:[f.isPending?D(B,{className:`h-3 w-3 animate-spin`}):D(W,{className:`h-3 w-3`}),`Log out`]})]}):n?S(v,{size:`sm`,variant:`ghost`,onClick:m,children:[D(ue,{className:`h-3 w-3 mr-1`}),` Cancel`]}):S(T,{children:[S(v,{size:`sm`,variant:`primary`,onClick:()=>void p(),children:[D(de,{className:`h-3 w-3`}),`Connect`]}),S(v,{size:`sm`,variant:`ghost`,disabled:f.isPending,onClick:()=>f.mutate({addonId:e}),children:[f.isPending?D(B,{className:`h-3 w-3 animate-spin`}):D(W,{className:`h-3 w-3`}),`Log out`]})]})})}function Ne({addonId:t}){let{status:n}=X(t),r=i({addonId:t},{refetchInterval:Oe,retry:!1});return S(`div`,{className:`rounded-lg border border-border bg-surface`,children:[S(`div`,{className:`p-4 space-y-4`,children:[n.error&&D(e,{message:n.error}),D(Pe,{status:n}),n.endpoints.length>0&&S(`div`,{className:`space-y-1.5`,children:[D(`div`,{className:`text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide`,children:`Endpoints`}),n.endpoints.map(e=>S(`div`,{className:`flex items-center gap-2 text-xs flex-wrap`,children:[S(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${De[e.scope]??`bg-foreground-subtle/15 text-foreground-subtle`}`,children:[e.scope===`public`?D(z,{className:`inline h-2.5 w-2.5 mr-0.5`}):null,e.label]}),S(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`text-emerald-700 dark:text-emerald-300 hover:underline break-all flex items-center gap-1`,children:[D(F,{className:`h-3 w-3 shrink-0`}),e.url]})]},e.id))]})]}),D(`div`,{className:`border-t border-border`,children:D(Ie,{peers:r.data?.peers??[],loading:r.isLoading})})]})}function Pe({status:e}){return D(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-1.5`,children:[{label:`Tenant`,value:e.tenantName||`—`},{label:`User`,value:e.userLogin??`—`},{label:`Control plane`,value:e.controlPlaneUrl||`—`},{label:`Mesh IP`,value:e.meshIp||`—`,mono:!0},{label:`MagicDNS`,value:e.magicDnsHostname||`—`,mono:!0},{label:`DNS suffix`,value:e.magicDnsSuffix||`—`,mono:!0},{label:`Peers`,value:String(e.peerCount)},{label:`Key expiry`,value:e.keyExpiry?Fe(e.keyExpiry):`—`}].map(e=>S(`div`,{className:`flex items-baseline justify-between gap-3 text-xs`,children:[D(`span`,{className:`text-foreground-subtle shrink-0`,children:e.label}),D(`span`,{className:`text-foreground truncate ${e.mono?`font-mono`:``}`,children:e.value})]},e.label))})}function Fe(e){let t=e-Date.now();if(t<0)return`Expired ${$(e)}`;let n=Math.floor(t/864e5);if(n>60)return new Date(e).toLocaleDateString();if(n>1)return`in ${n} days`;let r=Math.floor(t/36e5);return r>1?`in ${r}h`:`in ${Math.max(1,Math.floor(t/6e4))} min`}function Ie({peers:e,loading:t}){let r=C(()=>e.map(e=>({...e,_id:e.id})),[e]),i=b(e=>{e&&navigator.clipboard?.writeText(e)},[]),a=C(()=>[{key:`hostname`,header:`Hostname`,render:e=>S(`div`,{className:`flex flex-col`,children:[S(`div`,{className:`flex items-center gap-1.5`,children:[D(`span`,{className:`font-medium text-foreground`,children:e.hostname||`(unknown)`}),e.isSelf&&D(n,{variant:`info`,children:`self`}),e.exitNodeOption&&D(n,{variant:`warning`,children:`exit-node`})]}),e.userLogin&&D(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:e.userLogin})]})},{key:`magicDns`,header:`MagicDNS`,render:e=>e.magicDns?S(`div`,{className:`flex items-center gap-1`,children:[D(`span`,{className:`font-mono text-xs truncate`,children:e.magicDns}),D(`button`,{onClick:()=>i(e.magicDns),className:`p-0.5 hover:bg-foreground-subtle/10 rounded`,"aria-label":`Copy MagicDNS`,children:D(M,{className:`h-3 w-3 text-foreground-subtle`})})]}):D(`span`,{className:`text-foreground-subtle`,children:`—`})},{key:`addresses`,header:`IP`,render:e=>{let t=e.addresses[0]??``;return t?S(`div`,{className:`flex items-center gap-1`,children:[D(`span`,{className:`font-mono text-xs`,children:t}),D(`button`,{onClick:()=>i(t),className:`p-0.5 hover:bg-foreground-subtle/10 rounded`,"aria-label":`Copy IP`,children:D(M,{className:`h-3 w-3 text-foreground-subtle`})})]}):D(`span`,{className:`text-foreground-subtle`,children:`—`})}},{key:`connection`,header:`Connection`,render:e=>S(`div`,{className:`flex items-center gap-1.5`,children:[D(n,{variant:Le(e.connection),children:e.connection}),e.relay&&D(`span`,{className:`text-[10px] text-foreground-subtle font-mono`,children:e.relay})]})},{key:`routes`,header:`Routes`,render:e=>e.advertisedRoutes.length>0?D(`span`,{className:`text-[10px] font-mono text-foreground-subtle truncate`,children:e.advertisedRoutes.join(`, `)}):D(`span`,{className:`text-foreground-subtle`,children:`—`})},{key:`tx`,header:`TX / RX`,render:e=>S(`span`,{className:`text-[10px] text-foreground-subtle font-mono`,children:[`↑ `,Q(e.txBytes),` · ↓ `,Q(e.rxBytes)]})},{key:`lastSeen`,header:`Last seen`,render:e=>D(`span`,{className:`text-[10px] text-foreground-subtle`,children:e.lastSeenMs>0?$(e.lastSeenMs):`—`})}],[i]);return t&&e.length===0?S(`div`,{className:`p-4 text-xs text-foreground-subtle`,children:[D(B,{className:`h-3 w-3 animate-spin inline mr-1`}),` Loading peers…`]}):e.length===0?D(`div`,{className:`p-4 text-xs text-foreground-subtle`,children:`No peers visible — your tailnet may be empty or the host is not joined.`}):D(`div`,{className:`p-4`,children:D(l,{columns:a,rows:r,rowKey:e=>e._id,minWidthPx:820})})}function Le(e){return e===`direct`?`success`:e===`relay`?`warning`:`info`}function Q(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)}MB`:`${(e/1024/1024/1024).toFixed(2)}GB`}function $(e){let t=Date.now()-e;return t<6e4?`just now`:t<36e5?`${Math.round(t/6e4)}m ago`:t<864e5?`${Math.round(t/36e5)}h ago`:`${Math.round(t/864e5)}d ago`}function Re(e){return new Promise(t=>setTimeout(t,e))}function ze(){return D(`div`,{className:`flex flex-col p-4`,children:D(U,{tabs:[{id:`addresses`,label:`Network Addresses`,icon:P,content:D(Ee,{})},{id:`remote-access`,label:`Remote Access`,icon:z,content:D(he,{})},{id:`mesh`,label:`Mesh Networks`,icon:j,content:D(je,{})},{id:`turn`,label:`TURN Servers`,icon:L,content:D(be,{})}]})})}export{ze as NetworkPage};
@@ -1 +0,0 @@
1
- import{$r as e,Ar as t,Br as n,C as r,Cr as i,Dr as a,Ea as o,Er as s,Fr as c,Gr as l,Hi as u,Hr as d,Ir as f,Ji as p,Jr as m,Ki as h,Nr as g,Or as _,Pr as v,Q as y,Qi as b,Rr as x,T as S,Tr as C,Ur as w,X as T,Xr as E,Yi as D,Yr as O,Zi as k,_ as A,ai as j,ba as M,ci as N,ea as P,ei as F,fi as ee,gi as te,jr as ne,kr as re,mi as ie,oi as ae,pi as oe,qi as se,qr as ce,si as le,ta as ue,ui as de,zr as fe}from"./src-1618avTR.js";import{G as pe,I as me,K as I,S as L,T as he,W as R,Z as z,a as ge,b as B,o as V,x as H,z as U}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js";import{p as _e}from"./player-overlays-BK-_BrgW.js";import{D as W,O as ve}from"./src-D7qnpDWK.js";import{t as ye}from"./download-CRt3yUK3.js";import{i as be,n as xe,r as Se,t as Ce}from"./AddLocationWizard-BSAorNxx.js";import{n as we,r as Te,t as Ee}from"./zap--D6I-5eT.js";import{t as De}from"./pencil-CpJIJ9Uy.js";import{t as Oe}from"./plus-OLMgcI14.js";import{t as ke}from"./refresh-cw-D6BYsgNx.js";import{t as Ae}from"./search-5vt1VPCs.js";import{t as je}from"./server-DOFYQi_I.js";import{t as Me}from"./square-check-big-rAJ2A2-o.js";import{t as Ne}from"./square-BY1YswJx.js";import{A as Pe,F as Fe,G as Ie,M as Le,P as Re,V as G,i as ze,j as Be,k as K,o as Ve,s as He,w as Ue,x as q}from"./index-NMHNU-e8.js";import{t as We}from"./AdminPage-vtcsGqRq.js";import{r as Ge}from"./useDevice-DHi9vYPM.js";import{t as J}from"./useEventInvalidation-orMzg97E.js";import{n as Ke}from"./format-size-CO9d3C3-.js";import{t as qe}from"./NodeAddonsSettingsPanel-DBNKikBW.js";import{a as Y,i as Je,n as Ye,r as X,t as Xe}from"./esm-B4H3LqM1.js";var Ze=G(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Qe=G(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),$e=G(`flame`,[[`path`,{d:`M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z`,key:`96xj49`}]]),et=G(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]);z();var tt=`enabledDecoderNodes`,nt=`enabledNodes`,rt=`enabledAudioNodes`,it=[`hub`];function at(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function ot(e){let t=e.sections;if(!Array.isArray(t))return e;let n={};for(let e of t){if(!e||typeof e!=`object`)continue;let t=e.fields;if(Array.isArray(t))for(let e of t){if(!e||typeof e!=`object`)continue;let t=e.key;typeof t==`string`&&(t in n||(n[t]=e.value))}}return n}function st(e,t,n){let r=e[t];return(at(r)?r:it).includes(n)}function ct(e,t){if(e==null)return{decode:!0,pipeline:!0,audio:!0};let n=ot(e);return{decode:st(n,tt,t),pipeline:st(n,nt,t),audio:st(n,rt,t)}}var lt=`pipeline-orchestrator`;function ut({selectedNodeId:e,onSelect:t,refreshToken:n}){let{data:r}=i(void 0),{data:a}=ce(void 0),{data:o}=T({addonId:lt}),s=new Map;for(let e of a??[])s.set(e.agentNodeId,(s.get(e.agentNodeId)??0)+1);let c=r??[],l=c.filter(e=>e.isOnline).length,u=c.filter(e=>!e.isOnline).length;return L(`div`,{className:`flex flex-col h-full`,children:[L(`button`,{type:`button`,onClick:()=>t(tr),className:`flex items-center gap-3 px-4 py-3 border-b border-border text-left transition-colors ${e===`__cluster__`?`bg-primary/10 text-primary`:`text-foreground hover:bg-surface-hover`}`,children:[H(Ue,{className:`h-4 w-4 flex-shrink-0`}),L(`div`,{className:`min-w-0 flex-1`,children:[H(`div`,{className:`text-xs font-semibold truncate`,children:`Cluster`}),H(`div`,{className:`text-[10px] text-foreground-subtle`,children:`Balancer + failover + assignments`})]})]}),H(`div`,{className:`flex-1 overflow-y-auto`,children:c.map(n=>{let r=e===n.id,i=s.get(n.id)??0,a=n.isHub?je:K,c=ct(o,n.id);return L(`button`,{type:`button`,onClick:()=>t(n.id),className:`flex items-center gap-3 w-full px-4 py-3 border-b border-border text-left transition-colors ${r?`bg-primary/10 text-primary`:`text-foreground hover:bg-surface-hover`}`,children:[H(a,{className:`h-4 w-4 flex-shrink-0`}),L(`div`,{className:`min-w-0 flex-1`,children:[L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`text-xs font-semibold truncate`,children:n.name}),n.isHub&&H(`span`,{className:`text-[9px] uppercase tracking-wider text-foreground-subtle border border-border rounded px-1 py-0.5`,children:`hub`}),!n.isOnline&&H(`span`,{className:`h-1.5 w-1.5 rounded-full bg-destructive flex-shrink-0`}),n.isOnline&&H(`span`,{className:`h-1.5 w-1.5 rounded-full bg-success flex-shrink-0`})]}),L(`div`,{className:`text-[10px] text-foreground-subtle flex items-center gap-2 mt-0.5`,children:[L(`span`,{children:[n.cpuCores,` cores`]}),H(`span`,{children:`•`}),L(`span`,{children:[Math.round(n.memoryMB/1024),` GB`]}),i>0&&L(B,{children:[H(`span`,{children:`•`}),L(`span`,{className:`inline-flex items-center gap-0.5 text-foreground`,children:[H(we,{className:`h-2.5 w-2.5`}),i]})]})]}),L(`div`,{className:`mt-0.5 flex items-center gap-1`,children:[H(M,{variant:c.decode?`success`:`danger`,className:`px-1 py-0 text-[9px] leading-3`,title:c.decode?`Decode: enabled`:`Decode: not enabled (enabledDecoderNodes)`,children:`Dec`}),H(M,{variant:c.pipeline?`success`:`danger`,className:`px-1 py-0 text-[9px] leading-3`,title:c.pipeline?`Pipeline: enabled`:`Pipeline: not enabled (enabledNodes)`,children:`Pipe`}),H(M,{variant:c.audio?`success`:`danger`,className:`px-1 py-0 text-[9px] leading-3`,title:c.audio?`Audio: enabled`:`Audio: not enabled (enabledAudioNodes)`,children:`Aud`})]})]})]},n.id)})}),L(`div`,{className:`px-4 py-2 border-t border-border text-[10px] text-foreground-subtle flex items-center justify-between`,children:[L(`span`,{children:[l,` online`]}),u>0&&L(`span`,{className:`text-destructive`,children:[u,` offline`]})]})]})}function dt({nodeId:e,refreshToken:t}){let{data:n}=i(void 0),r=n?.find(t=>t.id===e),a=se(`pipeline.runner-load-snapshot`,t=>t.nodeId===e)?.load??null;return r?L(`div`,{className:`px-6 py-4 border-b border-border`,children:[L(`div`,{className:`flex items-center gap-2 mb-1`,children:[H(`h2`,{className:`text-base font-semibold text-foreground`,children:r.name}),r.isOnline?H(`span`,{className:`text-[10px] px-2 py-0.5 rounded-full bg-success/10 text-success`,children:`online`}):H(`span`,{className:`text-[10px] px-2 py-0.5 rounded-full bg-destructive/10 text-destructive`,children:`offline`}),r.isHub&&H(`span`,{className:`text-[9px] uppercase tracking-wider text-foreground-subtle border border-border rounded px-1 py-0.5`,children:`hub`})]}),L(`div`,{className:`text-[11px] text-foreground-subtle flex items-center gap-2 flex-wrap`,children:[H(`span`,{children:r.cpuModel??`CPU`}),H(`span`,{children:`•`}),L(`span`,{children:[r.cpuCores,` cores`]}),H(`span`,{children:`•`}),L(`span`,{children:[Math.round(r.memoryMB/1024),` GB`]}),a&&L(B,{children:[H(`span`,{children:`•`}),L(`span`,{children:[a.attachedCameras,` cameras (`,a.activeCameras,` active)`]}),H(`span`,{children:`•`}),L(`span`,{children:[a.avgInferenceTimeMs.toFixed(0),`ms avg inference`]}),H(`span`,{children:`•`}),L(`span`,{children:[`queue `,a.queueDepthTotal]}),a.hardware.hasGpu&&L(B,{children:[H(`span`,{children:`•`}),H(`span`,{className:`text-success`,children:`GPU`})]})]})]})]}):H(`div`,{className:`px-6 py-4 border-b border-border`,children:L(`div`,{className:`text-xs text-foreground-subtle`,children:[`Node not found: `,e]})})}function ft({refreshToken:e,nodeId:t}){let[r,i]=I(new Map),{nodes:a}=h();D(`pipeline.camera-metrics-snapshot`,e=>{let t=e.data;typeof t?.deviceId==`number`&&i(e=>{let n=new Map(e);return n.set(t.deviceId,t),n})});let{data:o}=n(void 0),s=R(()=>{let e=new Map;for(let t of o??[])e.set(t.nodeId,t.deviceCount);return e},[o]),c=R(()=>{let e=new Map,t=Date.now()-3e4;for(let n of r.values()){if(n.timestamp<t)continue;let r=n.nodeId??`hub`,i=e.get(r)??{attachedCameras:0,activeCameras:0,totalFps:0,totalInferenceWeighted:0,queueDepth:0};i.attachedCameras++,n.metrics.phase===`active`&&i.activeCameras++,i.totalFps+=n.metrics.actualFps,i.totalInferenceWeighted+=n.metrics.avgInferenceTimeMs,i.queueDepth+=n.metrics.queueDepth,e.set(r,i)}return e},[r]),l=R(()=>{let e=new Map;for(let t of a)e.set(t.id,t.shortName);return e},[a]),u=R(()=>{let e=0,t=0,n=0,r=0,i=0;for(let a of c.values())e+=a.attachedCameras,t+=a.activeCameras,n+=a.totalFps,r+=a.totalInferenceWeighted,i+=a.queueDepth;let o=e>0?r/e:0;return{totalAgents:a.length,onlineAgents:a.filter(e=>e.isOnline).length,attachedCameras:e,activeCameras:t,avgInferenceTimeMs:o,queueDepth:i,totalFps:n}},[c,a]);if(t){let e=c.get(t);return L(`div`,{className:`@container/liveload`,children:[H(`h3`,{className:`text-sm font-semibold text-foreground mb-2`,children:`Live load`}),L(`div`,{className:`grid grid-cols-2 @md/liveload:grid-cols-3 @3xl/liveload:grid-cols-5 gap-2 mb-3`,children:[H(Z,{label:`FPS`,value:e?e.totalFps.toFixed(1):`—`}),H(Z,{label:`Cameras`,value:e?`${e.activeCameras}/${e.attachedCameras}`:`—`}),H(Z,{label:`Avg infer ms`,value:e&&e.attachedCameras>0?(e.totalInferenceWeighted/e.attachedCameras).toFixed(0):`—`}),H(Z,{label:`Queue`,value:e?String(e.queueDepth):`—`}),H(Z,{label:`Audio`,value:String(s.get(t)??`—`)})]})]})}let d=[...c.entries()].toSorted(([e],[t])=>e===`hub`?-1:t===`hub`?1:e.localeCompare(t));return L(`div`,{className:`@container/liveload`,children:[H(`h3`,{className:`text-sm font-semibold text-foreground mb-2`,children:`Live load`}),L(`div`,{className:`grid grid-cols-2 @md/liveload:grid-cols-3 @3xl/liveload:grid-cols-5 gap-2 sm:gap-3 mb-3`,children:[H(Z,{label:`Total agents`,value:`${u.onlineAgents}/${u.totalAgents}`}),H(Z,{label:`Cameras`,value:`${u.activeCameras}/${u.attachedCameras}`}),H(Z,{label:`Total FPS`,value:u.totalFps.toFixed(1)}),H(Z,{label:`Avg inference ms`,value:u.avgInferenceTimeMs.toFixed(0)}),H(Z,{label:`Queue depth`,value:String(u.queueDepth)})]}),H(`div`,{className:`rounded-lg border border-border overflow-x-auto`,children:L(`table`,{className:`w-full text-xs min-w-[480px]`,children:[H(`thead`,{className:`bg-surface`,children:L(`tr`,{className:`text-foreground-subtle text-[10px] uppercase tracking-wider`,children:[H(`th`,{className:`text-left px-3 py-2`,children:`Agent`}),H(`th`,{className:`text-right px-3 py-2`,children:`FPS`}),H(`th`,{className:`text-right px-3 py-2`,children:`Cameras`}),H(`th`,{className:`text-right px-3 py-2`,children:`Inference ms`}),H(`th`,{className:`text-right px-3 py-2`,children:`Queue`}),H(`th`,{className:`text-right px-3 py-2`,children:`Audio`})]})}),L(`tbody`,{children:[d.map(([e,t])=>L(`tr`,{className:`border-t border-border`,children:[H(`td`,{className:`px-3 py-2 text-foreground font-medium`,children:l.get(e)??e}),H(`td`,{className:`px-3 py-2 text-right text-foreground`,children:t.totalFps.toFixed(1)}),H(`td`,{className:`px-3 py-2 text-right text-foreground`,children:t.attachedCameras}),H(`td`,{className:`px-3 py-2 text-right text-foreground`,children:t.attachedCameras>0?(t.totalInferenceWeighted/t.attachedCameras).toFixed(0):`—`}),H(`td`,{className:`px-3 py-2 text-right text-foreground`,children:t.queueDepth}),H(`td`,{className:`px-3 py-2 text-right text-foreground`,children:s.get(e)??`—`})]},e)),d.length===0&&H(`tr`,{children:H(`td`,{colSpan:6,className:`px-3 py-4 text-center text-foreground-subtle text-[11px]`,children:`No camera metrics received yet`})})]})]})})]})}function Z({label:e,value:t}){return L(`div`,{className:`rounded-lg border border-border bg-surface/60 p-3`,children:[H(`div`,{className:`text-[10px] uppercase tracking-wider text-foreground-subtle mb-1`,children:e}),H(`div`,{className:`text-lg font-semibold text-foreground`,children:t})]})}z();var pt={active:!1,pinned:!1,nodeId:null,reason:``},mt=[`pipeline.camera-assigned`,`pipeline.camera-unassigned`,`pipeline.camera-updated`,`agent.online`,`agent.offline`],ht={pipeline:K,decoder:Qe,audio:Te},gt={pipeline:`Pipeline`,decoder:`Decoder`,audio:`Audio`};function _t({mode:e,nodeId:t,compact:n=!1}){if(e===`agent`&&!t)throw Error(`CameraAssignmentsTable: nodeId is required when mode === "agent"`);let r=V(),[i,a]=I(null),[o,s]=I(null),[u,d]=I(new Map);J([`pipelineOrchestrator`,`getPipelineAssignments`],mt),J([`pipelineOrchestrator`,`getDecoderAssignments`],mt),J([`pipelineOrchestrator`,`getAudioAssignments`],mt);let{data:f}=ce(void 0),{data:p}=l(void 0),{data:m}=fe(void 0),{nodes:_}=h(),{data:y}=Ge();D(`pipeline.camera-metrics-snapshot`,e=>{let t=e.data;typeof t.deviceId==`number`&&d(e=>{let n=new Map(e);return n.set(t.deviceId,t),n})}),U(()=>{if(u.size===0)return;let e=setInterval(()=>{d(e=>{let t=Date.now()-1e4,n=!1,r=new Map(e);for(let[i,a]of e)a.timestamp<t&&(r.delete(i),n=!0);return n?r:e})},5e3);return()=>clearInterval(e)},[u.size]);let b=R(()=>{let e=new Map;for(let t of y??[])e.set(t.id,t.name);return e},[y]),x=R(()=>{let n=new Map,r=e=>{let t=n.get(e);if(t)return t;let r={deviceId:e,deviceName:b.get(e)??`Device ${e}`,pipeline:pt,decoder:pt,audio:pt};return n.set(e,r),r};for(let i of f??[]){let a=r(i.deviceId);n.set(i.deviceId,{...a,pipeline:{active:e===`cluster`?!0:i.agentNodeId===t,pinned:i.pinned,nodeId:i.agentNodeId,reason:i.reason??``}})}for(let i of p??[]){let a=r(i.deviceId);n.set(i.deviceId,{...a,decoder:{active:e===`cluster`?!0:i.decoderNodeId===t,pinned:i.pinned,nodeId:i.decoderNodeId,reason:i.reason??``}})}for(let i of m??[]){let a=r(i.deviceId);n.set(i.deviceId,{...a,audio:{active:e===`cluster`?!0:i.nodeId===t,pinned:i.pinned,nodeId:i.nodeId,reason:`capacity`}})}let i=[...n.values()];return e===`agent`&&(i=i.filter(e=>e.pipeline.active||e.decoder.active||e.audio.active)),i.sort((e,t)=>e.deviceId-t.deviceId),i},[f,p,m,b,e,t]),C=R(()=>(_??[]).filter(e=>e.isOnline).map(e=>({id:e.id,name:e.name})),[_]),w=()=>{r.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getPipelineAssignments`]]}),r.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getDecoderAssignments`]]}),r.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getAudioAssignments`]]})},T=c({onSuccess:w}),E=le({onSuccess:w}),O=v({onSuccess:w}),k=ae({onSuccess:w}),A=g({onSuccess:w}),M=j({onSuccess:w}),N=(e,t,n)=>{t===`pipeline`?T.mutate({deviceId:e,agentNodeId:n}):t===`decoder`?O.mutate({deviceId:e,nodeId:n}):A.mutate({deviceId:e,nodeId:n}),a(null)},P=(e,t)=>{t===`pipeline`?E.mutate({deviceId:e}):t===`decoder`?k.mutate({deviceId:e}):M.mutate({deviceId:e}),a(null)};return H(`div`,{className:`rounded-lg border border-border overflow-x-auto`,children:L(`table`,{className:`w-full text-xs min-w-[640px]`,children:[H(`thead`,{className:`bg-surface`,children:L(`tr`,{className:`text-foreground-subtle text-[10px] uppercase tracking-wider`,children:[!n&&H(`th`,{className:`w-6`}),H(`th`,{className:`text-left px-3 py-2 align-middle`,children:`Camera`}),H(`th`,{className:`text-left px-3 py-2 align-middle`,children:`Pipeline`}),H(`th`,{className:`text-left px-3 py-2 align-middle`,children:`Decoder`}),H(`th`,{className:`text-left px-3 py-2 align-middle`,children:`Audio`}),H(`th`,{className:`text-left px-3 py-2 align-middle`,children:`Status`})]})}),L(`tbody`,{children:[x.map(t=>{let r=u.get(t.deviceId),c=o===t.deviceId;return L(he.Fragment,{children:[L(`tr`,{className:`border-t border-border align-middle relative`,children:[!n&&H(`td`,{className:`px-2 py-2 align-middle`,children:H(`button`,{type:`button`,onClick:()=>s(c?null:t.deviceId),className:`p-1 rounded hover:bg-surface-hover text-foreground-subtle`,"aria-label":c?`Collapse broker details`:`Expand broker details`,children:H(c?Re:Le,{className:`h-3.5 w-3.5`})})}),L(`td`,{className:`px-3 py-2 align-middle`,children:[H(`div`,{className:`text-foreground font-medium leading-tight`,children:t.deviceName}),L(`div`,{className:`text-[10px] text-foreground-subtle leading-tight`,children:[`#`,t.deviceId]})]}),H(vt,{role:`pipeline`,state:t.pipeline,mode:e,deviceId:t.deviceId,onlineNodes:C,isMenuOpen:i?.deviceId===t.deviceId&&i.role===`pipeline`,onToggleMenu:()=>a(i?.deviceId===t.deviceId&&i.role===`pipeline`?null:{deviceId:t.deviceId,role:`pipeline`}),onCloseMenu:()=>a(null),onMove:e=>N(t.deviceId,`pipeline`,e),onUnpin:()=>P(t.deviceId,`pipeline`)}),H(vt,{role:`decoder`,state:t.decoder,mode:e,deviceId:t.deviceId,onlineNodes:C,isMenuOpen:i?.deviceId===t.deviceId&&i.role===`decoder`,onToggleMenu:()=>a(i?.deviceId===t.deviceId&&i.role===`decoder`?null:{deviceId:t.deviceId,role:`decoder`}),onCloseMenu:()=>a(null),onMove:e=>N(t.deviceId,`decoder`,e),onUnpin:()=>P(t.deviceId,`decoder`)}),H(vt,{role:`audio`,state:t.audio,mode:e,deviceId:t.deviceId,onlineNodes:C,isMenuOpen:i?.deviceId===t.deviceId&&i.role===`audio`,onToggleMenu:()=>a(i?.deviceId===t.deviceId&&i.role===`audio`?null:{deviceId:t.deviceId,role:`audio`}),onCloseMenu:()=>a(null),onMove:e=>N(t.deviceId,`audio`,e),onUnpin:()=>P(t.deviceId,`audio`)}),H(`td`,{className:`px-3 py-2 align-middle`,children:H(xt,{snap:r})})]}),c&&!n&&L(`tr`,{className:`bg-surface/50`,children:[H(`td`,{}),H(`td`,{colSpan:5,className:`px-3 py-2`,children:H(S,{widgetId:`stream-broker/stream-broker-panel`,host:`device-tab`,deviceId:t.deviceId,instanceId:`pipeline-row/${t.deviceId}`,config:{variant:`compact`,title:`Stream brokers & clients`}})})]})]},t.deviceId)}),x.length===0&&H(`tr`,{children:H(`td`,{colSpan:n?5:6,className:`px-3 py-4 text-center text-foreground-subtle text-[11px]`,children:e===`agent`?`No cameras assigned to this node`:`No cameras currently assigned`})})]})]})})}function vt({role:e,state:t,mode:n,onlineNodes:r,isMenuOpen:i,onToggleMenu:a,onCloseMenu:o,onMove:s,onUnpin:c}){let l=ht[e],u=r.filter(e=>e.id!==(t.nodeId??``)),d=(t.active||n===`cluster`)&&(u.length>0||t.pinned);return L(`td`,{className:`px-3 py-2 align-middle relative`,children:[L(`div`,{className:`flex items-center gap-2`,children:[H(n===`agent`?yt:bt,{state:t,Icon:l}),H(`div`,{className:`ml-auto`,children:d&&H(`button`,{type:`button`,onClick:a,className:`p-1 rounded hover:bg-surface-hover`,"aria-label":`${gt[e]} actions`,children:H(Ze,{className:`h-3 w-3 text-foreground-subtle`})})})]}),i&&d&&H(St,{title:gt[e],targets:u,pinned:t.pinned,onMove:s,onUnpin:c,onClose:o})]})}function yt({state:e,Icon:t}){return L(`div`,{className:`flex items-center gap-1.5`,children:[H(e.active?Me:Ne,{className:`h-3.5 w-3.5 ${e.active?`text-success`:`text-foreground-subtle/50`}`}),H(t,{className:`h-3 w-3 ${e.active?`text-foreground-subtle`:`text-foreground-subtle/40`}`}),e.pinned&&H(et,{className:`h-2.5 w-2.5 text-amber-400`})]})}function bt({state:e,Icon:t}){return!e.active||!e.nodeId?L(`div`,{className:`flex items-center gap-1.5 text-foreground-subtle/60`,children:[H(t,{className:`h-3 w-3`}),H(`span`,{className:`text-[10px] italic`,children:`—`})]}):L(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[H(t,{className:`h-3 w-3 text-foreground-subtle shrink-0`}),L(`div`,{className:`flex flex-col leading-tight min-w-0`,children:[H(`span`,{className:`font-mono text-[11px] text-foreground truncate`,children:e.nodeId}),H(`span`,{className:`flex items-center gap-1 text-[10px]`,children:e.pinned?L(`span`,{className:`inline-flex items-center gap-0.5 text-amber-400`,children:[H(et,{className:`h-2.5 w-2.5`}),` manual`]}):L(`span`,{className:`text-foreground-subtle truncate`,children:[`auto · `,e.reason||`capacity`]})})]})]})}function xt({snap:e}){if(!e)return H(`span`,{className:`text-[10px] text-foreground-subtle italic`,children:`—`});let{phase:t,actualFps:n,avgInferenceTimeMs:r,queueDepth:i,configuredFps:a}=e.metrics,s=o(t);return L(`div`,{className:`flex flex-col gap-0.5 font-mono text-[10px] tabular-nums leading-tight`,children:[L(`span`,{className:`inline-flex items-center gap-1 ${s.textColor}`,children:[H(A,{phase:t,className:`h-2.5 w-2.5`}),H(`span`,{className:`font-semibold uppercase tracking-wider`,children:s.label})]}),L(`span`,{className:`text-foreground-subtle`,children:[H(`span`,{className:`text-foreground`,children:n.toFixed(1)}),L(`span`,{children:[`/`,a.toFixed(0),` fps`]})]}),L(`span`,{className:`text-foreground-subtle`,children:[H(`span`,{className:`text-foreground`,children:r.toFixed(0)}),H(`span`,{children:` ms`}),i>0&&L(`span`,{className:`text-warning ml-1`,children:[`q`,i]})]})]})}function St({title:e,targets:t,pinned:n,onMove:r,onUnpin:i,onClose:a}){let o=pe(null);return U(()=>{let e=e=>{o.current?.contains(e.target)||a()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]),L(`div`,{ref:o,className:`absolute right-2 top-full mt-1 w-48 rounded-lg border border-border bg-surface shadow-lg z-20 text-left`,children:[H(`div`,{className:`px-3 py-1 text-[9px] uppercase tracking-wider text-foreground-subtle border-b border-border`,children:e}),t.length>0&&H(`div`,{className:`py-1`,children:t.map(e=>L(`button`,{type:`button`,onClick:()=>r(e.id),className:`block w-full text-left px-3 py-1 text-[11px] text-foreground hover:bg-surface-hover`,children:[`Move to `,e.name]},e.id))}),n&&L(`button`,{type:`button`,onClick:i,className:`block w-full text-left px-3 py-1.5 text-[11px] text-destructive hover:bg-destructive/10 border-t border-border`,children:[`Unpin `,e.toLowerCase()]}),t.length===0&&!n&&H(`div`,{className:`px-3 py-1.5 text-[10px] text-foreground-subtle italic`,children:`Already auto · no other nodes online`})]})}function Ct({nodeId:e,refreshToken:t}){return L(`div`,{className:`space-y-6`,children:[H(ft,{refreshToken:t,nodeId:e}),L(`div`,{children:[H(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Cameras on this node`}),L(`p`,{className:`text-[11px] text-foreground-subtle`,children:[`Checkboxes mark the roles currently running on `,e,`. Use the kebab to move a role to another node or unpin it; live KPIs come from the runner snapshot stream.`]})]}),H(_t,{mode:`agent`,nodeId:e,compact:!0})]})}z();function wt(e,t){let n=Math.max(0,t-e);return`${Math.floor(e/1e3)}s idle · ${Math.floor(n/1e3)}s left`}function Tt({nodeId:e,refreshToken:n}){let r=V(),i=t({onSettled:()=>{r.invalidateQueries({queryKey:[`pipelineExecutor`,`listLoadedEngines`]})}}),{data:a}=ne({nodeId:e}),o=se(`pipeline.engine-metrics-snapshot`,t=>t.nodeId===e)?.engines??a??null,s=o===null;J([`pipelineRunner`,`getLocalCameras`],[`pipeline.camera-assigned`,`pipeline.camera-unassigned`]);let{data:c}=de({nodeId:e}),{values:l}=p(`pipeline.camera-metrics-snapshot`,e=>e.deviceId,t=>t.nodeId===e),u=R(()=>l.filter(e=>e.metrics.phase===`active`).length,[l]),d=t=>{let n=c??[];n.length>0&&!window.confirm(`${n.length} camera(s) are dispatching through this engine. Killing it forces a respawn on the next frame. Continue?`)||i.mutate({nodeId:e,engine:t,force:n.length>0})};return L(`div`,{className:`space-y-6`,children:[L(`div`,{children:[H(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Inference engines on this node`}),L(`p`,{className:`text-[11px] text-foreground-subtle`,children:[(o??[]).length,` engine(s) resident in RAM. `,(c??[]).length,` `,`camera(s) attached, `,u,` actively dispatching frames. Refreshes every 5s.`]})]}),H(`div`,{className:`rounded-lg border border-border overflow-x-auto`,children:L(`table`,{className:`w-full text-xs min-w-[640px]`,children:[H(`thead`,{className:`bg-surface`,children:L(`tr`,{className:`text-foreground-subtle text-[10px] uppercase tracking-wider`,children:[H(`th`,{className:`text-left px-3 py-2 whitespace-nowrap`,children:`Kind`}),H(`th`,{className:`text-left px-3 py-2 whitespace-nowrap`,children:`Runtime / Backend / Device`}),H(`th`,{className:`text-left px-3 py-2`,children:`Models`}),H(`th`,{className:`text-right px-3 py-2 whitespace-nowrap`,children:`Pool PID`}),H(`th`,{className:`text-right px-3 py-2 whitespace-nowrap`,children:`Auto-kill`}),H(`th`,{className:`text-right px-3 py-2 whitespace-nowrap`,children:`In use`}),H(`th`,{className:`w-20`})]})}),L(`tbody`,{children:[s&&H(`tr`,{children:H(`td`,{colSpan:7,className:`px-3 py-4 text-center text-foreground-subtle text-[11px]`,children:`Loading…`})}),!s&&(o??[]).map(e=>{let t=e.kind===`warm-override`;return L(`tr`,{className:`border-t border-border ${t?`bg-amber-500/5`:``}`,children:[H(`td`,{className:`px-3 py-2`,children:L(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[10px] font-medium ${t?`bg-amber-500/15 text-amber-400`:`bg-success/15 text-success`}`,children:[H(t?$e:K,{className:`h-3 w-3`}),t?`warm`:`runtime`]})}),H(`td`,{className:`px-3 py-2`,children:L(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-sky-400`,children:[H(Ee,{className:`h-3 w-3`}),e.engine.runtime,`/`,e.engine.backend,e.engine.device?`/${e.engine.device}`:``,e.engine.format?` · ${e.engine.format}`:``]})}),H(`td`,{className:`px-3 py-2`,children:e.modelsLoaded.length===0?H(`span`,{className:`text-foreground-subtle text-[11px]`,children:`—`}):H(`div`,{className:`flex flex-wrap gap-1`,children:e.modelsLoaded.map(e=>H(`span`,{className:`inline-block rounded bg-surface px-1.5 py-0.5 text-[10px] font-mono text-foreground-subtle`,children:e},e))})}),H(`td`,{className:`px-3 py-2 text-right font-mono text-foreground`,children:e.poolPid??`—`}),H(`td`,{className:`px-3 py-2 text-right text-[11px]`,children:e.idleMs!==null&&e.idleTtlMs!==null?H(`span`,{className:`text-foreground-subtle`,children:wt(e.idleMs,e.idleTtlMs)}):H(`span`,{className:`text-foreground-subtle/50`,children:`never`})}),H(`td`,{className:`px-3 py-2 text-right text-foreground`,children:t?`—`:(c??[]).length}),H(`td`,{className:`px-3 py-2 text-right`,children:L(`button`,{type:`button`,disabled:i.isPending,onClick:()=>d(e.engine),className:`inline-flex items-center gap-1 px-2 py-1 rounded border border-destructive/30 text-destructive text-[11px] hover:bg-destructive/10 disabled:opacity-50`,children:[H(He,{className:`h-3 w-3`}),`Kill`]})})]},e.engineKey)}),!s&&(o??[]).length===0&&H(`tr`,{children:H(`td`,{colSpan:7,className:`px-3 py-4 text-center text-foreground-subtle text-[11px]`,children:`No engines resident — the factory spins up on the first pipeline run.`})})]})]})}),L(`div`,{className:`text-[10px] text-foreground-subtle leading-relaxed`,children:[H(`strong`,{className:`text-foreground`,children:`runtime`}),`: main camera-serving engine; never auto-killed while cameras attached. `,H(`strong`,{className:`text-foreground`,children:`warm`}),`: benchmark/test override held in cache for fast re-use; auto-disposed after the idle TTL.`]}),i.isError&&L(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] text-destructive`,children:[`Kill failed:`,` `,i.error instanceof Error?i.error.message:`unknown`]})]})}z();var Et=new Set(ve);function Dt(e){return Et.has(e)}function Ot(e,t,n){return`${e}/${t}/${n}`}function kt(e){return{coreml:`CoreML`,openvino:`OpenVINO`,onnx:`ONNX`}[e.format]??e.format.toUpperCase()}function At(e){return{coreml:`Apple Neural Engine / GPU — .mlpackage`,openvino:`Intel CPU / GPU / NPU — .xml`,onnx:`CPU, CUDA, Node.js — .onnx`}[e.format]??`.${e.format}`}function Q(e){return e.format}function jt(e,t){let n=0,r=0,i=0;for(let a of e)for(let e of a.addons)for(let a of e.models){let e=a.formats[t];e&&(n++,e.downloaded&&(r++,i+=e.sizeMB))}return{total:n,downloaded:r,downloadedSizeMB:i}}function Mt({addonId:e,model:t,format:n,isActive:r,progress:i,errorMsg:a,onDownload:o,onDelete:s}){let c=t.formats[n];return c?L(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-border/50 last:border-b-0 hover:bg-surface-hover/30 transition-colors`,children:[H(`div`,{className:`h-2 w-2 rounded-full shrink-0 ${c.downloaded?`bg-success`:`bg-foreground-subtle/30`}`}),L(`div`,{className:`flex-1 min-w-0`,children:[L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`text-sm font-medium text-foreground`,children:t.name}),L(`span`,{className:`text-[10px] text-foreground-subtle font-mono`,children:[`(`,t.id,`)`]})]}),i&&i.progress>=0&&i.progress<100&&L(`div`,{className:`mt-1.5 flex items-center gap-2 max-w-xs`,children:[H(`div`,{className:`flex-1 h-1 bg-surface-hover rounded-full overflow-hidden`,children:H(`div`,{className:`bg-primary h-full rounded-full transition-all duration-300`,style:{width:`${i.progress}%`}})}),L(`span`,{className:`text-[9px] text-primary font-mono tabular-nums shrink-0`,children:[Math.round(i.progress),`%`]})]})]}),H(`span`,{className:`text-xs text-foreground-subtle tabular-nums shrink-0`,children:Ke(c.sizeMB)}),a&&L(`span`,{className:`flex items-center gap-1 text-[10px] text-danger max-w-[160px] truncate shrink-0`,title:a,children:[H(Be,{className:`h-3 w-3 shrink-0`}),a]}),c.downloaded?L(`button`,{onClick:s,disabled:r,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-medium rounded-md border border-danger/30 text-danger hover:bg-danger/10 disabled:opacity-50 transition-colors shrink-0`,children:[r?H(q,{className:`h-3 w-3 animate-spin`}):H(He,{className:`h-3 w-3`}),r?`Deleting...`:`Delete`]}):L(`button`,{onClick:o,disabled:r,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors shrink-0`,children:[r?H(q,{className:`h-3 w-3 animate-spin`}):H(ye,{className:`h-3 w-3`}),r?`Downloading...`:`Download`]})]}):null}function Nt({engines:e,activeEngine:t,viewEngine:n,onSelect:r}){let[i,a]=I(!1);return L(`div`,{className:`relative`,children:[L(`button`,{type:`button`,onClick:()=>a(!i),className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-4 py-2.5 w-full text-left hover:bg-surface-hover transition-colors`,children:[H(K,{className:`h-4 w-4 text-primary shrink-0`}),L(`div`,{className:`flex-1 min-w-0`,children:[L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`text-sm font-medium text-foreground`,children:kt(n)}),Q(n)===Q(t)&&H(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded-full bg-success/10 text-success font-medium`,children:`Active`})]}),H(`div`,{className:`text-[10px] text-foreground-subtle`,children:At(n)})]}),H(Re,{className:`h-4 w-4 text-foreground-subtle transition-transform ${i?`rotate-180`:``}`})]}),i&&H(`div`,{className:`absolute top-full left-0 right-0 mt-1 rounded-lg border border-border bg-surface shadow-lg z-50 overflow-hidden`,children:e.map(e=>{let i=Q(e)===Q(n),o=Q(e)===Q(t);return L(`button`,{type:`button`,onClick:()=>{r(e),a(!1)},className:`flex items-center gap-3 px-4 py-2.5 w-full text-left transition-colors ${i?`bg-primary/5`:`hover:bg-surface-hover`}`,children:[H(K,{className:`h-4 w-4 shrink-0 ${i?`text-primary`:`text-foreground-subtle`}`}),L(`div`,{className:`flex-1`,children:[L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`text-sm font-medium ${i?`text-primary`:`text-foreground`}`,children:kt(e)}),o&&H(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded-full bg-success/10 text-success font-medium`,children:`Active`})]}),H(`div`,{className:`text-[10px] text-foreground-subtle`,children:At(e)})]}),i&&H(Pe,{className:`h-4 w-4 text-primary shrink-0`})]},Q(e))})})]})}function Pt({embedded:e=!1,nodeId:t}={}){let n=V(),r=t??`hub`,[i,o]=I(null),[c,l]=I(new Set),[u,d]=I(new Map),[f,p]=I(new Map),[m,h]=I(``),{data:g=[]}=a({nodeId:r}),v=g.filter((e,t,n)=>n.findIndex(t=>t.format===e.format)===t),{data:y}=re({nodeId:r}),b=y,{data:x,isLoading:S}=_({nodeId:r}),w=s(),T=C();D(`model.download.progress`,e=>{let t=e.data,r=typeof t.modelId==`string`?t.modelId:void 0,i=typeof t.progress==`number`?t.progress:void 0,a=typeof t.totalMB==`number`?t.totalMB:0;r===void 0||i===void 0||(d(e=>{let t=new Map(e);return i===100||i===-1?t.delete(r):t.set(r,{modelId:r,progress:i,totalMB:a}),t}),i===100&&n.invalidateQueries({queryKey:[[`pipelineExecutor`,`getSchema`]]}))});let E=b??{runtime:`node`,backend:`cpu`,format:`onnx`},O=v.find(e=>e.format===i)??E,k=O.format,A=x?.slots??[],j=A.map(e=>({...e,addons:e.addons.map(e=>({...e,models:e.models.filter(e=>e.formats[k]!==void 0)})).filter(e=>e.models.length>0)})).filter(e=>e.addons.length>0),M=jt(j,k),N=me(async(e,t,i)=>{if(!Dt(i))return;let a=Ot(e,t,i);l(e=>new Set([...e,a])),p(e=>{let t=new Map(e);return t.delete(a),t});try{await w.mutateAsync({addonId:e,modelId:t,format:i,nodeId:r}),n.invalidateQueries({queryKey:[[`pipelineExecutor`,`getSchema`]]})}catch(e){p(t=>new Map([...t,[a,e instanceof Error?e.message:`Download failed`]]))}finally{l(e=>{let t=new Set(e);return t.delete(a),t})}},[w,n,r]),P=me(async(e,t,i)=>{if(!Dt(i))return;let a=Ot(e,t,i);l(e=>new Set([...e,a])),p(e=>{let t=new Map(e);return t.delete(a),t});try{await T.mutateAsync({addonId:e,modelId:t,format:i,nodeId:r}),n.invalidateQueries({queryKey:[[`pipelineExecutor`,`getSchema`]]})}catch(e){p(t=>new Map([...t,[a,e instanceof Error?e.message:`Delete failed`]]))}finally{l(e=>{let t=new Set(e);return t.delete(a),t})}},[T,n,r]),F=me(e=>{o(e.format)},[]),ee=m.trim()?j.map(e=>({...e,addons:e.addons.map(e=>({...e,models:e.models.filter(t=>t.name.toLowerCase().includes(m.toLowerCase())||t.id.toLowerCase().includes(m.toLowerCase())||e.name.toLowerCase().includes(m.toLowerCase()))})).filter(e=>e.models.length>0)})).filter(e=>e.addons.length>0):j,te=L(B,{children:[S&&H(`div`,{className:`flex items-center justify-center py-16`,children:H(q,{className:`h-5 w-5 animate-spin text-foreground-subtle`})}),!S&&A.length===0&&L(`div`,{className:`flex flex-col items-center justify-center py-16 text-foreground-subtle`,children:[H(be,{className:`h-8 w-8 mb-3 opacity-30`}),H(`span`,{className:`text-sm`,children:`No pipeline steps available`}),H(`span`,{className:`text-xs mt-1`,children:`Configure the detection pipeline to see available models.`})]}),!S&&A.length>0&&L(B,{children:[H(Nt,{engines:v,activeEngine:E,viewEngine:O,onSelect:F}),L(`div`,{className:`flex items-center gap-4 text-xs text-foreground-subtle`,children:[L(`span`,{children:[H(`span`,{className:`font-semibold text-foreground tabular-nums`,children:M.total}),H(`span`,{className:`ml-1`,children:`compatible models`})]}),H(`span`,{className:`text-border`,children:`|`}),L(`span`,{children:[H(`span`,{className:`font-semibold text-success tabular-nums`,children:M.downloaded}),H(`span`,{className:`ml-1`,children:`downloaded`})]}),H(`span`,{className:`text-border`,children:`|`}),L(`span`,{className:`tabular-nums`,children:[Ke(M.downloadedSizeMB),H(`span`,{className:`ml-1`,children:`on disk`})]})]}),M.total>5&&L(`div`,{className:`relative`,children:[H(Ae,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle`}),H(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:`Search models...`,className:`w-full pl-9 pr-3 py-2 text-sm rounded-lg border border-border bg-surface text-foreground placeholder:text-foreground-subtle/50 focus:outline-none focus:ring-1 focus:ring-primary`})]}),ee.map(e=>{let t=e.addons.reduce((e,t)=>e+t.models.length,0),n=e.addons.reduce((e,t)=>e+t.models.filter(e=>e.formats[k]?.downloaded).length,0);return L(`div`,{children:[L(`div`,{className:`flex items-center gap-2 mb-2`,children:[H(`h2`,{className:`text-sm font-semibold text-foreground`,children:e.label}),H(`div`,{className:`flex-1 h-px bg-border`}),L(`span`,{className:`text-[10px] text-foreground-subtle tabular-nums`,children:[n,`/`,t]})]}),H(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:e.addons.map(e=>e.models.map(t=>{let n=Ot(e.id,t.id,k);return H(Mt,{addonId:e.id,model:t,format:k,isActive:c.has(n),progress:u.get(t.id),errorMsg:f.get(n),onDownload:()=>N(e.id,t.id,k),onDelete:()=>P(e.id,t.id,k)},`${e.id}/${t.id}`)}))})]},e.id)}),ee.length===0&&H(`div`,{className:`text-center py-8 text-sm text-foreground-subtle`,children:m.trim()?L(B,{children:[`No models matching “`,m,`”`]}):L(B,{children:[`No models available for `,kt(O),` format`]})})]})]});return e?H(`div`,{className:`space-y-4`,children:te}):H(We,{children:te})}function Ft({nodeId:e,refreshToken:t}){return H(Pt,{embedded:!0,nodeId:e})}var It=[{concern:`pipeline`,label:`Pipeline`,advisory:!1},{concern:`audio`,label:`Audio`,advisory:!1},{concern:`decode`,label:`Decode`,advisory:!0,advisoryNote:`Advisory: decode currently runs co-located with the stream source (hub). Pins are stored and take effect with Phase-2 stream load-balancing.`}];function Lt(e,t){return e.filter(e=>e.currentNodeId!==t)}var Rt=`This node is not decoder-enabled (enabledDecoderNodes). Pinning detection here strands frames (0 fps) until frame-source-aware placement ships. Enable decode on this node first, or pick a decoder-enabled node.`;function zt(e,t,n){return t.includes(e)?{verdict:`ok`}:n?{verdict:`warn`,reason:Rt}:{verdict:`block`,reason:Rt}}z();var Bt=`pipeline-orchestrator`,Vt=`enabledDecoderNodes`;function Ht(e,t){if(!e||typeof e!=`object`)return;let n=e.sections;if(Array.isArray(n))for(let e of n){if(!e||typeof e!=`object`)continue;let n=e.fields;if(Array.isArray(n))for(let e of n){if(!e||typeof e!=`object`)continue;let n=e;if(n.key!==t)continue;let r=n.value;return Array.isArray(r)&&r.every(e=>typeof e==`string`)?r:void 0}}}function Ut({nodeId:e,nodeName:t,concern:n,open:r,onClose:i}){let a=V(),o=Ge(),s=ce(void 0),u=l(void 0),d=fe(void 0),f=T({addonId:Bt}),p=c(),m=v(),h=g(),[_,y]=I(new Set),[b,x]=I(!1),[S,C]=I(null),[w,E]=I([]),[D,O]=I(null),k=It.find(e=>e.concern===n),A=R(()=>{let e=new Map;if(n===`pipeline`)for(let t of s.data??[])e.set(t.deviceId,t.agentNodeId);else if(n===`decode`)for(let t of u.data??[])e.set(t.deviceId,t.decoderNodeId);else for(let t of d.data??[])e.set(t.deviceId,t.nodeId);return e},[n,s.data,u.data,d.data]),j=R(()=>(o.data??[]).filter(e=>e.isCamera).map(e=>({deviceId:e.id,name:e.name,currentNodeId:A.get(e.id)??null})),[o.data,A]),M=R(()=>Lt(j,e),[j,e]),N=Ht(f.data,Vt),P=n===`pipeline`?zt(e,N??[],!1):{verdict:`ok`},[F,ee]=I(!1);if(!r)return null;let te=P.verdict===`block`,ne=P.verdict===`warn`&&!F,re=_.size>0&&!b&&!te&&!ne,ie=e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ae=M.length>0&&M.every(e=>_.has(e.deviceId)),oe=()=>{y(ae?new Set:new Set(M.map(e=>e.deviceId)))},se=async t=>{n===`pipeline`?await p.mutateAsync({deviceId:t,agentNodeId:e}):n===`decode`?await m.mutateAsync({deviceId:t,nodeId:e}):await h.mutateAsync({deviceId:t,nodeId:e})},le=new Map(j.map(e=>[e.deviceId,e.name]));return L(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[H(`div`,{className:`absolute inset-0 bg-black/60`,onClick:i}),L(`div`,{className:`relative z-10 flex w-full max-w-2xl flex-col h-[80vh] rounded-xl border border-border bg-background shadow-2xl`,children:[L(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-4 shrink-0`,children:[L(`div`,{className:`min-w-0`,children:[L(`h2`,{className:`text-sm font-semibold text-foreground`,children:[`Batch assign `,k?.label??n,` → `,t]}),L(`p`,{className:`text-[11px] text-foreground-subtle mt-0.5`,children:[`Pick the cameras whose `,k?.label.toLowerCase()??n,` should run on this node.`]})]}),H(`button`,{type:`button`,onClick:i,className:`rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,"aria-label":`Close`,children:H(ze,{className:`h-4 w-4`})})]}),L(`div`,{className:`flex-1 min-h-0 px-5 py-3 flex flex-col gap-2 overflow-hidden`,children:[k?.advisory&&k.advisoryNote&&H(`div`,{className:`rounded-lg border border-warning/30 bg-warning/5 px-3 py-2 shrink-0`,children:L(`div`,{className:`flex items-start gap-2`,children:[H(Ve,{className:`h-3.5 w-3.5 text-warning mt-0.5 shrink-0`}),H(`p`,{className:`text-[11px] text-warning`,children:k.advisoryNote})]})}),P.verdict!==`ok`&&H(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 shrink-0`,children:L(`div`,{className:`flex items-start gap-2`,children:[H(Ve,{className:`h-3.5 w-3.5 text-destructive mt-0.5 shrink-0`}),L(`div`,{className:`min-w-0`,children:[H(`p`,{className:`text-[11px] text-destructive`,children:P.reason}),P.verdict===`warn`&&L(`label`,{className:`mt-1 flex items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[H(`input`,{type:`checkbox`,checked:F,onChange:e=>ee(e.target.checked),className:`accent-primary`}),`I understand — assign anyway`]})]})]})}),M.length>0&&L(`label`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle shrink-0`,children:[H(`input`,{type:`checkbox`,"aria-label":`Select all`,checked:ae,onChange:oe,className:`accent-primary`}),`Select all (`,M.length,`)`]}),H(`div`,{className:`flex-1 min-h-0 overflow-y-auto rounded-lg border border-border divide-y divide-border`,children:M.length===0?L(`div`,{className:`px-3 py-6 text-center text-[11px] text-foreground-subtle`,children:[`No eligible cameras — all cameras are already assigned to `,t,`.`]}):M.map(e=>L(`label`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-foreground hover:bg-surface-hover cursor-pointer`,children:[H(`input`,{type:`checkbox`,"aria-label":`Select ${e.name}`,checked:_.has(e.deviceId),onChange:()=>ie(e.deviceId),className:`accent-primary`}),H(`span`,{className:`truncate`,children:e.name}),e.currentNodeId&&L(`span`,{className:`ml-auto text-[10px] text-foreground-subtle shrink-0`,children:[`on `,e.currentNodeId]})]},e.deviceId))}),(D!==null||w.length>0)&&L(`div`,{className:`space-y-1 text-[10px] shrink-0`,children:[D!==null&&D>0&&L(`p`,{className:`text-success`,children:[`Assigned `,D,` camera(s) to `,t,`.`]}),w.map(e=>L(`p`,{className:`text-destructive`,children:[e.name,`: `,e.message]},e.deviceId))]})]}),L(`div`,{className:`flex items-center justify-between border-t border-border px-5 py-3 shrink-0`,children:[H(`span`,{className:`text-[10px] text-foreground-subtle`,children:b&&S?`${S.done} / ${S.total}…`:``}),L(`div`,{className:`flex items-center gap-2`,children:[H(`button`,{type:`button`,onClick:i,className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground`,children:`Close`}),L(`button`,{type:`button`,onClick:async()=>{let e=[..._];if(e.length===0)return;x(!0),E([]),O(null),C({done:0,total:e.length});let t=[],n=0;for(let r=0;r<e.length;r+=1){let i=e[r];try{await se(i),n+=1}catch(e){t.push({deviceId:i,name:le.get(i)??String(i),message:e instanceof Error?e.message:String(e)})}C({done:r+1,total:e.length})}x(!1),E(t),O(n),y(new Set),a.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getPipelineAssignments`]]}),a.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getDecoderAssignments`]]}),a.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getAudioAssignments`]]})},disabled:!re,className:`inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50 disabled:cursor-not-allowed`,children:[b&&H(q,{className:`h-3.5 w-3.5 animate-spin`}),`Assign `,_.size,` to `,t]})]})]})]})]})}z();function Wt({nodeId:e,title:t}){let{data:n}=Ge(),{data:r}=ce(void 0),i=R(()=>{let e=new Map;for(let t of n??[])e.set(t.id,t.name);return e},[n]),a=R(()=>{if(!e)return null;let t=new Set;for(let n of r??[])n.agentNodeId===e&&t.add(n.deviceId);return t},[e,r]),[s,c]=I(new Map);D(`pipeline.camera-metrics-snapshot`,t=>{let n=t.data;typeof n.deviceId==`number`&&(e&&n.nodeId!==e||c(e=>{let t=new Map(e);return t.set(n.deviceId,n),t}))}),U(()=>{if(s.size===0)return;let e=setInterval(()=>{c(e=>{let t=Date.now()-1e4,n=!1,r=new Map(e);for(let[i,a]of e)a.timestamp<t&&(r.delete(i),n=!0);return n?r:e})},5e3);return()=>clearInterval(e)},[s.size]);let l=R(()=>{let e=[];for(let t of s.values())a&&!a.has(t.deviceId)||e.push(t);return e.sort((e,t)=>e.deviceId-t.deviceId),e},[s,a]);return l.length===0?L(`div`,{className:`rounded-md border border-border bg-surface px-3 py-2 text-[11px] text-foreground-subtle italic`,children:[t??`Cameras`,`: no live snapshots yet`]}):L(`div`,{className:`rounded-md border border-border bg-surface px-3 py-2`,children:[L(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[H(`span`,{className:`text-[10px] uppercase tracking-wider text-foreground-subtle`,children:t??`Cameras`}),H(`span`,{className:`text-[10px] text-foreground-subtle`,children:l.length})]}),H(`div`,{className:`flex flex-wrap gap-1.5`,children:l.map(e=>{let t=i.get(e.deviceId)??`#${e.deviceId}`,n=o(e.metrics.phase);return L(`div`,{title:`${t} · ${n.label} · ${e.metrics.actualFps.toFixed(1)} fps · ${e.metrics.avgInferenceTimeMs.toFixed(0)}ms infer · q=${e.metrics.queueDepth}`,className:`inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] ${n.badgeClass}`,children:[H(A,{phase:e.metrics.phase,className:`h-2.5 w-2.5`}),H(`span`,{className:`font-medium text-foreground/90 max-w-[120px] truncate`,children:t}),H(`span`,{className:`font-mono tabular-nums`,children:e.metrics.actualFps.toFixed(1)}),H(`span`,{className:`opacity-60`,children:`fps`})]},e.deviceId)})})]})}var Gt={key:`maxCameras`,type:`slider`,label:`Max cameras`,description:`Hard cap on cameras the balancer may assign to this node.`,min:1,max:64,step:1,showValue:!0,showStepper:!0,nullable:!0,nullLabel:`Unlimited`};function Kt(e){if(e.length===0)return{kind:`empty`};let t=e[0].maxCameras;return e.every(e=>e.maxCameras===t)?{kind:`uniform`,value:t}:{kind:`mixed`,perNode:e}}function qt(e,t,n){let r=new Map(e.map(e=>[e.agentNodeId,e.maxCameras]));return t.filter(e=>(r.get(e)??null)!==n)}z();var Jt=350;function Yt(e){return typeof e==`number`&&e>0?Math.floor(e):null}function Xt({value:e,pending:t,errorMessage:n,onCommit:i}){let[a,o]=I(e);U(()=>{o(e)},[e]);let s=pe(i);return s.current=i,U(()=>{if(a===e)return;let t=setTimeout(()=>s.current(a),Jt);return()=>clearTimeout(t)},[a,e]),L(`div`,{className:`flex items-center gap-3 text-xs text-foreground`,children:[H(`div`,{className:`max-w-md flex-1`,children:H(r,{field:Gt,values:{maxCameras:a},disabled:t,onChange:(e,t)=>o(Yt(t))})}),t&&H(`span`,{className:`text-[10px] text-muted-foreground animate-pulse`,children:`Saving…`}),n&&L(`span`,{className:`text-[10px] text-destructive`,children:[`Save failed: `,n]})]})}z();function Zt(e,t){if(!e)return null;for(let n of e.slots)for(let e of n.addons)if(e.id===t)return e;return null}function Qt({nodeId:t,refreshToken:n}){let r=V(),[a,o]=I(null),[s,c]=I(null),[l,u]=I(null),d=(i(void 0).data??[]).find(e=>e.id===t)?.name??t,f=_({nodeId:t},{refetchOnMount:`always`}),p=x({agentNodeId:t},{refetchOnMount:`always`}),m=()=>{r.invalidateQueries({queryKey:[[`addonSettings`]]}),r.invalidateQueries({queryKey:[[`pipelineOrchestrator`]]}),r.invalidateQueries({queryKey:[[`pipelineExecutor`]]})},h=e({onSuccess:m}),g=F({onSuccess:m}),v=f.data??null,y=p.data,S=v?.selectedEngine.format??`coreml`,C=R(()=>v?P(v):[],[v]),w=R(()=>[{agentNodeId:t,engineLabel:S}],[t,S]),T=(e,t)=>{let n=y?.addonDefaults[e];return!Zt(v,e)?.models.some(e=>!!e.formats[S])||!n?{kind:`na`}:n.enabled?{kind:`enabled`,modelId:n.modelId}:{kind:`disabled`}},E=a&&v?Zt(v,a.addonId):null,D=e=>{let n=y?.addonDefaults[e]??null;o({addonId:e,agentNodeId:t}),c(n)},O=(e,n)=>{if(!y)return;let r=y.addonDefaults[e],i=Zt(v,e);if(!r&&!i)return;let a={enabled:n,modelId:r?.modelId??i?.defaultModelId??``,settings:r?.settings??{}};h.mutate({agentNodeId:t,defaults:{...y.addonDefaults,[e]:a}})},A=()=>{o(null),c(null)},j=()=>{!s||!a||!y||h.mutate({agentNodeId:t,defaults:{...y.addonDefaults,[a.addonId]:s}},{onSuccess:A})};if(f.isLoading||p.isLoading)return H(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading pipeline…`});if(f.error)return L(`div`,{className:`text-xs text-red-400`,children:[`Failed to load catalog: `,String(f.error)]});if(!v)return H(`div`,{className:`text-xs text-foreground-subtle`,children:`Catalog unavailable for this node (runner offline?).`});let M=a!==null&&E!==null&&s!==null,N=p.data?.maxCameras??null;return L(`div`,{className:`relative h-full w-full space-y-3`,children:[H(Wt,{nodeId:t}),H(Xt,{value:N,pending:g.isPending,errorMessage:g.isError?g.error instanceof Error?g.error.message:`Unknown error`:null,onCommit:e=>g.mutate({agentNodeId:t,maxCameras:e})}),L(`div`,{className:`flex items-center gap-2 text-xs`,children:[H(`span`,{className:`font-medium text-muted-foreground`,children:`Batch assign:`}),H(`button`,{type:`button`,onClick:()=>u(`pipeline`),className:`rounded border border-border bg-surface px-2 py-0.5 text-xs hover:bg-surface-hover`,children:`Pipeline…`}),H(`button`,{type:`button`,onClick:()=>u(`audio`),className:`rounded border border-border bg-surface px-2 py-0.5 text-xs hover:bg-surface-hover`,children:`Audio…`}),H(`button`,{type:`button`,onClick:()=>u(`decode`),className:`rounded border border-border bg-surface px-2 py-0.5 text-xs text-foreground-subtle hover:bg-surface-hover`,children:`Decode… (advisory)`})]}),l&&H(Ut,{nodeId:t,nodeName:d,concern:l,open:l!==null,onClose:()=>u(null)}),H(`div`,{className:M?`pr-[360px]`:``,children:C.length>0?H(k,{tree:C,agents:w,getCellState:T,onCellClick:D,selectedCell:a,onToggleEnabled:O}):H(`div`,{className:`text-xs text-foreground-subtle`,children:`Catalog empty.`})}),H(ue,{open:M,onClose:A,title:E?.name??``,subtitle:a?`${a.agentNodeId} · ${S}`:``,footer:L(B,{children:[H(`button`,{type:`button`,className:`px-3 py-1 text-xs border border-border rounded bg-surface hover:bg-muted`,onClick:A,children:`Cancel`}),H(`button`,{type:`button`,disabled:!s||!a||h.isPending,className:`px-3 py-1 text-xs bg-primary text-primary-foreground rounded disabled:opacity-50`,onClick:j,children:h.isPending?`Saving…`:`Save`})]}),children:E&&s&&a&&H(b,{mode:`agent`,addon:E,agentDefault:s,agentNodeId:a.agentNodeId,engineFormat:S,onChangeAgentConfig:e=>c(e)})})]})}var $t=[`detection-pipeline`,`decoder-nodeav`,`audio-analyzer`,`pipeline-runner`];function en({nodeId:e,refreshToken:t}){return L(`div`,{className:`flex flex-col h-full`,children:[H(dt,{nodeId:e,refreshToken:t}),H(`div`,{className:`flex-1 min-h-0 overflow-y-auto p-6`,children:H(qe,{nodeId:e,addonIds:$t,level:`global`,extraTabs:[{id:`assignments`,label:`Assignments`,order:-10,content:H(Ct,{nodeId:e,refreshToken:t})},{id:`tree`,label:`Pipeline`,order:39,content:H(Qt,{nodeId:e,refreshToken:t})},{id:`engines`,label:`Warm instances`,order:180,content:H(Tt,{nodeId:e,refreshToken:t})},{id:`models`,label:`Models`,order:200,content:H(Ft,{nodeId:e,refreshToken:t})}]})})]})}function tn({refreshToken:e}){let t=V(),n=E({onSuccess:()=>{t.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getPipelineAssignments`]]}),t.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getDecoderAssignments`]]}),t.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getAudioAssignments`]]})}});return L(`div`,{className:`space-y-6`,children:[H(ft,{refreshToken:e}),L(`div`,{className:`flex flex-col gap-3 @md/clustertab:flex-row @md/clustertab:items-center @md/clustertab:justify-between`,children:[L(`div`,{className:`min-w-0`,children:[H(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Placement matrix`}),H(`p`,{className:`text-[11px] text-foreground-subtle`,children:`Pipeline · decoder · audio assignments per camera. Click the kebab to pin / unpin / move any role; expand the chevron for the per-camera broker drill-down.`})]}),L(`button`,{type:`button`,onClick:()=>n.mutate(void 0),disabled:n.isPending,className:`inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-white hover:bg-primary/90 disabled:opacity-50 shrink-0 self-start @md/clustertab:self-auto whitespace-nowrap`,children:[H(Ee,{className:`h-3.5 w-3.5`}),n.isPending?`Rebalancing…`:`Rebalance pipelines`]})]}),H(_t,{mode:`cluster`})]})}z();var nn={...Gt,label:`Max cameras (all nodes)`};function rn(e){return typeof e==`number`&&e>0?Math.floor(e):null}function an(e){return e===null?`∞`:String(e)}function on(){let e=V(),t=i(void 0),n=m(void 0),a=F(),o=t.data??[],s=n.data??[],c=new Map(o.map(e=>[e.id,e.name])),l=o.map(e=>e.id),u=s.map(e=>({agentNodeId:e.nodeId,maxCameras:e.settings.maxCameras})),d=Kt(u),[f,p]=I(null),[h,g]=I(!1),[_,v]=I(null),y=pe(!1);U(()=>{y.current||t.isLoading||n.isLoading||(y.current=!0,p(d.kind===`uniform`?d.value:null))},[t.isLoading,n.isLoading,d]);let b=qt(u,l,f);return L(`div`,{className:`rounded-lg border border-border bg-surface p-4 space-y-3`,children:[L(`div`,{children:[H(`h3`,{className:`text-xs font-semibold text-foreground`,children:`Max cameras — all nodes`}),H(`p`,{className:`text-[11px] text-foreground-subtle mt-0.5`,children:`Set the per-node camera cap across the whole cluster. Applies to every node whose current value differs; per-node tabs remain independently editable.`})]}),H(`div`,{className:`max-w-md`,children:H(r,{field:nn,values:{maxCameras:f},disabled:h,onChange:(e,t)=>p(rn(t))})}),d.kind===`mixed`&&L(`p`,{className:`text-[10px] text-warning`,children:[`Mixed (per-node values differ):`,` `,d.perNode.map(e=>`${c.get(e.agentNodeId)??e.agentNodeId} ${an(e.maxCameras)}`).join(` · `)]}),L(`div`,{className:`flex items-center gap-3`,children:[H(`button`,{type:`button`,onClick:async()=>{g(!0),v(null);let t=0,n=[];for(let e of b)try{await a.mutateAsync({agentNodeId:e,maxCameras:f}),t+=1}catch(t){n.push({nodeId:e,message:t instanceof Error?t.message:String(t)})}g(!1),v({ok:t,failures:n}),e.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`listAgentSettings`]]}),e.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getAgentSettings`]]})},disabled:h||b.length===0,className:`rounded bg-primary px-3 py-1 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:h?`Applying…`:`Apply to all nodes (${b.length})`}),b.length===0&&!h&&H(`span`,{className:`text-[10px] text-foreground-subtle`,children:`All nodes already match.`})]}),_&&L(`div`,{className:`space-y-1 text-[10px]`,children:[_.ok>0&&L(`p`,{className:`text-success`,children:[`Applied to `,_.ok,` node(s).`]}),_.failures.map(e=>L(`p`,{className:`text-destructive`,children:[c.get(e.nodeId)??e.nodeId,`: `,e.message]},e.nodeId))]})]})}var sn=[`pipeline-orchestrator`];function cn({refreshToken:e}){return L(`div`,{className:`space-y-4 max-w-3xl`,children:[H(on,{}),H(qe,{nodeId:`hub`,addonIds:sn,level:`global`,title:`Cluster settings`,description:`Cluster-wide orchestration knobs: enabled nodes, load balancer thresholds, and failover policy. Per-camera pipelines live in Device Overrides; live cluster load is on the Assignments tab.`})]})}z();function ln({refreshToken:e}){let t=V(),{data:n,isLoading:r}=O(),[i,a]=I(null),[o,s]=I(``),[c,l]=I(``),u=()=>{t.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`listTemplates`]]})},d=N({onSuccess:()=>{a(null),u()}}),p=f({onSuccess:u}),m=e=>{a(e.id),s(e.name),l(e.description??``)},h=()=>{a(null),s(``),l(``)},g=()=>{if(!i)return;let e=c.trim();d.mutate({id:i,name:o.trim()||`Untitled`,...e?{description:e}:{}})};if(r)return H(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading templates…`});let _=[...n??[]].toSorted((e,t)=>e.name.localeCompare(t.name));return H(`div`,{className:`space-y-6 max-w-4xl`,children:L(`section`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[L(`div`,{className:`border-b border-border px-4 py-3 flex items-center justify-between`,children:[L(`div`,{children:[H(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Templates`}),H(`p`,{className:`text-[11px] text-foreground-subtle mt-0.5`,children:`Curated pipeline presets operators can apply to any camera. Apply-time is a copy — future edits to a template don't retroactively change cameras that were seeded from it. Save a template from the device Pipeline tab.`})]}),L(`div`,{className:`text-[11px] text-foreground-subtle`,children:[_.length,` template`,_.length===1?``:`s`]})]}),_.length===0?L(`div`,{className:`px-4 py-8 text-xs text-foreground-subtle flex flex-col items-center gap-2`,children:[H(Oe,{className:`h-6 w-6 opacity-40`}),H(`div`,{children:`No templates yet. Create one from a device Pipeline tab ("Save as template").`})]}):H(`ul`,{className:`divide-y divide-border`,children:_.map(e=>{let t=i===e.id;return H(`li`,{className:`px-4 py-3 text-xs`,children:L(`div`,{className:`flex items-start gap-3`,children:[H(`div`,{className:`flex-1 min-w-0`,children:t?L(`div`,{className:`space-y-2`,children:[H(`input`,{className:`w-full rounded border border-border bg-surface-hover px-2 py-1 text-xs text-foreground focus:outline-none focus:border-primary`,value:o,onChange:e=>s(e.target.value),placeholder:`Template name`,autoFocus:!0}),H(`input`,{className:`w-full rounded border border-border bg-surface-hover px-2 py-1 text-[11px] text-foreground focus:outline-none focus:border-primary`,value:c,onChange:e=>l(e.target.value),placeholder:`Description (optional)`})]}):L(B,{children:[H(`div`,{className:`font-medium text-foreground`,children:e.name}),e.description&&H(`div`,{className:`text-foreground-subtle mt-0.5`,children:e.description}),L(`div`,{className:`mt-1 font-mono text-[10px] text-foreground-subtle`,children:[`engine `,e.config.engine.runtime,`/`,e.config.engine.backend,` ·`,` `,e.config.steps.length,` step(s)`,e.config.audio?.enabled?` · audio`:``,L(`span`,{className:`ml-2`,children:[`updated `,new Date(e.updatedAt).toLocaleString()]})]})]})}),H(`div`,{className:`flex items-center gap-1 shrink-0`,children:t?L(B,{children:[L(`button`,{type:`button`,onClick:g,disabled:d.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium bg-primary text-white hover:bg-primary/90 disabled:opacity-50`,children:[H(Fe,{className:`h-3 w-3`}),`Save`]}),L(`button`,{type:`button`,onClick:h,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover`,children:[H(ze,{className:`h-3 w-3`}),`Cancel`]})]}):L(B,{children:[H(`button`,{type:`button`,onClick:()=>m(e),title:`Rename`,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,children:H(De,{className:`h-3 w-3`})}),H(`button`,{type:`button`,onClick:()=>{confirm(`Delete template "${e.name}"?`)&&p.mutate({id:e.id})},disabled:p.isPending,title:`Delete`,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[11px] text-foreground-subtle hover:text-red-400 hover:bg-surface-hover disabled:opacity-50`,children:H(He,{className:`h-3 w-3`})})]})})]})},e.id)})})]})})}z();function un(e,t){if(!e)return null;for(let n of e.slots)for(let e of n.addons)if(e.id===t)return e;return null}function dn({nodeId:t,refreshToken:n}){let r=V(),a=_e().trpcClient,[o,s]=I(null),[c,l]=I(null),u=m(void 0,{refetchOnMount:`always`});J([`nodes`,`topology`],[`agent.online`,`agent.offline`,`agent.unregistered`,`addon.installed`,`addon.uninstalled`,`addon.updated`]);let d=i(void 0,{refetchOnMount:`always`}),f=R(()=>{let e=new Set;for(let t of d.data??[])t.isOnline&&e.add(t.id);return e},[d.data]),p=_({nodeId:t},{refetchOnMount:`always`}),h=R(()=>(u.data??[]).filter(e=>f.has(e.nodeId)).map(e=>e.nodeId),[u.data,f]),g=ge({enabled:h.length>0,queryKey:[[`pipelineExecutor`,`getSchema`],`schema-by-agent`,h.join(`,`),n],queryFn:async()=>{let e={};for(let t of h)try{e[t]=(await a.pipelineExecutor.getSchema.query({nodeId:t})).selectedEngine.format}catch{e[t]=`coreml`}return e}}),v=e({onSuccess:()=>{r.invalidateQueries({queryKey:[[`pipelineOrchestrator`]]}),r.invalidateQueries({queryKey:[[`pipelineExecutor`]]}),r.invalidateQueries({queryKey:[[`addonSettings`]]})}}),y=R(()=>p.data?P(p.data):[],[p.data]),x=R(()=>{let e=u.data??[],t=f;return(t.size===0?[]:e.filter(e=>t.has(e.nodeId))).map(e=>{let t=g.data?.[e.nodeId];return{agentNodeId:e.nodeId,engineLabel:t??`(engine unknown)`}})},[u.data,g.data,f]),S=(e,t)=>{let n=(u.data?.find(e=>e.nodeId===t))?.settings.addonDefaults[e],r=g.data?.[t];return!un(p.data??null,e)?.models.some(e=>r!==void 0&&!!e.formats[r])||!n?{kind:`na`}:n.enabled?{kind:`enabled`,modelId:n.modelId}:{kind:`disabled`}},C=o?u.data?.find(e=>e.nodeId===o.agentNodeId)??null:null,w=o&&p.data?un(p.data,o.addonId):null,T=o?g.data?.[o.agentNodeId]??`coreml`:`coreml`,E=()=>{s(null),l(null)},D=(e,t)=>{let n=(u.data?.find(e=>e.nodeId===t))?.settings.addonDefaults[e]??null;s({addonId:e,agentNodeId:t}),l(n)},O=()=>{!c||!o||!C||v.mutate({agentNodeId:o.agentNodeId,defaults:{...C.settings.addonDefaults,[o.addonId]:c}},{onSuccess:E})};if(u.isLoading||p.isLoading)return H(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading agents…`});if(!p.data)return L(`div`,{className:`text-xs text-foreground-subtle`,children:[`Catalog unavailable for `,t,`.`]});let A=o!==null&&w!==null&&c!==null;return L(`div`,{className:`relative h-full w-full space-y-3`,children:[H(Wt,{title:`Cluster cameras`}),H(`div`,{className:A?`pr-[360px]`:``,children:y.length>0&&x.length>0?H(k,{tree:y,agents:x,getCellState:S,onCellClick:D,selectedCell:o}):H(`div`,{className:`text-xs text-foreground-subtle`,children:`No agents or catalog empty.`})}),H(ue,{open:A,onClose:E,title:w?.name??``,subtitle:o?`${o.agentNodeId} · ${T}`:``,footer:L(B,{children:[H(`button`,{type:`button`,className:`px-3 py-1 text-xs border border-border rounded bg-surface hover:bg-muted`,onClick:E,children:`Cancel`}),H(`button`,{type:`button`,disabled:!c||!o||v.isPending,className:`px-3 py-1 text-xs bg-primary text-primary-foreground rounded disabled:opacity-50`,onClick:O,children:v.isPending?`Saving…`:`Save`})]}),children:w&&c&&o&&H(b,{mode:`agent`,addon:w,agentDefault:c,agentNodeId:o.agentNodeId,engineFormat:T,onChangeAgentConfig:e=>l(e)})})]})}z();function fn({types:e}){let t=V(),n=u(),{data:r}=ie({}),i=oe(),a=R(()=>i.data??[],[i.data]),[o,s]=I(null),[c,l]=I(null),d=()=>{t.invalidateQueries({queryKey:[[`storage`,`listLocations`]]})},f=te({onSuccess:d}),p=ee({onSuccess:d}),m=R(()=>{let e=new Map;for(let t of r??[]){let n=e.get(t.type);n?n.push(t):e.set(t.type,[t])}return e},[r]),h=e=>{e.isDefault||f.mutate({id:e.id,type:e.type,providerId:e.providerId,displayName:e.displayName,config:e.config,isDefault:!0})},g=async e=>{if(e.isDefault){await n({title:`Cannot delete default location`,message:`"${e.displayName}" is the default for type "${e.type}". Mark another as default first.`,confirmLabel:`OK`,variant:`warning`});return}await n({title:`Delete location "${e.displayName}"?`,message:`Removes the record; files on disk are untouched.`,confirmLabel:`Delete`,variant:`danger`})&&p.mutate({id:e.id})},_=e.map(e=>a.find(t=>t.id===e)).filter(e=>e!==void 0);return L(`div`,{className:`space-y-3`,children:[_.length===0?H(`p`,{className:`text-[11px] text-foreground-subtle italic`,children:`No storage locations declared for this purpose.`}):_.map(e=>H(Se,{type:e.id,displayName:e.displayName,description:e.description,cardinality:e.cardinality,locations:m.get(e.id)??[],onAdd:e=>s(e),onEdit:e=>l(e),onDelete:e=>{g(e)},onSetDefault:e=>h(e)},e.id)),o!==null&&H(Ce,{initialType:o,onClose:()=>s(null),onCreated:()=>{d(),s(null)}}),c!==null&&H(xe,{location:c,onClose:()=>l(null),onSaved:()=>{d(),l(null)}})]})}z();var pn=`pipeline-analytics`;function mn(e){for(let t of e?.sections??[])for(let e of t.fields??[])if(e.key===`postProcessingNodeId`&&typeof e.value==`string`)return e.value;return`hub`}function hn(){let e=V(),{data:t}=i(void 0),{data:n,isLoading:r}=T({addonId:pn}),a=mn(n),o=y({onSuccess:()=>{e.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),s=R(()=>{let e=(t??[]).filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,a,...e])].filter(Boolean)},[t,a]);return L(`div`,{className:`flex flex-col gap-6`,children:[L(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[H(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Post-processing node`}),H(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that runs detection post-processing (events, media, audio & motion). Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`}),L(`div`,{className:`mt-3 flex items-center gap-2`,children:[r?H(q,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):H(`select`,{value:a,onChange:e=>{e.target.value!==a&&o.mutate({addonId:pn,patch:{postProcessingNodeId:e.target.value}})},disabled:o.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:s.map(e=>H(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),o.isPending&&H(q,{className:`h-4 w-4 animate-spin text-primary`})]})]}),L(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[H(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Events folder`}),H(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`Where event crops / full frames are stored. A single folder — no collection / equal-splitting.`}),H(fn,{types:[`eventMedia`]})]})]})}z();var gn=`recorder`;function _n(e,t,n){for(let n of e?.sections??[])for(let e of n.fields??[])if(e.key===t&&typeof e.value==`string`)return e.value;return n}function vn(){let e=V(),{data:t}=i(void 0),{data:n,isLoading:r}=T({addonId:gn}),a=_n(n,`recordingNodeId`,`hub`),o=y({onSuccess:()=>{e.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),s=R(()=>{let e=(t??[]).filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,a,...e])].filter(Boolean)},[t,a]);return L(`div`,{className:`flex flex-col gap-6`,children:[L(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[H(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Recording node`}),H(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that records (continuous & events) and serves playback. Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`}),L(`div`,{className:`mt-3 flex items-center gap-2`,children:[r?H(q,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):H(`select`,{value:a,onChange:e=>{e.target.value!==a&&o.mutate({addonId:gn,patch:{recordingNodeId:e.target.value}})},disabled:o.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:s.map(e=>H(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),o.isPending&&H(q,{className:`h-4 w-4 animate-spin text-primary`})]}),a!==`hub`&&L(`p`,{className:`mt-2 text-[11px] text-amber-500`,children:[`The stream-broker is hub-only — an agent recorder pulls streams from the hub over the network. The hub's RTSP restream port must be reachable from`,` `,H(`span`,{className:`font-medium`,children:a}),`. If the auto-derived host doesn't work, set the recorder's`,H(`span`,{className:`font-medium`,children:` recordingHubHostname`}),` global setting.`]})]}),L(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[H(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Recordings folders`}),H(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`Where recordings are stored. Multi-location collections — segments are split across the locations of a type. Add a location to grow capacity; mark one default per type.`}),H(fn,{types:[`recordings`,`recordingsLow`]})]})]})}z();var yn=[{id:`assignments`,label:`Assignments`},{id:`pipeline`,label:`Pipeline`},{id:`events`,label:`Events`},{id:`recording`,label:`Recording`},{id:`settings`,label:`Settings`},{id:`templates`,label:`Templates`}];function bn({refreshToken:e}){let[t,n]=I(`assignments`),{data:r}=i(void 0),a=r?.find(e=>e.isHub&&e.isOnline)?.id??r?.find(e=>e.isOnline)?.id??null;return L(`div`,{className:`flex flex-col h-full`,children:[L(`div`,{className:`px-4 sm:px-6 py-4 border-b border-border`,children:[H(`h2`,{className:`text-base font-semibold text-foreground`,children:`Cluster Orchestration`}),H(`div`,{className:`text-[11px] text-foreground-subtle mt-1`,children:`Assignments with live load, cluster-wide settings, pipeline template library, per-camera pipeline overrides.`})]}),H(`div`,{className:`flex items-center gap-1 px-4 sm:px-6 border-b border-border overflow-x-auto`,children:yn.map(e=>H(`button`,{type:`button`,onClick:()=>n(e.id),className:`shrink-0 whitespace-nowrap px-3 py-2 text-xs font-medium border-b-2 transition-colors ${t===e.id?`border-primary text-primary`:`border-transparent text-foreground-subtle hover:text-foreground`}`,children:e.label},e.id))}),L(`div`,{className:`flex-1 min-h-0 overflow-y-auto p-4 sm:p-6 @container/clustertab`,children:[t===`assignments`&&H(tn,{refreshToken:e}),t===`pipeline`&&(a?H(dn,{nodeId:a,refreshToken:e}):H(`div`,{className:`text-xs text-foreground-subtle`,children:`No online node available — schema unreachable.`})),t===`events`&&H(hn,{}),t===`recording`&&H(vn,{}),t===`settings`&&H(cn,{refreshToken:e}),t===`templates`&&H(ln,{refreshToken:e})]})]})}function xn(e){let{assignment:t,detection:n}=e;return n!==null&&n.provisioning.state===`failed`||t.detectionNodeId===null&&n===null?`error`:n!==null&&n.phase===`active`?`healthy`:`idle`}z();var Sn={healthy:`bg-green-500`,idle:`bg-yellow-400`,error:`bg-red-500`},Cn={healthy:`Healthy`,idle:`Idle`,error:`Error`};function wn({health:e}){return H(`span`,{className:`inline-block h-2 w-2 rounded-full shrink-0 ${Sn[e]}`,title:Cn[e],"aria-label":Cn[e],role:`img`})}function Tn({selectedDeviceId:e,onSelect:t}){let{data:n}=Ge(),{data:r}=w({}),i=R(()=>{let e=new Map;for(let t of r??[])e.set(t.deviceId,t);return e},[r]),a=R(()=>(n??[]).filter(e=>e.isCamera).map(e=>{let t=i.get(e.id);return{deviceId:e.id,name:e.name,health:t===void 0?`idle`:xn(t)}}),[n,i]);return a.length===0?H(`div`,{className:`px-4 py-6 text-center text-[11px] text-foreground-subtle italic`,children:`No cameras found`}):H(`ul`,{className:`divide-y divide-border`,children:a.map(n=>{let r=n.deviceId===e;return H(`li`,{children:L(`button`,{type:`button`,onClick:()=>t(n.deviceId),className:[`w-full flex items-center gap-2.5 px-4 py-3 text-left transition-colors`,r?`bg-surface-active text-foreground`:`hover:bg-surface-hover text-foreground-subtle hover:text-foreground`].join(` `),"aria-pressed":r,children:[H(wn,{health:n.health}),L(`span`,{className:`flex-1 min-w-0`,children:[H(`span`,{className:`block truncate text-[12px] font-medium leading-tight`,children:n.name}),L(`span`,{className:`block text-[10px] text-foreground-subtle leading-tight mt-0.5`,children:[`#`,n.deviceId]})]})]})},n.deviceId)})})}var $={camera:0,source:200,broker:400,decoder:600,motion:800,detection:800,audio:800,recorder:800},En=120;function Dn(e,t){return e===null||t===null?!1:e!==t}function On(e){let t=e.profiles.reduce((e,t)=>e+t.subscribers,0),n=e.profiles.reduce((e,t)=>e+t.inFps,0),r=e.profiles.reduce((e,t)=>e+t.outFps,0);return`${t} subs · ${n.toFixed(1)}→${r.toFixed(1)} fps`}function kn(e){return`${e.actualFps.toFixed(1)} fps · q${e.queueDepth} · ${e.avgInferenceMs.toFixed(1)}ms`}function An(e){return`shm ${e.shm.getFrameHits+e.shm.getFrameMisses>0?Math.round(e.shm.getFrameHits/(e.shm.getFrameHits+e.shm.getFrameMisses)*100):0}% hit`}function jn(e){let t=[],n=[],r={id:`camera`,kind:`camera`,nodeId:null,data:{deviceId:e.deviceId},position:{x:$.camera,y:0}};t.push(r);let i={id:`source`,kind:`source`,nodeId:null,data:{streams:e.source.streams},position:{x:$.source,y:0}};t.push(i),n.push({id:`camera->source`,source:`camera`,target:`source`,crossNode:!1});let a=e.broker;if(a!==null){let e={id:`broker`,kind:`broker`,nodeId:null,data:{profiles:a.profiles,webrtcSessions:a.webrtcSessions,rtspRestream:a.rtspRestream},position:{x:$.broker,y:0}};t.push(e),n.push({id:`source->broker`,source:`source`,target:`broker`,crossNode:!1})}let o=e.decoder;if(o!==null){let r={id:`decoder`,kind:`decoder`,nodeId:o.nodeId,data:{nodeId:o.nodeId,formats:o.formats,sessionCount:o.sessionCount,shm:o.shm},position:{x:$.decoder,y:0}};t.push(r);let i=a===null?`source`:`broker`,s=a===null?void 0:On(a),c=a===null?An(o):s;n.push({id:`${i}->decoder`,source:i,target:`decoder`,crossNode:Dn(null,o.nodeId),...c===void 0?{}:{label:c}});let l=0,u=e.motion;if(u!==null){let e={id:`motion`,kind:`motion`,nodeId:null,data:{enabled:u.enabled,fps:u.fps},position:{x:$.motion,y:l*En}};t.push(e),n.push({id:`decoder->motion`,source:`decoder`,target:`motion`,crossNode:!1}),l++}let d=e.detection;if(d!==null){let e={id:`detection`,kind:`detection`,nodeId:d.nodeId,data:{nodeId:d.nodeId,engine:d.engine,phase:d.phase,configuredFps:d.configuredFps,actualFps:d.actualFps,queueDepth:d.queueDepth,avgInferenceMs:d.avgInferenceMs,provisioning:d.provisioning},position:{x:$.detection,y:l*En}};t.push(e),n.push({id:`decoder->detection`,source:`decoder`,target:`detection`,crossNode:Dn(o.nodeId,d.nodeId),label:kn(d)}),l++}let f=e.audio;if(f!==null){let e={id:`audio`,kind:`audio`,nodeId:f.nodeId,data:{nodeId:f.nodeId,enabled:f.enabled},position:{x:$.audio,y:l*En}};t.push(e),n.push({id:`decoder->audio`,source:`decoder`,target:`audio`,crossNode:Dn(o.nodeId,f.nodeId)}),l++}let p=e.recording;if(p!==null){let e={id:`recorder`,kind:`recorder`,nodeId:null,data:{mode:p.mode,active:p.active,storageBytes:p.storageBytes},position:{x:$.recorder,y:l*En}};t.push(e),n.push({id:`decoder->recorder`,source:`decoder`,target:`recorder`,crossNode:!1})}}return{nodes:t,edges:n}}z();function Mn(e){let{data:t,isLoading:n}=d({deviceId:e}),[r,i]=I(void 0);return U(()=>{t!==void 0&&i(t)},[t]),D(W.PipelineCameraMetricsSnapshot,t=>{let n=t.data;n.deviceId===e&&i(e=>e===void 0||e.detection===null?e:{...e,detection:{...e.detection,phase:n.metrics.phase,actualFps:n.metrics.actualFps,queueDepth:n.metrics.queueDepth,avgInferenceMs:n.metrics.avgInferenceTimeMs}})}),D(W.PipelineEngineProvisioning,e=>{let t=e.data;i(n=>{if(n===void 0||n.detection===null)return n;let r=n.detection.nodeId??n.assignment?.detectionNodeId??null;return r===null||e.source.type!==`node`||e.source.id!==r?n:{...n,detection:{...n.detection,provisioning:{state:t.state,error:t.error}}}})}),D(W.MotionAnalysis,t=>{t.source.type!==`device`||t.source.id!==e||i(e=>e===void 0||e.motion===null?e:{...e,motion:{...e.motion,enabled:!0}})}),D(W.StreamBrokerMetricsSnapshot,t=>{let n=t.data;n.deviceId===e&&i(e=>e===void 0||e.broker===null?e:{...e,broker:{...e.broker,profiles:e.broker.profiles.map(e=>e.profile===n.profile?{...e,subscribers:n.stats.encodedSubscribers+n.stats.decodedSubscribers,inFps:n.stats.inputFps,outFps:n.stats.decodeFps}:e)}})}),D(W.PipelineAudioInferenceResult,t=>{t.data.deviceId===e&&i(e=>e===void 0||e.audio===null?e:{...e,audio:{...e.audio,enabled:!0}})}),D(W.RecordingStarted,t=>{t.data.deviceId===e&&i(e=>e===void 0||e.recording===null?e:{...e,recording:{...e.recording,active:!0}})}),D(W.RecordingStopped,t=>{t.data.deviceId===e&&i(e=>e===void 0||e.recording===null?e:{...e,recording:{...e.recording,active:!1}})}),{status:r,isLoading:n}}function Nn({data:e}){return L(`div`,{className:`border border-border rounded-lg bg-background shadow-sm min-w-[160px] px-3 py-2`,children:[H(X,{type:`source`,position:Y.Right}),L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`h-2 w-2 rounded-full bg-green-500 shrink-0`,"aria-label":`healthy`}),L(`span`,{className:`text-sm font-semibold truncate`,children:[`Camera #`,e.deviceId]})]}),H(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`source`})]})}function Pn(e){return e>0?`bg-green-500`:`bg-yellow-500`}function Fn({data:e}){let t=e.streams[0],n=e.streams.length;return L(`div`,{className:`border border-border rounded-lg bg-background shadow-sm min-w-[160px] px-3 py-2`,children:[H(X,{type:`target`,position:Y.Left}),H(X,{type:`source`,position:Y.Right}),L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`h-2 w-2 rounded-full shrink-0 ${Pn(n)}`,"aria-label":n>0?`healthy`:`idle`}),H(`span`,{className:`text-sm font-semibold`,children:`Source`}),L(`span`,{className:`text-xs text-muted-foreground`,children:[n,` streams`]})]}),t!==void 0&&L(`div`,{className:`text-xs text-muted-foreground mt-1`,children:[t.codec,` `,t.width,`×`,t.height,` `,t.fps,`fps`]})]})}function In(e){return e>0?`bg-green-500`:`bg-yellow-500`}function Ln({data:e}){let t=e.profiles.reduce((e,t)=>e+t.subscribers,0),n=e.profiles.length;return L(`div`,{className:`border border-border rounded-lg bg-background shadow-sm min-w-[160px] px-3 py-2`,children:[H(X,{type:`target`,position:Y.Left}),H(X,{type:`source`,position:Y.Right}),L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`h-2 w-2 rounded-full shrink-0 ${In(t)}`,"aria-label":t>0?`healthy`:`idle`}),H(`span`,{className:`text-sm font-semibold`,children:`Broker`}),L(`span`,{className:`text-xs text-muted-foreground`,children:[n,` profiles`]})]}),L(`div`,{className:`text-xs text-muted-foreground mt-1`,children:[t,` subs · WebRTC `,e.webrtcSessions,e.rtspRestream&&` · RTSP`]})]})}function Rn(e){return e>0?`bg-green-500`:`bg-yellow-500`}function zn(e,t){let n=e+t;return n>0?Math.round(e/n*100):0}function Bn({data:e}){let t=zn(e.shm.getFrameHits,e.shm.getFrameMisses);return L(`div`,{className:`border border-border rounded-lg bg-background shadow-sm min-w-[160px] px-3 py-2`,children:[H(X,{type:`target`,position:Y.Left}),H(X,{type:`source`,position:Y.Right}),L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`h-2 w-2 rounded-full shrink-0 ${Rn(e.sessionCount)}`,"aria-label":e.sessionCount>0?`healthy`:`idle`}),H(`span`,{className:`text-sm font-semibold`,children:`Decoder`}),L(`span`,{className:`text-xs text-muted-foreground`,children:[`@`,e.nodeId]})]}),L(`div`,{className:`text-xs text-muted-foreground mt-1`,children:[e.formats.join(`, `),` · `,e.sessionCount,` sessions`]}),L(`div`,{className:`text-xs text-muted-foreground`,children:[`shm `,t,`% hit`]})]})}function Vn(e){return e?`bg-green-500`:`bg-yellow-500`}function Hn({data:e}){return L(`div`,{className:`border border-border rounded-lg bg-background shadow-sm min-w-[160px] px-3 py-2`,children:[H(X,{type:`target`,position:Y.Left}),L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`h-2 w-2 rounded-full shrink-0 ${Vn(e.enabled)}`,"aria-label":e.enabled?`enabled`:`disabled`}),H(`span`,{className:`text-sm font-semibold`,children:`Motion`})]}),L(`div`,{className:`text-xs text-muted-foreground mt-1`,children:[e.enabled?`enabled`:`disabled`,` · `,e.fps,` fps`]})]})}function Un(e){return e.provisioning.state===`failed`?`bg-red-500`:e.phase===`active`?`bg-green-500`:(e.phase,`bg-yellow-500`)}function Wn(e){return e===`ready`?`bg-green-500 text-white`:e===`failed`?`bg-red-500 text-white`:`bg-yellow-500 text-white`}function Gn({data:e}){return L(`div`,{className:`border border-border rounded-lg bg-background shadow-sm min-w-[180px] px-3 py-2`,children:[H(X,{type:`target`,position:Y.Left}),L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`h-2 w-2 rounded-full shrink-0 ${Un(e)}`,"aria-label":e.phase}),H(`span`,{className:`text-sm font-semibold`,children:`Detection`}),L(`span`,{className:`text-xs text-muted-foreground`,children:[`@`,e.nodeId]})]}),L(`div`,{className:`text-xs text-muted-foreground mt-1`,children:[e.engine.backend,`·`,e.engine.device,` · `,e.phase]}),L(`div`,{className:`text-xs text-muted-foreground`,children:[e.actualFps.toFixed(1),`/`,e.configuredFps,` fps · q`,e.queueDepth,` ·`,` `,e.avgInferenceMs.toFixed(1),`ms`]}),L(`div`,{className:`flex items-center gap-1 mt-1`,children:[H(`span`,{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded ${Wn(e.provisioning.state)}`,"aria-label":`provisioning ${e.provisioning.state}`,children:e.provisioning.state}),e.provisioning.state===`failed`&&e.provisioning.error!==void 0&&H(`span`,{className:`text-[10px] text-red-500 truncate`,children:e.provisioning.error})]})]})}function Kn(e){return e?`bg-green-500`:`bg-yellow-500`}function qn({data:e}){return L(`div`,{className:`border border-border rounded-lg bg-background shadow-sm min-w-[160px] px-3 py-2`,children:[H(X,{type:`target`,position:Y.Left}),L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`h-2 w-2 rounded-full shrink-0 ${Kn(e.enabled)}`,"aria-label":e.enabled?`enabled`:`disabled`}),H(`span`,{className:`text-sm font-semibold`,children:`Audio`}),L(`span`,{className:`text-xs text-muted-foreground`,children:[`@`,e.nodeId]})]}),H(`div`,{className:`text-xs text-muted-foreground mt-1`,children:e.enabled?`enabled`:`disabled`})]})}function Jn(e){return e.mode===`off`?`bg-red-500`:e.active?`bg-green-500`:`bg-yellow-500`}function Yn(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GB`:`${(e/1048576).toFixed(1)} MB`}function Xn({data:e}){return L(`div`,{className:`border border-border rounded-lg bg-background shadow-sm min-w-[160px] px-3 py-2`,children:[H(X,{type:`target`,position:Y.Left}),L(`div`,{className:`flex items-center gap-2`,children:[H(`span`,{className:`h-2 w-2 rounded-full shrink-0 ${Jn(e)}`,"aria-label":e.active?`active`:e.mode===`off`?`off`:`inactive`}),H(`span`,{className:`text-sm font-semibold`,children:`Recorder`}),H(`span`,{className:`text-xs text-muted-foreground`,children:e.mode})]}),L(`div`,{className:`text-xs text-muted-foreground mt-1`,children:[e.active?`active`:`inactive`,` · `,Yn(e.storageBytes)]})]})}z();var Zn={camera:Nn,source:Fn,broker:Ln,decoder:Bn,motion:Hn,detection:Gn,audio:qn,recorder:Xn},Qn={stroke:`#f59e0b`,strokeWidth:2},$n={strokeWidth:1.5};function er({deviceId:e}){let{status:t,isLoading:n}=Mn(e),{rfNodes:r,rfEdges:i}=R(()=>{if(t===void 0)return{rfNodes:[],rfEdges:[]};let e=jn(t);return{rfNodes:e.nodes.map(e=>({id:e.id,type:e.kind,position:{x:e.position.x,y:e.position.y},data:{...e.data}})),rfEdges:e.edges.map(e=>({id:e.id,source:e.source,target:e.target,animated:e.crossNode,style:e.crossNode?Qn:$n,label:e.label}))}},[t]);return n?H(`div`,{className:`flex items-center justify-center h-full text-sm text-muted-foreground`,children:`Loading…`}):t===void 0?H(`div`,{className:`flex items-center justify-center h-full text-sm text-muted-foreground`,children:`No pipeline data`}):H(`div`,{className:`w-full h-full`,children:L(Je,{nodes:r,edges:i,nodeTypes:Zn,fitView:!0,proOptions:{hideAttribution:!0},children:[H(Xe,{gap:20,size:1}),H(Ye,{showInteractive:!1})]})})}z();var tr=`__cluster__`;function nr(e){return e===`cameras`?`cameras`:`nodes`}function rr(){let[e,t]=Ie(),n=nr(e.get(`view`)),r=e.get(`node`)??`__cluster__`,i=e.get(`camera`),a=i===null?null:parseInt(i,10),[o,s]=I(0);return U(()=>{n===`nodes`&&!e.get(`node`)&&t({view:`nodes`,node:tr},{replace:!0})},[n,e,t]),L(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[L(`div`,{className:`flex items-center justify-between gap-4 px-4 py-3 border-b border-border shrink-0`,children:[L(`div`,{className:`flex items-center gap-1 rounded-lg border border-border p-0.5 bg-surface`,children:[H(`button`,{type:`button`,onClick:()=>{t({view:`nodes`,node:r},{replace:!0})},className:[`px-3 py-1 rounded-md text-[11px] font-medium transition-colors`,n===`nodes`?`bg-background text-foreground shadow-sm`:`text-foreground-subtle hover:text-foreground`].join(` `),children:`Nodes`}),H(`button`,{type:`button`,onClick:()=>{let e={view:`cameras`};a!==null&&(e.camera=String(a)),t(e,{replace:!0})},className:[`px-3 py-1 rounded-md text-[11px] font-medium transition-colors`,n===`cameras`?`bg-background text-foreground shadow-sm`:`text-foreground-subtle hover:text-foreground`].join(` `),children:`Cameras`})]}),L(`button`,{type:`button`,onClick:()=>s(e=>e+1),title:`Refresh`,className:`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,children:[H(ke,{className:`h-3.5 w-3.5`}),`Refresh`]})]}),H(`div`,{className:`flex-1 flex flex-col md:flex-row overflow-hidden min-h-0`,children:n===`nodes`?L(B,{children:[H(`aside`,{className:`w-full md:w-72 shrink-0 border-b md:border-b-0 md:border-r border-border overflow-y-auto`,children:H(ut,{selectedNodeId:r,onSelect:e=>{t({view:`nodes`,node:e},{replace:!0})},refreshToken:o})}),H(`section`,{className:`flex-1 min-h-0 overflow-hidden`,children:r===`__cluster__`?H(bn,{refreshToken:o}):H(en,{nodeId:r,refreshToken:o})})]}):L(B,{children:[H(`aside`,{className:`w-full md:w-72 shrink-0 border-b md:border-b-0 md:border-r border-border overflow-y-auto`,children:H(Tn,{selectedDeviceId:a,onSelect:e=>{t({view:`cameras`,camera:String(e)},{replace:!0})}})}),H(`section`,{className:`flex-1 min-h-0 overflow-hidden`,children:a!==null&&Number.isFinite(a)&&!Number.isNaN(a)?H(er,{deviceId:a}):H(`div`,{className:`flex items-center justify-center h-full text-sm text-foreground-subtle`,children:`Select a camera to view its pipeline flow`})})]})})]})}export{rr as PipelinePage};
@@ -1 +0,0 @@
1
- import{Ca as e,Sa as t,wa as n}from"./src-1618avTR.js";import{G as r,I as i,K as a,S as o,W as s,Z as c,b as ee,x as l,z as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js";import{L as d,V as f,c as te,g as p,n as m,p as h,s as g}from"./player-overlays-BK-_BrgW.js";import{MaskShapeCanvas as _}from"./MaskShapeCanvas-CQ2SgaNa.js";var ne=p(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]);c();var re=120,ie=`privacy-mask`,v=`rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,y=`rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors`;function b(e){return e.kind===`rect`||e.kind===`polygon`?e:null}function x(e){let t=new Set(e.map(e=>e.id)),n=0;for(;t.has(n);)n+=1;return n}function S(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(JSON.stringify(e[n])!==JSON.stringify(t[n]))return!1;return!0}function C({deviceId:c}){let p=te(h().trpcClient,c),[C,w]=a(null),[T,E]=a(!1),[D,O]=a(null),[k,A]=a(null),[j,M]=a(!1),[N,P]=a(!1),[F,I]=a(null),[L,R]=a(null),z=r(!1);u(()=>{if(!p)return;let e=!1;return z.current=!1,w(null),E(!1),O(null),A(null),P(!1),I(null),R(null),(async()=>{try{let t=await p.privacyMask?.getOptions({});if(e)return;if(!t)throw Error(`device proxy not ready`);if(w(t),z.current)return;let n=await p.privacyMask?.getStatus({});if(e)return;if(!n)throw Error(`device proxy not ready`);z.current=!0;let r={enabled:n.enabled,regions:n.regions};A(r),O(r)}catch(t){if(e)return;f(t)?E(!0):console.error(`Privacy Mask load failed`,t)}})(),()=>{e=!0}},[p]);let B=s(()=>D!==null&&k!==null&&(D.enabled!==k.enabled||!S(D.regions,k.regions)),[D,k]),V=D?D.regions.length:0,H=C?C.maxRegions:0,U=r(0);u(()=>{U.current=H},[H]);let W=H>0&&V>=H,G=i(()=>{O(e=>e&&{...e,enabled:!e.enabled})},[]),K=i(e=>{I(typeof e==`number`?e:null)},[]),q=s(()=>D?D.regions.map(e=>({id:e.id,shape:e.shape,enabled:e.enabled,label:`Zone ${String(e.id)}`})):[],[D]),J=i((e,t)=>{let n=b(t);n&&O(t=>t&&{...t,regions:t.regions.map(t=>t.id===e?{...t,shape:n}:t)})},[]),Y=i(e=>{let t=b(e);t&&(R(null),O(e=>{if(!e)return e;let n=U.current;if(n>0&&e.regions.length>=n)return e;let r=x(e.regions),i={id:r,enabled:!0,shape:t};return I(r),{...e,regions:[...e.regions,i]}}))},[]),X=i(e=>{P(!0),I(null),R(e)},[]),ae=i(e=>{P(!0),R(null),I(e)},[]),oe=i(e=>{I(t=>t===e?null:t),O(t=>t&&{...t,regions:t.regions.filter(t=>t.id!==e)})},[]),Z=i(()=>{R(null),I(null),k&&O({enabled:k.enabled,regions:k.regions})},[k]),se=i(async()=>{if(!(!p||!D)){M(!0);try{await p.privacyMask?.setMask({patch:{enabled:D.enabled,regions:[...D.regions]}});let e=await p.privacyMask?.getStatus({});if(e){let t={enabled:e.enabled,regions:e.regions};A(t),O(t)}}catch(e){console.error(`Privacy Mask save failed`,e)}finally{M(!1)}}},[p,D]),ce=i(()=>{P(e=>(e&&(R(null),I(null)),!e))},[]),Q=C?.supportedShapes??[];m(s(()=>N&&!T&&C&&D?{id:ie,order:re,node:l(_,{transparent:!0,items:q,supportedShapes:Q,polygonVertices:C.polygonVertices,selectedId:F,onSelect:K,onShapeChange:J,onDrawComplete:Y,drawingKind:L})}:null,[N,T,C,D,q,Q,F,K,J,Y,L]));let le=C?.supportedShapes.includes(`rect`)??!1,ue=C?.supportedShapes.includes(`polygon`)??!1,$=C!==null&&(C.maxRegions<=0||C.supportedShapes.length===0);return p?l(g,{title:`Privacy Mask`,icon:l(n,{className:`h-3.5 w-3.5 text-foreground-subtle`}),children:l(`div`,{className:`flex flex-col gap-3`,children:T||$?l(`p`,{className:`${d} leading-relaxed`,children:`This camera doesn't support an on-board privacy mask.`}):!T&&!$&&C!==null&&D!==null?o(ee,{children:[o(`p`,{className:`${d} leading-relaxed`,children:[`Toggle `,l(`strong`,{className:`text-foreground`,children:`Edit mask`}),` to draw blanked-out zones on the live frame, then `,l(`strong`,{className:`text-foreground`,children:`Save`}),` to push them to the camera. Drag a rectangle to move, its corner to resize; drag polygon vertices, click an edge midpoint to add one, or right-click a vertex to remove it.`]}),o(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[l(`button`,{type:`button`,onClick:ce,disabled:j,"aria-pressed":N,className:N?y:v,children:N?`Done editing`:`Edit mask`}),l(`button`,{type:`button`,onClick:G,disabled:j,"aria-pressed":D.enabled,className:D.enabled?y:v,children:D.enabled?`Mask on`:`Mask off`}),le&&l(`button`,{type:`button`,onClick:()=>X(`rect`),disabled:j||W,"aria-pressed":L===`rect`,className:L===`rect`?y:v,title:W?`Maximum zones reached`:`Add a rectangle zone`,children:`+ Rect`}),ue&&l(`button`,{type:`button`,onClick:()=>X(`polygon`),disabled:j||W,"aria-pressed":L===`polygon`,className:L===`polygon`?y:v,title:W?`Maximum zones reached`:`Add a polygon zone`,children:`+ Polygon`}),o(`span`,{className:`${d} ml-1 tabular-nums`,children:[V,` / `,H,` zones`]}),l(`span`,{className:`flex-1`}),l(`button`,{type:`button`,onClick:Z,disabled:j||!B,className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,children:`Revert`}),l(`button`,{type:`button`,onClick:()=>void se(),disabled:j||!B,className:y,children:j?`Saving…`:`Save`})]}),V>0?l(`div`,{className:`flex flex-col gap-1`,children:D.regions.map(n=>{let r=F===n.id,i=n.shape.kind===`polygon`?ne:e;return o(`div`,{className:`flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${r?`border-primary/50 bg-primary/10`:`border-border bg-surface`}`,children:[o(`button`,{type:`button`,onClick:()=>ae(n.id),disabled:j,className:`flex flex-1 items-center gap-2 text-left text-[11px] font-medium text-foreground-subtle hover:text-foreground disabled:opacity-40 transition-colors`,children:[l(i,{className:`h-3.5 w-3.5 shrink-0`}),o(`span`,{children:[`Zone `,n.id]}),l(`span`,{className:`text-foreground-faint capitalize`,children:n.shape.kind})]}),l(`button`,{type:`button`,onClick:()=>oe(n.id),disabled:j,"aria-label":`Delete zone ${String(n.id)}`,title:`Delete zone`,className:`inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors`,children:l(t,{className:`h-3.5 w-3.5`})})]},n.id)})}):null]}):l(`p`,{className:`${d} leading-relaxed`,children:`Loading the camera's privacy mask…`})})}):null}export{C as PrivacyMaskSettings};
@@ -1 +0,0 @@
1
- import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-Bj4tGzk2.js";import{t as e}from"./vite-preload-helper-zJ_50EbN.js";var t={"@camstack/sdk":async()=>await e(()=>import(`./dist-LQLUbjed.js`),[]),"@camstack/types":async()=>await e(()=>import(`./dist-DK88lvvz.js`),[]),"@camstack/ui-library":async()=>await e(()=>import(`./src-1618avTR.js`).then(e=>e.t),[]),"@tanstack/react-query":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js`).then(e=>e.y),[]),"@trpc/client":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CSJxMxg6.js`).then(e=>e.A),[]),"@trpc/react-query":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DqrXu-jG.js`).then(e=>e.r),[]),konva:async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__konva__loadShare__.js-B7XYY0cV.js`).then(e=>e.n),[]),react:async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js`).then(e=>(e.$(),e.Q)),[]),"react-dom":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-DcnMG4y9.js`).then(e=>(e.a(),e.i)),[]),"react-dom/client":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-CUURKTLp.js`).then(e=>e.r),[]),"react-konva":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-xmx-auwe.js`).then(e=>e.u),[]),"react/jsx-runtime":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js`).then(e=>e.w),[])},n={"@camstack/sdk":{name:`@camstack/sdk`,version:`1.1.13`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/sdk`].loaded=!0;let{"@camstack/sdk":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.1.13`}},"@camstack/types":{name:`@camstack/types`,version:`1.1.17`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/types`].loaded=!0;let{"@camstack/types":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.1.17`}},"@camstack/ui-library":{name:`@camstack/ui-library`,version:`1.1.16`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@camstack/ui-library`].loaded=!0;let{"@camstack/ui-library":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^1.1.16`}},"@tanstack/react-query":{name:`@tanstack/react-query`,version:`5.101.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@tanstack/react-query`].loaded=!0;let{"@tanstack/react-query":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^5.101.0`}},"@trpc/client":{name:`@trpc/client`,version:`11.18.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@trpc/client`].loaded=!0;let{"@trpc/client":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^11.18.0`}},"@trpc/react-query":{name:`@trpc/react-query`,version:`11.18.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`@trpc/react-query`].loaded=!0;let{"@trpc/react-query":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^11.18.0`}},konva:{name:`konva`,version:`10.3.0`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n.konva.loaded=!0;let{konva:e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^10.3.0`}},react:{name:`react`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n.react.loaded=!0;let{react:e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-dom":{name:`react-dom`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-dom`].loaded=!0;let{"react-dom":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-dom/client":{name:`react-dom/client`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-dom/client`].loaded=!0;let{"react-dom/client":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}},"react-konva":{name:`react-konva`,version:`19.2.5`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react-konva`].loaded=!0;let{"react-konva":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.5`}},"react/jsx-runtime":{name:`react/jsx-runtime`,version:`19.2.7`,scope:[`default`],loaded:!1,from:`admin_ui_host`,async get(){n[`react/jsx-runtime`].loaded=!0;let{"react/jsx-runtime":e}=t,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`^19.2.7`}}},r=[];export{r as usedRemotes,n as usedShared};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Cyuzqnbw.js";import{D as t,G as n,I as r,K as i,L as a,W as o,X as s,Z as c,_ as l,a as u,c as d,f,g as p,h as m,i as h,l as g,m as _,n as v,r as y,s as ee,t as te,x as ne,z as b}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CCjPq1YD.js";import{C as x,D as S,E as re,M as C,N as w,O as T,P as ie,S as E,T as D,_ as O,a as k,b as A,c as j,d as ae,f as oe,g as se,h as ce,i as le,j as M,l as ue,m as de,n as N,o as fe,p as pe,r as P,s as me,t as he,u as ge,v as _e,w as ve,x as ye,y as be}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CSJxMxg6.js";var xe=Object.create,Se=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,we=Object.getOwnPropertyNames,Te=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty,F=(e,t)=>function(){return t||(0,e[we(e)[0]])((t={exports:{}}).exports,t),t.exports},De=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=we(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ee.call(e,s)&&s!==n&&Se(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ce(t,s))||r.enumerable});return e},I=(e,t,n)=>(n=e==null?{}:xe(Te(e)),De(t||!e||!e.__esModule?Se(n,`default`,{value:e,enumerable:!0}):n,e)),Oe=F({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),ke=F({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=Oe();function r(e,t){if(e==null)return{};var r,i,a=n(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ae=F({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),je=F({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Ae().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Me=F({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Ae().default,r=je();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ne=F({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Me();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),L=F({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Ne();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Pe=I(ke(),1),R=I(L(),1),Fe=[`cursor`,`direction`];function z(e,t,n){let r=e.flatMap(e=>e.split(`.`));if(!t&&(!n||n===`any`))return r.length?[r]:[];if(n===`infinite`&&ie(t)&&(`direction`in t||`cursor`in t)){let{cursor:e,direction:n}=t;return[r,{input:(0,Pe.default)(t,Fe),type:`infinite`}]}return[r,(0,R.default)((0,R.default)({},t!==void 0&&t!==m&&{input:t}),n&&n!==`any`&&{type:n})]}function B(e){return z(e,void 0,`any`)}function Ie(e,...t){let[n,r]=t,i=e._def().path;return z(i,n,r??`any`)}function Le(e){let t=e._def().path;return B(t)}c();function Re(e){return C(({path:t,args:n})=>{let r=[...t],i=r.pop();if(i===`useMutation`)return e[i](r,...n);if(i===`_def`)return{path:r};let[a,...o]=n,s=o[0]??{};return e[i](r,a,s)})}var ze=[`client`,`ssrContext`,`ssrState`,`abortOnUnmount`],Be=t?.call(s,null),Ve=e=>{switch(e){case`queryOptions`:case`fetch`:case`ensureData`:case`prefetch`:case`getData`:case`setData`:case`setQueriesData`:return`query`;case`infiniteQueryOptions`:case`fetchInfinite`:case`prefetchInfinite`:case`getInfiniteData`:case`setInfiniteData`:return`infinite`;case`setMutationDefaults`:case`getMutationDefaults`:case`isMutating`:case`cancel`:case`invalidate`:case`refetch`:case`reset`:return`any`}};function V(e){return C(t=>{let n=[...t.path],r=n.pop(),i=[...t.args],a=i.shift(),o=z(n,a,Ve(r));return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,o,i[0]),queryOptions:()=>e.queryOptions(n,o,...i),fetch:()=>e.fetchQuery(o,...i),fetchInfinite:()=>e.fetchInfiniteQuery(o,i[0]),prefetch:()=>e.prefetchQuery(o,...i),prefetchInfinite:()=>e.prefetchInfiniteQuery(o,i[0]),ensureData:()=>e.ensureQueryData(o,...i),invalidate:()=>e.invalidateQueries(o,...i),reset:()=>e.resetQueries(o,...i),refetch:()=>e.refetchQueries(o,...i),cancel:()=>e.cancelQuery(o,...i),setData:()=>{e.setQueryData(o,i[0],i[1])},setQueriesData:()=>e.setQueriesData(o,i[0],i[1],i[2]),setInfiniteData:()=>{e.setInfiniteQueryData(o,i[0],i[1])},getData:()=>e.getQueryData(o),getInfiniteData:()=>e.getInfiniteQueryData(o),setMutationDefaults:()=>e.setMutationDefaults(B(n),a),getMutationDefaults:()=>e.getMutationDefaults(B(n)),isMutating:()=>e.isMutating({mutationKey:B(n)})}[r]()})}function He(e){let t=E(e.client),n=V(e);return M(r=>{let i=r;return i===`client`?t:ze.includes(i)?e[i]:n[r]})}function Ue(e){return V(e)}var We=I(L(),1);function H(e){let t=e instanceof N?e:P(e);return C(e=>{let n=e.path,r=n.join(`.`),[i,a]=e.args;return(0,We.default)({queryKey:z(n,i,`query`),queryFn:()=>t.query(r,i,a?.trpc)},a)})}var U=I(L(),1);function W(e,t,n){let r=e[0],i=e[1]?.input;return n&&(i=(0,U.default)((0,U.default)((0,U.default)({},i??{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})),[r.join(`.`),i,t?.trpc]}var Ge=I(F({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1);function G(e){return{path:e.path.join(`.`)}}function K(e){let t=G(e);return o(()=>t,[t])}async function q(e,t,n){let r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:`success`});let i=[];var a=!1,o=!1,s;try{for(var c=(0,Ge.default)(e),l;a=!(l=await c.next()).done;a=!1){let e=l.value;i.push(e),r.setState({data:[...i]})}}catch(e){o=!0,s=e}finally{try{a&&c.return!=null&&await c.return()}finally{if(o)throw s}}return i}var J=I(L(),1);function Ke(e){let{client:t,queryClient:n}=e,r=t instanceof N?t:P(t);return{infiniteQueryOptions:(e,t,n)=>{let i=t[1]?.input===m;return Object.assign(_((0,J.default)((0,J.default)({},n),{},{initialData:n?.initialData,queryKey:t,queryFn:i?m:async e=>{var i;let a=(0,J.default)((0,J.default)({},n),{},{trpc:(0,J.default)((0,J.default)({},n?.trpc),!(n==null||(i=n.trpc)==null)&&i.abortOnUnmount?{signal:e.signal}:{signal:null})});return await r.query(...W(t,a,{direction:e.direction,pageParam:e.pageParam}))},initialPageParam:n?.initialCursor??null})),{trpc:G({path:e})})},queryOptions:(e,t,i)=>{let a=t[1]?.input===m;return Object.assign(p((0,J.default)((0,J.default)({},i),{},{initialData:i?.initialData,queryKey:t,queryFn:a?m:async e=>{var a;let o=(0,J.default)((0,J.default)({},i),{},{trpc:(0,J.default)((0,J.default)({},i?.trpc),!(i==null||(a=i.trpc)==null)&&a.abortOnUnmount?{signal:e.signal}:{signal:null})}),s=await r.query(...W(t,o));return w(s)?q(s,n,t):s}})),{trpc:G({path:e})})},fetchQuery:(e,t)=>n.fetchQuery((0,J.default)((0,J.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...W(e,t))})),fetchInfiniteQuery:(e,t)=>n.fetchInfiniteQuery((0,J.default)((0,J.default)({},t),{},{queryKey:e,queryFn:({pageParam:n,direction:i})=>r.query(...W(e,t,{pageParam:n,direction:i})),initialPageParam:t?.initialCursor??null})),prefetchQuery:(e,t)=>n.prefetchQuery((0,J.default)((0,J.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...W(e,t))})),prefetchInfiniteQuery:(e,t)=>n.prefetchInfiniteQuery((0,J.default)((0,J.default)({},t),{},{queryKey:e,queryFn:({pageParam:n,direction:i})=>r.query(...W(e,t,{pageParam:n,direction:i})),initialPageParam:t?.initialCursor??null})),ensureQueryData:(e,t)=>n.ensureQueryData((0,J.default)((0,J.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...W(e,t))})),invalidateQueries:(e,t,r)=>n.invalidateQueries((0,J.default)((0,J.default)({},t),{},{queryKey:e}),r),resetQueries:(e,t,r)=>n.resetQueries((0,J.default)((0,J.default)({},t),{},{queryKey:e}),r),refetchQueries:(e,t,r)=>n.refetchQueries((0,J.default)((0,J.default)({},t),{},{queryKey:e}),r),cancelQuery:(e,t)=>n.cancelQueries({queryKey:e},t),setQueryData:(e,t,r)=>n.setQueryData(e,t,r),setQueriesData:(e,t,r,i)=>n.setQueriesData((0,J.default)((0,J.default)({},t),{},{queryKey:e}),r,i),getQueryData:e=>n.getQueryData(e),setInfiniteQueryData:(e,t,r)=>n.setQueryData(e,t,r),getInfiniteQueryData:e=>n.getQueryData(e),setMutationDefaults:(t,i)=>{let a=t[0];return n.setMutationDefaults(t,typeof i==`function`?i({canonicalMutationFn:t=>r.mutation(...W([a,{input:t}],e))}):i)},getMutationDefaults:e=>n.getMutationDefaults(e),isMutating:e=>n.isMutating((0,J.default)((0,J.default)({},e),{},{exact:!0}))}}var Y=I(L()),qe=(e,t)=>new Proxy(e,{get(e,n){return t(n),e[n]}});function Je(e){var t;let s=(e==null||(t=e.overrides)==null||(t=t.useMutation)==null?void 0:t.onSuccess)??(e=>e.originalFn()),c=e?.context??Be,p=ye,_=e=>{let{abortOnUnmount:t=!1,queryClient:n,ssrContext:r}=e,[a,s]=i(e.ssrState??!1),l=e.client instanceof N?e.client:P(e.client),u=o(()=>Ke({client:l,queryClient:n}),[l,n]),d=o(()=>(0,Y.default)({abortOnUnmount:t,queryClient:n,client:l,ssrContext:r??null,ssrState:a},u),[t,l,u,n,r,a]);return b(()=>{s(e=>e?`mounted`:!1)},[]),ne(c.Provider,{value:d,children:e.children})};function x(){let e=a(c);if(!e)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return e}function S(e,t){let{queryClient:n,ssrState:r}=x();return r&&r!==`mounted`&&n.getQueryCache().find({queryKey:e})?.state.status===`error`?(0,Y.default)({retryOnMount:!1},t):t}function re(t,n,r){var i,a;let{abortOnUnmount:o,client:s,ssrState:c,queryClient:l,prefetchQuery:d}=x(),f=z(t,n,`query`),p=l.getQueryDefaults(f),h=n===m;typeof window>`u`&&c===`prepass`&&(r==null||(i=r.trpc)==null?void 0:i.ssr)!==!1&&(r?.enabled??p?.enabled)!==!1&&!h&&!l.getQueryCache().find({queryKey:f})&&d(f,r);let g=S(f,(0,Y.default)((0,Y.default)({},p),r)),_=(r==null||(a=r.trpc)==null?void 0:a.abortOnUnmount)??e?.abortOnUnmount??o,v=u((0,Y.default)((0,Y.default)({},g),{},{queryKey:f,queryFn:h?n:async e=>{let t=(0,Y.default)((0,Y.default)({},g),{},{trpc:(0,Y.default)((0,Y.default)({},g?.trpc),_?{signal:e.signal}:{signal:null})}),n=await s.query(...W(f,t));return w(n)?q(n,l,f):n}}),l);return v.trpc=K({path:t}),v}function C(t,n,r){var i;let a=x(),o=z(t,n,`query`),s=n===m,c=(r==null||(i=r.trpc)==null?void 0:i.abortOnUnmount)??e?.abortOnUnmount??a.abortOnUnmount;y((0,Y.default)((0,Y.default)({},r),{},{queryKey:o,queryFn:s?n:e=>{let t={trpc:(0,Y.default)((0,Y.default)({},r?.trpc),c?{signal:e.signal}:{})};return a.client.query(...W(o,t))}}))}function T(t,n,r){var i;let a=x(),o=z(t,n,`query`),s=(r==null||(i=r.trpc)==null?void 0:i.abortOnUnmount)??e?.abortOnUnmount??a.abortOnUnmount,c=g((0,Y.default)((0,Y.default)({},r),{},{queryKey:o,queryFn:e=>{let t=(0,Y.default)((0,Y.default)({},r),{},{trpc:(0,Y.default)((0,Y.default)({},r?.trpc),s?{signal:e.signal}:{signal:null})});return a.client.query(...W(o,t))}}),a.queryClient);return c.trpc=K({path:t}),[c.data,c]}function ie(e,t){let{client:n,queryClient:r}=x(),i=B(e),a=r.defaultMutationOptions(r.getMutationDefaults(i)),o=te((0,Y.default)((0,Y.default)({},t),{},{mutationKey:i,mutationFn:r=>n.mutation(...W([e,{input:r}],t)),onSuccess(...e){return s({originalFn:()=>{var n,r;return(t==null||(n=t.onSuccess)==null?void 0:n.call(t,...e))??(a==null||(r=a.onSuccess)==null?void 0:r.call(a,...e))},queryClient:r,meta:t?.meta??a?.meta??{}})}}),r);return o.trpc=K({path:e}),o}let E={data:void 0,error:null,status:`idle`},D={data:void 0,error:null,status:`connecting`};function O(e,t,a){let o=a?.enabled??t!==m,s=f(z(e,t,`any`)),{client:c}=x(),l=n(a);b(()=>{l.current=a});let[u]=i(new Set([])),d=r(e=>{u.add(e)},[u]),p=n(null),h=r(e=>{let t=_.current,n=_.current=e(t),r=!1;for(let e of u)if(t[e]!==n[e]){r=!0;break}r&&y(qe(n,d))},[d,u]),g=r(()=>{var n;if((n=p.current)==null||n.unsubscribe(),!o){h(()=>(0,Y.default)((0,Y.default)({},E),{},{reset:g}));return}h(()=>(0,Y.default)((0,Y.default)({},D),{},{reset:g})),p.current=c.subscription(e.join(`.`),t??void 0,{onStarted:()=>{var e,t;(e=(t=l.current).onStarted)==null||e.call(t),h(e=>(0,Y.default)((0,Y.default)({},e),{},{status:`pending`,error:null}))},onData:e=>{var t,n;(t=(n=l.current).onData)==null||t.call(n,e),h(t=>(0,Y.default)((0,Y.default)({},t),{},{status:`pending`,data:e,error:null}))},onError:e=>{var t,n;(t=(n=l.current).onError)==null||t.call(n,e),h(t=>(0,Y.default)((0,Y.default)({},t),{},{status:`error`,error:e}))},onConnectionStateChange:e=>{h(t=>{switch(e.state){case`idle`:return(0,Y.default)((0,Y.default)({},t),{},{status:e.state,error:null,data:void 0});case`connecting`:return(0,Y.default)((0,Y.default)({},t),{},{error:e.error,status:e.state});case`pending`:return t}})},onComplete:()=>{var e,t;(e=(t=l.current).onComplete)==null||e.call(t),h(e=>(0,Y.default)((0,Y.default)({},e),{},{status:`idle`,error:null,data:void 0}))}})},[c,s,o,h]);b(()=>(g(),()=>{var e;(e=p.current)==null||e.unsubscribe()}),[g]);let _=n(o?(0,Y.default)((0,Y.default)({},D),{},{reset:g}):(0,Y.default)((0,Y.default)({},E),{},{reset:g})),[v,y]=i(qe(_.current,d));return v}function k(e,t,n){var r,i;let{client:a,ssrState:o,prefetchInfiniteQuery:s,queryClient:c,abortOnUnmount:u}=x(),d=z(e,t,`infinite`),f=c.getQueryDefaults(d),p=t===m;typeof window>`u`&&o===`prepass`&&(n==null||(r=n.trpc)==null?void 0:r.ssr)!==!1&&(n?.enabled??f?.enabled)!==!1&&!p&&!c.getQueryCache().find({queryKey:d})&&s(d,(0,Y.default)((0,Y.default)({},f),n));let h=S(d,(0,Y.default)((0,Y.default)({},f),n)),g=(n==null||(i=n.trpc)==null?void 0:i.abortOnUnmount)??u,_=l((0,Y.default)((0,Y.default)({},h),{},{initialPageParam:n.initialCursor??null,persister:n.persister,queryKey:d,queryFn:p?t:e=>{let t=(0,Y.default)((0,Y.default)({},h),{},{trpc:(0,Y.default)((0,Y.default)({},h?.trpc),g?{signal:e.signal}:{signal:null})});return a.query(...W(d,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}),c);return _.trpc=K({path:e}),_}function A(e,t,n){var r;let i=x(),a=z(e,t,`infinite`),o=i.queryClient.getQueryDefaults(a),s=t===m,c=S(a,(0,Y.default)((0,Y.default)({},o),n)),l=(n==null||(r=n.trpc)==null?void 0:r.abortOnUnmount)??i.abortOnUnmount;v((0,Y.default)((0,Y.default)({},n),{},{initialPageParam:n.initialCursor??null,queryKey:a,queryFn:s?t:e=>{let t=(0,Y.default)((0,Y.default)({},c),{},{trpc:(0,Y.default)((0,Y.default)({},c?.trpc),l?{signal:e.signal}:{})});return i.client.query(...W(a,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}))}function j(e,t,n){var r;let i=x(),a=z(e,t,`infinite`),o=i.queryClient.getQueryDefaults(a),s=S(a,(0,Y.default)((0,Y.default)({},o),n)),c=(n==null||(r=n.trpc)==null?void 0:r.abortOnUnmount)??i.abortOnUnmount,l=ee((0,Y.default)((0,Y.default)({},n),{},{initialPageParam:n.initialCursor??null,queryKey:a,queryFn:e=>{let t=(0,Y.default)((0,Y.default)({},s),{},{trpc:(0,Y.default)((0,Y.default)({},s?.trpc),c?{signal:e.signal}:{})});return i.client.query(...W(a,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}),i.queryClient);return l.trpc=K({path:e}),[l.data,l]}return{Provider:_,createClient:p,useContext:x,useUtils:x,useQuery:re,usePrefetchQuery:C,useSuspenseQuery:T,useQueries:(e,t)=>{let{ssrState:n,queryClient:r,prefetchQuery:i,client:a}=x(),o=e(H(a));if(typeof window>`u`&&n===`prepass`)for(let e of o){let t=e;t.trpc?.ssr!==!1&&!r.getQueryCache().find({queryKey:t.queryKey})&&i(t.queryKey,t)}return h({queries:o.map(e=>(0,Y.default)((0,Y.default)({},e),{},{queryKey:e.queryKey})),combine:t?.combine},r)},useSuspenseQueries:e=>{let{queryClient:t,client:n}=x(),r=d({queries:e(H(n)).map(e=>(0,Y.default)((0,Y.default)({},e),{},{queryFn:e.queryFn,queryKey:e.queryKey}))},t);return[r.map(e=>e.data),r]},useMutation:ie,useSubscription:O,useInfiniteQuery:k,usePrefetchInfiniteQuery:A,useSuspenseInfiniteQuery:j}}var Ye=e({TRPCClientError:()=>he,TRPCUntypedClient:()=>N,__moduleExports:()=>T,clientCallTypeToProcedureType:()=>pe,createTRPCClient:()=>ye,createTRPCClientProxy:()=>E,createTRPCProxyClient:()=>x,createTRPCQueryUtils:()=>Qe,createTRPCReact:()=>Ze,createTRPCUntypedClient:()=>ve,createWSClient:()=>D,experimental_localLink:()=>re,getFetch:()=>S,getMutationKey:()=>Le,getQueryKey:()=>Ie,getUntypedClient:()=>P,httpBatchLink:()=>le,httpBatchStreamLink:()=>k,httpLink:()=>fe,httpSubscriptionLink:()=>me,isFormData:()=>j,isNonJsonSerializable:()=>ue,isOctetType:()=>ge,isTRPCClientError:()=>ae,jsonEncoder:()=>oe,loggerLink:()=>de,retryLink:()=>ce,splitLink:()=>se,unstable_httpBatchStreamLink:()=>O,unstable_httpSubscriptionLink:()=>_e,unstable_localLink:()=>be,wsLink:()=>A});c();function Xe(e){let t=Re(e);return M(n=>n===`useContext`||n===`useUtils`?()=>{let t=e.useUtils();return o(()=>He(t),[t])}:e.hasOwnProperty(n)?e[n]:t[n])}function Ze(e){return Xe(Je(e))}function Qe(e){return Ue(Ke(e))}var $e=e({TRPCClientError:()=>it,TRPCUntypedClient:()=>at,clientCallTypeToProcedureType:()=>ot,createTRPCClient:()=>st,createTRPCClientProxy:()=>ct,createTRPCProxyClient:()=>lt,createTRPCQueryUtils:()=>et,createTRPCReact:()=>tt,createTRPCUntypedClient:()=>ut,createWSClient:()=>dt,default:()=>X,experimental_localLink:()=>ft,getFetch:()=>pt,getMutationKey:()=>nt,getQueryKey:()=>rt,getUntypedClient:()=>mt,httpBatchLink:()=>ht,httpBatchStreamLink:()=>gt,httpLink:()=>_t,httpSubscriptionLink:()=>vt,isFormData:()=>yt,isNonJsonSerializable:()=>bt,isOctetType:()=>xt,isTRPCClientError:()=>St,jsonEncoder:()=>Ct,loggerLink:()=>wt,retryLink:()=>Tt,splitLink:()=>Et,unstable_httpBatchStreamLink:()=>Dt,unstable_httpSubscriptionLink:()=>Ot,unstable_localLink:()=>kt,wsLink:()=>At}),X=Ye,et=X.createTRPCQueryUtils,tt=X.createTRPCReact,nt=X.getMutationKey,rt=X.getQueryKey,it=X.TRPCClientError,at=X.TRPCUntypedClient,ot=X.clientCallTypeToProcedureType,st=X.createTRPCClient,ct=X.createTRPCClientProxy,lt=X.createTRPCProxyClient,ut=X.createTRPCUntypedClient,dt=X.createWSClient,ft=X.experimental_localLink,pt=X.getFetch,mt=X.getUntypedClient,ht=X.httpBatchLink,gt=X.httpBatchStreamLink,_t=X.httpLink,vt=X.httpSubscriptionLink,yt=X.isFormData,bt=X.isNonJsonSerializable,xt=X.isOctetType,St=X.isTRPCClientError,Ct=X.jsonEncoder,wt=X.loggerLink,Tt=X.retryLink,Et=X.splitLink,Dt=X.unstable_httpBatchStreamLink,Ot=X.unstable_httpSubscriptionLink,kt=X.unstable_localLink,At=X.wsLink,jt=e({TRPCClientError:()=>Rt,TRPCUntypedClient:()=>zt,__moduleExports:()=>fn,clientCallTypeToProcedureType:()=>Bt,createTRPCClient:()=>Vt,createTRPCClientProxy:()=>Ht,createTRPCProxyClient:()=>Ut,createTRPCQueryUtils:()=>Pt,createTRPCReact:()=>Ft,createTRPCUntypedClient:()=>Wt,createWSClient:()=>Gt,default:()=>Nt,experimental_localLink:()=>Kt,getFetch:()=>qt,getMutationKey:()=>It,getQueryKey:()=>Lt,getUntypedClient:()=>Jt,httpBatchLink:()=>Yt,httpBatchStreamLink:()=>Xt,httpLink:()=>Zt,httpSubscriptionLink:()=>Qt,isFormData:()=>$t,isNonJsonSerializable:()=>en,isOctetType:()=>tn,isTRPCClientError:()=>nn,jsonEncoder:()=>rn,loggerLink:()=>an,retryLink:()=>on,splitLink:()=>sn,unstable_httpBatchStreamLink:()=>cn,unstable_httpSubscriptionLink:()=>ln,unstable_localLink:()=>un,wsLink:()=>dn}),Z=`__mf_module_cache__`;globalThis[Z]||={share:{},remote:{}},globalThis[Z].share||={},globalThis[Z].remote||={};var Q=globalThis[Z],Mt=e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`)break;let n=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(n.length>0&&n.some(e=>e!==void 0))break;t=e}return t},$=Q.share[`default:@trpc/react-query`];$===void 0&&($=Mt($e),Q.share[`default:@trpc/react-query`]=$);var Nt=(()=>{let e=$;for(let t=0;t<5;t++){let t=e?.default;if(!t||typeof t!=`object`)return t??e;e=t}return e})(),{createTRPCQueryUtils:Pt,createTRPCReact:Ft,getMutationKey:It,getQueryKey:Lt,TRPCClientError:Rt,TRPCUntypedClient:zt,clientCallTypeToProcedureType:Bt,createTRPCClient:Vt,createTRPCClientProxy:Ht,createTRPCProxyClient:Ut,createTRPCUntypedClient:Wt,createWSClient:Gt,experimental_localLink:Kt,getFetch:qt,getUntypedClient:Jt,httpBatchLink:Yt,httpBatchStreamLink:Xt,httpLink:Zt,httpSubscriptionLink:Qt,isFormData:$t,isNonJsonSerializable:en,isOctetType:tn,isTRPCClientError:nn,jsonEncoder:rn,loggerLink:an,retryLink:on,splitLink:sn,unstable_httpBatchStreamLink:cn,unstable_httpSubscriptionLink:ln,unstable_localLink:un,wsLink:dn}=$,fn=$;export{jt as n,$e as r,Ft as t};
@@ -1 +0,0 @@
1
- import{V as e}from"./index-NMHNU-e8.js";var t=e(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};