@camera.ui/server 2.0.18 → 2.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interface/assets/{404-hjvRJoie.js → 404-CG23ZpFv.js} +1 -1
- package/dist/interface/assets/{About-CXK9lps9.js → About-Dawv7dKP.js} +1 -1
- package/dist/interface/assets/{Adminpanel-D1bsiC_B.js → Adminpanel-529Hf8yC.js} +1 -1
- package/dist/interface/assets/{Automation-BE-lA9i2.js → Automation-BaF8MdrF.js} +3 -3
- package/dist/interface/assets/{AutomationImport-B1Wsf3O1.js → AutomationImport-CXXYinR0.js} +2 -2
- package/dist/interface/assets/{AutomationStore-BUmTKbR8.js → AutomationStore-DOdwMUIP.js} +2 -2
- package/dist/interface/assets/{AutomationStoreDetail-DfENt4wG.js → AutomationStoreDetail-CkNGHRNU.js} +2 -2
- package/dist/interface/assets/{Automations-3SibYydl.js → Automations-sO0qi27q.js} +2 -2
- package/dist/interface/assets/Camera-DW__aloL.js +2 -0
- package/dist/interface/assets/{CameraConsole-D_1E2i7a.js → CameraConsole-D06gEm91.js} +1 -1
- package/dist/interface/assets/{Cameras-Co54hUIY.js → Cameras-BNBi1F0q.js} +1 -1
- package/dist/interface/assets/Camview-Djtm5hEO.js +1 -0
- package/dist/interface/assets/{Config-CZ3qg4V7.js → Config-DioQs8yK.js} +1 -1
- package/dist/interface/assets/{ConfigActionCameraControl-BkP4KpkL.js → ConfigActionCameraControl-4E0E0_fY.js} +1 -1
- package/dist/interface/assets/{ConfigActionDelay-CW3x89X3.js → ConfigActionDelay-Cjmjm7gn.js} +1 -1
- package/dist/interface/assets/{ConfigActionHttp-CqRThGAM.js → ConfigActionHttp-W-_LXPpQ.js} +1 -1
- package/dist/interface/assets/{ConfigActionImageInput-D-wCYFc9.js → ConfigActionImageInput-D20ulIj4.js} +1 -1
- package/dist/interface/assets/{ConfigActionMqtt-50Oit6xb.js → ConfigActionMqtt-PGVLgx6J.js} +1 -1
- package/dist/interface/assets/{ConfigActionNotification-CV4TZpsD.js → ConfigActionNotification-DtE9vlwt.js} +1 -1
- package/dist/interface/assets/{ConfigActionOutput-DDCdD_nG.js → ConfigActionOutput-Cb0Ik5Lg.js} +1 -1
- package/dist/interface/assets/{ConfigActionPlugin-3BiyEJsy.js → ConfigActionPlugin-DeXj_Qku.js} +1 -1
- package/dist/interface/assets/{ConfigActionSensor-kkHOn3aC.js → ConfigActionSensor-DH03MD04.js} +1 -1
- package/dist/interface/assets/{ConfigActionSnapshot-O4nan24K.js → ConfigActionSnapshot-bEiIuVkE.js} +1 -1
- package/dist/interface/assets/{ConfigActionVariable-Ci3wXMYZ.js → ConfigActionVariable-6xpPwfGg.js} +1 -1
- package/dist/interface/assets/{ConfigConditionIfElse-CPzw54yv.js → ConfigConditionIfElse-CnUdhYBw.js} +1 -1
- package/dist/interface/assets/{ConfigConditionSensorState-DcV8-3Tj.js → ConfigConditionSensorState-Cpod48bM.js} +1 -1
- package/dist/interface/assets/{ConfigConditionSwitch-b0ikuhC6.js → ConfigConditionSwitch-CrcDpdeO.js} +1 -1
- package/dist/interface/assets/{ConfigConditionTime-q7GYSoQk.js → ConfigConditionTime-BK18wRIR.js} +1 -1
- package/dist/interface/assets/{ConfigSensorValueInput-Ba_ZC14J.js → ConfigSensorValueInput-BDJSe4AD.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerDetection-CF-C3A-0.js → ConfigTriggerDetection-CLY_l8WB.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerGeofence-CW5W3lot.js → ConfigTriggerGeofence-CAHirXSm.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerManual-B7UGIwE2.js → ConfigTriggerManual-BifyCaS9.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerMqtt-DL1MIwBs.js → ConfigTriggerMqtt-DVxJJ1Ii.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerSchedule-DCUXevkw.js → ConfigTriggerSchedule-C5apVQ3A.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerSensor-DRX68f5E.js → ConfigTriggerSensor-CtU2-Ebe.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerSystem-BOt8AI3a.js → ConfigTriggerSystem-P_hogQ3_.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerWebhook-CFeWElXX.js → ConfigTriggerWebhook-D4lYvM7m.js} +1 -1
- package/dist/interface/assets/{Console-Cxs29skk.js → Console-DgwnUKDQ.js} +1 -1
- package/dist/interface/assets/{CuiAutomationRunsDialog-yXyj7vrL.js → CuiAutomationRunsDialog-D8DfgOlE.js} +1 -1
- package/dist/interface/assets/{CuiBottomSheet-SnWWgn5I.js → CuiBottomSheet-BzKu50hx.js} +1 -1
- package/dist/interface/assets/CuiBottomSheet-d46jCJeG.js +1 -0
- package/dist/interface/assets/{CuiCameraPipCard-BmmyPCOP.js → CuiCameraPipCard-RB60OEgF.js} +1 -1
- package/dist/interface/assets/CuiCameraRecordings-DSeBoMKj.js +1 -0
- package/dist/interface/assets/{CuiCameraShares-BE9d09pX.js → CuiCameraShares-8Mo2XwFD.js} +1 -1
- package/dist/interface/assets/{CuiCameraTable-TiUZNpga.js → CuiCameraTable-MjJctqrJ.js} +1 -1
- package/dist/interface/assets/{CuiDataTable-DqtFJKC6.js → CuiDataTable-DQRKmdcE.js} +1 -1
- package/dist/interface/assets/{CuiPluginCard-C8eDXMRg.js → CuiPluginCard-4NsvwvgQ.js} +2 -2
- package/dist/interface/assets/{CuiPluginCategoryChip-BX0xg3py.js → CuiPluginCategoryChip-AsMNaK01.js} +1 -1
- package/dist/interface/assets/{CuiPluginOAuthButton-DZS31TnY.js → CuiPluginOAuthButton-7mwBhBzg.js} +2 -2
- package/dist/interface/assets/{CuiPluginTrustBadge-rZePqROi.js → CuiPluginTrustBadge-tIqjoCDz.js} +1 -1
- package/dist/interface/assets/{CuiQRCode-BqMd2Oh6.js → CuiQRCode-l-PLLptq.js} +1 -1
- package/dist/interface/assets/{CuiRecordingsGrid-Dkpe799a.js → CuiRecordingsGrid-BeOP2hpR.js} +1 -1
- package/dist/interface/assets/{CuiSchema-J_b00DYu.js → CuiSchema-TojDO40O.js} +1 -1
- package/dist/interface/assets/{CuiTopNavbarItem-CXxnNN1s.js → CuiTopNavbarItem-BhUA2MiU.js} +1 -1
- package/dist/interface/assets/{Faces-CaGWFf-y.js → Faces-DW0RFypU.js} +1 -1
- package/dist/interface/assets/FirstSteps-BgNqGgK1.js +1 -0
- package/dist/interface/assets/{Instances-BD727wNP.js → Instances-Cllek48f.js} +1 -1
- package/dist/interface/assets/{Logs-DK8-ilEl.js → Logs-ic15Mp_h.js} +1 -1
- package/dist/interface/assets/{Menu-Cn0dBf4v.js → Menu-By6NRK44.js} +1 -1
- package/dist/interface/assets/{OAuthDeviceFlow-C6aER-P5.js → OAuthDeviceFlow-BpeJI0ad.js} +1 -1
- package/dist/interface/assets/{Plugin-Cq_hIp8V.js → Plugin-B_ANQppI.js} +1 -1
- package/dist/interface/assets/{PluginConsole-cQBNvsGp.js → PluginConsole-BaPz9Ag3.js} +1 -1
- package/dist/interface/assets/{PluginDetail-9-jofn3X.js → PluginDetail-j7srfPSY.js} +2 -2
- package/dist/interface/assets/{PluginSchema-DhNpD_HM.js → PluginSchema-Cb_F8uew.js} +1 -1
- package/dist/interface/assets/{PluginSearch-CYEjSopJ.js → PluginSearch-C4JY7Iwj.js} +2 -2
- package/dist/interface/assets/PluginSearch-CTAtKAK4.js +1 -0
- package/dist/interface/assets/{Plugins-YyemYjP4.js → Plugins-RVhaBdkA.js} +1 -1
- package/dist/interface/assets/Recordings-frQ3fb5P.js +1 -0
- package/dist/interface/assets/{Settings-CDH3BeuL.js → Settings-DQgp2tgH.js} +1 -1
- package/dist/interface/assets/{SettingsAccount-CycVwV2K.js → SettingsAccount-BhCf1XAp.js} +1 -1
- package/dist/interface/assets/SettingsAccount-BhseUwL4.js +1 -0
- package/dist/interface/assets/SettingsAppearance--SabFiHj.js +1 -0
- package/dist/interface/assets/{SettingsAppearance-BnuFyX8o.js → SettingsAppearance-YNXseOYk.js} +1 -1
- package/dist/interface/assets/{SettingsBackup-CBF2IQN_.js → SettingsBackup-DIWxITfi.js} +1 -1
- package/dist/interface/assets/{SettingsMqtt-CChS0s5J.js → SettingsMqtt-Bf23ZOH-.js} +1 -1
- package/dist/interface/assets/{SettingsNotifications-D-2v9oM8.js → SettingsNotifications-Dv9Fixz_.js} +1 -1
- package/dist/interface/assets/{SettingsRecordings-Ui2Xd5Ye.js → SettingsRecordings-Dxdxayym.js} +1 -1
- package/dist/interface/assets/{SettingsRemote-D2nKjVHR.js → SettingsRemote-CGMwCx4y.js} +1 -1
- package/dist/interface/assets/{SettingsSystem-C1vJGmFo.js → SettingsSystem-ZHz6-3eN.js} +2 -2
- package/dist/interface/assets/{SettingsUsers-DTFIKS6H.js → SettingsUsers-Dxj65vMx.js} +1 -1
- package/dist/interface/assets/{Terminal-DDsjIhe7.js → Terminal-DFGD9NeS.js} +1 -1
- package/dist/interface/assets/{VariableInput-BEjTv8xz.js → VariableInput-Br6YY5HX.js} +1 -1
- package/dist/interface/assets/{VariableSuggestions-DcgHR-OY.js → VariableSuggestions-D898dM5K.js} +1 -1
- package/dist/interface/assets/{VersionsHandler-DrVcvut6.js → VersionsHandler-J51M6nHE.js} +1 -1
- package/dist/interface/assets/{Workers-xyas5_sn.js → Workers-BHibnYvL.js} +1 -1
- package/dist/interface/assets/{api-CdJDEL3z.js → api-BwUGcpse.js} +2 -2
- package/dist/interface/assets/{api-B1n4M73U.js → api-CkxuZ9lw.js} +1 -1
- package/dist/interface/assets/{auth-DOnr6Mc1.js → auth-Dgn4npDp.js} +1 -1
- package/dist/interface/assets/{automations-B-tYtR3y.js → automations-Dab1-eSY.js} +1 -1
- package/dist/interface/assets/{cameras.schema-C-xz1hwq.js → cameras.schema-CwGkDyzk.js} +1 -1
- package/dist/interface/assets/cloudHandoff-CpMzGP4H.js +1 -0
- package/dist/interface/assets/{config-CYmKCSzU.js → config-BYU9LRQr.js} +1 -1
- package/dist/interface/assets/{flowSchema-CsPTDyH8.js → flowSchema-BuhMrSRP.js} +1 -1
- package/dist/interface/assets/{main-DILs_jYV.js → main-DvYnQiyf.js} +3 -3
- package/dist/interface/assets/{mqtt-BrTLJ_eM.js → mqtt-Bj9HWVr-.js} +1 -1
- package/dist/interface/assets/{notifications-Dt6ygmRP.js → notifications-B2GVNEL7.js} +1 -1
- package/dist/interface/assets/{plugins-BcJnIPJC.js → plugins-Ct1tFRqH.js} +1 -1
- package/dist/interface/assets/{round-restart-alt-B6N0m8oC.js → round-restart-alt-COgLKyfG.js} +1 -1
- package/dist/interface/assets/{server-_ByAktOF.js → server-CmHQA2OF.js} +1 -1
- package/dist/interface/assets/{theme-CORL_-pn.js → theme-BdlqMboH.js} +1 -1
- package/dist/interface/assets/{types-CGqXKLKp.js → types-Du61QgCF.js} +1 -1
- package/dist/interface/assets/{types-DDSlYw6n.js → types-o57RMLy1.js} +1 -1
- package/dist/interface/assets/{useAppVersion-CWa09Ql5.js → useAppVersion-GqkuhLFI.js} +1 -1
- package/dist/interface/assets/useBackupRestore-xqzQKAfT.js +1 -0
- package/dist/interface/assets/{useCameraOptions-L0smaaZz.js → useCameraOptions-CAu9scRL.js} +1 -1
- package/dist/interface/assets/{useLogsSocket-DQSgBMsw.js → useLogsSocket-B_EbSIOU.js} +1 -1
- package/dist/interface/assets/{useServerRestart-lPp2ZiX-.js → useServerRestart-CZj3Y0Gh.js} +1 -1
- package/dist/interface/assets/{useStreamStatus-BroqI_Eh.js → useStreamStatus-B12LRLX9.js} +1 -1
- package/dist/interface/assets/{useUserOptions-BB451w9I.js → useUserOptions-BycuHkS6.js} +1 -1
- package/dist/interface/assets/{vendor-cameraui-Bq-hQsT7.js → vendor-cameraui-CywDBRLD.js} +16 -16
- package/dist/interface/assets/{vendor-core-CoiYJRqo.js → vendor-core-0Lu3l40a.js} +1 -1
- package/dist/interface/assets/{vendor-primevue-B3sIO6X2.js → vendor-primevue-Cm1rEh62.js} +1 -1
- package/dist/interface/index.html +18 -18
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +7 -4
- package/dist/server/src/api/controllers/backup.controller.js +1 -0
- package/dist/server/src/api/controllers/backup.controller.js.map +1 -1
- package/dist/server/src/api/database/selfcheck.js +5 -3
- package/dist/server/src/api/database/selfcheck.js.map +1 -1
- package/dist/server/src/camera/controller.d.ts +1 -1
- package/dist/server/src/camera/controller.js +13 -15
- package/dist/server/src/camera/controller.js.map +1 -1
- package/dist/server/src/camera/decoder/detection-coordinator.js +20 -8
- package/dist/server/src/camera/decoder/detection-coordinator.js.map +1 -1
- package/dist/server/src/main.js +3 -5
- package/dist/server/src/main.js.map +1 -1
- package/dist/server/src/rpc/interfaces/device.d.ts +1 -1
- package/dist/server/src/types.d.ts +1 -0
- package/dist/server/src/utils/ipc.d.ts +3 -0
- package/dist/server/src/utils/ipc.js +33 -0
- package/dist/server/src/utils/ipc.js.map +1 -1
- package/package.json +7 -4
- package/dist/interface/assets/Camera-ByUigyg3.js +0 -2
- package/dist/interface/assets/Camview-D83wwTUB.js +0 -1
- package/dist/interface/assets/CuiBottomSheet-DVzVzs8p.js +0 -1
- package/dist/interface/assets/CuiCameraRecordings-DLfMPUOL.js +0 -1
- package/dist/interface/assets/FirstSteps-fOhI977X.js +0 -1
- package/dist/interface/assets/PluginSearch-Cy8JvNJD.js +0 -1
- package/dist/interface/assets/Recordings-Cwns8Zzj.js +0 -1
- package/dist/interface/assets/SettingsAccount-BoWR0DKm.js +0 -1
- package/dist/interface/assets/SettingsAppearance-DHSpEmup.js +0 -1
- package/dist/interface/assets/cloudHandoff-zt3rCB3J.js +0 -1
- package/dist/interface/assets/useBackupRestore-5tZ-awcr.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Cr as e,Er as t,F as n,O as r,Ot as i,Pt as a,Sr as o,_t as s,gt as c,kr as l,wt as u,yr as d}from"./vendor-cameraui-Bq-hQsT7.js";import{Dt as f,G as p,Gn as ee,Gt as te,Jt as m,Sn as h,X as g,Yn as ne,an as _,bn as v,f as y,h as re,kn as b,nn as x,nt as S,z as C}from"./api-CdJDEL3z.js";import{An as w,Bn as T,In as E,Ln as ie,Qn as D,Rn as O,Sr as ae,Tr as k,Wn as oe,Xn as se,_n as A,an as j,bn as M,cr as ce,dn as N,dr as P,fn as F,gr as I,hn as L,in as R,ir as le,kn as ue,ln as z,lr as B,nr as de,pn as V,pr as H,rn as U,tr as W,un as G,vn as K,xr as q,yr as fe}from"./vendor-CdGy-Xet.js";import{B as pe,G as me,H as he,M as ge,U as _e,V as ve,W as J,i as ye}from"./types-CGqXKLKp.js";import{r as be}from"./lightbulb-outline-BGFG7wv-.js";import{l as xe,p as Y}from"./vendor-core-CoiYJRqo.js";import{B as Se,G as Ce,H as we,K as Te,V as Ee,W as De,a as Oe,i as ke,j as Ae,l as je}from"./vendor-primevue-B3sIO6X2.js";import{t as Me}from"./CuiSchema-J_b00DYu.js";import{t as Ne}from"./plugins-BcJnIPJC.js";import{t as Pe}from"./PluginSchema-DhNpD_HM.js";import{t as Fe}from"./information-outline-CjhiKBjG.js";import{t as Ie}from"./plus-C6l_Q-mY.js";import{t as X}from"./close-circle-raXx3m4Q.js";import{a as Le,i as Re,n as ze,o as Be,r as Ve,t as He}from"./vendor-markdown-D_3Of-Gz.js";import{t as Ue}from"./back-filled-DZmo9cAg.js";import{n as We,t as Ge}from"./CuiPluginCard-C8eDXMRg.js";var Z={class:`text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Q={class:`flex flex-col gap-4`},Ke={class:`flex flex-col field-gap`},qe={class:`cui-label`},Je={key:0,class:`text-red-500 text-sm`},$={class:`flex flex-col field-gap`},Ye={class:`cui-label`},Xe={class:`flex flex-col field-gap`},Ze={class:`cui-label`},Qe={class:`flex flex-col field-gap`},$e={class:`cui-label`},et={class:`flex flex-col field-gap`},tt={class:`cui-label`},nt={class:`flex flex-col field-gap`},rt={class:`cui-label`},it={class:`flex flex-col field-gap`},at={class:`cui-label`},ot={class:`flex flex-col field-gap`},st={class:`cui-label`},ct={class:`mt-8`},lt={class:`text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},ut={key:0,class:`flex items-center justify-center w-full py-4`},dt={key:1,class:`flex items-center justify-center text-sm text-muted py-4 text-center`},ft={key:2,class:`flex flex-col field-gap`},pt={class:`text-xs text-muted`},mt={key:0,class:`mt-8`},ht={class:`text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},gt=M({__name:`CuiNotificationInterface`,props:{pluginName:{}},setup(e){let t=e,n=ne(),{t:a}=l(),o=ee(),{user:s}=Y(re()),{pluginName:f}=fe(t),{plugin:p}=c(f),te=z(()=>Object.values(d).map(e=>({label:a(`components.notification_interface.severity_${e}`),value:e}))),h=P({title:`Test notification`,subtitle:``,body:`This is a test notification from camera.ui`,severity:d.Info,tag:``,imageUrl:``,deepLink:``}),g=H([]),_=H(!1),v=H(!1),y=I([]),b=H(!1),x=H([]),S=I(),C=H(!1),w=z(()=>y.value.map(e=>({id:e.id,label:e.name})));async function E(){if(!(!p.value||!s.value?._id)){b.value=!0;try{let e=m(void 0,`admin`)?[]:[s.value._id];y.value=await p.value.getDevices?.(e)??[]}catch(e){n.error(`Failed to load notifier devices:`,e),y.value=[]}finally{b.value=!1}}}async function ie(){if(p.value){C.value=!0;try{S.value=await p.value.notificationSettings?.()}catch(e){n.error(`Failed to load notification settings schema:`,e),S.value=void 0}finally{C.value=!1}}}function ae(){g.value.push({key:``,value:``})}function oe(e){g.value.splice(e,1)}function se(){let e={};for(let t of g.value)t.key.trim()&&(e[t.key.trim()]=t.value);return{title:h.title.trim(),subtitle:h.subtitle.trim()||void 0,body:h.body.trim()||void 0,severity:h.severity,tag:h.tag.trim()||void 0,imageUrl:h.imageUrl.trim()||void 0,deepLink:h.deepLink.trim()||void 0,data:Object.keys(e).length?e:void 0}}async function A(){let e=p.value;if(!(!e||v.value)){if(!h.title.trim()){_.value=!0;return}v.value=!0;try{let t=se(),n=x.value.length?x.value:y.value.map(e=>e.id);await e.sendNotification?.(n,t),o.add({severity:`success`,detail:a(`components.notification_interface.sent`),life:3e3})}catch(e){o.add({severity:`error`,detail:e,life:3e3})}finally{v.value=!1}}}return D(p,e=>{e&&(E(),ie())},{immediate:!0}),(e,t)=>{let n=r,a=ke,o=Ae,s=X,c=i,l=Ie,d=u,f=je,ee=Me;return O(),V(`div`,null,[G(`h3`,Z,k(e.$t(`components.notification_interface.template`)),1),G(`div`,Q,[G(`div`,Ke,[G(`label`,qe,k(e.$t(`components.notification_interface.title`)),1),K(n,{modelValue:q(h).title,"onUpdate:modelValue":[t[0]||=e=>q(h).title=e,t[1]||=e=>_.value=!1],placeholder:e.$t(`components.notification_interface.title`),invalid:q(_),class:`w-full`},null,8,[`modelValue`,`placeholder`,`invalid`]),q(_)?(O(),V(`p`,Je,k(e.$t(`components.notification_interface.title_required`)),1)):F(``,!0)]),G(`div`,$,[G(`label`,Ye,k(e.$t(`components.notification_interface.subtitle`)),1),K(n,{modelValue:q(h).subtitle,"onUpdate:modelValue":t[2]||=e=>q(h).subtitle=e,placeholder:e.$t(`components.notification_interface.subtitle`),class:`w-full`},null,8,[`modelValue`,`placeholder`])]),G(`div`,Xe,[G(`label`,Ze,k(e.$t(`components.notification_interface.body`)),1),K(a,{modelValue:q(h).body,"onUpdate:modelValue":t[3]||=e=>q(h).body=e,placeholder:e.$t(`components.notification_interface.body`),rows:`3`,class:`w-full`},null,8,[`modelValue`,`placeholder`])]),G(`div`,Qe,[G(`label`,$e,k(e.$t(`components.notification_interface.severity`)),1),K(o,{modelValue:q(h).severity,"onUpdate:modelValue":t[4]||=e=>q(h).severity=e,options:q(te),"option-label":`label`,"option-value":`value`,class:`w-full`},null,8,[`modelValue`,`options`])]),G(`div`,et,[G(`label`,tt,k(e.$t(`components.notification_interface.tag`)),1),K(n,{modelValue:q(h).tag,"onUpdate:modelValue":t[5]||=e=>q(h).tag=e,placeholder:`motion:cam-1`,class:`w-full`},null,8,[`modelValue`])]),G(`div`,nt,[G(`label`,rt,k(e.$t(`components.notification_interface.image_url`)),1),K(n,{modelValue:q(h).imageUrl,"onUpdate:modelValue":t[6]||=e=>q(h).imageUrl=e,placeholder:`https://…`,class:`w-full`},null,8,[`modelValue`])]),G(`div`,it,[G(`label`,at,k(e.$t(`components.notification_interface.deep_link`)),1),K(n,{modelValue:q(h).deepLink,"onUpdate:modelValue":t[7]||=e=>q(h).deepLink=e,placeholder:`/cameras/cam-1`,class:`w-full`},null,8,[`modelValue`])]),G(`div`,ot,[G(`label`,st,k(e.$t(`components.notification_interface.data`)),1),(O(!0),V(j,null,T(q(g),(t,r)=>(O(),V(`div`,{key:r,class:`flex gap-2 items-center`},[K(n,{modelValue:t.key,"onUpdate:modelValue":e=>t.key=e,placeholder:e.$t(`components.notification_interface.data_key`),class:`flex-1 min-w-0`},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`]),K(n,{modelValue:t.value,"onUpdate:modelValue":e=>t.value=e,placeholder:e.$t(`components.notification_interface.data_value`),class:`flex-1 min-w-0`},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`]),K(c,{text:``,rounded:``,severity:`danger`,class:`cui-icon-md shrink-0`,onClick:e=>oe(r)},{icon:W(()=>[K(s,{width:`100%`,height:`100%`})]),_:1},8,[`onClick`])]))),128)),K(c,{severity:`secondary`,outlined:``,fluid:``,class:`cui-button-medium`,label:e.$t(`components.notification_interface.add_data`),onClick:ae},{icon:W(()=>[K(l,{class:`w-4 h-4`})]),_:1},8,[`label`])])]),G(`div`,ct,[G(`h3`,lt,k(e.$t(`components.notification_interface.targets`)),1),q(b)?(O(),V(`div`,ut,[K(d,{class:`w-[24px] h-[24px] m-0`,"stroke-width":`5`})])):q(w).length?(O(),V(`div`,ft,[G(`span`,pt,k(e.$t(`components.notification_interface.targets_hint`)),1),K(f,{modelValue:q(x),"onUpdate:modelValue":t[8]||=e=>ce(x)?x.value=e:null,options:q(w),"option-label":`label`,"option-value":`id`,placeholder:e.$t(`components.notification_interface.all_devices`),display:`chip`,filter:``,class:`w-full`},null,8,[`modelValue`,`options`,`placeholder`])])):(O(),V(`div`,dt,k(e.$t(`components.notification_interface.no_devices`)),1))]),q(S)?.length?(O(),V(`div`,mt,[G(`h3`,ht,k(e.$t(`components.notification_interface.settings`)),1),K(ee,{"schema-form":{schema:q(S),config:{}},loading:q(C)},null,8,[`schema-form`,`loading`])])):F(``,!0),K(c,{fluid:``,class:`mt-8 cui-button-medium`,severity:`success`,loading:q(v),disabled:!q(p)||q(v),label:e.$t(`components.notification_interface.send_test`),onClick:A},null,8,[`loading`,`disabled`,`label`])])}}}),_t=.15,vt=.38,yt={class:`mb-4 rounded-xl overflow-hidden`},bt=[`src`],xt={class:`text-sm text-muted mb-4`},St={key:0,class:`ml-1`},Ct={class:`flex gap-2 mb-4`},wt={key:0,class:`flex flex-col gap-2`},Tt={class:`text-sm truncate flex-1 mr-3`},Et={class:`flex items-center gap-2 shrink-0`},Dt=M({__name:`PluginClipInterface`,props:{src:{},response:{},onTextSearch:{type:Function}},setup(e,{expose:t}){let n=e,a=ne(),o=H(``),s=H(!1),c=H([]);function l(e){return Math.max(0,Math.min(1,(e-_t)/(vt-_t)))}async function u(){let e=o.value.trim();if(!(!e||s.value)){s.value=!0;try{let{score:t}=await n.onTextSearch(e);c.value.unshift({query:e,rawScore:t,displayScore:l(t)}),o.value=``}catch(e){a.error(`CLIP text search failed:`,e)}finally{s.value=!1}}}return t({}),(t,n)=>{let a=r,l=i,d=Oe;return O(),V(`div`,null,[G(`div`,yt,[G(`img`,{src:e.src,alt:`CLIP test image`,class:`w-full object-contain`},null,8,bt)]),G(`div`,xt,[A(k(e.response.embeddings.length)+` embedding(s), `+k(e.response.embeddings[0]?.embedding?.length??0)+`-dim `,1),e.response.embeddingModel?(O(),V(`span`,St,`(`+k(e.response.embeddingModel)+`)`,1)):F(``,!0)]),G(`div`,Ct,[K(a,{modelValue:q(o),"onUpdate:modelValue":n[0]||=e=>ce(o)?o.value=e:null,class:`flex-1`,placeholder:t.$t(`components.clip_interface.enter_query`),onKeyup:U(u,[`enter`])},null,8,[`modelValue`,`placeholder`]),K(l,{class:`cui-button-medium`,label:t.$t(`components.clip_interface.search`),loading:q(s),onClick:u},null,8,[`label`,`loading`])]),q(c).length?(O(),V(`div`,wt,[(O(!0),V(j,null,T(q(c),(e,t)=>(O(),V(`div`,{key:t,class:`flex items-center justify-between p-3 rounded-lg content-background`},[G(`span`,Tt,k(e.query),1),G(`div`,Et,[G(`div`,{class:ae([`text-sm font-medium`,e.displayScore>=.5?`text-green-500`:e.displayScore>=.25?`text-yellow-500`:`text-red-400`])},k((e.displayScore*100).toFixed(0))+`% `,3),K(d,{value:e.displayScore>=.5?`Match`:e.displayScore>=.25?`Possible`:`No match`,severity:e.displayScore>=.5?`success`:e.displayScore>=.25?`warn`:`danger`,class:`text-xs`},null,8,[`value`,`severity`])])]))),128))])):F(``,!0)])}}}),Ot=M({__name:`PluginMotionInterface`,props:{response:{}},setup(e){let{response:t}=fe(e),n=se(`videoPlayerRef`);return E(()=>{if(n.value){let e=new Blob([t.value.videoData],{type:`video/mp4`});n.value.src=URL.createObjectURL(e),n.value.load()}}),(e,t)=>(O(),V(`div`,null,[G(`video`,{ref_key:`videoPlayerRef`,ref:n,controls:``,class:`w-full`},`Your browser does not support the video tag.`,512)]))}}),kt={class:`mb-5 h-min`},At=[`src`],jt=M({__name:`PluginObjectInterface`,props:{src:{},response:{}},setup(e){let{response:t,src:n}=fe(e),r=z(()=>t.value.detections);return(e,t)=>{let i=f;return O(),V(`div`,kt,[K(i,{detections:q(r)},null,8,[`detections`]),G(`img`,{src:q(n),alt:`Preview`,class:`w-full`},null,8,At)])}}}),Mt={key:0,class:`w-full`},Nt={class:`flex flex-col justify-center items-center mb-5`},Pt={for:`restoreInput`,class:`cursor-pointer text-center text-sm`},Ft=[`accept`],It={key:0,class:`text-red-500 text-sm`},Lt={key:1,class:`w-full flex flex-col items-center justify-center`},Rt={key:0,class:`relative mb-4`},zt=[`src`],Bt={key:1,class:`relative mb-4 w-full`},Vt={key:2,class:`relative mb-4 w-full`},Ht=[`src`,`type`],Ut={class:`flex items-center justify-center`},Wt={class:`mx-2`},Gt={class:`text-muted`},Kt={class:`flex items-center justify-center mt-2 text-xs text-muted`},qt={class:`mt-10`},Jt={class:`text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Yt={key:0,class:`flex items-center justify-center text-sm text-muted mt-5`},Xt=M({__name:`CuiDetectionInterface`,props:{type:{},pluginName:{}},emits:[`update:file`,`update:metadata`],setup(e,{emit:t}){let n={motionDetection:`drop_or_select_video_to_detect_motion`,audioDetection:`drop_or_select_audio_to_detect`,objectDetection:`drop_or_select_image_to_detect_objects`,faceDetection:`drop_or_select_image_to_detect_faces`,licensePlateDetection:`drop_or_select_image_to_detect_license_plates`,classifierDetection:`drop_or_select_image_to_classify`,clipDetection:`drop_or_select_image_for_semantic_search`},r=e,a=t,o=ne(),{t:s}=l(),u=ee(),d=p(),{type:f,pluginName:te}=fe(r),{plugin:m,isLoading:h}=c(te),g=se(`fileInputRef`),_=se(`videoPlayerRef`),v=se(`audioPlayerRef`),y=I([]),re=H(!1),b=H(!1),x=H(!1),S=H(!1),C=H(``),T=H(!1),E=H(),ie=H(!0),oe=I(),j=H(!1),M=z(()=>j.value||h.value||T.value),ce=z(()=>n[f.value]),P=z(()=>{switch(f.value){case`objectDetection`:case`faceDetection`:case`licensePlateDetection`:case`classifierDetection`:case`clipDetection`:return`image`;case`motionDetection`:return`video`;case`audioDetection`:return`audio`;default:return`image`}}),L=z(()=>{switch(P.value){case`image`:return he;case`video`:return ve;case`audio`:return pe;default:return[]}}),le=z(()=>{switch(P.value){case`image`:return ge;case`video`:return J;case`audio`:return _e;default:return 0}}),ue=z(()=>L.value.join(`,`));async function B(){if(m.value){j.value=!0;try{let e;switch(f.value){case`motionDetection`:e=await m.value.motionDetectionSettings?.();break;case`objectDetection`:e=await m.value.objectDetectionSettings?.();break;case`audioDetection`:e=await m.value.audioDetectionSettings?.();break;case`faceDetection`:e=await m.value.faceDetectionSettings?.();break;case`licensePlateDetection`:e=await m.value.licensePlateDetectionSettings?.();break;case`classifierDetection`:e=await m.value.classifierDetectionSettings?.();break;case`clipDetection`:e=await m.value.clipSettings?.();break}oe.value=e}catch(e){o.error(`Failed to load interface schema:`,e),oe.value=void 0}finally{j.value=!1}}}function de(e){let t=y.value.findIndex(t=>t.name===e);t>-1&&(y.value.splice(t,1),ye(),C.value=``,P.value===`video`&&_.value&&(_.value.src=``),E.value=void 0,a(`update:file`,null),a(`update:metadata`,null))}function U(e){if(re.value=!1,b.value=!1,S.value=!1,y.value=[],e.dataTransfer)if(e.dataTransfer.files.length>1)b.value=!0;else{let t=e.dataTransfer.files[0];(L.value.length===0||L.value.includes(t.type))&&t.size<=le.value?(y.value.push(t),w(()=>{be(t)})):t.size>le.value?S.value=!0:b.value=!0}}function me(e){b.value=!1,S.value=!1,y.value=[];let t=e.target;if(t&&t.files){if(t.files?.length>1)b.value=!0;else if(t.files.length===1){let e=t.files[0],n=L.value.length===0||L.value.includes(e.type);e.size<=le.value&&n?(y.value.push(e),w(()=>{be(e)})):e.size>le.value?S.value=!0:b.value=!0}}}function ye(){g.value&&(g.value.value=``)}function be(e){T.value=!0;let t=URL.createObjectURL(e);switch(P.value){case`image`:xe(e,t);break;case`video`:Y(e,t);break;case`audio`:Se(e,t);break}}function xe(e,t){let n=new Image;n.src=t,n.onload=()=>{C.value=n.src;let t={width:n.width,height:n.height};E.value=t,a(`update:metadata`,t),a(`update:file`,e),T.value=!1}}function Y(e,t){_.value&&(_.value.src=t,_.value.load(),_.value.onloadeddata=()=>{a(`update:file`,e),T.value=!1})}function Se(e,t){C.value=t;let n=new Audio;n.src=t,n.onloadedmetadata=()=>{let t={mimeType:e.type};E.value=t,a(`update:metadata`,t),a(`update:file`,e),T.value=!1}}function Ce(e){return e<1024?e+` bytes`:e<1048576?(e/1024).toFixed(1)+` KB`:(e/1048576).toFixed(1)+` MB`}function we(e,t){let n=0,r=0,i=0;for(let a=0;a<e.length;a++)n+=e[a]*t[a],r+=e[a]*e[a],i+=t[a]*t[a];return r&&i?n/(Math.sqrt(r)*Math.sqrt(i)):0}async function Te(e){if(!y.value.length){x.value=!0;return}if(!m.value){o.error(`Plugin not connected`);return}T.value=!0;try{let t=await y.value[0].arrayBuffer();if(f.value===`audioDetection`){let n=await m.value.testAudioDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No audio detection interface available`);return}if(n.detected&&n.detections?.length){let e=n.detections.map(e=>`${e.label} (${Math.round(e.confidence*100)}%)`).join(`, `),t=n.decibels==null?``:` | ${n.decibels.toFixed(1)} dBFS`;u.add({severity:`success`,detail:`${e}${t}`,life:3e3})}else u.add({severity:`info`,detail:s(`components.detection_interface.audio_not_detected`),life:3e3})}else if(f.value===`motionDetection`){let n=await m.value.testMotionDetection?.(new Uint8Array(t),e);if(!n){o.warn(`No motion detection interface available`);return}d.openComponentDialog(Ot,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{response:n}}})}else if(f.value===`faceDetection`){let n=await m.value.testFaceDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No face detection interface available`);return}d.openComponentDialog(jt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n}}})}else if(f.value===`licensePlateDetection`){let n=await m.value.testLicensePlateDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No license plate detection interface available`);return}d.openComponentDialog(jt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n}}})}else if(f.value===`classifierDetection`){let n=await m.value.testClassifierDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No classifier detection interface available`);return}d.openComponentDialog(jt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n}}})}else if(f.value===`clipDetection`){let n=await m.value.testClipEmbedding?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No CLIP detection interface available`);return}if(!n.embeddings?.length){u.add({severity:`info`,detail:s(`components.detection_interface.no_detections`),life:3e3});return}let r=n.embeddings[0].embedding;d.openComponentDialog(Dt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n,onTextSearch:async e=>{let t=await m.value.getTextEmbedding(e);return t?.embedding?.length?{score:we(r,t.embedding)}:{score:0}}}}})}else{let n=await m.value.testObjectDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No object detection interface available`);return}d.openComponentDialog(jt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n}}})}}catch(e){u.add({severity:`error`,detail:e,life:3e3})}finally{T.value=!1}}return D(m,e=>{e&&B()},{immediate:!0}),D(y,e=>{e.length>0?(x.value=!1,ie.value=!1):(C.value=``,E.value=void 0,ie.value=!0)},{immediate:!0,deep:!0}),(e,t)=>{let n=X,r=i,a=Me;return O(),V(`div`,null,[G(`div`,{class:`file-upload-box`,onDrop:t[1]||=R(e=>U(e),[`prevent`]),onDragover:t[2]||=R(e=>re.value=!0,[`prevent`]),onDragenter:t[3]||=R(e=>re.value=!0,[`prevent`]),onDragleave:t[4]||=R(e=>re.value=!1,[`prevent`])},[q(y).length?(O(),V(`div`,Lt,[q(P)===`image`?(O(),V(`div`,Rt,[G(`img`,{src:q(C),alt:`Preview`,class:`w-full`},null,8,zt)])):q(P)===`video`?(O(),V(`div`,Bt,[G(`video`,{ref_key:`videoPlayerRef`,ref:_,controls:``,class:`w-full`},`Your browser does not support the video tag.`,512)])):q(P)===`audio`?(O(),V(`div`,Vt,[G(`audio`,{ref_key:`audioPlayerRef`,ref:v,controls:``,class:`w-full`},[G(`source`,{src:q(C),type:q(y)[0].type},null,8,Ht),t[5]||=A(` Your browser does not support the audio element. `,-1)],512)])):F(``,!0),G(`div`,Ut,[K(r,{text:``,rounded:``,severity:`danger`,class:`cui-icon-md shrink-0`,onClick:t[0]||=R(e=>de(q(y)[0].name),[`stop`])},{icon:W(()=>[K(n,{width:`100%`,height:`100%`})]),_:1}),G(`b`,Wt,k(q(y)[0].name),1),G(`span`,Gt,`(`+k(Ce(q(y)[0].size))+`)`,1)])])):(O(),V(`div`,Mt,[G(`div`,Nt,[G(`label`,Pt,k(e.$t(`components.detection_interface.${q(ce)}`)),1),G(`input`,{id:`restoreInput`,ref_key:`fileInputRef`,ref:g,type:`file`,class:`hidden`,accept:q(ue),onChange:me},null,40,Ft),q(b)?(O(),V(`p`,It,k(e.$t(`components.detection_interface.only_one_${q(P)}_allowed`)),1)):F(``,!0),q(x)?(O(),V(`p`,{key:1,class:ae([`text-red-500 text-sm`,{"mt-2":q(b)}])},k(e.$t(`components.detection_interface.${q(P)}_required`)),3)):F(``,!0),q(S)?(O(),V(`p`,{key:2,class:ae([`text-red-500 text-sm`,{"mt-2":q(b)||q(x)}])},k(e.$t(`components.detection_interface.file_size_error`)),3)):F(``,!0)])]))],32),G(`div`,Kt,[G(`span`,null,`(`+k(q(le)/1024/1024)+`MB, `+k(q(L).join(`, `))+`)`,1)]),G(`div`,qt,[G(`h3`,Jt,k(e.$t(`components.detection_interface.interface_config`)),1),q(oe)?.length?(O(),N(a,{key:1,"schema-form":{schema:q(oe),config:{}},loading:q(M),"save-button-label":e.$t(`components.detection_interface.detect`),"disable-button":q(ie),"show-button":``,onOnFormSubmit:Te},null,8,[`schema-form`,`loading`,`save-button-label`,`disable-button`])):(O(),V(`div`,Yt,k(e.$t(`components.detection_interface.no_interface_config`)),1))])])}}}),Zt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Qt(e,t){return O(),V(`svg`,Zt,[...t[0]||=[G(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M2 10v3m4-7v11m4-14v18m4-13v7m4-10v13m4-8v3`},null,-1)]])}var $t=B({name:`lucide-audio-lines`,render:Qt}),en={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tn(e,t){return O(),V(`svg`,en,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M2 7V4q0-.825.588-1.412T4 2h3v2H4v3zm5 15H4q-.825 0-1.412-.587T2 20v-3h2v3h3zm10 0v-2h3v-3h2v3q0 .825-.587 1.413T20 22zm3-15V4h-3V2h3q.825 0 1.413.588T22 4v3zm-7.913 1.913Q11.5 8.325 11.5 7.5t.588-1.412T13.5 5.5t1.413.588T15.5 7.5t-.587 1.413T13.5 9.5t-1.412-.587M12.8 18h-4l1-5.1l-1.8.7V17H6v-4.7l3.95-1.7q.875-.375 1.288-.487T12 10q.525 0 .975.275T13.7 11l1 1.6q.65 1.05 1.763 1.725T19 15v2q-1.65 0-3.088-.687T13.5 14.5z`},null,-1)]])}var nn=B({name:`material-symbols-detection-and-zone`,render:tn}),rn={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function an(e,t){return O(),V(`svg`,rn,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M8.113 13.888Q7.75 13.525 7.75 13t.363-.888T9 11.75t.888.363t.362.887t-.363.888T9 14.25t-.888-.363m6 0q-.362-.362-.362-.887t.363-.888t.887-.362t.888.363t.362.887t-.363.888t-.887.362t-.888-.363M12 20q3.35 0 5.675-2.325T20 12q0-.6-.075-1.162T19.65 9.75q-.525.125-1.05.188T17.5 10q-2.275 0-4.3-.975T9.75 6.3q-.8 1.95-2.287 3.388T4 11.85V12q0 3.35 2.325 5.675T12 20m0 2q-2.075 0-3.9-.787t-3.175-2.138T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22`},null,-1)]])}var on=B({name:`material-symbols-face`,render:an}),sn={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function cn(e,t){return O(),V(`svg`,sn,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M8 17q-.425 0-.712-.288T7 16t.288-.712T8 15h5q-.35-.425-.562-.925T12.1 13H10q-.425 0-.712-.288T9 12t.288-.712T10 11h2.1q.125-.575.338-1.075T13 9H4q-.425 0-.712-.288T3 8t.288-.712T4 7h13q2.075 0 3.538 1.463T22 12t-1.463 3.538T17 17zm9-2q1.25 0 2.125-.875T20 12t-.875-2.125T17 9t-2.125.875T14 12t.875 2.125T17 15M3 13q-.425 0-.712-.288T2 12t.288-.712T3 11h4q.425 0 .713.288T8 12t-.288.713T7 13zm1 4q-.425 0-.712-.288T3 16t.288-.712T4 15h1q.425 0 .713.288T6 16t-.288.713T5 17z`},null,-1)]])}var ln=B({name:`material-symbols-motion-blur-rounded`,render:cn}),un={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function dn(e,t){return O(),V(`svg`,un,[...t[0]||=[G(`g`,{fill:`none`,"fill-rule":`evenodd`},[G(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),G(`path`,{fill:`currentColor`,d:`M15.586 2.757a2 2 0 0 1 2.828 0l2.829 2.829a2 2 0 0 1 0 2.828l-2.829 2.829a2 2 0 0 1-2.828 0l-2.829-2.829a2 2 0 0 1 0-2.828zM9 3a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm12 12a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2zM9 13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2z`})],-1)]])}var fn=B({name:`mingcute-classify-2-fill`,render:dn}),pn={viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`};function mn(e,t){return O(),V(`svg`,pn,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M200 156c0 6.5-7.33 12-16 12s-16-5.5-16-12s7.33-12 16-12s16 5.5 16 12m32-100v144a16 16 0 0 1-16 16H40a16 16 0 0 1-16-16V56a16 16 0 0 1 16-16h176a16 16 0 0 1 16 16m-88.63 116.88l-44-104a8 8 0 0 0-14.74 0l-44 104a8 8 0 0 0 14.74 6.24L66.84 152h50.32l11.47 27.12a8 8 0 0 0 14.74-6.24M216 124c0-15.44-14.36-28-32-28a34.86 34.86 0 0 0-20.78 6.68a8 8 0 0 0 9.56 12.83A18.84 18.84 0 0 1 184 112c8.56 0 15.8 5.36 16 11.76v8a35.24 35.24 0 0 0-16-3.76c-17.64 0-32 12.56-32 28s14.36 28 32 28a35.1 35.1 0 0 0 16.93-4.26A8 8 0 0 0 216 176ZM73.61 136h36.78L92 92.53Z`},null,-1)]])}var hn=B({name:`ph-text-aa-fill`,render:mn}),gn={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function _n(e,t){return O(),V(`svg`,gn,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M12.75 3a.75.75 0 0 0-1.5 0v2a.75.75 0 0 0 1.5 0z`},null,-1),G(`path`,{fill:`currentColor`,"fill-rule":`evenodd`,d:`M22.75 12.057c0 1.837 0 3.293-.153 4.432c-.158 1.172-.49 2.121-1.238 2.87c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153H9.944c-1.837 0-3.293 0-4.432-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433v-.926q.001-.575.008-1.096c.014-.975.05-1.81.145-2.523c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c.716-.096 1.558-.132 2.541-.145l.697-.005a1 1 0 0 1 1.001.999V5a2.25 2.25 0 0 0 4.5 0v-.75c0-.552.448-1 1-.998c1.29.006 2.359.033 3.239.151c1.172.158 2.121.49 2.87 1.238c.748.749 1.08 1.698 1.238 2.87c.153 1.14.153 2.595.153 4.433zM8 9.75a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5zm0 3.5a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z`,"clip-rule":`evenodd`},null,-1)]])}var vn=B({name:`solar-plate-bold`,render:_n}),yn={class:`font-semibold text-xl truncate`},bn={class:`lg:col-span-2 order-1 !h-[220px]`},xn={class:`flex w-full h-full items-center justify-center`},Sn={class:`lg:col-span-1 lg:row-span-3 order-2`},Cn={class:`lg:!hidden card-title`},wn={key:0,class:`w-full h-full flex items-center justify-center`},Tn={key:1},En={class:`hidden lg:block text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Dn={key:0,class:`flex items-center justify-center w-full h-full text-muted text-sm`},On=[`onClick`],kn={key:0,class:`w-full h-full`},An={key:0,class:`flex flex-col items-center justify-center w-full h-full text-muted text-sm gap-3 text-center`},jn={key:2,class:`flex items-center justify-center w-full h-full text-muted text-sm`},Mn={key:9,class:`w-full h-full`},Nn={key:0,class:`flex items-center justify-center w-full h-full text-muted text-sm`},Pn={key:1,class:`flex items-center justify-center gap-2 w-full h-full text-muted text-sm`},Fn={class:`lg:col-span-2 order-3`},In={class:`lg:!hidden card-title`},Ln={class:`hidden lg:block text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Rn={key:0,class:`flex w-full h-full items-center justify-center`},zn=[`innerHTML`],Bn={class:`lg:col-span-2 order-4`},Vn={class:`lg:!hidden card-title`},Hn={class:`hidden lg:block text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Un={key:0,class:`flex w-full h-full items-center justify-center`},Wn=[`innerHTML`],Gn=x(M({__name:`Plugin`,setup(r){let d=new S,f=new Ne,m=ne(),re=g(),x=xe(),w=ee(),E=p(),{lgBreakpoint:se}=_(),{t:A}=l(),M=H(x.params.scope),P=H(x.params.pluginname),I=z(()=>M.value?`${M.value}/${P.value}`:P.value),{contract:R,error:B}=c(I);f.toggleQueryActivator(`getPluginContractQuery`,!1);let{data:U,isBusy:fe}=f.getPluginQuery(I),{data:pe,isBusy:he}=f.getPluginReadmeQuery(I),{data:ge,isBusy:_e}=f.getPluginChangelogQuery(I),{data:ve}=f.getPluginContractQuery(I),J=s(I),Y=J.config,Oe=J.isLoading,{mutate:ke,isPending:Ae}=d.addCameraExtensionQuery(),{mutate:je,isPending:Ie}=d.removeCameraExtensionQuery(),X=H(`settings`),Z=H([]),Q=H([]),Ke=H(me.UNKNOWN),qe,Je=z(()=>!!R.value&&o(R.value,t.NVR)),$=z(()=>Ke.value===me.READY||Ke.value===me.STARTED),Ye=z(()=>$.value?Je.value||Y.value?.schema?.length?!0:Oe.value:!1),Xe=He(`commonmark`,{highlight(e,t){if(t&&Be.getLanguage(t))try{return`<pre><code class="hljs">`+Be.highlight(e,{language:t,ignoreIllegals:!0}).value+`</code></pre>`}catch{}return`<pre><code class="hljs">`+Xe.utils.escapeHtml(e)+`</code></pre>`}});Be.registerLanguage(`typescript`,Ve),Be.registerLanguage(`yaml`,ze),Be.registerLanguage(`json`,Le),Be.registerLanguage(`python`,Re);function Ze(e,t){return e.pluginInfo?.name===t}async function Qe(e){try{await J.setValue(e.key,void 0),w.add({severity:`success`,detail:A(`components.toast.config_updated`),life:3e3})}catch(e){w.add({severity:`error`,detail:e,life:3e3})}}async function $e(e){try{let t=await J.submitValue(e.key,e.payload);if(t?.toast){let e=y(t.toast.type);w.add({severity:e,detail:t.toast.message,life:3e3})}t?.schema?.length&&E.openComponentDialog(Pe,{data:{title:A(`components.dialog.title.config`),hideConfirmButton:!0,contentProps:{schemaConfig:{schema:t.schema,config:e.payload},pluginName:I.value,buttonKey:e.key}}})}catch(e){w.add({severity:`error`,detail:e,life:3e3})}}async function et(e){if(Y.value?.schema.length)try{let t=ye(Y.value.schema,e);await J.setConfig(t),w.add({severity:`success`,detail:A(`components.toast.config_updated`),life:3e3})}catch(e){w.add({severity:`error`,detail:e,life:3e3})}}async function tt(t){if(U.value&&U.value.contract){let n=e(U.value.contract)?[`hub`]:U.value.contract.provides;if(Q.value.includes(t.name))for(let e of n)je({cameraname:t.name,pluginname:U.value.pluginName,type:e},{onSuccess:()=>{Q.value=Q.value.filter(e=>e!==t.name)}});else for(let e of n)ke({cameraname:t.name,pluginname:U.value.pluginName,type:e},{onSuccess:()=>{Q.value=[...Q.value,t.name]}})}}return D(U,e=>{if(!e||e.disabled){let e=Z.value.some(e=>e.name===`settings`),t=Z.value.some(e=>e.name===`cameras`);e?X.value=`settings`:t&&(X.value=`cameras`)}},{deep:!0}),D(x,()=>{P.value=x.params.pluginname},{deep:!0,immediate:!0}),D([U,J.isConnected],async([e,t])=>{e&&!e.disabled&&t&&await J.getConfig()},{immediate:!0}),D(I,e=>{qe?.stop(),e&&(qe=le(),qe.run(()=>{let t=We(e);t.connect(),D(t.status,e=>Ke.value=e,{immediate:!0})}))},{immediate:!0}),D(Y,()=>{Y.value?f.toggleQueryActivator(`getPluginContractQuery`,!0):f.toggleQueryActivator(`getPluginContractQuery`,!1)},{deep:!0,immediate:!0}),D([ve,Y,R,Ye,$],()=>{let e=[],n=!1;Ye.value&&e.push({name:`settings`,icon:v,isInterface:!1,tooltip:A(`views.plugin.settings_tab_tooltip`)}),$.value&&R.value&&o(R.value,t.MotionDetection)&&(n=!0,e.push({name:`motion_detection`,icon:ln,isInterface:!0,tooltip:A(`views.plugin.motion_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.ObjectDetection)&&(n=!0,e.push({name:`object_detection`,icon:nn,isInterface:!0,tooltip:A(`views.plugin.object_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.AudioDetection)&&(n=!0,e.push({name:`audio_detection`,icon:$t,isInterface:!0,tooltip:A(`views.plugin.audio_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.FaceDetection)&&(n=!0,e.push({name:`face_detection`,icon:on,isInterface:!0,tooltip:A(`views.plugin.face_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.LicensePlateDetection)&&(n=!0,e.push({name:`license_plate_detection`,icon:vn,isInterface:!0,tooltip:A(`views.plugin.license_plate_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.ClassifierDetection)&&(n=!0,e.push({name:`classifier_detection`,icon:fn,isInterface:!0,tooltip:A(`views.plugin.classifier_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.ClipDetection)&&(n=!0,e.push({name:`clip_detection`,icon:hn,isInterface:!0,tooltip:A(`views.plugin.clip_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.Notifier)&&(n=!0,e.push({name:`notification`,icon:h,isInterface:!0,tooltip:A(`views.plugin.notification_tab_tooltip`)})),e.push({name:`cameras`,icon:b,isInterface:!1,tooltip:A(`views.plugin.cameras_tab_tooltip`)}),ve.value?.cameras.length&&(Q.value=ve.value.cameras.filter(e=>e.plugins?.some(e=>e.name===I.value)).map(e=>e.name)),Z.value=[...e],U.value?.disabled||(Ye.value?X.value=`settings`:n?X.value=Z.value.filter(e=>e.isInterface)[0].name:X.value=`cameras`)},{deep:!0,immediate:!0}),D(B,e=>{e&&U.value&&!U.value.disabled&&m.error(`Error connecting to plugin:`,e)}),ie(()=>qe?.stop()),(e,t)=>{let r=Ue,o=i,s=C,c=u,l=n,d=Ge,f=Se,p=Ee,ee=be,m=Me,h=Xt,g=gt,ne=Fe,_=Te,v=te,y=we,b=De,x=Ce,S=a;return O(),V(`div`,{key:q(I)},[K(s,{position:`left`},{default:W(()=>[K(o,{severity:`secondary`,text:``,class:`cui-button p-2 text-color non-draggable-region`,onClick:t[0]||=t=>e.$router.push(`/plugins`)},{icon:W(()=>[K(r,{class:`w-6 h-6`})]),_:1})]),_:1}),K(s,{position:`center`},{default:W(()=>[G(`span`,yn,k(e.$t(`views.plugin.title`)),1)]),_:1}),G(`div`,{class:ae([`grid grid-auto grid-cols-1 lg:grid-cols-3 gap-6 lg:h-full`,{"!gap-2":q(se)}])},[G(`div`,bn,[q(U)?(O(),N(d,{key:1,plugin:q(U),class:`h-[220px]`},null,8,[`plugin`])):(O(),N(l,{key:0,class:`cui-card items-center justify-center !h-[220px]`},{content:W(()=>[G(`div`,xn,[K(c,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])]),_:1}))]),G(`div`,Sn,[G(`span`,Cn,k(e.$t(`views.plugin.settings`)),1),K(l,{class:ae([`cui-card !h-auto lg:!h-full`,{"items-center justify-center":q(fe)||q(Oe)}])},{content:W(()=>[q(fe)||q(Oe)?(O(),V(`div`,wn,[K(c,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(O(),V(`div`,Tn,[G(`h3`,En,k(e.$t(`views.plugin.settings`)),1),q(U)?.disabled?(O(),V(`div`,Dn,[G(`span`,null,k(e.$t(`views.plugin.disabled_info`)),1)])):(O(),N(x,{key:1,value:q(X),"onUpdate:value":t[2]||=e=>ce(X)?X.value=e:null,scrollable:``},{default:W(()=>[K(p,{class:`justify-between`,pt:{activeBar:{class:`!w-auto`},content:{class:`border-[1px] border-color cui-rounded-corner overflow-hidden`}}},{default:W(()=>[(O(!0),V(j,null,T(q(Z),(e,t)=>(O(),N(f,{key:t,disabled:e.isInterface&&q(U)?.disabled,value:e.name,"as-child":``},{default:W(t=>[de((O(),V(`div`,ue({ref_for:!0},t.a11yAttrs,{class:[`flex flex-col items-center justify-center flex-1 content-background !py-3 h-[55px]`,[{"hover:!text-color active:!text-color focus:!text-color":!t.active},t.class]],onClick:t.onClick}),[(O(),N(oe(e.icon),{class:`w-5 h-5`}))],16,On)),[[S,{value:e.tooltip}]])]),_:2},1032,[`disabled`,`value`]))),128))]),_:1}),K(b,{class:`px-0 pb-0`},{default:W(()=>[(O(!0),V(j,null,T(q(Z),(n,r)=>(O(),N(y,{key:r,value:n.name,"as-child":``},{default:W(r=>[r.active?(O(),V(`div`,ue({key:0,class:r.class},{ref_for:!0},r.a11yAttrs),[n.name===`settings`?(O(),V(`div`,kn,[q(Je)?(O(),V(`div`,An,[G(`span`,null,k(e.$t(`views.plugin.nvr_settings_hint`)),1),K(o,{class:`cui-button-medium whitespace-nowrap`,label:e.$t(`views.plugin.nvr_settings_button`),onClick:t[1]||=t=>e.$router.push(`/settings/recordings`)},{icon:W(()=>[K(ee,{class:`w-4 h-4`})]),_:1},8,[`label`])])):q(Y)?.schema?.length?(O(),N(m,{key:1,"schema-form":{schema:q(Y).schema,config:q(Y).config},loading:q(J).isLoading.value,"save-button-color":`success`,onOnAction:Qe,onOnSubmit:$e,onOnFormSubmit:et},null,8,[`schema-form`,`loading`])):(O(),V(`div`,jn,[G(`span`,null,k(e.$t(`views.plugin.no_settings`)),1)]))])):n.name===`motion_detection`?(O(),N(h,{key:1,"plugin-name":q(I),type:`motionDetection`},null,8,[`plugin-name`])):n.name===`object_detection`?(O(),N(h,{key:2,"plugin-name":q(I),type:`objectDetection`},null,8,[`plugin-name`])):n.name===`audio_detection`?(O(),N(h,{key:3,"plugin-name":q(I),type:`audioDetection`},null,8,[`plugin-name`])):n.name===`face_detection`?(O(),N(h,{key:4,"plugin-name":q(I),type:`faceDetection`},null,8,[`plugin-name`])):n.name===`license_plate_detection`?(O(),N(h,{key:5,"plugin-name":q(I),type:`licensePlateDetection`},null,8,[`plugin-name`])):n.name===`classifier_detection`?(O(),N(h,{key:6,"plugin-name":q(I),type:`classifierDetection`},null,8,[`plugin-name`])):n.name===`clip_detection`?(O(),N(h,{key:7,"plugin-name":q(I),type:`clipDetection`},null,8,[`plugin-name`])):n.name===`notification`?(O(),N(g,{key:8,"plugin-name":q(I)},null,8,[`plugin-name`])):n.name===`cameras`?(O(),V(`div`,Mn,[q(ve)?.cameras?.length?q($)?(O(!0),V(j,{key:2},T(q(ve).cameras,e=>(O(),V(`div`,{key:e.name,class:`cui-list-item`},[K(v,{disabled:q(Ae)||q(Ie)||q(J).isLoading.value,active:q(Q).includes(e.name),class:`h-14`,onClick:t=>q(re).open({cameraName:e.name})},L({default:W(()=>[G(`span`,null,k(e.name),1)]),_:2},[!q(U)||!Ze(e,q(U).pluginName)?{name:`append`,fn:W(()=>[K(_,{"model-value":q(Q).includes(e.name),disabled:q(Ae)||q(Ie)||q(J).isLoading.value||!q($),"onUpdate:modelValue":()=>tt(e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])]),key:`0`}:void 0]),1032,[`disabled`,`active`,`onClick`])]))),128)):(O(),V(`div`,Pn,[K(ne,{class:`w-4 h-4 flex-shrink-0`}),G(`span`,null,k(e.$t(`views.plugin.assignment_requires_running`)),1)])):(O(),V(`div`,Nn,[G(`span`,null,k(e.$t(`views.plugin.no_cameras`)),1)]))])):F(``,!0)],16)):F(``,!0)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`value`]))]))]),_:1},8,[`class`])]),G(`div`,Fn,[G(`span`,In,k(e.$t(`views.plugin.readme`)),1),K(l,{class:`cui-card !h-auto lg:!h-full`},{content:W(()=>[G(`h3`,Ln,k(e.$t(`views.plugin.readme`)),1),q(he)?(O(),V(`div`,Rn,[K(c,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(O(),V(`div`,{key:1,class:`markdown-body`,innerHTML:q(Xe).render(q(pe)||e.$t(`views.plugin.no_readme`))},null,8,zn))]),_:1})]),G(`div`,Bn,[G(`span`,Vn,k(e.$t(`views.plugin.changelog`)),1),K(l,{class:`cui-card !h-auto lg:!h-full`},{content:W(()=>[G(`h3`,Hn,k(e.$t(`views.plugin.changelog`)),1),q(_e)?(O(),V(`div`,Un,[K(c,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(O(),V(`div`,{key:1,class:`markdown-body`,innerHTML:q(Xe).render(q(ge)||e.$t(`views.plugin.no_changelog`))},null,8,Wn))]),_:1})])],2)])}}}),[[`__scopeId`,`data-v-3596b20b`]]);export{Gn as default};
|
|
1
|
+
import{Cr as e,Er as t,F as n,O as r,Ot as i,Pt as a,Sr as o,_t as s,gt as c,kr as l,wt as u,yr as d}from"./vendor-cameraui-CywDBRLD.js";import{Dt as f,G as p,Gn as ee,Gt as te,Jt as m,Sn as h,X as g,Yn as ne,an as _,bn as v,f as y,h as re,kn as b,nn as x,nt as S,z as C}from"./api-BwUGcpse.js";import{An as w,Bn as T,In as E,Ln as ie,Qn as D,Rn as O,Sr as ae,Tr as k,Wn as oe,Xn as se,_n as A,an as j,bn as M,cr as ce,dn as N,dr as P,fn as F,gr as I,hn as L,in as R,ir as le,kn as ue,ln as z,lr as B,nr as de,pn as V,pr as H,rn as U,tr as W,un as G,vn as K,xr as q,yr as fe}from"./vendor-CdGy-Xet.js";import{B as pe,G as me,H as he,M as ge,U as _e,V as ve,W as J,i as ye}from"./types-Du61QgCF.js";import{r as be}from"./lightbulb-outline-BGFG7wv-.js";import{l as xe,p as Y}from"./vendor-core-0Lu3l40a.js";import{B as Se,G as Ce,H as we,K as Te,V as Ee,W as De,a as Oe,i as ke,j as Ae,l as je}from"./vendor-primevue-Cm1rEh62.js";import{t as Me}from"./CuiSchema-TojDO40O.js";import{t as Ne}from"./plugins-Ct1tFRqH.js";import{t as Pe}from"./PluginSchema-Cb_F8uew.js";import{t as Fe}from"./information-outline-CjhiKBjG.js";import{t as Ie}from"./plus-C6l_Q-mY.js";import{t as X}from"./close-circle-raXx3m4Q.js";import{a as Le,i as Re,n as ze,o as Be,r as Ve,t as He}from"./vendor-markdown-D_3Of-Gz.js";import{t as Ue}from"./back-filled-DZmo9cAg.js";import{n as We,t as Ge}from"./CuiPluginCard-4NsvwvgQ.js";var Z={class:`text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Q={class:`flex flex-col gap-4`},Ke={class:`flex flex-col field-gap`},qe={class:`cui-label`},Je={key:0,class:`text-red-500 text-sm`},$={class:`flex flex-col field-gap`},Ye={class:`cui-label`},Xe={class:`flex flex-col field-gap`},Ze={class:`cui-label`},Qe={class:`flex flex-col field-gap`},$e={class:`cui-label`},et={class:`flex flex-col field-gap`},tt={class:`cui-label`},nt={class:`flex flex-col field-gap`},rt={class:`cui-label`},it={class:`flex flex-col field-gap`},at={class:`cui-label`},ot={class:`flex flex-col field-gap`},st={class:`cui-label`},ct={class:`mt-8`},lt={class:`text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},ut={key:0,class:`flex items-center justify-center w-full py-4`},dt={key:1,class:`flex items-center justify-center text-sm text-muted py-4 text-center`},ft={key:2,class:`flex flex-col field-gap`},pt={class:`text-xs text-muted`},mt={key:0,class:`mt-8`},ht={class:`text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},gt=M({__name:`CuiNotificationInterface`,props:{pluginName:{}},setup(e){let t=e,n=ne(),{t:a}=l(),o=ee(),{user:s}=Y(re()),{pluginName:f}=fe(t),{plugin:p}=c(f),te=z(()=>Object.values(d).map(e=>({label:a(`components.notification_interface.severity_${e}`),value:e}))),h=P({title:`Test notification`,subtitle:``,body:`This is a test notification from camera.ui`,severity:d.Info,tag:``,imageUrl:``,deepLink:``}),g=H([]),_=H(!1),v=H(!1),y=I([]),b=H(!1),x=H([]),S=I(),C=H(!1),w=z(()=>y.value.map(e=>({id:e.id,label:e.name})));async function E(){if(!(!p.value||!s.value?._id)){b.value=!0;try{let e=m(void 0,`admin`)?[]:[s.value._id];y.value=await p.value.getDevices?.(e)??[]}catch(e){n.error(`Failed to load notifier devices:`,e),y.value=[]}finally{b.value=!1}}}async function ie(){if(p.value){C.value=!0;try{S.value=await p.value.notificationSettings?.()}catch(e){n.error(`Failed to load notification settings schema:`,e),S.value=void 0}finally{C.value=!1}}}function ae(){g.value.push({key:``,value:``})}function oe(e){g.value.splice(e,1)}function se(){let e={};for(let t of g.value)t.key.trim()&&(e[t.key.trim()]=t.value);return{title:h.title.trim(),subtitle:h.subtitle.trim()||void 0,body:h.body.trim()||void 0,severity:h.severity,tag:h.tag.trim()||void 0,imageUrl:h.imageUrl.trim()||void 0,deepLink:h.deepLink.trim()||void 0,data:Object.keys(e).length?e:void 0}}async function A(){let e=p.value;if(!(!e||v.value)){if(!h.title.trim()){_.value=!0;return}v.value=!0;try{let t=se(),n=x.value.length?x.value:y.value.map(e=>e.id);await e.sendNotification?.(n,t),o.add({severity:`success`,detail:a(`components.notification_interface.sent`),life:3e3})}catch(e){o.add({severity:`error`,detail:e,life:3e3})}finally{v.value=!1}}}return D(p,e=>{e&&(E(),ie())},{immediate:!0}),(e,t)=>{let n=r,a=ke,o=Ae,s=X,c=i,l=Ie,d=u,f=je,ee=Me;return O(),V(`div`,null,[G(`h3`,Z,k(e.$t(`components.notification_interface.template`)),1),G(`div`,Q,[G(`div`,Ke,[G(`label`,qe,k(e.$t(`components.notification_interface.title`)),1),K(n,{modelValue:q(h).title,"onUpdate:modelValue":[t[0]||=e=>q(h).title=e,t[1]||=e=>_.value=!1],placeholder:e.$t(`components.notification_interface.title`),invalid:q(_),class:`w-full`},null,8,[`modelValue`,`placeholder`,`invalid`]),q(_)?(O(),V(`p`,Je,k(e.$t(`components.notification_interface.title_required`)),1)):F(``,!0)]),G(`div`,$,[G(`label`,Ye,k(e.$t(`components.notification_interface.subtitle`)),1),K(n,{modelValue:q(h).subtitle,"onUpdate:modelValue":t[2]||=e=>q(h).subtitle=e,placeholder:e.$t(`components.notification_interface.subtitle`),class:`w-full`},null,8,[`modelValue`,`placeholder`])]),G(`div`,Xe,[G(`label`,Ze,k(e.$t(`components.notification_interface.body`)),1),K(a,{modelValue:q(h).body,"onUpdate:modelValue":t[3]||=e=>q(h).body=e,placeholder:e.$t(`components.notification_interface.body`),rows:`3`,class:`w-full`},null,8,[`modelValue`,`placeholder`])]),G(`div`,Qe,[G(`label`,$e,k(e.$t(`components.notification_interface.severity`)),1),K(o,{modelValue:q(h).severity,"onUpdate:modelValue":t[4]||=e=>q(h).severity=e,options:q(te),"option-label":`label`,"option-value":`value`,class:`w-full`},null,8,[`modelValue`,`options`])]),G(`div`,et,[G(`label`,tt,k(e.$t(`components.notification_interface.tag`)),1),K(n,{modelValue:q(h).tag,"onUpdate:modelValue":t[5]||=e=>q(h).tag=e,placeholder:`motion:cam-1`,class:`w-full`},null,8,[`modelValue`])]),G(`div`,nt,[G(`label`,rt,k(e.$t(`components.notification_interface.image_url`)),1),K(n,{modelValue:q(h).imageUrl,"onUpdate:modelValue":t[6]||=e=>q(h).imageUrl=e,placeholder:`https://…`,class:`w-full`},null,8,[`modelValue`])]),G(`div`,it,[G(`label`,at,k(e.$t(`components.notification_interface.deep_link`)),1),K(n,{modelValue:q(h).deepLink,"onUpdate:modelValue":t[7]||=e=>q(h).deepLink=e,placeholder:`/cameras/cam-1`,class:`w-full`},null,8,[`modelValue`])]),G(`div`,ot,[G(`label`,st,k(e.$t(`components.notification_interface.data`)),1),(O(!0),V(j,null,T(q(g),(t,r)=>(O(),V(`div`,{key:r,class:`flex gap-2 items-center`},[K(n,{modelValue:t.key,"onUpdate:modelValue":e=>t.key=e,placeholder:e.$t(`components.notification_interface.data_key`),class:`flex-1 min-w-0`},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`]),K(n,{modelValue:t.value,"onUpdate:modelValue":e=>t.value=e,placeholder:e.$t(`components.notification_interface.data_value`),class:`flex-1 min-w-0`},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`]),K(c,{text:``,rounded:``,severity:`danger`,class:`cui-icon-md shrink-0`,onClick:e=>oe(r)},{icon:W(()=>[K(s,{width:`100%`,height:`100%`})]),_:1},8,[`onClick`])]))),128)),K(c,{severity:`secondary`,outlined:``,fluid:``,class:`cui-button-medium`,label:e.$t(`components.notification_interface.add_data`),onClick:ae},{icon:W(()=>[K(l,{class:`w-4 h-4`})]),_:1},8,[`label`])])]),G(`div`,ct,[G(`h3`,lt,k(e.$t(`components.notification_interface.targets`)),1),q(b)?(O(),V(`div`,ut,[K(d,{class:`w-[24px] h-[24px] m-0`,"stroke-width":`5`})])):q(w).length?(O(),V(`div`,ft,[G(`span`,pt,k(e.$t(`components.notification_interface.targets_hint`)),1),K(f,{modelValue:q(x),"onUpdate:modelValue":t[8]||=e=>ce(x)?x.value=e:null,options:q(w),"option-label":`label`,"option-value":`id`,placeholder:e.$t(`components.notification_interface.all_devices`),display:`chip`,filter:``,class:`w-full`},null,8,[`modelValue`,`options`,`placeholder`])])):(O(),V(`div`,dt,k(e.$t(`components.notification_interface.no_devices`)),1))]),q(S)?.length?(O(),V(`div`,mt,[G(`h3`,ht,k(e.$t(`components.notification_interface.settings`)),1),K(ee,{"schema-form":{schema:q(S),config:{}},loading:q(C)},null,8,[`schema-form`,`loading`])])):F(``,!0),K(c,{fluid:``,class:`mt-8 cui-button-medium`,severity:`success`,loading:q(v),disabled:!q(p)||q(v),label:e.$t(`components.notification_interface.send_test`),onClick:A},null,8,[`loading`,`disabled`,`label`])])}}}),_t=.15,vt=.38,yt={class:`mb-4 rounded-xl overflow-hidden`},bt=[`src`],xt={class:`text-sm text-muted mb-4`},St={key:0,class:`ml-1`},Ct={class:`flex gap-2 mb-4`},wt={key:0,class:`flex flex-col gap-2`},Tt={class:`text-sm truncate flex-1 mr-3`},Et={class:`flex items-center gap-2 shrink-0`},Dt=M({__name:`PluginClipInterface`,props:{src:{},response:{},onTextSearch:{type:Function}},setup(e,{expose:t}){let n=e,a=ne(),o=H(``),s=H(!1),c=H([]);function l(e){return Math.max(0,Math.min(1,(e-_t)/(vt-_t)))}async function u(){let e=o.value.trim();if(!(!e||s.value)){s.value=!0;try{let{score:t}=await n.onTextSearch(e);c.value.unshift({query:e,rawScore:t,displayScore:l(t)}),o.value=``}catch(e){a.error(`CLIP text search failed:`,e)}finally{s.value=!1}}}return t({}),(t,n)=>{let a=r,l=i,d=Oe;return O(),V(`div`,null,[G(`div`,yt,[G(`img`,{src:e.src,alt:`CLIP test image`,class:`w-full object-contain`},null,8,bt)]),G(`div`,xt,[A(k(e.response.embeddings.length)+` embedding(s), `+k(e.response.embeddings[0]?.embedding?.length??0)+`-dim `,1),e.response.embeddingModel?(O(),V(`span`,St,`(`+k(e.response.embeddingModel)+`)`,1)):F(``,!0)]),G(`div`,Ct,[K(a,{modelValue:q(o),"onUpdate:modelValue":n[0]||=e=>ce(o)?o.value=e:null,class:`flex-1`,placeholder:t.$t(`components.clip_interface.enter_query`),onKeyup:U(u,[`enter`])},null,8,[`modelValue`,`placeholder`]),K(l,{class:`cui-button-medium`,label:t.$t(`components.clip_interface.search`),loading:q(s),onClick:u},null,8,[`label`,`loading`])]),q(c).length?(O(),V(`div`,wt,[(O(!0),V(j,null,T(q(c),(e,t)=>(O(),V(`div`,{key:t,class:`flex items-center justify-between p-3 rounded-lg content-background`},[G(`span`,Tt,k(e.query),1),G(`div`,Et,[G(`div`,{class:ae([`text-sm font-medium`,e.displayScore>=.5?`text-green-500`:e.displayScore>=.25?`text-yellow-500`:`text-red-400`])},k((e.displayScore*100).toFixed(0))+`% `,3),K(d,{value:e.displayScore>=.5?`Match`:e.displayScore>=.25?`Possible`:`No match`,severity:e.displayScore>=.5?`success`:e.displayScore>=.25?`warn`:`danger`,class:`text-xs`},null,8,[`value`,`severity`])])]))),128))])):F(``,!0)])}}}),Ot=M({__name:`PluginMotionInterface`,props:{response:{}},setup(e){let{response:t}=fe(e),n=se(`videoPlayerRef`);return E(()=>{if(n.value){let e=new Blob([t.value.videoData],{type:`video/mp4`});n.value.src=URL.createObjectURL(e),n.value.load()}}),(e,t)=>(O(),V(`div`,null,[G(`video`,{ref_key:`videoPlayerRef`,ref:n,controls:``,class:`w-full`},`Your browser does not support the video tag.`,512)]))}}),kt={class:`mb-5 h-min`},At=[`src`],jt=M({__name:`PluginObjectInterface`,props:{src:{},response:{}},setup(e){let{response:t,src:n}=fe(e),r=z(()=>t.value.detections);return(e,t)=>{let i=f;return O(),V(`div`,kt,[K(i,{detections:q(r)},null,8,[`detections`]),G(`img`,{src:q(n),alt:`Preview`,class:`w-full`},null,8,At)])}}}),Mt={key:0,class:`w-full`},Nt={class:`flex flex-col justify-center items-center mb-5`},Pt={for:`restoreInput`,class:`cursor-pointer text-center text-sm`},Ft=[`accept`],It={key:0,class:`text-red-500 text-sm`},Lt={key:1,class:`w-full flex flex-col items-center justify-center`},Rt={key:0,class:`relative mb-4`},zt=[`src`],Bt={key:1,class:`relative mb-4 w-full`},Vt={key:2,class:`relative mb-4 w-full`},Ht=[`src`,`type`],Ut={class:`flex items-center justify-center`},Wt={class:`mx-2`},Gt={class:`text-muted`},Kt={class:`flex items-center justify-center mt-2 text-xs text-muted`},qt={class:`mt-10`},Jt={class:`text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Yt={key:0,class:`flex items-center justify-center text-sm text-muted mt-5`},Xt=M({__name:`CuiDetectionInterface`,props:{type:{},pluginName:{}},emits:[`update:file`,`update:metadata`],setup(e,{emit:t}){let n={motionDetection:`drop_or_select_video_to_detect_motion`,audioDetection:`drop_or_select_audio_to_detect`,objectDetection:`drop_or_select_image_to_detect_objects`,faceDetection:`drop_or_select_image_to_detect_faces`,licensePlateDetection:`drop_or_select_image_to_detect_license_plates`,classifierDetection:`drop_or_select_image_to_classify`,clipDetection:`drop_or_select_image_for_semantic_search`},r=e,a=t,o=ne(),{t:s}=l(),u=ee(),d=p(),{type:f,pluginName:te}=fe(r),{plugin:m,isLoading:h}=c(te),g=se(`fileInputRef`),_=se(`videoPlayerRef`),v=se(`audioPlayerRef`),y=I([]),re=H(!1),b=H(!1),x=H(!1),S=H(!1),C=H(``),T=H(!1),E=H(),ie=H(!0),oe=I(),j=H(!1),M=z(()=>j.value||h.value||T.value),ce=z(()=>n[f.value]),P=z(()=>{switch(f.value){case`objectDetection`:case`faceDetection`:case`licensePlateDetection`:case`classifierDetection`:case`clipDetection`:return`image`;case`motionDetection`:return`video`;case`audioDetection`:return`audio`;default:return`image`}}),L=z(()=>{switch(P.value){case`image`:return he;case`video`:return ve;case`audio`:return pe;default:return[]}}),le=z(()=>{switch(P.value){case`image`:return ge;case`video`:return J;case`audio`:return _e;default:return 0}}),ue=z(()=>L.value.join(`,`));async function B(){if(m.value){j.value=!0;try{let e;switch(f.value){case`motionDetection`:e=await m.value.motionDetectionSettings?.();break;case`objectDetection`:e=await m.value.objectDetectionSettings?.();break;case`audioDetection`:e=await m.value.audioDetectionSettings?.();break;case`faceDetection`:e=await m.value.faceDetectionSettings?.();break;case`licensePlateDetection`:e=await m.value.licensePlateDetectionSettings?.();break;case`classifierDetection`:e=await m.value.classifierDetectionSettings?.();break;case`clipDetection`:e=await m.value.clipSettings?.();break}oe.value=e}catch(e){o.error(`Failed to load interface schema:`,e),oe.value=void 0}finally{j.value=!1}}}function de(e){let t=y.value.findIndex(t=>t.name===e);t>-1&&(y.value.splice(t,1),ye(),C.value=``,P.value===`video`&&_.value&&(_.value.src=``),E.value=void 0,a(`update:file`,null),a(`update:metadata`,null))}function U(e){if(re.value=!1,b.value=!1,S.value=!1,y.value=[],e.dataTransfer)if(e.dataTransfer.files.length>1)b.value=!0;else{let t=e.dataTransfer.files[0];(L.value.length===0||L.value.includes(t.type))&&t.size<=le.value?(y.value.push(t),w(()=>{be(t)})):t.size>le.value?S.value=!0:b.value=!0}}function me(e){b.value=!1,S.value=!1,y.value=[];let t=e.target;if(t&&t.files){if(t.files?.length>1)b.value=!0;else if(t.files.length===1){let e=t.files[0],n=L.value.length===0||L.value.includes(e.type);e.size<=le.value&&n?(y.value.push(e),w(()=>{be(e)})):e.size>le.value?S.value=!0:b.value=!0}}}function ye(){g.value&&(g.value.value=``)}function be(e){T.value=!0;let t=URL.createObjectURL(e);switch(P.value){case`image`:xe(e,t);break;case`video`:Y(e,t);break;case`audio`:Se(e,t);break}}function xe(e,t){let n=new Image;n.src=t,n.onload=()=>{C.value=n.src;let t={width:n.width,height:n.height};E.value=t,a(`update:metadata`,t),a(`update:file`,e),T.value=!1}}function Y(e,t){_.value&&(_.value.src=t,_.value.load(),_.value.onloadeddata=()=>{a(`update:file`,e),T.value=!1})}function Se(e,t){C.value=t;let n=new Audio;n.src=t,n.onloadedmetadata=()=>{let t={mimeType:e.type};E.value=t,a(`update:metadata`,t),a(`update:file`,e),T.value=!1}}function Ce(e){return e<1024?e+` bytes`:e<1048576?(e/1024).toFixed(1)+` KB`:(e/1048576).toFixed(1)+` MB`}function we(e,t){let n=0,r=0,i=0;for(let a=0;a<e.length;a++)n+=e[a]*t[a],r+=e[a]*e[a],i+=t[a]*t[a];return r&&i?n/(Math.sqrt(r)*Math.sqrt(i)):0}async function Te(e){if(!y.value.length){x.value=!0;return}if(!m.value){o.error(`Plugin not connected`);return}T.value=!0;try{let t=await y.value[0].arrayBuffer();if(f.value===`audioDetection`){let n=await m.value.testAudioDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No audio detection interface available`);return}if(n.detected&&n.detections?.length){let e=n.detections.map(e=>`${e.label} (${Math.round(e.confidence*100)}%)`).join(`, `),t=n.decibels==null?``:` | ${n.decibels.toFixed(1)} dBFS`;u.add({severity:`success`,detail:`${e}${t}`,life:3e3})}else u.add({severity:`info`,detail:s(`components.detection_interface.audio_not_detected`),life:3e3})}else if(f.value===`motionDetection`){let n=await m.value.testMotionDetection?.(new Uint8Array(t),e);if(!n){o.warn(`No motion detection interface available`);return}d.openComponentDialog(Ot,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{response:n}}})}else if(f.value===`faceDetection`){let n=await m.value.testFaceDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No face detection interface available`);return}d.openComponentDialog(jt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n}}})}else if(f.value===`licensePlateDetection`){let n=await m.value.testLicensePlateDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No license plate detection interface available`);return}d.openComponentDialog(jt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n}}})}else if(f.value===`classifierDetection`){let n=await m.value.testClassifierDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No classifier detection interface available`);return}d.openComponentDialog(jt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n}}})}else if(f.value===`clipDetection`){let n=await m.value.testClipEmbedding?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No CLIP detection interface available`);return}if(!n.embeddings?.length){u.add({severity:`info`,detail:s(`components.detection_interface.no_detections`),life:3e3});return}let r=n.embeddings[0].embedding;d.openComponentDialog(Dt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n,onTextSearch:async e=>{let t=await m.value.getTextEmbedding(e);return t?.embedding?.length?{score:we(r,t.embedding)}:{score:0}}}}})}else{let n=await m.value.testObjectDetection?.(new Uint8Array(t),E.value,e);if(!n){o.warn(`No object detection interface available`);return}d.openComponentDialog(jt,{data:{title:s(`components.dialog.title.result`),hideConfirmButton:!0,contentProps:{src:C,response:n}}})}}catch(e){u.add({severity:`error`,detail:e,life:3e3})}finally{T.value=!1}}return D(m,e=>{e&&B()},{immediate:!0}),D(y,e=>{e.length>0?(x.value=!1,ie.value=!1):(C.value=``,E.value=void 0,ie.value=!0)},{immediate:!0,deep:!0}),(e,t)=>{let n=X,r=i,a=Me;return O(),V(`div`,null,[G(`div`,{class:`file-upload-box`,onDrop:t[1]||=R(e=>U(e),[`prevent`]),onDragover:t[2]||=R(e=>re.value=!0,[`prevent`]),onDragenter:t[3]||=R(e=>re.value=!0,[`prevent`]),onDragleave:t[4]||=R(e=>re.value=!1,[`prevent`])},[q(y).length?(O(),V(`div`,Lt,[q(P)===`image`?(O(),V(`div`,Rt,[G(`img`,{src:q(C),alt:`Preview`,class:`w-full`},null,8,zt)])):q(P)===`video`?(O(),V(`div`,Bt,[G(`video`,{ref_key:`videoPlayerRef`,ref:_,controls:``,class:`w-full`},`Your browser does not support the video tag.`,512)])):q(P)===`audio`?(O(),V(`div`,Vt,[G(`audio`,{ref_key:`audioPlayerRef`,ref:v,controls:``,class:`w-full`},[G(`source`,{src:q(C),type:q(y)[0].type},null,8,Ht),t[5]||=A(` Your browser does not support the audio element. `,-1)],512)])):F(``,!0),G(`div`,Ut,[K(r,{text:``,rounded:``,severity:`danger`,class:`cui-icon-md shrink-0`,onClick:t[0]||=R(e=>de(q(y)[0].name),[`stop`])},{icon:W(()=>[K(n,{width:`100%`,height:`100%`})]),_:1}),G(`b`,Wt,k(q(y)[0].name),1),G(`span`,Gt,`(`+k(Ce(q(y)[0].size))+`)`,1)])])):(O(),V(`div`,Mt,[G(`div`,Nt,[G(`label`,Pt,k(e.$t(`components.detection_interface.${q(ce)}`)),1),G(`input`,{id:`restoreInput`,ref_key:`fileInputRef`,ref:g,type:`file`,class:`hidden`,accept:q(ue),onChange:me},null,40,Ft),q(b)?(O(),V(`p`,It,k(e.$t(`components.detection_interface.only_one_${q(P)}_allowed`)),1)):F(``,!0),q(x)?(O(),V(`p`,{key:1,class:ae([`text-red-500 text-sm`,{"mt-2":q(b)}])},k(e.$t(`components.detection_interface.${q(P)}_required`)),3)):F(``,!0),q(S)?(O(),V(`p`,{key:2,class:ae([`text-red-500 text-sm`,{"mt-2":q(b)||q(x)}])},k(e.$t(`components.detection_interface.file_size_error`)),3)):F(``,!0)])]))],32),G(`div`,Kt,[G(`span`,null,`(`+k(q(le)/1024/1024)+`MB, `+k(q(L).join(`, `))+`)`,1)]),G(`div`,qt,[G(`h3`,Jt,k(e.$t(`components.detection_interface.interface_config`)),1),q(oe)?.length?(O(),N(a,{key:1,"schema-form":{schema:q(oe),config:{}},loading:q(M),"save-button-label":e.$t(`components.detection_interface.detect`),"disable-button":q(ie),"show-button":``,onOnFormSubmit:Te},null,8,[`schema-form`,`loading`,`save-button-label`,`disable-button`])):(O(),V(`div`,Yt,k(e.$t(`components.detection_interface.no_interface_config`)),1))])])}}}),Zt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Qt(e,t){return O(),V(`svg`,Zt,[...t[0]||=[G(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M2 10v3m4-7v11m4-14v18m4-13v7m4-10v13m4-8v3`},null,-1)]])}var $t=B({name:`lucide-audio-lines`,render:Qt}),en={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tn(e,t){return O(),V(`svg`,en,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M2 7V4q0-.825.588-1.412T4 2h3v2H4v3zm5 15H4q-.825 0-1.412-.587T2 20v-3h2v3h3zm10 0v-2h3v-3h2v3q0 .825-.587 1.413T20 22zm3-15V4h-3V2h3q.825 0 1.413.588T22 4v3zm-7.913 1.913Q11.5 8.325 11.5 7.5t.588-1.412T13.5 5.5t1.413.588T15.5 7.5t-.587 1.413T13.5 9.5t-1.412-.587M12.8 18h-4l1-5.1l-1.8.7V17H6v-4.7l3.95-1.7q.875-.375 1.288-.487T12 10q.525 0 .975.275T13.7 11l1 1.6q.65 1.05 1.763 1.725T19 15v2q-1.65 0-3.088-.687T13.5 14.5z`},null,-1)]])}var nn=B({name:`material-symbols-detection-and-zone`,render:tn}),rn={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function an(e,t){return O(),V(`svg`,rn,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M8.113 13.888Q7.75 13.525 7.75 13t.363-.888T9 11.75t.888.363t.362.887t-.363.888T9 14.25t-.888-.363m6 0q-.362-.362-.362-.887t.363-.888t.887-.362t.888.363t.362.887t-.363.888t-.887.362t-.888-.363M12 20q3.35 0 5.675-2.325T20 12q0-.6-.075-1.162T19.65 9.75q-.525.125-1.05.188T17.5 10q-2.275 0-4.3-.975T9.75 6.3q-.8 1.95-2.287 3.388T4 11.85V12q0 3.35 2.325 5.675T12 20m0 2q-2.075 0-3.9-.787t-3.175-2.138T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22`},null,-1)]])}var on=B({name:`material-symbols-face`,render:an}),sn={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function cn(e,t){return O(),V(`svg`,sn,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M8 17q-.425 0-.712-.288T7 16t.288-.712T8 15h5q-.35-.425-.562-.925T12.1 13H10q-.425 0-.712-.288T9 12t.288-.712T10 11h2.1q.125-.575.338-1.075T13 9H4q-.425 0-.712-.288T3 8t.288-.712T4 7h13q2.075 0 3.538 1.463T22 12t-1.463 3.538T17 17zm9-2q1.25 0 2.125-.875T20 12t-.875-2.125T17 9t-2.125.875T14 12t.875 2.125T17 15M3 13q-.425 0-.712-.288T2 12t.288-.712T3 11h4q.425 0 .713.288T8 12t-.288.713T7 13zm1 4q-.425 0-.712-.288T3 16t.288-.712T4 15h1q.425 0 .713.288T6 16t-.288.713T5 17z`},null,-1)]])}var ln=B({name:`material-symbols-motion-blur-rounded`,render:cn}),un={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function dn(e,t){return O(),V(`svg`,un,[...t[0]||=[G(`g`,{fill:`none`,"fill-rule":`evenodd`},[G(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),G(`path`,{fill:`currentColor`,d:`M15.586 2.757a2 2 0 0 1 2.828 0l2.829 2.829a2 2 0 0 1 0 2.828l-2.829 2.829a2 2 0 0 1-2.828 0l-2.829-2.829a2 2 0 0 1 0-2.828zM9 3a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm12 12a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2zM9 13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2z`})],-1)]])}var fn=B({name:`mingcute-classify-2-fill`,render:dn}),pn={viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`};function mn(e,t){return O(),V(`svg`,pn,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M200 156c0 6.5-7.33 12-16 12s-16-5.5-16-12s7.33-12 16-12s16 5.5 16 12m32-100v144a16 16 0 0 1-16 16H40a16 16 0 0 1-16-16V56a16 16 0 0 1 16-16h176a16 16 0 0 1 16 16m-88.63 116.88l-44-104a8 8 0 0 0-14.74 0l-44 104a8 8 0 0 0 14.74 6.24L66.84 152h50.32l11.47 27.12a8 8 0 0 0 14.74-6.24M216 124c0-15.44-14.36-28-32-28a34.86 34.86 0 0 0-20.78 6.68a8 8 0 0 0 9.56 12.83A18.84 18.84 0 0 1 184 112c8.56 0 15.8 5.36 16 11.76v8a35.24 35.24 0 0 0-16-3.76c-17.64 0-32 12.56-32 28s14.36 28 32 28a35.1 35.1 0 0 0 16.93-4.26A8 8 0 0 0 216 176ZM73.61 136h36.78L92 92.53Z`},null,-1)]])}var hn=B({name:`ph-text-aa-fill`,render:mn}),gn={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function _n(e,t){return O(),V(`svg`,gn,[...t[0]||=[G(`path`,{fill:`currentColor`,d:`M12.75 3a.75.75 0 0 0-1.5 0v2a.75.75 0 0 0 1.5 0z`},null,-1),G(`path`,{fill:`currentColor`,"fill-rule":`evenodd`,d:`M22.75 12.057c0 1.837 0 3.293-.153 4.432c-.158 1.172-.49 2.121-1.238 2.87c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153H9.944c-1.837 0-3.293 0-4.432-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433v-.926q.001-.575.008-1.096c.014-.975.05-1.81.145-2.523c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c.716-.096 1.558-.132 2.541-.145l.697-.005a1 1 0 0 1 1.001.999V5a2.25 2.25 0 0 0 4.5 0v-.75c0-.552.448-1 1-.998c1.29.006 2.359.033 3.239.151c1.172.158 2.121.49 2.87 1.238c.748.749 1.08 1.698 1.238 2.87c.153 1.14.153 2.595.153 4.433zM8 9.75a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5zm0 3.5a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z`,"clip-rule":`evenodd`},null,-1)]])}var vn=B({name:`solar-plate-bold`,render:_n}),yn={class:`font-semibold text-xl truncate`},bn={class:`lg:col-span-2 order-1 !h-[220px]`},xn={class:`flex w-full h-full items-center justify-center`},Sn={class:`lg:col-span-1 lg:row-span-3 order-2`},Cn={class:`lg:!hidden card-title`},wn={key:0,class:`w-full h-full flex items-center justify-center`},Tn={key:1},En={class:`hidden lg:block text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Dn={key:0,class:`flex items-center justify-center w-full h-full text-muted text-sm`},On=[`onClick`],kn={key:0,class:`w-full h-full`},An={key:0,class:`flex flex-col items-center justify-center w-full h-full text-muted text-sm gap-3 text-center`},jn={key:2,class:`flex items-center justify-center w-full h-full text-muted text-sm`},Mn={key:9,class:`w-full h-full`},Nn={key:0,class:`flex items-center justify-center w-full h-full text-muted text-sm`},Pn={key:1,class:`flex items-center justify-center gap-2 w-full h-full text-muted text-sm`},Fn={class:`lg:col-span-2 order-3`},In={class:`lg:!hidden card-title`},Ln={class:`hidden lg:block text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Rn={key:0,class:`flex w-full h-full items-center justify-center`},zn=[`innerHTML`],Bn={class:`lg:col-span-2 order-4`},Vn={class:`lg:!hidden card-title`},Hn={class:`hidden lg:block text-base font-semibold border-b-[1px] border-color mb-3 pb-3`},Un={key:0,class:`flex w-full h-full items-center justify-center`},Wn=[`innerHTML`],Gn=x(M({__name:`Plugin`,setup(r){let d=new S,f=new Ne,m=ne(),re=g(),x=xe(),w=ee(),E=p(),{lgBreakpoint:se}=_(),{t:A}=l(),M=H(x.params.scope),P=H(x.params.pluginname),I=z(()=>M.value?`${M.value}/${P.value}`:P.value),{contract:R,error:B}=c(I);f.toggleQueryActivator(`getPluginContractQuery`,!1);let{data:U,isBusy:fe}=f.getPluginQuery(I),{data:pe,isBusy:he}=f.getPluginReadmeQuery(I),{data:ge,isBusy:_e}=f.getPluginChangelogQuery(I),{data:ve}=f.getPluginContractQuery(I),J=s(I),Y=J.config,Oe=J.isLoading,{mutate:ke,isPending:Ae}=d.addCameraExtensionQuery(),{mutate:je,isPending:Ie}=d.removeCameraExtensionQuery(),X=H(`settings`),Z=H([]),Q=H([]),Ke=H(me.UNKNOWN),qe,Je=z(()=>!!R.value&&o(R.value,t.NVR)),$=z(()=>Ke.value===me.READY||Ke.value===me.STARTED),Ye=z(()=>$.value?Je.value||Y.value?.schema?.length?!0:Oe.value:!1),Xe=He(`commonmark`,{highlight(e,t){if(t&&Be.getLanguage(t))try{return`<pre><code class="hljs">`+Be.highlight(e,{language:t,ignoreIllegals:!0}).value+`</code></pre>`}catch{}return`<pre><code class="hljs">`+Xe.utils.escapeHtml(e)+`</code></pre>`}});Be.registerLanguage(`typescript`,Ve),Be.registerLanguage(`yaml`,ze),Be.registerLanguage(`json`,Le),Be.registerLanguage(`python`,Re);function Ze(e,t){return e.pluginInfo?.name===t}async function Qe(e){try{await J.setValue(e.key,void 0),w.add({severity:`success`,detail:A(`components.toast.config_updated`),life:3e3})}catch(e){w.add({severity:`error`,detail:e,life:3e3})}}async function $e(e){try{let t=await J.submitValue(e.key,e.payload);if(t?.toast){let e=y(t.toast.type);w.add({severity:e,detail:t.toast.message,life:3e3})}t?.schema?.length&&E.openComponentDialog(Pe,{data:{title:A(`components.dialog.title.config`),hideConfirmButton:!0,contentProps:{schemaConfig:{schema:t.schema,config:e.payload},pluginName:I.value,buttonKey:e.key}}})}catch(e){w.add({severity:`error`,detail:e,life:3e3})}}async function et(e){if(Y.value?.schema.length)try{let t=ye(Y.value.schema,e);await J.setConfig(t),w.add({severity:`success`,detail:A(`components.toast.config_updated`),life:3e3})}catch(e){w.add({severity:`error`,detail:e,life:3e3})}}async function tt(t){if(U.value&&U.value.contract){let n=e(U.value.contract)?[`hub`]:U.value.contract.provides;if(Q.value.includes(t.name))for(let e of n)je({cameraname:t.name,pluginname:U.value.pluginName,type:e},{onSuccess:()=>{Q.value=Q.value.filter(e=>e!==t.name)}});else for(let e of n)ke({cameraname:t.name,pluginname:U.value.pluginName,type:e},{onSuccess:()=>{Q.value=[...Q.value,t.name]}})}}return D(U,e=>{if(!e||e.disabled){let e=Z.value.some(e=>e.name===`settings`),t=Z.value.some(e=>e.name===`cameras`);e?X.value=`settings`:t&&(X.value=`cameras`)}},{deep:!0}),D(x,()=>{P.value=x.params.pluginname},{deep:!0,immediate:!0}),D([U,J.isConnected],async([e,t])=>{e&&!e.disabled&&t&&await J.getConfig()},{immediate:!0}),D(I,e=>{qe?.stop(),e&&(qe=le(),qe.run(()=>{let t=We(e);t.connect(),D(t.status,e=>Ke.value=e,{immediate:!0})}))},{immediate:!0}),D(Y,()=>{Y.value?f.toggleQueryActivator(`getPluginContractQuery`,!0):f.toggleQueryActivator(`getPluginContractQuery`,!1)},{deep:!0,immediate:!0}),D([ve,Y,R,Ye,$],()=>{let e=[],n=!1;Ye.value&&e.push({name:`settings`,icon:v,isInterface:!1,tooltip:A(`views.plugin.settings_tab_tooltip`)}),$.value&&R.value&&o(R.value,t.MotionDetection)&&(n=!0,e.push({name:`motion_detection`,icon:ln,isInterface:!0,tooltip:A(`views.plugin.motion_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.ObjectDetection)&&(n=!0,e.push({name:`object_detection`,icon:nn,isInterface:!0,tooltip:A(`views.plugin.object_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.AudioDetection)&&(n=!0,e.push({name:`audio_detection`,icon:$t,isInterface:!0,tooltip:A(`views.plugin.audio_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.FaceDetection)&&(n=!0,e.push({name:`face_detection`,icon:on,isInterface:!0,tooltip:A(`views.plugin.face_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.LicensePlateDetection)&&(n=!0,e.push({name:`license_plate_detection`,icon:vn,isInterface:!0,tooltip:A(`views.plugin.license_plate_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.ClassifierDetection)&&(n=!0,e.push({name:`classifier_detection`,icon:fn,isInterface:!0,tooltip:A(`views.plugin.classifier_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.ClipDetection)&&(n=!0,e.push({name:`clip_detection`,icon:hn,isInterface:!0,tooltip:A(`views.plugin.clip_detection_tab_tooltip`)})),$.value&&R.value&&o(R.value,t.Notifier)&&(n=!0,e.push({name:`notification`,icon:h,isInterface:!0,tooltip:A(`views.plugin.notification_tab_tooltip`)})),e.push({name:`cameras`,icon:b,isInterface:!1,tooltip:A(`views.plugin.cameras_tab_tooltip`)}),ve.value?.cameras.length&&(Q.value=ve.value.cameras.filter(e=>e.plugins?.some(e=>e.name===I.value)).map(e=>e.name)),Z.value=[...e],U.value?.disabled||(Ye.value?X.value=`settings`:n?X.value=Z.value.filter(e=>e.isInterface)[0].name:X.value=`cameras`)},{deep:!0,immediate:!0}),D(B,e=>{e&&U.value&&!U.value.disabled&&m.error(`Error connecting to plugin:`,e)}),ie(()=>qe?.stop()),(e,t)=>{let r=Ue,o=i,s=C,c=u,l=n,d=Ge,f=Se,p=Ee,ee=be,m=Me,h=Xt,g=gt,ne=Fe,_=Te,v=te,y=we,b=De,x=Ce,S=a;return O(),V(`div`,{key:q(I)},[K(s,{position:`left`},{default:W(()=>[K(o,{severity:`secondary`,text:``,class:`cui-button p-2 text-color non-draggable-region`,onClick:t[0]||=t=>e.$router.push(`/plugins`)},{icon:W(()=>[K(r,{class:`w-6 h-6`})]),_:1})]),_:1}),K(s,{position:`center`},{default:W(()=>[G(`span`,yn,k(e.$t(`views.plugin.title`)),1)]),_:1}),G(`div`,{class:ae([`grid grid-auto grid-cols-1 lg:grid-cols-3 gap-6 lg:h-full`,{"!gap-2":q(se)}])},[G(`div`,bn,[q(U)?(O(),N(d,{key:1,plugin:q(U),class:`h-[220px]`},null,8,[`plugin`])):(O(),N(l,{key:0,class:`cui-card items-center justify-center !h-[220px]`},{content:W(()=>[G(`div`,xn,[K(c,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])]),_:1}))]),G(`div`,Sn,[G(`span`,Cn,k(e.$t(`views.plugin.settings`)),1),K(l,{class:ae([`cui-card !h-auto lg:!h-full`,{"items-center justify-center":q(fe)||q(Oe)}])},{content:W(()=>[q(fe)||q(Oe)?(O(),V(`div`,wn,[K(c,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(O(),V(`div`,Tn,[G(`h3`,En,k(e.$t(`views.plugin.settings`)),1),q(U)?.disabled?(O(),V(`div`,Dn,[G(`span`,null,k(e.$t(`views.plugin.disabled_info`)),1)])):(O(),N(x,{key:1,value:q(X),"onUpdate:value":t[2]||=e=>ce(X)?X.value=e:null,scrollable:``},{default:W(()=>[K(p,{class:`justify-between`,pt:{activeBar:{class:`!w-auto`},content:{class:`border-[1px] border-color cui-rounded-corner overflow-hidden`}}},{default:W(()=>[(O(!0),V(j,null,T(q(Z),(e,t)=>(O(),N(f,{key:t,disabled:e.isInterface&&q(U)?.disabled,value:e.name,"as-child":``},{default:W(t=>[de((O(),V(`div`,ue({ref_for:!0},t.a11yAttrs,{class:[`flex flex-col items-center justify-center flex-1 content-background !py-3 h-[55px]`,[{"hover:!text-color active:!text-color focus:!text-color":!t.active},t.class]],onClick:t.onClick}),[(O(),N(oe(e.icon),{class:`w-5 h-5`}))],16,On)),[[S,{value:e.tooltip}]])]),_:2},1032,[`disabled`,`value`]))),128))]),_:1}),K(b,{class:`px-0 pb-0`},{default:W(()=>[(O(!0),V(j,null,T(q(Z),(n,r)=>(O(),N(y,{key:r,value:n.name,"as-child":``},{default:W(r=>[r.active?(O(),V(`div`,ue({key:0,class:r.class},{ref_for:!0},r.a11yAttrs),[n.name===`settings`?(O(),V(`div`,kn,[q(Je)?(O(),V(`div`,An,[G(`span`,null,k(e.$t(`views.plugin.nvr_settings_hint`)),1),K(o,{class:`cui-button-medium whitespace-nowrap`,label:e.$t(`views.plugin.nvr_settings_button`),onClick:t[1]||=t=>e.$router.push(`/settings/recordings`)},{icon:W(()=>[K(ee,{class:`w-4 h-4`})]),_:1},8,[`label`])])):q(Y)?.schema?.length?(O(),N(m,{key:1,"schema-form":{schema:q(Y).schema,config:q(Y).config},loading:q(J).isLoading.value,"save-button-color":`success`,onOnAction:Qe,onOnSubmit:$e,onOnFormSubmit:et},null,8,[`schema-form`,`loading`])):(O(),V(`div`,jn,[G(`span`,null,k(e.$t(`views.plugin.no_settings`)),1)]))])):n.name===`motion_detection`?(O(),N(h,{key:1,"plugin-name":q(I),type:`motionDetection`},null,8,[`plugin-name`])):n.name===`object_detection`?(O(),N(h,{key:2,"plugin-name":q(I),type:`objectDetection`},null,8,[`plugin-name`])):n.name===`audio_detection`?(O(),N(h,{key:3,"plugin-name":q(I),type:`audioDetection`},null,8,[`plugin-name`])):n.name===`face_detection`?(O(),N(h,{key:4,"plugin-name":q(I),type:`faceDetection`},null,8,[`plugin-name`])):n.name===`license_plate_detection`?(O(),N(h,{key:5,"plugin-name":q(I),type:`licensePlateDetection`},null,8,[`plugin-name`])):n.name===`classifier_detection`?(O(),N(h,{key:6,"plugin-name":q(I),type:`classifierDetection`},null,8,[`plugin-name`])):n.name===`clip_detection`?(O(),N(h,{key:7,"plugin-name":q(I),type:`clipDetection`},null,8,[`plugin-name`])):n.name===`notification`?(O(),N(g,{key:8,"plugin-name":q(I)},null,8,[`plugin-name`])):n.name===`cameras`?(O(),V(`div`,Mn,[q(ve)?.cameras?.length?q($)?(O(!0),V(j,{key:2},T(q(ve).cameras,e=>(O(),V(`div`,{key:e.name,class:`cui-list-item`},[K(v,{disabled:q(Ae)||q(Ie)||q(J).isLoading.value,active:q(Q).includes(e.name),class:`h-14`,onClick:t=>q(re).open({cameraName:e.name})},L({default:W(()=>[G(`span`,null,k(e.name),1)]),_:2},[!q(U)||!Ze(e,q(U).pluginName)?{name:`append`,fn:W(()=>[K(_,{"model-value":q(Q).includes(e.name),disabled:q(Ae)||q(Ie)||q(J).isLoading.value||!q($),"onUpdate:modelValue":()=>tt(e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])]),key:`0`}:void 0]),1032,[`disabled`,`active`,`onClick`])]))),128)):(O(),V(`div`,Pn,[K(ne,{class:`w-4 h-4 flex-shrink-0`}),G(`span`,null,k(e.$t(`views.plugin.assignment_requires_running`)),1)])):(O(),V(`div`,Nn,[G(`span`,null,k(e.$t(`views.plugin.no_cameras`)),1)]))])):F(``,!0)],16)):F(``,!0)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`value`]))]))]),_:1},8,[`class`])]),G(`div`,Fn,[G(`span`,In,k(e.$t(`views.plugin.readme`)),1),K(l,{class:`cui-card !h-auto lg:!h-full`},{content:W(()=>[G(`h3`,Ln,k(e.$t(`views.plugin.readme`)),1),q(he)?(O(),V(`div`,Rn,[K(c,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(O(),V(`div`,{key:1,class:`markdown-body`,innerHTML:q(Xe).render(q(pe)||e.$t(`views.plugin.no_readme`))},null,8,zn))]),_:1})]),G(`div`,Bn,[G(`span`,Vn,k(e.$t(`views.plugin.changelog`)),1),K(l,{class:`cui-card !h-auto lg:!h-full`},{content:W(()=>[G(`h3`,Hn,k(e.$t(`views.plugin.changelog`)),1),q(_e)?(O(),V(`div`,Un,[K(c,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(O(),V(`div`,{key:1,class:`markdown-body`,innerHTML:q(Xe).render(q(ge)||e.$t(`views.plugin.no_changelog`))},null,8,Wn))]),_:1})])],2)])}}}),[[`__scopeId`,`data-v-3596b20b`]]);export{Gn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{an as e,en as t}from"./api-
|
|
1
|
+
import{an as e,en as t}from"./api-BwUGcpse.js";import{In as n,Ln as r,Rn as i,Tn as a,Xn as o,bn as s,ln as c,pn as l,vn as u,xr as d,yr as f}from"./vendor-CdGy-Xet.js";import{t as p}from"./plugins-Ct1tFRqH.js";import{n as m,t as h}from"./useLogsSocket-B_EbSIOU.js";var g=s({__name:`PluginConsole`,props:{plugin:{},isInstalling:{type:Boolean}},setup(s,{expose:g}){let _=new p,v=s,{mdBreakpoint:y}=e(),b=a(`dialogRefProps`),{plugin:x,isInstalling:S}=f(v),C=h({target:x.value.pluginName,onStdout:e=>D.value?.writeTerminal(e),onDisconnect:()=>D.value?.writeTerminal(`\r
|
|
2
2
|
Websocket failed to connect! Is the server running?\r
|
|
3
3
|
\r
|
|
4
4
|
`),onClearLog:()=>D.value?.clearTerminal(),onReconnected:()=>{S.value||(D.value?.clearTerminal(),D.value?.writeTerminal(`\r
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./VersionsHandler-
|
|
2
|
-
import{Ot as e,Pt as t,kr as n,wt as ee}from"./vendor-cameraui-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./VersionsHandler-J51M6nHE.js","./vendor-cameraui-CywDBRLD.js","./rolldown-runtime-DAXXjFlN.js","./vendor-CdGy-Xet.js","./api-BwUGcpse.js","./vendor-zod-BaT-dXMv.js","./types-Du61QgCF.js","./lightbulb-outline-BGFG7wv-.js","./vendor-core-0Lu3l40a.js","./vendor-primevue-Cm1rEh62.js","./vendor-dnd-BN6m9rq8.js","./close-BCRtoBTk.js","./vendor-draggabilly-BLoTmI_a.js","./api-Ct6LuJao.css","./server-CmHQA2OF.js","./useServerRestart-CZj3Y0Gh.js","./plugins-Ct1tFRqH.js","./useLogsSocket-B_EbSIOU.js","./vendor-xterm-IIYDrBG1.js","./vendor-xterm-BrP-ENHg.css","./useLogsSocket-CoA-Nq-_.css","./vendor-markdown-D_3Of-Gz.js","./vendor-markdown-DtOhvyRx.css","./alert-circle-CqEfEWD8.js","./platformLabels-D-cF6OTP.js","./config-BYU9LRQr.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Ot as e,Pt as t,kr as n,wt as ee}from"./vendor-cameraui-CywDBRLD.js";import{G as r,c as i,l as a,nn as o,q as s,tn as c,xn as te}from"./api-BwUGcpse.js";import{Bn as l,Rn as u,Tr as d,Ut as f,_n as p,an as m,bn as h,dn as g,fn as _,ln as v,lr as y,nr as b,pn as x,tr as S,un as C,vn as w,xr as T,yr as E}from"./vendor-CdGy-Xet.js";import{U as ne,a as re,q as ie}from"./vendor-primevue-Cm1rEh62.js";import{t as D}from"./plugins-Ct1tFRqH.js";import{t as ae}from"./home-C5hRJg9h.js";import{t as oe}from"./clock-outline-dv-kmi60.js";import{t as se}from"./source-branch-DejOTyZv.js";import{t as O}from"./CuiPluginTrustBadge-tIqjoCDz.js";import{t as ce}from"./account-jONrhXkE.js";import{t as le}from"./check-circle-CVNa_reg.js";import{t as ue}from"./CuiMarkdownContent-BwMdbyad.js";import{t as de}from"./alert-circle-CqEfEWD8.js";import{i as fe,t as pe}from"./CuiPluginCategoryChip-AsMNaK01.js";import{t as me}from"./download-Dq82fWLS.js";import{n as k,r as A}from"./platformLabels-D-cF6OTP.js";var j={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function M(e,t){return u(),x(`svg`,j,[...t[0]||=[C(`path`,{fill:`currentColor`,d:`M12 3c-1.27 0-2.4.8-2.82 2H3v2h1.95L2 14c-.47 2 1 3 3.5 3s4.06-1 3.5-3L6.05 7h3.12c.33.85.98 1.5 1.83 1.83V20H2v2h20v-2h-9V8.82c.85-.32 1.5-.97 1.82-1.82h3.13L15 14c-.47 2 1 3 3.5 3s4.06-1 3.5-3l-2.95-7H21V5h-6.17C14.4 3.8 13.27 3 12 3m0 2a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1m-6.5 5.25L7 14H4zm13 0L20 14h-3z`},null,-1)]])}var N=y({name:`mdi-scale-balance`,render:M}),P={class:`plugin-detail`},F={class:`flex items-start gap-4`},I={class:`w-16 h-16 relative rounded-2xl flex-shrink-0 border-2 border-color overflow-hidden`},L={class:`flex flex-col min-w-0 flex-1`},R={class:`flex items-center gap-2 flex-wrap`},z={class:`text-xl font-semibold truncate`},he={class:`text-sm text-muted truncate`},ge={key:0,class:`text-sm mt-1`},_e={class:`flex flex-wrap items-center gap-2 mt-4`},ve={key:0,class:`detail-meta`},ye={key:1,class:`detail-meta`},be={key:2,class:`detail-meta`},xe={key:3,class:`detail-meta`},Se={key:0,class:`flex flex-wrap items-center gap-1 mt-4`},Ce={key:1,class:`mt-4 flex flex-col gap-3`},we={class:`flex items-center gap-1`},Te={key:0,class:`flex flex-wrap items-center gap-1`},Ee={key:1,class:`flex items-start gap-3 px-4 py-3 rounded-xl bg-orange-500/10 border border-orange-500/30`},De={class:`flex flex-col gap-1 min-w-0`},B={class:`text-sm font-semibold text-orange-400`},Oe={key:0},ke={class:`text-xs text-orange-600 dark:text-orange-300`},Ae={class:`text-sm text-orange-400`},je={key:2,class:`mt-5`},Me={class:`text-base font-semibold mb-2`},Ne={class:`screenshots-row custom-scrollbar`},Pe={class:`readme-section`},Fe={key:0,class:`flex w-full items-center justify-center py-10`},V=o(h({__name:`PluginDetail`,props:{plugin:{}},setup(o,{expose:h}){let y=s(()=>f(()=>import(`./VersionsHandler-J51M6nHE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]),import.meta.url)),j=new D,M=o,V=r(),{t:H}=n(),{plugin:U}=E(M),{data:W}=j.getPluginLogoQuery(U.value.pluginName),{data:Ie,isBusy:Le}=j.getPluginReadmeQuery(U.value.pluginName),{data:G}=j.getPluginCompatQuery(U.value.pluginName),Re=v(()=>U.value.logo||W.value),K=v(()=>{let e=U.value.downloads?.weekly;return typeof e==`number`?H(`components.plugin_search.downloads_per_week`,{count:i(e)}):void 0}),q=v(()=>U.value.lastUpdated?a(U.value.lastUpdated):void 0),ze=v(()=>!!(U.value.links?.npm||U.value.links?.repository||U.value.links?.homepage||U.value.links?.bugs)),J=v(()=>(G.value?.os??[]).map(A)),Y=v(()=>(G.value?.cpu??[]).map(k)),X=v(()=>[...J.value,...Y.value].join(` · `)),Z=v(()=>G.value?.platformCompatible??!0),Be=v(()=>!!G.value&&(J.value.length>0||Y.value.length>0||!Z.value||(G.value?.issues?.length??0)>0));function Q(){V.openComponentDialog(y,{data:{title:H(`components.dialog.title.install`),confirmText:H(`components.form.button.install`),contentProps:{target:T(U),installVersion:`latest`}}})}return h({onConfirm:Q}),(n,r)=>{let i=c,a=O,o=pe,s=me,f=oe,h=N,v=ce,y=fe,E=e,D=se,k=ae,A=te,j=le,M=re,V=de,H=ie,W=ne,Q=ee,Ve=ue,$=t;return u(),x(`div`,P,[C(`div`,F,[C(`div`,I,[w(i,{src:T(Re),alt:`Plugin icon`,class:`block w-full h-full`,"image-container-class":`w-full h-full`,"image-class":`object-contain`},null,8,[`src`])]),C(`div`,L,[C(`div`,R,[C(`h2`,z,d(T(U).displayName),1),w(a,{trust:T(U).trust,"show-label":!1},null,8,[`trust`])]),C(`div`,he,d(T(U).pluginName),1),T(U).tagline||T(U).description?(u(),x(`p`,ge,d(T(U).tagline||T(U).description),1)):_(``,!0)])]),C(`div`,_e,[w(o,{category:T(U).category},null,8,[`category`]),T(K)?(u(),x(`span`,ve,[w(s,{class:`detail-meta-icon`}),p(` `+d(T(K)),1)])):_(``,!0),T(q)?(u(),x(`span`,ye,[w(f,{class:`detail-meta-icon`}),p(` `+d(n.$t(`components.plugin_search.updated_ago`,{time:T(q)})),1)])):_(``,!0),T(U).license?(u(),x(`span`,be,[w(h,{class:`detail-meta-icon`}),p(` `+d(T(U).license),1)])):_(``,!0),T(U).author?(u(),x(`span`,xe,[w(v,{class:`detail-meta-icon`}),p(` `+d(T(U).author),1)])):_(``,!0)]),T(ze)?(u(),x(`div`,Se,[T(U).links?.npm?b((u(),g(E,{key:0,text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:r[0]||=e=>n.$router.absUrl(T(U).links.npm,!0)},{icon:S(()=>[w(y,{width:`100%`,height:`100%`})]),_:1})),[[$,{value:`NPM`},void 0,{top:!0}]]):_(``,!0),T(U).links?.repository?b((u(),g(E,{key:1,text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:r[1]||=e=>n.$router.absUrl(T(U).links.repository,!0)},{icon:S(()=>[w(D,{width:`100%`,height:`100%`})]),_:1})),[[$,{value:n.$t(`components.plugin_search.repository`)},void 0,{top:!0}]]):_(``,!0),T(U).links?.homepage?b((u(),g(E,{key:2,text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:r[2]||=e=>n.$router.absUrl(T(U).links.homepage,!0)},{icon:S(()=>[w(k,{width:`100%`,height:`100%`})]),_:1})),[[$,{value:n.$t(`components.plugin_search.homepage`)},void 0,{top:!0}]]):_(``,!0),T(U).links?.bugs?b((u(),g(E,{key:3,text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:r[3]||=e=>n.$router.absUrl(T(U).links.bugs,!0)},{icon:S(()=>[w(A,{width:`100%`,height:`100%`})]),_:1})),[[$,{value:n.$t(`components.plugin_search.bugs`)},void 0,{top:!0}]]):_(``,!0)])):_(``,!0),T(Be)?(u(),x(`div`,Ce,[T(Z)?(u(),x(m,{key:0},[w(M,{severity:`success`,class:`self-start`},{default:S(()=>[C(`span`,we,[w(j),p(` `+d(n.$t(`components.plugin_search.compatible_system`)),1)])]),_:1}),T(J).length||T(Y).length?(u(),x(`div`,Te,[(u(!0),x(m,null,l(T(J),e=>(u(),g(M,{key:`os-${e}`,severity:`secondary`,value:e},null,8,[`value`]))),128)),(u(!0),x(m,null,l(T(Y),e=>(u(),g(M,{key:`cpu-${e}`,severity:`secondary`,value:e},null,8,[`value`]))),128))])):_(``,!0)],64)):(u(),x(`div`,Ee,[w(V,{class:`w-5 h-5 shrink-0 text-orange-400 mt-0.5`}),C(`div`,De,[C(`span`,B,[p(d(n.$t(`components.plugin_search.incompatible_system`)),1),T(X)?(u(),x(`span`,Oe,` — `+d(T(X)),1)):_(``,!0)]),C(`span`,ke,d(n.$t(`components.plugin_search.incompatible_worker_hint`)),1)])])),(u(!0),x(m,null,l(T(G)?.issues??[],e=>(u(),x(`div`,{key:e.engine,class:`flex items-start gap-3 px-4 py-3 rounded-xl bg-orange-500/10 border border-orange-500/30`},[w(V,{class:`w-5 h-5 shrink-0 text-orange-400 mt-0.5`}),C(`span`,Ae,d(n.$t(`components.dialog.message.compatibility_engine`,{engine:e.engine,required:e.required,current:e.current})),1)]))),128))])):_(``,!0),T(U).screenshots?.length?(u(),x(`div`,je,[C(`h3`,Me,d(n.$t(`components.plugin_search.screenshots`)),1),C(`div`,Ne,[(u(!0),x(m,null,l(T(U).screenshots,(e,t)=>(u(),g(H,{key:t,src:e,alt:`Screenshot`,preview:``,class:`screenshot-thumb`},null,8,[`src`]))),128))])])):_(``,!0),w(W),C(`div`,Pe,[T(Le)?(u(),x(`div`,Fe,[w(Q,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(u(),g(Ve,{key:1,content:T(Ie)||n.$t(`views.plugin.no_readme`)},null,8,[`content`]))])])}}}),[[`__scopeId`,`data-v-332ce412`]]);export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_t as e,at as t,vt as n}from"./vendor-cameraui-
|
|
1
|
+
import{_t as e,at as t,vt as n}from"./vendor-cameraui-CywDBRLD.js";import{Gn as r,f as i}from"./api-BwUGcpse.js";import{Qn as a,Rn as o,Tn as s,bn as c,dn as l,ln as u,pr as d,xr as f,yr as p}from"./vendor-CdGy-Xet.js";import{t as m}from"./CuiSchema-TojDO40O.js";var h=c({__name:`PluginSchema`,props:{schemaConfig:{},pluginName:{},cameraName:{},buttonKey:{},sensorId:{},pluginId:{}},setup(c,{expose:h}){let g=c,_=r(),v=s(`dialogRef`),y=s(`dialogRefProps`),{schemaConfig:b,pluginName:x,cameraName:S,buttonKey:C,sensorId:w,pluginId:T}=p(g),E=e(x),D=t(S,x),O=n(S,w,T),k=d({schema:[],config:{}}),A=u(()=>S.value&&w.value?`sensor`:S.value?`camera`:`plugin`),j=u(()=>{switch(A.value){case`sensor`:return O;case`camera`:return D;default:return E}}),M=u(()=>!!(y.loading?.value||j.value.isLoading.value));async function N(e){await j.value.setValue(e.key,void 0)}async function P(e){let t={...b.value.config,...e},n=await j.value.submitValue(C.value,t);if(n?.toast){let e=i(n.toast.type);_.add({severity:e,detail:n.toast.message,life:3e3})}n?.schema&&Object.keys(n.schema).length&&k.value?k.value.schema=n.schema:v.value.close()}return a(b,e=>{k.value=e},{deep:!0,immediate:!0}),h({isLoading:M}),(e,t)=>{let n=m;return o(),l(n,{"schema-form":f(k),loading:f(M),"show-button":``,onOnAction:N,onOnFormSubmit:P},null,8,[`schema-form`,`loading`])}}});export{h as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./VersionsHandler-
|
|
2
|
-
import{At as e,I as t,O as n,Ot as r,Pt as i,kr as a}from"./vendor-cameraui-Bq-hQsT7.js";import{G as o,M as s,Qt as c,c as l,l as u,nn as d,q as f,tn as p}from"./api-CdJDEL3z.js";import{Bn as m,Qn as h,Rn as g,Sr as _,Tn as v,Tr as y,Ut as b,_n as x,an as S,bn as C,cr as w,dn as T,fn as E,in as D,ln as O,lr as k,nr as A,pn as j,pr as M,rn as N,tr as P,un as F,vn as I,xr as L}from"./vendor-CdGy-Xet.js";import{L as ee,R as te,U as ne,a as R,d as re,j as ie}from"./vendor-primevue-B3sIO6X2.js";import{t as ae}from"./close-BCRtoBTk.js";import{t as oe}from"./plugins-BcJnIPJC.js";import{t as z}from"./clock-outline-dv-kmi60.js";import{t as B}from"./CuiPluginTrustBadge-rZePqROi.js";import{i as V,n as se,r as ce,t as H}from"./CuiPluginCategoryChip-BX0xg3py.js";import{t as U}from"./download-Dq82fWLS.js";var W={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function G(e,t){return g(),j(`svg`,W,[...t[0]||=[F(`path`,{fill:`currentColor`,d:`M13 15.6c.3.2.7.2 1 0l5-2.9v.3c.7 0 1.4.1 2 .4v-1.8l1-.6c.5-.3.6-.9.4-1.4l-1.5-2.5c-.1-.2-.2-.4-.4-.5l-7.9-4.4c-.2-.1-.4-.2-.6-.2s-.4.1-.6.2L3.6 6.6c-.2.1-.4.2-.5.4L1.6 9.6c-.3.5-.1 1.1.4 1.4c.3.2.7.2 1 0v5.5c0 .4.2.7.5.9l7.9 4.4c.2.1.4.2.6.2s.4-.1.6-.2l.9-.5c-.3-.6-.4-1.3-.5-2m-2 0l-6-3.4V9.2l6 3.4zm9.1-9.6l-6.3 3.6l-.6-1l6.3-3.6zM12 10.8V4.2l6 3.3zm8 4.2v3h3v2h-3v3h-2v-3h-3v-2h3v-3z`},null,-1)]])}var le=k({name:`mdi-package-variant-plus`,render:G}),K={class:`plugin-store-card-body`},ue={class:`flex items-start gap-3 min-w-0`},de={class:`plugin-store-icon flex-shrink-0`},q={class:`min-w-0 flex-1`},J={class:`flex items-center gap-2 min-w-0`},fe={class:`font-medium text-base truncate`},pe={class:`text-sm text-muted truncate`},me={class:`plugin-store-card-description`},Y={class:`flex flex-wrap items-center gap-x-3 gap-y-1 mt-auto pt-2`},X={key:1,class:`plugin-store-meta`},Z={key:2,class:`plugin-store-meta`},Q={class:`flex gap-1`},he=d(C({__name:`CuiPluginStoreCard`,props:{plugin:{},inProgress:{type:Boolean}},emits:[`open`,`install`],setup(e,{emit:t}){let n=e,o=t,{t:c}=a(),d=O(()=>n.plugin),f=O(()=>{let e=d.value.downloads?.weekly;return typeof e==`number`?c(`components.plugin_search.downloads_per_week`,{count:l(e)}):void 0}),m=O(()=>d.value.lastUpdated?u(d.value.lastUpdated):void 0);return(t,n)=>{let a=p,c=B,l=R,u=H,h=U,v=z,b=s,S=r,C=V,w=i;return g(),j(`div`,{class:_([`plugin-store-card shadow-sm transition-default card-background custom-scrollbar`,{"opacity-50 in-progress":e.inProgress}]),role:`button`,tabindex:`0`,onClick:n[4]||=e=>o(`open`,L(d)),onKeydown:n[5]||=N(e=>o(`open`,L(d)),[`enter`])},[F(`div`,K,[F(`div`,ue,[F(`div`,de,[I(a,{src:L(d).logo,alt:`Plugin logo`,class:`block w-full h-full`,"image-container-class":`w-full h-full`,"image-class":`object-contain`},null,8,[`src`])]),F(`div`,q,[F(`div`,J,[F(`h4`,fe,y(L(d).displayName),1),I(c,{trust:L(d).trust,"show-label":!1,class:`flex-shrink-0`},null,8,[`trust`])]),F(`div`,pe,y(L(d).pluginName),1)])]),F(`p`,me,y(L(d).tagline||L(d).description),1),F(`div`,Y,[L(d).compatible===!1?A((g(),T(l,{key:0,severity:`warn`,value:t.$t(`components.plugin_search.incompatible`)},null,8,[`value`])),[[w,{value:t.$t(`components.plugin_search.incompatible_system`)},void 0,{top:!0}]]):E(``,!0),I(u,{category:L(d).category},null,8,[`category`]),L(f)?(g(),j(`span`,X,[I(h,{class:`plugin-store-meta-icon`}),x(` `+y(L(f)),1)])):E(``,!0),L(m)?(g(),j(`span`,Z,[I(v,{class:`plugin-store-meta-icon`}),x(` `+y(t.$t(`components.plugin_search.updated_ago`,{time:L(m)})),1)])):E(``,!0)])]),F(`div`,{class:`plugin-store-card-actions`,onClick:n[3]||=D(()=>{},[`stop`])},[F(`div`,Q,[L(d).links?.repository||L(d).links?.homepage?A((g(),T(S,{key:0,text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:n[0]||=e=>t.$router.absUrl(L(d).links?.repository||L(d).links?.homepage,!0)},{icon:P(()=>[I(b,{width:`100%`,height:`100%`})]),_:1})),[[w,{value:`Github`},void 0,{top:!0}]]):E(``,!0),L(d).links?.npm?A((g(),T(S,{key:1,text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:n[1]||=e=>t.$router.absUrl(L(d).links.npm,!0)},{icon:P(()=>[I(C,{width:`100%`,height:`100%`})]),_:1})),[[w,{value:`NPM`},void 0,{top:!0}]]):E(``,!0)]),I(S,{class:`cui-button-medium ml-auto`,label:t.$t(`components.form.button.install`),disabled:e.inProgress,onClick:n[2]||=e=>o(`install`,L(d))},null,8,[`label`,`disabled`])])],34)}}}),[[`__scopeId`,`data-v-501b0eb9`]]),ge={class:`cui-label`},_e={class:`flex flex-wrap gap-2 mt-4`},ve={key:0,class:`mt-6`},ye={class:`featured-row custom-scrollbar mt-3`},be={class:`flex flex-row items-center justify-center w-full mt-8`},xe={key:3,class:`text-center py-10`},Se={class:`text-muted mb-2`},Ce={class:`text-muted`},we={key:4,class:`w-full`},Te={key:5,class:`w-full plugin-list`},$=d(C({__name:`PluginSearch`,setup(s,{expose:l}){let u=f(()=>b(()=>import(`./VersionsHandler-DrVcvut6.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]),import.meta.url)),d=f(()=>b(()=>import(`./PluginDetail-9-jofn3X.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,12,13,16,27,28,29,30,31,32,33,34,21,22,23,35,36,37,38,39,24,40]),import.meta.url)),p=new oe,_=o(),{t:x}=a(),C=v(`dialogRefProps`),k=M(``),N=M({}),R=M([]),z=M(`all`),B=M(`all`),V=M(`name`),H=M(!1),{data:U,isBusy:W,refetch:G}=p.searchPluginsQuery(N,{page:1,pageSize:-1},H),{data:K,isBusy:ue,refetch:de}=p.getPluginsProgressQuery({page:1,pageSize:-1}),q=O(()=>W.value||ue.value),J=O(()=>!!(C.loading?.value||q.value)),fe=O(()=>[{label:x(`components.plugin_search.filter_all_categories`),value:`all`},...ce.map(e=>({label:x(se[e].labelKey),value:e}))]),pe=O(()=>[{label:x(`components.plugin_search.filter_all_trust`),value:`all`},{label:x(`components.plugin_search.trust_official`),value:`official`},{label:x(`components.plugin_search.trust_verified`),value:`verified`},{label:x(`components.plugin_search.trust_community`),value:`community`}]),me=O(()=>[{label:x(`components.plugin_search.sort_name`),value:`name`},{label:x(`components.plugin_search.sort_downloads`),value:`downloads`},{label:x(`components.plugin_search.sort_updated`),value:`updated`}]),Y=O(()=>{let e=R.value.slice();return z.value!==`all`&&(e=e.filter(e=>e.category===z.value)),B.value!==`all`&&(e=e.filter(e=>e.trust===B.value)),e.sort((e,t)=>{switch(V.value){case`downloads`:return(t.downloads?.weekly??0)-(e.downloads?.weekly??0);case`updated`:return new Date(t.lastUpdated??0).getTime()-new Date(e.lastUpdated??0).getTime();default:return(e.displayName||e.pluginName).localeCompare(t.displayName||t.pluginName)}}),e}),X=O(()=>Y.value.filter(e=>e.featured)),Z=O(()=>Y.value.filter(e=>!e.featured));function Q(e){return K.value?.result.some(t=>t.pluginName===e)}function $(e){e?.preventDefault(),N.value.pluginname=k.value??``}function Ee(){k.value=``,N.value={},z.value=`all`,B.value=`all`,V.value=`name`,$()}function De(){H.value=!0,Promise.all([G(),de()]).finally(()=>{H.value=!1})}function Oe(e){_.openComponentDialog(u,{data:{title:x(`components.dialog.title.install`),loading:J,contentProps:{target:L(e),installVersion:`latest`}}})}function ke(e){_.openComponentDialog(d,{data:{title:x(`components.dialog.title.details`),confirmText:x(`components.form.button.install`),contentProps:{plugin:L(e)}}})}return h(U,e=>{e?.result&&(R.value=e.result.filter(e=>!e.installPath))},{immediate:!0,deep:!0}),l({isLoading:J}),(a,o)=>{let s=n,l=ae,u=r,d=ee,f=te,p=ie,h=he,_=c,v=e,b=re,x=ne,C=le,O=t,M=i;return g(),j(`div`,null,[F(`form`,{onSubmit:D($,[`prevent`])},[F(`label`,ge,y(a.$t(`components.form.label.name`)),1),I(f,null,{default:P(()=>[I(s,{modelValue:L(k),"onUpdate:modelValue":o[0]||=e=>w(k)?k.value=e:null,modelModifiers:{trim:!0},loading:L(q),placeholder:`camera-ui-`,type:`text`},null,8,[`modelValue`,`loading`]),I(d,null,{default:P(()=>[I(u,{text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:Ee},{icon:P(()=>[I(l,{width:`100%`,height:`100%`})]),_:1})]),_:1})]),_:1})],32),F(`div`,_e,[I(p,{modelValue:L(z),"onUpdate:modelValue":o[1]||=e=>w(z)?z.value=e:null,options:L(fe),"option-label":`label`,"option-value":`value`,class:`flex-1 min-w-[140px]`,placeholder:a.$t(`components.plugin_search.filter_category`)},null,8,[`modelValue`,`options`,`placeholder`]),I(p,{modelValue:L(B),"onUpdate:modelValue":o[2]||=e=>w(B)?B.value=e:null,options:L(pe),"option-label":`label`,"option-value":`value`,class:`flex-1 min-w-[140px]`,placeholder:a.$t(`components.plugin_search.filter_trust`)},null,8,[`modelValue`,`options`,`placeholder`]),I(p,{modelValue:L(V),"onUpdate:modelValue":o[3]||=e=>w(V)?V.value=e:null,options:L(me),"option-label":`label`,"option-value":`value`,class:`flex-1 min-w-[140px]`,placeholder:a.$t(`components.plugin_search.sort_by`)},null,8,[`modelValue`,`options`,`placeholder`])]),!L(q)&&L(X).length?(g(),j(`div`,ve,[F(`h3`,null,y(a.$t(`components.plugin_search.featured`)),1),F(`div`,ye,[(g(!0),j(S,null,m(L(X),(e,t)=>(g(),j(`div`,{key:t,class:`featured-item`},[I(h,{plugin:e,"in-progress":Q(e.pluginName),onOpen:ke,onInstall:Oe},null,8,[`plugin`,`in-progress`])]))),128))])])):E(``,!0),F(`div`,be,[F(`h3`,null,y(a.$t(`components.plugin_search.plugins`)),1),A((g(),T(u,{text:``,rounded:``,severity:`secondary`,class:`cui-icon-md ml-auto`,onClick:De},{icon:P(()=>[I(_,{width:`100%`,height:`100%`})]),_:1})),[[M,{value:a.$t(`components.plugin_search.refresh`)},void 0,{left:!0}]]),I(v,{size:`small`,class:`ml-2 rounded-full`,value:String(L(Z).length)},null,8,[`value`])]),L(q)?(g(),T(b,{key:1,mode:`indeterminate`,class:`my-3 !h-[1px]`})):(g(),T(x,{key:2,class:`m-0 py-3`})),!L(q)&&!L(Z).length?(g(),j(`div`,xe,[F(`div`,Se,[I(C,{class:`w-12 h-12 mx-auto opacity-30`})]),F(`p`,Ce,y(a.$t(`views.plugins.no_plugins`)),1)])):L(q)?(g(),j(`div`,we,[(g(),j(S,null,m(6,e=>I(O,{key:e,class:`mb-2`,height:`132px`})),64))])):(g(),j(`div`,Te,[(g(!0),j(S,null,m(L(Z),(e,t)=>A((g(),T(h,{key:t,plugin:e,"in-progress":Q(e.pluginName),onOpen:ke,onInstall:Oe},null,8,[`plugin`,`in-progress`])),[[M,{value:Q(e.pluginName)?a.$t(`components.plugin_search.in_progress`):void 0}]])),128))]))])}}}),[[`__scopeId`,`data-v-5d16a648`]]);export{$ as t};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./VersionsHandler-J51M6nHE.js","./vendor-cameraui-CywDBRLD.js","./rolldown-runtime-DAXXjFlN.js","./vendor-CdGy-Xet.js","./api-BwUGcpse.js","./vendor-zod-BaT-dXMv.js","./types-Du61QgCF.js","./lightbulb-outline-BGFG7wv-.js","./vendor-core-0Lu3l40a.js","./vendor-primevue-Cm1rEh62.js","./vendor-dnd-BN6m9rq8.js","./close-BCRtoBTk.js","./vendor-draggabilly-BLoTmI_a.js","./api-Ct6LuJao.css","./server-CmHQA2OF.js","./useServerRestart-CZj3Y0Gh.js","./plugins-Ct1tFRqH.js","./useLogsSocket-B_EbSIOU.js","./vendor-xterm-IIYDrBG1.js","./vendor-xterm-BrP-ENHg.css","./useLogsSocket-CoA-Nq-_.css","./vendor-markdown-D_3Of-Gz.js","./vendor-markdown-DtOhvyRx.css","./alert-circle-CqEfEWD8.js","./platformLabels-D-cF6OTP.js","./config-BYU9LRQr.js","./PluginDetail-j7srfPSY.js","./home-C5hRJg9h.js","./clock-outline-dv-kmi60.js","./source-branch-DejOTyZv.js","./CuiPluginTrustBadge-tIqjoCDz.js","./CuiPluginTrustBadge-QHTLaN1n.css","./account-jONrhXkE.js","./check-circle-CVNa_reg.js","./CuiMarkdownContent-BwMdbyad.js","./CuiPluginCategoryChip-AsMNaK01.js","./cctv-CdDfBHME.js","./bell-ring-D0h1GDrU.js","./CuiPluginCategoryChip-CdGrTCxH.css","./download-Dq82fWLS.js","./PluginDetail-BYqji8yN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{At as e,I as t,O as n,Ot as r,Pt as i,kr as a}from"./vendor-cameraui-CywDBRLD.js";import{G as o,M as s,Qt as c,c as l,l as u,nn as d,q as f,tn as p}from"./api-BwUGcpse.js";import{Bn as m,Qn as h,Rn as g,Sr as _,Tn as v,Tr as y,Ut as b,_n as x,an as S,bn as C,cr as w,dn as T,fn as E,in as D,ln as O,lr as k,nr as A,pn as j,pr as M,rn as N,tr as P,un as F,vn as I,xr as L}from"./vendor-CdGy-Xet.js";import{L as ee,R as te,U as ne,a as R,d as re,j as ie}from"./vendor-primevue-Cm1rEh62.js";import{t as ae}from"./close-BCRtoBTk.js";import{t as oe}from"./plugins-Ct1tFRqH.js";import{t as z}from"./clock-outline-dv-kmi60.js";import{t as B}from"./CuiPluginTrustBadge-tIqjoCDz.js";import{i as V,n as se,r as ce,t as H}from"./CuiPluginCategoryChip-AsMNaK01.js";import{t as U}from"./download-Dq82fWLS.js";var W={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function G(e,t){return g(),j(`svg`,W,[...t[0]||=[F(`path`,{fill:`currentColor`,d:`M13 15.6c.3.2.7.2 1 0l5-2.9v.3c.7 0 1.4.1 2 .4v-1.8l1-.6c.5-.3.6-.9.4-1.4l-1.5-2.5c-.1-.2-.2-.4-.4-.5l-7.9-4.4c-.2-.1-.4-.2-.6-.2s-.4.1-.6.2L3.6 6.6c-.2.1-.4.2-.5.4L1.6 9.6c-.3.5-.1 1.1.4 1.4c.3.2.7.2 1 0v5.5c0 .4.2.7.5.9l7.9 4.4c.2.1.4.2.6.2s.4-.1.6-.2l.9-.5c-.3-.6-.4-1.3-.5-2m-2 0l-6-3.4V9.2l6 3.4zm9.1-9.6l-6.3 3.6l-.6-1l6.3-3.6zM12 10.8V4.2l6 3.3zm8 4.2v3h3v2h-3v3h-2v-3h-3v-2h3v-3z`},null,-1)]])}var le=k({name:`mdi-package-variant-plus`,render:G}),K={class:`plugin-store-card-body`},ue={class:`flex items-start gap-3 min-w-0`},de={class:`plugin-store-icon flex-shrink-0`},q={class:`min-w-0 flex-1`},J={class:`flex items-center gap-2 min-w-0`},fe={class:`font-medium text-base truncate`},pe={class:`text-sm text-muted truncate`},me={class:`plugin-store-card-description`},Y={class:`flex flex-wrap items-center gap-x-3 gap-y-1 mt-auto pt-2`},X={key:1,class:`plugin-store-meta`},Z={key:2,class:`plugin-store-meta`},Q={class:`flex gap-1`},he=d(C({__name:`CuiPluginStoreCard`,props:{plugin:{},inProgress:{type:Boolean}},emits:[`open`,`install`],setup(e,{emit:t}){let n=e,o=t,{t:c}=a(),d=O(()=>n.plugin),f=O(()=>{let e=d.value.downloads?.weekly;return typeof e==`number`?c(`components.plugin_search.downloads_per_week`,{count:l(e)}):void 0}),m=O(()=>d.value.lastUpdated?u(d.value.lastUpdated):void 0);return(t,n)=>{let a=p,c=B,l=R,u=H,h=U,v=z,b=s,S=r,C=V,w=i;return g(),j(`div`,{class:_([`plugin-store-card shadow-sm transition-default card-background custom-scrollbar`,{"opacity-50 in-progress":e.inProgress}]),role:`button`,tabindex:`0`,onClick:n[4]||=e=>o(`open`,L(d)),onKeydown:n[5]||=N(e=>o(`open`,L(d)),[`enter`])},[F(`div`,K,[F(`div`,ue,[F(`div`,de,[I(a,{src:L(d).logo,alt:`Plugin logo`,class:`block w-full h-full`,"image-container-class":`w-full h-full`,"image-class":`object-contain`},null,8,[`src`])]),F(`div`,q,[F(`div`,J,[F(`h4`,fe,y(L(d).displayName),1),I(c,{trust:L(d).trust,"show-label":!1,class:`flex-shrink-0`},null,8,[`trust`])]),F(`div`,pe,y(L(d).pluginName),1)])]),F(`p`,me,y(L(d).tagline||L(d).description),1),F(`div`,Y,[L(d).compatible===!1?A((g(),T(l,{key:0,severity:`warn`,value:t.$t(`components.plugin_search.incompatible`)},null,8,[`value`])),[[w,{value:t.$t(`components.plugin_search.incompatible_system`)},void 0,{top:!0}]]):E(``,!0),I(u,{category:L(d).category},null,8,[`category`]),L(f)?(g(),j(`span`,X,[I(h,{class:`plugin-store-meta-icon`}),x(` `+y(L(f)),1)])):E(``,!0),L(m)?(g(),j(`span`,Z,[I(v,{class:`plugin-store-meta-icon`}),x(` `+y(t.$t(`components.plugin_search.updated_ago`,{time:L(m)})),1)])):E(``,!0)])]),F(`div`,{class:`plugin-store-card-actions`,onClick:n[3]||=D(()=>{},[`stop`])},[F(`div`,Q,[L(d).links?.repository||L(d).links?.homepage?A((g(),T(S,{key:0,text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:n[0]||=e=>t.$router.absUrl(L(d).links?.repository||L(d).links?.homepage,!0)},{icon:P(()=>[I(b,{width:`100%`,height:`100%`})]),_:1})),[[w,{value:`Github`},void 0,{top:!0}]]):E(``,!0),L(d).links?.npm?A((g(),T(S,{key:1,text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:n[1]||=e=>t.$router.absUrl(L(d).links.npm,!0)},{icon:P(()=>[I(C,{width:`100%`,height:`100%`})]),_:1})),[[w,{value:`NPM`},void 0,{top:!0}]]):E(``,!0)]),I(S,{class:`cui-button-medium ml-auto`,label:t.$t(`components.form.button.install`),disabled:e.inProgress,onClick:n[2]||=e=>o(`install`,L(d))},null,8,[`label`,`disabled`])])],34)}}}),[[`__scopeId`,`data-v-501b0eb9`]]),ge={class:`cui-label`},_e={class:`flex flex-wrap gap-2 mt-4`},ve={key:0,class:`mt-6`},ye={class:`featured-row custom-scrollbar mt-3`},be={class:`flex flex-row items-center justify-center w-full mt-8`},xe={key:3,class:`text-center py-10`},Se={class:`text-muted mb-2`},Ce={class:`text-muted`},we={key:4,class:`w-full`},Te={key:5,class:`w-full plugin-list`},$=d(C({__name:`PluginSearch`,setup(s,{expose:l}){let u=f(()=>b(()=>import(`./VersionsHandler-J51M6nHE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]),import.meta.url)),d=f(()=>b(()=>import(`./PluginDetail-j7srfPSY.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,12,13,16,27,28,29,30,31,32,33,34,21,22,23,35,36,37,38,39,24,40]),import.meta.url)),p=new oe,_=o(),{t:x}=a(),C=v(`dialogRefProps`),k=M(``),N=M({}),R=M([]),z=M(`all`),B=M(`all`),V=M(`name`),H=M(!1),{data:U,isBusy:W,refetch:G}=p.searchPluginsQuery(N,{page:1,pageSize:-1},H),{data:K,isBusy:ue,refetch:de}=p.getPluginsProgressQuery({page:1,pageSize:-1}),q=O(()=>W.value||ue.value),J=O(()=>!!(C.loading?.value||q.value)),fe=O(()=>[{label:x(`components.plugin_search.filter_all_categories`),value:`all`},...ce.map(e=>({label:x(se[e].labelKey),value:e}))]),pe=O(()=>[{label:x(`components.plugin_search.filter_all_trust`),value:`all`},{label:x(`components.plugin_search.trust_official`),value:`official`},{label:x(`components.plugin_search.trust_verified`),value:`verified`},{label:x(`components.plugin_search.trust_community`),value:`community`}]),me=O(()=>[{label:x(`components.plugin_search.sort_name`),value:`name`},{label:x(`components.plugin_search.sort_downloads`),value:`downloads`},{label:x(`components.plugin_search.sort_updated`),value:`updated`}]),Y=O(()=>{let e=R.value.slice();return z.value!==`all`&&(e=e.filter(e=>e.category===z.value)),B.value!==`all`&&(e=e.filter(e=>e.trust===B.value)),e.sort((e,t)=>{switch(V.value){case`downloads`:return(t.downloads?.weekly??0)-(e.downloads?.weekly??0);case`updated`:return new Date(t.lastUpdated??0).getTime()-new Date(e.lastUpdated??0).getTime();default:return(e.displayName||e.pluginName).localeCompare(t.displayName||t.pluginName)}}),e}),X=O(()=>Y.value.filter(e=>e.featured)),Z=O(()=>Y.value.filter(e=>!e.featured));function Q(e){return K.value?.result.some(t=>t.pluginName===e)}function $(e){e?.preventDefault(),N.value.pluginname=k.value??``}function Ee(){k.value=``,N.value={},z.value=`all`,B.value=`all`,V.value=`name`,$()}function De(){H.value=!0,Promise.all([G(),de()]).finally(()=>{H.value=!1})}function Oe(e){_.openComponentDialog(u,{data:{title:x(`components.dialog.title.install`),loading:J,contentProps:{target:L(e),installVersion:`latest`}}})}function ke(e){_.openComponentDialog(d,{data:{title:x(`components.dialog.title.details`),confirmText:x(`components.form.button.install`),contentProps:{plugin:L(e)}}})}return h(U,e=>{e?.result&&(R.value=e.result.filter(e=>!e.installPath))},{immediate:!0,deep:!0}),l({isLoading:J}),(a,o)=>{let s=n,l=ae,u=r,d=ee,f=te,p=ie,h=he,_=c,v=e,b=re,x=ne,C=le,O=t,M=i;return g(),j(`div`,null,[F(`form`,{onSubmit:D($,[`prevent`])},[F(`label`,ge,y(a.$t(`components.form.label.name`)),1),I(f,null,{default:P(()=>[I(s,{modelValue:L(k),"onUpdate:modelValue":o[0]||=e=>w(k)?k.value=e:null,modelModifiers:{trim:!0},loading:L(q),placeholder:`camera-ui-`,type:`text`},null,8,[`modelValue`,`loading`]),I(d,null,{default:P(()=>[I(u,{text:``,rounded:``,severity:`secondary`,class:`cui-icon-md`,onClick:Ee},{icon:P(()=>[I(l,{width:`100%`,height:`100%`})]),_:1})]),_:1})]),_:1})],32),F(`div`,_e,[I(p,{modelValue:L(z),"onUpdate:modelValue":o[1]||=e=>w(z)?z.value=e:null,options:L(fe),"option-label":`label`,"option-value":`value`,class:`flex-1 min-w-[140px]`,placeholder:a.$t(`components.plugin_search.filter_category`)},null,8,[`modelValue`,`options`,`placeholder`]),I(p,{modelValue:L(B),"onUpdate:modelValue":o[2]||=e=>w(B)?B.value=e:null,options:L(pe),"option-label":`label`,"option-value":`value`,class:`flex-1 min-w-[140px]`,placeholder:a.$t(`components.plugin_search.filter_trust`)},null,8,[`modelValue`,`options`,`placeholder`]),I(p,{modelValue:L(V),"onUpdate:modelValue":o[3]||=e=>w(V)?V.value=e:null,options:L(me),"option-label":`label`,"option-value":`value`,class:`flex-1 min-w-[140px]`,placeholder:a.$t(`components.plugin_search.sort_by`)},null,8,[`modelValue`,`options`,`placeholder`])]),!L(q)&&L(X).length?(g(),j(`div`,ve,[F(`h3`,null,y(a.$t(`components.plugin_search.featured`)),1),F(`div`,ye,[(g(!0),j(S,null,m(L(X),(e,t)=>(g(),j(`div`,{key:t,class:`featured-item`},[I(h,{plugin:e,"in-progress":Q(e.pluginName),onOpen:ke,onInstall:Oe},null,8,[`plugin`,`in-progress`])]))),128))])])):E(``,!0),F(`div`,be,[F(`h3`,null,y(a.$t(`components.plugin_search.plugins`)),1),A((g(),T(u,{text:``,rounded:``,severity:`secondary`,class:`cui-icon-md ml-auto`,onClick:De},{icon:P(()=>[I(_,{width:`100%`,height:`100%`})]),_:1})),[[M,{value:a.$t(`components.plugin_search.refresh`)},void 0,{left:!0}]]),I(v,{size:`small`,class:`ml-2 rounded-full`,value:String(L(Z).length)},null,8,[`value`])]),L(q)?(g(),T(b,{key:1,mode:`indeterminate`,class:`my-3 !h-[1px]`})):(g(),T(x,{key:2,class:`m-0 py-3`})),!L(q)&&!L(Z).length?(g(),j(`div`,xe,[F(`div`,Se,[I(C,{class:`w-12 h-12 mx-auto opacity-30`})]),F(`p`,Ce,y(a.$t(`views.plugins.no_plugins`)),1)])):L(q)?(g(),j(`div`,we,[(g(),j(S,null,m(6,e=>I(O,{key:e,class:`mb-2`,height:`132px`})),64))])):(g(),j(`div`,Te,[(g(!0),j(S,null,m(L(Z),(e,t)=>A((g(),T(h,{key:t,plugin:e,"in-progress":Q(e.pluginName),onOpen:ke,onInstall:Oe},null,8,[`plugin`,`in-progress`])),[[M,{value:Q(e.pluginName)?a.$t(`components.plugin_search.in_progress`):void 0}]])),128))]))])}}}),[[`__scopeId`,`data-v-5d16a648`]]);export{$ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./PluginSearch-C4JY7Iwj.js";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,O as t,Ot as n,Pt as r,kr as i}from"./vendor-cameraui-
|
|
1
|
+
import{I as e,O as t,Ot as n,Pt as r,kr as i}from"./vendor-cameraui-CywDBRLD.js";import{G as a,Jt as o,Ut as s,an as c,gn as l,ln as u,rn as d,z as ee}from"./api-BwUGcpse.js";import{Bn as f,Qt as p,Rn as m,Tr as h,Xn as g,an as _,bn as v,cr as te,dn as y,fn as b,ln as x,nr as ne,pn as S,pr as C,tr as w,un as T,vn as E,wr as D,xr as O}from"./vendor-CdGy-Xet.js";import{F as k,P as A}from"./vendor-primevue-Cm1rEh62.js";import{t as j}from"./plugins-Ct1tFRqH.js";import{t as M}from"./search-BTu5ntI6.js";import{t as N}from"./PluginSearch-C4JY7Iwj.js";import{t as P}from"./config-BYU9LRQr.js";import{t as re}from"./back-filled-DZmo9cAg.js";import{t as ie}from"./plus-DhRnJIfm.js";import{t as ae}from"./settings-wRDwvjf-.js";import{r as F,t as I}from"./CuiPluginCard-4NsvwvgQ.js";var L={class:`flex flex-col`},R={key:0,class:`page-title`},z={class:`flex gap-2 mb-4`},B={key:1,class:`flex flex-1 min-h-0 flex-col items-center justify-center w-full gap-4`},V={class:`text-muted text-sm`},H=v({__name:`Plugins`,setup(v){let H=new j,U=new P,W=a(),{t:G}=i(),{smBreakpoint:K}=c(),{width:q,height:J}=u(),{data:oe,isBusy:se}=H.getPluginsQuery({page:1,pageSize:-1}),{data:Y}=U.getConfigQuery(!0),{mutateAsync:X}=U.patchConfigQuery(),Z=g(`menuRef`),Q=C(``),ce=x(()=>[{key:`betaVersions`,label:G(`views.plugins.beta_versions`),description:G(`views.plugins.beta_versions_hint`),toggle:!0,toggleState:Y.value?.plugins?.betaVersions??!1,onClick:fe},{key:`allowBuildScripts`,label:G(`views.plugins.allow_build_scripts`),description:G(`views.plugins.allow_build_scripts_hint`),toggle:!0,toggleState:Y.value?.plugins?.allowBuildScripts??!1,onClick:de}]),le=x(()=>se.value),$=x(()=>{let e=oe.value?.result??[],t=Q.value.toLowerCase().trim();return t?e.filter(e=>e.pluginName.toLowerCase().includes(t)||e.displayName?.toLowerCase().includes(t)):e}),ue=x(()=>(K.value?1:Math.max(1,Math.floor(q.value/450)))*Math.max(1,Math.ceil(J.value/(F.HEIGHT+8))));async function de(){let e=Y.value;if(!e||typeof e==`string`)return;let t={...e,plugins:{...e.plugins,allowBuildScripts:!e.plugins?.allowBuildScripts}};await X({configData:JSON.stringify(t)})}async function fe(){let e=Y.value;if(!e||typeof e==`string`)return;let t={...e,plugins:{...e.plugins,betaVersions:!e.plugins?.betaVersions}};await X({configData:JSON.stringify(t)})}function pe(){W.openComponentDialog(N,{data:{title:G(`components.dialog.title.search_plugin`),contentProps:{},hideConfirmButton:!0,fullscreen:!0}})}return(i,a)=>{let c=re,u=n,g=ee,v=M,x=A,C=t,j=k,N=ae,P=s,H=e,U=l,W=I,q=d,J=r;return m(),S(`div`,L,[O(K)?b(``,!0):(m(),S(`h1`,R,h(i.$t(`views.${String(i.$route.name).toLowerCase()}.title`)),1)),E(g,{position:`left`},{default:w(()=>[E(u,{severity:`secondary`,text:``,class:`cui-button p-2 text-color non-draggable-region`,onClick:a[0]||=e=>i.$router.push(`/menu`)},{icon:w(()=>[E(c,{class:`w-6 h-6`})]),_:1})]),_:1}),T(`div`,z,[E(j,{class:`flex-1`},{default:w(()=>[E(x,null,{default:w(()=>[E(v,{class:`w-4 h-4`})]),_:1}),E(C,{modelValue:O(Q),"onUpdate:modelValue":a[1]||=e=>te(Q)?Q.value=e:null,placeholder:O(G)(`views.plugins.search`),class:`w-full`},null,8,[`modelValue`,`placeholder`])]),_:1}),(`hasPermission`in i?i.hasPermission:O(o))(void 0,`admin`)?(m(),S(_,{key:0},[ne((m(),y(u,{severity:`secondary`,outlined:``,class:`cui-button shrink-0`,onClick:a[2]||=e=>O(Z)?.toggleMenu(e)},{icon:w(()=>[E(N,{class:`w-4.5 h-4.5`})]),_:1})),[[J,{value:O(G)(`views.plugins.settings`)},void 0,{left:!0}]]),E(P,{ref_key:`menuRef`,ref:Z,items:O(ce),"auto-hide":!1,popover:{pt:{root:{class:`w-[22rem]`},content:{class:`p-0! rounded-xl! overflow-hidden!`}}}},null,8,[`items`])],64)):b(``,!0)]),E(p,{name:`fade-2`,mode:`out-in`},{default:w(()=>[O(le)?(m(),S(`div`,{key:`loading`,class:`grid w-full gap-2`,style:D({gridTemplateColumns:`repeat(auto-fill, minmax(${O(K)?`100%`:`450px`}, 1fr))`})},[(m(!0),S(_,null,f(O(ue),e=>(m(),y(H,{key:e,height:`${O(F).HEIGHT}px`,class:`cui-card`},null,8,[`height`]))),128))],4)):!O($).length||!(`hasPermission`in i?i.hasPermission:O(o))(void 0,`admin`)?(m(),S(`div`,B,[E(U,{class:`w-12 h-12 text-muted`}),T(`span`,V,h(i.$t(`views.plugins.no_plugins`)),1)])):(m(),S(`div`,{key:`content`,class:`grid w-full gap-2`,style:D({gridTemplateColumns:`repeat(auto-fill, minmax(${O(K)?`100%`:`450px`}, 1fr))`})},[(m(!0),S(_,null,f(O($),(e,t)=>(m(),y(W,{key:t,plugin:e},null,8,[`plugin`]))),128))],4))]),_:1}),(`hasPermission`in i?i.hasPermission:O(o))(void 0,`admin`)?(m(),y(q,{key:1,"tooltip-props":{value:i.$t(`views.plugins.search_plugins`)},"button-props":{class:`text-white`},icon:O(ie),"icon-props":{width:`30px`,height:`30px`},onClick:pe},null,8,[`tooltip-props`,`icon`])):b(``,!0)])}}});export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,Dr as t,E as n,Lr as r,O as i,Ot as a,Pt as o,S as s,_ as c,b as l,fr as u,g as d,gt as f,h as p,hi as m,kr as h,mi as g,pr as ee,r as _,v,vi as y,vr as te,w as ne,wt as re}from"./vendor-cameraui-CywDBRLD.js";import{$t as ie,B as b,G as x,Gn as S,H as C,I as w,Ot as ae,U as T,V as E,_n as oe,an as se,en as D,nn as O,nt as k,on as A,qt as ce,rn as le,sn as ue,z as de}from"./api-BwUGcpse.js";import{$n as fe,Bn as j,In as pe,Qn as M,Rn as N,Sr as P,Tn as F,Tr as I,Wn as L,Xn as me,_n as he,an as R,bn as z,cr as B,dn as V,dr as H,fn as U,gr as ge,ln as W,lr as G,nr as _e,pn as K,pr as q,sn as ve,tr as J,un as Y,vn as X,wr as ye,xr as Z,zn as be}from"./vendor-CdGy-Xet.js";import{C as xe,K as Se,a as Ce,i as we,j as Te,l as Ee,z as De}from"./vendor-primevue-Cm1rEh62.js";import{t as Oe}from"./ring-resize-peEJMXPl.js";import{n as ke,t as Ae}from"./CuiRecordingsGrid-BeOP2hpR.js";import{n as je,t as Me}from"./round-alt-arrow-left-bold-BcL7KVCG.js";var Ne={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Pe(e,t){return N(),K(`svg`,Ne,[...t[0]||=[Y(`path`,{fill:`currentColor`,d:`M3 11h8V3H3m2 2h4v4H5m8 12h8v-8h-8m2 2h4v4h-4M3 21h8v-8H3m2 2h4v4H5m8-16v8h8V3m-2 6h-4V5h4Z`},null,-1)]])}var Fe=G({name:`mdi-view-grid-outline`,render:Pe}),Q={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ie(e,t){return N(),K(`svg`,Q,[...t[0]||=[Y(`path`,{fill:`currentColor`,d:`M22 18.605a.75.75 0 0 1-.75.75h-5.1a2.93 2.93 0 0 1-5.66 0H2.75a.75.75 0 1 1 0-1.5h7.74a2.93 2.93 0 0 1 5.66 0h5.1a.75.75 0 0 1 .75.75m0-13.21a.75.75 0 0 1-.75.75H18.8a2.93 2.93 0 0 1-5.66 0H2.75a.75.75 0 1 1 0-1.5h10.39a2.93 2.93 0 0 1 5.66 0h2.45a.74.74 0 0 1 .75.75m0 6.6a.74.74 0 0 1-.75.75H9.55a2.93 2.93 0 0 1-5.66 0H2.75a.75.75 0 1 1 0-1.5h1.14a2.93 2.93 0 0 1 5.66 0h11.7a.75.75 0 0 1 .75.75`},null,-1)]])}var Le=G({name:`mage-filter-fill`,render:Ie}),$={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Re(e,t){return N(),K(`svg`,$,[...t[0]||=[Y(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`1.5`,d:`M21.25 12H8.895m-4.361 0H2.75m18.5 6.607h-5.748m-4.361 0H2.75m18.5-13.214h-3.105m-4.361 0H2.75m13.214 2.18a2.18 2.18 0 1 0 0-4.36a2.18 2.18 0 0 0 0 4.36Zm-9.25 6.607a2.18 2.18 0 1 0 0-4.36a2.18 2.18 0 0 0 0 4.36Zm6.607 6.608a2.18 2.18 0 1 0 0-4.361a2.18 2.18 0 0 0 0 4.36Z`},null,-1)]])}var ze=G({name:`mage-filter`,render:Re}),Be={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ve(e,t){return N(),K(`svg`,Be,[...t[0]||=[Y(`path`,{fill:`currentColor`,d:`m14 2l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 18V9h-5V4H6v16zm-2-2l-2.5-1.7V18H8v-5h5.5v1.7L16 13z`},null,-1)]])}var He=G({name:`mdi-file-video-outline`,render:Ve}),Ue={class:`flex flex-col gap-6`},We={class:`flex flex-col field-gap`},Ge={class:`cui-label`},Ke={class:`flex flex-col field-gap`},qe={class:`cui-label`},Je={class:`grid grid-cols-1 xs:grid-cols-2 gap-3`},Ye={class:`flex flex-col gap-1`},Xe={class:`text-xs text-muted`},Ze={class:`flex flex-col gap-1`},Qe={class:`text-xs text-muted`},$e={class:`grid grid-cols-1 xs:grid-cols-2 gap-x-6 gap-y-4`},et={class:`flex flex-col field-gap`},tt={class:`cui-label`},nt={class:`flex flex-col field-gap`},rt={class:`cui-label`},it={class:`flex flex-col field-gap`},at={class:`flex items-center gap-3`},ot={class:`cui-label !mb-0`},st={key:0,class:`ml-auto flex items-center gap-2.5 text-sm tabular-nums`},ct={class:`font-semibold`},lt={class:`font-semibold`},ut={class:`border border-color rounded-xl card-background overflow-hidden`},dt={class:`flex flex-col gap-3 max-h-[240px] overflow-y-auto p-2.5`},ft={key:0,class:`flex items-center justify-center gap-2 text-muted text-sm py-6`},pt={key:1,class:`text-center text-muted text-sm py-6`},mt={class:`text-xs text-muted px-0.5`},ht={class:`font-mono text-xs truncate flex-1`},gt={class:`text-xs text-muted tabular-nums shrink-0`},_t={class:`font-mono text-xs text-muted tabular-nums shrink-0 min-w-[58px] text-right`},vt=30,yt=z({__name:`ExportRecordings`,props:{cameras:{},preselect:{}},setup(e,{expose:t}){let r=e,{t:i}=h(),a=S(),o=F(`dialogRefProps`),{plugin:s}=f(`@camera.ui/camera-ui-nvr`),c=q([]),l=q(!1),u=q(r.preselect?.length?[...r.preselect]:[]),d=q(`best`),p=q(0),m=q(new Date(new Date().setHours(0,0,0,0))),g=q(new Date),ee=W(()=>[{label:i(`views.recordings.export.quality_best`),value:`best`},{label:i(`views.recordings.export.quality_smallest`),value:`smallest`}]),_=W(()=>[0,1,2,5,10,30,60,120,180,240,300].map(e=>({label:e===0?i(`views.recordings.export.timelapse_off`):e<60?`${e} s`:`${e/60} min`,value:e}))),v=W(()=>p.value>0),te=W(()=>v.value?`~`:``),ie=W(()=>new Map(r.cameras.map(e=>[e.id,e.name]))),b=W(()=>m.value instanceof Date&&g.value instanceof Date&&m.value<g.value),x=W(()=>{if(!b.value)return[];let e=[],t=m.value.getTime(),n=g.value.getTime(),r=new Date(m.value);r.setHours(0,0,0,0);let i=new Date(g.value);for(i.setHours(0,0,0,0);r.getTime()<=i.getTime();){let i=new Date(r),a=new Date(r);a.setDate(a.getDate()+1);let o=Math.max(i.getTime(),t),s=Math.min(a.getTime(),n);s>o&&e.push({day:oe(i),startUs:o*1e3,endUs:s*1e3}),r.setDate(r.getDate()+1)}return e}),C=W(()=>c.value.map(e=>{let t=ie.value.get(e.cameraId)??e.cameraId,n=new Date(e.startUs/1e3),r=new Date(e.endUs/1e3),a=n.getHours()===0&&n.getMinutes()===0&&e.endUs-e.startUs===24*3600*1e6,o=r.getHours()===0&&r.getMinutes()===0?`24:00`:se(r);return{cameraId:e.cameraId,cameraName:t,name:`${O(t)}_${e.day}${v.value?`_timelapse`:``}.mp4`,span:a?i(`views.recordings.export.whole_day`):`${se(n)}–${o}`,bytes:v.value?e.bytes/vt:e.bytes}})),w=W(()=>{let e=new Map;for(let t of C.value){let n=e.get(t.cameraId);n||(n={cameraId:t.cameraId,cameraName:t.cameraName,files:[],bytes:0},e.set(t.cameraId,n)),n.files.push(t),n.bytes+=t.bytes}return[...e.values()]}),ae=W(()=>C.value.reduce((e,t)=>e+t.bytes,0)),T=W(()=>u.value.length===0?i(`views.recordings.export.no_cameras`):b.value?i(`views.recordings.export.no_footage`):i(`views.recordings.export.no_range`));function E(e){return String(e).padStart(2,`0`)}function oe(e){return`${e.getFullYear()}-${E(e.getMonth()+1)}-${E(e.getDate())}`}function se(e){return`${E(e.getHours())}:${E(e.getMinutes())}`}function O(e){return e.replace(/[^a-zA-Z0-9-_]/g,`_`)}function k(e){if(e<=0)return`0 MB`;let t=e/1e6;if(t<1e3)return`${t<10?t.toFixed(1):Math.round(t)} MB`;let n=e/1e9;return`${n.toFixed(+(n<10))} GB`}async function A(){let e=s.value;if(!e?.nvrExportEstimate||u.value.length===0||x.value.length===0){c.value=[],l.value=!1;return}l.value=!0;try{let t=await e.nvrExportEstimate({cameras:u.value,slices:x.value,quality:d.value});c.value=t.files??[]}catch{c.value=[]}finally{l.value=!1}}async function ce(){if(!b.value||u.value.length===0||x.value.length===0)return null;let e=s.value;if(!e?.nvrExportBatch)return a.add({severity:`error`,detail:i(`views.recordings.export.plugin_missing`),life:3e3}),null;let t=await e.nvrExportBatch({cameras:u.value,slices:x.value,quality:d.value,timelapseIntervalSec:v.value?p.value:0});await D({url:t.url,filename:t.filename})}return y([u,x,d],A,{debounce:350,immediate:!0,deep:!0}),fe(()=>{o.disabled&&(o.disabled.value=!b.value||u.value.length===0||!l.value&&C.value.length===0)}),t({onConfirm:ce}),(t,r)=>{let i=Ee,a=n,o=De,s=ne,c=Te,f=Ce,h=re,v=He;return N(),K(`div`,Ue,[Y(`div`,We,[Y(`label`,Ge,I(t.$t(`views.recordings.export.cameras`)),1),X(i,{modelValue:Z(u),"onUpdate:modelValue":r[0]||=e=>B(u)?u.value=e:null,options:e.cameras,"option-label":`name`,"option-value":`id`,display:`chip`,filter:``,placeholder:t.$t(`views.recordings.export.cameras_placeholder`),class:`w-full`},null,8,[`modelValue`,`options`,`placeholder`])]),Y(`div`,Ke,[Y(`label`,qe,I(t.$t(`views.recordings.export.range`)),1),Y(`div`,Je,[Y(`div`,Ye,[Y(`span`,Xe,I(t.$t(`views.recordings.export.from`)),1),X(a,{modelValue:Z(m),"onUpdate:modelValue":r[1]||=e=>B(m)?m.value=e:null,"show-time":``,"hour-format":`24`,fluid:``,"max-date":Z(g)},null,8,[`modelValue`,`max-date`])]),Y(`div`,Ze,[Y(`span`,Qe,I(t.$t(`views.recordings.export.to`)),1),X(a,{modelValue:Z(g),"onUpdate:modelValue":r[2]||=e=>B(g)?g.value=e:null,"show-time":``,"hour-format":`24`,fluid:``,"min-date":Z(m)},null,8,[`modelValue`,`min-date`])])]),Z(b)?(N(),V(o,{key:1,severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:J(()=>[he(I(t.$t(`views.recordings.export.range_hint`)),1)]),_:1})):(N(),V(o,{key:0,severity:`error`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:J(()=>[he(I(t.$t(`views.recordings.export.invalid_range`)),1)]),_:1}))]),Y(`div`,$e,[Y(`div`,et,[Y(`label`,tt,I(t.$t(`views.recordings.export.quality`)),1),X(s,{modelValue:Z(d),"onUpdate:modelValue":r[3]||=e=>B(d)?d.value=e:null,options:Z(ee),"option-label":`label`,"option-value":`value`,"allow-empty":!1,pt:{root:{class:`flex w-full`},pcToggleButton:{root:{class:`flex-1`}}}},null,8,[`modelValue`,`options`])]),Y(`div`,nt,[Y(`label`,rt,I(t.$t(`views.recordings.export.timelapse`)),1),X(c,{modelValue:Z(p),"onUpdate:modelValue":r[4]||=e=>B(p)?p.value=e:null,options:Z(_),"option-label":`label`,"option-value":`value`,class:`w-full`},null,8,[`modelValue`,`options`])])]),Y(`div`,it,[Y(`div`,at,[Y(`label`,ot,I(t.$t(`views.recordings.export.result`)),1),Z(C).length?(N(),K(`div`,st,[Y(`span`,ct,I(Z(C).length)+` `+I(Z(C).length===1?t.$t(`views.recordings.export.file`):t.$t(`views.recordings.export.files`)),1),r[5]||=Y(`span`,{class:`text-muted`},`·`,-1),Y(`span`,lt,I(Z(te))+I(k(Z(ae))),1),X(f,{value:Z(C).length===1?`MP4`:`ZIP`,severity:`info`},null,8,[`value`])])):U(``,!0)]),Y(`div`,ut,[Y(`div`,dt,[Z(l)&&!Z(C).length?(N(),K(`div`,ft,[X(h,{style:{width:`1rem`,height:`1rem`},"stroke-width":`4`,class:`m-0`}),Y(`span`,null,I(t.$t(`views.recordings.export.estimating`)),1)])):Z(C).length?(N(!0),K(R,{key:2},j(Z(w),e=>(N(),K(`div`,{key:e.cameraId,class:`flex flex-col gap-1`},[Y(`span`,mt,I(e.cameraName)+` · `+I(e.files.length)+` · `+I(Z(te))+I(k(e.bytes)),1),(N(!0),K(R,null,j(e.files,e=>(N(),K(`div`,{key:e.name,class:`flex items-center gap-3 card-inner-background border border-color rounded-lg px-3 py-2`},[X(v,{class:`w-4 h-4 text-muted shrink-0`}),Y(`span`,ht,I(e.name),1),Y(`span`,gt,I(e.span),1),Y(`span`,_t,I(Z(te))+I(k(e.bytes)),1)]))),128))]))),128)):(N(),K(`div`,pt,I(Z(T)),1))])])])])}}}),bt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function xt(e,t){return N(),K(`svg`,bt,[...t[0]||=[Y(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m6 9l6 6l6-6`},null,-1)]])}var St=G({name:`tabler-chevron-down`,render:xt}),Ct={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function wt(e,t){return N(),K(`svg`,Ct,[...t[0]||=[Y(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m6 15l6-6l6 6`},null,-1)]])}var Tt=G({name:`tabler-chevron-up`,render:wt}),Et={class:`flex flex-col gap-2`},Dt={class:`sidebar-section-title`},Ot={class:`p-input-icon-left w-full`},kt={class:`flex items-center justify-between gap-2`},At={class:`sidebar-section-title !mb-0`},jt={class:`flex flex-col gap-2`},Mt={class:`sidebar-section-title flex items-center gap-1.5`},Nt={key:0,class:`flex flex-col gap-1.5 mt-1`},Pt={class:`text-xs text-muted`},Ft={class:`flex items-center gap-3`},It={class:`text-xs font-mono w-8 text-right shrink-0`},Lt={class:`flex flex-col gap-2`},Rt={class:`sidebar-section-title`},zt={class:`flex flex-col gap-2`},Bt={class:`sidebar-section-title`},Vt={class:`relative rounded-md overflow-hidden`},Ht={class:`flex flex-col gap-2`},Ut={class:`sidebar-section-title`},Wt={class:`flex items-center gap-3`},Gt={class:`text-xs font-mono w-8 text-right shrink-0`},Kt={class:`flex flex-col gap-2`},qt={class:`sidebar-section-title`},Jt={class:`flex flex-wrap gap-1`},Yt={class:`flex flex-col gap-2`},Xt={key:0,class:`flex flex-col gap-2`},Zt={class:`flex items-center gap-2 cursor-pointer text-sm`},Qt={key:0,class:`flex flex-col gap-2 ml-6`},$t={class:`filter-logic-divider`},en={class:`flex flex-col gap-2`},tn={key:0,class:`flex flex-col gap-2`},nn={class:`filter-logic-divider`},rn={class:`flex flex-col gap-2`},an={key:0,class:`flex flex-col gap-2`},on={class:`flex items-center gap-2 cursor-pointer text-sm`},sn=288,cn=O(z({__name:`RecordingsFilterSidebar`,props:{filters:{},cameras:{},isOpen:{type:Boolean},isOverlay:{type:Boolean},semanticSearchAvailable:{type:Boolean},semanticSearchLoading:{type:Boolean}},emits:[`update:filters`,`semantic-search`,`close`],setup(n,{expose:o,emit:s}){let c={doorbell:`views.recordings.audio_doorbell`,glass_break:`views.recordings.audio_glass_break`,siren:`views.recordings.audio_siren`,speaking:`views.recordings.audio_speaking`,gunshot:`views.recordings.audio_gunshot`,dog_bark:`views.recordings.audio_dog_bark`,baby_cry:`views.recordings.audio_baby_cry`,alarm:`views.recordings.audio_alarm`,scream:`views.recordings.audio_scream`,cat:`views.recordings.audio_cat`,car_alarm:`views.recordings.audio_car_alarm`,smoke_alarm:`views.recordings.audio_smoke_alarm`},d={face:`views.recordings.attr_face`,license_plate:`views.recordings.attr_license_plate`},f={motion:`views.recordings.sensor_motion`,audio:`views.recordings.sensor_audio`,contact:`views.recordings.sensor_contact`,doorbell:`views.recordings.sensor_doorbell`,switch:`views.recordings.sensor_switch`,light:`views.recordings.sensor_light`,siren:`views.recordings.sensor_siren`,security_system:`views.recordings.sensor_security_system`,"line-crossing":`views.recordings.sensor_line_crossing`},p=new Set([`motion`,`audio`]),g=n,_=s,{t:v}=h(),{xlBreakpoint:y}=se(),{topbarHeight:re,bottombarHeight:b}=A(),{icons:x,generic:S}=E(),C=x,w=Tt,T=St,oe=me(`sidebarRef`),D=q(g.filters.semanticQuery??``),O=H({eventTypes:!0,attributes:!0,sensorEvents:!0}),k=W(()=>g.isOpen?sn:0),le=W(()=>g.cameras.map(e=>({id:e.id,name:e.name}))),ue=W(()=>{if(g.filters.cameraIds.length===1)return g.cameras.find(e=>e.id===g.filters.cameraIds[0])?.name}),de=W(()=>[{label:v(`views.recordings.filter_and`),value:`and`},{label:v(`views.recordings.filter_or`),value:`or`}]),fe=W(()=>[{label:v(`views.recordings.time_1h`),value:`1h`},{label:v(`views.recordings.time_1d`),value:`1d`},{label:v(`views.recordings.time_1w`),value:`1w`},{label:v(`views.recordings.time_1m`),value:`1m`}]),pe=W(()=>ee.filter(e=>!p.has(e)).map(e=>({label:v(`views.recordings.type_${e}`),value:e,icon:x[e]??S}))),P=W(()=>({label:v(`views.recordings.type_other`),value:l,icon:x.other??S})),F=W(()=>t.map(e=>({label:v(f[e]??`views.recordings.sensor_${e}`),value:e,icon:C[e]??S}))),z=W(()=>te.map(e=>({label:v(c[e]??e),value:e,icon:x[e]??S}))),ge=W(()=>u.map(e=>({label:v(d[e]??`views.recordings.attr_${e}`),value:e,icon:x[e]??S})));function G(e,t){_(`update:filters`,{...g.filters,[e]:t})}let _e=m(e=>{G(`search`,e)},300);function ve(){let e=D.value.trim();G(`semanticQuery`,e),_(`semantic-search`,e)}function J(e){let t=[...g.filters.eventTypes],n=t.indexOf(e);n>=0?t.splice(n,1):t.push(e),G(`eventTypes`,t)}function be(e){let t=[...g.filters.audioLabels],n=t.indexOf(e);n>=0?t.splice(n,1):t.push(e),G(`audioLabels`,t)}function Ce(e){let t=[...g.filters.sensorEvents],n=t.indexOf(e);n>=0?t.splice(n,1):t.push(e),G(`sensorEvents`,t)}function Te(e){let t=[...g.filters.hasAttributes],n=t.indexOf(e);n>=0?t.splice(n,1):t.push(e),G(`hasAttributes`,t)}function De(e){O[e]=!O[e]}return M(D,e=>{!e?.trim()&&g.filters.semanticQuery&&G(`semanticQuery`,``)}),r(oe,e=>{let t=e.target;t.closest(`#recordings-sidebar-toggle`)||t.closest(`[data-pc-section="overlay"], [data-pc-section="panel"], .p-connected-overlay`)||g.isOpen&&(g.isOverlay||!y.value)&&_(`close`)}),o({sidebarWidth:k}),(t,r)=>{let o=i,s=Se,c=ce,l=we,u=a,d=e,f=Ee,p=ie,m=ae,h=xe,g=ne;return N(),K(`nav`,{ref_key:`sidebarRef`,ref:oe,class:`recordings-sidebar fixed transition-all duration-200 overflow-x-hidden overflow-y-auto md:!pl-0 pl-safe pb-safe flex flex-col z-4`,style:ye({width:`${Z(k)}px`,borderRightWidth:n.isOpen?`1px`:`0px`,paddingBottom:`calc(env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px) + ${Z(b)}px + ${Z(re)}px)`})},[Y(`div`,{class:`flex flex-col gap-4 p-4`,style:ye({width:`${sn}px`})},[Y(`div`,Et,[Y(`label`,Dt,I(t.$t(`views.recordings.search`)),1),Y(`span`,Ot,[X(o,{"model-value":n.filters.search,placeholder:t.$t(`views.recordings.search_placeholder`),class:`w-full text-sm`,"onUpdate:modelValue":r[0]||=e=>Z(_e)(e)},null,8,[`model-value`,`placeholder`])])]),r[19]||=Y(`div`,{class:`sidebar-divider`},null,-1),Y(`div`,kt,[Y(`label`,At,I(t.$t(`views.recordings.only_with_recordings`)),1),X(s,{"model-value":n.filters.onlyWithRecordings,class:`shrink-0`,"onUpdate:modelValue":r[1]||=e=>G(`onlyWithRecordings`,e)},null,8,[`model-value`])]),r[20]||=Y(`div`,{class:`sidebar-divider`},null,-1),Y(`div`,jt,[Y(`label`,Mt,[X(c,{class:`w-3.5 h-3.5`}),he(` `+I(t.$t(`views.recordings.semantic_search`)),1)]),X(l,{modelValue:Z(D),"onUpdate:modelValue":r[2]||=e=>B(D)?D.value=e:null,placeholder:t.$t(`views.recordings.semantic_search_placeholder`),class:`w-full text-sm semantic-textarea`,rows:`3`,disabled:!n.semanticSearchAvailable},null,8,[`modelValue`,`placeholder`,`disabled`]),X(u,{label:t.$t(`views.recordings.semantic_search_button`),severity:`secondary`,outlined:``,size:`small`,class:`w-full text-xs`,loading:n.semanticSearchLoading,disabled:!n.semanticSearchAvailable||!Z(D)?.trim(),onClick:ve},null,8,[`label`,`loading`,`disabled`]),n.filters.semanticQuery?(N(),K(`div`,Nt,[Y(`label`,Pt,I(t.$t(`views.recordings.min_match_score`)),1),Y(`div`,Ft,[X(d,{"model-value":n.filters.minSemanticScore,min:0,max:1,step:.05,class:`flex-1`,"onUpdate:modelValue":r[3]||=e=>G(`minSemanticScore`,e)},null,8,[`model-value`]),Y(`span`,It,I(Math.round(n.filters.minSemanticScore*100))+`%`,1)])])):U(``,!0)]),r[21]||=Y(`div`,{class:`sidebar-divider`},null,-1),Y(`div`,Lt,[Y(`label`,Rt,I(t.$t(`views.recordings.cameras`)),1),X(f,{"model-value":n.filters.cameraIds,options:Z(le),"option-label":`name`,"option-value":`id`,placeholder:t.$t(`views.recordings.all_cameras`),class:`w-full text-sm`,"max-selected-labels":2,"show-toggle-all":!1,pt:{overlay:{style:`position: fixed`}},"onUpdate:modelValue":r[4]||=e=>G(`cameraIds`,e)},null,8,[`model-value`,`options`,`placeholder`])]),Z(ue)?(N(),K(R,{key:0},[r[14]||=Y(`div`,{class:`sidebar-divider`},null,-1),Y(`div`,zt,[Y(`label`,Bt,I(t.$t(`views.recordings.grid_search`)),1),Y(`div`,Vt,[X(p,{camera:Z(ue),"object-fit":`cover`},null,8,[`camera`]),X(m,{"model-value":n.filters.gridRegions,"onUpdate:modelValue":r[5]||=e=>G(`gridRegions`,e)},null,8,[`model-value`])]),X(u,{label:t.$t(`views.recordings.grid_clear`),severity:`secondary`,outlined:``,size:`small`,class:`w-full text-xs`,disabled:n.filters.gridRegions.length===0,onClick:r[6]||=e=>G(`gridRegions`,[])},null,8,[`label`,`disabled`])])],64)):U(``,!0),r[22]||=Y(`div`,{class:`sidebar-divider`},null,-1),Y(`div`,Ht,[Y(`label`,Ut,I(t.$t(`views.recordings.confidence`)),1),Y(`div`,Wt,[X(d,{"model-value":n.filters.minConfidence,min:0,max:1,step:.05,class:`flex-1`,"onUpdate:modelValue":r[7]||=e=>G(`minConfidence`,e)},null,8,[`model-value`]),Y(`span`,Gt,I(Math.round(n.filters.minConfidence*100))+`%`,1)])]),r[23]||=Y(`div`,{class:`sidebar-divider`},null,-1),Y(`div`,Kt,[Y(`label`,qt,I(t.$t(`views.recordings.time_range`)),1),Y(`div`,Jt,[(N(!0),K(R,null,j(Z(fe),e=>(N(),V(u,{key:e.value,label:e.label,severity:n.filters.timeRange===e.value?void 0:`secondary`,outlined:n.filters.timeRange!==e.value,size:`small`,class:`text-xs flex-1 min-w-0`,onClick:t=>G(`timeRange`,n.filters.timeRange===e.value?null:e.value)},null,8,[`label`,`severity`,`outlined`,`onClick`]))),128))])]),r[24]||=Y(`div`,{class:`sidebar-divider`},null,-1),Y(`div`,Yt,[Y(`button`,{class:`sidebar-section-title flex items-center justify-between w-full cursor-pointer`,onClick:r[8]||=e=>De(`sensorEvents`)},[Y(`span`,null,I(t.$t(`views.recordings.sensor_events`)),1),(N(),V(L(Z(O).sensorEvents?Z(w):Z(T)),{class:`w-4 h-4 text-muted`}))]),Z(O).sensorEvents?(N(),K(`div`,Xt,[(N(!0),K(R,null,j(Z(F),e=>(N(),K(R,{key:e.value},[Y(`label`,Zt,[X(h,{"model-value":n.filters.sensorEvents.includes(e.value),binary:!0,"onUpdate:modelValue":t=>Ce(e.value)},null,8,[`model-value`,`onUpdate:modelValue`]),(N(),V(L(e.icon),{class:`w-4 h-4 text-muted`})),Y(`span`,null,I(e.label),1)]),e.value===`audio`&&n.filters.sensorEvents.includes(`audio`)?(N(),K(`div`,Qt,[(N(!0),K(R,null,j(Z(z),e=>(N(),K(`label`,{key:e.value,class:`flex items-center gap-2 cursor-pointer text-sm`},[X(h,{"model-value":n.filters.audioLabels.includes(e.value),binary:!0,"onUpdate:modelValue":t=>be(e.value)},null,8,[`model-value`,`onUpdate:modelValue`]),(N(),V(L(e.icon),{class:`w-4 h-4 text-muted`})),Y(`span`,null,I(e.label),1)]))),128))])):U(``,!0)],64))),128))])):U(``,!0)]),Y(`div`,$t,[r[15]||=Y(`div`,{class:`filter-logic-line`},null,-1),X(g,{"model-value":n.filters.filterLogicTriggers,options:Z(de),"option-label":`label`,"option-value":`value`,"allow-empty":!1,class:`filter-logic-toggle`,"onUpdate:modelValue":r[9]||=e=>G(`filterLogicTriggers`,e)},null,8,[`model-value`,`options`]),r[16]||=Y(`div`,{class:`filter-logic-line`},null,-1)]),Y(`div`,en,[Y(`button`,{class:`sidebar-section-title flex items-center justify-between w-full cursor-pointer`,onClick:r[10]||=e=>De(`eventTypes`)},[Y(`span`,null,I(t.$t(`views.recordings.event_type`)),1),(N(),V(L(Z(O).eventTypes?Z(w):Z(T)),{class:`w-4 h-4 text-muted`}))]),Z(O).eventTypes?(N(),K(`div`,tn,[(N(!0),K(R,null,j(Z(pe),e=>(N(),K(`label`,{key:e.value,class:`flex items-center gap-2 cursor-pointer text-sm`},[X(h,{"model-value":n.filters.eventTypes.includes(e.value),binary:!0,"onUpdate:modelValue":t=>J(e.value)},null,8,[`model-value`,`onUpdate:modelValue`]),(N(),V(L(e.icon),{class:`w-4 h-4 text-muted`})),Y(`span`,null,I(e.label),1)]))),128))])):U(``,!0)]),Y(`div`,nn,[r[17]||=Y(`div`,{class:`filter-logic-line`},null,-1),X(g,{"model-value":n.filters.filterLogicAttributes,options:Z(de),"option-label":`label`,"option-value":`value`,"allow-empty":!1,class:`filter-logic-toggle`,"onUpdate:modelValue":r[11]||=e=>G(`filterLogicAttributes`,e)},null,8,[`model-value`,`options`]),r[18]||=Y(`div`,{class:`filter-logic-line`},null,-1)]),Y(`div`,rn,[Y(`button`,{class:`sidebar-section-title flex items-center justify-between w-full cursor-pointer`,onClick:r[12]||=e=>De(`attributes`)},[Y(`span`,null,I(t.$t(`views.recordings.attributes`)),1),(N(),V(L(Z(O).attributes?Z(w):Z(T)),{class:`w-4 h-4 text-muted`}))]),Z(O).attributes?(N(),K(`div`,an,[(N(!0),K(R,null,j(Z(ge),e=>(N(),K(`label`,{key:e.value,class:`flex items-center gap-2 cursor-pointer text-sm`},[X(h,{"model-value":n.filters.hasAttributes.includes(e.value),binary:!0,"onUpdate:modelValue":t=>Te(e.value)},null,8,[`model-value`,`onUpdate:modelValue`]),(N(),V(L(e.icon),{class:`w-4 h-4 text-muted`})),Y(`span`,null,I(e.label),1)]))),128)),Y(`label`,on,[X(h,{"model-value":n.filters.eventTypes.includes(Z(P).value),binary:!0,"onUpdate:modelValue":r[13]||=e=>J(Z(P).value)},null,8,[`model-value`]),(N(),V(L(Z(P).icon),{class:`w-4 h-4 text-muted`})),Y(`span`,null,I(Z(P).label),1)])])):U(``,!0)])],4)],4)}}}),[[`__scopeId`,`data-v-a1b07102`]]),ln={class:`font-semibold text-xl truncate`},un={class:`w-full h-full relative`},dn={key:0,class:`w-full flex flex-row h-[calc(40px+1rem)] py-2 items-center fixed z-10`},fn={class:`relative z-2 page-title !m-0`},pn={key:0,class:`flex items-center gap-2 mb-2 text-xs text-muted ml-auto`},mn={key:0,class:`inline-flex items-center gap-1`},hn={key:2,class:`flex justify-center py-4`},gn={key:3,class:`flex flex-1 min-h-0 flex-col items-center justify-center w-full gap-4`},_n={class:`text-muted text-sm`},vn=288,yn=10,bn=11,xn=z({__name:`Recordings`,setup(e){let t=new k,n=x(),{t:r}=h(),{smBreakpoint:i,xlBreakpoint:l,mdBreakpoint:u}=se(),{isTouch:f}=ue(),{registerScrollToTop:m}=b();if(!f.value&&typeof VideoDecoder<`u`){let e=c({cacheSize:20});be(p,e),g(()=>e.dispose())}let{results:ee,isSearching:y,isAvailable:te,hasSearched:ne,search:re,clear:ie}=v(),{data:S}=t.getCamerasQuery({page:1,pageSize:-1}),ae={"1h":3600*1e3,"1d":1440*60*1e3,"1w":10080*60*1e3,"1m":720*60*60*1e3},E=me(`gridRef`),D=q(`closed`),O=q(!1),A=q({search:``,semanticQuery:``,filterLogicTriggers:`or`,filterLogicAttributes:`or`,cameraIds:[],timeRange:null,customDateRange:null,eventTypes:[],audioLabels:[],hasAttributes:[],sensorEvents:[],gridRegions:[],minConfidence:.5,minSemanticScore:.5,onlyWithRecordings:!0}),fe=ge({state:`ended`,hasDetections:!0,withRecordingInfo:!0,hasRecording:!0}),j=JSON.stringify(fe.value),F=q(!1),L=ge([]),R=W(()=>l.value?!0:D.value===`opened`),z=W(()=>u.value),B=W(()=>u.value?`0px`:R.value?`${vn}px`:`0px`),H=W(()=>(S.value?.result??[]).map(e=>({id:e._id,name:e.name}))),G=W(()=>{let e=new Map;for(let t of H.value)e.set(t.id,t.name);return e}),xe=W(()=>{let e=new Map;for(let t of S.value?.result??[])e.set(t._id,t);return e}),Se=W(()=>A.value.cameraIds),Ce=W(()=>H.value.map(e=>e.id));m(()=>E.value?.scrollToTop());let{events:we,isLoading:Te,hasMore:Ee,loadMore:De,loadThumbnails:Ne,getCachedThumbnails:Pe}=s({availableCameraIds:Ce,cameraIds:Se,realtime:!0,pageSize:40,filter:fe}),Q=W(()=>{let e=new Map;for(let t of ee.value??[]){let n=e.get(t.eventId);(!n||t.score>n)&&e.set(t.eventId,t.score)}return e}),Ie=W(()=>ne.value),$=W(()=>{let e=we.value.filter(e=>e.state===`ended`),t=A.value;if(t.timeRange&&ae[t.timeRange]){let n=Date.now()-ae[t.timeRange];e=e.filter(e=>e.startTime>=n)}if(t.gridRegions.length>0&&(e=e.filter(e=>e.segments.some(e=>e.detections.some(e=>e.box&&Ue(e.box,t.gridRegions))))),Ie.value){let n=.15,r=t.minSemanticScore*(.38-n)+n;e=e.filter(e=>{let t=Q.value.get(e.id);return t!=null&&t>=r}),e.sort((e,t)=>(Q.value.get(t.id)??0)-(Q.value.get(e.id)??0))}return e}),Re=W(()=>F.value&&L.value.length?L.value:$.value.map(e=>({event:e,key:e.id})));function Be(){n.openComponentDialog(yt,{data:{title:r(`views.recordings.export.title`),contentProps:{cameras:H.value,preselect:A.value.cameraIds?.length?A.value.cameraIds:[]},confirmText:r(`views.recordings.export.confirm`)}})}function Ve(){let e=D.value;D.value=e===`opened`?`closed`:`opened`}function He(){D.value=`closed`}function Ue(e,t){if(t.length===0)return!0;let n=1/yn,r=1/bn,i=e.x/n,a=(e.x+e.width)/n,o=e.y/r,s=(e.y+e.height)/r;for(let e of t)if(a>e.col&&i<e.col+e.w&&s>e.row&&o<e.row+e.h)return!0;return!1}function We(e,t){let n=[];if(e.attributes)for(let[r,i]of Object.entries(e.attributes)){let e=d(i);if(!e)continue;let a=r.indexOf(`:`);n.push({key:`${t.id}:attr:${r}`,url:e,type:a>=0?r.substring(0,a):r,label:a>=0?r.substring(a+1):void 0})}if(e.detections)for(let[r,i]of Object.entries(e.detections)){let e=d(i);if(!e)continue;let a=r.includes(`:`)?r.split(`:`).slice(1).join(`:`):r;n.push({key:`${t.id}:det:${r}`,url:e,type:a})}if(e.scenes)for(let[r,i]of Object.entries(e.scenes)){let e=d(i);e&&n.push({key:`${t.id}:scene:${r}`,url:e,type:`scene`})}let r=new Set;return n.filter(e=>r.has(e.url)?!1:(r.add(e.url),!0))}function Ge(e){let t=[];for(let n of e){let e=Pe(n.id);if(!e){t.push({event:n,key:n.id});continue}let r=We(e,n),i=_(e,n);if(i.url){let e=r.findIndex(e=>e.url===i.url);e>0&&r.unshift(...r.splice(e,1))}r.length<=1?t.push({event:n,key:n.id}):r.forEach((e,r)=>{t.push({event:n,key:r===0?n.id:e.key,thumbnailOverride:{url:e.url,type:e.type,label:e.label}})})}return t}function Ke(e){!e.semanticQuery?.trim()&&A.value.semanticQuery?.trim()&&ie(),A.value=e}function qe(e){if(!e.trim()){ie();return}re(e)}function Je(e){let t=xe.value.get(e.cameraId);t&&n.openComponentDialog(C,{data:{title:t.name,stayActive:!0,hideCancelButton:!0,hideConfirmButton:!0,contentProps:{camera:t,eventTimestamp:e.startTime},headerActions:e.segments?.some(e=>e?.description)?[{icon:ce,toggle:!0,onClick:()=>{}}]:void 0,draggable:!0,blockDragOnSelectors:[`.p-dialog-body`],dismissableMask:!1,modal:!1,dialogContentClass:`!px-0 h-full`,goTo:`/cameras/${t.name}?startTs=${e.startTime}`},dialogSize:{desktop:{maxWidth:`800px`,maxHeight:`calc(100vh - max(1rem, env(safe-area-inset-top, 0px)) - max(1rem, env(safe-area-inset-bottom, 0px)))`,width:`50vw`}}})}return M(l,e=>{e&&(D.value=`closed`)}),M(A,e=>{let t=e.eventTypes.length>0||e.sensorEvents.length>0||e.audioLabels.length>0||e.hasAttributes.length>0,n={types:e.eventTypes.length>0?e.eventTypes:void 0,triggers:e.sensorEvents.length>0?e.sensorEvents:void 0,triggerLabels:e.audioLabels.length>0?e.audioLabels:void 0,attributes:e.hasAttributes.length>0?e.hasAttributes:void 0,filterLogicTriggers:t?e.filterLogicTriggers:void 0,filterLogicAttributes:t?e.filterLogicAttributes:void 0,search:e.search||void 0,minConfidence:e.minConfidence>0?e.minConfidence:void 0,state:`ended`,hasDetections:!t,withRecordingInfo:!0,hasRecording:e.onlyWithRecordings||void 0},r=JSON.stringify(n);r!==j&&(j=r,fe.value=n)},{deep:!0,immediate:!0}),M(F,e=>{e?L.value=Ge($.value):L.value=[]}),M($,e=>{if(!F.value)return;let t=new Set(e.map(e=>e.id)),n=new Set(L.value.map(e=>e.event.id)),r=L.value.filter(e=>t.has(e.event.id)),i=e.filter(e=>!n.has(e.id));i.length&&(r=[...Ge(i),...r]),L.value=r}),M(()=>A.value.cameraIds,e=>{e.length!==1&&A.value.gridRegions.length>0&&(A.value={...A.value,gridRegions:[]})}),pe(()=>{requestAnimationFrame(()=>{O.value=!0})}),(e,t)=>{let n=de,r=ze,s=Le,c=a,u=Me,d=je,f=Fe,p=w,m=ce,h=ke,g=Ae,ee=Oe,_=oe,v=le,ne=o;return N(),K(`div`,null,[X(n,{position:`center`},{default:J(()=>[Y(`span`,ln,I(e.$t(`views.recordings.title`)),1)]),_:1}),X(n,{position:`left`},{default:J(()=>[X(c,{id:`recordings-sidebar-toggle`,severity:`secondary`,class:`cui-button p-2 text-color`,text:``,rounded:``,onClick:Ve},{icon:J(()=>[Z(D)===`closed`?(N(),V(r,{key:0,width:`100%`,height:`100%`})):(N(),V(s,{key:1,width:`100%`,height:`100%`}))]),_:1})]),_:1}),X(cn,{filters:Z(A),cameras:Z(H),"is-open":Z(R),"is-overlay":Z(z),"semantic-search-available":Z(te),"semantic-search-loading":Z(y),"onUpdate:filters":Ke,onSemanticSearch:qe,onClose:He},null,8,[`filters`,`cameras`,`is-open`,`is-overlay`,`semantic-search-available`,`semantic-search-loading`]),(N(),V(ve,{to:`#container`,defer:``},[Z(R)&&Z(z)?(N(),K(`div`,{key:0,class:`fixed top-0 left-0 right-0 bottom-0 w-full h-full bg-black/50 z-1`,onClick:He})):U(``,!0)])),Y(`main`,{class:`relative w-full h-full`,style:ye({paddingLeft:Z(B),transition:Z(O)?`padding-left 200ms`:void 0})},[Y(`div`,un,[Z(i)?U(``,!0):(N(),K(`div`,dn,[t[1]||=Y(`div`,{class:`ml-2`},null,-1),Z(l)?U(``,!0):(N(),V(c,{key:0,id:`recordings-sidebar-toggle`,severity:`secondary`,class:`mr-2 cui-icon-lg relative z-2`,text:``,rounded:``,onClick:Ve},{icon:J(()=>[Z(R)?(N(),V(u,{key:0,width:`100%`,height:`100%`})):(N(),V(d,{key:1,width:`100%`,height:`100%`}))]),_:1})),Y(`h1`,fn,I(e.$t(`views.recordings.title`)),1),t[2]||=Y(`div`,{class:`gradient-blur rotate-180 !h-[70px]`},[Y(`div`),Y(`div`),Y(`div`),Y(`div`),Y(`div`),Y(`div`)],-1)])),Y(`div`,{class:P([`px-2 h-full w-full flex flex-col`,{"pt-4":Z(i),"pt-[calc(40px+2rem)]":!Z(i)}])},[Z($).length||Z(Ie)?(N(),K(`div`,pn,[_e((N(),V(c,{severity:Z(F)?`primary`:`secondary`,text:``,rounded:``,class:`cui-icon-sm`,onClick:t[0]||=e=>F.value=!Z(F)},{icon:J(()=>[Z(F)?(N(),V(p,{key:1,width:`100%`,height:`100%`})):(N(),V(f,{key:0,width:`100%`,height:`100%`}))]),_:1},8,[`severity`])),[[ne,{value:e.$t(`views.recordings.ungroup`)},void 0,{bottom:!0}]]),Y(`span`,null,I(e.$t(`views.recordings.result_count`,{count:Z(Re).length})),1),Z(Ie)?(N(),K(`span`,mn,[X(m,{class:`w-3 h-3`}),he(` `+I(e.$t(`views.recordings.semantic_results`,{count:Z(Q).size})),1)])):U(``,!0)])):U(``,!0),Z(Re).length?(N(),V(g,{key:1,ref_key:`gridRef`,ref:E,items:Z(Re),"min-item-width":Z(i)?160:180,gap:8,"has-more":Z(Ee),"load-more":Z(De),"item-key":e=>e.key,class:`flex-1 min-h-0`},{item:J(({item:e})=>[X(h,{event:e.event,"camera-name":Z(G).get(e.event.cameraId),camera:Z(xe).get(e.event.cameraId),"load-thumbnails":Z(Ne),"semantic-score":Z(Q).get(e.event.id),"thumbnail-override":e.thumbnailOverride,onScrollToEvent:()=>Je(e.event)},null,8,[`event`,`camera-name`,`camera`,`load-thumbnails`,`semantic-score`,`thumbnail-override`,`onScrollToEvent`])]),_:1},8,[`items`,`min-item-width`,`has-more`,`load-more`,`item-key`])):U(``,!0),Z(Te)||Z(y)?(N(),K(`div`,hn,[X(ee,{width:`24px`,height:`24px`,class:`text-muted`})])):U(``,!0),!Z($).length&&!Z(Te)&&!Z(y)?(N(),K(`div`,gn,[X(_,{class:`w-12 h-12 text-muted`}),Y(`span`,_n,I(e.$t(`views.recordings.no_recordings`)),1)])):U(``,!0)],2)])],4),Z(H).length?(N(),V(v,{key:0,"tooltip-props":{value:e.$t(`views.recordings.export.title`)},"button-props":{class:`text-white`},icon:Z(T),"icon-props":{width:`26px`,height:`26px`},"force-visible":``,onClick:Be},null,8,[`tooltip-props`,`icon`])):U(``,!0)])}}});export{xn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Lr as e,Ot as t,Ur as n,hi as r,ni as i,si as a,ti as o,wt as s}from"./vendor-cameraui-
|
|
1
|
+
import{Lr as e,Ot as t,Ur as n,hi as r,ni as i,si as a,ti as o,wt as s}from"./vendor-cameraui-CywDBRLD.js";import{Jt as c,S as l,an as u,dn as d,nn as f,on as p,sn as m,un as h,v as g,z as _}from"./api-BwUGcpse.js";import{An as v,Bn as y,Hn as b,In as x,Qn as S,Rn as C,Sr as w,Tr as T,Wn as E,Xn as D,an as O,bn as k,dn as A,fn as j,ln as M,pn as N,pr as P,tr as F,un as I,vn as L,wr as R,xr as z,yr as B}from"./vendor-CdGy-Xet.js";import{p as ee,u as V}from"./vendor-core-0Lu3l40a.js";import{n as H,t as U}from"./round-alt-arrow-left-bold-BcL7KVCG.js";var W={},G={class:`w-full h-full flex items-center justify-center`};function K(e,t){let n=s;return C(),N(`div`,G,[L(n,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])}var te=f(W,[[`render`,K]]),q={key:0},J={key:1},Y={class:`overflow-hidden w-full`},X={class:`ml-2 flex flex-row items-center justify-between`},Z={class:`text-start flex-1`},ne={class:`text-sm font-bold max-w-100 truncate`},re={key:0,class:`text-sm text-muted font-normal`},Q=f(k({__name:`CuiSubNavItem`,props:{label:{},to:{},description:{},icon:{},activeIcon:{}},setup(e){let{icon:n,activeIcon:r,label:i,description:a,to:o}=B(e);return(e,s)=>{let c=t,l=b(`RouterLink`);return C(),A(l,{to:z(o)},{default:F(({isExactActive:e})=>[L(c,{text:``,severity:`secondary`,class:w([`subnavitem-button w-full h-[120px] flex items-start justify-start p-6 bg-none text-color hover:!text-primary active:!text-primary focus:!text-primary rounded-none`,{"active !text-primary":e}]),fluid:``},{default:F(()=>[z(n)&&!e||!z(r)?(C(),N(`div`,q,[L(z(n),{class:`w-[24px] h-[24px]`})])):z(r)&&e?(C(),N(`div`,J,[L(z(r),{class:`w-[24px] h-[24px]`})])):j(``,!0),I(`div`,Y,[I(`div`,X,[I(`div`,Z,[I(`div`,ne,T(z(i)),1),z(a)?(C(),N(`div`,re,T(z(a)),1)):j(``,!0)])])])]),_:2},1032,[`class`])]),_:1},8,[`to`])}}}),[[`__scopeId`,`data-v-a5399c04`]]),$={CLOSED:0,EXPANDED:288},ie=f(k({__name:`CuiSubNavbar`,setup(t,{expose:n}){let a=V(),{bus:o}=h(),{xlBreakpoint:s,mdBreakpoint:l}=u(),{bottombarHeight:d,subbarState:f,navbarState:m,topbarHeight:_}=p(),b=D(`subnavbarRef`),w=P(`closed`),T=M(()=>s.value?`opened`:w.value),E=M(()=>T.value===`closed`?$.CLOSED:$.EXPANDED),k=M(()=>g.find(e=>e.name===`Settings`).children.filter(e=>e.meta?.settingsBar&&c(e)));function j(){w.value=`closed`,o.emit({subbarState:`closed`})}function F(){v(()=>{let e=b.value?.querySelector(`.subnavitem-button.active`);e&&e.scrollIntoView({block:`center`,behavior:`smooth`})})}let I=r(F,100);return e(b,e=>{let t=e.target,n=t.closest(`#menu-icon`),r=t.closest(`#submenu-icon`),i=t.closest(`#navbar-icon`);!n&&!r&&!i&&j()}),i(b,()=>{I()}),S(f,e=>{e&&e!==w.value&&(w.value=e)},{immediate:!0}),S(a.currentRoute,(e,t)=>{e.path!==t.path&&j()}),S(m,e=>{e===`opened`&&l.value&&j()}),x(()=>{F()}),n({subnavbarState:T}),(e,t)=>{let n=Q;return C(),N(`nav`,{ref_key:`subnavbarRef`,ref:b,class:`cui-subnavbar fixed transition-all duration-200 overflow-x-hidden overflow-y-scroll md:!pl-0 pl-safe pb-safe w-full h-full flex flex-col`,style:R({width:`${z(E)}px`,borderRightWidth:z(T)===`opened`?`1px`:`0px`,paddingBottom:`calc(env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px) + ${z(d)}px + ${z(_)}px)`})},[(C(!0),N(O,null,y(z(k),t=>(C(),A(n,{key:t.name,icon:t.meta.settingsBar.icon.default,"active-icon":t.meta.settingsBar.icon.active,to:t.path,label:e.$t(`navigation.${(t.meta?.name).toLowerCase()}`),description:e.$t(`navigation_description.${t.meta?.description}`),class:`cui-list-item !m-0 !p-0 shrink-0`,style:R({width:`${z($).EXPANDED}px`})},null,8,[`icon`,`active-icon`,`to`,`label`,`description`,`style`]))),128))],4)}}}),[[`__scopeId`,`data-v-dd32f99b`]]),ae={class:`font-semibold text-xl truncate`},oe={class:`relative flex overflow-hidden items-center justify-center w-5 h-5`},se={class:`flex flex-col justify-between w-4 h-3 transform transition-all duration-100 origin-center overflow-hidden`},ce={class:`w-full h-full relative`},le={key:0,class:`w-full flex flex-row h-[calc(40px+1rem)] py-2 items-center fixed z-2`},ue={class:`relative z-2 page-title !m-0`},de=k({__name:`Settings`,setup(e){let r=V(),i=d(),{bus:s}=h(),{isTouch:f}=m(),{mdBreakpoint:p,xlBreakpoint:v,smBreakpoint:y}=u(),{routerLoading:x}=ee(l()),O=g.find(e=>e.name===`Settings`).children.filter(e=>c(e)&&e.meta?.settingsBar),k=D(`subnavbarRef`),B=D(`containerRef`),W=P(!0),{isSwiping:G,direction:K}=f.value?a(B,{threshold:50,onSwipeStart(e){let t=e.target;([`INPUT`,`TEXTAREA`,`SELECT`,`BUTTON`].includes(t.tagName)||t.closest(`.p-datatable`))&&(W.value=!1)},onSwipeEnd(){W.value=!0}}):o(B,{threshold:50,onSwipeStart(e){let t=e.target;([`INPUT`,`TEXTAREA`,`SELECT`,`BUTTON`].includes(t.tagName)||t.closest(`.p-datatable`))&&(W.value=!1)},onSwipeEnd(){W.value=!0}}),q=n(k),J=M(()=>k.value?.subnavbarState??`closed`);function Y(){let e=J.value===`opened`?`closed`:`opened`;s.emit({subbarState:e})}return S([G,K],()=>{if(G.value&&W.value){let e=O.findIndex(e=>e.path===r.currentRoute.value.path.split(`/settings/`)[1]);switch(K.value){case`right`:{let t=O[e-1];t&&r.push({path:t.path})}break;case`left`:{let t=O[e+1];t&&r.push({path:t.path})}break}}}),(e,n)=>{let r=_,a=t,o=ie,s=U,c=H,l=te,u=b(`RouterView`);return C(),N(`div`,null,[L(r,{position:`center`},{default:F(()=>[I(`span`,ae,T(e.$t(`views.settings.title_${e.$route.meta?.name}`)),1)]),_:1}),L(r,{position:`left`},{default:F(()=>[L(a,{id:`menu-icon`,class:`cui-button relative group p-2 transition-colors duration-100 w-[40px] h-[42px] flex items-center justify-center`,severity:`secondary`,text:``,onClick:Y},{default:F(()=>[I(`div`,oe,[I(`div`,se,[I(`div`,{class:w([`h-0.5 w-2 transform transition-all duration-100 origin-center`,{"w-4 rotate-45 translate-y-[5px]":z(J)===`opened`}]),style:{backgroundColor:`var(--text-color)`}},null,2),I(`div`,{class:w([`h-0.5 w-4 rounded transform transition-all duration-100`,{"opacity-0":z(J)===`opened`}]),style:{backgroundColor:`var(--text-color)`}},null,2),I(`div`,{class:w([`h-0.5 w-3 transform transition-all duration-100 origin-center`,{"w-4 -rotate-45 -translate-y-[5px]":z(J)===`opened`}]),style:{backgroundColor:`var(--text-color)`}},null,2)])])]),_:1})]),_:1}),L(o,{ref_key:`subnavbarRef`,ref:k,class:`z-4 min-w-0`},null,512),I(`main`,{class:`relative w-full h-full`,style:R({paddingLeft:z(p)?`0px`:`${z(q).width.value}px`})},[I(`div`,ce,[z(y)?j(``,!0):(C(),N(`div`,le,[n[0]||=I(`div`,{class:`ml-2`},null,-1),z(v)?j(``,!0):(C(),A(a,{key:0,id:`submenu-icon`,severity:`secondary`,class:`mr-2 cui-icon-lg relative z-2`,text:``,rounded:``,onClick:Y},{icon:F(()=>[z(J)===`opened`?(C(),A(s,{key:0,width:`100%`,height:`100%`})):(C(),A(c,{key:1,width:`100%`,height:`100%`}))]),_:1})),I(`h1`,ue,T(e.$t(`views.settings.title_${e.$route.meta?.name}`)),1),n[1]||=I(`div`,{class:`gradient-blur rotate-180 !h-[70px]`},[I(`div`),I(`div`),I(`div`),I(`div`),I(`div`),I(`div`)],-1)])),I(`div`,{ref_key:`containerRef`,ref:B,class:w([`px-2 h-full w-full`,{"py-4":z(y),"pt-[calc(40px+2rem)] pb-2":!z(y)}])},[z(x)&&z(i).showRouterLoadingSub.value?(C(),A(l,{key:0,class:`w-full h-full relative overflow-x-hidden`})):(C(),A(u,{key:1},{default:F(({Component:e})=>[(C(),A(E(e),{class:`h-full`}))]),_:1}))],2)])],4)])}}});export{de as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,O as t,Ot as n,Pt as r,kr as i,wt as a}from"./vendor-cameraui-Bq-hQsT7.js";import{A as o,E as s,Et as c,Fn as l,G as u,Gn as d,L as ee,Wt as te,et as f,h as p,i as m,l as ne,m as h,nn as g,tt as re,yn as ie}from"./api-CdJDEL3z.js";import{Bn as _,I as v,In as ae,L as y,Qt as b,R as oe,Rn as x,Tn as S,Tr as C,Wn as se,Xn as ce,_n as le,an as ue,bn as w,cr as T,dn as E,fn as D,gr as de,kn as O,ln as k,lr as A,nr as fe,pn as j,pr as M,tr as N,un as P,vn as F,xr as I,yr as L}from"./vendor-CdGy-Xet.js";import{n as R,r as z}from"./vendor-zod-BaT-dXMv.js";import{p as pe}from"./vendor-core-CoiYJRqo.js";import{K as me,L as he,R as ge,a as _e,s as ve,u as ye,x as be,z as xe}from"./vendor-primevue-B3sIO6X2.js";import{t as Se}from"./CuiDataTable-DqtFJKC6.js";import{t as Ce}from"./CuiQRCode-BqMd2Oh6.js";import{t as B}from"./auth-DOnr6Mc1.js";var V={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function H(e,t){return x(),j(`svg`,V,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`m17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5M4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z`},null,-1)]])}var we=A({name:`mdi-logout`,render:H}),U={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function W(e,t){return x(),j(`svg`,U,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`M7 14c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2m5.6-4c-.8-2.3-3-4-5.6-4c-3.3 0-6 2.7-6 6s2.7 6 6 6c2.6 0 4.8-1.7 5.6-4H16v4h4v-4h3v-4z`},null,-1)]])}var Te=A({name:`mdi-key`,render:W}),G={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function K(e,t){return x(),j(`svg`,G,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`M17 19H7V5h10m0-4H7c-1.11 0-2 .89-2 2v18a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2`},null,-1)]])}var Ee=A({name:`mdi-cellphone`,render:K}),De={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Oe(e,t){return x(),j(`svg`,De,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`M22 18v4h-4v-3h-3v-3h-3l-2.26-2.26c-.55.17-1.13.26-1.74.26a6 6 0 0 1-6-6a6 6 0 0 1 6-6a6 6 0 0 1 6 6c0 .61-.09 1.19-.26 1.74zM7 5a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2`},null,-1)]])}var ke=A({name:`mdi-key-variant`,render:Oe}),Ae={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function je(e,t){return x(),j(`svg`,Ae,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`M4 6h16v10H4m16 2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4c-1.11 0-2 .89-2 2v10a2 2 0 0 0 2 2H0v2h24v-2z`},null,-1)]])}var Me=A({name:`mdi-laptop`,render:je}),Ne={class:`flex flex-col gap-6`},Pe={class:`token-box`},Fe={class:`token-value`},Ie=g(w({__name:`ApiTokenCreated`,props:{token:{}},setup(e,{expose:t}){let a=e,o=d(),{t:s}=i(),{token:c}=L(a);async function l(){await m(c.value)?o.add({severity:`success`,detail:s(`components.toast.copied`),life:1500}):o.add({severity:`error`,detail:s(`components.toast.copy_failed`),life:3e3})}async function u(){}return t({onConfirm:u}),(e,t)=>{let i=xe,a=n,o=r;return x(),j(`div`,Ne,[F(i,{severity:`warn`},{default:N(()=>[le(C(e.$t(`views.settings.api_tokens.created_warning`)),1)]),_:1}),P(`div`,Pe,[P(`span`,Fe,C(I(c)),1),fe((x(),E(a,{text:``,rounded:``,class:`cui-icon-md shrink-0`,onClick:l},{icon:N(()=>[F(I(f),{width:`100%`,height:`100%`})]),_:1})),[[o,{value:e.$t(`components.form.button.copy`)}]])])])}}}),[[`__scopeId`,`data-v-591cfcb4`]]),Le={class:`flex flex-col gap-2 w-full`},Re={for:`apiTokenName`,class:`cui-label`},ze={key:0,class:`text-xs text-red-500`},Be=w({__name:`CreateApiToken`,props:{existingNames:{}},setup(e,{expose:n}){let r=e,i=M(``),a=k(()=>r.existingNames.includes(i.value.trim()));return n({onConfirm:async()=>{let e=i.value.trim();return!e||a.value?null:e}}),(e,n)=>{let r=t;return x(),j(`div`,Le,[P(`label`,Re,C(e.$t(`views.settings.api_tokens.name_label`)),1),F(r,{id:`apiTokenName`,modelValue:I(i),"onUpdate:modelValue":n[0]||=e=>T(i)?i.value=e:null,class:`w-full`,placeholder:e.$t(`views.settings.api_tokens.name_placeholder`),autofocus:``,invalid:I(a)},null,8,[`modelValue`,`placeholder`,`invalid`]),I(a)?(x(),j(`span`,ze,C(e.$t(`views.settings.api_tokens.name_exists`)),1)):D(``,!0)])}}}),Ve={class:`flex flex-col gap-6`},He={class:`backup-codes-grid`},Ue=g(w({__name:`TwoFactorBackupCodes`,props:{backupCodes:{}},setup(e,{expose:t}){let{backupCodes:n}=L(e);async function r(){}return t({onConfirm:r}),(e,t)=>{let r=xe;return x(),j(`div`,Ve,[F(r,{severity:`warn`},{default:N(()=>[le(C(e.$t(`views.settings.security.backup_warning`)),1)]),_:1}),P(`div`,He,[(x(!0),j(ue,null,_(I(n),e=>(x(),j(`span`,{key:e,class:`backup-code`},C(e),1))),128))])])}}}),[[`__scopeId`,`data-v-0761a2ae`]]),We={class:`flex flex-col gap-6`},Ge={class:`text-muted`},Ke={class:`flex flex-col gap-2 justify-center items-center mt-5`},qe={class:`cui-label`},Je=w({__name:`TwoFactorDisable`,setup(e,{expose:t}){let n=new B,r=d(),{t:a}=i(),o=S(`dialogRefProps`),{mutateAsync:s,isPending:c}=n.disable2FAQuery(),l=M(``),u=k(()=>!!(o.loading?.value||c.value)),ee=k(()=>l.value.length<6);async function te(){if(l.value.length<6)return null;try{await s({code:l.value}),r.add({severity:`success`,detail:a(`views.settings.security.2fa_disabled_success`),life:3e3})}catch(e){return r.add({severity:`error`,detail:e,life:3e3}),null}}return t({isLoading:u,isDisabled:ee,onConfirm:te}),(e,t)=>{let n=ye;return x(),j(`div`,We,[P(`p`,Ge,C(e.$t(`views.settings.security.disable_confirm`)),1),P(`div`,Ke,[P(`label`,qe,C(e.$t(`views.settings.security.enter_code`)),1),F(n,{modelValue:I(l),"onUpdate:modelValue":t[0]||=e=>T(l)?l.value=e:null,length:6,"integer-only":``,class:`justify-center`},null,8,[`modelValue`])])])}}}),Ye={class:`flex flex-col gap-6`},Xe={class:`text-muted`},q={class:`flex flex-col gap-2 justify-center items-center mt-5`},J={class:`cui-label`},Ze=w({__name:`TwoFactorRegenerate`,props:{onBackupCodesGenerated:{type:Function}},setup(e,{expose:t}){let n=new B,r=e,a=d(),{t:o}=i(),s=S(`dialogRefProps`),{mutateAsync:c,isPending:l}=n.regenerateBackupCodesQuery(),u=M(``),ee=k(()=>!!(s.loading?.value||l.value)),te=k(()=>u.value.length<6);async function f(){if(u.value.length<6)return null;try{let e=await c({code:u.value});a.add({severity:`success`,detail:o(`views.settings.security.backup_regenerated`),life:3e3}),r.onBackupCodesGenerated&&r.onBackupCodesGenerated(e.backupCodes)}catch(e){return a.add({severity:`error`,detail:e,life:3e3}),null}}return t({isLoading:ee,isDisabled:te,onConfirm:f}),(e,t)=>{let n=ye;return x(),j(`div`,Ye,[P(`p`,Xe,C(e.$t(`views.settings.security.regenerate_confirm`)),1),P(`div`,q,[P(`label`,J,C(e.$t(`views.settings.security.enter_code`)),1),F(n,{modelValue:I(u),"onUpdate:modelValue":t[0]||=e=>T(u)?u.value=e:null,length:6,"integer-only":``,class:`justify-center`},null,8,[`modelValue`])])])}}}),Qe={class:`flex flex-col w-full gap-6`},$e={class:`relative`},et={class:`image-upload rounded-full z-1`},tt={for:`file-input`},nt={class:`card-title`},rt={class:`flex flex-col gap-6`},it={for:`username`,class:`cui-label`},at={class:`card-title`},ot={class:`flex flex-col gap-6`},st={for:`password`,class:`cui-label`},ct={for:`passwordConfirm`,class:`cui-label`},lt={class:`relative`},ut={class:`image-upload rounded-full z-1`},dt={for:`file-input`},ft={class:`card-title`},pt={class:`flex flex-col gap-6`},mt={class:`flex flex-col field-gap`},ht={for:`username`,class:`cui-label`},gt={class:`flex flex-row items-end justify-end`},_t={class:`card-title`},vt={for:`password`,class:`cui-label`},yt={for:`passwordConfirm`,class:`cui-label`},bt={class:`flex flex-row items-end justify-end`},xt={class:`card-title`},St={key:0,class:`flex justify-center py-6`},Ct={key:`initial`,class:`flex flex-col gap-6`},wt={class:`flex flex-col gap-1`},Tt={class:`tfa-row-title`},Et={class:`tfa-row-description`},Dt={key:`loading`,class:`flex flex-col items-center py-8 gap-3`},Ot={class:`text-sm text-muted`},kt={key:`setup`,class:`tfa-setup`},At={class:`tfa-setup-qr`},jt={class:`text-sm text-muted text-center mt-3`},Mt={class:`flex flex-col gap-5 flex-1`},Nt={class:`flex flex-col field-gap`},Pt={class:`cui-label`},Ft={class:`flex flex-col field-gap`},It={class:`cui-label`},Lt={class:`flex gap-2 justify-end`},Rt={key:`enabled`,class:`flex flex-col gap-6`},zt={class:`tfa-row tfa-row-enabled`},Bt={class:`tfa-status-icon`},Vt={class:`tfa-row-content`},Ht={class:`tfa-row-title`},Ut={key:0,class:`tfa-backup-info`},Wt={class:`flex gap-2 justify-end`},Gt={key:0},Kt={class:`card-title`},qt={class:`flex items-center gap-4`},Jt={class:`flex flex-col field-switch-gap min-w-0`},Yt={class:`text-sm font-bold text-color`},Xt={class:`card-title`},Zt={class:`flex flex-col gap-6`},Qt={class:`text-sm text-muted`},$t={class:`text-muted text-sm`},en={class:`flex items-center gap-3`},tn={class:`flex flex-col min-w-0`},nn={class:`text-sm font-semibold text-color truncate`},rn={class:`text-xs text-muted truncate font-mono`},an={class:`text-xs text-muted`},on={class:`flex flex-row items-end justify-end gap-2`},sn={class:`card-title`},cn={class:`flex flex-col gap-6`},ln={class:`text-muted text-sm`},un={class:`flex items-center gap-3`},dn={class:`flex flex-col min-w-0`},fn={class:`flex items-center gap-2`},pn={class:`text-sm font-semibold text-color truncate`},mn={class:`text-xs text-muted truncate`},hn={key:0,class:`flex flex-row items-end justify-end gap-2`},Y=g(w({__name:`SettingsAccount`,props:{firststeps:{type:Boolean}},setup(g,{expose:_}){let S=new B,w=g,A=u(),V=d(),{t:H}=i(),{firststeps:U}=L(w),W=p(),{user:G}=pe(W),{data:K,isLoading:De}=S.toggleQueryActivator(`get2FAStatusQuery`,!U.value).get2FAStatusQuery(),{mutateAsync:Oe,isPending:Ae}=S.setup2FAQuery(),{mutateAsync:je,isPending:Ne}=S.enable2FAQuery(),{data:Pe,isBusy:Fe}=S.toggleQueryActivator(`listSessionsQuery`,!U.value).listSessionsQuery({page:1,pageSize:-1}),{mutateAsync:Le}=S.revokeSessionQuery(),{mutateAsync:Re}=S.revokeOtherSessionsQuery(),{data:ze,isBusy:Ve}=S.toggleQueryActivator(`listApiTokensQuery`,!U.value).listApiTokensQuery(),{mutateAsync:He,isPending:We}=S.createApiTokenQuery(),{mutateAsync:Ge}=S.revokeApiTokenQuery(),Ke=R({password:s,passwordConfirm:z().min(1)}).refine(e=>e.password===e.passwordConfirm,{message:`Passwords do not match`,path:[`passwordConfirm`]}),qe=R({username:z().min(1),password:s,passwordConfirm:z().min(1)}).refine(e=>e.password===e.passwordConfirm,{message:`Passwords do not match`,path:[`passwordConfirm`]}),Ye=ce(`formRef`),Xe=ce(`passwordFormRef`),q=de(),J=M(`avatar`),Y=M(G.value?.username??``),X=M(!1),Z=M(!1),Q=M(null),$=M(``),gn=M(null),_n=M(!1),vn=M(null);M(!1);let yn=M(!1),bn=M(!1),xn=k(()=>!1),Sn={bodyRow:{class:`text-sm text-secondary`},column:{columnTitle:{class:`text-sm`}}},Cn=k(()=>(Pe.value??[]).filter(e=>!e.is_current).length),wn=k(()=>!Q.value?.secret||!G.value?.username?``:`otpauth://totp/${encodeURIComponent(`camera.ui:${G.value.username}`)}?secret=${Q.value.secret}&issuer=camera.ui`);async function Tn(){Q.value?.secret&&await m(Q.value.secret)}function En(e){return e===`native`?Ee:Me}async function Dn(e){gn.value=e;try{await Le({id:e})}catch(e){V.add({severity:`error`,detail:e,life:3e3})}finally{gn.value=null}}function On(){A.openComponentDialog(Be,{data:{title:H(`views.settings.api_tokens.create`),confirmText:H(`views.settings.api_tokens.create_confirm`),contentProps:{existingNames:(ze.value??[]).map(e=>e.name)}},onConfirm:async e=>{if(e)try{kn((await He({name:e})).token)}catch(e){V.add({severity:`error`,detail:e,life:3e3})}}})}function kn(e){A.openComponentDialog(Ie,{data:{title:H(`views.settings.api_tokens.created_title`),confirmText:H(`components.form.button.close`),hideCancelButton:!0,contentProps:{token:e}}})}function An(e){A.openTextDialog({data:{title:H(`views.settings.api_tokens.revoke_title`),contentText:H(`views.settings.api_tokens.revoke_confirm`,{name:e.name}),confirmText:H(`views.settings.api_tokens.revoke`),confirmButtonProps:{severity:`danger`}},onConfirm:async()=>{vn.value=e.id;try{await Ge({id:e.id})}catch(e){V.add({severity:`error`,detail:e,life:3e3})}finally{vn.value=null}}})}function jn(){A.openTextDialog({data:{title:H(`views.settings.active_sessions.revoke_others_title`),contentText:H(`views.settings.active_sessions.revoke_others_confirm`,{count:Cn.value}),confirmText:H(`views.settings.active_sessions.revoke`),confirmButtonProps:{severity:`danger`}},onConfirm:async()=>{_n.value=!0;try{await Re()}catch(e){V.add({severity:`error`,detail:e,life:3e3})}finally{_n.value=!1}}})}async function Mn(){try{Q.value=await Oe()}catch(e){V.add({severity:`error`,detail:e,life:3e3})}}function Nn(){Q.value=null,$.value=``}async function Pn(){try{let e=await je({code:$.value});Q.value=null,$.value=``,V.add({severity:`success`,detail:H(`views.settings.security.2fa_enabled_success`),life:3e3}),Ln(e.backupCodes)}catch(e){V.add({severity:`error`,detail:e,life:3e3})}}function Fn(){A.openComponentDialog(Je,{data:{title:H(`views.settings.security.disable_2fa`),confirmText:H(`views.settings.security.disable_2fa`),confirmButtonProps:{severity:`danger`},contentProps:{}}})}function In(){A.openComponentDialog(Ze,{data:{title:H(`views.settings.security.regenerate_backup`),confirmText:H(`views.settings.security.regenerate_backup`),contentProps:{onBackupCodesGenerated:e=>{Ln(e)}}}})}function Ln(e){A.openComponentDialog(Ue,{data:{title:H(`views.settings.security.backup_codes`),confirmText:H(`components.form.button.close`),hideCancelButton:!0,contentProps:{backupCodes:e}}})}async function Rn(e){let t=e.target?.files;q.value=t?.[0],J.value=await h(e)??J.value}async function zn(){X.value=!0;try{let e;q.value&&(e=new FormData,e.append(`upload`,q.value));let t=G.value?.username!==Y.value;if(t)await W.updateUser({username:Y.value},e);else if(e)await W.updateUser(void 0,e);else{X.value=!1;return}V.add({severity:`success`,detail:H(`components.toast.profile_updated`),life:3e3}),q.value=void 0,t&&W.logout()}catch{}X.value=!1}async function Bn(e){Z.value=!0;try{await W.updateUser({password:e.password,passwordConfirm:e.passwordConfirm}),V.add({severity:`success`,detail:H(`components.toast.password_updated`),life:3e3}),Xe.value?.resetForm(),W.logout()}catch(e){V.add({severity:`error`,detail:e,life:3e3})}Z.value=!1}async function Vn(){}async function Hn(e){if(e!==yn.value){if(e){V.add({severity:`info`,detail:H(`views.settings.biometric.enable_hint`),life:3e3});return}bn.value=!0;try{await o(l()),yn.value=!1,V.add({severity:`success`,detail:H(`views.settings.biometric.cleared`),life:3e3})}finally{bn.value=!1}}}return ae(()=>{Vn()}),_({formRef:Ye}),(i,o)=>{let s=te,l=t,u=ge,d=e,p=ve,m=n,h=a,g=Ce,_=re,ae=he,S=ye,ce=c,w=Te,de=ie,k=xe,A=me,M=be,L=ee,R=Se,z=_e,pe=we,B=r;return x(),j(`div`,null,[P(`div`,Qe,[I(U)?(x(),E(I(oe),{key:0,ref_key:`formRef`,ref:Ye,"validation-schema":I(qe),class:`flex flex-col w-full gap-6`},{default:N(()=>[P(`div`,$e,[P(`div`,et,[P(`label`,tt,[F(s,{src:I(J),size:64,"show-border":!1,class:`cursor-pointer`},null,8,[`src`]),P(`input`,{id:`file-input`,type:`file`,class:`hidden`,accept:`image/png,image/jpeg,image/jpg`,onChange:o[0]||=e=>Rn(e)},null,32)])]),P(`span`,nt,C(i.$t(`views.settings.profile`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,rt,[F(I(y),{"model-value":I(G)?.username,name:`username`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,it,C(i.$t(`components.form.label.username`)),1),F(u,null,{default:N(()=>[F(l,O(e,{invalid:t.length>0,type:`text`}),null,16,[`invalid`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`username`,class:`cui-input-error`})]),_:1})]),_:1},8,[`model-value`])])]),_:1})]),P(`div`,null,[P(`span`,at,C(i.$t(`views.settings.password`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,ot,[F(I(y),{name:`password`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,st,C(i.$t(`components.form.label.new_password`)),1),F(u,null,{default:N(()=>[F(p,O({invalid:t.length>0},e,{feedback:!1,"toggle-mask":``}),null,16,[`invalid`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`password`,class:`cui-input-error`})]),_:1})]),_:1}),F(I(y),{name:`passwordConfirm`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,ct,C(i.$t(`components.form.label.new_password_confirm`)),1),F(u,null,{default:N(()=>[F(p,O({invalid:t.length>0},e,{feedback:!1,"toggle-mask":``}),null,16,[`invalid`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`passwordConfirm`,class:`cui-input-error`})]),_:1})]),_:1})])]),_:1})])]),_:1},8,[`validation-schema`])):(x(),j(ue,{key:1},[P(`div`,lt,[P(`div`,ut,[P(`label`,dt,[F(s,{src:I(J),size:64,"show-border":!1,class:`cursor-pointer`},null,8,[`src`]),P(`input`,{id:`file-input`,type:`file`,class:`hidden`,accept:`image/png,image/jpeg,image/jpg`,onChange:o[1]||=e=>Rn(e)},null,32)])]),P(`span`,ft,C(i.$t(`views.settings.profile`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,pt,[P(`div`,mt,[P(`label`,ht,C(i.$t(`components.form.label.username`)),1),F(u,null,{default:N(()=>[F(l,{modelValue:I(Y),"onUpdate:modelValue":o[2]||=e=>T(Y)?Y.value=e:null,loading:I(X),type:`text`},null,8,[`modelValue`,`loading`])]),_:1})]),P(`div`,gt,[F(m,{loading:I(X),class:`cui-button-medium`,label:i.$t(`components.form.button.update_profile`),onClick:zn},null,8,[`loading`,`label`])])])]),_:1})]),P(`div`,null,[P(`span`,_t,C(i.$t(`views.settings.password`)),1),F(d,{class:`cui-card`},{content:N(()=>[F(I(oe),{ref_key:`passwordFormRef`,ref:Xe,"validation-schema":I(Ke),class:`flex flex-col gap-6`,onSubmit:o[3]||=e=>Bn(e)},{default:N(()=>[F(I(y),{name:`password`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,vt,C(i.$t(`components.form.label.new_password`)),1),F(u,null,{default:N(()=>[F(p,O({invalid:t.length>0},e,{loading:I(Z),feedback:!1,"toggle-mask":``}),null,16,[`invalid`,`loading`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`password`,class:`cui-input-error`})]),_:1})]),_:1}),F(I(y),{name:`passwordConfirm`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,yt,C(i.$t(`components.form.label.new_password_confirm`)),1),F(u,null,{default:N(()=>[F(p,O({invalid:t.length>0},e,{loading:I(Z),feedback:!1,"toggle-mask":``}),null,16,[`invalid`,`loading`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`passwordConfirm`,class:`cui-input-error`})]),_:1})]),_:1}),P(`div`,bt,[F(m,{type:`submit`,loading:I(Z),class:`cui-button-medium`,label:i.$t(`components.form.button.change_password`)},null,8,[`loading`,`label`])])]),_:1},8,[`validation-schema`])]),_:1})]),P(`div`,null,[P(`span`,xt,C(i.$t(`views.settings.security.title`)),1),F(d,{class:`cui-card`},{content:N(()=>[I(De)?(x(),j(`div`,St,[F(h,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(x(),E(b,{key:1,name:`fade`,mode:`out-in`},{default:N(()=>[!I(K)?.enabled&&!I(Q)&&!I(Ae)?(x(),j(`div`,Ct,[P(`div`,wt,[P(`span`,Tt,C(i.$t(`views.settings.security.2fa_title`)),1),P(`span`,Et,C(i.$t(`views.settings.security.2fa_description`)),1)]),F(m,{class:`cui-button-medium ml-auto`,label:i.$t(`views.settings.security.setup_2fa`),onClick:Mn},null,8,[`label`])])):!I(K)?.enabled&&I(Ae)?(x(),j(`div`,Dt,[F(h,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`}),P(`span`,Ot,C(i.$t(`views.settings.security.generating_qr`)),1)])):!I(K)?.enabled&&I(Q)?(x(),j(`div`,kt,[P(`div`,At,[F(g,{value:I(wn),size:160,"logo-size":36},null,8,[`value`]),P(`p`,jt,C(i.$t(`views.settings.security.scan_qr`)),1)]),P(`div`,Mt,[P(`div`,Nt,[P(`label`,Pt,C(i.$t(`views.settings.security.manual_entry`)),1),F(u,null,{default:N(()=>[F(l,{"model-value":I(Q)?.secret,readonly:``,class:`font-mono text-sm`},null,8,[`model-value`]),F(ae,null,{default:N(()=>[F(_,{"action-text":i.$t(`components.form.tooltip.copied`),icon:I(f),"button-props":{severity:`secondary`,text:!0},onAction:Tn},null,8,[`action-text`,`icon`])]),_:1})]),_:1})]),P(`div`,Ft,[P(`label`,It,C(i.$t(`views.settings.security.enter_code`)),1),F(S,{modelValue:I($),"onUpdate:modelValue":o[4]||=e=>T($)?$.value=e:null,length:6,"integer-only":``},null,8,[`modelValue`])]),P(`div`,Lt,[F(m,{severity:`secondary`,class:`cui-button-medium`,label:i.$t(`components.form.button.cancel`),onClick:Nn},null,8,[`label`]),F(m,{class:`cui-button-medium`,label:i.$t(`views.settings.security.enable_2fa`),loading:I(Ne),disabled:I($).length<6,onClick:Pn},null,8,[`label`,`loading`,`disabled`])])])])):(x(),j(`div`,Rt,[P(`div`,zt,[P(`div`,Bt,[F(ce,{class:`w-5 h-5`})]),P(`div`,Vt,[P(`span`,Ht,C(i.$t(`views.settings.security.2fa_enabled`)),1)])]),I(K)?.backupCodesCount===void 0?D(``,!0):(x(),j(`div`,Ut,[F(w,{class:`w-4 h-4`}),P(`span`,null,C(i.$t(`views.settings.security.backup_codes_remaining`,{count:I(K).backupCodesCount})),1)])),P(`div`,Wt,[F(m,{severity:`secondary`,class:`cui-button-medium`,label:i.$t(`views.settings.security.regenerate_backup`),onClick:In},null,8,[`label`]),F(m,{severity:`danger`,class:`cui-button-medium`,label:i.$t(`views.settings.security.disable_2fa`),onClick:Fn},null,8,[`label`])])]))]),_:1}))]),_:1})]),I(xn)?(x(),j(`div`,Gt,[P(`span`,Kt,C(i.$t(`views.settings.biometric.title`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,qt,[F(de,{class:`shrink-0 w-6 h-6 text-color`}),P(`div`,Jt,[P(`span`,Yt,C(i.$t(`views.settings.biometric.label`)),1),F(k,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-switch-hint`},{default:N(()=>[le(C(i.$t(`views.settings.biometric.description`)),1)]),_:1})]),F(A,{"model-value":I(yn),loading:I(bn),class:`ml-auto shrink-0`,"onUpdate:modelValue":Hn},null,8,[`model-value`,`loading`])])]),_:1})])):D(``,!0),P(`div`,null,[P(`span`,Xt,C(i.$t(`views.settings.api_tokens.title`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,Zt,[P(`span`,Qt,C(i.$t(`views.settings.api_tokens.info`)),1),F(R,{value:I(ze)??[],"data-key":`id`,loading:I(Ve),pt:Sn,"striped-rows":``,scrollable:``},{loading:N(()=>[F(h,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})]),empty:N(()=>[P(`span`,$t,C(i.$t(`views.settings.api_tokens.empty`)),1)]),default:N(()=>[F(M,{field:`name`,header:i.$t(`views.settings.api_tokens.name_label`),"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7`},{body:N(({data:e})=>[P(`div`,en,[F(I(ke),{class:`cui-session-icon`}),P(`div`,tn,[P(`span`,nn,C(e.name),1),P(`span`,rn,C(e.token_hint),1)])])]),_:1},8,[`header`]),F(M,{field:`last_seen_at`,header:i.$t(`views.settings.api_tokens.last_used`),"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7`},{body:N(({data:e})=>[P(`span`,an,C(e.last_seen_at>e.created_at?I(ne)(e.last_seen_at):i.$t(`views.settings.api_tokens.never`)),1)]),_:1},8,[`header`]),F(M,{field:`action`,"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7 text-right`},{body:N(({data:e})=>[fe((x(),E(m,{severity:`danger`,text:``,rounded:``,class:`cui-icon-md`,loading:I(vn)===e.id,onClick:t=>An(e)},{icon:N(()=>[F(L,{width:`100%`,height:`100%`})]),_:1},8,[`loading`,`onClick`])),[[B,{value:i.$t(`views.settings.api_tokens.revoke`)}]])]),_:1})]),_:1},8,[`value`,`loading`]),P(`div`,on,[F(m,{loading:I(We),class:`cui-button-medium mr-4 md:mr-0`,label:i.$t(`views.settings.api_tokens.create`),onClick:On},null,8,[`loading`,`label`])])])]),_:1})]),P(`div`,null,[P(`span`,sn,C(i.$t(`views.settings.active_sessions.title`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,cn,[F(R,{value:I(Pe)??[],"data-key":`id`,loading:I(Fe),pt:Sn,"striped-rows":``,scrollable:``},{loading:N(()=>[F(h,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})]),empty:N(()=>[P(`span`,ln,C(i.$t(`views.settings.active_sessions.empty`)),1)]),default:N(()=>[F(M,{field:`device`,header:i.$t(`views.settings.title_device`),"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7`},{body:N(({data:e})=>[P(`div`,un,[(x(),E(se(En(e.device.kind)),{class:`cui-session-icon`})),P(`div`,dn,[P(`div`,fn,[P(`span`,pn,C(e.device.name),1),e.is_current?(x(),E(z,{key:0,severity:`success`,value:i.$t(`views.settings.active_sessions.this_device`),class:`cui-session-tag`},null,8,[`value`])):D(``,!0)]),P(`span`,mn,C(e.device.ip||`—`),1)])])]),_:1},8,[`header`]),F(M,{field:`action`,"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7 text-right`},{body:N(({data:e})=>[e.is_current?D(``,!0):fe((x(),E(m,{key:0,severity:`danger`,text:``,rounded:``,class:`cui-icon-md`,loading:I(gn)===e.id,onClick:t=>Dn(e.id)},{icon:N(()=>[F(pe,{width:`100%`,height:`100%`})]),_:1},8,[`loading`,`onClick`])),[[B,{value:i.$t(`views.settings.active_sessions.revoke`)}]])]),_:1})]),_:1},8,[`value`,`loading`]),I(Cn)>0?(x(),j(`div`,hn,[F(m,{loading:I(_n),class:`cui-button-medium mr-4 md:mr-0`,label:i.$t(`views.settings.active_sessions.revoke_all_others`,{count:I(Cn)}),onClick:jn},null,8,[`loading`,`label`])])):D(``,!0)])]),_:1})])],64))])])}}}),[[`__scopeId`,`data-v-2ec387ac`]]);export{Y as t};
|
|
1
|
+
import{F as e,O as t,Ot as n,Pt as r,kr as i,wt as a}from"./vendor-cameraui-CywDBRLD.js";import{A as o,E as s,Et as c,Fn as l,G as u,Gn as d,L as ee,Wt as te,et as f,h as p,i as m,l as ne,m as h,nn as g,tt as re,yn as ie}from"./api-BwUGcpse.js";import{Bn as _,I as v,In as ae,L as y,Qt as b,R as oe,Rn as x,Tn as S,Tr as C,Wn as se,Xn as ce,_n as le,an as ue,bn as w,cr as T,dn as E,fn as D,gr as de,kn as O,ln as k,lr as A,nr as fe,pn as j,pr as M,tr as N,un as P,vn as F,xr as I,yr as L}from"./vendor-CdGy-Xet.js";import{n as R,r as z}from"./vendor-zod-BaT-dXMv.js";import{p as pe}from"./vendor-core-0Lu3l40a.js";import{K as me,L as he,R as ge,a as _e,s as ve,u as ye,x as be,z as xe}from"./vendor-primevue-Cm1rEh62.js";import{t as Se}from"./CuiDataTable-DQRKmdcE.js";import{t as Ce}from"./CuiQRCode-l-PLLptq.js";import{t as B}from"./auth-Dgn4npDp.js";var V={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function H(e,t){return x(),j(`svg`,V,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`m17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5M4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z`},null,-1)]])}var we=A({name:`mdi-logout`,render:H}),U={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function W(e,t){return x(),j(`svg`,U,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`M7 14c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2m5.6-4c-.8-2.3-3-4-5.6-4c-3.3 0-6 2.7-6 6s2.7 6 6 6c2.6 0 4.8-1.7 5.6-4H16v4h4v-4h3v-4z`},null,-1)]])}var Te=A({name:`mdi-key`,render:W}),G={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function K(e,t){return x(),j(`svg`,G,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`M17 19H7V5h10m0-4H7c-1.11 0-2 .89-2 2v18a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2`},null,-1)]])}var Ee=A({name:`mdi-cellphone`,render:K}),De={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Oe(e,t){return x(),j(`svg`,De,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`M22 18v4h-4v-3h-3v-3h-3l-2.26-2.26c-.55.17-1.13.26-1.74.26a6 6 0 0 1-6-6a6 6 0 0 1 6-6a6 6 0 0 1 6 6c0 .61-.09 1.19-.26 1.74zM7 5a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2`},null,-1)]])}var ke=A({name:`mdi-key-variant`,render:Oe}),Ae={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function je(e,t){return x(),j(`svg`,Ae,[...t[0]||=[P(`path`,{fill:`currentColor`,d:`M4 6h16v10H4m16 2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4c-1.11 0-2 .89-2 2v10a2 2 0 0 0 2 2H0v2h24v-2z`},null,-1)]])}var Me=A({name:`mdi-laptop`,render:je}),Ne={class:`flex flex-col gap-6`},Pe={class:`token-box`},Fe={class:`token-value`},Ie=g(w({__name:`ApiTokenCreated`,props:{token:{}},setup(e,{expose:t}){let a=e,o=d(),{t:s}=i(),{token:c}=L(a);async function l(){await m(c.value)?o.add({severity:`success`,detail:s(`components.toast.copied`),life:1500}):o.add({severity:`error`,detail:s(`components.toast.copy_failed`),life:3e3})}async function u(){}return t({onConfirm:u}),(e,t)=>{let i=xe,a=n,o=r;return x(),j(`div`,Ne,[F(i,{severity:`warn`},{default:N(()=>[le(C(e.$t(`views.settings.api_tokens.created_warning`)),1)]),_:1}),P(`div`,Pe,[P(`span`,Fe,C(I(c)),1),fe((x(),E(a,{text:``,rounded:``,class:`cui-icon-md shrink-0`,onClick:l},{icon:N(()=>[F(I(f),{width:`100%`,height:`100%`})]),_:1})),[[o,{value:e.$t(`components.form.button.copy`)}]])])])}}}),[[`__scopeId`,`data-v-591cfcb4`]]),Le={class:`flex flex-col gap-2 w-full`},Re={for:`apiTokenName`,class:`cui-label`},ze={key:0,class:`text-xs text-red-500`},Be=w({__name:`CreateApiToken`,props:{existingNames:{}},setup(e,{expose:n}){let r=e,i=M(``),a=k(()=>r.existingNames.includes(i.value.trim()));return n({onConfirm:async()=>{let e=i.value.trim();return!e||a.value?null:e}}),(e,n)=>{let r=t;return x(),j(`div`,Le,[P(`label`,Re,C(e.$t(`views.settings.api_tokens.name_label`)),1),F(r,{id:`apiTokenName`,modelValue:I(i),"onUpdate:modelValue":n[0]||=e=>T(i)?i.value=e:null,class:`w-full`,placeholder:e.$t(`views.settings.api_tokens.name_placeholder`),autofocus:``,invalid:I(a)},null,8,[`modelValue`,`placeholder`,`invalid`]),I(a)?(x(),j(`span`,ze,C(e.$t(`views.settings.api_tokens.name_exists`)),1)):D(``,!0)])}}}),Ve={class:`flex flex-col gap-6`},He={class:`backup-codes-grid`},Ue=g(w({__name:`TwoFactorBackupCodes`,props:{backupCodes:{}},setup(e,{expose:t}){let{backupCodes:n}=L(e);async function r(){}return t({onConfirm:r}),(e,t)=>{let r=xe;return x(),j(`div`,Ve,[F(r,{severity:`warn`},{default:N(()=>[le(C(e.$t(`views.settings.security.backup_warning`)),1)]),_:1}),P(`div`,He,[(x(!0),j(ue,null,_(I(n),e=>(x(),j(`span`,{key:e,class:`backup-code`},C(e),1))),128))])])}}}),[[`__scopeId`,`data-v-0761a2ae`]]),We={class:`flex flex-col gap-6`},Ge={class:`text-muted`},Ke={class:`flex flex-col gap-2 justify-center items-center mt-5`},qe={class:`cui-label`},Je=w({__name:`TwoFactorDisable`,setup(e,{expose:t}){let n=new B,r=d(),{t:a}=i(),o=S(`dialogRefProps`),{mutateAsync:s,isPending:c}=n.disable2FAQuery(),l=M(``),u=k(()=>!!(o.loading?.value||c.value)),ee=k(()=>l.value.length<6);async function te(){if(l.value.length<6)return null;try{await s({code:l.value}),r.add({severity:`success`,detail:a(`views.settings.security.2fa_disabled_success`),life:3e3})}catch(e){return r.add({severity:`error`,detail:e,life:3e3}),null}}return t({isLoading:u,isDisabled:ee,onConfirm:te}),(e,t)=>{let n=ye;return x(),j(`div`,We,[P(`p`,Ge,C(e.$t(`views.settings.security.disable_confirm`)),1),P(`div`,Ke,[P(`label`,qe,C(e.$t(`views.settings.security.enter_code`)),1),F(n,{modelValue:I(l),"onUpdate:modelValue":t[0]||=e=>T(l)?l.value=e:null,length:6,"integer-only":``,class:`justify-center`},null,8,[`modelValue`])])])}}}),Ye={class:`flex flex-col gap-6`},Xe={class:`text-muted`},q={class:`flex flex-col gap-2 justify-center items-center mt-5`},J={class:`cui-label`},Ze=w({__name:`TwoFactorRegenerate`,props:{onBackupCodesGenerated:{type:Function}},setup(e,{expose:t}){let n=new B,r=e,a=d(),{t:o}=i(),s=S(`dialogRefProps`),{mutateAsync:c,isPending:l}=n.regenerateBackupCodesQuery(),u=M(``),ee=k(()=>!!(s.loading?.value||l.value)),te=k(()=>u.value.length<6);async function f(){if(u.value.length<6)return null;try{let e=await c({code:u.value});a.add({severity:`success`,detail:o(`views.settings.security.backup_regenerated`),life:3e3}),r.onBackupCodesGenerated&&r.onBackupCodesGenerated(e.backupCodes)}catch(e){return a.add({severity:`error`,detail:e,life:3e3}),null}}return t({isLoading:ee,isDisabled:te,onConfirm:f}),(e,t)=>{let n=ye;return x(),j(`div`,Ye,[P(`p`,Xe,C(e.$t(`views.settings.security.regenerate_confirm`)),1),P(`div`,q,[P(`label`,J,C(e.$t(`views.settings.security.enter_code`)),1),F(n,{modelValue:I(u),"onUpdate:modelValue":t[0]||=e=>T(u)?u.value=e:null,length:6,"integer-only":``,class:`justify-center`},null,8,[`modelValue`])])])}}}),Qe={class:`flex flex-col w-full gap-6`},$e={class:`relative`},et={class:`image-upload rounded-full z-1`},tt={for:`file-input`},nt={class:`card-title`},rt={class:`flex flex-col gap-6`},it={for:`username`,class:`cui-label`},at={class:`card-title`},ot={class:`flex flex-col gap-6`},st={for:`password`,class:`cui-label`},ct={for:`passwordConfirm`,class:`cui-label`},lt={class:`relative`},ut={class:`image-upload rounded-full z-1`},dt={for:`file-input`},ft={class:`card-title`},pt={class:`flex flex-col gap-6`},mt={class:`flex flex-col field-gap`},ht={for:`username`,class:`cui-label`},gt={class:`flex flex-row items-end justify-end`},_t={class:`card-title`},vt={for:`password`,class:`cui-label`},yt={for:`passwordConfirm`,class:`cui-label`},bt={class:`flex flex-row items-end justify-end`},xt={class:`card-title`},St={key:0,class:`flex justify-center py-6`},Ct={key:`initial`,class:`flex flex-col gap-6`},wt={class:`flex flex-col gap-1`},Tt={class:`tfa-row-title`},Et={class:`tfa-row-description`},Dt={key:`loading`,class:`flex flex-col items-center py-8 gap-3`},Ot={class:`text-sm text-muted`},kt={key:`setup`,class:`tfa-setup`},At={class:`tfa-setup-qr`},jt={class:`text-sm text-muted text-center mt-3`},Mt={class:`flex flex-col gap-5 flex-1`},Nt={class:`flex flex-col field-gap`},Pt={class:`cui-label`},Ft={class:`flex flex-col field-gap`},It={class:`cui-label`},Lt={class:`flex gap-2 justify-end`},Rt={key:`enabled`,class:`flex flex-col gap-6`},zt={class:`tfa-row tfa-row-enabled`},Bt={class:`tfa-status-icon`},Vt={class:`tfa-row-content`},Ht={class:`tfa-row-title`},Ut={key:0,class:`tfa-backup-info`},Wt={class:`flex gap-2 justify-end`},Gt={key:0},Kt={class:`card-title`},qt={class:`flex items-center gap-4`},Jt={class:`flex flex-col field-switch-gap min-w-0`},Yt={class:`text-sm font-bold text-color`},Xt={class:`card-title`},Zt={class:`flex flex-col gap-6`},Qt={class:`text-sm text-muted`},$t={class:`text-muted text-sm`},en={class:`flex items-center gap-3`},tn={class:`flex flex-col min-w-0`},nn={class:`text-sm font-semibold text-color truncate`},rn={class:`text-xs text-muted truncate font-mono`},an={class:`text-xs text-muted`},on={class:`flex flex-row items-end justify-end gap-2`},sn={class:`card-title`},cn={class:`flex flex-col gap-6`},ln={class:`text-muted text-sm`},un={class:`flex items-center gap-3`},dn={class:`flex flex-col min-w-0`},fn={class:`flex items-center gap-2`},pn={class:`text-sm font-semibold text-color truncate`},mn={class:`text-xs text-muted truncate`},hn={key:0,class:`flex flex-row items-end justify-end gap-2`},Y=g(w({__name:`SettingsAccount`,props:{firststeps:{type:Boolean}},setup(g,{expose:_}){let S=new B,w=g,A=u(),V=d(),{t:H}=i(),{firststeps:U}=L(w),W=p(),{user:G}=pe(W),{data:K,isLoading:De}=S.toggleQueryActivator(`get2FAStatusQuery`,!U.value).get2FAStatusQuery(),{mutateAsync:Oe,isPending:Ae}=S.setup2FAQuery(),{mutateAsync:je,isPending:Ne}=S.enable2FAQuery(),{data:Pe,isBusy:Fe}=S.toggleQueryActivator(`listSessionsQuery`,!U.value).listSessionsQuery({page:1,pageSize:-1}),{mutateAsync:Le}=S.revokeSessionQuery(),{mutateAsync:Re}=S.revokeOtherSessionsQuery(),{data:ze,isBusy:Ve}=S.toggleQueryActivator(`listApiTokensQuery`,!U.value).listApiTokensQuery(),{mutateAsync:He,isPending:We}=S.createApiTokenQuery(),{mutateAsync:Ge}=S.revokeApiTokenQuery(),Ke=R({password:s,passwordConfirm:z().min(1)}).refine(e=>e.password===e.passwordConfirm,{message:`Passwords do not match`,path:[`passwordConfirm`]}),qe=R({username:z().min(1),password:s,passwordConfirm:z().min(1)}).refine(e=>e.password===e.passwordConfirm,{message:`Passwords do not match`,path:[`passwordConfirm`]}),Ye=ce(`formRef`),Xe=ce(`passwordFormRef`),q=de(),J=M(`avatar`),Y=M(G.value?.username??``),X=M(!1),Z=M(!1),Q=M(null),$=M(``),gn=M(null),_n=M(!1),vn=M(null);M(!1);let yn=M(!1),bn=M(!1),xn=k(()=>!1),Sn={bodyRow:{class:`text-sm text-secondary`},column:{columnTitle:{class:`text-sm`}}},Cn=k(()=>(Pe.value??[]).filter(e=>!e.is_current).length),wn=k(()=>!Q.value?.secret||!G.value?.username?``:`otpauth://totp/${encodeURIComponent(`camera.ui:${G.value.username}`)}?secret=${Q.value.secret}&issuer=camera.ui`);async function Tn(){Q.value?.secret&&await m(Q.value.secret)}function En(e){return e===`native`?Ee:Me}async function Dn(e){gn.value=e;try{await Le({id:e})}catch(e){V.add({severity:`error`,detail:e,life:3e3})}finally{gn.value=null}}function On(){A.openComponentDialog(Be,{data:{title:H(`views.settings.api_tokens.create`),confirmText:H(`views.settings.api_tokens.create_confirm`),contentProps:{existingNames:(ze.value??[]).map(e=>e.name)}},onConfirm:async e=>{if(e)try{kn((await He({name:e})).token)}catch(e){V.add({severity:`error`,detail:e,life:3e3})}}})}function kn(e){A.openComponentDialog(Ie,{data:{title:H(`views.settings.api_tokens.created_title`),confirmText:H(`components.form.button.close`),hideCancelButton:!0,contentProps:{token:e}}})}function An(e){A.openTextDialog({data:{title:H(`views.settings.api_tokens.revoke_title`),contentText:H(`views.settings.api_tokens.revoke_confirm`,{name:e.name}),confirmText:H(`views.settings.api_tokens.revoke`),confirmButtonProps:{severity:`danger`}},onConfirm:async()=>{vn.value=e.id;try{await Ge({id:e.id})}catch(e){V.add({severity:`error`,detail:e,life:3e3})}finally{vn.value=null}}})}function jn(){A.openTextDialog({data:{title:H(`views.settings.active_sessions.revoke_others_title`),contentText:H(`views.settings.active_sessions.revoke_others_confirm`,{count:Cn.value}),confirmText:H(`views.settings.active_sessions.revoke`),confirmButtonProps:{severity:`danger`}},onConfirm:async()=>{_n.value=!0;try{await Re()}catch(e){V.add({severity:`error`,detail:e,life:3e3})}finally{_n.value=!1}}})}async function Mn(){try{Q.value=await Oe()}catch(e){V.add({severity:`error`,detail:e,life:3e3})}}function Nn(){Q.value=null,$.value=``}async function Pn(){try{let e=await je({code:$.value});Q.value=null,$.value=``,V.add({severity:`success`,detail:H(`views.settings.security.2fa_enabled_success`),life:3e3}),Ln(e.backupCodes)}catch(e){V.add({severity:`error`,detail:e,life:3e3})}}function Fn(){A.openComponentDialog(Je,{data:{title:H(`views.settings.security.disable_2fa`),confirmText:H(`views.settings.security.disable_2fa`),confirmButtonProps:{severity:`danger`},contentProps:{}}})}function In(){A.openComponentDialog(Ze,{data:{title:H(`views.settings.security.regenerate_backup`),confirmText:H(`views.settings.security.regenerate_backup`),contentProps:{onBackupCodesGenerated:e=>{Ln(e)}}}})}function Ln(e){A.openComponentDialog(Ue,{data:{title:H(`views.settings.security.backup_codes`),confirmText:H(`components.form.button.close`),hideCancelButton:!0,contentProps:{backupCodes:e}}})}async function Rn(e){let t=e.target?.files;q.value=t?.[0],J.value=await h(e)??J.value}async function zn(){X.value=!0;try{let e;q.value&&(e=new FormData,e.append(`upload`,q.value));let t=G.value?.username!==Y.value;if(t)await W.updateUser({username:Y.value},e);else if(e)await W.updateUser(void 0,e);else{X.value=!1;return}V.add({severity:`success`,detail:H(`components.toast.profile_updated`),life:3e3}),q.value=void 0,t&&W.logout()}catch{}X.value=!1}async function Bn(e){Z.value=!0;try{await W.updateUser({password:e.password,passwordConfirm:e.passwordConfirm}),V.add({severity:`success`,detail:H(`components.toast.password_updated`),life:3e3}),Xe.value?.resetForm(),W.logout()}catch(e){V.add({severity:`error`,detail:e,life:3e3})}Z.value=!1}async function Vn(){}async function Hn(e){if(e!==yn.value){if(e){V.add({severity:`info`,detail:H(`views.settings.biometric.enable_hint`),life:3e3});return}bn.value=!0;try{await o(l()),yn.value=!1,V.add({severity:`success`,detail:H(`views.settings.biometric.cleared`),life:3e3})}finally{bn.value=!1}}}return ae(()=>{Vn()}),_({formRef:Ye}),(i,o)=>{let s=te,l=t,u=ge,d=e,p=ve,m=n,h=a,g=Ce,_=re,ae=he,S=ye,ce=c,w=Te,de=ie,k=xe,A=me,M=be,L=ee,R=Se,z=_e,pe=we,B=r;return x(),j(`div`,null,[P(`div`,Qe,[I(U)?(x(),E(I(oe),{key:0,ref_key:`formRef`,ref:Ye,"validation-schema":I(qe),class:`flex flex-col w-full gap-6`},{default:N(()=>[P(`div`,$e,[P(`div`,et,[P(`label`,tt,[F(s,{src:I(J),size:64,"show-border":!1,class:`cursor-pointer`},null,8,[`src`]),P(`input`,{id:`file-input`,type:`file`,class:`hidden`,accept:`image/png,image/jpeg,image/jpg`,onChange:o[0]||=e=>Rn(e)},null,32)])]),P(`span`,nt,C(i.$t(`views.settings.profile`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,rt,[F(I(y),{"model-value":I(G)?.username,name:`username`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,it,C(i.$t(`components.form.label.username`)),1),F(u,null,{default:N(()=>[F(l,O(e,{invalid:t.length>0,type:`text`}),null,16,[`invalid`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`username`,class:`cui-input-error`})]),_:1})]),_:1},8,[`model-value`])])]),_:1})]),P(`div`,null,[P(`span`,at,C(i.$t(`views.settings.password`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,ot,[F(I(y),{name:`password`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,st,C(i.$t(`components.form.label.new_password`)),1),F(u,null,{default:N(()=>[F(p,O({invalid:t.length>0},e,{feedback:!1,"toggle-mask":``}),null,16,[`invalid`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`password`,class:`cui-input-error`})]),_:1})]),_:1}),F(I(y),{name:`passwordConfirm`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,ct,C(i.$t(`components.form.label.new_password_confirm`)),1),F(u,null,{default:N(()=>[F(p,O({invalid:t.length>0},e,{feedback:!1,"toggle-mask":``}),null,16,[`invalid`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`passwordConfirm`,class:`cui-input-error`})]),_:1})]),_:1})])]),_:1})])]),_:1},8,[`validation-schema`])):(x(),j(ue,{key:1},[P(`div`,lt,[P(`div`,ut,[P(`label`,dt,[F(s,{src:I(J),size:64,"show-border":!1,class:`cursor-pointer`},null,8,[`src`]),P(`input`,{id:`file-input`,type:`file`,class:`hidden`,accept:`image/png,image/jpeg,image/jpg`,onChange:o[1]||=e=>Rn(e)},null,32)])]),P(`span`,ft,C(i.$t(`views.settings.profile`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,pt,[P(`div`,mt,[P(`label`,ht,C(i.$t(`components.form.label.username`)),1),F(u,null,{default:N(()=>[F(l,{modelValue:I(Y),"onUpdate:modelValue":o[2]||=e=>T(Y)?Y.value=e:null,loading:I(X),type:`text`},null,8,[`modelValue`,`loading`])]),_:1})]),P(`div`,gt,[F(m,{loading:I(X),class:`cui-button-medium`,label:i.$t(`components.form.button.update_profile`),onClick:zn},null,8,[`loading`,`label`])])])]),_:1})]),P(`div`,null,[P(`span`,_t,C(i.$t(`views.settings.password`)),1),F(d,{class:`cui-card`},{content:N(()=>[F(I(oe),{ref_key:`passwordFormRef`,ref:Xe,"validation-schema":I(Ke),class:`flex flex-col gap-6`,onSubmit:o[3]||=e=>Bn(e)},{default:N(()=>[F(I(y),{name:`password`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,vt,C(i.$t(`components.form.label.new_password`)),1),F(u,null,{default:N(()=>[F(p,O({invalid:t.length>0},e,{loading:I(Z),feedback:!1,"toggle-mask":``}),null,16,[`invalid`,`loading`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`password`,class:`cui-input-error`})]),_:1})]),_:1}),F(I(y),{name:`passwordConfirm`,as:`div`,class:`flex flex-col field-gap`},{default:N(({field:e,errors:t})=>[P(`label`,yt,C(i.$t(`components.form.label.new_password_confirm`)),1),F(u,null,{default:N(()=>[F(p,O({invalid:t.length>0},e,{loading:I(Z),feedback:!1,"toggle-mask":``}),null,16,[`invalid`,`loading`])]),_:2},1024),F(b,{name:`fade`},{default:N(()=>[F(I(v),{name:`passwordConfirm`,class:`cui-input-error`})]),_:1})]),_:1}),P(`div`,bt,[F(m,{type:`submit`,loading:I(Z),class:`cui-button-medium`,label:i.$t(`components.form.button.change_password`)},null,8,[`loading`,`label`])])]),_:1},8,[`validation-schema`])]),_:1})]),P(`div`,null,[P(`span`,xt,C(i.$t(`views.settings.security.title`)),1),F(d,{class:`cui-card`},{content:N(()=>[I(De)?(x(),j(`div`,St,[F(h,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])):(x(),E(b,{key:1,name:`fade`,mode:`out-in`},{default:N(()=>[!I(K)?.enabled&&!I(Q)&&!I(Ae)?(x(),j(`div`,Ct,[P(`div`,wt,[P(`span`,Tt,C(i.$t(`views.settings.security.2fa_title`)),1),P(`span`,Et,C(i.$t(`views.settings.security.2fa_description`)),1)]),F(m,{class:`cui-button-medium ml-auto`,label:i.$t(`views.settings.security.setup_2fa`),onClick:Mn},null,8,[`label`])])):!I(K)?.enabled&&I(Ae)?(x(),j(`div`,Dt,[F(h,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`}),P(`span`,Ot,C(i.$t(`views.settings.security.generating_qr`)),1)])):!I(K)?.enabled&&I(Q)?(x(),j(`div`,kt,[P(`div`,At,[F(g,{value:I(wn),size:160,"logo-size":36},null,8,[`value`]),P(`p`,jt,C(i.$t(`views.settings.security.scan_qr`)),1)]),P(`div`,Mt,[P(`div`,Nt,[P(`label`,Pt,C(i.$t(`views.settings.security.manual_entry`)),1),F(u,null,{default:N(()=>[F(l,{"model-value":I(Q)?.secret,readonly:``,class:`font-mono text-sm`},null,8,[`model-value`]),F(ae,null,{default:N(()=>[F(_,{"action-text":i.$t(`components.form.tooltip.copied`),icon:I(f),"button-props":{severity:`secondary`,text:!0},onAction:Tn},null,8,[`action-text`,`icon`])]),_:1})]),_:1})]),P(`div`,Ft,[P(`label`,It,C(i.$t(`views.settings.security.enter_code`)),1),F(S,{modelValue:I($),"onUpdate:modelValue":o[4]||=e=>T($)?$.value=e:null,length:6,"integer-only":``},null,8,[`modelValue`])]),P(`div`,Lt,[F(m,{severity:`secondary`,class:`cui-button-medium`,label:i.$t(`components.form.button.cancel`),onClick:Nn},null,8,[`label`]),F(m,{class:`cui-button-medium`,label:i.$t(`views.settings.security.enable_2fa`),loading:I(Ne),disabled:I($).length<6,onClick:Pn},null,8,[`label`,`loading`,`disabled`])])])])):(x(),j(`div`,Rt,[P(`div`,zt,[P(`div`,Bt,[F(ce,{class:`w-5 h-5`})]),P(`div`,Vt,[P(`span`,Ht,C(i.$t(`views.settings.security.2fa_enabled`)),1)])]),I(K)?.backupCodesCount===void 0?D(``,!0):(x(),j(`div`,Ut,[F(w,{class:`w-4 h-4`}),P(`span`,null,C(i.$t(`views.settings.security.backup_codes_remaining`,{count:I(K).backupCodesCount})),1)])),P(`div`,Wt,[F(m,{severity:`secondary`,class:`cui-button-medium`,label:i.$t(`views.settings.security.regenerate_backup`),onClick:In},null,8,[`label`]),F(m,{severity:`danger`,class:`cui-button-medium`,label:i.$t(`views.settings.security.disable_2fa`),onClick:Fn},null,8,[`label`])])]))]),_:1}))]),_:1})]),I(xn)?(x(),j(`div`,Gt,[P(`span`,Kt,C(i.$t(`views.settings.biometric.title`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,qt,[F(de,{class:`shrink-0 w-6 h-6 text-color`}),P(`div`,Jt,[P(`span`,Yt,C(i.$t(`views.settings.biometric.label`)),1),F(k,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-switch-hint`},{default:N(()=>[le(C(i.$t(`views.settings.biometric.description`)),1)]),_:1})]),F(A,{"model-value":I(yn),loading:I(bn),class:`ml-auto shrink-0`,"onUpdate:modelValue":Hn},null,8,[`model-value`,`loading`])])]),_:1})])):D(``,!0),P(`div`,null,[P(`span`,Xt,C(i.$t(`views.settings.api_tokens.title`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,Zt,[P(`span`,Qt,C(i.$t(`views.settings.api_tokens.info`)),1),F(R,{value:I(ze)??[],"data-key":`id`,loading:I(Ve),pt:Sn,"striped-rows":``,scrollable:``},{loading:N(()=>[F(h,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})]),empty:N(()=>[P(`span`,$t,C(i.$t(`views.settings.api_tokens.empty`)),1)]),default:N(()=>[F(M,{field:`name`,header:i.$t(`views.settings.api_tokens.name_label`),"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7`},{body:N(({data:e})=>[P(`div`,en,[F(I(ke),{class:`cui-session-icon`}),P(`div`,tn,[P(`span`,nn,C(e.name),1),P(`span`,rn,C(e.token_hint),1)])])]),_:1},8,[`header`]),F(M,{field:`last_seen_at`,header:i.$t(`views.settings.api_tokens.last_used`),"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7`},{body:N(({data:e})=>[P(`span`,an,C(e.last_seen_at>e.created_at?I(ne)(e.last_seen_at):i.$t(`views.settings.api_tokens.never`)),1)]),_:1},8,[`header`]),F(M,{field:`action`,"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7 text-right`},{body:N(({data:e})=>[fe((x(),E(m,{severity:`danger`,text:``,rounded:``,class:`cui-icon-md`,loading:I(vn)===e.id,onClick:t=>An(e)},{icon:N(()=>[F(L,{width:`100%`,height:`100%`})]),_:1},8,[`loading`,`onClick`])),[[B,{value:i.$t(`views.settings.api_tokens.revoke`)}]])]),_:1})]),_:1},8,[`value`,`loading`]),P(`div`,on,[F(m,{loading:I(We),class:`cui-button-medium mr-4 md:mr-0`,label:i.$t(`views.settings.api_tokens.create`),onClick:On},null,8,[`loading`,`label`])])])]),_:1})]),P(`div`,null,[P(`span`,sn,C(i.$t(`views.settings.active_sessions.title`)),1),F(d,{class:`cui-card`},{content:N(()=>[P(`div`,cn,[F(R,{value:I(Pe)??[],"data-key":`id`,loading:I(Fe),pt:Sn,"striped-rows":``,scrollable:``},{loading:N(()=>[F(h,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})]),empty:N(()=>[P(`span`,ln,C(i.$t(`views.settings.active_sessions.empty`)),1)]),default:N(()=>[F(M,{field:`device`,header:i.$t(`views.settings.title_device`),"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7`},{body:N(({data:e})=>[P(`div`,un,[(x(),E(se(En(e.device.kind)),{class:`cui-session-icon`})),P(`div`,dn,[P(`div`,fn,[P(`span`,pn,C(e.device.name),1),e.is_current?(x(),E(z,{key:0,severity:`success`,value:i.$t(`views.settings.active_sessions.this_device`),class:`cui-session-tag`},null,8,[`value`])):D(``,!0)]),P(`span`,mn,C(e.device.ip||`—`),1)])])]),_:1},8,[`header`]),F(M,{field:`action`,"header-class":`p-2 h-7 min-h-7 max-h-7`,class:`p-2 h-7 min-h-7 max-h-7 text-right`},{body:N(({data:e})=>[e.is_current?D(``,!0):fe((x(),E(m,{key:0,severity:`danger`,text:``,rounded:``,class:`cui-icon-md`,loading:I(gn)===e.id,onClick:t=>Dn(e.id)},{icon:N(()=>[F(pe,{width:`100%`,height:`100%`})]),_:1},8,[`loading`,`onClick`])),[[B,{value:i.$t(`views.settings.active_sessions.revoke`)}]])]),_:1})]),_:1},8,[`value`,`loading`]),I(Cn)>0?(x(),j(`div`,hn,[F(m,{loading:I(_n),class:`cui-button-medium mr-4 md:mr-0`,label:i.$t(`views.settings.active_sessions.revoke_all_others`,{count:I(Cn)}),onClick:jn},null,8,[`loading`,`label`])])):D(``,!0)])]),_:1})])],64))])])}}}),[[`__scopeId`,`data-v-2ec387ac`]]);export{Y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./SettingsAccount-BhCf1XAp.js";export{e as default};
|