@camera.ui/server 2.1.12 → 2.1.14-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (627) hide show
  1. package/dist/interface/assets/{404-BDi1TzED.js → 404-CVkDpT0X.js} +1 -1
  2. package/dist/interface/assets/{About-DeHiJp3n.js → About-CUgIR2xi.js} +1 -1
  3. package/dist/interface/assets/Automation-BYRKp0AC.js +3 -0
  4. package/dist/interface/assets/{AutomationImport-B3bCE-yS.js → AutomationImport-L_OzZZgi.js} +2 -2
  5. package/dist/interface/assets/{AutomationStore-BoWd7IW9.js → AutomationStore-DaNQqJoT.js} +2 -2
  6. package/dist/interface/assets/AutomationStoreDetail-Seor4Ohh.js +2 -0
  7. package/dist/interface/assets/Automations-BMQIkpUa.js +2 -0
  8. package/dist/interface/assets/Camera-3umh2Xjc.js +2 -0
  9. package/dist/interface/assets/{CameraConsole-C8XSUr7X.js → CameraConsole-BLlgkKDp.js} +2 -2
  10. package/dist/interface/assets/Cameras-DvK8E1Vk.js +651 -0
  11. package/dist/interface/assets/{Camview-Lp3QU0de.css → Camview-DIEa8IRE.css} +1 -1
  12. package/dist/interface/assets/Camview-DSO2lWxT.js +1 -0
  13. package/dist/interface/assets/{CertificateUpload-Cg89m_cM.js → CertificateUpload-BsnlaxRS.js} +1 -1
  14. package/dist/interface/assets/{Config-BDa4dy1w.js → Config-BXj83-No.js} +1 -1
  15. package/dist/interface/assets/{ConfigActionCameraControl-DNmRpuPG.js → ConfigActionCameraControl-BGfvT6ME.js} +1 -1
  16. package/dist/interface/assets/{ConfigActionDelay-Reg_tEG_.js → ConfigActionDelay-D10_C6yo.js} +1 -1
  17. package/dist/interface/assets/{ConfigActionHttp-CqRBOSa3.js → ConfigActionHttp-DL4jh9Wz.js} +1 -1
  18. package/dist/interface/assets/{ConfigActionImageInput-GWECLY4I.js → ConfigActionImageInput-DVvMUzrT.js} +1 -1
  19. package/dist/interface/assets/{ConfigActionMqtt-Di4ZTig8.js → ConfigActionMqtt-BqK3q4cC.js} +1 -1
  20. package/dist/interface/assets/ConfigActionNotification-D_H5Q68D.js +1 -0
  21. package/dist/interface/assets/{ConfigActionNotificationControl-B_p8dnc4.js → ConfigActionNotificationControl-BnTJl4dr.js} +1 -1
  22. package/dist/interface/assets/{ConfigActionOutput-B31cj20h.js → ConfigActionOutput-udY95_rH.js} +1 -1
  23. package/dist/interface/assets/{ConfigActionPlugin-DCUhDIiJ.js → ConfigActionPlugin-C51LrkZb.js} +1 -1
  24. package/dist/interface/assets/{ConfigActionSensor-De63wYQU.js → ConfigActionSensor-B2tFf8x6.js} +1 -1
  25. package/dist/interface/assets/{ConfigActionSnapshot-DZJDjOMT.js → ConfigActionSnapshot-BzmeByH3.js} +1 -1
  26. package/dist/interface/assets/{ConfigActionVariable-Q3QXVMbR.js → ConfigActionVariable-BagC3lj5.js} +1 -1
  27. package/dist/interface/assets/{ConfigConditionIfElse-DKonPxli.js → ConfigConditionIfElse-CQOZJ19Y.js} +1 -1
  28. package/dist/interface/assets/{ConfigConditionSensorState-C_J6ERzt.js → ConfigConditionSensorState-SGYpkNP5.js} +1 -1
  29. package/dist/interface/assets/ConfigConditionSwitch-BXR6xUN8.js +1 -0
  30. package/dist/interface/assets/{ConfigConditionTime-CRDI58_P.js → ConfigConditionTime-BrEhw1R9.js} +1 -1
  31. package/dist/interface/assets/{ConfigSensorValueInput-C3ep90ds.js → ConfigSensorValueInput-DezTWtbA.js} +1 -1
  32. package/dist/interface/assets/{ConfigTriggerDetection-CbVFlyI8.js → ConfigTriggerDetection-xo0imE_3.js} +1 -1
  33. package/dist/interface/assets/ConfigTriggerGeofence-BmJpP4Ew.js +1 -0
  34. package/dist/interface/assets/{ConfigTriggerManual-7kAukUgk.js → ConfigTriggerManual-CmAdnZQK.js} +1 -1
  35. package/dist/interface/assets/{ConfigTriggerMqtt-DUCZZt2j.js → ConfigTriggerMqtt-F19dhVm1.js} +1 -1
  36. package/dist/interface/assets/{ConfigTriggerSchedule-lAiLdu1W.js → ConfigTriggerSchedule-BGci3Aed.js} +1 -1
  37. package/dist/interface/assets/{ConfigTriggerSensor-DIhCfhcN.js → ConfigTriggerSensor-DSEDGB2X.js} +1 -1
  38. package/dist/interface/assets/{ConfigTriggerSystem-DZu6Fp2j.js → ConfigTriggerSystem-DPy8Zir4.js} +1 -1
  39. package/dist/interface/assets/{ConfigTriggerWebhook-D3a5f6vl.js → ConfigTriggerWebhook-Dv0Kmwg8.js} +1 -1
  40. package/dist/interface/assets/Console-Cuh-Vc4u.js +1 -0
  41. package/dist/interface/assets/{CuiAutomationRunsDialog-CgzW_s6M.js → CuiAutomationRunsDialog-B1UeVC6Q.js} +1 -1
  42. package/dist/interface/assets/{CuiBottomSheet-C7UdIQu1.js → CuiBottomSheet-BjkDE7_9.js} +1 -1
  43. package/dist/interface/assets/CuiBottomSheet-C9G-NoMU.js +1 -0
  44. package/dist/interface/assets/CuiCameraPipCard-nrln9zp-.js +1 -0
  45. package/dist/interface/assets/CuiCameraRecordings-B7BhgPpP.css +1 -0
  46. package/dist/interface/assets/CuiCameraRecordings-HKwhFpea.js +1 -0
  47. package/dist/interface/assets/{CuiCameraShares-D3fAJNWF.js → CuiCameraShares-D-fhJCro.js} +1 -1
  48. package/dist/interface/assets/{CuiCameraTable-ApLSxeO4.js → CuiCameraTable-BTVfK-HY.js} +2 -2
  49. package/dist/interface/assets/CuiCameraTable-DGg4_c_u.js +1 -0
  50. package/dist/interface/assets/{CuiChartTable-BeEij8SL.js → CuiChartTable-DAUYP-EW.js} +1 -1
  51. package/dist/interface/assets/{CuiConsole-CMxpzZ51.js → CuiConsole-C7aZj4wK.js} +2 -2
  52. package/dist/interface/assets/{CuiDataTable-f_QVzRqq.js → CuiDataTable-1B8aaZQO.js} +1 -1
  53. package/dist/interface/assets/CuiLightControl-CSA1PYc8.js +1 -0
  54. package/dist/interface/assets/{CuiList-C3oJKyJC.js → CuiList-D-hOSNou.js} +1 -1
  55. package/dist/interface/assets/CuiPluginCard-D1Hkyiy4.js +2 -0
  56. package/dist/interface/assets/{CuiPluginCategoryChip-EJhup0nM.js → CuiPluginCategoryChip-qnn-HD6g.js} +1 -1
  57. package/dist/interface/assets/{CuiPluginOAuthButton-CbPU8trR.js → CuiPluginOAuthButton-CXextmBv.js} +2 -2
  58. package/dist/interface/assets/{CuiPluginTrustBadge-B4bxBl3A.js → CuiPluginTrustBadge-C-8MN2Qc.js} +1 -1
  59. package/dist/interface/assets/{CuiQRCode-CycvR5wz.js → CuiQRCode-D1qmU4qU.js} +1 -1
  60. package/dist/interface/assets/CuiSchema-DnHOpBg4.js +1 -0
  61. package/dist/interface/assets/{CuiTopNavbarItem-D4qP-WpK.js → CuiTopNavbarItem-Csb3O1-n.js} +1 -1
  62. package/dist/interface/assets/Faces-C0QpQxuF.js +1 -0
  63. package/dist/interface/assets/FirstSteps-BqZQovY7.js +1 -0
  64. package/dist/interface/assets/{Floorplan-Da5gt435.css → Floorplan-Bxhdg4C2.css} +1 -1
  65. package/dist/interface/assets/Floorplan-CW-W5ZkV.js +1 -0
  66. package/dist/interface/assets/Instances-VSkiqKKf.js +1 -0
  67. package/dist/interface/assets/{Logs-BBZMBN6a.js → Logs-DQFS2AUi.js} +2 -2
  68. package/dist/interface/assets/{Menu-CRLIo98F.js → Menu-COvvZ_vz.js} +1 -1
  69. package/dist/interface/assets/Metrics-cvbQzChA.js +9 -0
  70. package/dist/interface/assets/OAuthDeviceFlow-3ZC2QCAs.js +1 -0
  71. package/dist/interface/assets/Plugin-DjQd3Y9J.js +1 -0
  72. package/dist/interface/assets/{PluginConsole-D2SUwFDo.js → PluginConsole-BaUkghQD.js} +2 -2
  73. package/dist/interface/assets/PluginDetail-Ofj1hk2q.js +2 -0
  74. package/dist/interface/assets/{PluginSchema-U4q4c9ak.js → PluginSchema-f-ER7hlx.js} +1 -1
  75. package/dist/interface/assets/PluginSearch-Ce3S1HDv.js +1 -0
  76. package/dist/interface/assets/PluginSearch-D5eQsj5p.js +2 -0
  77. package/dist/interface/assets/{PluginUpdateProgress-DWcs6NlJ.js → PluginUpdateProgress-BfYNLvVX.js} +1 -1
  78. package/dist/interface/assets/Plugins-DtDN9z0k.js +1 -0
  79. package/dist/interface/assets/Recordings-CQGnTZFt.js +1 -0
  80. package/dist/interface/assets/SensorEdit-BZtiJyoI.js +1 -0
  81. package/dist/interface/assets/{SensorHistory-B16b4-Um.js → SensorHistory-BFkT3teu.js} +1 -1
  82. package/dist/interface/assets/{Sensors-BsLHVGqk.css → Sensors-CaKl4PQY.css} +1 -1
  83. package/dist/interface/assets/Sensors-DSR-AUqb.js +2 -0
  84. package/dist/interface/assets/{Settings-BOd4EPix.js → Settings-DV3JZFjc.js} +1 -1
  85. package/dist/interface/assets/SettingsAccount-Cd5JPsv2.js +1 -0
  86. package/dist/interface/assets/SettingsAccount-D4ib7Asi.js +1 -0
  87. package/dist/interface/assets/SettingsAppearance-BYsQmdyo.js +1 -0
  88. package/dist/interface/assets/{SettingsAppearance-DZGa_aiI.js → SettingsAppearance-CC6StMAi.js} +1 -1
  89. package/dist/interface/assets/{SettingsBackup-DyblUiF8.js → SettingsBackup-BcVFCbhB.js} +1 -1
  90. package/dist/interface/assets/{SettingsList-DM0yAFkS.js → SettingsList-04HiM3OT.js} +1 -1
  91. package/dist/interface/assets/SettingsMqtt-XaJdsYPn.js +1 -0
  92. package/dist/interface/assets/SettingsNotifications-CUoYMHwr.js +1 -0
  93. package/dist/interface/assets/{SettingsPermissions-w2ptf4wy.js → SettingsPermissions-gFDNSlTh.js} +1 -1
  94. package/dist/interface/assets/SettingsRecordings-Bw64UZWe.js +1 -0
  95. package/dist/interface/assets/SettingsRemote-BnFW-uT-.js +2 -0
  96. package/dist/interface/assets/{SettingsSystem-BsXkYsRC.js → SettingsSystem-Cdjg5GNY.js} +2 -2
  97. package/dist/interface/assets/{SettingsUsers-BSsmo6T0.js → SettingsUsers-DphPL78H.js} +1 -1
  98. package/dist/interface/assets/{Terminal-cU-8dVL_.js → Terminal-CrNjqzTs.js} +2 -2
  99. package/dist/interface/assets/{Updates-dw0MwgsN.js → Updates-V5B9LSD-.js} +1 -1
  100. package/dist/interface/assets/{VariableInput-JSpyezJa.js → VariableInput-n0TxKRqq.js} +1 -1
  101. package/dist/interface/assets/{VariableSuggestions-DZbWgsck.js → VariableSuggestions-C4LmaCAo.js} +1 -1
  102. package/dist/interface/assets/{VersionsHandler-C_mzsgfj.js → VersionsHandler-BPocJcb0.js} +2 -2
  103. package/dist/interface/assets/{VirtualSensorCreate-3mJ8c6Tl.js → VirtualSensorCreate-BPvbrzGS.js} +1 -1
  104. package/dist/interface/assets/Workers-DEvQNzUi.js +2 -0
  105. package/dist/interface/assets/{lightbulb-outline-BtraGBwO.js → alert-outline-DtiCgufF.js} +1 -1
  106. package/dist/interface/assets/{api-COPnjVh2.js → api-BXmkXIE8.js} +1 -1
  107. package/dist/interface/assets/api-DO5wBndX.css +2 -0
  108. package/dist/interface/assets/api-x8zXlvtm.js +4 -0
  109. package/dist/interface/assets/{auth-owqLfbdn.js → auth-BKJnreuu.js} +1 -1
  110. package/dist/interface/assets/{automations-Bql07EFx.js → automations-CVuIXlAQ.js} +1 -1
  111. package/dist/interface/assets/cameraSources-C3cl6FVD.js +1 -0
  112. package/dist/interface/assets/cloudHandoff-BZvvihwX.js +1 -0
  113. package/dist/interface/assets/{config-soN-D-nC.js → config-Sw94rZxF.js} +1 -1
  114. package/dist/interface/assets/{flowSchema-BFZ6n5Su.js → flowSchema-BOrDqdeG.js} +1 -1
  115. package/dist/interface/assets/{intercomService-Bjn0OsVT.js → intercomService-CfCIMUlA.js} +1 -1
  116. package/dist/interface/assets/main-Jl93jEZK.js +3 -0
  117. package/dist/interface/assets/{main-BF8Mg561.css → main-Qqk3RyYP.css} +1 -1
  118. package/dist/interface/assets/{mqtt-CMdU36uB.js → mqtt-BaCMJJk_.js} +1 -1
  119. package/dist/interface/assets/nodeDefinitions-a8iyp3yk.js +1 -0
  120. package/dist/interface/assets/{notifications-C_CbT9aA.js → notifications-l-x8vA4D.js} +1 -1
  121. package/dist/interface/assets/{plugins-CGDE1O2F.js → plugins-GA9v-eQx.js} +1 -1
  122. package/dist/interface/assets/{rooms-BnJo8QbU.js → rooms-DX7PBdpP.js} +1 -1
  123. package/dist/interface/assets/sensorIcons-BTgouEmX.js +1 -0
  124. package/dist/interface/assets/{sensors-Bshdwbki.js → sensors-LJkBCaMk.js} +1 -1
  125. package/dist/interface/assets/{server-CaRDiFTF.js → server-dOx3q8o1.js} +1 -1
  126. package/dist/interface/assets/theme-DgrclY58.js +1 -0
  127. package/dist/interface/assets/types-CSWXRySW.js +1 -0
  128. package/dist/interface/assets/{types-Dwu7_YVv.js → types-D19FOdYo.js} +1 -1
  129. package/dist/interface/assets/types-Yq0FH8fa.js +1 -0
  130. package/dist/interface/assets/ungrouped-B_u9a5wm.js +1 -0
  131. package/dist/interface/assets/{ungrouped-uv64nr5n.css → ungrouped-DTYy_Pud.css} +1 -1
  132. package/dist/interface/assets/{updates-DelnBMM3.js → updates-BVN6uGXy.js} +1 -1
  133. package/dist/interface/assets/{useAppVersion-DeQeb6UF.js → useAppVersion-BUDIkitU.js} +1 -1
  134. package/dist/interface/assets/useBackupRestore-CnSZNCC8.js +1 -0
  135. package/dist/interface/assets/{useCameraOptions-DgMpN00_.js → useCameraOptions-Cgb4eV2d.js} +1 -1
  136. package/dist/interface/assets/{useLogsSocket-BKPqNCOv.js → useLogsSocket-CGKtL049.js} +1 -1
  137. package/dist/interface/assets/{useNavLayout-BJhl8UVM.js → useNavLayout-Dcngcb73.js} +1 -1
  138. package/dist/interface/assets/{usePermissions-Eyt2t6_8.js → usePermissions-zJF4LCPm.js} +1 -1
  139. package/dist/interface/assets/{usePluginUpdates-wfckuNy_.js → usePluginUpdates-DP--lRxm.js} +1 -1
  140. package/dist/interface/assets/{usePushRegistration-jcfB8ujf.js → usePushRegistration-BhPBp28J.js} +1 -1
  141. package/dist/interface/assets/{useServerRestart-XnqHaTb7.js → useServerRestart-BpCDYbPH.js} +1 -1
  142. package/dist/interface/assets/{useStreamStatus-8bE5h_fQ.js → useStreamStatus-BoVMk6KT.js} +1 -1
  143. package/dist/interface/assets/{useTabSwipe-DxZfseQO.js → useTabSwipe--t-Qqa31.js} +1 -1
  144. package/dist/interface/assets/{useUpdateChannel-CjxdE3h1.js → useUpdateChannel-DAuhU-__.js} +1 -1
  145. package/dist/interface/assets/{useUpdatesSocket-DFt7_yr8.js → useUpdatesSocket-C-j3b3tU.js} +1 -1
  146. package/dist/interface/assets/{useUserOptions-DStio0f5.js → useUserOptions-CcLVC73O.js} +1 -1
  147. package/dist/interface/assets/vendor-cameraui-phsC2Mmi.js +2326 -0
  148. package/dist/interface/assets/vendor-core-C0ZWoGJD.js +1 -0
  149. package/dist/interface/assets/{vendor-primevue-DXXRO7Z5.js → vendor-primevue-nPess0JU.js} +76 -76
  150. package/dist/interface/assets/vendor-zod-CJ7LAMqQ.js +99 -0
  151. package/dist/interface/ha/404-PedrGUiq.js +60 -0
  152. package/dist/interface/ha/About-l5fkBqG7.js +55 -0
  153. package/dist/interface/ha/Automation-CaSlGjT4.js +2015 -0
  154. package/dist/interface/ha/AutomationImport-BNavtjDq.js +206 -0
  155. package/dist/interface/ha/AutomationStore-BVSW8TVt.js +335 -0
  156. package/dist/interface/ha/AutomationStoreDetail-DHZwlpz0.js +122 -0
  157. package/dist/interface/ha/Automations-CZ2jvH6d.js +437 -0
  158. package/dist/interface/ha/Camera-CggUrrPm.js +625 -0
  159. package/dist/interface/ha/CameraConsole-DpzF48TF.js +52 -0
  160. package/dist/interface/ha/Cameras-K-kQF5tG.js +1970 -0
  161. package/dist/interface/ha/Camview-zJVP7JwZ.js +1337 -0
  162. package/dist/interface/ha/CertificateUpload-DbBQ87OT.js +117 -0
  163. package/dist/interface/ha/Config-Bsud2DYI.js +356 -0
  164. package/dist/interface/ha/ConfigActionCameraControl-Czkfw_NO.js +152 -0
  165. package/dist/interface/ha/ConfigActionDelay-BHug57u7.js +61 -0
  166. package/dist/interface/ha/ConfigActionHttp-LfbxbfgG.js +134 -0
  167. package/dist/interface/ha/ConfigActionImageInput-Ce2GJzCm.js +171 -0
  168. package/dist/interface/ha/ConfigActionMqtt-KmCGcNZb.js +81 -0
  169. package/dist/interface/ha/ConfigActionNotification-DUMY_3IT.js +199 -0
  170. package/dist/interface/ha/ConfigActionNotificationControl-B9Z2i5WR.js +111 -0
  171. package/dist/interface/ha/ConfigActionOutput-CX-ZQjcs.js +98 -0
  172. package/dist/interface/ha/ConfigActionPlugin-y5PuPwdk.js +172 -0
  173. package/dist/interface/ha/ConfigActionSensor-CC39Rpxi.js +139 -0
  174. package/dist/interface/ha/ConfigActionSnapshot-CWyhx6rk.js +48 -0
  175. package/dist/interface/ha/ConfigActionVariable-BNRLCthd.js +88 -0
  176. package/dist/interface/ha/ConfigConditionIfElse-BayS5_Dr.js +124 -0
  177. package/dist/interface/ha/ConfigConditionSensorState-DLXNqL-R.js +192 -0
  178. package/dist/interface/ha/ConfigConditionSwitch-BBesQgWi.js +128 -0
  179. package/dist/interface/ha/ConfigConditionTime-aD8mk2aa.js +95 -0
  180. package/dist/interface/ha/ConfigSensorValueInput-5JzesEuD.js +169 -0
  181. package/dist/interface/ha/ConfigTriggerDetection--BcjPuyh.js +241 -0
  182. package/dist/interface/ha/ConfigTriggerGeofence-BZi5a2Yv.js +4896 -0
  183. package/dist/interface/ha/ConfigTriggerManual-ConxhgNx.js +14 -0
  184. package/dist/interface/ha/ConfigTriggerMqtt-B6C9injX.js +134 -0
  185. package/dist/interface/ha/ConfigTriggerSchedule-Vv5iNKL3.js +72 -0
  186. package/dist/interface/ha/ConfigTriggerSensor-beixHfSD.js +73 -0
  187. package/dist/interface/ha/ConfigTriggerSystem-BHDpn485.js +188 -0
  188. package/dist/interface/ha/ConfigTriggerWebhook-D9cuCU_p.js +94 -0
  189. package/dist/interface/ha/Console-CbQnrt6X.js +348 -0
  190. package/dist/interface/ha/CuiAutomationRunsDialog-CckgCRNS.js +130 -0
  191. package/dist/interface/ha/CuiBottomSheet-juhGdTsO.js +270 -0
  192. package/dist/interface/ha/CuiCameraRecordings-CLzZiXhk.js +552 -0
  193. package/dist/interface/ha/CuiCameraShares-Dzx1jZGE.js +121 -0
  194. package/dist/interface/ha/CuiCameraTable-ug0ik9N-.js +153 -0
  195. package/dist/interface/ha/CuiChartTable-7EnAA-WG.js +6784 -0
  196. package/dist/interface/ha/CuiConsole-DOnyBSL7.js +244 -0
  197. package/dist/interface/ha/CuiDataTable-Cx9GBqsV.js +8725 -0
  198. package/dist/interface/ha/CuiList-C45psxFZ.js +57 -0
  199. package/dist/interface/ha/CuiMarkdownContent-D7sCtnNQ.js +4716 -0
  200. package/dist/interface/ha/CuiPluginCard-ChLIfOms.js +769 -0
  201. package/dist/interface/ha/CuiPluginOAuthButton-B6vPOEx2.js +105 -0
  202. package/dist/interface/ha/CuiPluginTrustBadge-BvPV93D0.js +123 -0
  203. package/dist/interface/ha/CuiQRCode-Djr3z54t.js +86 -0
  204. package/dist/interface/ha/CuiSchema-dl7TXv-k.js +963 -0
  205. package/dist/interface/ha/CuiTopNavbarItem-BXoda5eM.js +141 -0
  206. package/dist/interface/ha/Faces-DnqWMGWW.js +1281 -0
  207. package/dist/interface/ha/FirstSteps-CFawb017.js +251 -0
  208. package/dist/interface/ha/Floorplan-Mv-Ootly.js +3677 -0
  209. package/dist/interface/ha/Instances-DJjZ3btI.js +680 -0
  210. package/dist/interface/ha/Logs-CLFhW1xq.js +418 -0
  211. package/dist/interface/ha/Menu-D7QTRqMJ.js +161 -0
  212. package/dist/interface/ha/Metrics-CCvFtezL.js +1330 -0
  213. package/dist/interface/ha/OAuthDeviceFlow-4YupTNsK.js +112 -0
  214. package/dist/interface/ha/Plugin-BHU0yhBa.js +1404 -0
  215. package/dist/interface/ha/PluginConsole-CNrLuFQM.js +56 -0
  216. package/dist/interface/ha/PluginDetail-Bm3X-xN4.js +230 -0
  217. package/dist/interface/ha/PluginSearch-C0be8cYD.js +475 -0
  218. package/dist/interface/ha/PluginUpdateProgress-DVvgYMLG.js +34 -0
  219. package/dist/interface/ha/Plugins-R-uz0Se-.js +705 -0
  220. package/dist/interface/ha/Recordings-DAwbihs8.js +1463 -0
  221. package/dist/interface/ha/SensorEdit-BxE1cRLR.js +1460 -0
  222. package/dist/interface/ha/SensorHistory-DUGlH2pU.js +54 -0
  223. package/dist/interface/ha/Sensors-Cax5RlPH.js +1358 -0
  224. package/dist/interface/ha/Settings-DKtlCoyz.js +218 -0
  225. package/dist/interface/ha/SettingsAccount-2e_Vjpev.js +970 -0
  226. package/dist/interface/ha/SettingsAppearance-DCm60FhX.js +220 -0
  227. package/dist/interface/ha/SettingsBackup-CiM_nNWt.js +556 -0
  228. package/dist/interface/ha/SettingsList-D4D3cmLo.js +40 -0
  229. package/dist/interface/ha/SettingsMqtt-CID4L0PD.js +526 -0
  230. package/dist/interface/ha/SettingsNotifications-DGJkhm8T.js +529 -0
  231. package/dist/interface/ha/SettingsPermissions-Cd0rtgli.js +84 -0
  232. package/dist/interface/ha/SettingsRecordings-pR4L0wgy.js +151 -0
  233. package/dist/interface/ha/SettingsRemote-CYg-LSQK.js +1810 -0
  234. package/dist/interface/ha/SettingsSystem-BeYJN1Ut.js +376 -0
  235. package/dist/interface/ha/SettingsUsers-F4CZggSR.js +379 -0
  236. package/dist/interface/ha/Terminal-iQahUx9P.js +631 -0
  237. package/dist/interface/ha/Updates-ClQ77p-o.js +356 -0
  238. package/dist/interface/ha/VariableInput-BOHBmNff.js +52 -0
  239. package/dist/interface/ha/VariableSuggestions-BE06z6SW.js +201 -0
  240. package/dist/interface/ha/VersionsHandler-Cx9u0oj8.js +211 -0
  241. package/dist/interface/ha/VirtualSensorCreate-CvSzLo4N.js +101 -0
  242. package/dist/interface/ha/Workers-CEJtdSu-.js +765 -0
  243. package/dist/interface/ha/accordion-BT2wHwK8.js +577 -0
  244. package/dist/interface/ha/account-B1xL2wxD.js +19 -0
  245. package/dist/interface/ha/ace-Dh61T4RV.js +13238 -0
  246. package/dist/interface/ha/ace.config-HyzcNHkM.js +1429 -0
  247. package/dist/interface/ha/alert-circle-CLRn5GAd.js +19 -0
  248. package/dist/interface/ha/alert-outline-CGTMAqXf.js +75 -0
  249. package/dist/interface/ha/api-BmNBy1ay.js +29 -0
  250. package/dist/interface/ha/api-CWJkvtnM.js +60866 -0
  251. package/dist/interface/ha/arrow-left-DkvcResi.js +19 -0
  252. package/dist/interface/ha/auth-X6tkVYJs.js +271 -0
  253. package/dist/interface/ha/autocomplete-L_jK3s3m.js +1373 -0
  254. package/dist/interface/ha/automationBlueprint-D1TiCF7R.js +249 -0
  255. package/dist/interface/ha/back-filled-Cxzg5vQg.js +20 -0
  256. package/dist/interface/ha/base-D_LAf3cS.js +26 -0
  257. package/dist/interface/ha/base-c1lsE5TW.js +125 -0
  258. package/dist/interface/ha/bell-ring-xrXdzNHW.js +19 -0
  259. package/dist/interface/ha/brain-DyOOk3m3.js +19 -0
  260. package/dist/interface/ha/browser-Bxx7joo_.js +1227 -0
  261. package/dist/interface/ha/browserconfig.xml +11 -0
  262. package/dist/interface/ha/button-BlYuI0Q7.js +406 -0
  263. package/dist/interface/ha/cameraui-cards.js +190 -0
  264. package/dist/interface/ha/cards-CNOyNWMA.js +13316 -0
  265. package/dist/interface/ha/cctv-Bz6BH0ns.js +19 -0
  266. package/dist/interface/ha/check-circle-D_wDxrLs.js +19 -0
  267. package/dist/interface/ha/chevron-down-P5MtUhJO.js +19 -0
  268. package/dist/interface/ha/chip-DxGABeun.js +149 -0
  269. package/dist/interface/ha/clock-outline-JxApewmA.js +19 -0
  270. package/dist/interface/ha/close-Eq3txTBS.js +19 -0
  271. package/dist/interface/ha/close-circle-C2nTtN_-.js +19 -0
  272. package/dist/interface/ha/config-E4Jkelkr.js +116 -0
  273. package/dist/interface/ha/content-copy-DpPXKtKE.js +19 -0
  274. package/dist/interface/ha/copy-C48Ur26H.js +22 -0
  275. package/dist/interface/ha/datepicker-BuvKhBWJ.js +3236 -0
  276. package/dist/interface/ha/definitions-E-sY7Cxg.js +23 -0
  277. package/dist/interface/ha/delete-D-m8mqly.js +19 -0
  278. package/dist/interface/ha/dist-B7lgvbyI.js +279 -0
  279. package/dist/interface/ha/dist-Ca9_5rzq.js +3457 -0
  280. package/dist/interface/ha/divider-jkWvVbPJ.js +110 -0
  281. package/dist/interface/ha/download-Cnr7IQKX.js +19 -0
  282. package/dist/interface/ha/esm-1sIZN4t7.js +6 -0
  283. package/dist/interface/ha/esm-6hnPZcZr.js +15 -0
  284. package/dist/interface/ha/esm-B72ViJ7F.js +5 -0
  285. package/dist/interface/ha/esm-BGlkcEes.js +156 -0
  286. package/dist/interface/ha/esm-BKPZuThK.js +5 -0
  287. package/dist/interface/ha/esm-BMx7MsZ_.js +15 -0
  288. package/dist/interface/ha/esm-CChFtwcx.js +21 -0
  289. package/dist/interface/ha/esm-CMTmAdHP.js +5 -0
  290. package/dist/interface/ha/esm-CkoEL9YX.js +7 -0
  291. package/dist/interface/ha/esm-CvxDASXR.js +23 -0
  292. package/dist/interface/ha/esm-Demxl4zQ.js +5 -0
  293. package/dist/interface/ha/esm-DiBhi9zp.js +5 -0
  294. package/dist/interface/ha/esm-XFPB9fYb.js +15 -0
  295. package/dist/interface/ha/eventLabels-B4C1_4vT.js +42 -0
  296. package/dist/interface/ha/eye-off-AdumIw0H.js +33 -0
  297. package/dist/interface/ha/eye-off-outline-DO3xfiua.js +19 -0
  298. package/dist/interface/ha/fonts/InterVariable.woff2 +0 -0
  299. package/dist/interface/ha/history-BoZc8mgf.js +19 -0
  300. package/dist/interface/ha/home-am0tRTsk.js +19 -0
  301. package/dist/interface/ha/information-outline-DIdNxPCN.js +19 -0
  302. package/dist/interface/ha/inputicon-6-vaPLbw.js +324 -0
  303. package/dist/interface/ha/inputnumber-B1Buq8Nc.js +1033 -0
  304. package/dist/interface/ha/inputtext-DGIESrd0.js +257 -0
  305. package/dist/interface/ha/intercomService-jB2mTgsn.js +1406 -0
  306. package/dist/interface/ha/message-C8U_kMBA.js +244 -0
  307. package/dist/interface/ha/minus-DKa9TXat.js +19 -0
  308. package/dist/interface/ha/minus-QyTgaT70.js +46 -0
  309. package/dist/interface/ha/mqtt-BmDCmG9h.js +56 -0
  310. package/dist/interface/ha/multiselect-BbgV_fPx.js +1492 -0
  311. package/dist/interface/ha/native-BaNeloQn.js +35 -0
  312. package/dist/interface/ha/native-C8PbNqsJ.js +29 -0
  313. package/dist/interface/ha/notifications-B51yvrGL.js +159 -0
  314. package/dist/interface/ha/og-share.png +0 -0
  315. package/dist/interface/ha/pencil-outline-BqfTDXIh.js +19 -0
  316. package/dist/interface/ha/pinia-3D39Do4a.js +6934 -0
  317. package/dist/interface/ha/platformLabels-C3d1PLg-.js +27 -0
  318. package/dist/interface/ha/plugin-DAGqBiG_.js +38 -0
  319. package/dist/interface/ha/plugins-dkWbXWVM.js +592 -0
  320. package/dist/interface/ha/plus-CNdrByQb.js +46 -0
  321. package/dist/interface/ha/plus-d_caPq5l.js +19 -0
  322. package/dist/interface/ha/progressbar-CIoPoMSe.js +95 -0
  323. package/dist/interface/ha/protocol-BB4jdtUC-K1r3LFCq.js +706 -0
  324. package/dist/interface/ha/pwa/apple-splash-landscape-dark-1136x640.png +0 -0
  325. package/dist/interface/ha/pwa/apple-splash-landscape-dark-1334x750.png +0 -0
  326. package/dist/interface/ha/pwa/apple-splash-landscape-dark-1792x828.png +0 -0
  327. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2048x1536.png +0 -0
  328. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2160x1620.png +0 -0
  329. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2208x1242.png +0 -0
  330. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2224x1668.png +0 -0
  331. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2388x1668.png +0 -0
  332. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2436x1125.png +0 -0
  333. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2532x1170.png +0 -0
  334. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2556x1179.png +0 -0
  335. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2688x1242.png +0 -0
  336. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2732x2048.png +0 -0
  337. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2778x1284.png +0 -0
  338. package/dist/interface/ha/pwa/apple-splash-landscape-dark-2796x1290.png +0 -0
  339. package/dist/interface/ha/pwa/apple-splash-landscape-light-1136x640.png +0 -0
  340. package/dist/interface/ha/pwa/apple-splash-landscape-light-1334x750.png +0 -0
  341. package/dist/interface/ha/pwa/apple-splash-landscape-light-1792x828.png +0 -0
  342. package/dist/interface/ha/pwa/apple-splash-landscape-light-2048x1536.png +0 -0
  343. package/dist/interface/ha/pwa/apple-splash-landscape-light-2160x1620.png +0 -0
  344. package/dist/interface/ha/pwa/apple-splash-landscape-light-2208x1242.png +0 -0
  345. package/dist/interface/ha/pwa/apple-splash-landscape-light-2224x1668.png +0 -0
  346. package/dist/interface/ha/pwa/apple-splash-landscape-light-2388x1668.png +0 -0
  347. package/dist/interface/ha/pwa/apple-splash-landscape-light-2436x1125.png +0 -0
  348. package/dist/interface/ha/pwa/apple-splash-landscape-light-2532x1170.png +0 -0
  349. package/dist/interface/ha/pwa/apple-splash-landscape-light-2556x1179.png +0 -0
  350. package/dist/interface/ha/pwa/apple-splash-landscape-light-2688x1242.png +0 -0
  351. package/dist/interface/ha/pwa/apple-splash-landscape-light-2732x2048.png +0 -0
  352. package/dist/interface/ha/pwa/apple-splash-landscape-light-2778x1284.png +0 -0
  353. package/dist/interface/ha/pwa/apple-splash-landscape-light-2796x1290.png +0 -0
  354. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1125x2436.png +0 -0
  355. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1170x2532.png +0 -0
  356. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1179x2556.png +0 -0
  357. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1242x2208.png +0 -0
  358. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1242x2688.png +0 -0
  359. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1284x2778.png +0 -0
  360. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1290x2796.png +0 -0
  361. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1536x2048.png +0 -0
  362. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1620x2160.png +0 -0
  363. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1668x2224.png +0 -0
  364. package/dist/interface/ha/pwa/apple-splash-portrait-dark-1668x2388.png +0 -0
  365. package/dist/interface/ha/pwa/apple-splash-portrait-dark-2048x2732.png +0 -0
  366. package/dist/interface/ha/pwa/apple-splash-portrait-dark-640x1136.png +0 -0
  367. package/dist/interface/ha/pwa/apple-splash-portrait-dark-750x1334.png +0 -0
  368. package/dist/interface/ha/pwa/apple-splash-portrait-dark-828x1792.png +0 -0
  369. package/dist/interface/ha/pwa/apple-splash-portrait-light-1125x2436.png +0 -0
  370. package/dist/interface/ha/pwa/apple-splash-portrait-light-1170x2532.png +0 -0
  371. package/dist/interface/ha/pwa/apple-splash-portrait-light-1179x2556.png +0 -0
  372. package/dist/interface/ha/pwa/apple-splash-portrait-light-1242x2208.png +0 -0
  373. package/dist/interface/ha/pwa/apple-splash-portrait-light-1242x2688.png +0 -0
  374. package/dist/interface/ha/pwa/apple-splash-portrait-light-1284x2778.png +0 -0
  375. package/dist/interface/ha/pwa/apple-splash-portrait-light-1290x2796.png +0 -0
  376. package/dist/interface/ha/pwa/apple-splash-portrait-light-1536x2048.png +0 -0
  377. package/dist/interface/ha/pwa/apple-splash-portrait-light-1620x2160.png +0 -0
  378. package/dist/interface/ha/pwa/apple-splash-portrait-light-1668x2224.png +0 -0
  379. package/dist/interface/ha/pwa/apple-splash-portrait-light-1668x2388.png +0 -0
  380. package/dist/interface/ha/pwa/apple-splash-portrait-light-2048x2732.png +0 -0
  381. package/dist/interface/ha/pwa/apple-splash-portrait-light-640x1136.png +0 -0
  382. package/dist/interface/ha/pwa/apple-splash-portrait-light-750x1334.png +0 -0
  383. package/dist/interface/ha/pwa/apple-splash-portrait-light-828x1792.png +0 -0
  384. package/dist/interface/ha/pwa/apple-touch-icon-180x180.png +0 -0
  385. package/dist/interface/ha/pwa/favicon-16.ico +0 -0
  386. package/dist/interface/ha/pwa/favicon-32.ico +0 -0
  387. package/dist/interface/ha/pwa/favicon-48.ico +0 -0
  388. package/dist/interface/ha/pwa/favicon-64.ico +0 -0
  389. package/dist/interface/ha/pwa/logo.svg +1 -0
  390. package/dist/interface/ha/pwa/maskable-icon-1240x600.png +0 -0
  391. package/dist/interface/ha/pwa/maskable-icon-512x512.png +0 -0
  392. package/dist/interface/ha/pwa/maskable-icon-620x300.png +0 -0
  393. package/dist/interface/ha/pwa/pwa-1024x1024.png +0 -0
  394. package/dist/interface/ha/pwa/pwa-120x120.png +0 -0
  395. package/dist/interface/ha/pwa/pwa-144x144.png +0 -0
  396. package/dist/interface/ha/pwa/pwa-152x152.png +0 -0
  397. package/dist/interface/ha/pwa/pwa-167x167.png +0 -0
  398. package/dist/interface/ha/pwa/pwa-180x180.png +0 -0
  399. package/dist/interface/ha/pwa/pwa-192x192.png +0 -0
  400. package/dist/interface/ha/pwa/pwa-24x24.png +0 -0
  401. package/dist/interface/ha/pwa/pwa-300x300.png +0 -0
  402. package/dist/interface/ha/pwa/pwa-36x36.png +0 -0
  403. package/dist/interface/ha/pwa/pwa-48x48.png +0 -0
  404. package/dist/interface/ha/pwa/pwa-50x50.png +0 -0
  405. package/dist/interface/ha/pwa/pwa-64x64.png +0 -0
  406. package/dist/interface/ha/pwa/pwa-72x72.png +0 -0
  407. package/dist/interface/ha/pwa/pwa-88x88.png +0 -0
  408. package/dist/interface/ha/pwa/pwa-96x96.png +0 -0
  409. package/dist/interface/ha/radar-C7lI26j4.js +19 -0
  410. package/dist/interface/ha/refresh-BIhepekY.js +19 -0
  411. package/dist/interface/ha/ring-resize-VS4MSeBv.js +16 -0
  412. package/dist/interface/ha/ripple-BilzxWfY.js +2928 -0
  413. package/dist/interface/ha/robots.txt +2 -0
  414. package/dist/interface/ha/rolldown-runtime-CEFd7nDs.js +30 -0
  415. package/dist/interface/ha/rooms-B-FUXQ1p.js +45 -0
  416. package/dist/interface/ha/round-alt-arrow-left-bold-CWEg-ZLF.js +37 -0
  417. package/dist/interface/ha/runtime-core.esm-bundler-D8slQ3BU.js +3295 -0
  418. package/dist/interface/ha/search-CoOsbgeb.js +19 -0
  419. package/dist/interface/ha/select-DjWkRqsI.js +1382 -0
  420. package/dist/interface/ha/server-CKJKoFfg.js +239 -0
  421. package/dist/interface/ha/settings-EKkSQLzv.js +22 -0
  422. package/dist/interface/ha/source-branch-CZwSOrQA.js +19 -0
  423. package/dist/interface/ha/speeddial-Dv9txWte.js +682 -0
  424. package/dist/interface/ha/spinner-D6iUldg9.js +46 -0
  425. package/dist/interface/ha/synapse-CGrlyQDE.js +35 -0
  426. package/dist/interface/ha/tag-CXgC9OZ6.js +95 -0
  427. package/dist/interface/ha/textarea-DvLkfUX7.js +130 -0
  428. package/dist/interface/ha/tooltip-BIrD_hC8.js +277 -0
  429. package/dist/interface/ha/trash-2-C4zSCZfs.js +23 -0
  430. package/dist/interface/ha/trash-can-outline-DCqsCOd2.js +19 -0
  431. package/dist/interface/ha/trash-fill-BPsrwR8X.js +21 -0
  432. package/dist/interface/ha/types-C7MzwoQR.js +28 -0
  433. package/dist/interface/ha/types-J_J0HKlK.js +1032 -0
  434. package/dist/interface/ha/ungrouped-BpaM88Y-.js +1116 -0
  435. package/dist/interface/ha/updates-BdVmkKAa.js +341 -0
  436. package/dist/interface/ha/upload-2xJkVPZE.js +19 -0
  437. package/dist/interface/ha/upload-wQHBRZX_.js +23 -0
  438. package/dist/interface/ha/useAppVersion-DzDaOsKc.js +22 -0
  439. package/dist/interface/ha/useLogsSocket-CWUE-KXV.js +59 -0
  440. package/dist/interface/ha/useNavLayout-BqpyvD2F.js +125 -0
  441. package/dist/interface/ha/usePermissions-BIUeW4ef.js +72 -0
  442. package/dist/interface/ha/useServerRestart-0c4gA1fG.js +23 -0
  443. package/dist/interface/ha/useTabSwipe-C8LdKw23.js +45 -0
  444. package/dist/interface/ha/useUpdateChannel-CHVLthZB.js +22 -0
  445. package/dist/interface/ha/useUpdatesSocket-CaxEs511.js +34 -0
  446. package/dist/interface/ha/useUserOptions-Rk_71WAK.js +15 -0
  447. package/dist/interface/ha/utils-DYtBrGDz.js +7 -0
  448. package/dist/interface/ha/virtualscroller-s_gNqN5p.js +996 -0
  449. package/dist/interface/ha/vue-flow-background-B0Vu4-8M.js +6840 -0
  450. package/dist/interface/ha/vue-i18n-Dcb07o5U.js +2409 -0
  451. package/dist/interface/ha/web-0Kyq65na.js +78 -0
  452. package/dist/interface/ha/web-B7Dt2zZN.js +340 -0
  453. package/dist/interface/ha/web-BNdrPSpb.js +102 -0
  454. package/dist/interface/ha/web-BPBZBCtX.js +8 -0
  455. package/dist/interface/ha/web-BjKL51lK-qwJdIpM1.js +221 -0
  456. package/dist/interface/ha/web-C01i9qI1.js +57 -0
  457. package/dist/interface/ha/web-CH3JeXWa.js +211 -0
  458. package/dist/interface/ha/web-Cpm1-DVe.js +33 -0
  459. package/dist/interface/ha/web-DqRMXrnx.js +31 -0
  460. package/dist/interface/ha/web-DtVT7WYt.js +17 -0
  461. package/dist/interface/ha/web-DxJQZCiR.js +59 -0
  462. package/dist/interface/ha/web-I7Urp4AE.js +46 -0
  463. package/dist/interface/ha/web-aSaPk7kr.js +57 -0
  464. package/dist/interface/ha/web-pMey9p3Y.js +79 -0
  465. package/dist/interface/ha/xterm-B6xA6E5i.js +14833 -0
  466. package/dist/interface/ha/zoom-in-CNVB9H3D.js +41 -0
  467. package/dist/interface/index.html +29 -29
  468. package/dist/interface/sw.js +1 -1
  469. package/dist/server/package.json +9 -9
  470. package/dist/server/requirements.txt +3 -3
  471. package/dist/server/src/_camera_ui_tools/camera_ui_rpc/client.py +9 -6
  472. package/dist/server/src/_camera_ui_tools/camera_ui_rpc/types.py +2 -2
  473. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/__init__.py +4 -2
  474. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/camera/config.py +8 -0
  475. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/camera/device.py +4 -3
  476. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/internal/__init__.py +6 -0
  477. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/internal/sensor_rpc.py +17 -6
  478. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/manager/__init__.py +24 -70
  479. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/plugin/interfaces.py +46 -19
  480. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/__init__.py +2 -0
  481. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/base.py +65 -8
  482. package/dist/server/src/api/database/index.d.ts +1 -1
  483. package/dist/server/src/api/database/index.js +4 -32
  484. package/dist/server/src/api/database/index.js.map +1 -1
  485. package/dist/server/src/api/database/migrations/v2-1-18.d.ts +3 -0
  486. package/dist/server/src/api/database/migrations/v2-1-18.js +24 -0
  487. package/dist/server/src/api/database/migrations/v2-1-18.js.map +1 -0
  488. package/dist/server/src/api/database/record-schemas.d.ts +1 -0
  489. package/dist/server/src/api/database/types.d.ts +4 -3
  490. package/dist/server/src/api/schemas/cameras.schema.d.ts +53 -15
  491. package/dist/server/src/api/schemas/cameras.schema.js +5 -1
  492. package/dist/server/src/api/schemas/cameras.schema.js.map +1 -1
  493. package/dist/server/src/api/schemas/users.schema.d.ts +7 -0
  494. package/dist/server/src/api/schemas/users.schema.js +1 -1
  495. package/dist/server/src/api/schemas/users.schema.js.map +1 -1
  496. package/dist/server/src/api/services/cameras.service.js +14 -21
  497. package/dist/server/src/api/services/cameras.service.js.map +1 -1
  498. package/dist/server/src/api/services/sensors.service.d.ts +3 -3
  499. package/dist/server/src/api/services/sensors.service.js +3 -24
  500. package/dist/server/src/api/services/sensors.service.js.map +1 -1
  501. package/dist/server/src/api/utils/regex.d.ts +2 -0
  502. package/dist/server/src/api/utils/regex.js +2 -0
  503. package/dist/server/src/api/utils/regex.js.map +1 -1
  504. package/dist/server/src/api/websocket/nsp/sensors.d.ts +3 -1
  505. package/dist/server/src/api/websocket/nsp/sensors.js +13 -3
  506. package/dist/server/src/api/websocket/nsp/sensors.js.map +1 -1
  507. package/dist/server/src/camera/decoder/debug/detection-record.d.ts +3 -1
  508. package/dist/server/src/camera/decoder/debug/detection-record.js +6 -2
  509. package/dist/server/src/camera/decoder/debug/detection-record.js.map +1 -1
  510. package/dist/server/src/camera/decoder/detection-coordinator.d.ts +2 -0
  511. package/dist/server/src/camera/decoder/detection-coordinator.js +44 -25
  512. package/dist/server/src/camera/decoder/detection-coordinator.js.map +1 -1
  513. package/dist/server/src/camera/decoder/detection-pipeline.d.ts +3 -1
  514. package/dist/server/src/camera/decoder/detection-pipeline.js +3 -22
  515. package/dist/server/src/camera/decoder/detection-pipeline.js.map +1 -1
  516. package/dist/server/src/camera/decoder/event-manager.d.ts +4 -3
  517. package/dist/server/src/camera/decoder/event-manager.js +17 -5
  518. package/dist/server/src/camera/decoder/event-manager.js.map +1 -1
  519. package/dist/server/src/camera/decoder/event-thumbnailer.d.ts +3 -0
  520. package/dist/server/src/camera/decoder/event-thumbnailer.js +13 -8
  521. package/dist/server/src/camera/decoder/event-thumbnailer.js.map +1 -1
  522. package/dist/server/src/camera/decoder/event-trace.d.ts +58 -0
  523. package/dist/server/src/camera/decoder/event-trace.js +118 -0
  524. package/dist/server/src/camera/decoder/event-trace.js.map +1 -0
  525. package/dist/server/src/camera/decoder/nvr-sink.d.ts +2 -0
  526. package/dist/server/src/camera/decoder/nvr-sink.js.map +1 -1
  527. package/dist/server/src/camera/decoder/reconnect-backoff.js +1 -1
  528. package/dist/server/src/camera/decoder/reconnect-backoff.js.map +1 -1
  529. package/dist/server/src/camera/decoder/sources/analysis-source.d.ts +1 -0
  530. package/dist/server/src/camera/decoder/sources/buffered-source.d.ts +7 -1
  531. package/dist/server/src/camera/decoder/sources/buffered-source.js +27 -15
  532. package/dist/server/src/camera/decoder/sources/buffered-source.js.map +1 -1
  533. package/dist/server/src/camera/decoder/sources/frame-handle.d.ts +2 -1
  534. package/dist/server/src/camera/decoder/sources/frame-handle.js +5 -3
  535. package/dist/server/src/camera/decoder/sources/frame-handle.js.map +1 -1
  536. package/dist/server/src/camera/decoder/sources/frame-source.d.ts +1 -0
  537. package/dist/server/src/camera/decoder/sources/frame-source.js +7 -2
  538. package/dist/server/src/camera/decoder/sources/frame-source.js.map +1 -1
  539. package/dist/server/src/camera/decoder/sources/rtp-index.d.ts +9 -0
  540. package/dist/server/src/camera/decoder/sources/rtp-index.js +24 -0
  541. package/dist/server/src/camera/decoder/sources/rtp-index.js.map +1 -0
  542. package/dist/server/src/camera/decoder/worker.js +1 -0
  543. package/dist/server/src/camera/decoder/worker.js.map +1 -1
  544. package/dist/server/src/go2rtc/types.d.ts +1 -1
  545. package/dist/server/src/go2rtc/types.js +1 -1
  546. package/dist/server/src/go2rtc/types.js.map +1 -1
  547. package/dist/server/src/plugins/runtime/node/child.js +1 -0
  548. package/dist/server/src/plugins/runtime/node/child.js.map +1 -1
  549. package/dist/server/src/plugins/runtime/node/proxy/cameraDevice.js +3 -0
  550. package/dist/server/src/plugins/runtime/node/proxy/cameraDevice.js.map +1 -1
  551. package/dist/server/src/plugins/runtime/node/proxy/sensorManager.d.ts +2 -5
  552. package/dist/server/src/plugins/runtime/node/proxy/sensorManager.js +95 -24
  553. package/dist/server/src/plugins/runtime/node/proxy/sensorManager.js.map +1 -1
  554. package/dist/server/src/plugins/runtime/python/child.py +1 -0
  555. package/dist/server/src/plugins/runtime/python/proxy/camera_device.py +9 -0
  556. package/dist/server/src/plugins/runtime/python/proxy/sensor.py +2 -1
  557. package/dist/server/src/plugins/runtime/python/proxy/sensor_manager.py +185 -88
  558. package/dist/server/src/plugins/runtime/python/typings.py +18 -0
  559. package/dist/server/src/rpc/interfaces/sensor.d.ts +19 -4
  560. package/dist/server/src/sensors/discovery.d.ts +1 -1
  561. package/dist/server/src/sensors/discovery.js +10 -19
  562. package/dist/server/src/sensors/discovery.js.map +1 -1
  563. package/dist/server/src/sensors/registry.d.ts +6 -2
  564. package/dist/server/src/sensors/registry.js +75 -6
  565. package/dist/server/src/sensors/registry.js.map +1 -1
  566. package/dist/server/src/utils/camera.d.ts +12 -2
  567. package/dist/server/src/utils/camera.js +27 -1
  568. package/dist/server/src/utils/camera.js.map +1 -1
  569. package/dist/server/src/workers/pairing.js +17 -8
  570. package/dist/server/src/workers/pairing.js.map +1 -1
  571. package/package.json +9 -9
  572. package/dist/interface/assets/Automation-4HPAjq1i.js +0 -3
  573. package/dist/interface/assets/AutomationStoreDetail-C2ntfGP-.js +0 -2
  574. package/dist/interface/assets/Automations-CUUq9dxs.js +0 -2
  575. package/dist/interface/assets/Camera-DmrRrgqQ.js +0 -2
  576. package/dist/interface/assets/Cameras-B-aQUuPk.js +0 -652
  577. package/dist/interface/assets/Camview-B-W5jpCR.js +0 -1
  578. package/dist/interface/assets/ConfigActionNotification-Bq28CjsJ.js +0 -1
  579. package/dist/interface/assets/ConfigConditionSwitch-DYAlj5no.js +0 -1
  580. package/dist/interface/assets/ConfigTriggerGeofence-ClKyzb-x.js +0 -1
  581. package/dist/interface/assets/Console-ctbGFtCH.js +0 -1
  582. package/dist/interface/assets/CuiBottomSheet-Bo1wUyiN.js +0 -1
  583. package/dist/interface/assets/CuiCameraPipCard-BEAE44of.js +0 -1
  584. package/dist/interface/assets/CuiCameraRecordings-BzbwSK8-.css +0 -1
  585. package/dist/interface/assets/CuiCameraRecordings-C1evIMhc.js +0 -1
  586. package/dist/interface/assets/CuiCameraTable-BAjQ8h5H.js +0 -1
  587. package/dist/interface/assets/CuiLightControl-9OhT9YYt.js +0 -1
  588. package/dist/interface/assets/CuiPluginCard-DQgVasi7.js +0 -2
  589. package/dist/interface/assets/CuiSchema-juKEra_J.js +0 -1
  590. package/dist/interface/assets/Faces-Ce3mKYc7.js +0 -1
  591. package/dist/interface/assets/FirstSteps-BBLzX2bl.js +0 -1
  592. package/dist/interface/assets/Floorplan-B7BVj65t.js +0 -1
  593. package/dist/interface/assets/Instances-4VxGT2fm.js +0 -1
  594. package/dist/interface/assets/Metrics-DudHV8Ov.js +0 -9
  595. package/dist/interface/assets/OAuthDeviceFlow-Z3Cesvs9.js +0 -1
  596. package/dist/interface/assets/Plugin-DwadariU.js +0 -1
  597. package/dist/interface/assets/PluginDetail-C_XghvQz.js +0 -2
  598. package/dist/interface/assets/PluginSearch-11dsxfvW.js +0 -1
  599. package/dist/interface/assets/PluginSearch-DgQOryM2.js +0 -2
  600. package/dist/interface/assets/Plugins-QheVcYZB.js +0 -1
  601. package/dist/interface/assets/Recordings-DwPnYsd6.js +0 -1
  602. package/dist/interface/assets/SensorEdit-C9Ejdxaz.js +0 -1
  603. package/dist/interface/assets/Sensors-D4tY50d4.js +0 -2
  604. package/dist/interface/assets/SettingsAccount-DMvvar8D.js +0 -1
  605. package/dist/interface/assets/SettingsAccount-DYCCnjWY.js +0 -1
  606. package/dist/interface/assets/SettingsAppearance-vLBhLEag.js +0 -1
  607. package/dist/interface/assets/SettingsMqtt-Cj9ywnP2.js +0 -1
  608. package/dist/interface/assets/SettingsNotifications-flx3W4Uo.js +0 -1
  609. package/dist/interface/assets/SettingsRecordings-D3b6y2SX.js +0 -1
  610. package/dist/interface/assets/SettingsRemote-o01wgKPR.js +0 -2
  611. package/dist/interface/assets/Workers-CdaYj6Ap.js +0 -2
  612. package/dist/interface/assets/alert-outline-KxFvd3i6.js +0 -1
  613. package/dist/interface/assets/api-2VPaKkqc.js +0 -2
  614. package/dist/interface/assets/api-CEbDxsSY.css +0 -2
  615. package/dist/interface/assets/cameras.schema-CnSdfqqj.js +0 -1
  616. package/dist/interface/assets/cloudHandoff-B1z5dyPD.js +0 -1
  617. package/dist/interface/assets/main-BfL5CDS8.js +0 -3
  618. package/dist/interface/assets/nodeDefinitions-D6zhuw60.js +0 -1
  619. package/dist/interface/assets/sensorIcons-FPxm3pDg.js +0 -1
  620. package/dist/interface/assets/theme-CRQoJiuY.js +0 -1
  621. package/dist/interface/assets/types-BHgaZSm2.js +0 -1
  622. package/dist/interface/assets/types-CQpPteyx.js +0 -1
  623. package/dist/interface/assets/ungrouped-BbOtmmDD.js +0 -1
  624. package/dist/interface/assets/useBackupRestore-CT1PYJDW.js +0 -1
  625. package/dist/interface/assets/vendor-cameraui-ZyqPntQ7.js +0 -2326
  626. package/dist/interface/assets/vendor-core-DN-bpg68.js +0 -1
  627. package/dist/interface/assets/vendor-zod-B0ZFM2Pr.js +0 -127
