@camstack/addon-admin-ui 1.2.68 → 1.2.71

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 (83) hide show
  1. package/dist/assets/{AddLocationWizard-lYC9uIOO.js → AddLocationWizard-DHDPErNf.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-tzdC3Ns0.js → AddonCollectionPage-CVQw4J0u.js} +1 -1
  3. package/dist/assets/{Addons-8wN98Oyl.js → Addons-sYTMrK-J.js} +1 -1
  4. package/dist/assets/{AdminTabs-C6C22UAV.js → AdminTabs-pF1-A-KE.js} +1 -1
  5. package/dist/assets/{AiProfiles-B2rXccRU.js → AiProfiles-GRKxgX35.js} +1 -1
  6. package/dist/assets/{BrokerForm-O0G1TfN8.js → BrokerForm-VxSsRip5.js} +1 -1
  7. package/dist/assets/{Build-CT1bHQ5W.js → Build-O3uVgjNh.js} +1 -1
  8. package/dist/assets/{Capabilities-zevBj-yO.js → Capabilities-CQxxUapl.js} +1 -1
  9. package/dist/assets/{CapabilityBadges-C0aYZ-4Y.js → CapabilityBadges-_oHvazCd.js} +1 -1
  10. package/dist/assets/{Cluster-BjIfKtHy.js → Cluster-Kkl7uw72.js} +1 -1
  11. package/dist/assets/{Data-B26wfmsF.js → Data-DBDi9mvj.js} +1 -1
  12. package/dist/assets/{DetectionIntelligence-BcVZA4EA.js → DetectionIntelligence-av4nRGRE.js} +1 -1
  13. package/dist/assets/{DeviceAggregateSection-Co1rugo0.js → DeviceAggregateSection-Wr_kfytd.js} +1 -1
  14. package/dist/assets/{DeviceDetail-MGcjPx4I.js → DeviceDetail-eNEkb8_m.js} +1 -1
  15. package/dist/assets/{Devices-CT_WC490.js → Devices-C_MbmSJ4.js} +1 -1
  16. package/dist/assets/{Events-BnQRQSge.js → Events-D7JFLtdm.js} +1 -1
  17. package/dist/assets/{FormBuilder-BzY15Lqd.js → FormBuilder-D2RrNSU_.js} +1 -1
  18. package/dist/assets/{Identity-Cv_12glz.js → Identity-fgQCEPfW.js} +1 -1
  19. package/dist/assets/IntegrationDetail-C-xpeTBn.js +1 -0
  20. package/dist/assets/Integrations-DdvDPknh.js +1 -0
  21. package/dist/assets/{Integrations-C8GhHDoJ.js → Integrations-aOxmxqz2.js} +1 -1
  22. package/dist/assets/{MyAccess-D5qRNofB.js → MyAccess-beomxYFE.js} +1 -1
  23. package/dist/assets/{Network-DexmOXnK.js → Network-JO3K8mwy.js} +1 -1
  24. package/dist/assets/{NodeAddonsSettingsPanel-D3PBRSCc.js → NodeAddonsSettingsPanel-_3VgKCYz.js} +1 -1
  25. package/dist/assets/{NodeInferenceDevices-DauAgzeM.js → NodeInferenceDevices-C0nb4Opn.js} +1 -1
  26. package/dist/assets/{Notifications-DdSvg2fp.js → Notifications-Dr3_MOBK.js} +1 -1
  27. package/dist/assets/{Pipeline-DmfeqWPL.js → Pipeline-B0ixO03m.js} +1 -1
  28. package/dist/assets/{Plates-AklIH6zB.js → Plates-_EwaGk0h.js} +1 -1
  29. package/dist/assets/{ProviderIcon-w7jhybfv.js → ProviderIcon-Dupar-28.js} +1 -1
  30. package/dist/assets/{Recordings-jrL_5nGK.js → Recordings-BxrqJepv.js} +1 -1
  31. package/dist/assets/ScanNetworkModal-Bcp3-HGX.js +1 -0
  32. package/dist/assets/{Scenes-DHkvhZk9.js → Scenes-BpQ2wcG1.js} +1 -1
  33. package/dist/assets/{Settings-paBA0-zW.js → Settings-BVcHPqsS.js} +1 -1
  34. package/dist/assets/{Showroom-BBzjcDSB.js → Showroom-C8FV0gXO.js} +1 -1
  35. package/dist/assets/{Terminal-CKM7xoD6.js → Terminal-dazFgbKN.js} +1 -1
  36. package/dist/assets/{bell-ring-UE4k5yV3.js → bell-ring-CcxrN_iN.js} +1 -1
  37. package/dist/assets/{boxes-C4p8IxEA.js → boxes-DsUqcFyl.js} +1 -1
  38. package/dist/assets/{build-cluster-graph-DK2CKCXo.js → build-cluster-graph-DuaRJrmK.js} +1 -1
  39. package/dist/assets/circle-check-big-DUGsHUSS.js +1 -0
  40. package/dist/assets/{circle-x-Bh81U5AA.js → circle-x-BmQS0KmF.js} +1 -1
  41. package/dist/assets/clock-Bh4t9kpX.js +1 -0
  42. package/dist/assets/{copy-BhNSHU_B.js → copy-CwI0y35L.js} +1 -1
  43. package/dist/assets/{debounced-invalidate-6xh2t1qd.js → debounced-invalidate-DbIi5r2U.js} +1 -1
  44. package/dist/assets/{download-9miCnZfg.js → download-GhxgQuVb.js} +1 -1
  45. package/dist/assets/{face-bbox-DvdTCgbz.js → face-bbox-BvFF5wo_.js} +1 -1
  46. package/dist/assets/{hard-drive-1o4L7lo0.js → hard-drive-8M4xd0gL.js} +1 -1
  47. package/dist/assets/{index-azdrQ4w4.js → index-Cuk54oGv.js} +2 -2
  48. package/dist/assets/{key-round-BUZ4-qru.js → key-round-jjwiThl-.js} +1 -1
  49. package/dist/assets/{mf-entry-bootstrap-0-1aff9649.js → mf-entry-bootstrap-0-02557f9b.js} +1 -1
  50. package/dist/assets/{pencil-LbaEjBS9.js → pencil-BC4xFPPI.js} +1 -1
  51. package/dist/assets/play-BfElPdNV.js +1 -0
  52. package/dist/assets/plus-DWlX1Elu.js +1 -0
  53. package/dist/assets/power-DngdttbL.js +1 -0
  54. package/dist/assets/{radio-CGH2S7bU.js → radio-CuFaCHVR.js} +1 -1
  55. package/dist/assets/{refresh-cw-wh6hxwHJ.js → refresh-cw-CIsDaMr7.js} +1 -1
  56. package/dist/assets/rotate-ccw-zVZ9g59u.js +1 -0
  57. package/dist/assets/rotate-cw-BO0OJOrs.js +1 -0
  58. package/dist/assets/search-JUKgJIWO.js +1 -0
  59. package/dist/assets/{send-CQbE-JKj.js → send-Bk0nhfPV.js} +1 -1
  60. package/dist/assets/{server-COV8wfcz.js → server-CHhr0nc3.js} +1 -1
  61. package/dist/assets/square-C6g9glTu.js +1 -0
  62. package/dist/assets/{square-check-big-Bpr6rGNJ.js → square-check-big-DtFtxAKr.js} +1 -1
  63. package/dist/assets/{star-D7GcDnGr.js → star-DA-MbzZ5.js} +1 -1
  64. package/dist/assets/{undo-2-m-3jbCZw.js → undo-2-FdTAJw9k.js} +1 -1
  65. package/dist/assets/{upload-DIC9blg_.js → upload-CFeYziNH.js} +1 -1
  66. package/dist/assets/{video-DTFPTLfW.js → video-ClKGJxy8.js} +1 -1
  67. package/dist/assets/{wifi-DlHjNFdy.js → wifi-B1oDK3Wx.js} +1 -1
  68. package/dist/assets/{zap-B8n5Qhry.js → zap-D8QzxlxE.js} +1 -1
  69. package/dist/index.html +2 -2
  70. package/dist/server/addon.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/assets/IntegrationDetail-BiX5Pyn7.js +0 -1
  73. package/dist/assets/Integrations-C8_K5MC5.js +0 -1
  74. package/dist/assets/ScanNetworkModal-BY6u70f3.js +0 -1
  75. package/dist/assets/circle-check-big-Dazzd10z.js +0 -1
  76. package/dist/assets/clock-BP6fsTva.js +0 -1
  77. package/dist/assets/play-t8CxcM7s.js +0 -1
  78. package/dist/assets/plus-DPDRiLWi.js +0 -1
  79. package/dist/assets/power-CIROm3xW.js +0 -1
  80. package/dist/assets/rotate-ccw-CmM5_O6a.js +0 -1
  81. package/dist/assets/rotate-cw-CmZvMVGS.js +0 -1
  82. package/dist/assets/search-CCGxRez4.js +0 -1
  83. package/dist/assets/square-BsN7W9LE.js +0 -1
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]);export{t};
@@ -16,4 +16,4 @@ const __mfImport = (src) =>
16
16
  await __mfHostInit.__tla;
17
17
  const { initHost } = __mfHostInit;
18
18
  await initHost();
19
- })().then(() => __mfImport("./index-azdrQ4w4.js"));
19
+ })().then(() => __mfImport("./index-Cuk54oGv.js"));
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),n=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t as n,n as t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),n=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t as n,n as t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`square-check-big`,[[`path`,{d:`M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5`,key:`1uzm8b`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`square-check-big`,[[`path`,{d:`M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5`,key:`1uzm8b`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`mic`,[[`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`,key:`131961`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}]]),n=e(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]);export{t as n,n as t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`mic`,[[`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`,key:`131961`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}]]),n=e(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]);export{t as n,n as t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{t};
1
+ import{K as e}from"./index-Cuk54oGv.js";var t=e(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{t};
package/dist/index.html CHANGED
@@ -99,13 +99,13 @@
99
99
  })
100
100
  })()
101
101
  </script>
102
- <script type="module" crossorigin src="/assets/mf-entry-bootstrap-0-1aff9649.js"></script>
102
+ <script type="module" crossorigin src="/assets/mf-entry-bootstrap-0-02557f9b.js"></script>
103
103
  <link rel="modulepreload" crossorigin href="/assets/__vite-browser-external-B6qJ4svC.js">
104
104
  <link rel="modulepreload" crossorigin href="/assets/src-C0bBvS2n.js">
105
105
  <link rel="modulepreload" crossorigin href="/assets/player-overlays-DQkaycbj.js">
106
106
  <link rel="modulepreload" crossorigin href="/assets/src-Dke0Hyis.js">
107
107
  <link rel="stylesheet" crossorigin href="/assets/index-BppWvbJe.css">