@@ -0,0 +1,3677 @@
1
+ import { m as e } from "./ripple-BilzxWfY.js";
2
+ import { B as t, G as n, H as r, Jt as i, M as a, N as o, Wt as s, Y as c, _t as l, d as u, f as d, ft as f, gt as p, kt as m, l as h, lt as g, ot as ee, p as _, qt as v, r as y, rt as te, u as b, ut as x, v as S, wt as ne, x as C, xt as w, y as T, yt as re, z as ie } from "./runtime-core.esm-bundler-D8slQ3BU.js";
3
+ import { t as E } from "./tooltip-BIrD_hC8.js";
4
+ import { t as ae } from "./message-C8U_kMBA.js";
5
+ import { t as D } from "./chevron-down-P5MtUhJO.js";
6
+ import { At as oe, Dn as se, Dr as ce, Er as le, Fr as ue, Ft as de, It as fe, Lt as O, Mt as pe, Nt as me, Pt as he, Rr as ge, Rt as k, W as A, cn as j, dr as _e, er as ve, gi as ye, gt as be, ht as xe, jt as Se, kt as Ce, mn as we, o as M, qi as N, qt as Te, rr as P, si as F, vr as I, yr as L } from "./api-CWJkvtnM.js";
7
+ import { n as Ee } from "./vue-i18n-Dcb07o5U.js";
8
+ import { G as R, v as De } from "./dist-Ca9_5rzq.js";
9
+ import { t as Oe } from "./button-BlYuI0Q7.js";
10
+ import { t as ke } from "./inputtext-DGIESrd0.js";
11
+ import { t as Ae } from "./close-Eq3txTBS.js";
12
+ import { t as je } from "./divider-jkWvVbPJ.js";
13
+ import { t as Me } from "./select-DjWkRqsI.js";
14
+ import { i as Ne, n as Pe, r as Fe, t as Ie } from "./accordion-BT2wHwK8.js";
15
+ import { t as Le } from "./speeddial-Dv9txWte.js";
16
+ import { t as Re } from "./textarea-DvLkfUX7.js";
17
+ import { t as ze } from "./CuiBottomSheet-juhGdTsO.js";
18
+ import { t as Be } from "./cctv-Bz6BH0ns.js";
19
+ import { u as Ve } from "./cards-CNOyNWMA.js";
20
+ import { t as He } from "./trash-can-outline-DCqsCOd2.js";
21
+ import { t as Ue } from "./back-filled-Cxzg5vQg.js";
22
+ import { a as We, d as Ge, f as Ke, l as z, p as qe, t as B, u as Je } from "./vue-flow-background-B0Vu4-8M.js";
23
+ import { n as Ye } from "./rooms-B-FUXQ1p.js";
24
+ import { t as V } from "./minus-DKa9TXat.js";
25
+ import { t as H } from "./eye-off-outline-DO3xfiua.js";
26
+ import { t as Xe } from "./pencil-outline-BqfTDXIh.js";
27
+ //#region ~icons/mdi/open-in-new
28
+ var U = {
29
+ viewBox: "0 0 24 24",
30
+ width: "1.2em",
31
+ height: "1.2em"
32
+ };
33
+ function W(e, t) {
34
+ return r(), _("svg", U, [...t[0] ||= [b("path", {
35
+ fill: "currentColor",
36
+ d: "M14 3v2h3.59l-9.83 9.83l1.41 1.41L19 6.41V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2z"
37
+ }, null, -1)]]);
38
+ }
39
+ var Ze = l({
40
+ name: "mdi-open-in-new",
41
+ render: W
42
+ }), Qe = {
43
+ viewBox: "0 0 24 24",
44
+ width: "1.2em",
45
+ height: "1.2em"
46
+ };
47
+ function G(e, t) {
48
+ return r(), _("svg", Qe, [...t[0] ||= [b("path", {
49
+ fill: "currentColor",
50
+ d: "M2 2h6v2h8V2h6v6h-2v8h2v6h-6v-2H8v2H2v-6h2V8H2zm14 6V6H8v2H6v8h2v2h8v-2h2V8zM4 4v2h2V4zm14 0v2h2V4zM4 18v2h2v-2zm14 0v2h2v-2z"
51
+ }, null, -1)]]);
52
+ }
53
+ var $e = l({
54
+ name: "mdi-vector-square",
55
+ render: G
56
+ }), et = {
57
+ viewBox: "0 0 24 24",
58
+ width: "1.2em",
59
+ height: "1.2em"
60
+ };
61
+ function tt(e, t) {
62
+ return r(), _("svg", et, [...t[0] ||= [b("path", {
63
+ fill: "currentColor",
64
+ d: "M12 3c-1.11 0-2 .89-2 2H3v14H2v2h20v-2h-1V5c0-1.11-.89-2-2-2zm0 2h7v14h-7zm-7 6h2v2H5z"
65
+ }, null, -1)]]);
66
+ }
67
+ var nt = l({
68
+ name: "mdi-door-open",
69
+ render: tt
70
+ }), rt = .55, it = {
71
+ min: .2,
72
+ max: 3
73
+ }, K = {
74
+ min: 100,
75
+ max: 3e3
76
+ }, at = [
77
+ "door",
78
+ "opening",
79
+ "stairs"
80
+ ], q = {
81
+ min: 40,
82
+ max: 400
83
+ }, ot = "application/floorplanitem";
84
+ //#endregion
85
+ //#region src/components/CuiFloorplan/utils.ts
86
+ function st(e) {
87
+ return e / 100;
88
+ }
89
+ function ct(e, t = 2) {
90
+ return `${st(e).toFixed(t)} m`;
91
+ }
92
+ function lt(e) {
93
+ return {
94
+ x: e.x + e.width / 2,
95
+ y: e.y + e.height / 2
96
+ };
97
+ }
98
+ function ut(e, t) {
99
+ let n = Math.min(e.y + e.height, t.y + t.height) - Math.max(e.y, t.y), r = Math.min(e.x + e.width, t.x + t.width) - Math.max(e.x, t.x);
100
+ if (n > 0 && (e.x + e.width === t.x || t.x + t.width === e.x)) return {
101
+ x: e.x + e.width === t.x ? t.x : e.x,
102
+ y: Math.max(e.y, t.y),
103
+ stepX: 0,
104
+ stepY: 1,
105
+ length: n
106
+ };
107
+ if (r > 0 && (e.y + e.height === t.y || t.y + t.height === e.y)) {
108
+ let n = e.y + e.height === t.y ? t.y : e.y;
109
+ return {
110
+ x: Math.max(e.x, t.x),
111
+ y: n,
112
+ stepX: 1,
113
+ stepY: 0,
114
+ length: r
115
+ };
116
+ }
117
+ return null;
118
+ }
119
+ function dt(e, t, n) {
120
+ let r = Math.min(n, e.length) / 2, i = Math.min(Math.max(t ?? e.length / 2, r), e.length - r);
121
+ return {
122
+ x1: e.x + e.stepX * (i - r),
123
+ y1: e.y + e.stepY * (i - r),
124
+ x2: e.x + e.stepX * (i + r),
125
+ y2: e.y + e.stepY * (i + r)
126
+ };
127
+ }
128
+ function ft(e, t, n) {
129
+ let r = t.filter((t) => t.roomId === e.fromRoomId), i = t.filter((t) => t.roomId === e.toRoomId);
130
+ if (!r.length || !i.length) return null;
131
+ let a = r.some((e) => e.levelId === n), o = i.some((e) => e.levelId === n);
132
+ if (!a && !o) return null;
133
+ if (a !== o) {
134
+ let t = a ? e.fromShapeId : e.toShapeId, n = a ? r : i;
135
+ return {
136
+ kind: "badge",
137
+ roomId: a ? e.fromRoomId : e.toRoomId,
138
+ shapeId: n.find((e) => e.id === t)?.id ?? n[0].id
139
+ };
140
+ }
141
+ let s = r.find((t) => t.id === e.fromShapeId), c = i.find((t) => t.id === e.toShapeId), l = s && c ? [[s, c]] : r.flatMap((e) => i.map((t) => [e, t]));
142
+ for (let [t, n] of l) {
143
+ let r = ut(t, n);
144
+ if (r) return {
145
+ kind: "edge",
146
+ ...dt(r, e.offset, e.width),
147
+ wall: r
148
+ };
149
+ }
150
+ let u = lt(r[0]), d = lt(i[0]);
151
+ return {
152
+ kind: "link",
153
+ x1: u.x,
154
+ y1: u.y,
155
+ x2: d.x,
156
+ y2: d.y
157
+ };
158
+ }
159
+ function pt(e, t, n) {
160
+ let r = mt(e);
161
+ return {
162
+ fill: r.map((e) => ht(e, t, [])).join(" "),
163
+ wall: r.map((e) => ht(e, t, n)).join(" ")
164
+ };
165
+ }
166
+ function mt(e) {
167
+ if (!e.length) return [];
168
+ let t = [...new Set(e.flatMap((e) => [e.x, e.x + e.width]))].sort((e, t) => e - t), n = [...new Set(e.flatMap((e) => [e.y, e.y + e.height]))].sort((e, t) => e - t), r = (r, i) => {
169
+ if (r < 0 || i < 0 || r >= t.length - 1 || i >= n.length - 1) return !1;
170
+ let a = (t[r] + t[r + 1]) / 2, o = (n[i] + n[i + 1]) / 2;
171
+ return e.some((e) => a > e.x && a < e.x + e.width && o > e.y && o < e.y + e.height);
172
+ }, i = (e) => `${e.x},${e.y}`, a = /* @__PURE__ */ new Map();
173
+ for (let e = 0; e < t.length - 1; e++) for (let o = 0; o < n.length - 1; o++) {
174
+ if (!r(e, o)) continue;
175
+ let s = t[e], c = t[e + 1], l = n[o], u = n[o + 1];
176
+ r(e, o - 1) || a.set(i({
177
+ x: s,
178
+ y: l
179
+ }), {
180
+ x: c,
181
+ y: l
182
+ }), r(e + 1, o) || a.set(i({
183
+ x: c,
184
+ y: l
185
+ }), {
186
+ x: c,
187
+ y: u
188
+ }), r(e, o + 1) || a.set(i({
189
+ x: c,
190
+ y: u
191
+ }), {
192
+ x: s,
193
+ y: u
194
+ }), r(e - 1, o) || a.set(i({
195
+ x: s,
196
+ y: u
197
+ }), {
198
+ x: s,
199
+ y: l
200
+ });
201
+ }
202
+ let o = [];
203
+ for (; a.size;) {
204
+ let [e] = a.keys(), t = [], n = {
205
+ x: Number(e.split(",")[0]),
206
+ y: Number(e.split(",")[1])
207
+ };
208
+ for (; n;) {
209
+ let e = a.get(i(n));
210
+ if (!e) break;
211
+ a.delete(i(n)), t.push(n), n = a.has(i(e)) ? e : void 0;
212
+ }
213
+ t.length > 2 && o.push(J(t));
214
+ }
215
+ return o;
216
+ }
217
+ function J(e) {
218
+ return e.filter((t, n) => {
219
+ let r = e[(n - 1 + e.length) % e.length], i = e[(n + 1) % e.length];
220
+ return (r.x !== t.x || i.x !== t.x) && (r.y !== t.y || i.y !== t.y);
221
+ });
222
+ }
223
+ function ht(e, t, n) {
224
+ let r = [], i = [], a = [];
225
+ for (let n = 0; n < e.length; n++) {
226
+ let o = e[n], s = e[(n - 1 + e.length) % e.length], c = e[(n + 1) % e.length], l = Y(s, o), u = Y(o, c), d = Math.min(t, l / 2, u / 2);
227
+ r.push({
228
+ x: o.x + (s.x - o.x) / l * d,
229
+ y: o.y + (s.y - o.y) / l * d
230
+ }), i.push({
231
+ x: o.x + (c.x - o.x) / u * d,
232
+ y: o.y + (c.y - o.y) / u * d
233
+ }), a.push(d);
234
+ }
235
+ let o = n.length === 0, s = [], c = !1;
236
+ for (let t = 0; t < e.length; t++) {
237
+ let l = (t + 1) % e.length;
238
+ for (let e of gt(i[t], r[l], n)) (!c || !o) && s.push(`M ${X(e.x1)} ${X(e.y1)}`), s.push(`L ${X(e.x2)} ${X(e.y2)}`), c = !0;
239
+ if (a[l] > 0) {
240
+ let n = e[(l + 1) % e.length], o = (e[l].x - e[t].x) * (n.y - e[l].y) - (e[l].y - e[t].y) * (n.x - e[l].x);
241
+ c || s.push(`M ${X(r[l].x)} ${X(r[l].y)}`), s.push(`A ${X(a[l])} ${X(a[l])} 0 0 ${+(o > 0)} ${X(i[l].x)} ${X(i[l].y)}`), c = !0;
242
+ }
243
+ }
244
+ return o ? `${s.join(" ")} Z` : s.join(" ");
245
+ }
246
+ function gt(e, t, n) {
247
+ let r = Y(e, t);
248
+ if (r === 0) return [];
249
+ let i = (t.x - e.x) / r, a = (t.y - e.y) / r, o = (t) => ({
250
+ x: e.x + i * t,
251
+ y: e.y + a * t
252
+ }), s = (t) => (t.x - e.x) * i + (t.y - e.y) * a, c = [];
253
+ for (let i of n) {
254
+ let n = e.x === t.x && i.x1 === i.x2 && Math.abs(i.x1 - e.x) < 1, a = e.y === t.y && i.y1 === i.y2 && Math.abs(i.y1 - e.y) < 1;
255
+ if (!n && !a) continue;
256
+ let o = s({
257
+ x: i.x1,
258
+ y: i.y1
259
+ }), l = s({
260
+ x: i.x2,
261
+ y: i.y2
262
+ }), u = Math.max(0, Math.min(o, l)), d = Math.min(r, Math.max(o, l));
263
+ d > u && c.push({
264
+ start: u,
265
+ end: d
266
+ });
267
+ }
268
+ c.sort((e, t) => e.start - t.start);
269
+ let l = [], u = 0;
270
+ for (let e of c) {
271
+ if (e.start > u) {
272
+ let t = o(u), n = o(e.start);
273
+ l.push({
274
+ x1: t.x,
275
+ y1: t.y,
276
+ x2: n.x,
277
+ y2: n.y
278
+ });
279
+ }
280
+ u = Math.max(u, e.end);
281
+ }
282
+ if (u < r) {
283
+ let e = o(u), t = o(r);
284
+ l.push({
285
+ x1: e.x,
286
+ y1: e.y,
287
+ x2: t.x,
288
+ y2: t.y
289
+ });
290
+ }
291
+ return l;
292
+ }
293
+ function Y(e, t) {
294
+ return Math.abs(t.x - e.x) + Math.abs(t.y - e.y);
295
+ }
296
+ function X(e) {
297
+ return Math.round(e * 100) / 100;
298
+ }
299
+ //#endregion
300
+ //#region src/components/CuiFloorplan/CuiFloorplanInspector.vue?vue&type=script&setup=true&lang.ts
301
+ var _t = { class: "h-full flex flex-col overflow-hidden" }, vt = { class: "flex items-center gap-2 px-4 py-3 border-bottom-color" }, yt = { class: "flex items-center justify-center w-8 h-8 rounded-md shrink-0 inspector-icon" }, bt = { class: "flex-1 min-w-0" }, Z = { class: "text-sm font-semibold truncate text-color" }, xt = { class: "text-xs text-muted truncate" }, St = { class: "flex-1 overflow-y-auto" }, Ct = { class: "text-color font-normal text-sm" }, wt = { class: "flex flex-col gap-6" }, Tt = {
302
+ key: 0,
303
+ class: "flex flex-col field-gap"
304
+ }, Et = { class: "cui-label" }, Dt = { class: "flex flex-col field-gap" }, Ot = { class: "cui-label" }, kt = { class: "flex flex-col field-gap" }, At = { class: "cui-label" }, jt = { class: "flex flex-col field-gap" }, Mt = { class: "cui-label" }, Nt = { class: "flex flex-col field-gap" }, Pt = { class: "cui-label" }, Ft = { class: "flex flex-col field-gap" }, Q = { class: "cui-label" }, It = { class: "text-sm text-muted" }, Lt = { class: "text-color font-normal text-sm" }, Rt = { class: "flex flex-col field-gap" }, zt = { class: "cui-label" }, Bt = {
305
+ key: 1,
306
+ class: "text-sm text-color"
307
+ }, Vt = {
308
+ key: 0,
309
+ class: "flex flex-col field-gap mt-6"
310
+ }, Ht = { class: "cui-label" }, Ut = { class: "flex flex-col field-gap mt-6" }, Wt = { class: "cui-label" }, Gt = { class: "text-color font-normal text-sm" }, Kt = { class: "flex flex-col gap-6" }, qt = { class: "flex flex-col field-gap" }, Jt = { class: "cui-label" }, Yt = {
311
+ key: 0,
312
+ class: "flex flex-col field-gap"
313
+ }, Xt = { class: "cui-label" }, Zt = { class: "flex flex-col field-gap" }, $ = { class: "cui-label" }, Qt = { class: "text-color font-normal text-sm" }, $t = { class: "flex flex-col gap-6" }, en = { class: "flex flex-col field-gap" }, tn = { class: "cui-label" }, nn = { class: "flex flex-col field-gap" }, rn = { class: "cui-label" }, an = { class: "text-color font-normal text-sm" }, on = { class: "flex flex-col gap-6" }, sn = { class: "flex flex-col field-gap" }, cn = { class: "cui-label" }, ln = { class: "flex flex-col field-gap" }, un = { class: "cui-label" }, dn = { class: "flex flex-col field-gap" }, fn = { class: "cui-label" }, pn = {
314
+ key: 0,
315
+ class: "p-4 border-top-color"
316
+ }, mn = /*#__PURE__*/ I(/* @__PURE__ */ C({
317
+ __name: "CuiFloorplanInspector",
318
+ props: {
319
+ fluid: { type: Boolean },
320
+ rooms: {},
321
+ connections: {},
322
+ cameras: {},
323
+ sensors: {},
324
+ levels: {},
325
+ selection: {},
326
+ readOnly: { type: Boolean }
327
+ },
328
+ emits: [
329
+ "close",
330
+ "update-room",
331
+ "update-camera",
332
+ "update-sensor",
333
+ "update-connection",
334
+ "remove"
335
+ ],
336
+ setup(e, { emit: t }) {
337
+ let n = e, a = t, { t: o } = Ee(), c = w(["general", "view"]), l = h(() => n.selection?.kind === "room" ? n.rooms.find((e) => e.id === n.selection?.id) : void 0), f = h(() => n.selection?.kind === "camera" ? n.cameras.find((e) => e.id === n.selection?.id) : void 0), p = h(() => n.levels.map((e) => ({
338
+ label: e.name,
339
+ value: e.id
340
+ }))), ee = h(() => l.value?.outdoor ? l.value.publicSpace ? "public" : "outdoor" : "indoor"), v = h(() => [
341
+ "indoor",
342
+ "outdoor",
343
+ "public"
344
+ ].map((e) => ({
345
+ label: o(`views.floorplan.room_kind_${e}`),
346
+ value: e
347
+ }))), te = h(() => l.value ? n.rooms.filter((e) => e.roomId === l.value?.roomId).length : 0), x = h(() => {
348
+ let e = l.value;
349
+ if (!e) return [];
350
+ let t = /* @__PURE__ */ new Set(), r = [{
351
+ label: e.name,
352
+ value: e.roomId
353
+ }];
354
+ t.add(e.roomId);
355
+ for (let i of n.rooms) i.roomId === e.roomId || t.has(i.roomId) || i.levelId !== e.levelId || ut(e, i) && (t.add(i.roomId), r.push({
356
+ label: i.name,
357
+ value: i.roomId
358
+ }));
359
+ return r;
360
+ }), ne = h(() => {
361
+ let e = /* @__PURE__ */ new Set();
362
+ return n.rooms.filter((t) => t.levelId === f.value?.levelId && !e.has(t.roomId) && e.add(t.roomId)).map((e) => ({
363
+ label: e.name,
364
+ value: e.roomId
365
+ }));
366
+ }), C = h(() => n.selection?.kind === "sensor" ? n.sensors.find((e) => e.id === n.selection?.id) : void 0), re = h(() => {
367
+ let e = /* @__PURE__ */ new Set();
368
+ return n.rooms.filter((t) => t.levelId === C.value?.levelId && !e.has(t.roomId) && e.add(t.roomId)).map((e) => ({
369
+ label: e.name,
370
+ value: e.roomId
371
+ }));
372
+ }), ie = h(() => C.value ? n.connections.filter((e) => e.fromRoomId === C.value?.roomId || e.toRoomId === C.value?.roomId).map((e) => {
373
+ let t = e.fromRoomId === C.value?.roomId ? e.toRoomId : e.fromRoomId;
374
+ return {
375
+ label: n.rooms.find((e) => e.roomId === t)?.name ?? t,
376
+ value: e.id
377
+ };
378
+ }) : []), E = h(() => n.selection?.kind === "connection" ? n.connections.find((e) => e.id === n.selection?.id) : void 0), D = h(() => {
379
+ if (!E.value) return !1;
380
+ let e = n.rooms.find((e) => e.roomId === E.value?.fromRoomId), t = n.rooms.find((e) => e.roomId === E.value?.toRoomId);
381
+ return !!e && !!t && e.levelId !== t.levelId;
382
+ }), oe = h(() => at.filter((e) => e !== "stairs").map((e) => ({
383
+ label: o(`views.floorplan.connection_${e}`),
384
+ value: e
385
+ }))), se = h(() => E.value ? `${n.rooms.find((e) => e.roomId === E.value?.fromRoomId)?.name ?? ""} · ${n.rooms.find((e) => e.roomId === E.value?.toRoomId)?.name ?? ""}` : ""), ce = h(() => ((f.value?.rotation ?? 0) % 360 + 360) % 360), le = h(() => C.value ? C.value.owner || (n.rooms.find((e) => e.roomId === C.value?.roomId)?.name ?? "") : l.value ? n.levels.find((e) => e.id === l.value?.levelId)?.name ?? "" : E.value ? o(`views.floorplan.connection_${E.value.type}`) : f.value ? n.rooms.find((e) => e.roomId === f.value?.roomId)?.name ?? o("views.floorplan.no_room") : "");
386
+ function ue(e) {
387
+ C.value && a("update-sensor", {
388
+ id: C.value.id,
389
+ patch: e
390
+ });
391
+ }
392
+ function de(e) {
393
+ return {
394
+ outdoor: e !== "indoor",
395
+ publicSpace: e === "public"
396
+ };
397
+ }
398
+ function fe(e) {
399
+ l.value && a("update-room", {
400
+ id: l.value.id,
401
+ patch: e
402
+ });
403
+ }
404
+ function O(e) {
405
+ f.value && a("update-camera", {
406
+ id: f.value.id,
407
+ patch: e
408
+ });
409
+ }
410
+ function pe() {
411
+ l.value ? a("remove", {
412
+ kind: "room",
413
+ id: l.value.id
414
+ }) : C.value ? a("remove", {
415
+ kind: "sensor",
416
+ id: C.value.id
417
+ }) : f.value ? a("remove", {
418
+ kind: "camera",
419
+ id: f.value.id
420
+ }) : E.value && a("remove", {
421
+ kind: "connection",
422
+ id: E.value.id
423
+ });
424
+ }
425
+ return (t, n) => {
426
+ let o = Be, h = nt, w = $e, me = Ae, he = Oe, ge = Fe, k = Me, A = ae, j = ke, _e = Re, ye = Ne, be = Pe, xe = ve, Se = Ie;
427
+ return r(), _("div", _t, [
428
+ b("div", vt, [
429
+ b("div", yt, [m(f) ? (r(), u(o, {
430
+ key: 0,
431
+ class: "w-4 h-4"
432
+ })) : m(E) ? (r(), u(h, {
433
+ key: 1,
434
+ class: "w-4 h-4"
435
+ })) : (r(), u(w, {
436
+ key: 2,
437
+ class: "w-4 h-4"
438
+ }))]),
439
+ b("div", bt, [b("div", Z, i(m(l)?.name ?? m(f)?.name ?? m(C)?.name ?? m(se)), 1), b("div", xt, i(m(le)), 1)]),
440
+ T(he, {
441
+ severity: "secondary",
442
+ text: "",
443
+ rounded: "",
444
+ class: "shrink-0 cui-icon-sm",
445
+ onClick: n[0] ||= (e) => a("close")
446
+ }, {
447
+ icon: g(() => [T(me, {
448
+ width: "100%",
449
+ height: "100%"
450
+ })]),
451
+ _: 1
452
+ })
453
+ ]),
454
+ b("div", St, [T(Se, {
455
+ multiple: "",
456
+ value: m(c),
457
+ class: s(e.fluid ? "w-full" : "w-[300px]")
458
+ }, {
459
+ default: g(() => [
460
+ m(l) ? (r(), u(be, {
461
+ key: 0,
462
+ value: "general"
463
+ }, {
464
+ default: g(() => [T(ge, { class: "px-4 rounded-none!" }, {
465
+ default: g(() => [b("span", Ct, i(t.$t("views.floorplan.section_room")), 1)]),
466
+ _: 1
467
+ }), T(ye, { pt: { content: { class: e.fluid ? "px-4 w-full" : "px-4 w-[300px]" } } }, {
468
+ default: g(() => [b("div", wt, [
469
+ m(x).length > 1 ? (r(), _("div", Tt, [
470
+ b("label", Et, i(t.$t("views.floorplan.belongs_to")), 1),
471
+ T(k, {
472
+ "model-value": m(l).roomId,
473
+ options: m(x),
474
+ "option-label": "label",
475
+ "option-value": "value",
476
+ disabled: e.readOnly,
477
+ "onUpdate:modelValue": n[1] ||= (e) => e && fe({ roomId: e })
478
+ }, null, 8, [
479
+ "model-value",
480
+ "options",
481
+ "disabled"
482
+ ]),
483
+ T(A, {
484
+ severity: "secondary",
485
+ variant: "simple",
486
+ size: "small",
487
+ class: "cui-input-hint"
488
+ }, {
489
+ default: g(() => [S(i(t.$t("views.floorplan.belongs_to_hint")), 1)]),
490
+ _: 1
491
+ })
492
+ ])) : d("", !0),
493
+ b("div", Dt, [
494
+ b("label", Ot, i(t.$t("views.floorplan.room_name")), 1),
495
+ T(j, {
496
+ "model-value": m(l).name,
497
+ disabled: e.readOnly,
498
+ "onUpdate:modelValue": n[2] ||= (e) => fe({ name: e ?? "" })
499
+ }, null, 8, ["model-value", "disabled"]),
500
+ m(te) > 1 ? (r(), u(A, {
501
+ key: 0,
502
+ severity: "secondary",
503
+ variant: "simple",
504
+ size: "small",
505
+ class: "cui-input-hint"
506
+ }, {
507
+ default: g(() => [S(i(t.$t("views.floorplan.room_parts", { count: m(te) })), 1)]),
508
+ _: 1
509
+ })) : d("", !0)
510
+ ]),
511
+ b("div", kt, [b("label", At, i(t.$t("views.floorplan.level")), 1), T(k, {
512
+ "model-value": m(l).levelId,
513
+ options: m(p),
514
+ "option-label": "label",
515
+ "option-value": "value",
516
+ "onUpdate:modelValue": n[3] ||= (e) => fe({ levelId: e })
517
+ }, null, 8, ["model-value", "options"])]),
518
+ b("div", jt, [
519
+ b("label", Mt, i(t.$t("views.floorplan.room_kind")), 1),
520
+ T(k, {
521
+ "model-value": m(ee),
522
+ options: m(v),
523
+ "option-label": "label",
524
+ "option-value": "value",
525
+ disabled: e.readOnly,
526
+ "onUpdate:modelValue": n[4] ||= (e) => fe(de(e))
527
+ }, null, 8, [
528
+ "model-value",
529
+ "options",
530
+ "disabled"
531
+ ]),
532
+ T(A, {
533
+ severity: "secondary",
534
+ variant: "simple",
535
+ size: "small",
536
+ class: "cui-input-hint"
537
+ }, {
538
+ default: g(() => [S(i(t.$t(`views.floorplan.room_kind_${m(ee)}_hint`)), 1)]),
539
+ _: 1
540
+ })
541
+ ]),
542
+ b("div", Nt, [
543
+ b("label", Pt, i(t.$t("views.floorplan.note")), 1),
544
+ T(_e, {
545
+ "model-value": m(l).note,
546
+ disabled: e.readOnly,
547
+ maxlength: m(240),
548
+ rows: "3",
549
+ "auto-resize": "",
550
+ "onUpdate:modelValue": n[5] ||= (e) => fe({ note: e ?? "" })
551
+ }, null, 8, [
552
+ "model-value",
553
+ "disabled",
554
+ "maxlength"
555
+ ]),
556
+ T(A, {
557
+ severity: "secondary",
558
+ variant: "simple",
559
+ size: "small",
560
+ class: "cui-input-hint"
561
+ }, {
562
+ default: g(() => [S(i(t.$t("views.floorplan.note_hint")), 1)]),
563
+ _: 1
564
+ })
565
+ ]),
566
+ b("div", Ft, [b("label", Q, i(t.$t("views.floorplan.size")), 1), b("span", It, i(m(ct)(m(l).width)) + " x " + i(m(ct)(m(l).height)), 1)])
567
+ ])]),
568
+ _: 1
569
+ }, 8, ["pt"])]),
570
+ _: 1
571
+ })) : d("", !0),
572
+ m(E) ? (r(), u(be, {
573
+ key: 1,
574
+ value: "general"
575
+ }, {
576
+ default: g(() => [T(ge, { class: "px-4 rounded-none!" }, {
577
+ default: g(() => [b("span", Lt, i(t.$t("views.floorplan.section_connection")), 1)]),
578
+ _: 1
579
+ }), T(ye, { pt: { content: { class: e.fluid ? "px-4 w-full" : "px-4 w-[300px]" } } }, {
580
+ default: g(() => [
581
+ b("div", Rt, [
582
+ b("label", zt, i(t.$t("views.floorplan.connection_type")), 1),
583
+ m(D) ? (r(), _("span", Bt, i(t.$t("views.floorplan.connection_stairs")), 1)) : (r(), u(k, {
584
+ key: 0,
585
+ "model-value": m(E).type,
586
+ options: m(oe),
587
+ "option-label": "label",
588
+ "option-value": "value",
589
+ disabled: e.readOnly,
590
+ "onUpdate:modelValue": n[6] ||= (e) => a("update-connection", {
591
+ id: m(E).id,
592
+ patch: { type: e }
593
+ })
594
+ }, null, 8, [
595
+ "model-value",
596
+ "options",
597
+ "disabled"
598
+ ])),
599
+ T(A, {
600
+ severity: "secondary",
601
+ variant: "simple",
602
+ size: "small",
603
+ class: "cui-input-hint"
604
+ }, {
605
+ default: g(() => [S(i(m(D) ? t.$t("views.floorplan.connection_level_hint") : t.$t("views.floorplan.connection_type_hint")), 1)]),
606
+ _: 1
607
+ })
608
+ ]),
609
+ m(D) ? d("", !0) : (r(), _("div", Vt, [
610
+ b("label", Ht, i(t.$t("views.floorplan.connection_width", { value: m(st)(m(E).width).toFixed(2) })), 1),
611
+ T(xe, {
612
+ "model-value": m(E).width,
613
+ disabled: e.readOnly,
614
+ min: m(q).min,
615
+ max: m(q).max,
616
+ step: 5,
617
+ "onUpdate:modelValue": n[7] ||= (e) => a("update-connection", {
618
+ id: m(E).id,
619
+ patch: { width: Number(e) }
620
+ })
621
+ }, null, 8, [
622
+ "model-value",
623
+ "disabled",
624
+ "min",
625
+ "max"
626
+ ]),
627
+ T(A, {
628
+ severity: "secondary",
629
+ variant: "simple",
630
+ size: "small",
631
+ class: "cui-input-hint"
632
+ }, {
633
+ default: g(() => [S(i(t.$t("views.floorplan.connection_width_hint")), 1)]),
634
+ _: 1
635
+ })
636
+ ])),
637
+ b("div", Ut, [
638
+ b("label", Wt, i(t.$t("views.floorplan.note")), 1),
639
+ T(_e, {
640
+ "model-value": m(E).note,
641
+ disabled: e.readOnly,
642
+ maxlength: m(240),
643
+ rows: "3",
644
+ "auto-resize": "",
645
+ "onUpdate:modelValue": n[8] ||= (e) => a("update-connection", {
646
+ id: m(E).id,
647
+ patch: { note: e ?? "" }
648
+ })
649
+ }, null, 8, [
650
+ "model-value",
651
+ "disabled",
652
+ "maxlength"
653
+ ]),
654
+ T(A, {
655
+ severity: "secondary",
656
+ variant: "simple",
657
+ size: "small",
658
+ class: "cui-input-hint"
659
+ }, {
660
+ default: g(() => [S(i(t.$t("views.floorplan.note_hint")), 1)]),
661
+ _: 1
662
+ })
663
+ ])
664
+ ]),
665
+ _: 1
666
+ }, 8, ["pt"])]),
667
+ _: 1
668
+ })) : d("", !0),
669
+ m(C) ? (r(), u(be, {
670
+ key: 2,
671
+ value: "general"
672
+ }, {
673
+ default: g(() => [T(ge, { class: "px-4 rounded-none!" }, {
674
+ default: g(() => [b("span", Gt, i(t.$t("views.floorplan.section_sensor")), 1)]),
675
+ _: 1
676
+ }), T(ye, { pt: { content: { class: e.fluid ? "px-4 w-full" : "px-4 w-[300px]" } } }, {
677
+ default: g(() => [b("div", Kt, [
678
+ b("div", qt, [b("label", Jt, i(t.$t("views.floorplan.assigned_room")), 1), T(k, {
679
+ "model-value": m(C).roomId,
680
+ options: m(re),
681
+ disabled: e.readOnly,
682
+ "option-label": "label",
683
+ "option-value": "value",
684
+ "onUpdate:modelValue": n[9] ||= (e) => e && ue({ roomId: e })
685
+ }, null, 8, [
686
+ "model-value",
687
+ "options",
688
+ "disabled"
689
+ ])]),
690
+ m(ie).length ? (r(), _("div", Yt, [
691
+ b("label", Xt, i(t.$t("views.floorplan.sensor_passage")), 1),
692
+ T(k, {
693
+ "model-value": m(C).connectionId,
694
+ options: m(ie),
695
+ disabled: e.readOnly,
696
+ "option-label": "label",
697
+ "option-value": "value",
698
+ "show-clear": "",
699
+ "onUpdate:modelValue": n[10] ||= (e) => ue({ connectionId: e ?? null })
700
+ }, null, 8, [
701
+ "model-value",
702
+ "options",
703
+ "disabled"
704
+ ]),
705
+ T(A, {
706
+ severity: "secondary",
707
+ variant: "simple",
708
+ size: "small",
709
+ class: "cui-input-hint"
710
+ }, {
711
+ default: g(() => [S(i(t.$t("views.floorplan.sensor_passage_hint")), 1)]),
712
+ _: 1
713
+ })
714
+ ])) : d("", !0),
715
+ b("div", Zt, [
716
+ b("label", $, i(t.$t("views.floorplan.note")), 1),
717
+ T(_e, {
718
+ "model-value": m(C).note,
719
+ disabled: e.readOnly,
720
+ maxlength: m(240),
721
+ rows: "3",
722
+ "auto-resize": "",
723
+ "onUpdate:modelValue": n[11] ||= (e) => ue({ note: e ?? "" })
724
+ }, null, 8, [
725
+ "model-value",
726
+ "disabled",
727
+ "maxlength"
728
+ ]),
729
+ T(A, {
730
+ severity: "secondary",
731
+ variant: "simple",
732
+ size: "small",
733
+ class: "cui-input-hint"
734
+ }, {
735
+ default: g(() => [S(i(t.$t("views.floorplan.note_hint")), 1)]),
736
+ _: 1
737
+ })
738
+ ])
739
+ ])]),
740
+ _: 1
741
+ }, 8, ["pt"])]),
742
+ _: 1
743
+ })) : d("", !0),
744
+ m(f) ? (r(), _(y, { key: 3 }, [T(be, { value: "general" }, {
745
+ default: g(() => [T(ge, { class: "px-4 rounded-none!" }, {
746
+ default: g(() => [b("span", Qt, i(t.$t("views.floorplan.section_camera")), 1)]),
747
+ _: 1
748
+ }), T(ye, { pt: { content: { class: e.fluid ? "px-4 w-full" : "px-4 w-[300px]" } } }, {
749
+ default: g(() => [b("div", $t, [b("div", en, [
750
+ b("label", tn, i(t.$t("views.floorplan.assigned_room")), 1),
751
+ T(k, {
752
+ "model-value": m(f).roomId,
753
+ options: m(ne),
754
+ disabled: e.readOnly,
755
+ "option-label": "label",
756
+ "option-value": "value",
757
+ "onUpdate:modelValue": n[12] ||= (e) => e && O({ roomId: e })
758
+ }, null, 8, [
759
+ "model-value",
760
+ "options",
761
+ "disabled"
762
+ ]),
763
+ T(A, {
764
+ severity: "secondary",
765
+ variant: "simple",
766
+ size: "small",
767
+ class: "cui-input-hint"
768
+ }, {
769
+ default: g(() => [S(i(t.$t("views.floorplan.assigned_room_hint")), 1)]),
770
+ _: 1
771
+ })
772
+ ]), b("div", nn, [
773
+ b("label", rn, i(t.$t("views.floorplan.note")), 1),
774
+ T(_e, {
775
+ "model-value": m(f).note,
776
+ disabled: e.readOnly,
777
+ maxlength: m(240),
778
+ rows: "3",
779
+ "auto-resize": "",
780
+ "onUpdate:modelValue": n[13] ||= (e) => O({ note: e ?? "" })
781
+ }, null, 8, [
782
+ "model-value",
783
+ "disabled",
784
+ "maxlength"
785
+ ]),
786
+ T(A, {
787
+ severity: "secondary",
788
+ variant: "simple",
789
+ size: "small",
790
+ class: "cui-input-hint"
791
+ }, {
792
+ default: g(() => [S(i(t.$t("views.floorplan.note_hint")), 1)]),
793
+ _: 1
794
+ })
795
+ ])])]),
796
+ _: 1
797
+ }, 8, ["pt"])]),
798
+ _: 1
799
+ }), T(be, { value: "view" }, {
800
+ default: g(() => [T(ge, { class: "px-4 rounded-none!" }, {
801
+ default: g(() => [b("span", an, i(t.$t("views.floorplan.section_view")), 1)]),
802
+ _: 1
803
+ }), T(ye, { pt: { content: { class: e.fluid ? "px-4 w-full" : "px-4 w-[300px]" } } }, {
804
+ default: g(() => [b("div", on, [
805
+ b("div", sn, [b("label", cn, i(t.$t("views.floorplan.direction", { value: m(ce) })), 1), T(xe, {
806
+ "model-value": m(ce),
807
+ disabled: e.readOnly,
808
+ min: 0,
809
+ max: 359,
810
+ "onUpdate:modelValue": n[14] ||= (e) => O({ rotation: Number(e) })
811
+ }, null, 8, ["model-value", "disabled"])]),
812
+ b("div", ln, [b("label", un, i(t.$t("views.floorplan.fov", { value: m(f).fov })), 1), T(xe, {
813
+ "model-value": m(f).fov,
814
+ disabled: e.readOnly,
815
+ min: 30,
816
+ max: 180,
817
+ "onUpdate:modelValue": n[15] ||= (e) => O({ fov: Number(e) })
818
+ }, null, 8, ["model-value", "disabled"])]),
819
+ b("div", dn, [b("label", fn, i(t.$t("views.floorplan.range", { value: m(st)(m(f).range).toFixed(1) })), 1), T(xe, {
820
+ disabled: e.readOnly,
821
+ "model-value": m(f).range,
822
+ min: m(K).min,
823
+ max: m(K).max,
824
+ step: 50,
825
+ "onUpdate:modelValue": n[16] ||= (e) => O({ range: Number(e) })
826
+ }, null, 8, [
827
+ "disabled",
828
+ "model-value",
829
+ "min",
830
+ "max"
831
+ ])])
832
+ ])]),
833
+ _: 1
834
+ }, 8, ["pt"])]),
835
+ _: 1
836
+ })], 64)) : d("", !0)
837
+ ]),
838
+ _: 1
839
+ }, 8, ["value", "class"])]),
840
+ e.readOnly ? d("", !0) : (r(), _("div", pn, [T(he, {
841
+ severity: "danger",
842
+ fluid: "",
843
+ class: "w-full cui-button-medium",
844
+ label: m(l) ? t.$t("views.floorplan.delete_room") : m(E) ? t.$t("views.floorplan.remove_connection") : m(C) ? t.$t("views.floorplan.remove_sensor") : t.$t("views.floorplan.remove_camera"),
845
+ onClick: pe
846
+ }, null, 8, ["label"])]))
847
+ ]);
848
+ };
849
+ }
850
+ }), [["__scopeId", "data-v-2f085b3a"]]), hn = {
851
+ viewBox: "0 0 24 24",
852
+ width: "1.2em",
853
+ height: "1.2em"
854
+ };
855
+ function gn(e, t) {
856
+ return r(), _("svg", hn, [...t[0] ||= [b("path", {
857
+ fill: "currentColor",
858
+ d: "M10 13a2 2 0 0 1 2 2c0 1.11-.89 2-2 2s-2-.89-2-2s.9-2 2-2m8-12c-2.76 0-5 2.24-5 5v2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2h-1V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2h2V6c0-2.76-2.24-5-5-5m-2 9v10H4V10z"
859
+ }, null, -1)]]);
860
+ }
861
+ var _n = l({
862
+ name: "mdi-lock-open-variant-outline",
863
+ render: gn
864
+ }), vn = {
865
+ viewBox: "0 0 24 24",
866
+ width: "1.2em",
867
+ height: "1.2em"
868
+ };
869
+ function yn(e, t) {
870
+ return r(), _("svg", vn, [...t[0] ||= [b("path", {
871
+ fill: "currentColor",
872
+ d: "M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zm9-8v4H8v-4zm2-2H6v8h12z"
873
+ }, null, -1)]]);
874
+ }
875
+ var bn = l({
876
+ name: "mdi-fit-to-screen-outline",
877
+ render: yn
878
+ }), xn = ["width", "height"], Sn = ["width", "height"], Cn = ["y2", "stroke-width"], wn = ["id"], Tn = ["d"], En = ["width", "height"], Dn = ["y2", "stroke-width"], On = [
879
+ "x",
880
+ "y",
881
+ "width",
882
+ "height"
883
+ ], kn = ["d"], An = ["clip-path"], jn = ["d", "transform"], Mn = ["transform"], Nn = ["d"], Pn = ["d", "stroke-width"], Fn = ["clip-path"], In = ["d", "transform"], Ln = [
884
+ "x",
885
+ "y",
886
+ "width",
887
+ "height"
888
+ ], Rn = [
889
+ "x",
890
+ "y",
891
+ "width",
892
+ "height",
893
+ "onPointerdown"
894
+ ], zn = [
895
+ "x",
896
+ "y",
897
+ "font-size",
898
+ "transform"
899
+ ], Bn = ["onPointerdown"], Vn = ["d", "stroke-width"], Hn = ["d", "stroke-width"], Un = [
900
+ "cx",
901
+ "cy",
902
+ "r",
903
+ "stroke-width",
904
+ "onPointerdown"
905
+ ], Wn = [
906
+ "d",
907
+ "stroke-width",
908
+ "onPointerdown"
909
+ ], Gn = ["onPointerdown", "onPointerenter"], Kn = [
910
+ "cx",
911
+ "cy",
912
+ "r",
913
+ "stroke-width"
914
+ ], qn = [
915
+ "cx",
916
+ "cy",
917
+ "r"
918
+ ], Jn = {
919
+ key: 0,
920
+ class: "camera-chip"
921
+ }, Yn = [
922
+ "x",
923
+ "y",
924
+ "width",
925
+ "height",
926
+ "rx"
927
+ ], Xn = [
928
+ "x",
929
+ "y",
930
+ "width",
931
+ "height"
932
+ ], Zn = [
933
+ "x",
934
+ "y",
935
+ "font-size"
936
+ ], Qn = [
937
+ "cx",
938
+ "cy",
939
+ "r",
940
+ "stroke-width",
941
+ "onPointerdown"
942
+ ], $n = ["d", "stroke-width"], er = ["onPointerdown", "onPointerenter"], tr = [
943
+ "cx",
944
+ "cy",
945
+ "r",
946
+ "stroke-width"
947
+ ], nr = [
948
+ "x",
949
+ "y",
950
+ "width",
951
+ "height"
952
+ ], rr = {
953
+ key: 0,
954
+ class: "camera-chip"
955
+ }, ir = [
956
+ "x",
957
+ "y",
958
+ "width",
959
+ "height",
960
+ "rx"
961
+ ], ar = [
962
+ "x",
963
+ "y",
964
+ "font-size"
965
+ ], or = ["onPointerenter"], sr = [
966
+ "cx",
967
+ "cy",
968
+ "r",
969
+ "stroke-width"
970
+ ], cr = [
971
+ "cx",
972
+ "cy",
973
+ "r"
974
+ ], lr = {
975
+ key: 0,
976
+ class: "camera-chip"
977
+ }, ur = [
978
+ "x",
979
+ "y",
980
+ "width",
981
+ "height",
982
+ "rx"
983
+ ], dr = [
984
+ "x",
985
+ "y",
986
+ "font-size"
987
+ ], fr = ["onPointerdown"], pr = [
988
+ "cx",
989
+ "cy",
990
+ "r",
991
+ "stroke-width"
992
+ ], mr = ["d", "stroke-width"], hr = [
993
+ "x",
994
+ "y",
995
+ "font-size"
996
+ ], gr = {
997
+ key: 1,
998
+ class: "camera-chip"
999
+ }, _r = [
1000
+ "x",
1001
+ "y",
1002
+ "width",
1003
+ "height",
1004
+ "rx"
1005
+ ], vr = [
1006
+ "x",
1007
+ "y",
1008
+ "font-size"
1009
+ ], yr = ["d", "stroke-width"], br = ["d", "stroke-width"], xr = [
1010
+ "x",
1011
+ "y",
1012
+ "width",
1013
+ "height",
1014
+ "rx",
1015
+ "stroke-width"
1016
+ ], Sr = [
1017
+ "cx",
1018
+ "cy",
1019
+ "r",
1020
+ "stroke-width"
1021
+ ], Cr = {
1022
+ width: "46",
1023
+ height: "46",
1024
+ viewBox: "0 0 46 46"
1025
+ }, wr = ["transform"], Tr = { class: "flex flex-col overflow-hidden floorplan-controls" }, Er = { class: "floorplan-scale flex items-center gap-2 px-2 py-1" }, Dr = ["width"], Or = ["d"], kr = { class: "text-xs text-muted whitespace-nowrap" }, Ar = 60, jr = /*#__PURE__*/ I(/* @__PURE__ */ C({
1026
+ __name: "CuiFloorplanCanvas",
1027
+ props: {
1028
+ mobile: { type: Boolean },
1029
+ bottomInset: {},
1030
+ bottomInsetDragging: { type: Boolean },
1031
+ levels: {},
1032
+ rooms: {},
1033
+ connections: {},
1034
+ cameras: {},
1035
+ sensors: {},
1036
+ levelId: {},
1037
+ selection: {},
1038
+ north: {},
1039
+ readOnly: { type: Boolean }
1040
+ },
1041
+ emits: [
1042
+ "select",
1043
+ "history",
1044
+ "move-room",
1045
+ "resize-room",
1046
+ "move-camera",
1047
+ "rotate-camera",
1048
+ "create-connection",
1049
+ "move-connection",
1050
+ "resize-connection",
1051
+ "drop",
1052
+ "update-north",
1053
+ "request-stairs",
1054
+ "settle-room",
1055
+ "hover-camera",
1056
+ "move-sensor",
1057
+ "hover-sensor"
1058
+ ],
1059
+ setup(a, { expose: l, emit: f }) {
1060
+ let p = a, S = f, ne = te("wrapperRef"), C = w(!1), re = w(!1), ae = te("compassRef"), D = w({
1061
+ x: null,
1062
+ y: null
1063
+ }), oe = w(null), se = w(null), ce = w(null), le = w(null), ue = /* @__PURE__ */ new Set(["motion", "audio"]), de = /* @__PURE__ */ new Set([
1064
+ "object",
1065
+ "face",
1066
+ "licensePlate",
1067
+ "classifier",
1068
+ "objectAssist",
1069
+ "clip"
1070
+ ]), O = null, ge = !1, k = null, { viewport: A, zoomIn: _e, zoomOut: ve, fitBounds: ye } = z(), { sensors: be } = De(), xe = h(() => p.sensors.filter((e) => e.levelId === p.levelId)), Se = h(() => {
1071
+ let e = /* @__PURE__ */ new Map();
1072
+ for (let t of be.value) {
1073
+ let n = String(t.type), r = ue.has(n), i = de.has(n);
1074
+ if (!r && !i || t.getProperty("detected") !== !0) continue;
1075
+ let a = Ke(t, n);
1076
+ for (let n of t.assignedCameraIds.value) {
1077
+ let t = e.get(n);
1078
+ e.set(n, {
1079
+ level: t?.level === "detection" || i ? "detection" : "motion",
1080
+ labels: [.../* @__PURE__ */ new Set([...t?.labels ?? [], ...a])]
1081
+ });
1082
+ }
1083
+ }
1084
+ return e;
1085
+ }), Ce = h(() => {
1086
+ let e = F.value.find((e) => e.id === le.value);
1087
+ if (!e) return null;
1088
+ let t = `${ct(e.width, 1)} x ${ct(e.height, 1)}`;
1089
+ return {
1090
+ text: t,
1091
+ width: st(t),
1092
+ x: e.x + e.width / 2,
1093
+ y: e.y + e.height + 10 / M.value
1094
+ };
1095
+ }), M = h(() => A.value.zoom), N = h(() => ({
1096
+ x: A.value.x,
1097
+ y: A.value.y
1098
+ })), Te = h(() => p.north ?? 0), P = h(() => p.readOnly === !0 || C.value), F = h(() => p.rooms.filter((e) => e.levelId === p.levelId)), I = h(() => p.cameras.filter((e) => e.levelId === p.levelId)), L = h(() => {
1099
+ let e = 4e3, t = [0], n = [0];
1100
+ for (let e of F.value) t.push(e.x, e.x + e.width), n.push(e.y, e.y + e.height);
1101
+ for (let e of I.value) t.push(e.x - e.range, e.x + e.range), n.push(e.y - e.range, e.y + e.range);
1102
+ let r = Math.min(...t) - e, i = Math.min(...n) - e;
1103
+ return {
1104
+ x: r,
1105
+ y: i,
1106
+ width: Math.max(...t) + e - r,
1107
+ height: Math.max(...n) + e - i
1108
+ };
1109
+ }), Ee = [{
1110
+ id: "scene",
1111
+ type: "scene",
1112
+ position: {
1113
+ x: 0,
1114
+ y: 0
1115
+ },
1116
+ draggable: !1,
1117
+ selectable: !1,
1118
+ data: {}
1119
+ }], R = h(() => p.selection?.kind === "room" ? F.value.find((e) => e.id === p.selection?.id) : void 0), Oe = h(() => p.selection?.kind === "camera" ? I.value.find((e) => e.id === p.selection?.id) : void 0), ke = h(() => M.value >= .45), Ae = h(() => {
1120
+ let e = [
1121
+ .5,
1122
+ 1,
1123
+ 2,
1124
+ 5,
1125
+ 10,
1126
+ 20,
1127
+ 50
1128
+ ], t = e.filter((e) => e * 100 * M.value <= 130).pop() ?? e[0];
1129
+ return {
1130
+ meters: t,
1131
+ width: Math.round(t * 100 * M.value),
1132
+ label: `${t} m`
1133
+ };
1134
+ }), je = h(() => p.connections.map((e) => ({
1135
+ connection: e,
1136
+ geometry: ft(e, p.rooms, p.levelId)
1137
+ })).filter((e) => e.geometry !== null)), Me = h(() => new Map([...Ne.value].map(([e, t]) => [e, tt(t.reduce((e, t) => t.width * t.height > e.width * e.height ? t : e))]))), Ne = h(() => {
1138
+ let e = /* @__PURE__ */ new Map();
1139
+ for (let t of F.value) e.set(t.roomId, [...e.get(t.roomId) ?? [], t]);
1140
+ return e;
1141
+ }), Pe = h(() => {
1142
+ let e = /* @__PURE__ */ new Map();
1143
+ for (let t of je.value) {
1144
+ if (t.geometry.kind !== "edge") continue;
1145
+ let n = {
1146
+ x1: t.geometry.x1,
1147
+ y1: t.geometry.y1,
1148
+ x2: t.geometry.x2,
1149
+ y2: t.geometry.y2
1150
+ };
1151
+ for (let r of [t.connection.fromRoomId, t.connection.toRoomId]) e.set(r, [...e.get(r) ?? [], n]);
1152
+ }
1153
+ return e;
1154
+ }), Fe = h(() => [...Ne.value].map(([e, t]) => ({
1155
+ roomId: e,
1156
+ parts: t,
1157
+ ...pt(t, 8 / M.value, Pe.value.get(e) ?? []),
1158
+ outdoor: t.every((e) => e.outdoor),
1159
+ publicSpace: t.every((e) => e.publicSpace),
1160
+ selected: t.some((e) => J("room", e.id))
1161
+ })).sort((e, t) => Number(e.selected) - Number(t.selected))), Ie = h(() => {
1162
+ let e = /* @__PURE__ */ new Map();
1163
+ for (let t of Ne.value.keys()) e.set(t, t);
1164
+ let t = (t) => {
1165
+ let n = t;
1166
+ for (; e.get(n) !== n;) n = e.get(n);
1167
+ return n;
1168
+ }, n = (e) => (Ne.value.get(e) ?? []).every((e) => e.outdoor);
1169
+ for (let r of p.connections) {
1170
+ if (!e.has(r.fromRoomId) || !e.has(r.toRoomId) || !n(r.fromRoomId) || !n(r.toRoomId)) continue;
1171
+ let i = t(r.fromRoomId), a = t(r.toRoomId);
1172
+ i !== a && e.set(i, a);
1173
+ }
1174
+ let r = /* @__PURE__ */ new Map();
1175
+ for (let [e, n] of Ne.value) {
1176
+ let i = t(e);
1177
+ r.set(i, [...r.get(i) ?? [], ...n]);
1178
+ }
1179
+ let i = /* @__PURE__ */ new Map();
1180
+ for (let [e, t] of r) i.set(e, pt(t, 8 / M.value, []).fill);
1181
+ return [...Ne.value.keys()].map((e) => ({
1182
+ roomId: e,
1183
+ path: i.get(t(e)) ?? ""
1184
+ }));
1185
+ }), Le = h(() => je.value.flatMap((e) => {
1186
+ if (e.geometry.kind !== "edge") return [];
1187
+ let { x1: t, y1: n, x2: r, y2: i, wall: a } = e.geometry;
1188
+ return [{
1189
+ id: e.connection.id,
1190
+ type: e.connection.type,
1191
+ wall: a,
1192
+ line: `M ${t} ${n} L ${r} ${i}`,
1193
+ handles: [{
1194
+ x: t,
1195
+ y: n
1196
+ }, {
1197
+ x: r,
1198
+ y: i
1199
+ }]
1200
+ }];
1201
+ })), Re = h(() => {
1202
+ let e = R.value;
1203
+ return !e || P.value ? [] : F.value.filter((t) => t.roomId !== e.roomId).map((t) => ({
1204
+ other: t,
1205
+ wall: ut(e, t)
1206
+ })).filter((e) => e.wall !== null).map((t) => ({
1207
+ fromRoomId: e.roomId,
1208
+ fromShapeId: e.id,
1209
+ roomId: t.other.roomId,
1210
+ shapeId: t.other.id,
1211
+ x: t.wall.x + t.wall.stepX * t.wall.length / 2,
1212
+ y: t.wall.y + t.wall.stepY * t.wall.length / 2
1213
+ }));
1214
+ }), ze = h(() => {
1215
+ let e = /* @__PURE__ */ new Map(), t = (t) => {
1216
+ for (; e.get(t) !== t;) t = e.get(t);
1217
+ return t;
1218
+ };
1219
+ for (let n of p.connections) if (n.type === "stairs") {
1220
+ for (let t of [n.fromRoomId, n.toRoomId]) e.has(t) || e.set(t, t);
1221
+ e.set(t(n.fromRoomId), t(n.toRoomId));
1222
+ }
1223
+ let n = [];
1224
+ for (let r of F.value) {
1225
+ if (!e.has(r.roomId)) continue;
1226
+ let i = t(r.roomId), a = p.cameras.filter((n) => n.roomId !== r.roomId && e.has(n.roomId) && t(n.roomId) === i);
1227
+ a.length && n.push({
1228
+ key: `${r.id}-flight`,
1229
+ label: a.map((e) => e.name).join(", "),
1230
+ x: r.x + r.width / 2,
1231
+ y: r.y + r.height / 2
1232
+ });
1233
+ }
1234
+ return n;
1235
+ }), Be = h(() => {
1236
+ let e = [], t = /* @__PURE__ */ new Map(), n = (n, r, i, a) => {
1237
+ let o = F.value.find((e) => e.id === r) ?? F.value.find((e) => e.roomId === n);
1238
+ if (!o || o.width * M.value < 80 || o.height * M.value < 60) return;
1239
+ let s = t.get(o.id) ?? 0;
1240
+ t.set(o.id, s + 1), e.push({
1241
+ key: i ?? `stairs-${n}`,
1242
+ roomId: n,
1243
+ connectionId: i,
1244
+ direction: a,
1245
+ x: o.x + o.width - (16 + s * 30) / M.value,
1246
+ y: o.y + 16 / M.value
1247
+ });
1248
+ };
1249
+ for (let e of je.value) e.geometry.kind === "badge" && n(e.geometry.roomId, e.geometry.shapeId, e.connection.id, G(e.connection, e.geometry.roomId));
1250
+ return He.value && n(He.value.roomId, He.value.shapeId, void 0, void 0), e;
1251
+ }), He = h(() => {
1252
+ let e = R.value;
1253
+ if (!e || P.value) return null;
1254
+ let t = new Set(p.connections.flatMap((e) => [e.fromRoomId, e.toRoomId].join("|")));
1255
+ return p.rooms.some((n) => n.levelId !== e.levelId && !t.has([e.roomId, n.roomId].join("|")) && !t.has([n.roomId, e.roomId].join("|"))) ? {
1256
+ roomId: e.roomId,
1257
+ shapeId: e.id
1258
+ } : null;
1259
+ }), Ue = h(() => {
1260
+ let e = ne.value?.getBoundingClientRect(), t = e?.width ?? 0, n = e?.height ?? 0;
1261
+ return {
1262
+ left: -N.value.x / M.value,
1263
+ top: -N.value.y / M.value,
1264
+ right: (t - N.value.x) / M.value,
1265
+ bottom: (n - N.value.y) / M.value
1266
+ };
1267
+ }), Ge = h(() => new Set(I.value.filter((e) => Se.value.has(e.id)).map((e) => e.roomId)));
1268
+ function Ke(e, t) {
1269
+ switch (t) {
1270
+ case "object":
1271
+ case "classifier": {
1272
+ let t = e.getProperty("labels");
1273
+ return Array.isArray(t) && t.length ? t : ["other"];
1274
+ }
1275
+ case "face": return ["face"];
1276
+ case "licensePlate": return ["license_plate"];
1277
+ case "motion":
1278
+ case "audio": return ["motion"];
1279
+ case "clip":
1280
+ case "objectAssist": return [];
1281
+ default: return ["other"];
1282
+ }
1283
+ }
1284
+ function qe(e) {
1285
+ return Se.value.get(e)?.level;
1286
+ }
1287
+ function Je(e) {
1288
+ return Se.value.get(e.id)?.labels ?? [];
1289
+ }
1290
+ function Ye(e) {
1291
+ let t = (8 + Je(e).length * 17) / M.value;
1292
+ return {
1293
+ width: t + st(e.name) - 10 / M.value,
1294
+ textOffset: t
1295
+ };
1296
+ }
1297
+ function Xe(e, t) {
1298
+ ce.value = t.id, e.pointerType === "mouse" && S("hover-sensor", {
1299
+ sensorId: t.id,
1300
+ x: e.clientX,
1301
+ y: e.clientY
1302
+ });
1303
+ }
1304
+ function U() {
1305
+ ce.value = null, S("hover-sensor", null);
1306
+ }
1307
+ function W(e) {
1308
+ return be.value.find((t) => t.id === e);
1309
+ }
1310
+ function Ze(e) {
1311
+ return fe(e.sensorType, he(W(e.id)));
1312
+ }
1313
+ function Qe(e) {
1314
+ let t = me(W(e.id));
1315
+ return t ? `${e.name} · ${t}` : e.name;
1316
+ }
1317
+ function G(e, t) {
1318
+ let n = e.fromRoomId === t ? e.toRoomId : e.fromRoomId, r = p.rooms.find((e) => e.roomId === t)?.levelId, i = p.rooms.find((e) => e.roomId === n)?.levelId;
1319
+ if (!r || !i) return;
1320
+ let a = p.levels.findIndex((e) => e.id === r), o = p.levels.findIndex((e) => e.id === i);
1321
+ if (!(a < 0 || o < 0 || a === o)) return o > a ? "↑" : "↓";
1322
+ }
1323
+ function $e(e, t) {
1324
+ if (t.connectionId) return xt(e, t.connectionId);
1325
+ S("request-stairs", {
1326
+ roomId: t.roomId,
1327
+ event: e
1328
+ });
1329
+ }
1330
+ function et(e) {
1331
+ let t = Me.value.get(e.roomId);
1332
+ return t ? [t] : [];
1333
+ }
1334
+ function tt(e) {
1335
+ let t = e.width >= e.height, n = t ? e.width : e.height, r = t ? e.height : e.width, i = 9 / M.value, a = Math.max(Math.min(15, r * .3), i);
1336
+ if (a > r) return null;
1337
+ let o = n - a, s = a * rt, c = e.name;
1338
+ if (s * c.length > o) {
1339
+ let e = Math.floor(o / s) - 1;
1340
+ if (e < 2) return null;
1341
+ c = `${c.slice(0, e)}…`;
1342
+ }
1343
+ return {
1344
+ text: c,
1345
+ size: a,
1346
+ x: e.x + e.width / 2,
1347
+ y: e.y + e.height / 2 + a * .35,
1348
+ upright: t
1349
+ };
1350
+ }
1351
+ function nt(e, t) {
1352
+ e.pointerType === "mouse" && (oe.value = t.id, S("hover-camera", {
1353
+ cameraId: t.id,
1354
+ x: e.clientX,
1355
+ y: e.clientY
1356
+ }));
1357
+ }
1358
+ function at() {
1359
+ oe.value = null, S("hover-camera", null);
1360
+ }
1361
+ function st(e) {
1362
+ return (e.length * 7 + 20) / M.value;
1363
+ }
1364
+ function lt(e, t) {
1365
+ let n = 4 / M.value;
1366
+ return `M ${e - n * 2} ${t + n * 1.5} L ${e - n} ${t + n * 1.5} L ${e - n} ${t} L ${e + n} ${t} L ${e + n} ${t - n * 1.5} L ${e + n * 2} ${t - n * 1.5}`;
1367
+ }
1368
+ function mt(e) {
1369
+ return e * Math.PI / 180;
1370
+ }
1371
+ function J(e, t) {
1372
+ return p.selection?.kind === e && p.selection.id === t;
1373
+ }
1374
+ function ht(e) {
1375
+ let t = mt(e.fov / 2), n = Math.cos(-t) * e.range, r = Math.sin(-t) * e.range, i = Math.cos(t) * e.range, a = Math.sin(t) * e.range, o = +(e.fov > 180);
1376
+ return `M 0 0 L ${n} ${r} A ${e.range} ${e.range} 0 ${o} 1 ${i} ${a} Z`;
1377
+ }
1378
+ function gt(e) {
1379
+ let t = ne.value?.getBoundingClientRect();
1380
+ return t ? {
1381
+ x: (e.clientX - t.left - N.value.x) / M.value,
1382
+ y: (e.clientY - t.top - N.value.y) / M.value
1383
+ } : {
1384
+ x: 0,
1385
+ y: 0
1386
+ };
1387
+ }
1388
+ function Y(e) {
1389
+ return Math.round(e / 10) * 10;
1390
+ }
1391
+ function X(e, t) {
1392
+ return F.value.some((n) => n.id !== t && e.x < n.x + n.width && e.x + e.width > n.x && e.y < n.y + n.height && e.y + e.height > n.y);
1393
+ }
1394
+ function _t(e, t, n) {
1395
+ let r = 10 / M.value, i = n === "end" ? [e.x + e.width] : [e.x, e.x + e.width], a = n === "end" ? [e.y + e.height] : [e.y, e.y + e.height], o, s;
1396
+ for (let e of F.value) if (e.id !== t) {
1397
+ for (let t of i) for (let n of [e.x, e.x + e.width]) {
1398
+ let e = n - t;
1399
+ Math.abs(e) <= r && (o === void 0 || Math.abs(e) < Math.abs(o)) && (o = e);
1400
+ }
1401
+ for (let t of a) for (let n of [e.y, e.y + e.height]) {
1402
+ let e = n - t;
1403
+ Math.abs(e) <= r && (s === void 0 || Math.abs(e) < Math.abs(s)) && (s = e);
1404
+ }
1405
+ }
1406
+ return D.value = {
1407
+ x: o === void 0 ? null : (n === "end" ? e.x + e.width : e.x) + o,
1408
+ y: s === void 0 ? null : (n === "end" ? e.y + e.height : e.y) + s
1409
+ }, n === "end" ? {
1410
+ ...e,
1411
+ width: e.width + (o ?? 0),
1412
+ height: e.height + (s ?? 0)
1413
+ } : {
1414
+ ...e,
1415
+ x: e.x + (o ?? 0),
1416
+ y: e.y + (s ?? 0)
1417
+ };
1418
+ }
1419
+ function vt(e, t, n) {
1420
+ return Math.min(Math.max(e, t), n);
1421
+ }
1422
+ function yt(e, t, n) {
1423
+ let r = Ne.value.get(e);
1424
+ if (!r?.length || r.some((e) => t >= e.x && t <= e.x + e.width && n >= e.y && n <= e.y + e.height)) return {
1425
+ x: t,
1426
+ y: n
1427
+ };
1428
+ let i = {
1429
+ x: t,
1430
+ y: n
1431
+ }, a = Infinity;
1432
+ for (let e of r) {
1433
+ let r = {
1434
+ x: vt(t, e.x, e.x + e.width),
1435
+ y: vt(n, e.y, e.y + e.height)
1436
+ }, o = Math.hypot(r.x - t, r.y - n);
1437
+ o < a && (a = o, i = r);
1438
+ }
1439
+ return i;
1440
+ }
1441
+ function bt(e) {
1442
+ return I.value.filter((t) => t.roomId === e);
1443
+ }
1444
+ function Z(e) {
1445
+ ne.value?.setPointerCapture?.(e.pointerId);
1446
+ }
1447
+ function xt(e, t) {
1448
+ Pt(e, {
1449
+ kind: "connection",
1450
+ id: t
1451
+ });
1452
+ }
1453
+ function St(e, t) {
1454
+ if (Pt(e, {
1455
+ kind: "room",
1456
+ id: t.id
1457
+ }), P.value) return;
1458
+ e.stopPropagation();
1459
+ let n = gt(e);
1460
+ O = {
1461
+ mode: "room",
1462
+ id: t.id,
1463
+ offsetX: n.x - t.x,
1464
+ offsetY: n.y - t.y
1465
+ }, Z(e);
1466
+ }
1467
+ function Ct(e, t) {
1468
+ S("select", {
1469
+ kind: "room",
1470
+ id: t.id
1471
+ }), !P.value && (e.stopPropagation(), le.value = t.id, O = {
1472
+ mode: "resize",
1473
+ id: t.id,
1474
+ originX: t.x,
1475
+ originY: t.y
1476
+ }, Z(e));
1477
+ }
1478
+ function wt(e, t) {
1479
+ if (Pt(e, {
1480
+ kind: "camera",
1481
+ id: t.id
1482
+ }), P.value) return;
1483
+ e.stopPropagation();
1484
+ let n = gt(e);
1485
+ O = {
1486
+ mode: "camera",
1487
+ id: t.id,
1488
+ offsetX: n.x - t.x,
1489
+ offsetY: n.y - t.y
1490
+ }, Z(e);
1491
+ }
1492
+ function Tt(e, t) {
1493
+ S("select", {
1494
+ kind: "camera",
1495
+ id: t.id
1496
+ }), !P.value && (e.stopPropagation(), O = {
1497
+ mode: "rotate",
1498
+ id: t.id
1499
+ }, Z(e));
1500
+ }
1501
+ function Et(e) {
1502
+ if (!O) return;
1503
+ if (O.mode === "north") {
1504
+ let t = ae.value?.getBoundingClientRect();
1505
+ if (!t) return;
1506
+ let n = Math.atan2(e.clientY - (t.top + t.height / 2), e.clientX - (t.left + t.width / 2)) * 180 / Math.PI;
1507
+ S("update-north", Math.round((n + 450) % 360));
1508
+ return;
1509
+ }
1510
+ ge || (ge = !0, S("history"));
1511
+ let t = gt(e);
1512
+ if (O.mode === "room") {
1513
+ let e = O.id, n = F.value.find((t) => t.id === e);
1514
+ if (!n) return;
1515
+ let r = _t({
1516
+ x: Y(t.x - O.offsetX),
1517
+ y: Y(t.y - O.offsetY),
1518
+ width: n.width,
1519
+ height: n.height
1520
+ }, n.id, "both"), i = X(n, n.id) ? {
1521
+ x: r.x,
1522
+ y: r.y
1523
+ } : Dt(n, r);
1524
+ i && S("move-room", {
1525
+ id: n.id,
1526
+ x: i.x,
1527
+ y: i.y
1528
+ });
1529
+ return;
1530
+ }
1531
+ if (O.mode === "resize") {
1532
+ let e = O.id, n = F.value.find((t) => t.id === e);
1533
+ if (!n) return;
1534
+ let r = _t({
1535
+ x: n.x,
1536
+ y: n.y,
1537
+ width: Math.max(60, Y(t.x - O.originX)),
1538
+ height: Math.max(60, Y(t.y - O.originY))
1539
+ }, n.id, "end"), i = X({
1540
+ ...r,
1541
+ height: n.height
1542
+ }, n.id) ? n.width : Math.max(60, r.width), a = X({
1543
+ ...r,
1544
+ width: i
1545
+ }, n.id) ? n.height : Math.max(60, r.height);
1546
+ S("resize-room", {
1547
+ id: n.id,
1548
+ width: i,
1549
+ height: a
1550
+ });
1551
+ return;
1552
+ }
1553
+ if (O.mode === "passage") {
1554
+ let e = O, n = p.connections.find((t) => t.id === e.id);
1555
+ if (!n) return;
1556
+ let r = dt(e.wall, n.offset, n.width), i = Nt(e.wall, {
1557
+ x: (r.x1 + r.x2) / 2,
1558
+ y: (r.y1 + r.y2) / 2
1559
+ }), a = Nt(e.wall, t);
1560
+ S("move-connection", {
1561
+ id: e.id,
1562
+ offset: Math.round(i + (a - e.grab))
1563
+ }), e.grab = a;
1564
+ return;
1565
+ }
1566
+ if (O.mode === "passage-resize") {
1567
+ let e = O, n = p.connections.find((t) => t.id === e.id);
1568
+ if (!n) return;
1569
+ let r = dt(e.wall, n.offset, n.width), i = Nt(e.wall, e.end === 0 ? {
1570
+ x: r.x2,
1571
+ y: r.y2
1572
+ } : {
1573
+ x: r.x1,
1574
+ y: r.y1
1575
+ }), a = Math.min(Math.max(Nt(e.wall, t), 0), e.wall.length), o = Math.min(Math.max(Math.abs(a - i), q.min), q.max), s = a < i ? i - o : i;
1576
+ S("resize-connection", {
1577
+ id: e.id,
1578
+ offset: Math.round(s + o / 2),
1579
+ width: Math.round(o)
1580
+ });
1581
+ return;
1582
+ }
1583
+ if (O.mode === "sensor") {
1584
+ let e = O.id, n = yt(xe.value.find((t) => t.id === e)?.roomId ?? "", Y(t.x - O.offsetX), Y(t.y - O.offsetY));
1585
+ S("move-sensor", {
1586
+ id: e,
1587
+ ...n
1588
+ });
1589
+ return;
1590
+ }
1591
+ if (O.mode === "camera") {
1592
+ let e = O.id, n = yt(I.value.find((t) => t.id === e)?.roomId ?? "", Y(t.x - O.offsetX), Y(t.y - O.offsetY));
1593
+ S("move-camera", {
1594
+ id: e,
1595
+ ...n
1596
+ });
1597
+ return;
1598
+ }
1599
+ let n = O.id, r = I.value.find((e) => e.id === n);
1600
+ if (!r) return;
1601
+ let i = t.x - r.x, a = t.y - r.y;
1602
+ S("rotate-camera", {
1603
+ id: n,
1604
+ rotation: Math.round(Math.atan2(a, i) * 180 / Math.PI),
1605
+ range: Math.round(vt(Math.hypot(i, a), K.min, K.max))
1606
+ });
1607
+ }
1608
+ function Dt(e, t) {
1609
+ for (let n of [
1610
+ t,
1611
+ {
1612
+ ...t,
1613
+ y: e.y
1614
+ },
1615
+ {
1616
+ ...t,
1617
+ x: e.x
1618
+ }
1619
+ ]) if (!X(n, e.id)) return {
1620
+ x: n.x,
1621
+ y: n.y
1622
+ };
1623
+ }
1624
+ function Ot(e) {
1625
+ P.value || (e.stopPropagation(), S("history"), O = { mode: "north" }, ae.value?.setPointerCapture?.(e.pointerId));
1626
+ }
1627
+ function kt(e) {
1628
+ let t = e.dataTransfer?.getData(ot);
1629
+ if (!t || p.readOnly) return;
1630
+ e.preventDefault();
1631
+ let n = JSON.parse(t), r = ne.value?.getBoundingClientRect();
1632
+ r && S("drop", {
1633
+ ...n,
1634
+ x: Y((e.clientX - r.left - N.value.x) / M.value),
1635
+ y: Y((e.clientY - r.top - N.value.y) / M.value)
1636
+ });
1637
+ }
1638
+ function At(e, t) {
1639
+ if (Pt(e, {
1640
+ kind: "sensor",
1641
+ id: t.id
1642
+ }), P.value) return;
1643
+ e.stopPropagation();
1644
+ let n = gt(e);
1645
+ O = {
1646
+ mode: "sensor",
1647
+ id: t.id,
1648
+ offsetX: n.x - t.x,
1649
+ offsetY: n.y - t.y
1650
+ }, Z(e);
1651
+ }
1652
+ function jt(e, t) {
1653
+ Pt(e, {
1654
+ kind: "connection",
1655
+ id: t.id
1656
+ }), !P.value && (e.stopPropagation(), O = {
1657
+ mode: "passage",
1658
+ id: t.id,
1659
+ wall: t.wall,
1660
+ grab: Nt(t.wall, gt(e))
1661
+ }, Z(e));
1662
+ }
1663
+ function Mt(e, t, n) {
1664
+ P.value || (e.stopPropagation(), O = {
1665
+ mode: "passage-resize",
1666
+ id: t.id,
1667
+ wall: t.wall,
1668
+ end: n
1669
+ }, Z(e));
1670
+ }
1671
+ function Nt(e, t) {
1672
+ return (t.x - e.x) * e.stepX + (t.y - e.y) * e.stepY;
1673
+ }
1674
+ function Pt(e, t) {
1675
+ k = {
1676
+ target: t,
1677
+ x: e.clientX,
1678
+ y: e.clientY
1679
+ };
1680
+ }
1681
+ function Ft(e) {
1682
+ le.value = null, k &&= (e && Math.abs(e.clientX - k.x) < 4 && Math.abs(e.clientY - k.y) < 4 && S("select", k.target), null), O?.mode === "room" && ge && S("settle-room", O.id), O = null, ge = !1, D.value = {
1683
+ x: null,
1684
+ y: null
1685
+ };
1686
+ }
1687
+ function Q() {
1688
+ let e = [], t = [];
1689
+ for (let n of F.value) e.push(n.x, n.x + n.width), t.push(n.y, n.y + n.height);
1690
+ for (let n of I.value) e.push(n.x - Ar, n.x + Ar), t.push(n.y - Ar, n.y + Ar);
1691
+ if (!e.length) return;
1692
+ let n = Math.min(...e), r = Math.min(...t);
1693
+ ye({
1694
+ x: n,
1695
+ y: r,
1696
+ width: Math.max(Math.max(...e) - n, 1),
1697
+ height: Math.max(Math.max(...t) - r, 1)
1698
+ }, { padding: .15 });
1699
+ }
1700
+ return ee(() => p.levelId, () => o(Q)), ie(() => {
1701
+ window.addEventListener("pointerup", Ft), o(Q);
1702
+ }), t(() => window.removeEventListener("pointerup", Ft)), l({ fit: Q }), (t, o) => {
1703
+ let l = Ve, f = V, p = bn, h = j, ee = _n, te = H, w = E;
1704
+ return r(), _("div", {
1705
+ ref_key: "wrapperRef",
1706
+ ref: ne,
1707
+ class: s(["floorplan-canvas relative w-full h-full overflow-hidden border-left-color border-bottom-color border-right-color rounded-b-xl", { "rounded-none! border-0!": a.mobile }]),
1708
+ onPointermove: Et,
1709
+ onPointerup: Ft,
1710
+ onPointercancel: Ft,
1711
+ onDrop: kt,
1712
+ onDragover: o[14] ||= e(() => {}, ["prevent"]),
1713
+ onDragenter: o[15] ||= e(() => {}, ["prevent"])
1714
+ }, [
1715
+ T(m(We), {
1716
+ nodes: Ee,
1717
+ "nodes-draggable": !1,
1718
+ "nodes-connectable": !1,
1719
+ "elements-selectable": !1,
1720
+ "zoom-on-double-click": !1,
1721
+ "min-zoom": m(it).min,
1722
+ "max-zoom": m(it).max,
1723
+ "default-viewport": {
1724
+ x: 0,
1725
+ y: 0,
1726
+ zoom: 1
1727
+ },
1728
+ class: "floorplan-flow",
1729
+ onPaneClick: o[3] ||= (e) => S("select", null)
1730
+ }, {
1731
+ "node-scene": g(() => [(r(), _("svg", {
1732
+ class: "floorplan-scene",
1733
+ style: v({
1734
+ left: `${m(L).x}px`,
1735
+ top: `${m(L).y}px`,
1736
+ width: `${m(L).width}px`,
1737
+ height: `${m(L).height}px`
1738
+ })
1739
+ }, [b("defs", null, [
1740
+ b("pattern", {
1741
+ id: "floorplan-public",
1742
+ width: 14 / m(M),
1743
+ height: 14 / m(M),
1744
+ patternUnits: "userSpaceOnUse",
1745
+ patternTransform: "rotate(45)"
1746
+ }, [b("rect", {
1747
+ width: 14 / m(M),
1748
+ height: 14 / m(M),
1749
+ class: "public-base"
1750
+ }, null, 8, Sn), b("line", {
1751
+ x1: "0",
1752
+ y1: "0",
1753
+ x2: "0",
1754
+ y2: 14 / m(M),
1755
+ class: "public-hatch",
1756
+ "stroke-width": 1.5 / m(M)
1757
+ }, null, 8, Cn)], 8, xn),
1758
+ (r(!0), _(y, null, n(m(Ie), (e) => (r(), _("clipPath", {
1759
+ id: `floorplan-sight-${e.roomId}`,
1760
+ key: e.roomId
1761
+ }, [b("path", { d: e.path }, null, 8, Tn)], 8, wn))), 128)),
1762
+ b("pattern", {
1763
+ id: "floorplan-gaps-hatch",
1764
+ width: 10 / m(M),
1765
+ height: 10 / m(M),
1766
+ patternUnits: "userSpaceOnUse",
1767
+ patternTransform: "rotate(-45)"
1768
+ }, [b("line", {
1769
+ x1: "0",
1770
+ y1: "0",
1771
+ x2: "0",
1772
+ y2: 10 / m(M),
1773
+ class: "gaps-hatch",
1774
+ "stroke-width": 1.5 / m(M)
1775
+ }, null, 8, Dn)], 8, En),
1776
+ m(re) ? (r(), _("mask", {
1777
+ key: 0,
1778
+ id: "floorplan-gaps",
1779
+ maskUnits: "userSpaceOnUse",
1780
+ x: m(L).x,
1781
+ y: m(L).y,
1782
+ width: m(L).width,
1783
+ height: m(L).height
1784
+ }, [(r(!0), _(y, null, n(m(Fe), (e) => (r(), _(y, { key: `gap-room-${e.roomId}` }, [e.publicSpace ? d("", !0) : (r(), _("path", {
1785
+ key: 0,
1786
+ d: e.fill,
1787
+ fill: "white"
1788
+ }, null, 8, kn))], 64))), 128)), (r(!0), _(y, null, n(m(Ie), (e) => (r(), _("g", {
1789
+ key: `gap-sight-${e.roomId}`,
1790
+ "clip-path": `url(#floorplan-sight-${e.roomId})`
1791
+ }, [(r(!0), _(y, null, n(bt(e.roomId), (e) => (r(), _("path", {
1792
+ key: `gap-cone-${e.id}`,
1793
+ d: ht(e),
1794
+ fill: "black",
1795
+ transform: `translate(${e.x} ${e.y}) rotate(${e.rotation})`
1796
+ }, null, 8, jn))), 128))], 8, An))), 128))], 8, On)) : d("", !0)
1797
+ ]), b("g", { transform: `translate(${-m(L).x} ${-m(L).y})` }, [
1798
+ (r(!0), _(y, null, n(m(Fe), (e) => (r(), _("g", { key: e.roomId }, [b("path", {
1799
+ d: e.fill,
1800
+ class: s(["room", {
1801
+ "room-outdoor": e.outdoor && !e.publicSpace,
1802
+ "room-public": e.publicSpace,
1803
+ "room-active": m(Ge).has(e.roomId)
1804
+ }])
1805
+ }, null, 10, Nn), b("path", {
1806
+ d: e.wall,
1807
+ class: s(["room-wall", {
1808
+ "room-selected": e.selected,
1809
+ "room-public-wall": e.publicSpace
1810
+ }]),
1811
+ "stroke-width": (e.selected ? 2.5 : 1.5) / m(M)
1812
+ }, null, 10, Pn)]))), 128)),
1813
+ (r(!0), _(y, null, n(m(Ie), (e) => (r(), _("g", {
1814
+ key: `sight-${e.roomId}`,
1815
+ "clip-path": `url(#floorplan-sight-${e.roomId})`
1816
+ }, [(r(!0), _(y, null, n(bt(e.roomId), (e) => (r(), _("path", {
1817
+ key: e.id,
1818
+ d: ht(e),
1819
+ class: s(["cone", [`cone-${qe(e.id) ?? "idle"}`, { "cone-selected": J("camera", e.id) }]]),
1820
+ transform: `translate(${e.x} ${e.y}) rotate(${e.rotation})`
1821
+ }, null, 10, In))), 128))], 8, Fn))), 128)),
1822
+ m(re) ? (r(), _("rect", {
1823
+ key: 0,
1824
+ x: m(L).x,
1825
+ y: m(L).y,
1826
+ width: m(L).width,
1827
+ height: m(L).height,
1828
+ fill: "url(#floorplan-gaps-hatch)",
1829
+ mask: "url(#floorplan-gaps)",
1830
+ class: "gaps-layer"
1831
+ }, null, 8, Ln)) : d("", !0),
1832
+ (r(!0), _(y, null, n(m(Fe), (e) => (r(), _("g", { key: `hits-${e.roomId}` }, [(r(!0), _(y, null, n(e.parts, (e) => (r(), _("rect", {
1833
+ key: e.id,
1834
+ x: e.x,
1835
+ y: e.y,
1836
+ width: e.width,
1837
+ height: e.height,
1838
+ class: s(["room-hit", { nopan: !m(P) }]),
1839
+ onPointerdown: (t) => St(t, e)
1840
+ }, null, 42, Rn))), 128)), (r(!0), _(y, null, n(et(e), (e) => (r(), _("text", {
1841
+ key: e.text,
1842
+ x: e.x,
1843
+ y: e.y,
1844
+ "font-size": e.size,
1845
+ transform: e.upright ? void 0 : `rotate(-90 ${e.x} ${e.y})`,
1846
+ class: "room-label",
1847
+ "text-anchor": "middle"
1848
+ }, i(e.text), 9, zn))), 128))]))), 128)),
1849
+ (r(!0), _(y, null, n(m(Le), (e) => (r(), _("g", {
1850
+ key: e.id,
1851
+ class: s({ nopan: !m(P) }),
1852
+ onPointerdown: (t) => jt(t, e)
1853
+ }, [
1854
+ b("path", {
1855
+ d: e.line,
1856
+ class: "connection-hit",
1857
+ "stroke-width": 24 / m(M)
1858
+ }, null, 8, Vn),
1859
+ b("path", {
1860
+ d: e.line,
1861
+ class: s(["connection", [`connection-${e.type}`, { "connection-selected": J("connection", e.id) }]]),
1862
+ "stroke-width": 7 / m(M)
1863
+ }, null, 10, Hn),
1864
+ (r(!0), _(y, null, n(J("connection", e.id) && !m(P) ? e.handles : [], (t, n) => (r(), _("circle", {
1865
+ key: n,
1866
+ cx: t.x,
1867
+ cy: t.y,
1868
+ r: 7 / m(M),
1869
+ class: "passage-handle nopan",
1870
+ "stroke-width": 2 / m(M),
1871
+ onPointerdown: (t) => Mt(t, e, n)
1872
+ }, null, 40, Un))), 128))
1873
+ ], 42, Bn))), 128)),
1874
+ (r(!0), _(y, null, n(m(je), (e) => (r(), _(y, { key: e.connection.id }, [e.geometry.kind === "link" ? (r(), _("path", {
1875
+ key: 0,
1876
+ d: `M ${e.geometry.x1} ${e.geometry.y1} L ${e.geometry.x2} ${e.geometry.y2}`,
1877
+ class: s(["connection connection-stairs", { "connection-selected": J("connection", e.connection.id) }]),
1878
+ "stroke-width": 2 / m(M),
1879
+ onPointerdown: (t) => xt(t, e.connection.id)
1880
+ }, null, 42, Wn)) : d("", !0)], 64))), 128)),
1881
+ (r(!0), _(y, null, n(m(I), (e) => (r(), _("g", {
1882
+ key: e.id,
1883
+ class: s({ nopan: !m(P) }),
1884
+ onPointerdown: (t) => wt(t, e),
1885
+ onPointerenter: (t) => nt(t, e),
1886
+ onPointerleave: at
1887
+ }, [
1888
+ b("circle", {
1889
+ cx: e.x,
1890
+ cy: e.y,
1891
+ r: 13 / m(M),
1892
+ class: s(["camera-body", [`camera-${qe(e.id) ?? "idle"}`, { "camera-selected": J("camera", e.id) }]]),
1893
+ "stroke-width": 2 / m(M)
1894
+ }, null, 10, Kn),
1895
+ b("circle", {
1896
+ cx: e.x,
1897
+ cy: e.y,
1898
+ r: 4 / m(M),
1899
+ class: "camera-lens"
1900
+ }, null, 8, qn),
1901
+ m(oe) === e.id || J("camera", e.id) || m(Se).has(e.id) ? (r(), _("g", Jn, [
1902
+ b("rect", {
1903
+ x: e.x - Ye(e).width / 2,
1904
+ y: e.y - 42 / m(M),
1905
+ width: Ye(e).width,
1906
+ height: 20 / m(M),
1907
+ rx: 10 / m(M)
1908
+ }, null, 8, Yn),
1909
+ (r(!0), _(y, null, n(Je(e), (t, n) => (r(), _("foreignObject", {
1910
+ key: t,
1911
+ x: e.x - Ye(e).width / 2 + (8 + n * 17) / m(M),
1912
+ y: e.y - 39.5 / m(M),
1913
+ width: 15 / m(M),
1914
+ height: 15 / m(M),
1915
+ class: "chip-glyph"
1916
+ }, [(r(), u(c(m(we)(t).icon), {
1917
+ width: "100%",
1918
+ height: "100%"
1919
+ }))], 8, Xn))), 128)),
1920
+ b("text", {
1921
+ x: e.x - Ye(e).width / 2 + Ye(e).textOffset,
1922
+ y: e.y - 28 / m(M),
1923
+ "font-size": 12 / m(M)
1924
+ }, i(e.name), 9, Zn)
1925
+ ])) : d("", !0)
1926
+ ], 42, Gn))), 128)),
1927
+ (r(!0), _(y, null, n(m(ke) ? m(Re) : [], (t) => (r(), _("g", { key: t.roomId }, [b("circle", {
1928
+ cx: t.x,
1929
+ cy: t.y,
1930
+ r: 11 / m(M),
1931
+ class: "connection-ghost nopan",
1932
+ "stroke-width": 1.5 / m(M),
1933
+ onPointerdown: e((e) => S("create-connection", {
1934
+ fromRoomId: t.fromRoomId,
1935
+ toRoomId: t.roomId,
1936
+ fromShapeId: t.fromShapeId,
1937
+ toShapeId: t.shapeId
1938
+ }), ["stop"])
1939
+ }, null, 40, Qn), b("path", {
1940
+ d: `M ${t.x - 5 / m(M)} ${t.y} L ${t.x + 5 / m(M)} ${t.y} M ${t.x} ${t.y - 5 / m(M)} L ${t.x} ${t.y + 5 / m(M)}`,
1941
+ class: "connection-ghost-plus",
1942
+ "stroke-width": 1.5 / m(M)
1943
+ }, null, 8, $n)]))), 128)),
1944
+ (r(!0), _(y, null, n(m(xe), (e) => (r(), _("g", {
1945
+ key: `sensor-${e.id}`,
1946
+ class: s({ nopan: !m(P) }),
1947
+ onPointerdown: (t) => At(t, e),
1948
+ onPointerenter: (t) => Xe(t, e),
1949
+ onPointerleave: U
1950
+ }, [
1951
+ b("circle", {
1952
+ cx: e.x,
1953
+ cy: e.y,
1954
+ r: 11 / m(M),
1955
+ class: s(["sensor-body", { "sensor-selected": J("sensor", e.id) }]),
1956
+ "stroke-width": 2 / m(M)
1957
+ }, null, 10, tr),
1958
+ (r(), _("foreignObject", {
1959
+ x: e.x - 7 / m(M),
1960
+ y: e.y - 7 / m(M),
1961
+ width: 14 / m(M),
1962
+ height: 14 / m(M),
1963
+ class: "sensor-glyph"
1964
+ }, [(r(), u(c(m(pe)(e.sensorType, W(e.id))), {
1965
+ width: "100%",
1966
+ height: "100%",
1967
+ style: v(Ze(e))
1968
+ }, null, 8, ["style"]))], 8, nr)),
1969
+ m(ce) === e.id || J("sensor", e.id) ? (r(), _("g", rr, [b("rect", {
1970
+ x: e.x - st(Qe(e)) / 2,
1971
+ y: e.y - 42 / m(M),
1972
+ width: st(Qe(e)),
1973
+ height: 20 / m(M),
1974
+ rx: 10 / m(M)
1975
+ }, null, 8, ir), b("text", {
1976
+ x: e.x,
1977
+ y: e.y - 28 / m(M),
1978
+ "text-anchor": "middle",
1979
+ "font-size": 12 / m(M)
1980
+ }, i(Qe(e)), 9, ar)])) : d("", !0)
1981
+ ], 42, er))), 128)),
1982
+ (r(!0), _(y, null, n(m(ze), (e) => (r(), _("g", {
1983
+ key: e.key,
1984
+ class: "flight-camera",
1985
+ onPointerenter: (t) => se.value = e.key,
1986
+ onPointerleave: o[0] ||= (e) => se.value = null
1987
+ }, [
1988
+ b("circle", {
1989
+ cx: e.x,
1990
+ cy: e.y,
1991
+ r: 11 / m(M),
1992
+ class: "flight-camera-body",
1993
+ "stroke-width": 1.5 / m(M)
1994
+ }, null, 8, sr),
1995
+ b("circle", {
1996
+ cx: e.x,
1997
+ cy: e.y,
1998
+ r: 3.5 / m(M),
1999
+ class: "flight-camera-lens"
2000
+ }, null, 8, cr),
2001
+ m(se) === e.key ? (r(), _("g", lr, [b("rect", {
2002
+ x: e.x - st(e.label) / 2,
2003
+ y: e.y - 42 / m(M),
2004
+ width: st(e.label),
2005
+ height: 20 / m(M),
2006
+ rx: 10 / m(M)
2007
+ }, null, 8, ur), b("text", {
2008
+ x: e.x,
2009
+ y: e.y - 28 / m(M),
2010
+ "text-anchor": "middle",
2011
+ "font-size": 12 / m(M)
2012
+ }, i(e.label), 9, dr)])) : d("", !0)
2013
+ ], 40, or))), 128)),
2014
+ (r(!0), _(y, null, n(m(Be), (e) => (r(), _("g", {
2015
+ key: e.key,
2016
+ class: s({ nopan: !m(P) }),
2017
+ onPointerdown: (t) => $e(t, e)
2018
+ }, [
2019
+ b("circle", {
2020
+ cx: e.x,
2021
+ cy: e.y,
2022
+ r: 12 / m(M),
2023
+ class: s([e.connectionId ? "connection-badge" : "connection-ghost", { "connection-selected": e.connectionId && J("connection", e.connectionId) }]),
2024
+ "stroke-width": (e.connectionId ? 2 : 1.5) / m(M)
2025
+ }, null, 10, pr),
2026
+ b("path", {
2027
+ d: lt(e.x, e.y),
2028
+ class: "badge-glyph",
2029
+ "stroke-width": 1.5 / m(M),
2030
+ fill: "none",
2031
+ "stroke-linejoin": "round"
2032
+ }, null, 8, mr),
2033
+ e.direction ? (r(), _("text", {
2034
+ key: 0,
2035
+ x: e.x + 13 / m(M),
2036
+ y: e.y - 7 / m(M),
2037
+ class: "badge-direction",
2038
+ "font-size": 12 / m(M)
2039
+ }, i(e.direction), 9, hr)) : d("", !0),
2040
+ m(Ce) ? (r(), _("g", gr, [b("rect", {
2041
+ x: m(Ce).x - m(Ce).width / 2,
2042
+ y: m(Ce).y,
2043
+ width: m(Ce).width,
2044
+ height: 20 / m(M),
2045
+ rx: 10 / m(M)
2046
+ }, null, 8, _r), b("text", {
2047
+ x: m(Ce).x,
2048
+ y: m(Ce).y + 14 / m(M),
2049
+ "text-anchor": "middle",
2050
+ "font-size": 12 / m(M)
2051
+ }, i(m(Ce).text), 9, vr)])) : d("", !0)
2052
+ ], 42, fr))), 128)),
2053
+ m(D).x === null ? d("", !0) : (r(), _("path", {
2054
+ key: 1,
2055
+ d: `M ${m(D).x} ${m(Ue).top} L ${m(D).x} ${m(Ue).bottom}`,
2056
+ class: "guide",
2057
+ "stroke-width": 1 / m(M)
2058
+ }, null, 8, yr)),
2059
+ m(D).y === null ? d("", !0) : (r(), _("path", {
2060
+ key: 2,
2061
+ d: `M ${m(Ue).left} ${m(D).y} L ${m(Ue).right} ${m(D).y}`,
2062
+ class: "guide",
2063
+ "stroke-width": 1 / m(M)
2064
+ }, null, 8, br)),
2065
+ m(R) && !m(P) ? (r(), _("rect", {
2066
+ key: 3,
2067
+ x: m(R).x + m(R).width - 7 / m(M),
2068
+ y: m(R).y + m(R).height - 7 / m(M),
2069
+ width: 14 / m(M),
2070
+ height: 14 / m(M),
2071
+ rx: 3 / m(M),
2072
+ class: "handle nopan",
2073
+ "stroke-width": 1.5 / m(M),
2074
+ onPointerdown: o[1] ||= (e) => Ct(e, m(R))
2075
+ }, null, 40, xr)) : d("", !0),
2076
+ m(Oe) && !m(P) ? (r(), _("circle", {
2077
+ key: 4,
2078
+ cx: m(Oe).x + Math.cos(mt(m(Oe).rotation)) * m(Oe).range,
2079
+ cy: m(Oe).y + Math.sin(mt(m(Oe).rotation)) * m(Oe).range,
2080
+ r: 9 / m(M),
2081
+ class: "handle nopan",
2082
+ "stroke-width": 1.5 / m(M),
2083
+ onPointerdown: o[2] ||= (e) => Tt(e, m(Oe))
2084
+ }, null, 40, Sr)) : d("", !0)
2085
+ ], 8, Mn)], 4))]),
2086
+ default: g(() => [T(m(B), {
2087
+ gap: m(16),
2088
+ size: m(1),
2089
+ "pattern-color": "#81818a"
2090
+ }, null, 8, ["gap", "size"])]),
2091
+ _: 1
2092
+ }, 8, ["min-zoom", "max-zoom"]),
2093
+ x((r(), _("div", {
2094
+ ref_key: "compassRef",
2095
+ ref: ae,
2096
+ class: s(["floorplan-compass absolute top-3 right-3", { "cursor-grab active:cursor-grabbing": !m(P) }]),
2097
+ onPointerdown: e(Ot, ["stop"])
2098
+ }, [(r(), _("svg", Cr, [o[17] ||= b("circle", {
2099
+ cx: "23",
2100
+ cy: "23",
2101
+ r: "21",
2102
+ class: "compass-ring",
2103
+ "stroke-width": "1"
2104
+ }, null, -1), b("g", { transform: `rotate(${m(Te)} 23 23)` }, [...o[16] ||= [b("path", {
2105
+ d: "M 23 6 L 27 23 L 23 19 L 19 23 Z",
2106
+ class: "compass-needle"
2107
+ }, null, -1), b("text", {
2108
+ x: "23",
2109
+ y: "41",
2110
+ "text-anchor": "middle",
2111
+ class: "compass-label",
2112
+ "font-size": "9"
2113
+ }, "N", -1)]], 8, wr)]))], 34)), [[
2114
+ w,
2115
+ { value: m(P) ? t.$t("views.floorplan.north_reading", { value: m(Te) }) : t.$t("views.floorplan.north_hint") },
2116
+ void 0,
2117
+ { left: !0 }
2118
+ ]]),
2119
+ b("div", {
2120
+ class: "absolute left-3 flex flex-col gap-2 items-start",
2121
+ style: v({
2122
+ bottom: `${12 + (a.bottomInset ?? 0)}px`,
2123
+ transition: a.bottomInsetDragging ? "none" : "bottom 0.2s ease-in-out"
2124
+ })
2125
+ }, [b("div", Tr, [
2126
+ x((r(), _("button", {
2127
+ type: "button",
2128
+ class: "control-button",
2129
+ onPointerdown: o[4] ||= e(() => {}, ["stop"]),
2130
+ onClick: o[5] ||= e((e) => m(_e)(), ["stop"])
2131
+ }, [T(l, { class: "w-4 h-4" })], 32)), [[
2132
+ w,
2133
+ { value: t.$t("views.floorplan.zoom_in") },
2134
+ void 0,
2135
+ { right: !0 }
2136
+ ]]),
2137
+ x((r(), _("button", {
2138
+ type: "button",
2139
+ class: "control-button",
2140
+ onPointerdown: o[6] ||= e(() => {}, ["stop"]),
2141
+ onClick: o[7] ||= e((e) => m(ve)(), ["stop"])
2142
+ }, [T(f, { class: "w-4 h-4" })], 32)), [[
2143
+ w,
2144
+ { value: t.$t("views.floorplan.zoom_out") },
2145
+ void 0,
2146
+ { right: !0 }
2147
+ ]]),
2148
+ x((r(), _("button", {
2149
+ type: "button",
2150
+ class: "control-button",
2151
+ onPointerdown: o[8] ||= e(() => {}, ["stop"]),
2152
+ onClick: o[9] ||= e((e) => Q(), ["stop"])
2153
+ }, [T(p, { class: "w-4 h-4" })], 32)), [[
2154
+ w,
2155
+ { value: t.$t("views.floorplan.fit") },
2156
+ void 0,
2157
+ { right: !0 }
2158
+ ]]),
2159
+ x((r(), _("button", {
2160
+ type: "button",
2161
+ class: s(["control-button", { "control-active": m(C) }]),
2162
+ onPointerdown: o[10] ||= e(() => {}, ["stop"]),
2163
+ onClick: o[11] ||= e((e) => C.value = !m(C), ["stop"])
2164
+ }, [m(C) ? (r(), u(h, {
2165
+ key: 0,
2166
+ class: "w-4 h-4"
2167
+ })) : (r(), u(ee, {
2168
+ key: 1,
2169
+ class: "w-4 h-4"
2170
+ }))], 34)), [[
2171
+ w,
2172
+ { value: m(C) ? t.$t("views.floorplan.unlock") : t.$t("views.floorplan.lock") },
2173
+ void 0,
2174
+ { right: !0 }
2175
+ ]]),
2176
+ x((r(), _("button", {
2177
+ type: "button",
2178
+ class: s(["control-button", { "control-active": m(re) }]),
2179
+ onPointerdown: o[12] ||= e(() => {}, ["stop"]),
2180
+ onClick: o[13] ||= e((e) => re.value = !m(re), ["stop"])
2181
+ }, [T(te, { class: "w-4 h-4" })], 34)), [[
2182
+ w,
2183
+ { value: t.$t("views.floorplan.blind_spots") },
2184
+ void 0,
2185
+ { right: !0 }
2186
+ ]])
2187
+ ]), b("div", Er, [(r(), _("svg", {
2188
+ width: m(Ae).width,
2189
+ height: "10",
2190
+ class: "shrink-0"
2191
+ }, [b("path", {
2192
+ d: `M 1 1 L 1 9 M 1 5 L ${m(Ae).width - 1} 5 M ${m(Ae).width - 1} 1 L ${m(Ae).width - 1} 9`,
2193
+ class: "scale-line",
2194
+ "stroke-width": "1"
2195
+ }, null, 8, Or)], 8, Dr)), b("span", kr, i(m(Ae).label), 1)])], 4)
2196
+ ], 34);
2197
+ };
2198
+ }
2199
+ }), [["__scopeId", "data-v-27e461bb"]]), Mr = {
2200
+ viewBox: "0 0 24 24",
2201
+ width: "1.2em",
2202
+ height: "1.2em"
2203
+ };
2204
+ function Nr(e, t) {
2205
+ return r(), _("svg", Mr, [...t[0] ||= [b("path", {
2206
+ fill: "currentColor",
2207
+ d: "M13 19c0-.3 0-.7.1-1H8v-2H6V8h2V6h8v2h2v5.1c.3-.1.7-.1 1-.1s.7 0 1 .1V8h2V2h-6v2H8V2H2v6h2v8H2v6h6v-2h5.1c-.1-.3-.1-.7-.1-1m5-15h2v2h-2zM4 4h2v2H4zm2 16H4v-2h2zm14-5v3h3v2h-3v3h-2v-3h-3v-2h3v-3z"
2208
+ }, null, -1)]]);
2209
+ }
2210
+ var Pr = l({
2211
+ name: "mdi-vector-square-plus",
2212
+ render: Nr
2213
+ }), Fr = {
2214
+ key: 0,
2215
+ class: "text-xs font-semibold text-muted uppercase tracking-wider mb-3"
2216
+ }, Ir = { class: "mb-4" }, Lr = { class: "text-xs font-medium text-muted mb-2" }, Rr = ["draggable"], zr = { class: "flex items-center gap-2.5 flex-1 min-w-0 px-3 py-2.5" }, Br = { class: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0 palette-icon" }, Vr = { class: "text-[13px] font-medium truncate text-color leading-tight" }, Hr = {
2217
+ key: 0,
2218
+ class: "flex flex-col gap-1.5 mt-1.5"
2219
+ }, Ur = [
2220
+ "draggable",
2221
+ "onDragstart",
2222
+ "onClick"
2223
+ ], Wr = { class: "flex items-center gap-2.5 flex-1 min-w-0 px-3 py-2.5" }, Gr = { class: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0 palette-icon" }, Kr = { class: "text-[13px] font-medium truncate text-color leading-tight" }, qr = { class: "mb-4" }, Jr = { class: "text-xs font-medium text-muted mb-2" }, Yr = {
2224
+ key: 0,
2225
+ class: "text-xs text-muted px-1"
2226
+ }, Xr = {
2227
+ key: 1,
2228
+ class: "flex flex-col gap-1.5"
2229
+ }, Zr = [
2230
+ "draggable",
2231
+ "onDragstart",
2232
+ "onClick"
2233
+ ], Qr = { class: "flex items-center gap-2.5 flex-1 min-w-0 px-3 py-2.5" }, $r = { class: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0 palette-icon" }, ei = { class: "text-[13px] font-medium truncate text-color leading-tight" }, ti = { class: "text-xs font-medium text-muted mb-2" }, ni = {
2234
+ key: 0,
2235
+ class: "text-xs text-muted px-1"
2236
+ }, ri = {
2237
+ key: 1,
2238
+ class: "flex flex-col gap-1.5"
2239
+ }, ii = [
2240
+ "draggable",
2241
+ "onDragstart",
2242
+ "onClick"
2243
+ ], ai = { class: "flex items-center gap-2.5 flex-1 min-w-0 px-3 py-2.5" }, oi = { class: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0 palette-icon" }, si = { class: "flex flex-col min-w-0" }, ci = { class: "text-[13px] font-medium truncate text-color leading-tight" }, li = {
2244
+ key: 0,
2245
+ class: "text-[11px] text-muted truncate leading-tight"
2246
+ }, ui = /*#__PURE__*/ I(/* @__PURE__ */ C({
2247
+ __name: "CuiFloorplanPalette",
2248
+ props: {
2249
+ cameras: {},
2250
+ sensors: {},
2251
+ rooms: {},
2252
+ mode: { default: "drag" },
2253
+ disabled: { type: Boolean }
2254
+ },
2255
+ emits: ["pick"],
2256
+ setup(e, { emit: t }) {
2257
+ let a = e, o = t;
2258
+ function l(e, t, n, r, i) {
2259
+ a.disabled || !e.dataTransfer || (e.dataTransfer.setData(ot, JSON.stringify({
2260
+ kind: t,
2261
+ cameraId: n,
2262
+ roomId: r,
2263
+ sensorId: i?.id,
2264
+ sensorType: i?.sensorType
2265
+ })), e.dataTransfer.effectAllowed = "move");
2266
+ }
2267
+ return (t, a) => {
2268
+ let f = ae, p = $e, h = Pr, ee = Be, v = E;
2269
+ return r(), _("div", { class: s(["overflow-y-auto p-3", e.mode === "drag" ? "h-full" : ""]) }, [
2270
+ e.mode === "drag" ? (r(), _("div", Fr, i(t.$t("views.floorplan.palette")), 1)) : d("", !0),
2271
+ e.disabled ? (r(), u(f, {
2272
+ key: 1,
2273
+ severity: "secondary",
2274
+ variant: "simple",
2275
+ size: "small",
2276
+ class: "cui-input-hint mb-3"
2277
+ }, {
2278
+ default: g(() => [S(i(t.$t("views.floorplan.needs_level")), 1)]),
2279
+ _: 1
2280
+ })) : d("", !0),
2281
+ b("div", Ir, [
2282
+ b("div", Lr, i(t.$t("views.floorplan.section_room")), 1),
2283
+ b("div", {
2284
+ class: s(["floorplan-palette-item", [e.mode === "drag" ? "cursor-grab active:cursor-grabbing" : "cursor-pointer", { "palette-disabled": e.disabled }]]),
2285
+ draggable: e.mode === "drag" && !e.disabled,
2286
+ onDragstart: a[0] ||= (e) => l(e, "room"),
2287
+ onClick: a[1] ||= (t) => !e.disabled && o("pick", { kind: "room" })
2288
+ }, [b("div", zr, [b("div", Br, [T(p, { class: "w-4 h-4" })]), b("span", Vr, i(t.$t("views.floorplan.new_room")), 1)])], 42, Rr),
2289
+ e.rooms.length ? (r(), _("div", Hr, [(r(!0), _(y, null, n(e.rooms, (n) => x((r(), _("div", {
2290
+ key: n.id,
2291
+ class: s(["floorplan-palette-item", [e.mode === "drag" ? "cursor-grab active:cursor-grabbing" : "cursor-pointer", { "palette-disabled": e.disabled }]]),
2292
+ draggable: e.mode === "drag" && !e.disabled,
2293
+ onDragstart: (e) => l(e, "room", void 0, n.id),
2294
+ onClick: (t) => !e.disabled && o("pick", {
2295
+ kind: "room",
2296
+ roomId: n.id
2297
+ })
2298
+ }, [b("div", Wr, [b("div", Gr, [T(h, { class: "w-4 h-4" })]), b("span", Kr, i(n.name), 1)])], 42, Ur)), [[
2299
+ v,
2300
+ { value: t.$t("views.floorplan.room_not_drawn") },
2301
+ void 0,
2302
+ { right: !0 }
2303
+ ]])), 128))])) : d("", !0)
2304
+ ]),
2305
+ b("div", qr, [b("div", Jr, i(t.$t("views.floorplan.section_cameras")), 1), e.cameras.length ? (r(), _("div", Xr, [(r(!0), _(y, null, n(e.cameras, (t) => (r(), _("div", {
2306
+ key: t.id,
2307
+ class: s(["floorplan-palette-item", [e.mode === "drag" ? "cursor-grab active:cursor-grabbing" : "cursor-pointer", { "palette-disabled": e.disabled }]]),
2308
+ draggable: e.mode === "drag" && !e.disabled,
2309
+ onDragstart: (e) => l(e, "camera", t.id),
2310
+ onClick: (n) => !e.disabled && o("pick", {
2311
+ kind: "camera",
2312
+ cameraId: t.id
2313
+ })
2314
+ }, [b("div", Qr, [b("div", $r, [T(ee, { class: "w-4 h-4" })]), b("span", ei, i(t.name), 1)])], 42, Zr))), 128))])) : (r(), _("span", Yr, i(t.$t("views.floorplan.all_cameras_placed")), 1))]),
2315
+ b("div", null, [b("div", ti, i(t.$t("views.floorplan.section_sensors")), 1), e.sensors.length ? (r(), _("div", ri, [(r(!0), _(y, null, n(e.sensors, (t) => (r(), _("div", {
2316
+ key: t.id,
2317
+ class: s(["floorplan-palette-item", [e.mode === "drag" ? "cursor-grab active:cursor-grabbing" : "cursor-pointer", { "palette-disabled": e.disabled }]]),
2318
+ draggable: e.mode === "drag" && !e.disabled,
2319
+ onDragstart: (e) => l(e, "sensor", void 0, void 0, t),
2320
+ onClick: (n) => !e.disabled && o("pick", {
2321
+ kind: "sensor",
2322
+ sensorId: t.id,
2323
+ sensorType: t.sensorType
2324
+ })
2325
+ }, [b("div", ai, [b("div", oi, [(r(), u(c(m(pe)(t.sensorType, void 0)), { class: "w-4 h-4" }))]), b("div", si, [b("span", ci, i(t.name), 1), t.subtitle ? (r(), _("span", li, i(t.subtitle), 1)) : d("", !0)])])], 42, ii))), 128))])) : (r(), _("span", ni, i(t.$t("views.floorplan.all_sensors_placed")), 1))])
2326
+ ], 2);
2327
+ };
2328
+ }
2329
+ }), [["__scopeId", "data-v-531420ee"]]), di = {
2330
+ viewBox: "0 0 24 24",
2331
+ width: "1.2em",
2332
+ height: "1.2em"
2333
+ };
2334
+ function fi(e, t) {
2335
+ return r(), _("svg", di, [...t[0] ||= [b("path", {
2336
+ fill: "currentColor",
2337
+ d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"
2338
+ }, null, -1)]]);
2339
+ }
2340
+ var pi = l({
2341
+ name: "mdi-chevron-up",
2342
+ render: fi
2343
+ }), mi = {
2344
+ viewBox: "0 0 24 24",
2345
+ width: "1.2em",
2346
+ height: "1.2em"
2347
+ };
2348
+ function hi(e, t) {
2349
+ return r(), _("svg", mi, [...t[0] ||= [b("path", {
2350
+ fill: "currentColor",
2351
+ d: "m12 18.54l7.37-5.74L21 14.07l-9 7l-9-7l1.62-1.26zM12 16L3 9l9-7l9 7zm0-11.47L6.26 9L12 13.47L17.74 9z"
2352
+ }, null, -1)]]);
2353
+ }
2354
+ var gi = l({
2355
+ name: "mdi-layers-outline",
2356
+ render: hi
2357
+ }), _i = {
2358
+ viewBox: "0 0 24 24",
2359
+ width: "1.2em",
2360
+ height: "1.2em"
2361
+ };
2362
+ function vi(e, t) {
2363
+ return r(), _("svg", _i, [...t[0] ||= [b("path", {
2364
+ fill: "currentColor",
2365
+ d: "M13 3a9 9 0 0 0-9 9H1l3.89 3.89l.07.14L9 12H6a7 7 0 0 1 7-7a7 7 0 0 1 7 7a7 7 0 0 1-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.9 8.9 0 0 0 13 21a9 9 0 0 0 9-9a9 9 0 0 0-9-9"
2366
+ }, null, -1)]]);
2367
+ }
2368
+ var yi = l({
2369
+ name: "mdi-restore",
2370
+ render: vi
2371
+ }), bi = {
2372
+ viewBox: "0 0 24 24",
2373
+ width: "1.2em",
2374
+ height: "1.2em"
2375
+ };
2376
+ function xi(e, t) {
2377
+ return r(), _("svg", bi, [...t[0] ||= [b("path", {
2378
+ fill: "currentColor",
2379
+ d: "M15 5v4h-4v4H7v4H3v3h7v-4h4v-4h4V8h4V5z"
2380
+ }, null, -1)]]);
2381
+ }
2382
+ var Si = l({
2383
+ name: "mdi-stairs",
2384
+ render: xi
2385
+ });
2386
+ //#endregion
2387
+ //#region src/api/routes/floorplan.ts
2388
+ async function Ci({ signal: e } = {}) {
2389
+ return (await N.get("/floorplan", { signal: e })).data;
2390
+ }
2391
+ async function wi(e) {
2392
+ return (await N.put("/floorplan", e)).data;
2393
+ }
2394
+ //#endregion
2395
+ //#region src/components/CuiDialog/templates/FloorplanLevel/FloorplanLevel.vue?vue&type=script&setup=true&lang.ts
2396
+ var Ti = { class: "flex flex-col gap-2 w-full" }, Ei = {
2397
+ for: "floorplanLevelName",
2398
+ class: "cui-label"
2399
+ }, Di = /* @__PURE__ */ C({
2400
+ __name: "FloorplanLevel",
2401
+ props: { name: { default: "" } },
2402
+ setup(e, { expose: t }) {
2403
+ let n = w(e.name);
2404
+ return t({ onConfirm: async () => n.value.trim() || null }), (e, t) => {
2405
+ let a = ke;
2406
+ return r(), _("div", Ti, [b("label", Ei, i(e.$t("components.form.label.name")), 1), T(a, {
2407
+ id: "floorplanLevelName",
2408
+ modelValue: m(n),
2409
+ "onUpdate:modelValue": t[0] ||= (e) => p(n) ? n.value = e : null,
2410
+ class: "w-full",
2411
+ placeholder: e.$t("views.floorplan.level_name_placeholder"),
2412
+ autofocus: ""
2413
+ }, null, 8, ["modelValue", "placeholder"])]);
2414
+ };
2415
+ }
2416
+ }), Oi = re({ plan: null }), ki = null, Ai = null, ji = /* @__PURE__ */ new Set();
2417
+ function Mi() {
2418
+ Ai || (ki = f(!0), ki.run(() => {
2419
+ let e = F("/camera.ui");
2420
+ Ai = e, e.on("floorplan-changed", (e) => {
2421
+ Oi.plan = e;
2422
+ for (let t of ji) try {
2423
+ t(e);
2424
+ } catch {}
2425
+ });
2426
+ }));
2427
+ }
2428
+ function Ni() {
2429
+ function e() {
2430
+ Mi();
2431
+ }
2432
+ function t(e) {
2433
+ return ji.add(e), () => ji.delete(e);
2434
+ }
2435
+ return {
2436
+ plan: h(() => Oi.plan),
2437
+ connect: e,
2438
+ onPlan: t
2439
+ };
2440
+ }
2441
+ //#endregion
2442
+ //#region src/views/Floorplan.vue?vue&type=script&setup=true&lang.ts
2443
+ var Pi = { class: "h-full w-full relative overflow-hidden flex flex-col" }, Fi = { class: "flex items-center gap-2 px-3 py-2 border-bottom-color card-background min-h-[48px]" }, Ii = {
2444
+ key: 0,
2445
+ class: "flex-1 flex items-center justify-center"
2446
+ }, Li = {
2447
+ key: 1,
2448
+ class: "flex flex-1 min-h-0"
2449
+ }, Ri = { class: "relative w-6 h-6" }, zi = { class: "flex items-center gap-2.5" }, Bi = { class: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0 palette-icon" }, Vi = { class: "flex-1 min-w-0" }, Hi = { class: "text-sm font-semibold truncate text-color" }, Ui = {
2450
+ key: 0,
2451
+ class: "text-[11px] text-muted truncate"
2452
+ }, Wi = { class: "text-xs text-muted truncate" }, Gi = {
2453
+ key: 0,
2454
+ class: "text-xs text-muted"
2455
+ }, Ki = {
2456
+ key: 1,
2457
+ class: "flex flex-col gap-1"
2458
+ }, qi = { class: "flex items-center justify-center" }, Ji = {
2459
+ key: 0,
2460
+ class: "flex items-center gap-2 pl-3 pr-2 py-1.5"
2461
+ }, Yi = { class: "flex-1 min-w-0 text-sm font-semibold truncate text-color" }, Xi = 50, Zi = 92, Qi = /*#__PURE__*/ I(/* @__PURE__ */ C({
2462
+ __name: "Floorplan",
2463
+ setup(e) {
2464
+ let { t: f } = Ee(), { smBreakpoint: S } = le(), { bottombarHeight: C } = ce(), re = be(), ae = ye(), fe = ge(), me = Ni(), he = new Te(), { sensors: j } = De(), { data: ve } = he.getCamerasQuery({
2465
+ page: 1,
2466
+ pageSize: -1
2467
+ }), we = w(), N = w(), F = w(null), I = w(null), ke = w({
2468
+ x: 0,
2469
+ y: 0
2470
+ }), Ae = w(null), Me = w({
2471
+ x: 0,
2472
+ y: 0
2473
+ }), Ne = w(), Pe = w(null), Fe = w({
2474
+ x: 0,
2475
+ y: 0
2476
+ }), Ie = w(), Re = w(null), Be = w(null), We = w({
2477
+ version: 0,
2478
+ updatedAt: 0,
2479
+ levels: [],
2480
+ rooms: []
2481
+ }), z = w([]), B = w([]), V = w([]), H = w([]), U = w([]), W = w(""), Qe = w(null), G = w(null), $e = w(!1), et = w(!0), tt = w(!1), nt = w(""), rt = te("sheetRef"), it = w(0), K = w(0), at = w(!1), q = ne([]), ot = ne([]), st = [
2482
+ {
2483
+ value: R.Disarmed,
2484
+ labelKey: "views.floorplan.security_disarmed"
2485
+ },
2486
+ {
2487
+ value: R.StayArm,
2488
+ labelKey: "views.floorplan.security_stay"
2489
+ },
2490
+ {
2491
+ value: R.AwayArm,
2492
+ labelKey: "views.floorplan.security_away"
2493
+ },
2494
+ {
2495
+ value: R.NightArm,
2496
+ labelKey: "views.floorplan.security_night"
2497
+ }
2498
+ ], ct = 0, lt = !1, ft, pt, mt, J = _e(void 0, "admin"), ht = h(() => Math.max(it.value - Zi, 0)), gt = h(() => q.value.length > 0), Y = h(() => ot.value.length > 0), X = h(() => (ve.value?.result ?? []).find((e) => e._id === Be.value)), _t = h(() => z.value.find((e) => e.id === W.value)), vt = h(() => Mt() !== nt.value), yt = h(() => new Map((ve.value?.result ?? []).map((e) => [e._id, e.name]))), bt = h(() => j.value.filter((e) => oe.has(String(e.type)))), Z = h(() => new Map(bt.value.map((e) => [e.id, {
2499
+ name: At(e),
2500
+ owner: jt(e)
2501
+ }]))), xt = h(() => {
2502
+ let e = new Set(U.value.map((e) => e.id));
2503
+ return bt.value.filter((t) => !e.has(t.id)).map((e) => ({
2504
+ id: e.id,
2505
+ name: At(e),
2506
+ subtitle: jt(e),
2507
+ sensorType: String(e.type)
2508
+ }));
2509
+ }), St = h(() => {
2510
+ let e = new Set(B.value.map((e) => e.roomId));
2511
+ return We.value.rooms.filter((t) => !e.has(t.id)).map((e) => ({
2512
+ id: e.id,
2513
+ name: e.name
2514
+ }));
2515
+ }), Ct = h(() => {
2516
+ let e = new Set(H.value.map((e) => e.id));
2517
+ return (ve.value?.result ?? []).filter((t) => !e.has(t._id)).map((e) => ({
2518
+ id: e._id,
2519
+ name: e.name
2520
+ }));
2521
+ }), wt = h(() => S.value || !G.value ? void 0 : "calc(300px + 1.25rem + env(safe-area-inset-right, 0px))"), Tt = h(() => z.value.findIndex((e) => e.id === W.value)), Et = h(() => [...z.value].reverse().map((e) => ({
2522
+ key: e.id,
2523
+ label: e.name,
2524
+ icon: l(gi),
2525
+ active: e.id === W.value,
2526
+ onClick: () => W.value = e.id
2527
+ }))), Dt = h(() => [
2528
+ {
2529
+ label: f("views.floorplan.undo"),
2530
+ icon: Je,
2531
+ buttonProps: { disabled: !gt.value },
2532
+ command: It
2533
+ },
2534
+ {
2535
+ label: f("views.floorplan.redo"),
2536
+ icon: Ke,
2537
+ buttonProps: { disabled: !Y.value },
2538
+ command: Lt
2539
+ },
2540
+ {
2541
+ label: f("views.floorplan.clear_level"),
2542
+ icon: qe,
2543
+ buttonProps: { disabled: !z.value.length },
2544
+ command: kn
2545
+ },
2546
+ {
2547
+ label: f("views.floorplan.revert"),
2548
+ icon: yi,
2549
+ buttonProps: { disabled: !vt.value },
2550
+ command: Nn
2551
+ }
2552
+ ]), Ot = h(() => {
2553
+ let e = B.value.find((e) => e.roomId === F.value);
2554
+ if (!e) return [];
2555
+ let t = new Set(V.value.flatMap((e) => [e.fromRoomId, e.toRoomId].join("|"))), n = /* @__PURE__ */ new Set();
2556
+ return B.value.filter((r) => r.levelId === e.levelId || n.has(r.roomId) || t.has([e.roomId, r.roomId].join("|")) || t.has([r.roomId, e.roomId].join("|")) ? !1 : (n.add(r.roomId), !0)).map((t) => ({
2557
+ key: t.roomId,
2558
+ label: t.name,
2559
+ description: z.value.find((e) => e.id === t.levelId)?.name,
2560
+ icon: l(Si),
2561
+ onClick: () => dn({
2562
+ fromRoomId: e.roomId,
2563
+ toRoomId: t.roomId
2564
+ })
2565
+ }));
2566
+ }), kt = h(() => {
2567
+ let e = B.value.filter((e) => e.levelId === W.value);
2568
+ if (!e.length) return {
2569
+ x: 0,
2570
+ y: 0
2571
+ };
2572
+ let t = Math.min(...e.map((e) => e.x)), n = Math.min(...e.map((e) => e.y)), r = Math.max(...e.map((e) => e.x + e.width)), i = Math.max(...e.map((e) => e.y + e.height));
2573
+ return {
2574
+ x: Math.round((t + r) / 2),
2575
+ y: Math.round((n + i) / 2)
2576
+ };
2577
+ });
2578
+ function At(e) {
2579
+ return e.displayName.value || e.name;
2580
+ }
2581
+ function jt(e) {
2582
+ return e.assignedCameraIds.value.map((e) => yt.value.get(e)).filter(Boolean).join(", ");
2583
+ }
2584
+ function Mt() {
2585
+ return JSON.stringify(Nt());
2586
+ }
2587
+ function Nt() {
2588
+ return {
2589
+ catalogVersion: We.value.version,
2590
+ north: Qe.value,
2591
+ levels: z.value.map((e, t) => ({
2592
+ id: e.id,
2593
+ name: e.name,
2594
+ order: t
2595
+ })),
2596
+ rooms: B.value.map((e) => ({
2597
+ id: e.id,
2598
+ roomId: e.roomId,
2599
+ name: e.name,
2600
+ note: e.note,
2601
+ publicSpace: e.publicSpace,
2602
+ levelId: e.levelId,
2603
+ outdoor: e.outdoor,
2604
+ x: e.x,
2605
+ y: e.y,
2606
+ width: e.width,
2607
+ height: e.height
2608
+ })),
2609
+ connections: V.value.map((e) => ({ ...e })),
2610
+ sensors: U.value.map((e) => ({
2611
+ sensorId: e.id,
2612
+ sensorType: e.sensorType,
2613
+ roomId: e.roomId,
2614
+ connectionId: e.connectionId,
2615
+ note: e.note,
2616
+ x: e.x,
2617
+ y: e.y
2618
+ })),
2619
+ cameras: H.value.map((e) => ({
2620
+ cameraId: e.id,
2621
+ roomId: e.roomId,
2622
+ note: e.note,
2623
+ x: e.x,
2624
+ y: e.y,
2625
+ rotation: e.rotation,
2626
+ fov: e.fov,
2627
+ range: e.range
2628
+ }))
2629
+ };
2630
+ }
2631
+ function Pt(e) {
2632
+ Qe.value = e.north, z.value = e.levels.map((e) => ({
2633
+ id: e.id,
2634
+ name: e.name
2635
+ })), B.value = e.rooms.map((e) => ({ ...e }));
2636
+ let t = new Map(B.value.map((e) => [e.roomId, e.levelId]));
2637
+ V.value = e.connections.map((e) => zt({ ...e })), H.value = e.cameras.map((e) => ({
2638
+ id: e.cameraId,
2639
+ name: yt.value.get(e.cameraId) ?? e.cameraId,
2640
+ levelId: t.get(e.roomId) ?? "",
2641
+ roomId: e.roomId,
2642
+ note: e.note ?? "",
2643
+ x: e.x,
2644
+ y: e.y,
2645
+ rotation: e.rotation,
2646
+ fov: e.fov,
2647
+ range: e.range
2648
+ })), U.value = e.sensors.map((e) => ({
2649
+ id: e.sensorId,
2650
+ name: Z.value.get(e.sensorId)?.name ?? e.sensorId,
2651
+ owner: Z.value.get(e.sensorId)?.owner ?? "",
2652
+ sensorType: e.sensorType,
2653
+ levelId: t.get(e.roomId) ?? "",
2654
+ roomId: e.roomId,
2655
+ connectionId: e.connectionId,
2656
+ note: e.note ?? "",
2657
+ x: e.x,
2658
+ y: e.y
2659
+ })), z.value.some((e) => e.id === W.value) || (W.value = z.value[0]?.id ?? ""), G.value = null;
2660
+ }
2661
+ function Ft(e, t) {
2662
+ We.value = t;
2663
+ let n = new Map(t.rooms.map((e) => [e.id, e]));
2664
+ Pt({
2665
+ catalogVersion: t.version,
2666
+ north: e.north,
2667
+ levels: [...t.levels].sort((e, t) => e.order - t.order),
2668
+ rooms: e.rooms.flatMap((e) => {
2669
+ let t = n.get(e.roomId);
2670
+ return t?.levelId ? [{
2671
+ id: e.id,
2672
+ roomId: t.id,
2673
+ name: t.name,
2674
+ note: t.note ?? "",
2675
+ levelId: t.levelId,
2676
+ outdoor: t.outdoor,
2677
+ publicSpace: t.publicSpace ?? !1,
2678
+ x: e.x,
2679
+ y: e.y,
2680
+ width: e.width,
2681
+ height: e.height
2682
+ }] : [];
2683
+ }),
2684
+ connections: e.connections,
2685
+ cameras: e.cameras,
2686
+ sensors: e.sensors ?? []
2687
+ }), nt.value = Mt(), q.value = [], ot.value = [];
2688
+ }
2689
+ function Q(e = !1) {
2690
+ let t = Date.now();
2691
+ if (e && t - ct < 600) return;
2692
+ ct = t;
2693
+ let n = [...q.value, Mt()];
2694
+ n.length > Xi && n.shift(), q.value = n, ot.value = [];
2695
+ }
2696
+ function It() {
2697
+ let e = [...q.value], t = e.pop();
2698
+ t && (ot.value = [...ot.value, Mt()], q.value = e, ct = 0, Pt(JSON.parse(t)));
2699
+ }
2700
+ function Lt() {
2701
+ let e = [...ot.value], t = e.pop();
2702
+ t && (q.value = [...q.value, Mt()], ot.value = e, ct = 0, Pt(JSON.parse(t)));
2703
+ }
2704
+ function Rt(e) {
2705
+ return B.value.find((t) => t.id === e);
2706
+ }
2707
+ function zt(e) {
2708
+ if (e.width ||= 90, e.offset ??= null, e.note ??= "", e.fromShapeId && e.toShapeId) return e;
2709
+ let t = B.value.filter((t) => t.roomId === e.fromRoomId), n = B.value.filter((t) => t.roomId === e.toRoomId);
2710
+ for (let r of t) for (let t of n) if (ut(r, t)) return {
2711
+ ...e,
2712
+ fromShapeId: r.id,
2713
+ toShapeId: t.id
2714
+ };
2715
+ return {
2716
+ ...e,
2717
+ fromShapeId: t[0]?.id ?? null,
2718
+ toShapeId: n[0]?.id ?? null
2719
+ };
2720
+ }
2721
+ function Bt(e) {
2722
+ return B.value.filter((t) => t.roomId === e);
2723
+ }
2724
+ function Vt(e) {
2725
+ let t = Rt(e);
2726
+ if (!t) return;
2727
+ let n = Bt(t.roomId).filter((e) => e.id !== t.id);
2728
+ if (!n.length || n.some((e) => ut(t, e))) return;
2729
+ let r = new Set(B.value.map((e) => e.name.toLowerCase())), i = t.name;
2730
+ for (let e = 2; r.has(i.toLowerCase()); e++) i = `${t.name} ${e}`;
2731
+ let a = crypto.randomUUID();
2732
+ for (let e of H.value) e.roomId === t.roomId && gn(t, e) && (e.roomId = a);
2733
+ Object.assign(t, {
2734
+ roomId: a,
2735
+ name: i
2736
+ }), ae.add({
2737
+ severity: "info",
2738
+ detail: f("views.floorplan.room_detached", { name: i }),
2739
+ life: 4e3
2740
+ });
2741
+ }
2742
+ function Ht(e, t) {
2743
+ let n = Bt(t)[0];
2744
+ if (!n) return;
2745
+ let r = e.roomId;
2746
+ Object.assign(e, {
2747
+ roomId: t,
2748
+ name: n.name,
2749
+ note: n.note,
2750
+ levelId: n.levelId,
2751
+ outdoor: n.outdoor,
2752
+ publicSpace: n.publicSpace
2753
+ });
2754
+ for (let n of H.value) n.roomId === r && gn(e, n) && (n.roomId = t);
2755
+ Bt(r).length || (H.value = H.value.filter((e) => e.roomId !== r), V.value = V.value.filter((e) => e.fromRoomId !== r && e.toRoomId !== r));
2756
+ }
2757
+ function Ut(e) {
2758
+ return H.value.find((t) => t.id === e);
2759
+ }
2760
+ function Wt({ id: e, x: t, y: n }) {
2761
+ let r = Rt(e);
2762
+ if (!r) return;
2763
+ let i = t - r.x, a = n - r.y;
2764
+ r.x = t, r.y = n;
2765
+ for (let e of H.value) e.roomId !== r.roomId || !gn(r, e) || (e.x += i, e.y += a);
2766
+ }
2767
+ function Gt({ id: e, width: t, height: n }) {
2768
+ let r = Rt(e);
2769
+ if (r) {
2770
+ r.width = t, r.height = n;
2771
+ for (let e of H.value) e.roomId === r.id && (e.x = Math.min(Math.max(e.x, r.x), r.x + r.width), e.y = Math.min(Math.max(e.y, r.y), r.y + r.height));
2772
+ }
2773
+ }
2774
+ function Kt({ id: e, x: t, y: n }) {
2775
+ let r = Ut(e);
2776
+ r && (r.x = t, r.y = n);
2777
+ }
2778
+ function qt({ id: e, rotation: t, range: n }) {
2779
+ let r = Ut(e);
2780
+ r && (r.rotation = t, r.range = n);
2781
+ }
2782
+ function Jt({ id: e, patch: t }) {
2783
+ Q(!0);
2784
+ let n = Rt(e);
2785
+ if (!n) return;
2786
+ if (t.roomId && t.roomId !== n.roomId) {
2787
+ Ht(n, t.roomId);
2788
+ return;
2789
+ }
2790
+ let r = {
2791
+ name: t.name,
2792
+ note: t.note,
2793
+ levelId: t.levelId,
2794
+ outdoor: t.outdoor,
2795
+ publicSpace: t.publicSpace
2796
+ }, i = Object.fromEntries(Object.entries(r).filter(([, e]) => e !== void 0));
2797
+ if (Object.assign(n, t), Object.keys(i).length) {
2798
+ for (let e of Bt(n.roomId)) Object.assign(e, i);
2799
+ if (t.levelId) for (let e of H.value) e.roomId === n.roomId && (e.levelId = t.levelId);
2800
+ }
2801
+ }
2802
+ function Yt({ id: e, patch: t }) {
2803
+ Q(!0);
2804
+ let n = Ut(e);
2805
+ if (n && (Object.assign(n, t), t.roomId)) {
2806
+ let e = Bt(t.roomId), r = e.find((e) => gn(e, n)) ?? e[0];
2807
+ r && !gn(r, n) && (n.x = Math.round(r.x + r.width / 2), n.y = Math.round(r.y + r.height / 2), n.levelId = r.levelId);
2808
+ }
2809
+ }
2810
+ function Xt({ id: e, x: t, y: n }) {
2811
+ let r = U.value.find((t) => t.id === e);
2812
+ r && Object.assign(r, {
2813
+ x: t,
2814
+ y: n
2815
+ });
2816
+ }
2817
+ function Zt({ id: e, patch: t }) {
2818
+ Q(!0);
2819
+ let n = U.value.find((t) => t.id === e);
2820
+ n && Object.assign(n, t);
2821
+ }
2822
+ let $ = h(() => U.value.find((e) => e.id === Re.value));
2823
+ function Qt(e) {
2824
+ return j.value.find((t) => t.id === e);
2825
+ }
2826
+ function $t(e) {
2827
+ return J && !Ce.has(e);
2828
+ }
2829
+ async function en(e) {
2830
+ J && await k(Qt(e));
2831
+ }
2832
+ async function tn(e, t) {
2833
+ J && await O(Qt(e), t);
2834
+ }
2835
+ function nn() {
2836
+ clearTimeout(pt);
2837
+ }
2838
+ function rn() {
2839
+ clearTimeout(pt), pt = setTimeout(() => {
2840
+ Re.value = null, Ie.value?.hide();
2841
+ }, 220);
2842
+ }
2843
+ function an(e) {
2844
+ if (!e) return rn();
2845
+ nn(), Re.value = e.sensorId, Fe.value = {
2846
+ x: e.x,
2847
+ y: e.y
2848
+ }, o(() => {
2849
+ Pe.value && Ie.value?.show({ currentTarget: Pe.value });
2850
+ });
2851
+ }
2852
+ function on(e) {
2853
+ if (clearTimeout(ft), !e) {
2854
+ cn();
2855
+ return;
2856
+ }
2857
+ Me.value = {
2858
+ x: e.x,
2859
+ y: e.y
2860
+ }, Be.value = e.cameraId, ft = setTimeout(() => {
2861
+ Ae.value && Ne.value?.show({ currentTarget: Ae.value });
2862
+ }, 350);
2863
+ }
2864
+ function sn() {
2865
+ clearTimeout(ft);
2866
+ }
2867
+ function cn() {
2868
+ ft = setTimeout(() => {
2869
+ Ne.value?.hide(), Be.value = null;
2870
+ }, 200);
2871
+ }
2872
+ function ln({ roomId: e, event: t }) {
2873
+ F.value = e, ke.value = {
2874
+ x: t.clientX,
2875
+ y: t.clientY
2876
+ }, o(() => N.value?.toggleMenu(t, I.value));
2877
+ }
2878
+ function un({ id: e, patch: t }) {
2879
+ Q(!0);
2880
+ let n = V.value.find((t) => t.id === e);
2881
+ n && Object.assign(n, t);
2882
+ }
2883
+ function dn({ fromRoomId: e, toRoomId: t, fromShapeId: n, toShapeId: r }) {
2884
+ Q();
2885
+ let i = B.value.find((e) => e.id === n) ?? Bt(e)[0], a = B.value.find((e) => e.id === r) ?? Bt(t)[0], o = i && a ? ut(i, a) : null, s = {
2886
+ id: crypto.randomUUID(),
2887
+ fromRoomId: e,
2888
+ toRoomId: t,
2889
+ fromShapeId: i?.id ?? null,
2890
+ toShapeId: a?.id ?? null,
2891
+ offset: o ? fn(o, i?.id, a?.id) : null,
2892
+ width: 90,
2893
+ note: "",
2894
+ type: i && a && i.levelId !== a.levelId ? "stairs" : "door"
2895
+ };
2896
+ V.value.push(s), G.value = {
2897
+ kind: "connection",
2898
+ id: s.id
2899
+ };
2900
+ }
2901
+ function fn(e, t, n) {
2902
+ let r = V.value.filter((e) => e.fromShapeId === t && e.toShapeId === n).map((t) => dt(e, t.offset, t.width)).map((t) => {
2903
+ let n = (t.x1 - e.x) * e.stepX + (t.y1 - e.y) * e.stepY, r = (t.x2 - e.x) * e.stepX + (t.y2 - e.y) * e.stepY;
2904
+ return {
2905
+ start: Math.min(n, r),
2906
+ end: Math.max(n, r)
2907
+ };
2908
+ }).sort((e, t) => e.start - t.start), i = Math.min(90, e.length) / 2, a = 0;
2909
+ for (let e of r) {
2910
+ if (e.start - a >= i * 2) break;
2911
+ a = Math.max(a, e.end);
2912
+ }
2913
+ return Math.round(Math.min(Math.max(a + i, i), e.length - i));
2914
+ }
2915
+ function pn({ id: e, offset: t }) {
2916
+ Q(!0);
2917
+ let n = V.value.find((t) => t.id === e);
2918
+ n && (n.offset = t);
2919
+ }
2920
+ function hn({ id: e, offset: t, width: n }) {
2921
+ Q(!0);
2922
+ let r = V.value.find((t) => t.id === e);
2923
+ r && Object.assign(r, {
2924
+ offset: t,
2925
+ width: n
2926
+ });
2927
+ }
2928
+ function gn(e, t) {
2929
+ return t.x >= e.x && t.x <= e.x + e.width && t.y >= e.y && t.y <= e.y + e.height;
2930
+ }
2931
+ function _n(e) {
2932
+ if (Q(), e.kind === "room") {
2933
+ let t = Rt(e.id);
2934
+ if (!t) return;
2935
+ B.value = B.value.filter((t) => t.id !== e.id), H.value = H.value.filter((e) => e.roomId !== t.roomId || !gn(t, e)), Bt(t.roomId).length || (H.value = H.value.filter((e) => e.roomId !== t.roomId), V.value = V.value.filter((e) => e.fromRoomId !== t.roomId && e.toRoomId !== t.roomId));
2936
+ } else e.kind === "connection" ? V.value = V.value.filter((t) => t.id !== e.id) : e.kind === "sensor" ? U.value = U.value.filter((t) => t.id !== e.id) : H.value = H.value.filter((t) => t.id !== e.id);
2937
+ G.value = null;
2938
+ }
2939
+ function vn(e, t, n) {
2940
+ Q();
2941
+ let r = yn(Math.round(e - 120), Math.round(t - 100), 240, 200), i = n ? We.value.rooms.find((e) => e.id === n) : void 0, a = {
2942
+ id: crypto.randomUUID(),
2943
+ roomId: i?.id ?? crypto.randomUUID(),
2944
+ name: i?.name ?? f("views.floorplan.new_room"),
2945
+ note: i?.note ?? "",
2946
+ publicSpace: i?.publicSpace ?? !1,
2947
+ levelId: W.value,
2948
+ outdoor: i?.outdoor ?? !1,
2949
+ x: r.x,
2950
+ y: r.y,
2951
+ width: 240,
2952
+ height: 200
2953
+ };
2954
+ B.value.push(a), G.value = {
2955
+ kind: "room",
2956
+ id: a.id
2957
+ };
2958
+ }
2959
+ function yn(e, t, n, r) {
2960
+ let i = B.value.filter((e) => e.levelId === W.value), a = (e, t) => i.some((i) => e < i.x + i.width && e + n > i.x && t < i.y + i.height && t + r > i.y);
2961
+ if (!a(e, t)) return {
2962
+ x: e,
2963
+ y: t
2964
+ };
2965
+ for (let i = 1; i <= 12; i++) for (let [o, s] of [
2966
+ [1, 0],
2967
+ [0, 1],
2968
+ [-1, 0],
2969
+ [0, -1],
2970
+ [1, 1],
2971
+ [-1, 1],
2972
+ [1, -1],
2973
+ [-1, -1]
2974
+ ]) {
2975
+ let c = e + o * i * (n + 20), l = t + s * i * (r + 20);
2976
+ if (!a(c, l)) return {
2977
+ x: c,
2978
+ y: l
2979
+ };
2980
+ }
2981
+ return {
2982
+ x: e,
2983
+ y: t
2984
+ };
2985
+ }
2986
+ function bn(e, t, n) {
2987
+ let r = B.value.find((e) => e.levelId === W.value && t >= e.x && t <= e.x + e.width && n >= e.y && n <= e.y + e.height);
2988
+ if (!r) return;
2989
+ Q();
2990
+ let i = {
2991
+ id: e,
2992
+ name: yt.value.get(e) ?? e,
2993
+ levelId: W.value,
2994
+ roomId: r.roomId,
2995
+ note: "",
2996
+ x: Math.round(t),
2997
+ y: Math.round(n),
2998
+ rotation: 0,
2999
+ fov: 90,
3000
+ range: 800
3001
+ };
3002
+ H.value.push(i), G.value = {
3003
+ kind: "camera",
3004
+ id: i.id
3005
+ };
3006
+ }
3007
+ function xn(e, t, n, r) {
3008
+ let i = B.value.find((e) => e.levelId === W.value && n >= e.x && n <= e.x + e.width && r >= e.y && r <= e.y + e.height);
3009
+ if (!i) return;
3010
+ Q();
3011
+ let a = {
3012
+ id: e,
3013
+ name: Z.value.get(e)?.name ?? e,
3014
+ owner: Z.value.get(e)?.owner ?? "",
3015
+ sensorType: t,
3016
+ levelId: W.value,
3017
+ roomId: i.roomId,
3018
+ connectionId: null,
3019
+ note: "",
3020
+ x: Math.round(n),
3021
+ y: Math.round(r)
3022
+ };
3023
+ U.value.push(a), G.value = {
3024
+ kind: "sensor",
3025
+ id: a.id
3026
+ };
3027
+ }
3028
+ function Sn({ kind: e, cameraId: t, sensorId: n, sensorType: r, roomId: i, x: a, y: o }) {
3029
+ z.value.length && (e === "room" ? vn(a, o, i) : e === "sensor" && n && r ? xn(n, r, a, o) : t && bn(t, a, o));
3030
+ }
3031
+ function Cn(e) {
3032
+ Sn({
3033
+ ...e,
3034
+ x: kt.value.x,
3035
+ y: kt.value.y
3036
+ });
3037
+ }
3038
+ function wn(e) {
3039
+ $e.value = !1, Cn(e);
3040
+ }
3041
+ function Tn() {
3042
+ re.openComponentDialog(Di, {
3043
+ data: {
3044
+ title: f("views.floorplan.add_level"),
3045
+ confirmText: f("components.form.button.add"),
3046
+ contentProps: {}
3047
+ },
3048
+ onConfirm: (e) => {
3049
+ if (!e) return;
3050
+ Q();
3051
+ let t = {
3052
+ id: crypto.randomUUID(),
3053
+ name: e
3054
+ };
3055
+ z.value.push(t), W.value = t.id, G.value = null;
3056
+ }
3057
+ });
3058
+ }
3059
+ function En() {
3060
+ let e = _t.value;
3061
+ e && re.openComponentDialog(Di, {
3062
+ data: {
3063
+ title: f("views.floorplan.rename_level"),
3064
+ confirmText: f("components.form.button.save"),
3065
+ contentProps: { name: e.name }
3066
+ },
3067
+ onConfirm: (t) => {
3068
+ t && (Q(), e.name = t);
3069
+ }
3070
+ });
3071
+ }
3072
+ function Dn() {
3073
+ if (!_t.value) return;
3074
+ Q();
3075
+ let e = W.value, t = new Set(B.value.filter((t) => t.levelId === e).map((e) => e.id));
3076
+ z.value = z.value.filter((t) => t.id !== e), B.value = B.value.filter((t) => t.levelId !== e), H.value = H.value.filter((t) => t.levelId !== e), V.value = V.value.filter((e) => !t.has(e.fromRoomId) && !t.has(e.toRoomId)), W.value = z.value[0]?.id ?? "", G.value = null;
3077
+ }
3078
+ function On(e) {
3079
+ let t = Tt.value, n = t + e;
3080
+ if (t < 0 || n < 0 || n >= z.value.length) return;
3081
+ Q();
3082
+ let r = [...z.value];
3083
+ [r[t], r[n]] = [r[n], r[t]], z.value = r;
3084
+ }
3085
+ function kn() {
3086
+ Q();
3087
+ let e = new Set(B.value.filter((e) => e.levelId === W.value).map((e) => e.id));
3088
+ B.value = B.value.filter((e) => e.levelId !== W.value), H.value = H.value.filter((e) => e.levelId !== W.value), V.value = V.value.filter((t) => !e.has(t.fromRoomId) && !e.has(t.toRoomId)), G.value = null;
3089
+ }
3090
+ async function An() {
3091
+ tt.value = !0;
3092
+ try {
3093
+ Ft(await wi(Nt()), await Ye()), await jn(), ae.add({
3094
+ severity: "success",
3095
+ detail: f("views.floorplan.saved"),
3096
+ life: 3e3
3097
+ });
3098
+ } catch (e) {
3099
+ ae.add({
3100
+ severity: "error",
3101
+ detail: M(e),
3102
+ life: 5e3
3103
+ });
3104
+ } finally {
3105
+ tt.value = !1;
3106
+ }
3107
+ }
3108
+ async function jn() {
3109
+ await Promise.all([
3110
+ he.queryClient.refetchQueries({ queryKey: ["camerasList"] }),
3111
+ he.queryClient.refetchQueries({ queryKey: ["cameras"] }),
3112
+ he.queryClient.refetchQueries({
3113
+ queryKey: ["rooms"],
3114
+ exact: !0
3115
+ })
3116
+ ]);
3117
+ }
3118
+ async function Mn() {
3119
+ try {
3120
+ let [e, t] = await Promise.all([Ci(), Ye()]);
3121
+ Ft(e, t);
3122
+ } catch (e) {
3123
+ ae.add({
3124
+ severity: "error",
3125
+ detail: M(e),
3126
+ life: 5e3
3127
+ });
3128
+ } finally {
3129
+ et.value = !1;
3130
+ }
3131
+ }
3132
+ async function Nn() {
3133
+ await Mn();
3134
+ }
3135
+ function Pn(e) {
3136
+ if (!J) return;
3137
+ let t = e.target;
3138
+ if (t?.isContentEditable || [
3139
+ "INPUT",
3140
+ "TEXTAREA",
3141
+ "SELECT"
3142
+ ].includes(t?.tagName ?? "")) return;
3143
+ let n = e.metaKey || e.ctrlKey;
3144
+ if (n && e.key.toLowerCase() === "z") {
3145
+ e.preventDefault(), e.shiftKey ? Lt() : It();
3146
+ return;
3147
+ }
3148
+ if (n && e.key.toLowerCase() === "y") {
3149
+ e.preventDefault(), Lt();
3150
+ return;
3151
+ }
3152
+ (e.key === "Delete" || e.key === "Backspace") && G.value && (e.preventDefault(), _n(G.value));
3153
+ }
3154
+ let Fn = me.onPlan(async (e) => {
3155
+ vt.value || (Ft(e, await Ye()), await jn());
3156
+ });
3157
+ function In(e) {
3158
+ let t = e.clientY, n = K.value, r = !1;
3159
+ at.value = !0, e.currentTarget.setPointerCapture(e.pointerId);
3160
+ let i = (e) => {
3161
+ Math.abs(e.clientY - t) > 3 && (r = !0), K.value = Math.min(Math.max(n + (e.clientY - t), 0), ht.value);
3162
+ }, a = () => {
3163
+ window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", a), at.value = !1, r ? K.value = K.value > ht.value * .35 ? ht.value : 0 : K.value = n > 0 ? 0 : ht.value;
3164
+ };
3165
+ window.addEventListener("pointermove", i), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", a);
3166
+ }
3167
+ return ee(yt, (e) => {
3168
+ for (let t of H.value) t.name = e.get(t.id) ?? t.id;
3169
+ }), ee(Z, (e) => {
3170
+ for (let t of U.value) t.name = e.get(t.id)?.name ?? t.id, t.owner = e.get(t.id)?.owner ?? "";
3171
+ }), ee(rt, (e) => {
3172
+ if (mt?.disconnect(), !e) {
3173
+ it.value = 0;
3174
+ return;
3175
+ }
3176
+ mt = new ResizeObserver(([e]) => it.value = Math.round(e.contentRect.height)), mt.observe(e);
3177
+ }), ee(() => G.value && `${G.value.kind}:${G.value.id}`, () => K.value = 0), ie(() => {
3178
+ me.connect(), window.addEventListener("keydown", Pn), Mn();
3179
+ }), ue((e) => !vt.value || lt ? !0 : (re.openTextDialog({
3180
+ data: {
3181
+ title: f("views.floorplan.unsaved_title"),
3182
+ contentText: f("views.floorplan.unsaved_message"),
3183
+ confirmText: f("views.floorplan.discard")
3184
+ },
3185
+ onConfirm: async () => {
3186
+ lt = !0, fe.push(e.fullPath);
3187
+ }
3188
+ }), !1)), t(() => {
3189
+ clearTimeout(ft), clearTimeout(pt), Fn(), mt?.disconnect(), window.removeEventListener("keydown", Pn);
3190
+ }), (e, t) => {
3191
+ let o = Ue, l = Oe, f = A, h = gi, ee = D, te = pi, ne = je, w = He, re = Xe, ie = Ve, ae = L, oe = ui, ce = jr, le = mn, ue = Le, fe = Ge, O = ze, me = P, he = xe, ge = Ze, k = se, j = E;
3192
+ return r(), _("div", Pi, [
3193
+ T(f, { position: "left" }, {
3194
+ default: g(() => [T(l, {
3195
+ severity: "secondary",
3196
+ text: "",
3197
+ class: "cui-button p-2 text-color non-draggable-region",
3198
+ onClick: t[0] ||= (t) => e.$router.push("/menu")
3199
+ }, {
3200
+ icon: g(() => [T(o, { class: "w-6 h-6" })]),
3201
+ _: 1
3202
+ })]),
3203
+ _: 1
3204
+ }),
3205
+ b("div", Fi, [
3206
+ T(l, {
3207
+ severity: "secondary",
3208
+ text: "",
3209
+ class: "cui-button-medium shrink-0",
3210
+ label: m(_t)?.name ?? e.$t("views.floorplan.no_levels"),
3211
+ disabled: !m(z).length,
3212
+ onClick: t[1] ||= (e) => m(we)?.toggleMenu(e)
3213
+ }, {
3214
+ icon: g(() => [T(h)]),
3215
+ _: 1
3216
+ }, 8, ["label", "disabled"]),
3217
+ t[13] ||= b("div", { class: "flex-1" }, null, -1),
3218
+ m(J) ? (r(), _(y, { key: 0 }, [
3219
+ x((r(), u(l, {
3220
+ severity: "secondary",
3221
+ text: "",
3222
+ rounded: "",
3223
+ class: "cui-icon-md shrink-0",
3224
+ disabled: m(Tt) < 1,
3225
+ onClick: t[2] ||= (e) => On(-1)
3226
+ }, {
3227
+ icon: g(() => [T(ee, {
3228
+ width: "100%",
3229
+ height: "100%"
3230
+ })]),
3231
+ _: 1
3232
+ }, 8, ["disabled"])), [[
3233
+ j,
3234
+ { value: e.$t("views.floorplan.level_down") },
3235
+ void 0,
3236
+ { bottom: !0 }
3237
+ ]]),
3238
+ x((r(), u(l, {
3239
+ severity: "secondary",
3240
+ text: "",
3241
+ rounded: "",
3242
+ class: "cui-icon-md shrink-0",
3243
+ disabled: m(Tt) < 0 || m(Tt) >= m(z).length - 1,
3244
+ onClick: t[3] ||= (e) => On(1)
3245
+ }, {
3246
+ icon: g(() => [T(te, {
3247
+ width: "100%",
3248
+ height: "100%"
3249
+ })]),
3250
+ _: 1
3251
+ }, 8, ["disabled"])), [[
3252
+ j,
3253
+ { value: e.$t("views.floorplan.level_up") },
3254
+ void 0,
3255
+ { bottom: !0 }
3256
+ ]]),
3257
+ T(ne, {
3258
+ layout: "vertical",
3259
+ class: "floorplan-divider"
3260
+ }),
3261
+ x((r(), u(l, {
3262
+ severity: "secondary",
3263
+ text: "",
3264
+ rounded: "",
3265
+ class: "cui-icon-md shrink-0",
3266
+ disabled: !m(z).length,
3267
+ onClick: Dn
3268
+ }, {
3269
+ icon: g(() => [T(w, {
3270
+ width: "100%",
3271
+ height: "100%"
3272
+ })]),
3273
+ _: 1
3274
+ }, 8, ["disabled"])), [[
3275
+ j,
3276
+ { value: e.$t("views.floorplan.remove_level") },
3277
+ void 0,
3278
+ { bottom: !0 }
3279
+ ]]),
3280
+ x((r(), u(l, {
3281
+ severity: "secondary",
3282
+ text: "",
3283
+ rounded: "",
3284
+ class: "cui-icon-md shrink-0",
3285
+ disabled: !m(z).length,
3286
+ onClick: En
3287
+ }, {
3288
+ icon: g(() => [T(re, {
3289
+ width: "100%",
3290
+ height: "100%"
3291
+ })]),
3292
+ _: 1
3293
+ }, 8, ["disabled"])), [[
3294
+ j,
3295
+ { value: e.$t("views.floorplan.rename_level") },
3296
+ void 0,
3297
+ { bottom: !0 }
3298
+ ]]),
3299
+ x((r(), u(l, {
3300
+ severity: "secondary",
3301
+ text: "",
3302
+ rounded: "",
3303
+ class: "cui-icon-md shrink-0",
3304
+ onClick: Tn
3305
+ }, {
3306
+ icon: g(() => [T(ie, {
3307
+ width: "100%",
3308
+ height: "100%"
3309
+ })]),
3310
+ _: 1
3311
+ })), [[
3312
+ j,
3313
+ { value: e.$t("views.floorplan.add_level") },
3314
+ void 0,
3315
+ { bottom: !0 }
3316
+ ]])
3317
+ ], 64)) : d("", !0)
3318
+ ]),
3319
+ m(et) ? (r(), _("div", Ii, [T(ae, {
3320
+ class: "w-[30px] h-[30px] m-0",
3321
+ "stroke-width": "5"
3322
+ })])) : (r(), _("div", Li, [
3323
+ m(J) && !m(S) ? (r(), u(oe, {
3324
+ key: 0,
3325
+ cameras: m(Ct),
3326
+ sensors: m(xt),
3327
+ rooms: m(St),
3328
+ disabled: !m(z).length,
3329
+ class: "w-[240px] shrink-0",
3330
+ onPick: Cn
3331
+ }, null, 8, [
3332
+ "cameras",
3333
+ "sensors",
3334
+ "rooms",
3335
+ "disabled"
3336
+ ])) : d("", !0),
3337
+ T(ce, {
3338
+ mobile: m(S),
3339
+ "bottom-inset": m(S) && m(G) ? Math.max(m(it) - m(K), 0) : 0,
3340
+ "bottom-inset-dragging": m(at),
3341
+ levels: m(z),
3342
+ rooms: m(B),
3343
+ connections: m(V),
3344
+ cameras: m(H),
3345
+ sensors: m(U),
3346
+ "level-id": m(W),
3347
+ selection: m(G),
3348
+ "read-only": !m(J),
3349
+ north: m(Qe),
3350
+ class: "flex-1 min-w-0",
3351
+ onSelect: t[4] ||= (e) => G.value = e,
3352
+ onHistory: t[5] ||= (e) => Q(),
3353
+ onCreateConnection: dn,
3354
+ onDrop: Sn,
3355
+ onUpdateNorth: t[6] ||= (e) => Qe.value = e,
3356
+ onRequestStairs: ln,
3357
+ onHoverCamera: on,
3358
+ onMoveRoom: Wt,
3359
+ onResizeRoom: Gt,
3360
+ onSettleRoom: Vt,
3361
+ onMoveCamera: Kt,
3362
+ onMoveSensor: Xt,
3363
+ onHoverSensor: an,
3364
+ onRotateCamera: qt,
3365
+ onMoveConnection: pn,
3366
+ onResizeConnection: hn
3367
+ }, null, 8, [
3368
+ "mobile",
3369
+ "bottom-inset",
3370
+ "bottom-inset-dragging",
3371
+ "levels",
3372
+ "rooms",
3373
+ "connections",
3374
+ "cameras",
3375
+ "sensors",
3376
+ "level-id",
3377
+ "selection",
3378
+ "read-only",
3379
+ "north"
3380
+ ]),
3381
+ m(S) ? d("", !0) : (r(), _("div", {
3382
+ key: 1,
3383
+ class: "shrink-0 overflow-hidden transition-[width] duration-200 ease-in-out",
3384
+ style: v({ width: m(G) ? "300px" : "0px" })
3385
+ }, [m(G) ? (r(), u(le, {
3386
+ key: 0,
3387
+ rooms: m(B),
3388
+ connections: m(V),
3389
+ cameras: m(H),
3390
+ sensors: m(U),
3391
+ levels: m(z),
3392
+ selection: m(G),
3393
+ "read-only": !m(J),
3394
+ class: "w-[300px]",
3395
+ onClose: t[7] ||= (e) => G.value = null,
3396
+ onUpdateRoom: Jt,
3397
+ onUpdateCamera: Yt,
3398
+ onUpdateSensor: Zt,
3399
+ onUpdateConnection: un,
3400
+ onRemove: _n
3401
+ }, null, 8, [
3402
+ "rooms",
3403
+ "connections",
3404
+ "cameras",
3405
+ "sensors",
3406
+ "levels",
3407
+ "selection",
3408
+ "read-only"
3409
+ ])) : d("", !0)], 4))
3410
+ ])),
3411
+ m(S) && m(G) ? (r(), _("div", {
3412
+ key: 2,
3413
+ ref_key: "sheetRef",
3414
+ ref: rt,
3415
+ class: "fixed inset-x-0 z-[16] rounded-t-xl overflow-hidden shadow-lg border-top-color card-background",
3416
+ style: v({
3417
+ bottom: `calc(${m(C)}px + env(safe-area-inset-bottom, 0px))`,
3418
+ transform: `translateY(${m(K)}px)`,
3419
+ transition: m(at) ? "none" : "transform 0.2s ease-in-out"
3420
+ })
3421
+ }, [b("div", {
3422
+ class: "flex justify-center py-2 cursor-grab active:cursor-grabbing sheet-grip",
3423
+ onPointerdown: In
3424
+ }, [...t[14] ||= [b("div", { class: "w-10 h-1 rounded-full sheet-grip-bar" }, null, -1)]], 32), T(le, {
3425
+ rooms: m(B),
3426
+ connections: m(V),
3427
+ cameras: m(H),
3428
+ sensors: m(U),
3429
+ levels: m(z),
3430
+ selection: m(G),
3431
+ "read-only": !m(J),
3432
+ fluid: "",
3433
+ class: "max-h-[55vh]",
3434
+ onClose: t[8] ||= (e) => G.value = null,
3435
+ onUpdateRoom: Jt,
3436
+ onUpdateCamera: Yt,
3437
+ onUpdateSensor: Zt,
3438
+ onUpdateConnection: un,
3439
+ onRemove: _n
3440
+ }, null, 8, [
3441
+ "rooms",
3442
+ "connections",
3443
+ "cameras",
3444
+ "sensors",
3445
+ "levels",
3446
+ "selection",
3447
+ "read-only"
3448
+ ])], 4)) : d("", !0),
3449
+ m(J) && !m(et) ? (r(), u(ue, {
3450
+ key: 3,
3451
+ model: m(Dt),
3452
+ direction: "up",
3453
+ "transition-delay": 80,
3454
+ "tooltip-options": {
3455
+ position: "left",
3456
+ event: void 0
3457
+ },
3458
+ style: v({
3459
+ position: "fixed",
3460
+ zIndex: 15,
3461
+ bottom: `calc(${m(C)}px + ${m(vt) ? "4.25rem" : "1.25rem"} + env(safe-area-inset-bottom, 0px))`,
3462
+ right: m(wt) || "calc(1.25rem + env(safe-area-inset-right, 0px))",
3463
+ transition: "right 0.2s ease-in-out, bottom 0.2s ease-in-out"
3464
+ }),
3465
+ pt: { root: { style: "pointer-events: none" } }
3466
+ }, {
3467
+ button: g(({ visible: e, toggleCallback: t }) => [T(l, {
3468
+ rounded: "",
3469
+ severity: "secondary",
3470
+ class: "pointer-events-auto",
3471
+ onClick: t
3472
+ }, {
3473
+ icon: g(() => [b("div", Ri, [
3474
+ b("div", {
3475
+ class: s(["absolute top-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center", { "w-4 h-[2px] rotate-45 top-1/2 -translate-y-1/2 rounded-none": e }]),
3476
+ style: { backgroundColor: "var(--text-color)" }
3477
+ }, null, 2),
3478
+ b("div", {
3479
+ class: s(["absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full transition-all duration-100", { "opacity-0 scale-0": e }]),
3480
+ style: { backgroundColor: "var(--text-color)" }
3481
+ }, null, 2),
3482
+ b("div", {
3483
+ class: s(["absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center", { "w-4 h-[2px] -rotate-45 bottom-1/2 translate-y-1/2 rounded-none": e }]),
3484
+ style: { backgroundColor: "var(--text-color)" }
3485
+ }, null, 2)
3486
+ ])]),
3487
+ _: 2
3488
+ }, 1032, ["onClick"])]),
3489
+ item: g(({ item: e, toggleCallback: t }) => [x((r(), u(l, a({ severity: "secondary" }, e.buttonProps, {
3490
+ rounded: "",
3491
+ class: "pointer-events-auto",
3492
+ onClick: t
3493
+ }), {
3494
+ icon: g(() => [(r(), u(c(e.icon)))]),
3495
+ _: 2
3496
+ }, 1040, ["onClick"])), [[j, { value: e.label }]])]),
3497
+ _: 1
3498
+ }, 8, ["model", "style"])) : d("", !0),
3499
+ m(J) && m(vt) ? x((r(), u(l, {
3500
+ key: 4,
3501
+ rounded: "",
3502
+ severity: "success",
3503
+ class: "text-white",
3504
+ loading: m(tt),
3505
+ style: v({
3506
+ position: "fixed",
3507
+ zIndex: 15,
3508
+ bottom: `calc(${m(C)}px + ${Math.max(m(it) - m(K), 0)}px + 1.25rem + env(safe-area-inset-bottom, 0px))`,
3509
+ right: m(wt) || "calc(1.25rem + env(safe-area-inset-right, 0px))",
3510
+ transition: m(at) ? "right 0.2s ease-in-out" : "right 0.2s ease-in-out, bottom 0.2s ease-in-out"
3511
+ }),
3512
+ onClick: An
3513
+ }, {
3514
+ icon: g(() => [T(fe, { class: "w-5 h-5" })]),
3515
+ _: 1
3516
+ }, 8, ["loading", "style"])), [[j, { value: e.$t("views.floorplan.save") }]]) : d("", !0),
3517
+ m(J) && m(S) && !m(et) ? x((r(), u(l, {
3518
+ key: 5,
3519
+ rounded: "",
3520
+ class: "pointer-events-auto text-white",
3521
+ style: v({
3522
+ position: "fixed",
3523
+ zIndex: 15,
3524
+ bottom: `calc(${m(C)}px + 1.25rem + env(safe-area-inset-bottom, 0px))`,
3525
+ right: "calc(4.75rem + env(safe-area-inset-right, 0px))"
3526
+ }),
3527
+ onClick: t[9] ||= (e) => $e.value = !0
3528
+ }, {
3529
+ icon: g(() => [T(ie, { class: "w-5 h-5" })]),
3530
+ _: 1
3531
+ }, 8, ["style"])), [[j, { value: e.$t("views.floorplan.palette") }]]) : d("", !0),
3532
+ T(O, {
3533
+ modelValue: m($e),
3534
+ "onUpdate:modelValue": t[10] ||= (e) => p($e) ? $e.value = e : null,
3535
+ title: e.$t("views.floorplan.palette"),
3536
+ "max-height": "70vh"
3537
+ }, {
3538
+ default: g(() => [T(oe, {
3539
+ cameras: m(Ct),
3540
+ sensors: m(xt),
3541
+ rooms: m(St),
3542
+ disabled: !m(z).length,
3543
+ mode: "click",
3544
+ onPick: wn
3545
+ }, null, 8, [
3546
+ "cameras",
3547
+ "sensors",
3548
+ "rooms",
3549
+ "disabled"
3550
+ ])]),
3551
+ _: 1
3552
+ }, 8, ["modelValue", "title"]),
3553
+ b("div", {
3554
+ ref_key: "menuAnchorRef",
3555
+ ref: I,
3556
+ class: "fixed w-0 h-0",
3557
+ style: v({
3558
+ left: `${m(ke).x}px`,
3559
+ top: `${m(ke).y}px`
3560
+ })
3561
+ }, null, 4),
3562
+ b("div", {
3563
+ ref_key: "previewAnchorRef",
3564
+ ref: Ae,
3565
+ class: "fixed w-0 h-0",
3566
+ style: v({
3567
+ left: `${m(Me).x}px`,
3568
+ top: `${m(Me).y}px`
3569
+ })
3570
+ }, null, 4),
3571
+ b("div", {
3572
+ ref_key: "sensorAnchorRef",
3573
+ ref: Pe,
3574
+ class: "fixed w-0 h-0",
3575
+ style: v({
3576
+ left: `${m(Fe).x}px`,
3577
+ top: `${m(Fe).y}px`
3578
+ })
3579
+ }, null, 4),
3580
+ T(me, {
3581
+ ref_key: "sensorPopoverRef",
3582
+ ref: Ie,
3583
+ class: "shadow-lg cui-rounded-corner",
3584
+ pt: { content: { class: "p-3" } }
3585
+ }, {
3586
+ default: g(() => [m($) ? (r(), _("div", {
3587
+ key: 0,
3588
+ class: "w-[220px] flex flex-col gap-3",
3589
+ onPointerenter: nn,
3590
+ onPointerleave: rn
3591
+ }, [
3592
+ b("div", zi, [b("div", Bi, [(r(), u(c(m(pe)(m($).sensorType, Qt(m($).id))), { class: "w-4 h-4" }))]), b("div", Vi, [
3593
+ b("div", Hi, i(m($).name), 1),
3594
+ m($).owner ? (r(), _("div", Ui, i(m($).owner), 1)) : d("", !0),
3595
+ b("div", Wi, i(m(de)(m($).sensorType, Qt(m($).id))), 1)
3596
+ ])]),
3597
+ m($).note ? (r(), _("div", Gi, i(m($).note), 1)) : d("", !0),
3598
+ m($).sensorType === "securitySystem" ? (r(), _("div", Ki, [(r(), _(y, null, n(st, (t) => T(l, {
3599
+ key: t.value,
3600
+ severity: "secondary",
3601
+ outlined: m(Se)(Qt(m($).id)) !== t.value,
3602
+ size: "small",
3603
+ class: "cui-button-medium",
3604
+ label: e.$t(t.labelKey),
3605
+ onClick: (e) => tn(m($).id, t.value)
3606
+ }, null, 8, [
3607
+ "outlined",
3608
+ "label",
3609
+ "onClick"
3610
+ ])), 64))])) : $t(m($).sensorType) ? (r(), u(l, {
3611
+ key: 2,
3612
+ severity: "secondary",
3613
+ size: "small",
3614
+ class: "cui-button-medium",
3615
+ label: e.$t("views.floorplan.sensor_toggle"),
3616
+ onClick: t[11] ||= (e) => en(m($).id)
3617
+ }, null, 8, ["label"])) : d("", !0)
3618
+ ], 32)) : d("", !0)]),
3619
+ _: 1
3620
+ }, 512),
3621
+ T(me, {
3622
+ ref_key: "previewRef",
3623
+ ref: Ne,
3624
+ class: "shadow-lg cui-rounded-corner overflow-hidden",
3625
+ pt: { content: { class: "p-0" } }
3626
+ }, {
3627
+ default: g(() => [b("div", {
3628
+ class: "w-[280px] flex flex-col",
3629
+ onPointerenter: sn,
3630
+ onPointerleave: cn
3631
+ }, [b("div", qi, [m(X) ? (r(), u(he, {
3632
+ key: 0,
3633
+ "camera-info": m(X),
3634
+ "source-role": "low-resolution",
3635
+ "streaming-mode": "auto",
3636
+ toolbar: !1,
3637
+ control: !1,
3638
+ subcontrol: !1,
3639
+ "isolated-stream": !0,
3640
+ "live-indicator-overlay": "",
3641
+ class: "w-full",
3642
+ "flat-card": ""
3643
+ }, null, 8, ["camera-info"])) : d("", !0)]), m(X) ? (r(), _("div", Ji, [b("span", Yi, i(m(X).name), 1), x((r(), u(l, {
3644
+ severity: "secondary",
3645
+ text: "",
3646
+ class: "cui-button p-1.5",
3647
+ onClick: t[12] ||= (t) => e.$router.push(`/cameras/${m(X).name}`)
3648
+ }, {
3649
+ icon: g(() => [T(ge, { class: "w-4 h-4" })]),
3650
+ _: 1
3651
+ })), [[
3652
+ j,
3653
+ { value: e.$t("views.floorplan.open_camera") },
3654
+ void 0,
3655
+ { top: !0 }
3656
+ ]])])) : d("", !0)], 32)]),
3657
+ _: 1
3658
+ }, 512),
3659
+ T(k, {
3660
+ ref_key: "stairsMenuRef",
3661
+ ref: N,
3662
+ items: m(Ot),
3663
+ "max-height": "320px",
3664
+ popover: { pt: { content: { class: "p-0! rounded-xl! overflow-hidden!" } } }
3665
+ }, null, 8, ["items"]),
3666
+ T(k, {
3667
+ ref_key: "levelMenuRef",
3668
+ ref: we,
3669
+ items: m(Et),
3670
+ popover: { pt: { content: { class: "p-0! rounded-xl! overflow-hidden!" } } }
3671
+ }, null, 8, ["items"])
3672
+ ]);
3673
+ };
3674
+ }
3675
+ }), [["__scopeId", "data-v-7b86d341"]]);
3676
+ //#endregion
3677
+ export { Qi as default };