108
- <link rel="modulepreload" crossorigin href="/assets/hostInit-C8N2FrQZ.js"><link rel="modulepreload" crossorigin href="/assets/index-azdrQ4w4.js"><link rel="modulepreload" crossorigin href="/assets/remoteEntry-DZUTMZoM.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DV5OHDzt.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-8kv6pj9W.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DN3UpM8E.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-BsvPG3BX.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DtoGixA1.js"></head>
108
+ <link rel="modulepreload" crossorigin href="/assets/hostInit-C8N2FrQZ.js"><link rel="modulepreload" crossorigin href="/assets/index-Cuk54oGv.js"><link rel="modulepreload" crossorigin href="/assets/remoteEntry-DZUTMZoM.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DV5OHDzt.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-8kv6pj9W.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DN3UpM8E.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-BsvPG3BX.js"><link rel="modulepreload" crossorigin href="/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DtoGixA1.js"></head>
109
109
  <body>
110
110
  <div id="root"></div>
111
111
  <!-- Lock the app shell at 1x zoom. iOS Safari ignores `user-scalable=no`
@@ -33622,7 +33622,7 @@ var AdminUIAddon = class extends BaseAddon {
33622
33622
  capability: adminUiCapability,
33623
33623
  provider: {
33624
33624
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
33625
- getVersion: async () => ({ version: "1.2.68" })
33625
+ getVersion: async () => ({ version: "1.2.71" })
33626
33626
  }
33627
33627
  }];
33628
33628
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.2.68",
3
+ "version": "1.2.71",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin UI — Vite frontend build and server-side addon",
@@ -1 +0,0 @@
1
- import{I as e,K as t,Q as n,S as r,W as i,b as a,o,q as s,x as c,z as l}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Z as u}from"./player-overlays-DQkaycbj.js";import{Br as d,Cr as f,E as p,Gt as m,Hr as h,I as g,Lr as _,Mr as v,Mt as ee,Or as y,P as b,Sr as x,T as te,Xr as S,Y as ne,_r as C,bi as w,br as T,fi as E,gi as D,gr as O,kn as k,kr as A,mi as re,mn as j,ot as M,pi as ie,rt as N,vi as P,vr as F,wr as I,yr as L}from"./src-Dke0Hyis.js";import{et as R}from"./src-C0bBvS2n.js";import{t as z}from"./ProviderIcon-w7jhybfv.js";import{t as B}from"./circle-x-Bh81U5AA.js";import{t as V}from"./FormBuilder-BzY15Lqd.js";import{t as ae}from"./plus-DPDRiLWi.js";import{n as H,r as oe,t as se}from"./ScanNetworkModal-BY6u70f3.js";import{t as ce}from"./refresh-cw-wh6hxwHJ.js";import{t as U}from"./rotate-cw-CmZvMVGS.js";import{t as W}from"./wifi-DlHjNFdy.js";import{A as G,C as K,I as le,J as ue,K as q,P as de,R as fe,W as pe,X as me,Y as he,i as ge,k as _e,m as ve,o as J,p as ye,s as be,t as Y,z as xe}from"./index-azdrQ4w4.js";var Se=q(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);n();function Ce(e){let t=[];for(let n of e)n.type===`probe`&&t.push(n.key),n.type===`group`&&`fields`in n&&t.push(...Ce(n.fields));return t}function we(t,n,r){let[a,o]=s(`idle`),[c,l]=s({}),u=i(()=>{let e=[];for(let n of t.sections)e.push(...Ce(n.fields));return e},[t]),d=u.length>0&&r!==void 0,f=e(e=>{l(t=>{if(!t[e])return t;let n={...t};return delete n[e],n})},[]);return{testAllStatus:a,hasProbeFields:d,probeResults:c,handleTestAll:e(async()=>{if(!r)return;let e=u.filter(e=>{let t=n[e];return t!=null&&String(t).trim()!==``});if(e.length===0)return;o(`testing`);let t={};for(let n of e)t[n]={status:`probing`};l(t);let i=await Promise.allSettled(e.map(async e=>{try{return{key:e,result:await r(e,n[e])}}catch(t){return{key:e,result:{status:`error`,error:t instanceof Error?t.message:String(t)}}}})),a={};for(let e of i)if(e.status===`fulfilled`){let{key:t,result:n}=e.value;a[t]={status:n.status===`ok`?`ok`:`error`,result:n}}l(a),o(`idle`)},[r,u,n]),clearProbeResult:f}}n();function X(e){let t=[];for(let n of e)`required`in n&&n.required===!0&&`key`in n&&n.key&&t.push(n.key),n.type===`group`&&`fields`in n&&t.push(...X(n.fields));return t}function Z(e){return e==null?!0:typeof e==`string`?e.trim()===``:!1}function Q(e,t={}){for(let n of e){if(n.type===`group`&&`fields`in n){Q(n.fields,t);continue}`key`in n&&n.key&&`default`in n&&n.default!==void 0&&(t[n.key]=n.default)}return t}function Te(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?`probe-${crypto.randomUUID()}`:`probe-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Ee({open:t,integrationId:n,addonId:a,onClose:u}){let{t:p}=Y(),m=o(),[h,g]=s({}),[_,ee]=s(!1),[y,b]=s(null),[x,te]=s(Te),C=d({addonId:a},{enabled:t}),w=C.data?.deviceType??null,T=v({addonId:a,type:w??R.Camera},{enabled:t&&C.isSuccess&&w!==null}),E=T.data??null;l(()=>{t&&(g(E?Q(E.sections.flatMap(e=>e.fields)):{}),te(Te()),ee(!1),b(null))},[t,n,E]);let D=i(()=>({...h,_probeRequestId:x}),[h,x]),O=f({onSuccess:()=>{m.invalidateQueries({queryKey:[[`deviceManager`]]})}}),k=S(),A=e(async(e,t)=>{ee(!0);let n=await k.mutateAsync({addonId:a,type:w??R.Camera,key:e,value:t,formValues:D});return n.status===`ok`&&n.suggestedValues&&g(e=>{let t=!1,r={...e};for(let[i,a]of Object.entries(n.suggestedValues??{}))Z(e[i])&&!Z(a)&&(r[i]=a,t=!0);return t?r:e}),n},[k,a,D,w]),{testAllStatus:re,hasProbeFields:j,probeResults:M,handleTestAll:ie,clearProbeResult:N}=we(E??{sections:[]},h,A);async function P(e){b(null);try{await O.mutateAsync({addonId:a,type:w??R.Camera,config:h,integrationId:n}),e?g(E?Q(E.sections.flatMap(e=>e.fields)):{}):u()}catch(e){b(e instanceof Error?e.message:String(e))}}if(!t)return null;let F=X((E?.sections??[]).flatMap(e=>e.fields)).filter(e=>Z(h[e])),I=F.length===0,L=C.isLoading||w!==null&&T.isLoading,z=C.isError||C.isSuccess&&w===null||T.isError||T.isSuccess&&E===null;return r(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[c(`div`,{className:`absolute inset-0 bg-black/60`,onClick:u}),r(`div`,{className:`relative z-10 flex w-full max-w-2xl flex-col max-h-[calc(90dvh-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] rounded-xl border border-border bg-background shadow-2xl`,children:[r(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-4 shrink-0`,children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:p(`integrations.addDevice`)}),c(`button`,{onClick:u,className:`rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,children:c(ge,{className:`h-4 w-4`})})]}),c(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-3`,children:L?c(`div`,{className:`flex items-center justify-center py-8`,children:c(K,{className:`h-5 w-5 animate-spin text-primary`})}):z?r(`div`,{className:`flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3`,children:[c(J,{className:`h-4 w-4 text-destructive mt-0.5 shrink-0`}),r(`div`,{className:`space-y-1`,children:[c(`p`,{className:`text-xs font-medium text-destructive`,children:`Provider unavailable`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:[`The addon `,c(`span`,{className:`font-mono`,children:a}),` is not ready or does not support manual device creation. Check that the integration is online and try again.`]})]})]}):c(V,{schema:E,values:h,onChange:g,onTestField:A,probeResults:M,onClearProbe:N})}),!z&&!L&&r(`div`,{className:`border-t border-border bg-surface/50 shrink-0`,children:[r(`button`,{type:`button`,onClick:()=>ee(e=>!e),className:`flex w-full items-center justify-between px-5 py-2 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,children:[r(`span`,{className:`flex items-center gap-2`,children:[c(ve,{className:`h-3.5 w-3.5`}),`Test logs`,c(`span`,{className:`font-mono text-[9px] opacity-60`,children:x.slice(0,14)})]}),c(fe,{className:`h-3.5 w-3.5 transition-transform ${_?`rotate-180`:``}`})]}),_&&c(`div`,{className:`border-t border-border max-h-64 overflow-hidden`,children:c(ne,{addonId:a,requestId:x,limit:50,maxHeight:`max-h-64`,showFilters:!1,showScope:!1,className:`border-0 rounded-none`})})]}),!z&&!L&&(y||F.length>0)&&c(`div`,{className:`border-t border-destructive/30 bg-destructive/5 px-5 py-2 shrink-0`,children:r(`div`,{className:`flex items-start gap-2`,children:[c(J,{className:`h-3.5 w-3.5 text-destructive mt-0.5 shrink-0`}),c(`p`,{className:`text-[11px] text-destructive`,children:y||`Required: ${F.join(`, `)}`})]})}),r(`div`,{className:`flex items-center justify-between border-t border-border px-5 py-3 shrink-0`,children:[r(`div`,{className:`flex items-center gap-2`,children:[c(`button`,{onClick:u,className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:p(`integrations.cancel`)}),!z&&j&&r(`button`,{type:`button`,onClick:ie,disabled:re===`testing`,className:`inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,children:[re===`testing`?c(K,{className:`h-3.5 w-3.5 animate-spin`}):c(W,{className:`h-3.5 w-3.5`}),`Test All`]})]}),r(`div`,{className:`flex items-center gap-2`,children:[c(`button`,{onClick:()=>P(!0),disabled:z||!I||O.isPending,className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,children:p(`integrations.saveAndNew`)}),c(`button`,{onClick:()=>P(!1),disabled:z||!I||O.isPending,className:`rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50`,children:O.isPending?p(`integrations.saving`):p(`integrations.save`)})]})]})]})]})}var De=1500;function Oe({addonId:e,integrationId:t,jobId:n,onFinished:i}){let{t:a}=Y(),o=O(),s=(L({addonId:e,integrationId:t},{refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`running`)?De:!1}).data??[]).find(e=>e.jobId===n);if(!s)return null;let l=s.state===`running`,u=s.processed,d=s.total>0?Math.round(u/s.total*100):0;!l&&s.finishedAt!==null&&i();let f=[`${u}/${s.total} ${a(`integrations.adoptJobProcessed`,{defaultValue:`processed`})}`];s.adopted>0&&f.push(`${s.adopted} ${a(`integrations.adoptJobAdded`,{defaultValue:`added`})}`),s.alreadyAdopted>0&&f.push(`${s.alreadyAdopted} ${a(`integrations.adoptJobSkipped`,{defaultValue:`already there`})}`),s.failed>0&&f.push(`${s.failed} ${a(`integrations.adoptJobFailed`,{defaultValue:`failed`})}`);let p=f.join(` · `);return r(`div`,{className:`border-t border-border px-5 py-3 shrink-0 space-y-2`,children:[r(`div`,{className:`flex items-center gap-2`,children:[l?c(K,{className:`h-3.5 w-3.5 animate-spin text-primary shrink-0`}):s.failed>0?c(J,{className:`h-3.5 w-3.5 text-destructive shrink-0`}):s.state===`cancelled`?c(B,{className:`h-3.5 w-3.5 text-foreground-subtle shrink-0`}):c(de,{className:`h-3.5 w-3.5 text-primary shrink-0`}),c(`p`,{className:`text-[11px] text-foreground`,children:p}),l&&c(`button`,{onClick:()=>o.mutate({jobId:n}),className:`ml-auto rounded-lg border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground transition-colors`,children:a(`integrations.adoptJobCancel`,{defaultValue:`Stop`})})]}),c(`div`,{className:`h-1 w-full rounded-full bg-border overflow-hidden`,children:c(`div`,{className:`h-full bg-primary transition-all`,style:{width:`${d}%`},role:`progressbar`,"aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":100})}),s.results.filter(e=>e.outcome===`failed`).slice(0,5).map(e=>r(`p`,{className:`text-[11px] text-destructive`,children:[e.childNativeId,`: `,e.error]},e.childNativeId))]})}function ke(e){let t=e.metadata;return[e.name,e.childNativeId,t.model,t.manufacturer,t.integration,t.externalLocation].filter(e=>typeof e==`string`&&e.length>0).join(` `)}n();var $=`devices`,Ae={id:$,label:`Devices`,isDefault:!0},je=2e4,Me=100;function Ne({addonId:n,integrationId:i,onClose:a}){let{t:o}=Y(),[u,d]=s(new Set),[f,p]=s(new Set),[m,h]=s(new Map),[_,v]=s(null),{data:ee}=re(),y=(ee??[]).find(e=>e.addonId===n)?.supportsLocationImport??!1,[S,ne]=s(!0),w=C({addonId:n,integrationId:i}).data?.filters,E=w&&w.length>0?w:[Ae],[D,O]=s(E.find(e=>e.isDefault)?.id??(E.some(e=>e.id===$)?$:E[0].id)),k=D!==$,A=T(),j=F({addonId:n,integrationId:i,page:1,pageSize:je,filter:D}),M=j.refetch,ie=A.mutate,N=e(()=>{ie({addonId:n,integrationId:i},{onSettled:()=>{M()}})},[ie,n,i,M]),P=t(null);l(()=>{let e=`${n}::${i}`;P.current===e||j.isLoading||(P.current=e,(j.data?.candidates.length??0)===0&&N())},[n,i,j.isLoading,j.data,N]);let I=A.isPending,L=A.isError?A.error instanceof Error?A.error.message:String(A.error):null,R=j.data?.candidates??[],z=j.isError?j.error instanceof Error?j.error.message:String(j.error):null,B=x(),[V,ae]=s(null),H=e(e=>{e.alreadyAdopted||d(t=>{let n=new Set(t);return n.has(e.childNativeId)?n.delete(e.childNativeId):n.add(e.childNativeId),n})},[]),oe=e(e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),se=e((e,t)=>{h(n=>{let r=new Map(n),i=r.get(e)?.hiddenChildIds??new Set,a=new Set(i);return a.has(t)?a.delete(t):a.add(t),a.size===0?r.delete(e):r.set(e,{hiddenChildIds:a}),r})},[]),ce=e(e=>{let t={};for(let n of e){let e=m.get(n);e&&e.hiddenChildIds.size>0&&(t[n]={hiddenChildIds:[...e.hiddenChildIds]})}return Object.keys(t).length>0?t:void 0},[m]),W=e(async()=>{v(null);let e=[...u];if(e.length!==0)try{let t=ce(e),{jobId:r}=await B.mutateAsync({addonId:n,integrationId:i,filter:D,childNativeIds:e,...t?{perCandidate:t}:{},...y?{importLocations:S}:{}});ae(r),d(new Set),h(new Map)}catch(e){v(e instanceof Error?e.message:String(e))}},[u,ce,B,n,i,D,y,S]),G=t(null),le=e(()=>{V===null||G.current===V||(G.current=V,M())},[V,M]),ue=e(e=>{O(e),d(new Set),p(new Set),h(new Map),v(null)},[]),q=u.size;return r(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[c(`div`,{className:`absolute inset-0 bg-black/60`,onClick:a}),r(`div`,{className:`relative z-10 flex w-full max-w-3xl flex-col h-[85vh] rounded-xl border border-border bg-background shadow-2xl`,children:[r(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-4 shrink-0`,children:[r(`div`,{className:`min-w-0`,children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:o(`integrations.adoptDevices`,{defaultValue:`Adopt devices`})}),c(`p`,{className:`text-[11px] text-foreground-subtle mt-0.5`,children:o(`integrations.adoptDevicesHint`,{defaultValue:`Preview the candidate devices and add the ones you want.`})})]}),r(`div`,{className:`flex items-center gap-3 shrink-0`,children:[y&&r(`label`,{className:`flex items-center gap-1.5 cursor-pointer text-[11px] text-foreground-subtle hover:text-foreground transition-colors`,children:[c(`input`,{type:`checkbox`,checked:S,onChange:e=>ne(e.target.checked),className:`accent-primary`}),o(`integrations.importLocations`,{defaultValue:`Import locations from the integration`})]}),c(`button`,{onClick:a,className:`rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,"aria-label":`Close`,children:c(ge,{className:`h-4 w-4`})})]})]}),r(`div`,{className:`flex-1 min-h-0 px-5 py-3 flex flex-col gap-2 overflow-hidden`,children:[(L??z)&&R.length===0&&c(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3 shrink-0`,children:r(`div`,{className:`flex items-start gap-2`,children:[c(J,{className:`h-3.5 w-3.5 text-destructive mt-0.5 shrink-0`}),r(`div`,{className:`min-w-0`,children:[c(`p`,{className:`text-xs font-medium text-destructive`,children:o(`integrations.adoptRefreshFailed`,{defaultValue:`Could not discover devices.`})}),c(`p`,{className:`text-[11px] text-destructive/90 mt-0.5`,children:L??z})]})]})}),E.length>1&&c(Pe,{filters:E,activeFilter:D,onSelect:ue}),c(`div`,{className:`flex-1 min-h-0`,children:c(te,{mode:`generic`,items:R,pageSize:Me,getKey:e=>e.childNativeId,getSearchText:ke,getFilterType:e=>e.type,filterOptions:b(),filterLabel:o(`integrations.adoptColType`,{defaultValue:`Type`}),isLoading:j.isLoading||I&&R.length===0,searchPlaceholder:o(`integrations.adoptSearch`,{defaultValue:`Search candidates…`}),emptyLabel:(L??z)&&R.length===0?``:o(`integrations.adoptNoCandidates`,{defaultValue:`No candidate devices found.`}),toolbar:r(`button`,{type:`button`,onClick:N,disabled:I,title:o(`integrations.adoptRefreshTitle`,{defaultValue:`Re-scan Home Assistant for devices`}),className:`inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface px-2.5 py-1.5 text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-60 shrink-0`,children:[c(U,{className:`h-3.5 w-3.5 ${I?`animate-spin`:``}`}),o(`integrations.adoptRefresh`,{defaultValue:`Refresh`})]}),columns:[{key:`name`,header:o(`integrations.adoptColName`,{defaultValue:`Name`}),headerClassName:`w-[55%]`,cell:e=>c(Fe,{candidate:e,expandable:!k,expanded:f.has(e.childNativeId),onToggleExpand:()=>oe(e.childNativeId),adoptedLabel:o(`integrations.adoptAlready`,{defaultValue:`Adopted`})})},{key:`type`,header:o(`integrations.adoptColType`,{defaultValue:`Type`}),headerClassName:`w-[30%] hidden sm:table-cell`,cellClassName:`hidden sm:table-cell`,cell:e=>{let t=g(e.type),n=t.icon;return r(`span`,{className:`inline-flex items-center gap-1.5 text-[10px] text-foreground-subtle`,children:[c(n,{className:`h-3.5 w-3.5 shrink-0`}),t.label]})}},{key:`select`,header:``,headerClassName:`w-[15%] text-right`,cellClassName:`text-right`,cell:e=>c(`div`,{className:`flex items-center justify-end`,children:c(`button`,{onClick:()=>H(e),disabled:e.alreadyAdopted,"aria-label":u.has(e.childNativeId)?`Deselect`:`Select`,className:`inline-flex h-5 w-5 items-center justify-center rounded border ${u.has(e.childNativeId)?`border-primary bg-primary`:`border-border`} ${e.alreadyAdopted?`cursor-not-allowed opacity-50`:``}`,children:u.has(e.childNativeId)&&c(xe,{className:`h-3 w-3 text-primary-foreground`})})})}],isExpanded:e=>!k&&f.has(e.childNativeId),renderExpanded:k?void 0:e=>c(Ie,{candidate:e,hiddenChildIds:m.get(e.childNativeId)?.hiddenChildIds??new Set,onToggleChildHidden:t=>se(e.childNativeId,t)}),rowClassName:e=>e.alreadyAdopted?`opacity-60`:u.has(e.childNativeId)?`bg-primary/5`:``})})]}),_&&c(`div`,{className:`border-t border-destructive/30 bg-destructive/5 px-5 py-2 shrink-0`,children:r(`div`,{className:`flex items-start gap-2`,children:[c(J,{className:`h-3.5 w-3.5 text-destructive mt-0.5 shrink-0`}),c(`p`,{className:`text-[11px] text-destructive`,children:_})]})}),V!==null&&c(Oe,{addonId:n,integrationId:i,jobId:V,onFinished:le}),r(`div`,{className:`flex items-center justify-between border-t border-border px-5 py-3 shrink-0`,children:[c(`div`,{}),r(`div`,{className:`flex items-center gap-2`,children:[c(`button`,{onClick:a,className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:o(`integrations.cancel`,{defaultValue:`Cancel`})}),r(`button`,{onClick:W,disabled:q===0||B.isPending,className:`inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50 disabled:cursor-not-allowed`,children:[B.isPending&&c(K,{className:`h-3.5 w-3.5 animate-spin`}),o(`integrations.addSelected`,{defaultValue:`Add selected`}),q>0?` (${q})`:``]})]})]})]})]})}function Pe({filters:e,activeFilter:t,onSelect:n}){return c(`div`,{role:`tablist`,"aria-label":`Discovery granularity`,className:`inline-flex shrink-0 self-start rounded-lg border border-border bg-surface p-0.5`,children:e.map(e=>{let r=e.id===t;return c(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.id),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${r?`bg-primary text-primary-foreground shadow-sm`:`text-foreground-subtle hover:text-foreground hover:bg-surface-hover`}`,children:e.label},e.id)})})}function Fe({candidate:e,expandable:t,expanded:n,onToggleExpand:i,adoptedLabel:a}){let o=(e.children??[]).length;return r(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[t&&o>0?r(`button`,{type:`button`,onClick:i,"aria-label":n?`Collapse`:`Expand`,"aria-expanded":n,className:`flex h-5 flex-shrink-0 items-center justify-center gap-0.5 rounded px-0.5 text-[10px] text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground`,children:[c(n?fe:le,{className:`h-3.5 w-3.5`}),o]}):c(`span`,{className:`flex h-5 w-5 flex-shrink-0 items-center justify-center text-foreground-subtle/40`,children:`—`}),c(`span`,{className:`truncate text-xs font-medium text-foreground`,children:e.name}),e.alreadyAdopted&&c(`span`,{className:`rounded-full bg-success/10 px-2 py-0.5 text-[9px] font-medium text-success shrink-0`,children:a})]})}function Ie({candidate:e,hiddenChildIds:t,onToggleChildHidden:n}){let i=e.children??[];return i.length===0?null:c(`div`,{className:`space-y-1 py-1`,children:i.map(e=>{let i=t.has(e.childNativeId),a=e.capabilities??[];return r(`div`,{className:`flex items-center gap-2 rounded px-2 py-1 ${i?`opacity-50`:``}`,children:[c(`span`,{className:`text-[11px] text-foreground truncate flex-1 min-w-0`,children:e.name}),a.length>0&&c(`span`,{className:`text-[9px] text-foreground-subtle truncate`,children:a.join(`, `)}),c(`button`,{onClick:()=>n(e.childNativeId),"aria-label":i?`Show child`:`Hide child`,title:i?`Show after adopt`:`Hide after adopt`,className:`flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors flex-shrink-0`,children:c(i?G:_e,{className:`h-3 w-3`})})]},e.childNativeId)})})}n();function Le({integrationId:e,addonId:t,name:n,kind:a,brokerKind:s,trpc:l,onClose:u}){let{t:d}=Y(),f=o(),p=a===`device-adoption`,{data:h}=D({id:e},{enabled:p}),g=i(()=>{let e=h?.brokerId;return typeof e==`string`?e:null},[h]),_=P();return c(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onClick:u,children:r(`div`,{className:`max-h-[85vh] w-full max-w-md overflow-y-auto rounded-xl border border-border bg-surface p-5 shadow-xl`,onClick:e=>e.stopPropagation(),children:[r(`div`,{className:`mb-3 flex items-center justify-between`,children:[r(`h2`,{className:`text-sm font-semibold text-foreground`,children:[d(`integrations.editConfig`,{defaultValue:`Edit configuration`}),` — `,n]}),c(`button`,{onClick:u,className:`rounded-md p-1 text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,"aria-label":d(`common.close`,{defaultValue:`Close`}),children:c(ge,{className:`h-4 w-4`})})]}),p?s?r(`div`,{className:`space-y-3`,children:[c(`p`,{className:`text-[11px] text-foreground-subtle`,children:d(`integrations.relinkBrokerHelp`,{defaultValue:`Choose the broker this integration connects through. Picking a different broker re-points it and restarts the addon.`})}),g&&r(`p`,{className:`text-[11px] text-foreground`,children:[d(`integrations.currentBroker`,{defaultValue:`Current broker`}),`:`,` `,c(`span`,{className:`font-mono text-foreground-subtle`,children:g})]}),_.isPending?r(`div`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[c(K,{className:`h-3 w-3 animate-spin`}),d(`integrations.saving`,{defaultValue:`Saving…`})]}):c(H,{kind:s,onResolved:t=>{_.mutate({id:e,settings:{brokerId:t}},{onSuccess:()=>{f.invalidateQueries(),u()}})},onBack:u}),_.isError&&c(`p`,{className:`text-[11px] text-danger`,children:d(`integrations.relinkFailed`,{defaultValue:`Failed to update broker link.`})})]}):c(`p`,{className:`text-[11px] text-danger`,children:d(`integrations.noBrokerKind`,{defaultValue:`This integration declares device-adoption but its addon manifest has no brokerKind.`})}):c(m,{trpc:l,addonId:t,nodeId:`hub`,title:n})]})})}n();function Re(){let{t}=Y(),{integrationId:n}=he(),d=o(),f=ue(),[m,g]=me(),v=u(),[b,x]=s(!1),[S,C]=s(!1),[T,D]=s(!1),[O,P]=s(!1),[F,L]=s(!1),{data:R,isLoading:B}=ie({id:n??``},{enabled:!!n}),{data:V}=j({addonId:R?.addonId??``,nodeId:`hub`},{enabled:!!R?.addonId}),{data:H,isSuccess:U}=re(),W=i(()=>{let e=R?.addonId;return!e||!U?null:(H??[]).find(t=>t.addonId===e)?.kind===`device-adoption`?`device-adoption`:`device-provider`},[H,R?.addonId,U]),{data:G}=y({}),le=i(()=>(G?.providers??[]).some(e=>e.addonId===R?.addonId),[G,R?.addonId]),q=W!==null,de=R?.info?.fixed===!0,fe=q?W===`device-adoption`?t(`integrations.adoptDevices`,{defaultValue:`Adopt devices`}):t(`integrations.addDevice`):t(`integrations.addDeviceLoading`,{defaultValue:`Loading…`}),_e=i(()=>{let e=R?.addonId;return!e||!U?null:(H??[]).find(t=>t.addonId===e)?.brokerKind??null},[H,R?.addonId,U]),xe=i(()=>{let e=R?.addonId;return!e||!U?null:(H??[]).find(t=>t.addonId===e)?.mode??null},[H,R?.addonId,U]);l(()=>{m.get(`add`)===`1`&&q&&(x(!0),g(e=>{let t=new URLSearchParams(e);return t.delete(`add`),t},{replace:!0}))},[m,q,g]);let Ce=V!=null&&Array.isArray(V.sections)&&V.sections.some(e=>e.fields.length>0),{data:we}=_({},{refetchInterval:5e3}),X=[[`integrations`,`get`],{input:{id:n??``},type:`query`}],Z=w({onMutate:async e=>{await d.cancelQueries({queryKey:X});let t=d.getQueryData(X);return t!=null&&d.setQueryData(X,{...t,enabled:e.enabled}),{previous:t}},onError:(e,t,n)=>{let r=n;r?.previous!=null&&d.setQueryData(X,r.previous)},onSettled:()=>{d.invalidateQueries({queryKey:[[`integrations`]]}),d.invalidateQueries({queryKey:[[`deviceManager`]]})}}),Q=E({onSuccess:()=>{d.invalidateQueries({queryKey:[[`integrations`]]}),d.invalidateQueries({queryKey:[[`deviceManager`]]}),P(!1),f(`/integrations`)}}),Te=k({onSuccess:()=>{d.invalidateQueries({queryKey:[[`integrations`]]}),d.invalidateQueries({queryKey:[[`deviceManager`]]})}}),De=h({onSuccess:()=>{d.invalidateQueries({queryKey:[[`deviceManager`]]})}}),Oe=I({onSuccess:()=>{d.invalidateQueries({queryKey:[[`deviceManager`]]})}}),ke=A({onSuccess:()=>{d.invalidateQueries({queryKey:[[`deviceManager`]]})}}),$=i(()=>we??[],[we]),Ae=i(()=>{let e=new Map;for(let t of $)e.set(t.id,{id:t.id,name:t.name??t.stableId??`#${String(t.id)}`});return e},[$]),je=e(e=>Ae.get(e)??null,[Ae]),Me=e(e=>c(z,{type:e,size:`sm`}),[]),Pe=e(e=>f(`/devices/${String(e)}`),[f]),Fe=i(()=>{let e=R?.addonId;return e?$.filter(t=>t.addonId===e):[]},[$,R?.addonId]),Ie=i(()=>p(Fe).length,[Fe]);return B?r(`div`,{className:`p-4`,children:[c(`div`,{className:`h-16 rounded-lg bg-surface animate-pulse mb-4`}),c(`div`,{className:`h-40 rounded-lg bg-surface animate-pulse`})]}):R?r(`div`,{className:`p-4 space-y-4 overflow-x-hidden`,children:[c(M,{items:[{label:`Integrations`,onClick:()=>f(`/integrations`)},{label:R.name}]}),r(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[r(`div`,{className:`flex items-center gap-3 min-w-0`,children:[c(`img`,{src:`/api/addon-assets/${R.addonId}/assets/icon.svg`,alt:``,className:`h-8 w-8 rounded-lg shrink-0`,onError:e=>{e.target.style.display=`none`}}),r(`div`,{className:`min-w-0`,children:[c(`h1`,{className:`text-lg font-semibold text-foreground truncate`,children:R.name}),r(`p`,{className:`text-[11px] text-foreground-subtle mt-0.5 truncate`,children:[R.addonId,` · `,Ie,` `,t(`integrations.devices`)]})]})]}),r(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[le&&r(`button`,{onClick:()=>C(!0),className:`flex items-center gap-1.5 rounded-lg border border-border bg-surface px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,title:`Scan the network for devices (incl. a different subnet)`,children:[c(oe,{className:`h-3.5 w-3.5`}),`Scan network`]}),!de&&r(`button`,{onClick:()=>x(!0),disabled:!q,className:`flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50 disabled:cursor-not-allowed`,title:fe,children:[c(ae,{className:`h-3.5 w-3.5`}),fe]}),r(`div`,{className:`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 transition-colors ${Z.isPending?`opacity-60`:``} ${R.enabled?`border-success/30 bg-success/5`:`border-border bg-surface`}`,title:t(`integrations.toggleHint`,{defaultValue:`Click to toggle`}),children:[c(ee,{checked:R.enabled,onCheckedChange:e=>Z.mutate({id:n,enabled:e}),disabled:Z.isPending,"aria-label":R.enabled?`Disable integration`:`Enable integration`}),c(`span`,{className:`text-[11px] font-medium ${R.enabled?`text-success`:`text-foreground-subtle`}`,children:R.enabled?`Enabled`:`Disabled`}),Z.isPending&&c(K,{className:`h-3 w-3 animate-spin text-foreground-subtle`})]}),xe!==`standalone`&&(Ce||W===`device-adoption`)&&r(`button`,{onClick:()=>D(!0),className:`flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,children:[c(ye,{className:`h-3 w-3`}),t(`integrations.config`)]}),r(`button`,{onClick:()=>L(!0),className:`flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,title:t(`integrations.logs`,{defaultValue:`View logs`}),children:[c(ve,{className:`h-3 w-3`}),t(`integrations.logs`,{defaultValue:`Logs`})]}),c(N,{label:`Restart`,icon:ce,title:`Restart "${R.name}"?`,description:`Restarting the addon will briefly disconnect every device backed by it (${Ie} active). Streams will reconnect automatically.`,confirmLabel:`Restart`,triggerVariant:`outline`,confirmVariant:`danger`,disabled:Te.isPending,action:()=>Te.mutateAsync({addonId:R.addonId})}),!de&&r(`button`,{onClick:()=>P(!0),className:`flex items-center gap-1.5 rounded-lg border border-danger bg-danger/10 px-3 py-1.5 text-[11px] font-medium text-danger hover:bg-danger hover:text-background transition-colors`,title:t(`integrations.delete`,{defaultValue:`Delete integration`}),children:[c(be,{className:`h-3 w-3`}),t(`integrations.delete`,{defaultValue:`Delete`})]})]})]}),c(te,{context:`integration-detail`,devices:$,trpc:v.trpcClient,defaultView:`cards`,forceAddon:R.addonId,urlScope:`root`,lsKey:`integration-detail:${R.addonId}`,resolveIntegrationIcon:Me,resolveParent:je,onNavigate:Pe,batchActions:{remove:De.mutate,disable:Oe.mutate,enable:ke.mutate},...de?{}:{onDeleteDevice:e=>De.mutate({deviceId:e.id})}}),b&&n&&W===`device-adoption`&&c(Ne,{addonId:R.addonId,integrationId:n,onClose:()=>x(!1)}),b&&n&&W===`device-provider`&&c(Ee,{open:b,integrationId:n,addonId:R.addonId,onClose:()=>x(!1)}),S&&R&&c(se,{open:S,scope:{addonId:R.addonId,label:R.name},onClose:()=>C(!1)}),T&&n&&W!==null&&c(Le,{integrationId:n,addonId:R.addonId,name:R.name,kind:W,brokerKind:_e,trpc:v.trpcClient,onClose:()=>D(!1)}),F&&c(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6`,onClick:()=>L(!1),children:r(`div`,{className:`flex flex-col rounded-xl border border-border bg-surface shadow-xl w-full max-w-5xl h-[80vh]`,onClick:e=>e.stopPropagation(),children:[r(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2.5`,children:[r(`div`,{className:`flex items-center gap-2 min-w-0`,children:[c(ve,{className:`h-4 w-4 text-primary shrink-0`}),c(`h2`,{className:`text-sm font-semibold text-foreground truncate`,children:R.name}),r(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate`,children:[R.addonId,n?` · ${n}`:``]})]}),c(`button`,{onClick:()=>L(!1),className:`flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,"aria-label":`Close logs`,children:c(ge,{className:`h-4 w-4`})})]}),c(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:c(ne,{addonId:R.addonId,limit:200,maxHeight:`max-h-full`,showScope:!1,className:`h-full border-0 rounded-none`})})]})}),O&&c(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60`,onClick:()=>!Q.isPending&&P(!1),children:r(`div`,{className:`rounded-xl border border-border bg-background p-5 shadow-2xl w-96 space-y-3`,onClick:e=>e.stopPropagation(),children:[r(`div`,{className:`flex items-start gap-3`,children:[c(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-lg bg-danger/10 shrink-0`,children:c(J,{className:`h-4 w-4 text-danger`})}),r(`div`,{className:`min-w-0`,children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`integrations.deleteTitle`,{defaultValue:`Delete integration?`})}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`integrations.deleteWarning`,{defaultValue:`This removes the integration "{{name}}" and its {{count}} device(s). The addon will restart. This cannot be undone.`,name:R.name,count:Ie})})]})]}),Q.error&&c(`div`,{className:`rounded-lg border border-danger/40 bg-danger/10 px-3 py-2 text-[11px] text-danger`,children:Q.error instanceof Error?Q.error.message:String(Q.error)}),r(`div`,{className:`flex items-center justify-end gap-2 pt-1`,children:[c(`button`,{onClick:()=>P(!1),disabled:Q.isPending,className:`rounded-lg border border-border px-3 py-1.5 text-[11px] text-foreground-subtle hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:t(`integrations.cancel`,{defaultValue:`Cancel`})}),c(`button`,{onClick:()=>Q.mutate({id:n}),disabled:Q.isPending,className:`inline-flex items-center gap-1.5 rounded-lg bg-danger px-3 py-1.5 text-[11px] font-medium text-background hover:bg-danger/90 transition-colors disabled:opacity-60 disabled:cursor-not-allowed`,children:Q.isPending?r(a,{children:[c(K,{className:`h-3 w-3 animate-spin`}),t(`integrations.deleting`,{defaultValue:`Deleting…`})]}):r(a,{children:[c(be,{className:`h-3 w-3`}),t(`integrations.confirmDelete`,{defaultValue:`Delete integration`})]})})]})]})})]}):r(`div`,{className:`flex flex-col items-center justify-center py-20 px-6 text-center gap-4`,children:[c(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-foreground-subtle/10`,children:c(Se,{className:`h-6 w-6 text-foreground-subtle`})}),r(`div`,{className:`space-y-1 max-w-sm`,children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`integrations.integrationNotFound`,{defaultValue:`Integration not found`})}),c(`p`,{className:`text-[11px] text-foreground-subtle`,children:t(`integrations.integrationNotFoundHint`,{defaultValue:`The integration "{{id}}" does not exist. It may have been deleted, or the URL may be wrong.`,id:n??``})})]}),r(`button`,{onClick:()=>f(`/integrations`),className:`inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] font-medium text-foreground hover:bg-surface-hover transition-colors`,children:[c(pe,{className:`h-3 w-3`}),t(`integrations.backToList`,{defaultValue:`Back to integrations`})]})]})}export{Re as IntegrationDetailPage};
@@ -1 +0,0 @@
1
- import{I as e,Q as t,S as n,W as r,b as i,o as a,q as o,x as s,z as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Z as l}from"./player-overlays-DQkaycbj.js";import{E as u,Er as d,Lr as f,T as p,_i as m,di as h,hr as g,mi as _,mn as ee,tn as te,yi as v}from"./src-Dke0Hyis.js";import{t as y}from"./ProviderIcon-w7jhybfv.js";import{t as b}from"./FormBuilder-BzY15Lqd.js";import{t as ne}from"./plus-DPDRiLWi.js";import{n as re,r as x,t as S}from"./ScanNetworkModal-BY6u70f3.js";import{t as ie}from"./refresh-cw-wh6hxwHJ.js";import{C,I as w,J as T,R as E,V as D,X as O,i as k,p as A,t as j,v as ae,z as M}from"./index-azdrQ4w4.js";import{t as N}from"./AdminPage-CCD07UMs.js";import{t as P}from"./useEventInvalidation-CVopBRz3.js";import{t as F}from"./StatusBadge-CeptlsPG.js";import{t as I}from"./useBodyScrollLock-BDocajQE.js";t();function L(e,t){let[n,r]=o(!1);return c(()=>{if(!e){r(!1);return}r(!1);let n=setTimeout(()=>r(!0),t);return()=>clearTimeout(n)},[e,t]),n}t();function R({providerId:e,onImport:t,onSkip:r}){let{t:i}=j(),[a,l]=o(new Set),u=d(),f=u.data,p=u.isPending||!u.data&&!u.isError;c(()=>{e&&(u.isPending||u.data||u.mutate({addonId:e}))},[e,u]);function m(e){l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}if(p)return n(`div`,{className:`flex flex-col items-center py-12`,children:[s(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent`}),s(`p`,{className:`mt-3 text-xs text-foreground-subtle`,children:i(`integrations.searchingDevices`)})]});let h=f??[];return n(`div`,{className:`space-y-4`,children:[s(`p`,{className:`text-xs text-foreground-subtle`,children:h.length>0?i(`integrations.foundDevices`,{count:h.length}):i(`integrations.noDevicesFound`)}),h.length>0&&s(`div`,{className:`space-y-1.5 max-h-64 overflow-y-auto`,children:h.map(e=>{let t=e.stableId,r=e.suggestedName??t,i=a.has(t);return n(`button`,{onClick:()=>m(t),className:`flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors ${i?`border-primary/40 bg-primary/5`:`border-border bg-surface hover:border-foreground-subtle/30`}`,children:[s(`div`,{className:`flex h-5 w-5 items-center justify-center rounded border flex-shrink-0 ${i?`border-primary bg-primary`:`border-border`}`,children:i&&s(M,{className:`h-3 w-3 text-primary-foreground`})}),s(D,{className:`h-3.5 w-3.5 text-foreground-subtle flex-shrink-0`}),s(`span`,{className:`text-xs font-medium text-foreground truncate`,children:r})]},t)})}),n(`div`,{className:`flex items-center justify-between pt-2`,children:[s(`button`,{onClick:r,className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:i(`integrations.skip`)}),h.length>0&&n(`button`,{onClick:()=>t(Array.from(a)),disabled:a.size===0,className:`rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50`,children:[i(`integrations.importSelected`),` (`,a.size,`)`]})]})]})}t();function z(e){return{status:e.status===`validated`||e.status===`rejected`||e.status===`inconclusive`||e.status===`unsupported`?e.status:e.success?`validated`:`rejected`,...e.error===void 0?{}:{error:e.error},...e.detail===void 0?{}:{detail:e.detail}}}var B={validated:`border-success/30 bg-success/5 text-success`,rejected:`border-danger/30 bg-danger/5 text-danger`,inconclusive:`border-warning/30 bg-warning/5 text-warning`,unsupported:`border-border bg-surface text-foreground-subtle`};function V({addonId:e,configSchema:t,canTest:r=!0,onSave:i,onBack:a}){let{t:c}=j(),[l,u]=o(``),[d,f]=o({}),[p,m]=o(null),h=v({onSuccess:e=>m(z(e)),onError:e=>m({status:`inconclusive`,error:String(e)})});return n(`div`,{className:`space-y-4`,children:[n(`div`,{children:[s(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:c(`integrations.integrationName`)}),s(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:c(`integrations.integrationNamePlaceholder`),className:`w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50`})]}),t&&s(b,{schema:t,values:d,onChange:f}),p&&s(`div`,{className:`rounded-lg border px-3 py-2 text-xs ${B[p.status]}`,children:(e=>{switch(e.status){case`validated`:return e.detail?`${c(`integrations.connectionSuccess`)} — ${e.detail}`:c(`integrations.connectionSuccess`);case`rejected`:return`${c(`integrations.errorPrefix`)} ${e.error??``}`;case`inconclusive`:return`${c(`integrations.connectionInconclusive`,{defaultValue:`Could not be checked:`})} ${e.error??``}`;case`unsupported`:return e.error??c(`integrations.connectionUntestable`,{defaultValue:`This integration cannot be tested before it is created.`})}})(p)}),n(`div`,{className:`flex items-center justify-between pt-2`,children:[s(`button`,{onClick:a,className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:c(`integrations.back`)}),n(`div`,{className:`flex items-center gap-2`,children:[s(`button`,{onClick:()=>h.mutate({addonId:e,settings:d}),disabled:h.isPending||!r,title:r?void 0:c(`integrations.connectionUntestable`,{defaultValue:`This integration cannot be tested before it is created.`}),className:`rounded-lg border border-border px-3 py-1.5 text-xs text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:h.isPending?c(`integrations.testing`):c(`integrations.testConnection`)}),s(`button`,{onClick:()=>i({name:l,config:d}),disabled:!l.trim(),className:`rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50`,children:c(`integrations.forward`)})]})]})]})}function oe({onSelect:e,onClose:t,pendingAddonId:r=null}){let{t:i}=j(),a=T(),{data:o,isLoading:c}=_();if(c)return s(`div`,{className:`space-y-2 p-2`,children:[1,2,3].map(e=>s(`div`,{className:`h-14 rounded-lg bg-surface animate-pulse`},e))});let l=r!==null;return n(`div`,{className:`space-y-2`,children:[(o??[]).map(o=>{let c=o.instanceMode===`unique`&&o.existingInstances.length>0,u=r===o.addonId,d=l;return n(`button`,{disabled:d,onClick:()=>{if(!d)if(c){let e=o.existingInstances[0].id;t(),a(`/integrations/${e}`)}else e(o.addonId,o.instanceMode,o.discoveryMode,o.name,o.kind,o.brokerKind,o.mode,o.canTest)},className:`flex w-full items-center gap-3 rounded-lg border border-border bg-surface p-3 text-left hover:border-foreground-subtle/30 transition-colors disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:border-border`,children:[o.iconUrl?s(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-lg flex-shrink-0`,style:{backgroundColor:`${o.color}15`},children:s(`img`,{src:o.iconUrl,alt:``,className:`h-5 w-5`})}):s(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-lg flex-shrink-0`,style:{backgroundColor:`${o.color}15`},children:s(`span`,{className:`text-sm`,style:{color:o.color},children:`◉`})}),n(`div`,{className:`flex-1 min-w-0`,children:[s(`p`,{className:`text-xs font-semibold text-foreground`,children:o.name}),o.description&&s(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5 truncate`,children:o.description})]}),u?s(C,{className:`h-4 w-4 animate-spin text-primary flex-shrink-0`}):c?n(`span`,{className:`flex items-center gap-1 text-[10px] font-medium text-foreground-subtle`,children:[s(A,{className:`h-3 w-3`}),i(`integrations.manage`)]}):s(w,{className:`h-4 w-4 text-foreground-subtle flex-shrink-0`})]},o.addonId)}),(o??[]).length===0&&s(`div`,{className:`py-8 text-center text-xs text-foreground-subtle`,children:i(`integrations.noProviders`)})]})}t();function H(e){let t=e=>{if(e.type===`separator`||e.type===`info`||e.type===`button`)return e;if(e.type===`group`)return{...e,fields:e.fields.map(e=>t(e))};let{value:n,...r}=e;return r};return{...e.tabs?{tabs:e.tabs}:{},sections:e.sections.map(e=>({...e,fields:e.fields.map(t)}))}}var U=2e4;function se({open:e,onClose:t}){let{t:l}=j(),u=T(),f=a(),[p,m]=o(`picker`),[_,te]=o(null),[v,y]=o(null),[b,ne]=o(`manual`),[x,S]=o(null),[ie,w]=o(``),[E,D]=o(null),[O,A]=o(null),[ae,M]=o(!1),{data:N}=ee({addonId:_??``,nodeId:`hub`},{enabled:_!=null}),P=r(()=>N?H(N):null,[N]),F=h({onSuccess:()=>f.invalidateQueries({queryKey:[[`integrations`]]})}),z=d(),B=z.data;c(()=>{p!==`discovery`||!v||!_||z.isPending||z.data||z.mutate({addonId:_})},[p,v,_,z]);let se=g({onSuccess:()=>f.invalidateQueries({queryKey:[[`deviceManager`]]})});function W(e,t,n,r,i,a,o,s){if(!F.isPending){if(te(e),M(s),ne(n),w(r),A(null),o===`broker`){if(!a){A(`Addon '${e}' declares mode 'broker' but no brokerKind in its manifest`);return}S(a),m(`broker`);return}if(o===`account`){m(`config`);return}ce(e,r)}}async function ce(e,n){try{let r=await F.mutateAsync({addonId:e,name:n,settings:{}});t(),J(),u(`/integrations/${r.id}?add=1`)}catch{}}async function le(e){if(_)try{let t=await F.mutateAsync({addonId:_,name:e.name,settings:e.config});y(t.id),b===`auto`||b===`both`?m(`discovery`):q(t.id)}catch{}}async function G(e){if(_)try{let t=await F.mutateAsync({addonId:_,name:ie,settings:{brokerId:e}});D(t.id),y(t.id),q(t.id)}catch{}}async function K(e){if(_){for(let t of e){let e=B?.find(e=>e.stableId===t);e&&await se.mutateAsync({addonId:_,candidate:e,...E===null?{}:{integrationId:E}})}q()}}function q(e){let n=e??v??_;t(),J(),n&&u(`/integrations/${n}`)}function J(){m(`picker`),te(null),y(null),ne(`manual`),S(null),w(``),D(null),A(null),M(!1)}function Y(){t(),J()}I(e);let X=F.isPending,Z=L(X,U);if(!e)return null;let Q={picker:l(`integrations.newIntegration`),config:l(`integrations.configureIntegration`),discovery:l(`integrations.importDevices`),broker:l(`integrations.connectBroker`,{defaultValue:`Connect a broker`})},ue=X?_:null,$=F.error,de=X&&!Z;return n(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[s(`div`,{className:`absolute inset-0 bg-black/60`,onClick:de?void 0:Y}),n(`div`,{className:`relative z-10 w-full max-w-lg max-h-[calc(85dvh-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] rounded-xl border border-border bg-background shadow-2xl flex flex-col overflow-hidden`,children:[n(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-4 flex-shrink-0`,children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:Q[p]}),s(`button`,{onClick:Y,disabled:de,className:`rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:s(k,{className:`h-4 w-4`})})]}),n(`div`,{className:`px-5 py-4 flex-1 overflow-y-auto overscroll-contain`,children:[$&&!X&&s(`div`,{className:`mb-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:$ instanceof Error?$.message:String($)}),p===`picker`&&n(i,{children:[O&&s(`div`,{className:`mb-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:O}),s(oe,{onSelect:W,onClose:Y,pendingAddonId:ue})]}),p===`config`&&_&&s(V,{addonId:_,configSchema:P??null,canTest:ae,onSave:le,onBack:()=>m(`picker`)}),p===`broker`&&x&&s(re,{kind:x,onResolved:e=>{G(e)},onBack:()=>m(`picker`)}),p===`discovery`&&v&&s(R,{providerId:v,onImport:K,onSkip:q})]}),X&&n(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 rounded-xl bg-background/85 backdrop-blur-sm px-6 text-center`,children:[s(C,{className:`h-6 w-6 animate-spin text-primary`}),s(`p`,{className:`text-xs font-medium text-foreground`,children:l(`integrations.creating`,{defaultValue:`Creating integration…`})}),!Z&&s(`p`,{className:`text-[10px] text-foreground-subtle`,children:l(`integrations.creatingHint`,{defaultValue:`Waiting for the addon to restart and register`})}),Z&&n(i,{children:[s(`p`,{className:`text-[10px] text-foreground-subtle max-w-xs`,children:l(`integrations.creatingOverdue`,{defaultValue:`This is taking longer than expected. The integration may already have been created — close this dialog and refresh to check.`})}),s(`button`,{onClick:Y,className:`mt-1 rounded-md border border-border bg-surface px-3 py-1.5 text-[11px] font-medium text-foreground hover:bg-surface-hover transition-colors`,children:l(`integrations.closeAndRefresh`,{defaultValue:`Close`})})]})]})]})]})}function W({integration:e,expanded:t,onToggleExpand:r}){return n(`div`,{className:`flex items-center gap-2.5`,children:[s(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),r(e.addonId)},"aria-label":t?`Collapse`:`Expand`,"aria-expanded":t,className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground`,children:s(t?E:w,{className:`h-3.5 w-3.5`})}),s(y,{type:e.addonId,size:`sm`}),n(`div`,{className:`flex min-w-0 flex-col`,children:[s(`span`,{className:`truncate text-xs font-semibold text-foreground`,children:e.name}),s(`span`,{className:`truncate text-[10px] text-foreground-subtle`,children:e.addonId})]})]})}function ce(e){let{isExpanded:t,onToggleExpand:n}=e;return[{key:`name`,header:`Integration`,headerClassName:`w-[55%]`,cell:e=>s(W,{integration:e,expanded:t(e),onToggleExpand:n})},{key:`devices`,header:`Devices`,headerClassName:`w-[15%]`,cellClassName:`text-[11px] text-foreground-subtle`,cell:e=>`${e.deviceCount} device${e.deviceCount===1?``:`s`}`},{key:`status`,header:`Status`,headerClassName:`w-[15%]`,cell:e=>s(F,{status:e.status})}]}t();function le(e){if(!e.enabled)return`disabled`;switch(e.processState){case`running`:return`running`;default:return`stopped`}}var G=`expand`;function K(){let{t}=j(),a=T(),c=l(),[d]=O(),[h,g]=o(!1),_=e(()=>g(!0),[]),ee=e(()=>g(!1),[]),[v,b]=o(!1),re=e(()=>b(!0),[]),C=e(()=>b(!1),[]);P([`integrations`],[`integration.enabled`,`integration.disabled`,`integration.deleted`,`provider.started`,`provider.stopped`,`addon.installed`,`addon.uninstalled`,`addon.started`,`addon.stopped`,`addon.updated`]),P([`deviceManager`],[`device.registered`,`device.unregistered`,`device.online`,`device.offline`,`device.disabled`,`device.enabled`]);let{data:w,isLoading:E,refetch:D}=m(void 0),{data:k,isLoading:A,refetch:M}=f({}),F=r(()=>k??[],[k]),I=r(()=>w??[],[w]),L=r(()=>{let e=new Map;for(let t of F)e.set(t.id,{id:t.id,name:t.name??t.stableId??`#${String(t.id)}`});return e},[F]),R=r(()=>{let e=new Map;for(let t of u(F)){let n=t.addonId??``;n&&e.set(n,(e.get(n)??0)+1)}return e},[F]),z=r(()=>I.map(e=>({id:e.id,addonId:e.addonId,name:e.name,enabled:e.enabled,status:le(e),deviceCount:R.get(e.addonId)??0})),[I,R]),B=d.get(G),V=e(e=>{let t=new URLSearchParams(window.location.search);t.get(G)===e?t.delete(G):t.set(G,e);let n=t.toString(),r=`${window.location.pathname}${n?`?${n}`:``}${window.location.hash}`;window.history.replaceState(window.history.state,``,r),window.dispatchEvent(new PopStateEvent(`popstate`))},[]),oe=e(e=>a(`/integrations/${e.id}`),[a]),H=e(e=>L.get(e)??null,[L]),U=e(e=>s(y,{type:e,size:`sm`}),[]),W=e(e=>a(`/devices/${String(e)}`),[a]),K=e(e=>s(p,{context:`integration-detail`,devices:F,trpc:c.trpcClient,forceAddon:e.addonId,urlScope:`nested`,lsKey:`integrations:nested:${e.addonId}`,resolveIntegrationIcon:U,resolveParent:H,onNavigate:W}),[F,c.trpcClient,U,H,W]),q=e(e=>B===e.addonId,[B]),J=r(()=>ce({isExpanded:q,onToggleExpand:V}),[q,V]),Y=e(e=>`${e.name} ${e.addonId}`,[]),X=e(e=>e.addonId,[]),Z=e(()=>{D(),M()},[D,M]),Q=E||A,ue=I.length>0;return n(N,{icon:ae,title:t(`nav.integrations`,`Integrations`),actions:n(i,{children:[s(`button`,{onClick:Z,disabled:Q,className:`flex items-center gap-1 rounded-lg border border-border bg-surface px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,title:`Refresh`,children:s(ie,{className:te(`h-3.5 w-3.5`,Q&&`animate-spin`)})}),n(`button`,{onClick:re,className:`flex items-center gap-1.5 rounded-lg border border-border bg-surface px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,title:`Scan the local network for devices`,children:[s(x,{className:`h-3.5 w-3.5`}),`Scan network`]}),n(`button`,{onClick:_,className:`flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm`,children:[s(ne,{className:`h-3.5 w-3.5`}),`New Integration`]})]}),children:[Q&&s(`div`,{className:`space-y-2`,children:[1,2,3].map(e=>s(`div`,{className:`h-12 rounded-lg border border-border bg-surface animate-pulse`},e))}),!Q&&!ue&&n(`div`,{className:`flex flex-col items-center py-20 text-foreground-subtle`,children:[s(`p`,{className:`text-sm`,children:`No integrations configured.`}),s(`p`,{className:`text-xs mt-1`,children:`Click "New Integration" to connect cameras and devices.`})]}),!Q&&ue&&s(p,{mode:`generic`,items:z,getKey:X,getSearchText:Y,columns:J,onRowClick:oe,isExpanded:q,renderExpanded:K,searchPlaceholder:t(`integrations.search`,{defaultValue:`Search integrations…`}),emptyLabel:t(`integrations.empty`,{defaultValue:`No integrations found.`})}),s(se,{open:h,onClose:ee}),s(S,{open:v,onClose:C})]})}export{K as IntegrationsPage};
@@ -1 +0,0 @@
1
- import{I as e,K as t,Q as n,S as r,W as i,b as a,q as o,x as s,z as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Dr as l,Lr as u,Tr as d,Vr as f,ar as p,hr as m,or as h,tr as g}from"./src-Dke0Hyis.js";import{t as _}from"./download-9miCnZfg.js";import{t as v}from"./FormBuilder-BzY15Lqd.js";import{t as y}from"./refresh-cw-wh6hxwHJ.js";import{C as b,K as x,L as S,i as C,j as w,o as T,z as E}from"./index-azdrQ4w4.js";import{t as D}from"./BrokerForm-O0G1TfN8.js";var O=x(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]);n();var k=[`amazon.com`,`amazon.it`,`amazon.de`,`amazon.co.uk`,`amazon.fr`,`amazon.es`,`amazon.ca`,`amazon.com.au`,`amazon.co.jp`,`amazon.in`,`amazon.com.br`,`amazon.com.mx`],A=`/addon/import-alexa`,j=2e3;function M(e){return typeof e==`object`&&!!e&&typeof e.sessionId==`string`&&typeof e.loginUrl==`string`}function N(e){return typeof e==`object`&&!!e&&typeof e.phase==`string`&&typeof e.sessionId==`string`}function P(e){return typeof e==`object`&&!!e&&typeof e.brokerId==`string`}function F(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${localStorage.getItem(`camstack_admin_token`)??``}`,...e}}async function I(e,t,n){let r=await fetch(`${A}${e}`,{method:`POST`,headers:F(),body:JSON.stringify(t)}),i=await r.json();if(!r.ok){let e=typeof i==`object`&&i?i.error??`Unknown error`:`Unknown error`;throw Error(String(e))}if(!n(i))throw Error(`Unexpected response from server`);return i}async function L(e){let t=new URLSearchParams({sessionId:e}),n=localStorage.getItem(`camstack_admin_token`)??``,r=await fetch(`${A}/login/status?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}}),i=await r.json();if(!r.ok){let e=typeof i==`object`&&i?i.error??`Unknown error`:`Unknown error`;throw Error(String(e))}if(!N(i))throw Error(`Unexpected status response from server`);return i}async function R(e){try{await fetch(`${A}/login/cancel`,{method:`POST`,headers:F(),body:JSON.stringify({sessionId:e})})}catch{}}function z({brokerId:n,onResolved:i,onCancel:a}){let[l,u]=o(`amazon.it`),[d,f]=o(`Alexa account`),[p,m]=o({kind:`idle`}),h=t(!0);c(()=>(h.current=!0,()=>{h.current=!1}),[]);let g=t(null),_=t(null),v=e(()=>{_.current!==null&&(clearInterval(_.current),_.current=null)},[]),x=e(async e=>{v(),h.current&&m({kind:`committing`,sessionId:e});try{let t=await I(`/login/commit`,{sessionId:e,name:d.trim().length>0?d.trim():`Alexa account`,...n===void 0?{}:{brokerId:n}},P);g.current=null,i(t.brokerId)}catch(t){let n=t instanceof Error?t.message:String(t);h.current&&m({kind:`error`,message:n,sessionId:e})}},[n,d,i,v]),S=e((e,t)=>{v();let n=async()=>{try{let n=await L(e);if(n.phase===`captured`){v(),x(e);return}if(n.phase===`error`){v(),h.current&&m({kind:`error`,message:n.error??`Login proxy returned an error`,sessionId:e});return}if(n.phase===`cancelled`){v(),h.current&&m({kind:`idle`});return}h.current&&m({kind:`polling`,sessionId:e,loginUrl:n.loginUrl||t,phase:n.phase})}catch(e){let t=e instanceof Error?e.message:String(e);h.current&&m(e=>e.kind===`polling`?{...e}:{kind:`error`,message:t,sessionId:null})}};_.current=setInterval(()=>{n()},j)},[v,x]);c(()=>()=>{v(),g.current!==null&&R(g.current)},[v]);let C=async()=>{v(),g.current!==null&&(R(g.current),g.current=null),m({kind:`starting`});try{let e=await I(`/login/start`,{amazonDomain:l},M);g.current=e.sessionId,m({kind:`polling`,sessionId:e.sessionId,loginUrl:e.loginUrl,phase:`starting`}),S(e.sessionId,e.loginUrl)}catch(e){m({kind:`error`,message:e instanceof Error?e.message:String(e),sessionId:null})}},E=()=>{v(),g.current!==null&&(R(g.current),g.current=null),m({kind:`idle`})},D=()=>{E()},O=p.kind===`idle`,A=p.kind===`starting`,N=p.kind===`polling`,F=p.kind===`committing`,z=p.kind===`error`,B=A||N||F,V=p.kind===`polling`?p.phase:null,H=p.kind===`polling`?p.loginUrl:null,U=N&&V===`awaiting-login`,W=N&&(V===`starting`||V===null);return r(`div`,{className:`space-y-4`,children:[(O||z)&&r(`div`,{className:`space-y-3`,children:[n===void 0&&r(`div`,{className:`space-y-1`,children:[s(`label`,{htmlFor:`alexa-account-name`,className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Account name`}),s(`input`,{id:`alexa-account-name`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`Alexa account`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),r(`div`,{className:`space-y-1`,children:[s(`label`,{htmlFor:`alexa-amazon-region`,className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Amazon region`}),s(`select`,{id:`alexa-amazon-region`,value:l,onChange:e=>u(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`,children:k.map(e=>s(`option`,{value:e,children:e},e))})]})]}),z&&r(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px] flex items-start gap-2`,children:[s(T,{className:`h-3.5 w-3.5 mt-0.5 flex-shrink-0`}),s(`span`,{children:p.message})]}),A&&r(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[s(b,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Starting login proxy…`]}),W&&r(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[s(b,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Waiting for proxy to be ready…`]}),F&&r(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-3 text-xs text-foreground-subtle`,children:[s(b,{className:`h-4 w-4 animate-spin flex-shrink-0`}),`Saving credentials…`]}),U&&H!==null&&r(`div`,{className:`space-y-3`,children:[r(`div`,{className:`rounded-lg border border-border bg-surface p-3 space-y-2`,children:[s(`p`,{className:`text-xs font-semibold text-foreground`,children:`Open the link below to log in to your Amazon account`}),s(`p`,{className:`text-[10px] text-foreground-subtle`,children:`After completing the login and any 2FA steps, this wizard will continue automatically.`}),r(`a`,{href:H,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90`,children:[s(w,{className:`h-3.5 w-3.5`}),`Login to Amazon`]})]}),r(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[10px] text-amber-700 dark:text-amber-300`,children:[s(`strong`,{children:`Note:`}),` The login proxy runs directly on the hub. If the link does not open or the page does not load, make sure the hub's proxy host and port are reachable from your browser. You can configure `,s(`code`,{className:`font-mono`,children:`proxyHost`}),` in the Alexa addon settings and ensure the proxy port is published (Docker port mapping).`]}),r(`div`,{className:`flex items-center gap-2 text-[10px] text-foreground-subtle`,children:[s(b,{className:`h-3 w-3 animate-spin`}),`Waiting for Amazon login to complete…`]})]}),r(`div`,{className:`flex items-center justify-between gap-2 pt-1`,children:[s(`button`,{type:`button`,onClick:B?E:a,className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:B?`Cancel login`:`Back`}),r(`div`,{className:`flex items-center gap-2`,children:[z&&r(`button`,{type:`button`,onClick:D,className:`inline-flex items-center gap-1.5 rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10`,children:[s(y,{className:`h-3.5 w-3.5`}),`Retry`]}),O&&s(`button`,{type:`button`,onClick:()=>{C()},disabled:n===void 0&&d.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:`Start login`})]})]})]})}n();var B=`alexa`;function V(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`):[]}function H(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.addonId==`string`&&Array.isArray(e.kinds)):[]}var U={connected:`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`,connecting:`bg-amber-500/15 text-amber-700 dark:text-amber-300`,disconnected:`bg-foreground-subtle/15 text-foreground-subtle`,"auth-failed":`bg-danger/15 text-danger`,unreachable:`bg-danger/15 text-danger`,error:`bg-danger/15 text-danger`};function W({kind:e,onResolved:t,onBack:n}){let[a,c]=o(e===B?`alexa-login`:`existing`),l=p({kind:e}),u=i(()=>V(l.data).filter(t=>t.kind===e),[l.data,e]),d=h(),f=i(()=>{for(let t of H(d.data))if(t.kinds.some(t=>t.kind===e))return t.addonId},[d.data,e]),[m,_]=o(null),[v,y]=o(``),x=g({}),C=()=>{m&&t(m)},w=async n=>{v.trim().length!==0&&t((await x.mutateAsync({kind:e,name:v.trim(),settings:n,...f===void 0?{}:{addonId:f}})).id)},T=e=>{e===`new`?_(null):x.reset(),c(e)};return r(`div`,{className:`space-y-4`,children:[r(`button`,{type:`button`,onClick:n,className:`inline-flex items-center gap-1 text-[11px] text-foreground-subtle hover:text-foreground`,children:[s(S,{className:`h-3.5 w-3.5`}),` Back`]}),r(`div`,{className:`inline-flex rounded-lg border border-border p-0.5 flex-wrap gap-0.5`,children:[e===B&&s(`button`,{type:`button`,onClick:()=>T(`alexa-login`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a===`alexa-login`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:`Login interactively`}),s(`button`,{type:`button`,onClick:()=>T(`existing`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a===`existing`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:`Use existing`}),s(`button`,{type:`button`,onClick:()=>T(`new`),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a===`new`?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground`}`,children:e===B?`Paste cookie`:`Create new`})]}),a===`alexa-login`&&s(z,{onResolved:t,onCancel:n}),a===`existing`&&r(`div`,{className:`space-y-3`,children:[l.isLoading&&r(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[s(b,{className:`h-3.5 w-3.5 animate-spin`}),` Loading brokers…`]}),l.isError&&r(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:[`Failed to load brokers:`,` `,l.error instanceof Error?l.error.message:`Unknown error`]}),!l.isLoading&&!l.isError&&u.length===0&&r(`div`,{className:`rounded-lg border border-border bg-surface px-3 py-6 text-center text-xs text-foreground-subtle`,children:[`No brokers of this kind yet. Switch to`,` `,s(`span`,{className:`font-medium text-foreground`,children:e===B?`Login interactively`:`Create new`}),` `,`to register one.`]}),s(`div`,{className:`space-y-2`,children:u.map(e=>r(`button`,{type:`button`,onClick:()=>_(e.id),className:`flex w-full items-center justify-between gap-3 rounded-lg border bg-surface p-3 text-left transition-colors ${m===e.id?`border-primary ring-1 ring-primary`:`border-border hover:border-foreground-subtle/30`}`,children:[s(`span`,{className:`text-xs font-semibold text-foreground`,children:e.name}),s(`span`,{className:`text-[10px] rounded-full px-2 py-0.5 font-medium ${U[e.status]}`,children:e.status})]},e.id))}),u.length>0&&s(`div`,{className:`flex justify-end pt-1`,children:s(`button`,{type:`button`,onClick:C,disabled:!m,className:`inline-flex items-center gap-1.5 rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:`Use this broker`})})]}),a===`new`&&r(`div`,{className:`space-y-3`,children:[r(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Name`}),s(`input`,{type:`text`,value:v,onChange:e=>y(e.target.value),placeholder:`My Home Assistant`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),x.isError&&s(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:x.error instanceof Error?x.error.message:String(x.error)}),s(D,{kind:e,...f===void 0?{}:{addonId:f},onSubmit:e=>{w(e).catch(()=>{})},onCancel:n,submitLabel:x.isPending?`Creating…`:`Create broker`,disabled:x.isPending||v.trim().length===0}),v.trim().length===0&&s(`p`,{className:`text-[10px] text-foreground-subtle`,children:`Enter a name before creating.`})]})]})}n();function G({open:t,onClose:n,scope:a}){let c=m(),[l,d]=o(new Set),[f,p]=o(new Set),{data:h}=u({}),g=i(()=>new Set((h??[]).map(e=>e.stableId)),[h]),v=e(async(e,t)=>{p(e=>new Set(e).add(t.stableId));try{await c.mutateAsync({addonId:e,candidate:t}),d(e=>new Set(e).add(t.stableId))}catch{}finally{p(e=>{let n=new Set(e);return n.delete(t.stableId),n})}},[c]),y=e((e,t)=>{let n=typeof t.prefilledConfig.host==`string`?t.prefilledConfig.host:null,i=g.has(t.stableId),a=l.has(t.stableId)||i,o=f.has(t.stableId);return r(`div`,{className:`flex items-center justify-between rounded-lg border border-border bg-surface px-3 py-2`,children:[r(`div`,{className:`min-w-0`,children:[s(`p`,{className:`truncate text-xs font-medium text-foreground`,children:t.suggestedName}),n&&s(`p`,{className:`truncate text-[10px] font-mono text-foreground-subtle`,children:n})]}),a?r(`span`,{className:`flex items-center gap-1 text-[11px] text-foreground-subtle`,children:[s(E,{className:`h-3.5 w-3.5`}),` `,i?`Already added`:`Added`]}):r(`button`,{type:`button`,onClick:()=>void v(e,t),disabled:o,className:`flex items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-50`,children:[o?s(b,{className:`h-3.5 w-3.5 animate-spin`}):s(_,{className:`h-3.5 w-3.5`}),`Add`]})]},t.stableId)},[l,f,g,v]);if(!t)return null;let x=a?`Scan network — ${a.label}`:`Scan network for devices`;return r(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[s(`div`,{className:`absolute inset-0 bg-black/60`,onClick:n}),r(`div`,{className:`relative z-10 flex w-full max-w-2xl flex-col max-h-[calc(90dvh-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] rounded-xl border border-border bg-background shadow-2xl`,children:[r(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-4 shrink-0`,children:[r(`div`,{className:`flex items-center gap-2`,children:[s(O,{className:`h-4 w-4 text-primary`}),s(`h2`,{className:`text-sm font-semibold text-foreground`,children:x})]}),s(`button`,{onClick:n,className:`rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,children:s(C,{className:`h-4 w-4`})})]}),a?s(q,{scope:a,onAdopt:y,onReset:()=>d(new Set)}):s(K,{onAdopt:y,onReset:()=>d(new Set)})]})]})}function K({onAdopt:t,onReset:n}){let o=d(),l=e(()=>{n(),o.mutate({})},[o,n]);c(()=>{!o.isPending&&!o.data&&l()},[]);let u=i(()=>(o.data?.groups??[]).filter(e=>e.candidates.length>0),[o.data]),f=i(()=>u.reduce((e,t)=>e+t.candidates.length,0),[u]);return r(a,{children:[s(`div`,{className:`flex items-center justify-end gap-2 border-b border-border px-5 py-2 shrink-0`,children:r(`button`,{onClick:l,disabled:o.isPending,className:`flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,children:[s(y,{className:`h-3.5 w-3.5 ${o.isPending?`animate-spin`:``}`}),`Re-scan`]})}),r(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-4`,children:[o.isPending&&s(J,{label:`Scanning the local network…`}),!o.isPending&&o.isError&&s(Y,{}),!o.isPending&&o.data&&u.length===0&&s(`p`,{className:`py-8 text-center text-xs text-foreground-subtle`,children:`No devices responded to the scan.`}),!o.isPending&&u.length>0&&r(`p`,{className:`text-xs text-foreground-subtle`,children:[`Found `,f,` device`,f===1?``:`s`,` on the network.`]}),!o.isPending&&u.map(e=>r(`div`,{className:`space-y-1.5`,children:[r(`div`,{className:`flex items-center gap-2`,children:[s(`span`,{className:`text-[11px] font-semibold text-foreground`,children:e.label}),r(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`(`,e.candidates.length,`)`]})]}),e.candidates.map(n=>t(e.addonId,n))]},e.addonId))]})]})}function q({scope:t,onAdopt:n,onReset:i}){let c=f({addonId:t.addonId}).data??null,[u,d]=o({}),p=l(),m=e(()=>{i(),p.mutate({addonId:t.addonId,params:u})},[p,t.addonId,u,i]),h=p.data?.candidates??[];return s(a,{children:r(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-4`,children:[c&&s(v,{schema:c,values:u,onChange:d}),r(`button`,{onClick:m,disabled:p.isPending,className:`flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:[p.isPending?s(b,{className:`h-3.5 w-3.5 animate-spin`}):s(O,{className:`h-3.5 w-3.5`}),p.isPending?`Scanning…`:`Scan`]}),p.isError&&s(Y,{}),!p.isPending&&p.data&&h.length===0&&s(`p`,{className:`py-6 text-center text-xs text-foreground-subtle`,children:`No devices responded to the scan.`}),!p.isPending&&h.length>0&&r(`div`,{className:`space-y-1.5`,children:[r(`p`,{className:`text-xs text-foreground-subtle`,children:[`Found `,h.length,` device`,h.length===1?``:`s`,`.`]}),h.map(e=>n(t.addonId,e))]})]})})}function J({label:e}){return r(`div`,{className:`flex flex-col items-center py-12`,children:[s(b,{className:`h-6 w-6 animate-spin text-primary`}),s(`p`,{className:`mt-3 text-xs text-foreground-subtle`,children:e})]})}function Y(){return r(`div`,{className:`flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/10 px-4 py-3`,children:[s(T,{className:`h-4 w-4 text-destructive mt-0.5 shrink-0`}),s(`p`,{className:`text-xs text-destructive`,children:`The scan failed. Try again.`})]})}export{W as n,O as r,G as t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-azdrQ4w4.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};