From 9bbf6fb2487bfef24bfab6da256165d0965c278f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 23 Sep 2026 02:00:48 +0300 Subject: [PATCH] fix(dialog): restore HA modal after rejected close (#607) Issue: #607 User-Visible: yes --- .../houseplan/frontend/houseplan-assets.json | 284 +++++++++--------- ...-Cghq1scc.js => backdrop-pick-2vyBBTgG.js} | 78 ++--- .../{de-DSAbt10z.js => de-Bc8aNiKQ.js} | 2 +- .../houseplan-assets/editor-v1zFPTHb.js | 2 +- .../form-kit.styles-XjSspVjk.js | 2 +- .../frontend/houseplan-assets/fr-DClCaTp6.js | 2 +- .../furniture-plan-art.generated-BQJxPKO5.js | 2 +- ...BGma7Zjs.js => houseplan-card-eH_pY1mf.js} | 200 ++++++------ ...s => houseplan-editor-runtime-DazlWcYl.js} | 6 +- ... houseplan-onboarding-runtime-j98hXPrW.js} | 6 +- ...=> hp-zigbee-topology-overlay-BIunREL3.js} | 2 +- .../iso-scene-render-Byk9ZXv9.js | 4 +- ...s => live-interaction-runtime-DjzpPNim.js} | 2 +- ...ort-uvcL70gX.js => pdf-export-DhvYHpHG.js} | 4 +- .../summary-panel-editor-D6jtLpQ8.js | 2 +- ...n.js => summary-panel-metrics-lT9wi_mo.js} | 2 +- .../summary-panel-runtime-loaded-C750G8Rx.js | 4 +- .../zigbee-topology-B35vLrYp.js | 2 +- ...js => zigbee-topology-runtime-hsXdTYOk.js} | 2 +- .../houseplan/frontend/houseplan-card.js | 2 +- .../houseplan/frontend/houseplan-panel.js | 2 +- demo/helpers/README-ha-dialog-505.md | 14 + demo/smoke_dialog_modal_recovery.mjs | 46 ++- demo/verify_ha_dialog_discard_recovery.mjs | 174 +++++++++++ dist/houseplan-assets.json | 284 +++++++++--------- ...-Cghq1scc.js => backdrop-pick-2vyBBTgG.js} | 78 ++--- .../{de-DSAbt10z.js => de-Bc8aNiKQ.js} | 2 +- .../houseplan-assets/editor-v1zFPTHb.js | 2 +- .../form-kit.styles-XjSspVjk.js | 2 +- .../houseplan-assets/fr-DClCaTp6.js | 2 +- .../furniture-plan-art.generated-BQJxPKO5.js | 2 +- ...BGma7Zjs.js => houseplan-card-eH_pY1mf.js} | 200 ++++++------ ...s => houseplan-editor-runtime-DazlWcYl.js} | 6 +- ... houseplan-onboarding-runtime-j98hXPrW.js} | 6 +- ...=> hp-zigbee-topology-overlay-BIunREL3.js} | 2 +- .../iso-scene-render-Byk9ZXv9.js | 4 +- ...s => live-interaction-runtime-DjzpPNim.js} | 2 +- ...ort-uvcL70gX.js => pdf-export-DhvYHpHG.js} | 4 +- .../summary-panel-editor-D6jtLpQ8.js | 2 +- ...n.js => summary-panel-metrics-lT9wi_mo.js} | 2 +- .../summary-panel-runtime-loaded-C750G8Rx.js | 4 +- .../zigbee-topology-B35vLrYp.js | 2 +- ...js => zigbee-topology-runtime-hsXdTYOk.js} | 2 +- dist/houseplan-card.js | 2 +- dist/houseplan-panel.js | 2 +- docs/CHANGELOG.md | 5 + docs/CHANGELOG.ru.md | 5 + docs/STATUS.md | 7 +- docs/images/screenshots.json | 24 +- scripts/check-inputs.mjs | 1 + src/hp-dialog.ts | 16 +- test/hp-dialog-contract.test.mjs | 10 + 52 files changed, 895 insertions(+), 631 deletions(-) rename custom_components/houseplan/frontend/houseplan-assets/{backdrop-pick-Cghq1scc.js => backdrop-pick-2vyBBTgG.js} (95%) rename custom_components/houseplan/frontend/houseplan-assets/{de-DSAbt10z.js => de-Bc8aNiKQ.js} (99%) rename dist/houseplan-assets/editor-DuEZ_blF.js => custom_components/houseplan/frontend/houseplan-assets/editor-v1zFPTHb.js (94%) rename dist/houseplan-assets/form-kit.styles-CfB4DWMs.js => custom_components/houseplan/frontend/houseplan-assets/form-kit.styles-XjSspVjk.js (99%) rename dist/houseplan-assets/fr-Dqa7XXi8.js => custom_components/houseplan/frontend/houseplan-assets/fr-DClCaTp6.js (99%) rename dist/houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js => custom_components/houseplan/frontend/houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js (99%) rename custom_components/houseplan/frontend/houseplan-assets/{houseplan-card-BGma7Zjs.js => houseplan-card-eH_pY1mf.js} (81%) rename custom_components/houseplan/frontend/houseplan-assets/{houseplan-editor-runtime-dcfYk9Ux.js => houseplan-editor-runtime-DazlWcYl.js} (99%) rename custom_components/houseplan/frontend/houseplan-assets/{houseplan-onboarding-runtime-DO5YuA8C.js => houseplan-onboarding-runtime-j98hXPrW.js} (95%) rename custom_components/houseplan/frontend/houseplan-assets/{hp-zigbee-topology-overlay-Fybk76vu.js => hp-zigbee-topology-overlay-BIunREL3.js} (97%) rename dist/houseplan-assets/iso-scene-render-DrqMFlnw.js => custom_components/houseplan/frontend/houseplan-assets/iso-scene-render-Byk9ZXv9.js (92%) rename custom_components/houseplan/frontend/houseplan-assets/{live-interaction-runtime-CY4BdkFz.js => live-interaction-runtime-DjzpPNim.js} (88%) rename custom_components/houseplan/frontend/houseplan-assets/{pdf-export-uvcL70gX.js => pdf-export-DhvYHpHG.js} (99%) rename dist/houseplan-assets/summary-panel-editor-CMasQ4vg.js => custom_components/houseplan/frontend/houseplan-assets/summary-panel-editor-D6jtLpQ8.js (97%) rename custom_components/houseplan/frontend/houseplan-assets/{summary-panel-metrics-BeGWlYtn.js => summary-panel-metrics-lT9wi_mo.js} (85%) rename dist/houseplan-assets/summary-panel-runtime-loaded-CGySQMOD.js => custom_components/houseplan/frontend/houseplan-assets/summary-panel-runtime-loaded-C750G8Rx.js (99%) rename dist/houseplan-assets/zigbee-topology-DmwpO4_X.js => custom_components/houseplan/frontend/houseplan-assets/zigbee-topology-B35vLrYp.js (95%) rename custom_components/houseplan/frontend/houseplan-assets/{zigbee-topology-runtime-BK3ECo6u.js => zigbee-topology-runtime-hsXdTYOk.js} (93%) create mode 100644 demo/verify_ha_dialog_discard_recovery.mjs rename dist/houseplan-assets/{backdrop-pick-Cghq1scc.js => backdrop-pick-2vyBBTgG.js} (95%) rename dist/houseplan-assets/{de-DSAbt10z.js => de-Bc8aNiKQ.js} (99%) rename custom_components/houseplan/frontend/houseplan-assets/editor-DuEZ_blF.js => dist/houseplan-assets/editor-v1zFPTHb.js (94%) rename custom_components/houseplan/frontend/houseplan-assets/form-kit.styles-CfB4DWMs.js => dist/houseplan-assets/form-kit.styles-XjSspVjk.js (99%) rename custom_components/houseplan/frontend/houseplan-assets/fr-Dqa7XXi8.js => dist/houseplan-assets/fr-DClCaTp6.js (99%) rename custom_components/houseplan/frontend/houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js => dist/houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js (99%) rename dist/houseplan-assets/{houseplan-card-BGma7Zjs.js => houseplan-card-eH_pY1mf.js} (81%) rename dist/houseplan-assets/{houseplan-editor-runtime-dcfYk9Ux.js => houseplan-editor-runtime-DazlWcYl.js} (99%) rename dist/houseplan-assets/{houseplan-onboarding-runtime-DO5YuA8C.js => houseplan-onboarding-runtime-j98hXPrW.js} (95%) rename dist/houseplan-assets/{hp-zigbee-topology-overlay-Fybk76vu.js => hp-zigbee-topology-overlay-BIunREL3.js} (97%) rename custom_components/houseplan/frontend/houseplan-assets/iso-scene-render-DrqMFlnw.js => dist/houseplan-assets/iso-scene-render-Byk9ZXv9.js (92%) rename dist/houseplan-assets/{live-interaction-runtime-CY4BdkFz.js => live-interaction-runtime-DjzpPNim.js} (88%) rename dist/houseplan-assets/{pdf-export-uvcL70gX.js => pdf-export-DhvYHpHG.js} (99%) rename custom_components/houseplan/frontend/houseplan-assets/summary-panel-editor-CMasQ4vg.js => dist/houseplan-assets/summary-panel-editor-D6jtLpQ8.js (97%) rename dist/houseplan-assets/{summary-panel-metrics-BeGWlYtn.js => summary-panel-metrics-lT9wi_mo.js} (85%) rename custom_components/houseplan/frontend/houseplan-assets/summary-panel-runtime-loaded-CGySQMOD.js => dist/houseplan-assets/summary-panel-runtime-loaded-C750G8Rx.js (99%) rename custom_components/houseplan/frontend/houseplan-assets/zigbee-topology-DmwpO4_X.js => dist/houseplan-assets/zigbee-topology-B35vLrYp.js (95%) rename dist/houseplan-assets/{zigbee-topology-runtime-BK3ECo6u.js => zigbee-topology-runtime-hsXdTYOk.js} (93%) diff --git a/custom_components/houseplan/frontend/houseplan-assets.json b/custom_components/houseplan/frontend/houseplan-assets.json index a0539cd2..87d608db 100644 --- a/custom_components/houseplan/frontend/houseplan-assets.json +++ b/custom_components/houseplan/frontend/houseplan-assets.json @@ -1,89 +1,89 @@ { "schema": 1, - "fingerprint": "5e6b797362146dcb25e3ad594eca3a115b92cc4df3101d718fe7950b0ebfc362", + "fingerprint": "2c4a9a013205eef84710c72e2eae1f8c307d94c84078490ecded141d206dd07d", "entry": "houseplan-card.js", "panelEntry": "houseplan-panel.js", "initialViewFiles": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js", + "houseplan-assets/houseplan-card-eH_pY1mf.js", "houseplan-card.js" ], - "initialViewGzipBytes": 290095, + "initialViewGzipBytes": 290284, "initialPanelFiles": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js", + "houseplan-assets/houseplan-card-eH_pY1mf.js", "houseplan-panel.js" ], - "initialPanelGzipBytes": 291618, + "initialPanelGzipBytes": 291805, "initialPanelOnlyFiles": [ "houseplan-panel.js" ], - "initialPanelOnlyGzipBytes": 2325, + "initialPanelOnlyGzipBytes": 2322, "lazyFiles": [ - "houseplan-assets/backdrop-pick-Cghq1scc.js", - "houseplan-assets/de-DSAbt10z.js", - "houseplan-assets/editor-DuEZ_blF.js", - "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "houseplan-assets/fr-Dqa7XXi8.js", - "houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js", - "houseplan-assets/houseplan-editor-runtime-dcfYk9Ux.js", - "houseplan-assets/houseplan-onboarding-runtime-DO5YuA8C.js", - "houseplan-assets/hp-zigbee-topology-overlay-Fybk76vu.js", - "houseplan-assets/iso-scene-render-DrqMFlnw.js", - "houseplan-assets/live-interaction-runtime-CY4BdkFz.js", - "houseplan-assets/pdf-export-uvcL70gX.js", - "houseplan-assets/summary-panel-runtime-loaded-CGySQMOD.js", - "houseplan-assets/zigbee-topology-DmwpO4_X.js", - "houseplan-assets/zigbee-topology-runtime-BK3ECo6u.js" + "houseplan-assets/backdrop-pick-2vyBBTgG.js", + "houseplan-assets/de-Bc8aNiKQ.js", + "houseplan-assets/editor-v1zFPTHb.js", + "houseplan-assets/form-kit.styles-XjSspVjk.js", + "houseplan-assets/fr-DClCaTp6.js", + "houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js", + "houseplan-assets/houseplan-editor-runtime-DazlWcYl.js", + "houseplan-assets/houseplan-onboarding-runtime-j98hXPrW.js", + "houseplan-assets/hp-zigbee-topology-overlay-BIunREL3.js", + "houseplan-assets/iso-scene-render-Byk9ZXv9.js", + "houseplan-assets/live-interaction-runtime-DjzpPNim.js", + "houseplan-assets/pdf-export-DhvYHpHG.js", + "houseplan-assets/summary-panel-runtime-loaded-C750G8Rx.js", + "houseplan-assets/zigbee-topology-B35vLrYp.js", + "houseplan-assets/zigbee-topology-runtime-hsXdTYOk.js" ], - "lazyGzipBytes": 459921, + "lazyGzipBytes": 459905, "lazyEditorFiles": [ - "houseplan-assets/backdrop-pick-Cghq1scc.js", - "houseplan-assets/editor-DuEZ_blF.js", - "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js", - "houseplan-assets/houseplan-editor-runtime-dcfYk9Ux.js", - "houseplan-assets/zigbee-topology-DmwpO4_X.js" + "houseplan-assets/backdrop-pick-2vyBBTgG.js", + "houseplan-assets/editor-v1zFPTHb.js", + "houseplan-assets/form-kit.styles-XjSspVjk.js", + "houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js", + "houseplan-assets/houseplan-editor-runtime-DazlWcYl.js", + "houseplan-assets/zigbee-topology-B35vLrYp.js" ], - "lazyEditorGzipBytes": 243369, + "lazyEditorGzipBytes": 243361, "lazyOnboardingFiles": [ - "houseplan-assets/backdrop-pick-Cghq1scc.js", - "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "houseplan-assets/houseplan-onboarding-runtime-DO5YuA8C.js" + "houseplan-assets/backdrop-pick-2vyBBTgG.js", + "houseplan-assets/form-kit.styles-XjSspVjk.js", + "houseplan-assets/houseplan-onboarding-runtime-j98hXPrW.js" ], - "lazyOnboardingGzipBytes": 33816, + "lazyOnboardingGzipBytes": 33813, "lazyLocaleFiles": [ - "houseplan-assets/de-DSAbt10z.js", - "houseplan-assets/fr-Dqa7XXi8.js" + "houseplan-assets/de-Bc8aNiKQ.js", + "houseplan-assets/fr-DClCaTp6.js" ], - "lazyLocaleGzipBytes": 55370, + "lazyLocaleGzipBytes": 55371, "lazyIsometricFiles": [ - "houseplan-assets/iso-scene-render-DrqMFlnw.js" + "houseplan-assets/iso-scene-render-Byk9ZXv9.js" ], - "lazyIsometricGzipBytes": 17642, + "lazyIsometricGzipBytes": 17639, "lazyFurnitureArtFiles": [ - "houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js" + "houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js" ], - "lazyFurnitureArtGzipBytes": 16940, + "lazyFurnitureArtGzipBytes": 16939, "lazyPdfFiles": [ - "houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js", - "houseplan-assets/pdf-export-uvcL70gX.js" + "houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js", + "houseplan-assets/pdf-export-DhvYHpHG.js" ], "lazyPdfGzipBytes": 126825, "files": [ { - "path": "houseplan-assets/backdrop-pick-Cghq1scc.js", - "sha256": "a3c6643d8fa86b46c0b14d6464331ac722fb2de5f76090f2415c394c2b45830d", + "path": "houseplan-assets/backdrop-pick-2vyBBTgG.js", + "sha256": "5c1f5f3ac1132cc5970ade27d6797a2674d90945b3567b6b204990b55d394103", "rawBytes": 74076, - "gzipBytes": 23932, + "gzipBytes": 23929, "isEntry": false, "imports": [ - "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/form-kit.styles-XjSspVjk.js", + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/de-DSAbt10z.js", - "sha256": "00b04a9346c92a955a778fd765078a17e164f038ae93e8bf8980c047cc5c5eae", + "path": "houseplan-assets/de-Bc8aNiKQ.js", + "sha256": "23a420015836d2cb9dba5bb19349bf2b67f2cf5ed08d4ae77ebbde0cd661baa9", "rawBytes": 92496, "gzipBytes": 27928, "isEntry": false, @@ -91,222 +91,222 @@ "dynamicImports": [] }, { - "path": "houseplan-assets/editor-DuEZ_blF.js", - "sha256": "ffbfb66c07157e20053fd287e8e423b967322de5f633ba57ed3bdc9b6ab3f353", + "path": "houseplan-assets/editor-v1zFPTHb.js", + "sha256": "73af9764e3cba343dafc00d13696a3154255ef7f4cb0993f2fefc37ee40c01e8", "rawBytes": 3833, - "gzipBytes": 1583, + "gzipBytes": 1581, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "sha256": "551efa002ff77410c8ecd04f0b1e8eebba295e8f04f1de1c0f5973bc60343cba", + "path": "houseplan-assets/form-kit.styles-XjSspVjk.js", + "sha256": "c6f912fabc6288e8f84712cd3ebaf3bfd6c9ab821f511e0b977ef28f0f235ed3", "rawBytes": 25600, - "gzipBytes": 5056, + "gzipBytes": 5055, "isEntry": false, "imports": [], "dynamicImports": [] }, { - "path": "houseplan-assets/fr-Dqa7XXi8.js", - "sha256": "6e339f8074d2ad2325b5c93161a251f89ab4041f5bda8a90a491c165dd6aec31", + "path": "houseplan-assets/fr-DClCaTp6.js", + "sha256": "4c0e753ff9ae5160f0b702eeaa152ffa7462e96e888115e38ae33bac95bd8544", "rawBytes": 94813, - "gzipBytes": 27442, + "gzipBytes": 27443, "isEntry": false, "imports": [], "dynamicImports": [] }, { - "path": "houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js", - "sha256": "4e2e255541baab68c9a71b8996f7db842cd2fcbd1466984acda21423b2279be7", + "path": "houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js", + "sha256": "b293b18c355818c7f51e25562428643d9c524d217fd78fca675be1a2a792b0bc", "rawBytes": 52035, - "gzipBytes": 16940, + "gzipBytes": 16939, "isEntry": false, "imports": [], "dynamicImports": [] }, { - "path": "houseplan-assets/houseplan-card-BGma7Zjs.js", - "sha256": "020967c47a73d107ac522a4dc2e458154324779405cdddc60e3548f72939e7b4", - "rawBytes": 1028792, - "gzipBytes": 289293, + "path": "houseplan-assets/houseplan-card-eH_pY1mf.js", + "sha256": "e5b871748b29287d7c0e66fa30e7fc81cbd96715b839aee4e426885bd998c626", + "rawBytes": 1029393, + "gzipBytes": 289483, "isEntry": false, "imports": [], "dynamicImports": [ - "houseplan-assets/de-DSAbt10z.js", - "houseplan-assets/editor-DuEZ_blF.js", - "houseplan-assets/fr-Dqa7XXi8.js", - "houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js", - "houseplan-assets/houseplan-editor-runtime-dcfYk9Ux.js", - "houseplan-assets/houseplan-onboarding-runtime-DO5YuA8C.js", - "houseplan-assets/hp-zigbee-topology-overlay-Fybk76vu.js", - "houseplan-assets/iso-scene-render-DrqMFlnw.js", - "houseplan-assets/live-interaction-runtime-CY4BdkFz.js", - "houseplan-assets/pdf-export-uvcL70gX.js", - "houseplan-assets/summary-panel-runtime-loaded-CGySQMOD.js" + "houseplan-assets/de-Bc8aNiKQ.js", + "houseplan-assets/editor-v1zFPTHb.js", + "houseplan-assets/fr-DClCaTp6.js", + "houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js", + "houseplan-assets/houseplan-editor-runtime-DazlWcYl.js", + "houseplan-assets/houseplan-onboarding-runtime-j98hXPrW.js", + "houseplan-assets/hp-zigbee-topology-overlay-BIunREL3.js", + "houseplan-assets/iso-scene-render-Byk9ZXv9.js", + "houseplan-assets/live-interaction-runtime-DjzpPNim.js", + "houseplan-assets/pdf-export-DhvYHpHG.js", + "houseplan-assets/summary-panel-runtime-loaded-C750G8Rx.js" ] }, { - "path": "houseplan-assets/houseplan-editor-runtime-dcfYk9Ux.js", - "sha256": "a594bdfea7e0eaac7be0e513cf316d28503194dd4cc156f832271ac3b4f91f2b", + "path": "houseplan-assets/houseplan-editor-runtime-DazlWcYl.js", + "sha256": "6515e98e1c7d594e6c2943871a906b5a1a0762092e5a4cbfec0470e07863d659", "rawBytes": 677705, - "gzipBytes": 188432, + "gzipBytes": 188433, "isEntry": false, "imports": [ - "houseplan-assets/backdrop-pick-Cghq1scc.js", - "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js", - "houseplan-assets/houseplan-card-BGma7Zjs.js", - "houseplan-assets/zigbee-topology-DmwpO4_X.js" + "houseplan-assets/backdrop-pick-2vyBBTgG.js", + "houseplan-assets/form-kit.styles-XjSspVjk.js", + "houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js", + "houseplan-assets/houseplan-card-eH_pY1mf.js", + "houseplan-assets/zigbee-topology-B35vLrYp.js" ], "dynamicImports": [ - "houseplan-assets/zigbee-topology-runtime-BK3ECo6u.js" + "houseplan-assets/zigbee-topology-runtime-hsXdTYOk.js" ] }, { - "path": "houseplan-assets/houseplan-onboarding-runtime-DO5YuA8C.js", - "sha256": "2341b680e95085a18f3a4258ef54d76de360d8eb7f62c22d0bbbeb9e552a3776", + "path": "houseplan-assets/houseplan-onboarding-runtime-j98hXPrW.js", + "sha256": "6a7765d125bedbb22df7276f80f59bb5156cba93e86d4fb75adaac9c7574d4ea", "rawBytes": 15667, - "gzipBytes": 4828, + "gzipBytes": 4829, "isEntry": false, "imports": [ - "houseplan-assets/backdrop-pick-Cghq1scc.js", - "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/backdrop-pick-2vyBBTgG.js", + "houseplan-assets/form-kit.styles-XjSspVjk.js", + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/hp-zigbee-topology-overlay-Fybk76vu.js", - "sha256": "9a79675b2b08e08e69f48268134b052111cdbaa804b6b270dfc3c66857c475fa", + "path": "houseplan-assets/hp-zigbee-topology-overlay-BIunREL3.js", + "sha256": "8342c4c8f8b62e5caf311c5088fc817246a808bee1de871969a5760d9d11070c", "rawBytes": 10759, - "gzipBytes": 3685, + "gzipBytes": 3683, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js", - "houseplan-assets/zigbee-topology-DmwpO4_X.js", - "houseplan-assets/zigbee-topology-runtime-BK3ECo6u.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js", + "houseplan-assets/zigbee-topology-B35vLrYp.js", + "houseplan-assets/zigbee-topology-runtime-hsXdTYOk.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/iso-scene-render-DrqMFlnw.js", - "sha256": "516d5176c89713778220ea37910af126ac49deec11bca4835628acb9234a7c5b", + "path": "houseplan-assets/iso-scene-render-Byk9ZXv9.js", + "sha256": "2888754263d7837c59f98c267156ac601611915c53f31d6d8ba14e1656417afb", "rawBytes": 51983, - "gzipBytes": 17642, + "gzipBytes": 17639, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/live-interaction-runtime-CY4BdkFz.js", - "sha256": "4dcf38616ab83f5a2914558399c3852b7afa6ba5878fee9f75cf406cc746dda1", + "path": "houseplan-assets/live-interaction-runtime-DjzpPNim.js", + "sha256": "56c243a0be7558428fcd7351a903aef112e9e3c8054a43daf180b90e225e2826", "rawBytes": 8216, - "gzipBytes": 3209, + "gzipBytes": 3204, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/pdf-export-uvcL70gX.js", - "sha256": "206bebb97b82857af0143431a63ef1cf81cc7e869daa807278ef474cc91a57c6", + "path": "houseplan-assets/pdf-export-DhvYHpHG.js", + "sha256": "ae0e8f7a914fc3034f73c5e0128515019849a373f0a184864f6cd91ffdf0211f", "rawBytes": 236264, - "gzipBytes": 109885, + "gzipBytes": 109886, "isEntry": false, "imports": [ - "houseplan-assets/furniture-plan-art.generated-DvOAO0uu.js", - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/furniture-plan-art.generated-BQJxPKO5.js", + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/summary-panel-editor-CMasQ4vg.js", - "sha256": "4b34a8e5ddd9ddf67aa84d27b93a345cfca03b693f1f2513e2e046054465d817", + "path": "houseplan-assets/summary-panel-editor-D6jtLpQ8.js", + "sha256": "141837c9947c69b51b7f870afc1bb050372c7f26fb36d1ea6fe7a9e1073913ab", "rawBytes": 14862, - "gzipBytes": 3426, + "gzipBytes": 3424, "isEntry": false, "imports": [ - "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "houseplan-assets/houseplan-card-BGma7Zjs.js", - "houseplan-assets/summary-panel-runtime-loaded-CGySQMOD.js" + "houseplan-assets/form-kit.styles-XjSspVjk.js", + "houseplan-assets/houseplan-card-eH_pY1mf.js", + "houseplan-assets/summary-panel-runtime-loaded-C750G8Rx.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/summary-panel-metrics-BeGWlYtn.js", - "sha256": "d3b46ab20f1de0a48a16737e7456c0318e9903b79df2c5f9f78082bf378e5c93", + "path": "houseplan-assets/summary-panel-metrics-lT9wi_mo.js", + "sha256": "f21e7ab3dec25618eab55cca71fd9635583941673e402af8091b344a18ec0f26", "rawBytes": 2611, - "gzipBytes": 1307, + "gzipBytes": 1305, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/summary-panel-runtime-loaded-CGySQMOD.js", - "sha256": "70932d7306193061fed10ac47812d912c3a59a7417f95e240f37b61457bf09a8", + "path": "houseplan-assets/summary-panel-runtime-loaded-C750G8Rx.js", + "sha256": "9b3e61e18a989a38950776a248106dde45b711fc4b80f247bc429e8cb372a25a", "rawBytes": 72733, "gzipBytes": 20171, "isEntry": false, "imports": [ - "houseplan-assets/form-kit.styles-CfB4DWMs.js", - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/form-kit.styles-XjSspVjk.js", + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [ - "houseplan-assets/summary-panel-editor-CMasQ4vg.js", - "houseplan-assets/summary-panel-metrics-BeGWlYtn.js" + "houseplan-assets/summary-panel-editor-D6jtLpQ8.js", + "houseplan-assets/summary-panel-metrics-lT9wi_mo.js" ] }, { - "path": "houseplan-assets/zigbee-topology-DmwpO4_X.js", - "sha256": "a5f74e545476fb0048e5ae34d3e6aba6ca56d4774699b437f8400e40069a988e", + "path": "houseplan-assets/zigbee-topology-B35vLrYp.js", + "sha256": "aa8bf029c7fed0133c80c2b557f273f7593a6c7059d7f444bb59124484815a21", "rawBytes": 18962, - "gzipBytes": 7426, + "gzipBytes": 7424, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { - "path": "houseplan-assets/zigbee-topology-runtime-BK3ECo6u.js", - "sha256": "aa8b20e637d9d66b0affee0d0efee1bfd7defa9285d92d1bd496777fe5f3432b", + "path": "houseplan-assets/zigbee-topology-runtime-hsXdTYOk.js", + "sha256": "d60b3845428071ed0a8555fc50e5712e4bd029e38d75c6059a0b314af95dacda", "rawBytes": 3942, - "gzipBytes": 1762, + "gzipBytes": 1761, "isEntry": false, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js", - "houseplan-assets/zigbee-topology-DmwpO4_X.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js", + "houseplan-assets/zigbee-topology-B35vLrYp.js" ], "dynamicImports": [] }, { "path": "houseplan-card.js", - "sha256": "d0b270ebad646accee58fd8cf7a130875da8b505b596f0e05ada91fffb41bb02", + "sha256": "22729f58ff83f845a5b454830449099c16024d8fac36f87ffd1934c7928b0780", "rawBytes": 1205, - "gzipBytes": 802, + "gzipBytes": 801, "isEntry": true, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] }, { "path": "houseplan-panel.js", - "sha256": "4150cfd182db03e56a9e4b4b680ad72ace418f9882528e526de2579e32944606", + "sha256": "2981cd3ed29739c95c0cb9f351f731bbd363e2fee2a4b9cf354d4c24549bf9dd", "rawBytes": 6165, - "gzipBytes": 2325, + "gzipBytes": 2322, "isEntry": true, "imports": [ - "houseplan-assets/houseplan-card-BGma7Zjs.js" + "houseplan-assets/houseplan-card-eH_pY1mf.js" ], "dynamicImports": [] } diff --git a/custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-Cghq1scc.js b/custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-2vyBBTgG.js similarity index 95% rename from custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-Cghq1scc.js rename to custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-2vyBBTgG.js index a21077d1..4943bedc 100644 --- a/custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-Cghq1scc.js +++ b/custom_components/houseplan/frontend/houseplan-assets/backdrop-pick-2vyBBTgG.js @@ -1,16 +1,16 @@ -globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="5e6b797362146dcb25e3ad594eca3a115b92cc4df3101d718fe7950b0ebfc362";import{A as e,c as t,s as a,l as i,cH as n,ao as s,dD as r,dE as o,cG as l,dF as c,cM as p,cL as d,dG as h,bo as u,bn as m,bp as g,ar as _,ay as b,az as f,dH as v}from"./houseplan-card-BGma7Zjs.js";import{c as w,f as y,C as $}from"./form-kit.styles-CfB4DWMs.js";const k=w+y($,{withSwitch:!1}),x=new WeakSet;let S=null;function C(e){const t=e.renderRoot;if(!t||x.has(t))return;const a=t.ownerDocument??globalThis.document,i=a?.defaultView?.CSSStyleSheet;if(i&&"adoptedStyleSheets"in t)return S||(S=new i,S.replaceSync(k)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,S],void x.add(t);if(t.querySelector("style[data-hp-form-kit]"))return void x.add(t);const n=a.createElement("style");n.dataset.hpFormKit="true",n.textContent=k,t.appendChild(n),x.add(t)}function M({title:a,help:i,body:n,id:s}){return t`
+globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2c4a9a013205eef84710c72e2eae1f8c307d94c84078490ecded141d206dd07d";import{A as e,c as t,s as a,l as i,cH as n,ao as s,dD as r,dE as o,cG as l,dF as c,cM as d,cL as p,dG as h,bo as u,bn as m,bp as g,ar as _,ay as b,az as f,dH as v}from"./houseplan-card-eH_pY1mf.js";import{c as w,f as y,C as $}from"./form-kit.styles-XjSspVjk.js";const k=w+y($,{withSwitch:!1}),x=new WeakSet;let S=null;function C(e){const t=e.renderRoot;if(!t||x.has(t))return;const a=t.ownerDocument??globalThis.document,i=a?.defaultView?.CSSStyleSheet;if(i&&"adoptedStyleSheets"in t)return S||(S=new i,S.replaceSync(k)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,S],void x.add(t);if(t.querySelector("style[data-hp-form-kit]"))return void x.add(t);const n=a.createElement("style");n.dataset.hpFormKit="true",n.textContent=k,t.appendChild(n),x.add(t)}function M({title:a,help:i,body:n,id:s}){return t`
${a?t`

${a}

${i??e}
`:e}
${n}
`}function L({title:a,help:i}){return t`

${a}

${i??e}
`}function z({label:a,htmlFor:i,help:n,control:s,hint:r,error:o}){return t`
${i?t``:a}${n??e} ${s} ${o?t``:r?t`

${r}

`:e} -
`}function P(e,{narrow:a=!1}={}){return t`
${e}
`}function T({icon:a,title:i,caption:n,help:s,checked:r,disabled:o=!1,compact:l=!1,onChange:c,id:p}){const d=p&&n?`${p}-caption`:void 0;return t`
- `}}Pe.properties={title:{type:String},icon:{type:String},wide:{type:Boolean,reflect:!0},alert:{type:Boolean,reflect:!0},describedBy:{type:String,attribute:"described-by"},dismissOnScrim:{type:Boolean,attribute:"dismiss-on-scrim"},flexContent:{type:Boolean,reflect:!0,attribute:"flex-content"},badge:{type:String},formShell:{type:Boolean,reflect:!0,attribute:"form-shell"},hass:{attribute:!1}},Pe.styles=o`:host{display:contents;color:var(--primary-text-color,#e6e7eb);font:inherit;}ha-dialog{--dialog-content-padding:0;--dialog-surface-background:var(--card-background-color,var(--hp-bg,#202126));--ha-dialog-border-radius:var(--rad-l,18px);--ha-dialog-header-title-height:auto;color:inherit;}ha-dialog::part(dialog){border:1px solid var(--hp-accent,#d89300);box-shadow:var(--shadow-3,0 18px 48px rgb(0 0 0 / 0.34));overflow:hidden;}.header-title-slot{display:block;flex:1 1 auto;width:100%;max-width:100%;min-width:0;box-sizing:border-box;white-space:normal;}.title{display:flex;flex:1 1 auto;align-items:center;gap:var(--sp-4,12px);width:100%;max-width:100%;min-width:0;font-weight:600;line-height:1.25;white-space:normal;}.title ha-icon{flex:none;color:var(--hp-accent,#d89300);}.title-text{flex:1 1 auto;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:normal;}.badge{flex:none;max-width:180px;padding:5px 8px;border-radius:7px;background:rgb(127 127 127 / 0.16);color:var(--secondary-text-color,inherit);font-size:.875rem;font-weight:400;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.footer{display:block;width:100%;min-width:0;box-sizing:border-box;}::slotted([slot='footer']){width:100%;box-sizing:border-box;}dialog{width:fit-content;height:fit-content;max-width:none;max-height:none;inset:0;margin:auto;padding:0;border:0;overflow:visible;color:inherit;background:transparent;}dialog::backdrop{background:rgb(0 0 0 / 0.45);}.surface{width:min(360px,92vw);max-height:92vh;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;color:inherit;background:var(--card-background-color,var(--hp-bg,#202126));border:1px solid var(--hp-accent,#d89300);border-radius:var(--rad-l,18px);box-shadow:var(--shadow-3,0 18px 48px rgb(0 0 0 / 0.34));}:host([wide]) .surface{width:min(var(--hp-dialog-wide-width,500px),94vw);}:host([form-shell]){--hp-dialog-wide-width:560px;}:host([form-shell]) .surface{max-height:min(940px,calc(100vh - 48px));}:host([form-shell]) .content{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;background:var(--secondary-background-color,color-mix(in srgb,var(--card-background-color,var(--hp-bg,#202126)) 90%,var(--primary-text-color,#000)));}:host([form-shell]) .close{width:44px;height:44px;}:host([form-shell]) .header{min-height:70px;}@media (max-width:480px){:host([form-shell]) .surface{width:100vw;max-height:100vh;border:0;border-radius:0;}:host([form-shell]) .badge{max-width:105px;}}.header{min-height:56px;display:flex;align-items:center;gap:var(--sp-4,12px);padding:var(--sp-4,12px) var(--sp-5,16px);box-sizing:border-box;border-bottom:1px solid var(--hp-line,rgb(255 255 255 / 0.12));}.header .title{flex:1;}.close{width:40px;height:40px;flex:none;display:inline-flex;align-items:center;justify-content:center;padding:0;color:inherit;background:transparent;border:0;border-radius:50%;cursor:pointer;}:host([data-pointer-hover]) .close:hover,.close:focus-visible{background:rgb(127 127 127 / 0.16);}.content{min-height:0;display:flex;flex-direction:column;}.overlay-portal{position:fixed;z-index:2147483647;inset:0;overflow:visible;pointer-events:none;}.overlay-portal:empty{display:none;}.overlay-portal>*{pointer-events:auto;}`,customElements.get("hp-dialog")||customElements.define("hp-dialog",Pe);class Fe extends he{constructor(){super(...arguments),this.hass=null,this.request=null,this.token=0}createRenderRoot(){return this}_decide(e){this.dispatchEvent(new CustomEvent("hp-confirm-decision",{detail:{token:this.token,accepted:e},bubbles:!0,composed:!0}))}render(){const e=this.request;if(!e)return null;const t="destructive"===e.kind,i=`hp-confirm-description-${this.token}`;return j``}}Ie.properties={title:{type:String},icon:{type:String},wide:{type:Boolean,reflect:!0},alert:{type:Boolean,reflect:!0},describedBy:{type:String,attribute:"described-by"},dismissOnScrim:{type:Boolean,attribute:"dismiss-on-scrim"},flexContent:{type:Boolean,reflect:!0,attribute:"flex-content"},badge:{type:String},formShell:{type:Boolean,reflect:!0,attribute:"form-shell"},hass:{attribute:!1}},Ie.styles=o`:host{display:contents;color:var(--primary-text-color,#e6e7eb);font:inherit;}ha-dialog{--dialog-content-padding:0;--dialog-surface-background:var(--card-background-color,var(--hp-bg,#202126));--ha-dialog-border-radius:var(--rad-l,18px);--ha-dialog-header-title-height:auto;color:inherit;}ha-dialog::part(dialog){border:1px solid var(--hp-accent,#d89300);box-shadow:var(--shadow-3,0 18px 48px rgb(0 0 0 / 0.34));overflow:hidden;}.header-title-slot{display:block;flex:1 1 auto;width:100%;max-width:100%;min-width:0;box-sizing:border-box;white-space:normal;}.title{display:flex;flex:1 1 auto;align-items:center;gap:var(--sp-4,12px);width:100%;max-width:100%;min-width:0;font-weight:600;line-height:1.25;white-space:normal;}.title ha-icon{flex:none;color:var(--hp-accent,#d89300);}.title-text{flex:1 1 auto;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:normal;}.badge{flex:none;max-width:180px;padding:5px 8px;border-radius:7px;background:rgb(127 127 127 / 0.16);color:var(--secondary-text-color,inherit);font-size:.875rem;font-weight:400;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.footer{display:block;width:100%;min-width:0;box-sizing:border-box;}::slotted([slot='footer']){width:100%;box-sizing:border-box;}dialog{width:fit-content;height:fit-content;max-width:none;max-height:none;inset:0;margin:auto;padding:0;border:0;overflow:visible;color:inherit;background:transparent;}dialog::backdrop{background:rgb(0 0 0 / 0.45);}.surface{width:min(360px,92vw);max-height:92vh;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;color:inherit;background:var(--card-background-color,var(--hp-bg,#202126));border:1px solid var(--hp-accent,#d89300);border-radius:var(--rad-l,18px);box-shadow:var(--shadow-3,0 18px 48px rgb(0 0 0 / 0.34));}:host([wide]) .surface{width:min(var(--hp-dialog-wide-width,500px),94vw);}:host([form-shell]){--hp-dialog-wide-width:560px;}:host([form-shell]) .surface{max-height:min(940px,calc(100vh - 48px));}:host([form-shell]) .content{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;background:var(--secondary-background-color,color-mix(in srgb,var(--card-background-color,var(--hp-bg,#202126)) 90%,var(--primary-text-color,#000)));}:host([form-shell]) .close{width:44px;height:44px;}:host([form-shell]) .header{min-height:70px;}@media (max-width:480px){:host([form-shell]) .surface{width:100vw;max-height:100vh;border:0;border-radius:0;}:host([form-shell]) .badge{max-width:105px;}}.header{min-height:56px;display:flex;align-items:center;gap:var(--sp-4,12px);padding:var(--sp-4,12px) var(--sp-5,16px);box-sizing:border-box;border-bottom:1px solid var(--hp-line,rgb(255 255 255 / 0.12));}.header .title{flex:1;}.close{width:40px;height:40px;flex:none;display:inline-flex;align-items:center;justify-content:center;padding:0;color:inherit;background:transparent;border:0;border-radius:50%;cursor:pointer;}:host([data-pointer-hover]) .close:hover,.close:focus-visible{background:rgb(127 127 127 / 0.16);}.content{min-height:0;display:flex;flex-direction:column;}.overlay-portal{position:fixed;z-index:2147483647;inset:0;overflow:visible;pointer-events:none;}.overlay-portal:empty{display:none;}.overlay-portal>*{pointer-events:auto;}`,customElements.get("hp-dialog")||customElements.define("hp-dialog",Ie);class Oe extends ce{constructor(){super(...arguments),this.hass=null,this.request=null,this.token=0}createRenderRoot(){return this}_decide(e){this.dispatchEvent(new CustomEvent("hp-confirm-decision",{detail:{token:this.token,accepted:e},bubbles:!0,composed:!0}))}render(){const e=this.request;if(!e)return null;const t="destructive"===e.kind,i=`hp-confirm-description-${this.token}`;return j`{this._active={...t,resolve:e},this._changed(t)})}resolve(e,t){const i=this._active;return!(!i||i.token!==e)&&(this._active=null,this._changed(null),i.resolve(t),!0)}cancel(){const e=this._active;return!!e&&this.resolve(e.token,!1)}}const Ie=new Set(["hacs","sun","backup","hassio","met","telegram_bot","mobile_app","systemmonitor","better_thermostat","adaptive_lighting","yandex_pogoda","upnp_serial_number"]),Oe=[{pattern:"протечк|leak|water sensor",icon:"mdi:water-alert"},{pattern:"клапан|valve",icon:"mdi:pipe-valve"},{pattern:"дым|smoke",icon:"mdi:smoke-detector"},{pattern:"термоголов|trv|radiator",icon:"mdi:radiator"},{pattern:"чайник|kettle|термопот",icon:"mdi:kettle"},{pattern:"сауна|sauna|harvia|парная|парилк",icon:"mdi:hot-tub"},{pattern:"температ|temperature|thermometer|climate sensor",icon:"mdi:thermometer"},{pattern:"qingping|air monitor|молекул|air quality",icon:"mdi:air-filter"},{pattern:"штор|curtain|blind|shade",icon:"mdi:roller-shade"},{pattern:"розетк|plug|socket|outlet",icon:"mdi:power-socket-de"},{pattern:"выключат|switch",icon:"mdi:light-switch"},{pattern:"лампа|лампочк|bulb|gx53|светильник|rgb|lamp|light strip",icon:"mdi:lightbulb"},{pattern:"камер|camera",icon:"mdi:cctv"},{pattern:"замок|ttlock|lock|sn609|sn9161",icon:"mdi:lock"},{pattern:"ворота|garage|gate",icon:"mdi:garage-variant"},{pattern:"калитк|door|открыт|contact",icon:"mdi:door"},{pattern:"счётчик|счетчик|kws|meter",icon:"mdi:meter-electric"},{pattern:"вводный автомат|breaker|wifimcbn",icon:"mdi:electric-switch"},{pattern:"myheat|котёл|котел|boiler|отоплен|heating",icon:"mdi:water-boiler"},{pattern:"холодильник|fridge",icon:"mdi:fridge"},{pattern:"стиральн|washer|washing",icon:"mdi:washing-machine"},{pattern:"сушилк|dryer",icon:"mdi:tumble-dryer"},{pattern:"пылесос|vacuum|dreame|roborock",icon:"mdi:robot-vacuum"},{pattern:"soundbar",icon:"mdi:soundbar"},{pattern:"колонк|станц|speaker|яндекс|yandex|алиса|alice",icon:"mdi:speaker"},{pattern:"tv|телевизор|hyundaitv|mitv|television",icon:"mdi:television"},{pattern:"keenetic|роутер|router|mesh|access point",icon:"mdi:router-wireless"},{pattern:"ибп|ups|kirpich",icon:"mdi:battery-charging-high"},{pattern:"slzb|координат|zigbee|coordinator",icon:"mdi:zigbee"},{pattern:"motion|движен|presence|присутств",icon:"mdi:motion-sensor"},{pattern:"humidity|влажн",icon:"mdi:water-percent"}];function Ee(e){const t=[];for(const i of e)if(i&&"string"==typeof i.pattern&&i.icon)try{t.push({re:new RegExp(i.pattern,"i"),icon:i.icon})}catch{}return t}function Ne(e){try{return new RegExp(e,"i"),!0}catch{return!1}}const He=Ee(Oe),Le={temperature:"mdi:thermometer",humidity:"mdi:water-percent",motion:"mdi:motion-sensor",occupancy:"mdi:motion-sensor",presence:"mdi:motion-sensor",door:"mdi:door",window:"mdi:window-closed",garage_door:"mdi:garage-variant",smoke:"mdi:smoke-detector",moisture:"mdi:water-alert",gas:"mdi:gas-cylinder",power:"mdi:meter-electric",energy:"mdi:meter-electric",illuminance:"mdi:brightness-5",co2:"mdi:molecule-co2",pm25:"mdi:air-filter",battery:"mdi:battery"},Be="mdi:chip";function qe(e,t,i){const n=((e||"")+" "+(t||"")).toLowerCase();for(const{re:e,icon:t}of i??He)if(e.test(n))return t;return Be}const je=["light","switch","cover","valve","lock","climate","fan","media_player","camera","vacuum","humidifier","water_heater","alarm_control_panel","sensor","binary_sensor","event","button","number","select","update"];var We=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ue=Math.ceil,Ge=Math.floor,Ve="[BigNumber Error] ",Ke=Ve+"Number primitive has more than 15 significant digits: ",Ye=1e14,Xe=14,Ze=9007199254740991,Je=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Qe=1e7,et=1e9;function tt(e){var t=0|e;return e>0||e===t?t:t-1}function it(e){for(var t,i,n=1,r=e.length,o=e[0]+"";nc^i?1:-1;for(a=(l=r.length)<(c=o.length)?l:c,s=0;so[s]^i?1:-1;return l==c?0:l>c^i?1:-1}function rt(e,t,i,n){if(ei||e!==Ge(e))throw Error(Ve+(n||"Argument")+("number"==typeof e?ei?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ot(e){var t=e.c.length-1;return tt(e.e/Xe)==t&&e.c[t]%2!=0}function st(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function at(e,t,i){var n,r;if(t<0){for(r=i+".";++t;r+=i);e=r+e}else if(++t>(n=e.length)){for(r=i,t-=n;--t;r+=i);e+=r}else ty?u.c=u.e=null:e.e=10;l/=10,a++);return void(a>y?u.c=u.e=null:(u.e=a,u.c=[e]))}d=String(e)}else{if(!We.test(d=String(e)))return r(u,d,c);u.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(a=d.indexOf("."))>-1&&(d=d.replace(".","")),(l=d.search(/e/i))>0?(a<0&&(a=l),a+=+d.slice(l+1),d=d.substring(0,l)):a<0&&(a=d.length)}else{if(rt(t,2,S.length,"Base"),10==t&&$)return D(u=new M(e),_+u.e+1,m);if(d=String(e),c="number"==typeof e){if(0*e!=0)return r(u,d,c,t);if(u.s=1/e<0?(d=d.slice(1),-1):1,M.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(Ke+e)}else u.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(i=S.slice(0,t),a=l=0,h=d.length;la){a=h;continue}}else if(!s&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){s=!0,l=-1,a=0;continue}return r(u,String(e),c,t)}c=!1,(a=(d=n(d,t,10,u.s)).indexOf("."))>-1?d=d.replace(".",""):a=d.length}for(l=0;48===d.charCodeAt(l);l++);for(h=d.length;48===d.charCodeAt(--h););if(d=d.slice(l,++h)){if(h-=l,c&&M.DEBUG&&h>15&&(e>Ze||e!==Ge(e)))throw Error(Ke+u.s*e);if((a=a-l-1)>y)u.c=u.e=null;else if(a=f)?st(l,s):at(l,s,"0");else if(o=(e=D(new M(e),t,i)).e,a=(l=it(e.c)).length,1==n||2==n&&(t<=o||o<=g)){for(;as),l=at(l,o,"0"),o+1>a){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=o-a)>0)for(o+1==a&&(l+=".");t--;l+="0");return e.s<0&&r?"-"+l:l}function C(e,t){for(var i,n,r=1,o=new M(e[0]);r=10;r/=10,n++);return(i=n+i*Xe-1)>y?e.c=e.e=null:i=10;a/=10,r++);if((o=t-r)<0)o+=Xe,s=t,l=d[c=0],h=Ge(l/u[r-s-1]%10);else if((c=Ue((o+1)/Xe))>=d.length){if(!n)break e;for(;d.length<=c;d.push(0));l=h=0,r=1,s=(o%=Xe)-Xe+1}else{for(l=a=d[c],r=1;a>=10;a/=10,r++);h=(s=(o%=Xe)-Xe+r)<0?0:Ge(l/u[r-s-1]%10)}if(n=n||t<0||null!=d[c+1]||(s<0?l:l%u[r-s-1]),n=i<4?(h||n)&&(0==i||i==(e.s<0?3:2)):h>5||5==h&&(4==i||n||6==i&&(o>0?s>0?l/u[r-s]:0:d[c-1])%10&1||i==(e.s<0?8:7)),t<1||!d[0])return d.length=0,n?(t-=e.e+1,d[0]=u[(Xe-t%Xe)%Xe],e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=c,a=1,c--):(d.length=c+1,a=u[Xe-o],d[c]=s>0?Ge(l/u[r-s]%u[s])*a:0),n)for(;;){if(0==c){for(o=1,s=d[0];s>=10;s/=10,o++);for(s=d[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(e.e++,d[0]==Ye&&(d[0]=1));break}if(d[c]+=a,d[c]!=Ye)break;d[c--]=0,a=1}for(o=d.length;0===d[--o];d.pop());}e.e>y?e.c=e.e=null:e.e=f?st(t,i):at(t,i,"0"),e.s<0?"-"+t:t)}return M.clone=e,M.ROUND_UP=0,M.ROUND_DOWN=1,M.ROUND_CEIL=2,M.ROUND_FLOOR=3,M.ROUND_HALF_UP=4,M.ROUND_HALF_DOWN=5,M.ROUND_HALF_EVEN=6,M.ROUND_HALF_CEIL=7,M.ROUND_HALF_FLOOR=8,M.EUCLID=9,M.config=M.set=function(e){var t,i;if(null!=e){if("object"!=typeof e)throw Error(Ve+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(rt(i=e[t],0,et,t),_=i),e.hasOwnProperty(t="ROUNDING_MODE")&&(rt(i=e[t],0,8,t),m=i),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((i=e[t])&&i.pop?(rt(i[0],-et,0,t),rt(i[1],0,et,t),g=i[0],f=i[1]):(rt(i,-et,et,t),g=-(f=i<0?-i:i))),e.hasOwnProperty(t="RANGE"))if((i=e[t])&&i.pop)rt(i[0],-et,-1,t),rt(i[1],1,et,t),v=i[0],y=i[1];else{if(rt(i,-et,et,t),!i)throw Error(Ve+t+" cannot be zero: "+i);v=-(y=i<0?-i:i)}if(e.hasOwnProperty(t="CRYPTO")){if((i=e[t])!==!!i)throw Error(Ve+t+" not true or false: "+i);if(i){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!i,Error(Ve+"crypto unavailable");b=i}else b=i}if(e.hasOwnProperty(t="MODULO_MODE")&&(rt(i=e[t],0,9,t),w=i),e.hasOwnProperty(t="POW_PRECISION")&&(rt(i=e[t],0,et,t),k=i),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(i=e[t]))throw Error(Ve+t+" not an object: "+i);x=i}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(i=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(i))throw Error(Ve+t+" invalid: "+i);$="0123456789"==i.slice(0,10),S=i}}return{DECIMAL_PLACES:_,ROUNDING_MODE:m,EXPONENTIAL_AT:[g,f],RANGE:[v,y],CRYPTO:b,MODULO_MODE:w,POW_PRECISION:k,FORMAT:x,ALPHABET:S}},M.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!M.DEBUG)return!0;var t,i,n=e.c,r=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&r>=-et&&r<=et&&r===Ge(r)){if(0===n[0]){if(0===r&&1===n.length)return!0;break e}if((t=(r+1)%Xe)<1&&(t+=Xe),String(n[0]).length==t){for(t=0;t=Ye||i!==Ge(i))break e;if(0!==i)return!0}}}else if(null===n&&null===r&&(null===o||1===o||-1===o))return!0;throw Error(Ve+"Invalid BigNumber: "+e)},M.maximum=M.max=function(){return C(arguments,-1)},M.minimum=M.min=function(){return C(arguments,1)},M.random=(o=9007199254740992,s=Math.random()*o&2097151?function(){return Ge(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,i,n,r,o,a=0,l=[],c=new M(p);if(null==e?e=_:rt(e,0,et),r=Ue(e/Xe),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(r*=2));a>>11))>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),t[a]=i[0],t[a+1]=i[1]):(l.push(o%1e14),a+=2);a=r/2}else{if(!crypto.randomBytes)throw b=!1,Error(Ve+"crypto unavailable");for(t=crypto.randomBytes(r*=7);a=9e15?crypto.randomBytes(7).copy(t,a):(l.push(o%1e14),a+=7);a=r/7}if(!b)for(;a=10;o/=10,a++);ai-1&&(null==s[r+1]&&(s[r+1]=0),s[r+1]+=s[r]/i|0,s[r]%=i)}return s.reverse()}return function(n,r,o,s,a){var l,c,h,d,u,p,g,f,v=n.indexOf("."),y=_,b=m;for(v>=0&&(d=k,k=0,n=n.replace(".",""),p=(f=new M(r)).pow(n.length-v),k=d,f.c=t(at(it(p.c),p.e,"0"),10,o,e),f.e=f.c.length),h=d=(g=t(n,r,o,a?(l=S,e):(l=e,S))).length;0==g[--d];g.pop());if(!g[0])return l.charAt(0);if(v<0?--h:(p.c=g,p.e=h,p.s=s,g=(p=i(p,f,y,b,o)).c,u=p.r,h=p.e),v=g[c=h+y+1],d=o/2,u=u||c<0||null!=g[c+1],u=b<4?(null!=v||u)&&(0==b||b==(p.s<0?3:2)):v>d||v==d&&(4==b||u||6==b&&1&g[c-1]||b==(p.s<0?8:7)),c<1||!g[0])n=u?at(l.charAt(1),-y,l.charAt(0)):l.charAt(0);else{if(g.length=c,u)for(--o;++g[--c]>o;)g[c]=0,c||(++h,g=[1].concat(g));for(d=g.length;!g[--d];);for(v=0,n="";v<=d;n+=l.charAt(g[v++]));n=at(n,h,l.charAt(0))}return n}}(),i=function(){function e(e,t,i){var n,r,o,s,a=0,l=e.length,c=t%Qe,h=t/Qe|0;for(e=e.slice();l--;)a=((r=c*(o=e[l]%Qe)+(n=h*o+(s=e[l]/Qe|0)*c)%Qe*Qe+a)/i|0)+(n/Qe|0)+h*s,e[l]=r%i;return a&&(e=[a].concat(e)),e}function t(e,t,i,n){var r,o;if(i!=n)o=i>n?1:-1;else for(r=o=0;rt[r]?1:-1;break}return o}function i(e,t,i,n){for(var r=0;i--;)e[i]-=r,r=e[i]1;e.splice(0,1));}return function(n,r,o,s,a){var l,c,h,d,u,p,_,m,g,f,v,y,b,w,k,x,S,$=n.s==r.s?1:-1,R=n.c,C=r.c;if(!(R&&R[0]&&C&&C[0]))return new M(n.s&&r.s&&(R?!C||R[0]!=C[0]:C)?R&&0==R[0]||!C?0*$:$/0:NaN);for(g=(m=new M($)).c=[],$=o+(c=n.e-r.e)+1,a||(a=Ye,c=tt(n.e/Xe)-tt(r.e/Xe),$=$/Xe|0),h=0;C[h]==(R[h]||0);h++);if(C[h]>(R[h]||0)&&c--,$<0)g.push(1),d=!0;else{for(w=R.length,x=C.length,h=0,$+=2,(u=Ge(a/(C[0]+1)))>1&&(C=e(C,u,a),R=e(R,u,a),x=C.length,w=R.length),b=x,v=(f=R.slice(0,x)).length;v=a/2&&k++;do{if(u=0,(l=t(C,f,x,v))<0){if(y=f[0],x!=v&&(y=y*a+(f[1]||0)),(u=Ge(y/k))>1)for(u>=a&&(u=a-1),_=(p=e(C,u,a)).length,v=f.length;1==t(p,f,_,v);)u--,i(p,x<_?S:C,_,a),_=p.length,l=1;else 0==u&&(l=u=1),_=(p=C.slice()).length;if(_=10;$/=10,h++);D(m,o+(m.e=h+c*Xe-1)+1,s,d)}else m.e=c,m.r=+d;return m}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,c=/^\.([^.]+)$/,h=/^-?(Infinity|NaN)$/,d=/^\s*\+(?=[\w.])|^\s+|\s+$/g,r=function(e,t,i,n){var r,o=i?t:t.replace(d,"");if(h.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!i&&(o=o.replace(a,function(e,t,i){return r="x"==(i=i.toLowerCase())?16:"b"==i?2:8,n&&n!=r?e:t}),n&&(r=n,o=o.replace(l,"$1").replace(c,"0.$1")),t!=o))return new M(o,r);if(M.DEBUG)throw Error(Ve+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},u.absoluteValue=u.abs=function(){var e=new M(this);return e.s<0&&(e.s=1),e},u.comparedTo=function(e,t){return nt(this,new M(e,t))},u.decimalPlaces=u.dp=function(e,t){var i,n,r,o=this;if(null!=e)return rt(e,0,et),null==t?t=m:rt(t,0,8),D(new M(o),e+o.e+1,t);if(!(i=o.c))return null;if(n=((r=i.length-1)-tt(this.e/Xe))*Xe,r=i[r])for(;r%10==0;r/=10,n--);return n<0&&(n=0),n},u.dividedBy=u.div=function(e,t){return i(this,new M(e,t),_,m)},u.dividedToIntegerBy=u.idiv=function(e,t){return i(this,new M(e,t),0,1)},u.exponentiatedBy=u.pow=function(e,t){var i,n,r,o,s,a,l,c,h=this;if((e=new M(e)).c&&!e.isInteger())throw Error(Ve+"Exponent not an integer: "+A(e));if(null!=t&&(t=new M(t)),s=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return c=new M(Math.pow(+A(h),s?e.s*(2-ot(e)):+A(e))),t?c.mod(t):c;if(a=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new M(NaN);(n=!a&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||s&&h.c[1]>=24e7:h.c[0]<8e13||s&&h.c[0]<=9999975e7)))return o=h.s<0&&ot(e)?-0:0,h.e>-1&&(o=1/o),new M(a?1/o:o);k&&(o=Ue(k/Xe+2))}for(s?(i=new M(.5),a&&(e.s=1),l=ot(e)):l=(r=Math.abs(+A(e)))%2,c=new M(p);;){if(l){if(!(c=c.times(h)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(r){if(0===(r=Ge(r/2)))break;l=r%2}else if(D(e=e.times(i),e.e+1,1),e.e>14)l=ot(e);else{if(0===(r=+A(e)))break;l=r%2}h=h.times(h),o?h.c&&h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}return n?c:(a&&(c=p.div(c)),t?c.mod(t):o?D(c,k,m,void 0):c)},u.integerValue=function(e){var t=new M(this);return null==e?e=m:rt(e,0,8),D(t,t.e+1,e)},u.isEqualTo=u.eq=function(e,t){return 0===nt(this,new M(e,t))},u.isFinite=function(){return!!this.c},u.isGreaterThan=u.gt=function(e,t){return nt(this,new M(e,t))>0},u.isGreaterThanOrEqualTo=u.gte=function(e,t){return 1===(t=nt(this,new M(e,t)))||0===t},u.isInteger=function(){return!!this.c&&tt(this.e/Xe)>this.c.length-2},u.isLessThan=u.lt=function(e,t){return nt(this,new M(e,t))<0},u.isLessThanOrEqualTo=u.lte=function(e,t){return-1===(t=nt(this,new M(e,t)))||0===t},u.isNaN=function(){return!this.s},u.isNegative=function(){return this.s<0},u.isPositive=function(){return this.s>0},u.isZero=function(){return!!this.c&&0==this.c[0]},u.minus=function(e,t){var i,n,r,o,s=this,a=s.s;if(t=(e=new M(e,t)).s,!a||!t)return new M(NaN);if(a!=t)return e.s=-t,s.plus(e);var l=s.e/Xe,c=e.e/Xe,h=s.c,d=e.c;if(!l||!c){if(!h||!d)return h?(e.s=-t,e):new M(d?s:NaN);if(!h[0]||!d[0])return d[0]?(e.s=-t,e):new M(h[0]?s:3==m?-0:0)}if(l=tt(l),c=tt(c),h=h.slice(),a=l-c){for((o=a<0)?(a=-a,r=h):(c=l,r=d),r.reverse(),t=a;t--;r.push(0));r.reverse()}else for(n=(o=(a=h.length)<(t=d.length))?a:t,a=t=0;t0)for(;t--;h[i++]=0);for(t=Ye-1;n>a;){if(h[--n]=0;){for(i=0,u=y[r]%g,p=y[r]/g|0,o=r+(s=l);o>r;)i=((c=u*(c=v[--s]%g)+(a=p*c+(h=v[s]/g|0)*u)%g*g+_[o]+i)/m|0)+(a/g|0)+p*h,_[o--]=c%m;_[o]=i}return i?++n:_.splice(0,1),T(e,_,n)},u.negated=function(){var e=new M(this);return e.s=-e.s||null,e},u.plus=function(e,t){var i,n=this,r=n.s;if(t=(e=new M(e,t)).s,!r||!t)return new M(NaN);if(r!=t)return e.s=-t,n.minus(e);var o=n.e/Xe,s=e.e/Xe,a=n.c,l=e.c;if(!o||!s){if(!a||!l)return new M(r/0);if(!a[0]||!l[0])return l[0]?e:new M(a[0]?n:0*r)}if(o=tt(o),s=tt(s),a=a.slice(),r=o-s){for(r>0?(s=o,i=l):(r=-r,i=a),i.reverse();r--;i.push(0));i.reverse()}for((r=a.length)-(t=l.length)<0&&(i=l,l=a,a=i,t=r),r=0;t;)r=(a[--t]=a[t]+l[t]+r)/Ye|0,a[t]=Ye===a[t]?0:a[t]%Ye;return r&&(a=[r].concat(a),++s),T(e,a,s)},u.precision=u.sd=function(e,t){var i,n,r,o=this;if(null!=e&&e!==!!e)return rt(e,1,et),null==t?t=m:rt(t,0,8),D(new M(o),e,t);if(!(i=o.c))return null;if(n=(r=i.length-1)*Xe+1,r=i[r]){for(;r%10==0;r/=10,n--);for(r=i[0];r>=10;r/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},u.shiftedBy=function(e){return rt(e,-9007199254740991,Ze),this.times("1e"+e)},u.squareRoot=u.sqrt=function(){var e,t,n,r,o,s=this,a=s.c,l=s.s,c=s.e,h=_+4,d=new M("0.5");if(1!==l||!a||!a[0])return new M(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(l=Math.sqrt(+A(s)))||l==1/0?(((t=it(a)).length+c)%2==0&&(t+="0"),l=Math.sqrt(+t),c=tt((c+1)/2)-(c<0||c%2),n=new M(t=l==1/0?"5e"+c:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new M(l+""),n.c[0])for((l=(c=n.e)+h)<3&&(l=0);;)if(o=n,n=d.times(o.plus(i(s,o,h,1))),it(o.c).slice(0,l)===(t=it(n.c)).slice(0,l)){if(n.e0&&_>0){for(o=_%a||a,h=p.substr(0,o);o<_;o+=a)h+=c+p.substr(o,a);l>0&&(h+=c+p.slice(o)),u&&(h="-"+h)}n=d?h+(i.decimalSeparator||"")+((l=+i.fractionGroupSize)?d.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):d):h}return(i.prefix||"")+n+(i.suffix||"")},u.toFraction=function(e){var t,n,r,o,s,a,l,c,h,d,u,_,g=this,f=g.c;if(null!=e&&(!(l=new M(e)).isInteger()&&(l.c||1!==l.s)||l.lt(p)))throw Error(Ve+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+A(l));if(!f)return new M(g);for(t=new M(p),h=n=new M(p),r=c=new M(p),_=it(f),s=t.e=_.length-g.e-1,t.c[0]=Je[(a=s%Xe)<0?Xe+a:a],e=!e||l.comparedTo(t)>0?s>0?t:h:l,a=y,y=1/0,l=new M(_),c.c[0]=0;d=i(l,t,0,1),1!=(o=n.plus(d.times(r))).comparedTo(e);)n=r,r=o,h=c.plus(d.times(o=h)),c=o,t=l.minus(d.times(o=t)),l=o;return o=i(e.minus(n),r,0,1),c=c.plus(o.times(h)),n=n.plus(o.times(r)),c.s=h.s=g.s,u=i(h,r,s*=2,m).minus(g).abs().comparedTo(i(c,n,s,m).minus(g).abs())<1?[h,r]:[c,n],y=a,u},u.toNumber=function(){return+A(this)},u.toPrecision=function(e,t){return null!=e&&rt(e,1,et),R(this,e,t,2)},u.toString=function(e){var t,i=this,r=i.s,o=i.e;return null===o?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=o<=g||o>=f?st(it(i.c),o):at(it(i.c),o,"0"):10===e&&$?t=at(it((i=D(new M(i),_+o+1,m)).c),i.e,"0"):(rt(e,2,S.length,"Base"),t=n(at(it(i.c),o,"0"),10,e,r,!0)),r<0&&i.c[0]&&(t="-"+t)),t},u.valueOf=u.toJSON=function(){return A(this)},u._isBigNumber=!0,u[Symbol.toStringTag]="BigNumber",u[Symbol.for("nodejs.util.inspect.custom")]=u.valueOf,null!=t&&M.set(t),M}(),ct=class{key;left=null;right=null;constructor(e){this.key=e}},ht=class extends ct{constructor(e){super(e)}},dt=class{size=0;modificationCount=0;splayCount=0;splay(e){const t=this.root;if(null==t)return this.compare(e,e),-1;let i=null,n=null,r=null,o=null,s=t;const a=this.compare;let l;for(;;)if(l=a(s.key,e),l>0){let t=s.left;if(null==t)break;if(l=a(t.key,e),l>0&&(s.left=t.right,t.right=s,s=t,t=s.left,null==t))break;null==i?n=s:i.left=s,i=s,s=t}else{if(!(l<0))break;{let t=s.right;if(null==t)break;if(l=a(t.key,e),l<0&&(s.right=t.left,t.left=s,s=t,t=s.right,null==t))break;null==r?o=s:r.right=s,r=s,s=t}}return null!=r&&(r.right=s.left,s.left=o),null!=i&&(i.left=s.right,s.right=n),this.root!==s&&(this.root=s,this.splayCount++),l}splayMin(e){let t=e,i=t.left;for(;null!=i;){const e=i;t.left=e.right,e.right=t,t=e,i=t.left}return t}splayMax(e){let t=e,i=t.right;for(;null!=i;){const e=i;t.right=e.left,e.left=t,t=e,i=t.right}return t}_delete(e){if(null==this.root)return null;if(0!=this.splay(e))return null;let t=this.root;const i=t,n=t.left;if(this.size--,null==n)this.root=t.right;else{const e=t.right;t=this.splayMax(n),t.right=e,this.root=t}return this.modificationCount++,i}addNewRoot(e,t){this.size++,this.modificationCount++;const i=this.root;null!=i?(t<0?(e.left=i,e.right=i.right,i.right=null):(e.right=i,e.left=i.left,i.left=null),this.root=e):this.root=e}_first(){const e=this.root;return null==e?null:(this.root=this.splayMin(e),this.root)}_last(){const e=this.root;return null==e?null:(this.root=this.splayMax(e),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(e){return this.validKey(e)&&0==this.splay(e)}defaultCompare(){return(e,t)=>et?1:0}wrap(){return{getRoot:()=>this.root,setRoot:e=>{this.root=e},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:e=>{this.splayCount=e},splay:e=>this.splay(e),has:e=>this.has(e)}}},ut=class e extends dt{root=null;compare;validKey;constructor(e,t){super(),this.compare=e??this.defaultCompare(),this.validKey=t??(e=>null!=e&&null!=e)}delete(e){return!!this.validKey(e)&&null!=this._delete(e)}deleteAll(e){for(const t of e)this.delete(t)}forEach(e){const t=this[Symbol.iterator]();let i;for(;i=t.next(),!i.done;)e(i.value,i.value,this)}add(e){const t=this.splay(e);return 0!=t&&this.addNewRoot(new ht(e),t),this}addAndReturn(e){const t=this.splay(e);return 0!=t&&this.addNewRoot(new ht(e),t),this.root.key}addAll(e){for(const t of e)this.add(t)}isEmpty(){return null==this.root}isNotEmpty(){return null!=this.root}single(){if(0==this.size)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(0==this.size)throw"Bad state: No element";return this._first().key}last(){if(0==this.size)throw"Bad state: No element";return this._last().key}lastBefore(e){if(null==e)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(e)<0)return this.root.key;let t=this.root.left;if(null==t)return null;let i=t.right;for(;null!=i;)t=i,i=t.right;return t.key}firstAfter(e){if(null==e)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(e)>0)return this.root.key;let t=this.root.right;if(null==t)return null;let i=t.left;for(;null!=i;)t=i,i=t.left;return t.key}retainAll(t){const i=new e(this.compare,this.validKey),n=this.modificationCount;for(const e of t){if(n!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(e)&&0==this.splay(e)&&i.add(this.root.key)}i.size!=this.size&&(this.root=i.root,this.size=i.size,this.modificationCount++)}lookup(e){if(!this.validKey(e))return null;return 0!=this.splay(e)?null:this.root.key}intersection(t){const i=new e(this.compare,this.validKey);for(const e of this)t.has(e)&&i.add(e);return i}difference(t){const i=new e(this.compare,this.validKey);for(const e of this)t.has(e)||i.add(e);return i}union(e){const t=this.clone();return t.addAll(e),t}clone(){const t=new e(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(e){if(null==e)return null;const t=new ht(e.key);return function e(t,i){let n,r;do{if(n=t.left,r=t.right,null!=n){const t=new ht(n.key);i.left=t,e(n,t)}if(null!=r){const e=new ht(r.key);i.right=e,t=r,i=e}}while(null!=r)}(e,t),t}toSet(){return this.clone()}entries(){return new mt(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[Symbol.iterator](){return new _t(this.wrap())}[Symbol.toStringTag]="[object Set]"},pt=class{tree;path=new Array;modificationCount=null;splayCount;constructor(e){this.tree=e,this.splayCount=e.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const e=this.path[this.path.length-1];return this.getValue(e)}rebuildPath(e){this.path.splice(0,this.path.length),this.tree.splay(e),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(e){for(;null!=e;)this.path.push(e),e=e.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(null==this.modificationCount){this.modificationCount=this.tree.getModificationCount();let e=this.tree.getRoot();for(;null!=e;)this.path.push(e),e=e.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let e=this.path[this.path.length-1],t=e.right;if(null!=t){for(;null!=t;)this.path.push(t),t=t.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}},_t=class extends pt{getValue(e){return e.key}},mt=class extends pt{getValue(e){return[e.key,e.key]}},gt=e=>()=>e,ft=e=>{const t=e?(t,i)=>i.minus(t).abs().isLessThanOrEqualTo(e):gt(!1);return(e,i)=>t(e,i)?0:e.comparedTo(i)};function vt(e){const t=e?(t,i,n,r,o)=>t.exponentiatedBy(2).isLessThanOrEqualTo(r.minus(i).exponentiatedBy(2).plus(o.minus(n).exponentiatedBy(2)).times(e)):gt(!1);return(e,i,n)=>{const r=e.x,o=e.y,s=n.x,a=n.y,l=o.minus(a).times(i.x.minus(s)).minus(r.minus(s).times(i.y.minus(a)));return t(l,r,o,s,a)?0:l.comparedTo(0)}}var yt=e=>e,bt=e=>{if(e){const t=new ut(ft(e)),i=new ut(ft(e)),n=(e,t)=>t.addAndReturn(e),r=e=>({x:n(e.x,t),y:n(e.y,i)});return r({x:new lt(0),y:new lt(0)}),r}return yt},wt=e=>({set:e=>{kt=wt(e)},reset:()=>wt(e),compare:ft(e),snap:bt(e),orient:vt(e)}),kt=wt(),xt=(e,t)=>e.ll.x.isLessThanOrEqualTo(t.x)&&t.x.isLessThanOrEqualTo(e.ur.x)&&e.ll.y.isLessThanOrEqualTo(t.y)&&t.y.isLessThanOrEqualTo(e.ur.y),St=(e,t)=>{if(t.ur.x.isLessThan(e.ll.x)||e.ur.x.isLessThan(t.ll.x)||t.ur.y.isLessThan(e.ll.y)||e.ur.y.isLessThan(t.ll.y))return null;const i=e.ll.x.isLessThan(t.ll.x)?t.ll.x:e.ll.x,n=e.ur.x.isLessThan(t.ur.x)?e.ur.x:t.ur.x;return{ll:{x:i,y:e.ll.y.isLessThan(t.ll.y)?t.ll.y:e.ll.y},ur:{x:n,y:e.ur.y.isLessThan(t.ur.y)?e.ur.y:t.ur.y}}},$t=(e,t)=>e.x.times(t.y).minus(e.y.times(t.x)),Mt=(e,t)=>e.x.times(t.x).plus(e.y.times(t.y)),Rt=e=>Mt(e,e).sqrt(),Ct=(e,t,i)=>{const n={x:t.x.minus(e.x),y:t.y.minus(e.y)},r={x:i.x.minus(e.x),y:i.y.minus(e.y)};return $t(r,n).div(Rt(r)).div(Rt(n))},Tt=(e,t,i)=>{const n={x:t.x.minus(e.x),y:t.y.minus(e.y)},r={x:i.x.minus(e.x),y:i.y.minus(e.y)};return Mt(r,n).div(Rt(r)).div(Rt(n))},Dt=(e,t,i)=>t.y.isZero()?null:{x:e.x.plus(t.x.div(t.y).times(i.minus(e.y))),y:i},At=(e,t,i)=>t.x.isZero()?null:{x:i,y:e.y.plus(t.y.div(t.x).times(i.minus(e.x)))},Pt=class e{point;isLeft;segment;otherSE;consumedBy;static compare(t,i){const n=e.comparePoints(t.point,i.point);return 0!==n?n:(t.point!==i.point&&t.link(i),t.isLeft!==i.isLeft?t.isLeft?1:-1:Lt.compare(t.segment,i.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}constructor(e,t){void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let e=0,i=t.length;e{const n=i.otherSE;t.set(i,{sine:Ct(this.point,e.point,n.point),cosine:Tt(this.point,e.point,n.point)})};return(e,n)=>{t.has(e)||i(e),t.has(n)||i(n);const{sine:r,cosine:o}=t.get(e),{sine:s,cosine:a}=t.get(n);return r.isGreaterThanOrEqualTo(0)&&s.isGreaterThanOrEqualTo(0)?o.isLessThan(a)?1:o.isGreaterThan(a)?-1:0:r.isLessThan(0)&&s.isLessThan(0)?o.isLessThan(a)?-1:o.isGreaterThan(a)?1:0:s.isLessThan(r)?-1:s.isGreaterThan(r)?1:0}}},Ft=class e{events;poly;_isExteriorRing;_enclosingRing;static factory(t){const i=[];for(let n=0,r=t.length;n0&&(e=i)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut?.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut?.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}},zt=class{exteriorRing;interiorRings;constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=this.exteriorRing.getGeom();if(null===e)return null;const t=[e];for(let e=0,i=this.interiorRings.length;e0?(this.tree.delete(t),i.push(e)):(this.segments.push(t),t.prev=n)}else{if(n&&r){const e=n.getIntersection(r);if(null!==e){if(!n.isAnEndpoint(e)){const t=this._splitSafely(n,e);for(let e=0,n=t.length;e0)return-1;const n=t.comparePoint(e.rightSE.point);return 0!==n?n:-1}if(i.isGreaterThan(n)){if(s.isLessThan(a)&&s.isLessThan(c))return-1;if(s.isGreaterThan(a)&&s.isGreaterThan(c))return 1;const i=t.comparePoint(e.leftSE.point);if(0!==i)return i;const n=e.comparePoint(t.rightSE.point);return n<0?1:n>0?-1:1}if(s.isLessThan(a))return-1;if(s.isGreaterThan(a))return 1;if(r.isLessThan(o)){const i=t.comparePoint(e.rightSE.point);if(0!==i)return i}if(r.isGreaterThan(o)){const i=e.comparePoint(t.rightSE.point);if(i<0)return 1;if(i>0)return-1}if(!r.eq(o)){const e=l.minus(s),t=r.minus(i),h=c.minus(a),d=o.minus(n);if(e.isGreaterThan(t)&&h.isLessThan(d))return 1;if(e.isLessThan(t)&&h.isGreaterThan(d))return-1}return r.isGreaterThan(o)?1:r.isLessThan(o)||l.isLessThan(c)?-1:l.isGreaterThan(c)?1:e.idt.id?1:0}constructor(e,t,i,n){this.id=++Ht,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=n}static fromRing(t,i,n){let r,o,s;const a=Pt.comparePoints(t,i);if(a<0)r=t,o=i,s=1;else{if(!(a>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);r=i,o=t,s=-1}const l=new Pt(r,!0),c=new Pt(o,!1);return new e(l,c,[n],[s])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return kt.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),i=e.bbox(),n=St(t,i);if(null===n)return null;const r=this.leftSE.point,o=this.rightSE.point,s=e.leftSE.point,a=e.rightSE.point,l=xt(t,s)&&0===this.comparePoint(s),c=xt(i,r)&&0===e.comparePoint(r),h=xt(t,a)&&0===this.comparePoint(a),d=xt(i,o)&&0===e.comparePoint(o);if(c&&l)return d&&!h?o:!d&&h?a:null;if(c)return h&&r.x.eq(a.x)&&r.y.eq(a.y)?null:r;if(l)return d&&o.x.eq(s.x)&&o.y.eq(s.y)?null:s;if(d&&h)return null;if(d)return o;if(h)return a;const u=((e,t,i,n)=>{if(t.x.isZero())return At(i,n,e.x);if(n.x.isZero())return At(e,t,i.x);if(t.y.isZero())return Dt(i,n,e.y);if(n.y.isZero())return Dt(e,t,i.y);const r=$t(t,n);if(r.isZero())return null;const o={x:i.x.minus(e.x),y:i.y.minus(e.y)},s=$t(o,t).div(r),a=$t(o,n).div(r),l=e.x.plus(a.times(t.x)),c=i.x.plus(s.times(n.x)),h=e.y.plus(a.times(t.y)),d=i.y.plus(s.times(n.y));return{x:l.plus(c).div(2),y:h.plus(d).div(2)}})(r,this.vector(),s,e.vector());return null===u?null:xt(n,u)?kt.snap(u):null}split(t){const i=[],n=void 0!==t.events,r=new Pt(t,!0),o=new Pt(t,!1),s=this.rightSE;this.replaceRightSE(o),i.push(o),i.push(r);const a=new e(r,s,this.rings.slice(),this.windings.slice());return Pt.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Pt.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,t=this.windings.length;e0){const e=i;i=n,n=e}if(i.prev===n){const e=i;i=n,n=e}for(let e=0,t=n.rings.length;e1===e.length&&e[0].isSubject;this._isInResult=i(e)!==i(t);break}}return this._isInResult}},Bt=class{poly;isExterior;segments;bbox;constructor(e,t,i){if(!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=kt.snap({x:new lt(e[0][0]),y:new lt(e[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let t=1,i=e.length;tNt.run("union",e,t),Ut=(e,...t)=>Nt.run("intersection",e,t),Gt=(e,...t)=>Nt.run("difference",e,t);kt.set;const Vt=/^#[0-9a-fA-F]{6}$/;function Kt(e,t){return"string"==typeof e&&Vt.test(e)?e:t}const Yt="(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])",Xt=new RegExp(`^rgb\\(${Yt}, ${Yt}, ${Yt}\\)$`);function Zt(e){if(!Array.isArray(e)||e.length<3)return null;const t=e.slice(0,3);if(!t.every(e=>"number"==typeof e&&Number.isFinite(e)))return null;const[i,n,r]=t.map(e=>Math.round(Math.min(255,Math.max(0,e))));return`rgb(${i}, ${n}, ${r})`}function Jt(e){const t=Math.max(0,Math.min(120,(e-40)/140*120));return`hsl(${Math.round(t)}, 85%, 55%)`}function Qt(e,t){if(!(Number.isFinite(e)&&t>0))return e;const i=Math.round(e/t)*t;return Math.abs(i-e)<=1e-9*t?e:i}function ei(e,t,i,n=1/0){if(!(i>0&&e?.every(Number.isFinite)&&t?.every(Number.isFinite)))return[t[0],t[1]];const r=t[0]-e[0],o=t[1]-e[1];if(Math.abs(r)+Math.abs(o)<=1e-12)return[e[0],e[1]];const s=Math.PI/4;let a=Math.atan2(o,r);a<0&&(a+=2*Math.PI);const l=Math.floor(a/s+.5)%8,[c,h]=[[1,0],[1,1],[0,1],[-1,1],[-1,0],[-1,-1],[0,-1],[1,-1]][l],d=c*c+h*h;let u=Math.max(0,Math.round((r*c+o*h)/(i*d)));if(Number.isFinite(n)&&n>=0){const t=(e,t)=>{if(!t)return 1/0;const r=t>0?n-e:e+n;return Math.max(0,Math.floor((r+1e-9*i)/i))};u=Math.min(u,t(e[0],c),t(e[1],h))}return[e[0]+c*u*i,e[1]+h*u*i]}function ti(e,t){if(t){const t=e/2.54;let i=Math.floor(t/12),n=Math.round(t-12*i);return 12===n&&(i+=1,n=0),`${i}′ ${n}″`}return`${(e/100).toFixed(2)} m`}function ii(e,t,i=1){const n=e[0].toFixed(i),r=e[1].toFixed(i),o=t[0].toFixed(i),s=t[1].toFixed(i),a=n=3?e.poly:e&&null!=e.x&&null!=e.y&&null!=e.w&&null!=e.h?[[e.x,e.y],[e.x+e.w,e.y],[e.x+e.w,e.y+e.h],[e.x,e.y+e.h]]:null}function ri(e){const t=[];for(const i of e||[])i?.poly?.length>=3?t.push({poly:i.poly.map(e=>e.join(",")).join(" ")}):i&&null!=i.x&&null!=i.y&&null!=i.w&&null!=i.h&&t.push({rect:{x:i.x,y:i.y,w:i.w,h:i.h,rx:.03*Math.min(i.w,i.h)}});return t}function oi(e){const t=[],i=new Set;for(const n of e||[]){const e=ni(n);if(e)for(let n=0;n=90?e-=180:e<-90&&(e+=180),n.step&&n.step>0){const i=Math.sqrt(d),o=Math.min(Math.max(n.length||0,0)/2,i/2);let a=Math.round(u*i/n.step)*n.step;Math.abs(u*i-i/2)<=n.step/2&&(a=i/2),a=Math.max(o,Math.min(i-o,a));const l=a/i;r={x:t+l*c,y:s+l*h,angle:e}}else r={x:p[0],y:p[1],angle:e}}}return r}function ai(e,t,i){let n=null,r=1/0;for(let o=0;o=r)continue;r=_;const m=Math.sqrt(u),g=(i>0?Math.max(0,Math.min(m,Math.round(p*m/i)*i)):p*m)/m;n=[s+g*h,a+g*d]}return n}function li(e,t,i,n,r,o=1){const s=t*Math.PI/180,a=[Math.cos(s),Math.sin(s)];let l=null,c=o;for(const t of oi(n)){const i=[[t[0],t[1]],[t[2],t[3]]],n=t=>Math.abs(a[0]*(t[1]-e[1])-a[1]*(t[0]-e[0]));if(n(i[0])>o||n(i[1])>o)continue;const r=(i[0][0]-e[0])*a[0]+(i[0][1]-e[1])*a[1],s=(i[1][0]-e[0])*a[0]+(i[1][1]-e[1])*a[1],h=Math.min(r,s),d=Math.max(r,s),u=h>0?h:d<0?-d:0;u[e[0]+a[0]*t,e[1]+a[1]*t],g=(h+d)/2;return{wallA:m(h),wallB:m(d),sideA:p,sideB:_,midA:m((h-u)/2),midB:m((u+d)/2),wallCenter:m(g),centered:Math.abs(g)<=r}}function ci(e,t,i=!1,n){if("passage"===e)return 1;if(null==t||"unavailable"===t||"unknown"===t)return"window"===e?0:1;const r="string"==typeof n?n.trim()?Number(n):NaN:Number(n),o=null!=n&&Number.isFinite(r)?Math.max(0,Math.min(1,r/100)):function(e){return["on","open","home","detected","playing","cleaning"].includes(String(e))}(t)?1:0;return i?1-o:o}function hi(e){const t=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0;return Math.min(1,Math.max(0,.05*Math.round(t/.05)))}function di(e,t){return(Number.isFinite(e)&&e>0?e:0)*(Number.isFinite(t)?Math.max(0,Math.min(1,t)):0)}function ui(e){return"passage"===e.type?[]:[e.contact,e.lock].filter(e=>"string"==typeof e&&e.length>0)}function pi(e,t,i=200){const n=t.trim().toLowerCase();return(n?e.filter(e=>e.label.toLowerCase().includes(n)||e.value.toLowerCase().includes(n)):e).slice(0,Math.max(0,i))}function _i(e,t,i=.001){return Math.abs(e[0]-t[0])e[1]!=l>e[1]&&e[0]<(a-o)*(e[1]-s)/(l-s)+o&&(i=!i)}return i}function gi(e,t,i){const n=i[0]-t[0],r=i[1]-t[1],o=n*n+r*r;let s=o?((e[0]-t[0])*n+(e[1]-t[1])*r)/o:0;return s=Math.max(0,Math.min(1,s)),Math.hypot(e[0]-(t[0]+s*n),e[1]-(t[1]+s*r))}function fi(e,t){if(!t||t.length<2)return null;let i=null,n=1/0;for(let r=0;rr&&s<-r||o<-r&&s>r)&&(a>r&&l<-r||a<-r&&l>r)}function ki(e,t=24){const i=e.map(e=>e[0]),n=e.map(e=>e[1]),r=Math.min(...i),o=Math.max(...i),s=Math.min(...n),a=Math.max(...n),l=Math.max(o-r,a-s)||1;let c=0,h=0,d=0;for(let t=0;t1e-9?[h/(3*c),d/(3*c)]:[(r+o)/2,(s+a)/2],p=(t,i)=>{const n=((t,i)=>{if(!mi([t,i],e))return-1/0;let n=1/0;for(let r=0;rm&&(m=c,_=[n,l])}if(_){const[e,i]=_,n=(o-r)/t,l=(a-s)/t;for(let t=-4;t<=4;t++)for(let r=-4;r<=4;r++){const o=e+n*t/4,s=i+l*r/4,a=p(o,s);a>m&&(m=a,_=[o,s])}}return _||xi(e)||e[0]}function xi(e,t=1e-6){if(!e||e.length<3)return null;const i=e.length,n=[e.reduce((e,t)=>e+t[0],0)/i,e.reduce((e,t)=>e+t[1],0)/i];if(yi(n,e,t))return n;for(let n=0;n$i(e,t,i));return n.filter(e=>!n.some(t=>t!==e&&$i(t,e,i)))}function Ci(e){if(!e||e.length<3)return 0;let t=0;for(let i=0;i[e[0],e[1]]),[e[0][0],e[0][1]]]]}function Di(e,t){if(!e||!t||e.length<3||t.length<3)return null;const i=Wt(Ti(e),Ti(t));if(1!==i.length)return null;if(1!==i[0].length)return null;const n=i[0][0].slice(0,-1).map(e=>[e[0],e[1]]);return n.length>=3?n:null}function Ai(e,t,i){for(let n=0;n1&&_i(i[0],i[i.length-1],t)&&i.pop(),i}function Fi(e,t,i=1e-6){if(!e||e.length<3||!t||t.length<2)return null;const n=t[0],r=t[t.length-1];if(_i(n,r,i))return null;const o=Ai(e,n,i),s=Ai(e,r,i);if(o<0||s<0)return null;const a=t.slice(1,-1);for(const t of a)if(!yi(t,e,i))return null;for(let i=0;i{const s=[t];let a=(n+1)%e.length;for(let t=0;t<=e.length&&(s.push(e[a]),a!==o);t++)a=(a+1)%e.length;return s.push(r),Pi(s,i)};let c,h;if(o===s){const s=Pi([...t],i);if(s.length<3||Ci(s)<=i)return null;const a=[];for(let i=0;i=0?t:[...t].reverse();for(const e of i)a.push(e)}c=Pi(a,i),h=s}else c=Pi([...l(n,o,r,s),...[...a].reverse()],i),h=Pi([...l(r,s,n,o),...a],i);return c.length<3||h.length<3||Ci(c)<=i||Ci(h)<=i||Math.abs(Ci(c)+Ci(h)-Ci(e))>Math.max(i,1e-6*Ci(e))?null:[c,h]}function zi(e,t,i){const[n,r]=e.split(":");return"device"===n?r:"entity"===n?"lg_"+r:t&&t.startsWith("v_")?t:i()}function Ii(e){return e.length?Math.round(e.reduce((e,t)=>e+t,0)/e.length):null}function Oi(e,t){if(t>e[2]/e[3]){const i=e[3],n=e[3]*t;return{x:e[0]-(n-e[2])/2,y:e[1],w:n,h:i}}const i=e[2],n=e[2]/t;return{x:e[0],y:e[1]-(n-e[3])/2,w:i,h:n}}function Ei(e,t,i,n){if(e.length<2)return;const r=t.x+n,o=t.x+t.w-n,s=t.y+n,a=t.y+t.h-n;for(let t=0;t<60;t++){let t=!1;for(let n=0;n"value"===e||"value_static_icon"===e,Bi=e=>"static_icon"===e||"value_static_icon"===e;function qi(e){return"ripple"===e?"icon_ripple":Hi.includes(e)?e:"badge"}const ji=["info","more-info","toggle","run","none"],Wi=["custom","lqi","light","temp"],Ui=["none","lqi","light","temp","custom"],Gi=new Set(["garage","door","gate"]),Vi=["automation","script","scene"];const Ki="—",Yi="{}";function Xi(e){const t=String(e??"").trim();if(!t)return null;let i=t,n="";const r=t.indexOf(":");if(r>=0)i=t.slice(0,r).trim(),n=t.slice(r+1).trim();else{const e=t.split(".");e.length>2&&(i=e.slice(0,2).join("."),n=e.slice(2).join("."))}return/^[a-z0-9_]+\.[a-z0-9_]+$/.test(i)?r>=0&&!n||n&&!/^[a-zA-Z0-9_.-]+$/.test(n)?null:n?{entity:i,attr:n}:{entity:i}:null}function Zi(e,t){const i=String(e??"").trim(),n=String(t??"").trim(),r=Xi(n?`${i}:${n}`:i);return r?`{${r.entity}${r.attr?`:${r.attr}`:""}}`:""}function Ji(e,t,i){const n=String(t??"").trim();if(!n)return null;const r=e?.states?.[n];if(!r)return null;const o=String(i??"").trim(),s=e=>e.slice(0,60);if(o){const t=function(e){if(null==e)return null;if(Array.isArray(e)){const t=e.map(e=>null==e?"":String(e)).join(", ");return t?t.slice(0,60):null}if("object"==typeof e)return null;const t=String(e);return""===t?null:t.slice(0,60)}(r.attributes?.[o]);if(null===t)return null;const i=e?.formatEntityAttributeValue;if("function"==typeof i)try{const t=i.call(e,r,o);if("string"==typeof t&&""!==t)return{text:s(t),formatted:!0}}catch{}return{text:t,formatted:!1}}const a=r.state;if(null==a||""===a)return null;const l=e?.formatEntityState;if("function"==typeof l)try{const t=l.call(e,r);if("string"==typeof t&&""!==t)return{text:s(t),formatted:!0}}catch{}return{text:s(String(a)),formatted:!1}}function Qi(e,t,i){const n=String(t??"").trim(),r=String(i??"").trim()||n;if(!r)return e.text;const o=e.formatted&&n?function(e,t){if(!t)return e;const i=e.replace(/\s+$/,"");return i.endsWith(t)?i.slice(0,i.length-t.length).replace(/\s+$/,""):e}(e.text,n):e.text;return`${o} ${r}`}function en(e,t){const i=(t?.entity||"").trim();if(!i)return"";const n=e?.states?.[i],r=n?.state;if(!n||null==r||""===r||"unavailable"===r||"unknown"===r)return Ki;const o=(t?.attr||"").trim(),s=Ji(e,i,o||null);if(null===s)return Ki;return Qi(s,o?"":String(n.attributes?.unit_of_measurement??"").trim(),t?.unit)}function tn(e,t,i,n=()=>!0){const r=e??"";let o=!1;const s=r.replace(/\{([^{}\r\n]+)\}/g,(e,t)=>{const r=Xi(t);return r?(o=!0,n(r.entity||"")?en(i,r):Ki):e});if(o)return s;const a=(t?.entity||"").trim();if(!a)return r;if(!n(a)){const e=r.indexOf(Yi);return e>=0?r.slice(0,e)+Ki+r.slice(e+2):r?`${r} ${Ki}`:Ki}const l=en(i,t),c=r.indexOf(Yi);return c>=0?r.slice(0,c)+l+r.slice(c+2):r?`${r} ${l}`:l}const nn=20;function rn(e){const t=Number(e?.scale);if(Number.isFinite(t)&&t>0)return Math.min(20,Math.max(.15,t));return{s:.7,m:1,l:1.5}[String(e?.size??"")]??1}function on(e,t){if(!t)return e;let i=e;for(const[e,n]of Object.entries(t))i=i.split("{"+e+"}").join(String(n));return i}const sn="#55606c",an=.55,ln=20,cn=25,hn={c:"#607d8b",a:.18};function dn(e,t=hn){const i=e&&"object"==typeof e?e:null,n=i?.a;return{c:Kt(i?.c,t.c),a:"number"==typeof n&&Number.isFinite(n)?Math.min(1,Math.max(0,n)):t.a}}function un(e,t){const i=dn(e),n=t?.settings;if("custom"!==n?.fill_mode)return i;const r=n?.custom_fill;return r&&"object"==typeof r?dn(r,i):i}function pn(e,t,i){const n=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,r=n(e,20),o=n(t,25),s=n(i?.settings?.temp_min,r),a=n(i?.settings?.temp_max,o);return{min:Math.min(s,a),max:Math.max(s,a)}}function _n(e){const t=e?.settings||{},i=!e?.plan_url,n="glow"===t.fill_mode;return{showBorders:t.show_borders??i,showNames:t.show_names??i,color:Kt(t.room_color,sn),opacity:"number"==typeof t.room_opacity?Math.min(1,Math.max(0,t.room_opacity)):.55,fill:["lqi","light","temp","custom"].includes(t.fill_mode)?t.fill_mode:"none",customFill:dn(t.custom_fill),glow:"boolean"==typeof t.glow_enabled?t.glow_enabled:n,tempMin:"number"==typeof t.temp_min?t.temp_min:20,tempMax:"number"==typeof t.temp_max?t.temp_max:25,showLqi:"boolean"==typeof t.show_lqi?t.show_lqi:null,cardFontScale:"number"==typeof t.card_font_scale&&t.card_font_scale>0?Math.min(3,Math.max(.5,t.card_font_scale)):1,labelTemp:!0===t.label_temp,labelHum:!0===t.label_hum,labelLqi:!0===t.label_lqi,labelLight:!0===t.label_light,bgColor:Kt(t.bg_color,null),hideDecor:!0===t.hide_decor,hideOpenings:!0===t.hide_openings}}function mn(e,t){if(t.bgColor)return t.bgColor;const i=e?.bg_color;return Kt(i,"")}function gn(e){return!1!==e?.show_room_tooltip}const fn={light_on:{c:"#ffd45c",a:.18},light_off:{c:"#9aa0a6",a:.14},light_none:{c:"#6b7480",a:0},temp_cold:{c:"#4fc3f7",a:.18},temp_ok:{c:"#66d17a",a:.18},temp_hot:{c:"#ffd45c",a:.18},lqi_low:{c:"#f25a4a",a:.18},lqi_high:{c:"#4bd28f",a:.18},glow_base:{c:"#0d1b2a",a:.5},glow_light:{c:"#ffd9a0",a:.85},wall_fill:{c:"#ffffff",a:1}};function vn(e){const t={},i=e?.fill_colors||{};for(const e of Object.keys(fn)){const n=fn[e],r=i[e];t[e]={c:Kt(r?.c,n.c),a:r&&"number"==typeof r.a?Math.min(1,Math.max(0,r.a)):n.a}}return t}function yn(e,t,i){const n=Math.min(1,Math.max(0,i)),r=[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)),o=[1,3,5].map(e=>parseInt(t.slice(e,e+2),16)),s=r.map((e,t)=>Math.round(e+(o[t]-e)*n));return"#"+s.map(e=>e.toString(16).padStart(2,"0")).join("")}function bn(e,t,i,n,r,o,s,a=hn){const l=function(e,t,i,n,r,o,s,a=hn){if("custom"===e)return dn(a);if("lqi"===e){if(null==t)return null;const e=(t-40)/140;return{c:yn(s.lqi_low.c,s.lqi_high.c,e),a:s.lqi_low.a+(s.lqi_high.a-s.lqi_low.a)*Math.min(1,Math.max(0,e))}}if("light"===e)return"none"===i?s.light_none.a>0?s.light_none:null:"on"===i?s.light_on:s.light_off;if("temp"===e){if(null==n)return null;const e=Math.min(r,o),t=Math.max(r,o);return nt?s.temp_hot:s.temp_ok}return null}(e,t,i,n,r,o,s,a);return l?{color:l.c,opacity:l.a,mode:e}:null}const wn={blind:["mdi:blinds","mdi:blinds-open"],shade:["mdi:blinds","mdi:blinds-open"],shutter:["mdi:window-shutter","mdi:window-shutter-open"],curtain:["mdi:curtains-closed","mdi:curtains"],window:["mdi:window-closed","mdi:window-open"],awning:["mdi:awning-outline","mdi:awning"],door:["mdi:door-closed","mdi:door-open"],garage:["mdi:garage","mdi:garage-open"],gate:["mdi:gate","mdi:gate-open"],damper:["mdi:circle-slice-8","mdi:circle-outline"]},kn=[["mdi:roller-shade-closed","mdi:roller-shade"],["mdi:blinds-horizontal-closed","mdi:blinds-horizontal"],["mdi:garage-variant","mdi:garage-open-variant"],["mdi:door","mdi:door-open"]];function xn(e){for(const t of[...Object.values(wn),...kn])if(e===t[0]||e===t[1])return t;return null}function Sn(e,t,i,n,r){if(!n||"unavailable"===n||"unknown"===n)return e;if(r){const i="cover"===t?xn(e):null;return i?"closed"===n?i[0]:i[1]:e}if("binary_sensor"===t){if("door"===i)return"on"===n?"mdi:door-open":"mdi:door-closed";if("window"===i)return"on"===n?"mdi:window-open":"mdi:window-closed";if("garage_door"===i)return"on"===n?"mdi:garage-open-variant":"mdi:garage-variant"}if("cover"===t){const t=wn[String(i||"")];if(t)return"closed"===n?t[0]:t[1];const r=xn(e);return r?"closed"===n?r[0]:r[1]:e}return"lock"===t?"locked"===n?"mdi:lock":"mdi:lock-open-variant":"light"===t&&"mdi:lightbulb"===e&&"on"===n?"mdi:lightbulb-on":e}function $n(e){const t=Math.min(4e4,Math.max(1e3,e))/100,i=t<=66?255:329.698727446*Math.pow(t-60,-.1332047592),n=t<=66?99.4708025861*Math.log(t)-161.1195681661:288.1221695283*Math.pow(t-60,-.0755148492),r=t>=66?255:t<=19?0:138.5177312231*Math.log(t-10)-305.0447927307,o=e=>Math.round(Math.min(255,Math.max(0,e)));return[o(i),o(n),o(r)]}const Mn=1/2.2;function Rn(e){const t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/.exec(e);return t?"#"+t.slice(1).map(e=>Math.min(255,Number(e)).toString(16).padStart(2,"0")).join(""):null}function Cn(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;const t=e;if(Object.keys(t).some(e=>"c"!==e&&"bri"!==e))return null;const i=Kt(t.c,null);return i?void 0===t.bri||null===t.bri?{c:i}:"number"!=typeof t.bri||!Number.isFinite(t.bri)||t.bri<.01||t.bri>1?null:{c:i,bri:t.bri}:null}function Tn(e,t,i){const n=Cn(t),r=e?.attributes||{},o=n?.bri??function(e){const t=e?.attributes?.brightness,i="number"==typeof t?t:"string"==typeof t&&""!==t.trim()?Number(t):Number.NaN;return Number.isFinite(i)?Math.max(0,Math.min(1,i/255)):1}(e);if(n)return{c:n.c,bri:o};const s=Zt(r.rgb_color);if(s)return{c:Rn(s)||Kt(i,"#ffd9a0"),bri:o};const a=Number(r.color_temp_kelvin)||(Number(r.color_temp)>0?1e6/Number(r.color_temp):NaN);return Number.isFinite(a)&&a>0?{c:(l=$n(a),"#"+l.slice(0,3).map(e=>Math.min(255,Math.max(0,Math.round(Number(e)||0))).toString(16).padStart(2,"0")).join("")),bri:o}:{c:Kt(i,"#ffd9a0"),bri:o};var l}function Dn(e,t,i){return"on"===e?.state?Tn(e,t,i):null}function An(e,t=1){const i=Math.max(0,Math.min(1,Number.isFinite(e)?e:1)),n=.7*Math.max(0,Math.min(1,Number.isFinite(t)?t:1))*(.4+.6*Math.pow(i,Mn));return Math.max(0,Math.min(1,n))}function Pn(e){return e.startsWith("light.")||e.startsWith("switch.")}function Fn(e,t,i=1e-6){const n=[];if(!e||!t||e.length<3||t.length<3)return n;for(let r=0;ru||l>u)continue;const p=(r[0]-o[0])*h+(r[1]-o[1])*d,_=(s[0]-o[0])*h+(s[1]-o[1])*d,m=Math.max(0,Math.min(p,_)),g=Math.min(c,Math.max(p,_));g-m>i&&n.push([o[0]+h*m,o[1]+d*m,o[0]+h*g,o[1]+d*g])}}return n}function zn(e,t,i=1e-6){const n=[];for(const r of e){const e=[r[0],r[1]],o=[r[2],r[3]],s=o[0]-e[0],a=o[1]-e[1],l=Math.hypot(s,a);if(lo||r>o)continue;const s=(n[0]-e[0])*c+(n[1]-e[1])*h,a=(n[2]-e[0])*c+(n[3]-e[1])*h,u=Math.max(0,Math.min(s,a)),p=Math.min(l,Math.max(s,a));p-u>i&&d.push([u,p])}if(!d.length){n.push([e[0],e[1],o[0],o[1]]);continue}d.sort((e,t)=>e[0]-t[0]);let u=0;for(const[t,r]of d)t-u>i&&n.push([e[0]+c*u,e[1]+h*u,e[0]+c*t,e[1]+h*t]),u=Math.max(u,r);l-u>i&&n.push([e[0]+c*u,e[1]+h*u,o[0],o[1]])}return n}function In(e,t,i=1e-6){const n=[];for(let t=0;t{if("string"!=typeof e||!e)return;const i=Hn(e);i.startsWith("/api/houseplan/content/")&&t.add(i)};for(const t of e?.spaces||[]){i(t?.plan_url);for(const e of t?.markers||[])for(const t of e?.pdfs||[])i(t?.url)}for(const t of e?.markers||[])for(const e of t?.pdfs||[])i(e?.url);return t}function Hn(e){return e?e.startsWith("/houseplan_files/plans/")?"/api/houseplan/content/plans/_/"+e.slice(23):e.startsWith("/houseplan_files/files/")?"/api/houseplan/content/files/"+e.slice(23):e:""}function Ln(e,t){const i=t?.settings?.fill_mode;return"none"===i||"lqi"===i||"light"===i||"temp"===i||"custom"===i?i:e}function Bn(e,t){const i=t?.settings;return"boolean"==typeof i?.glow?i.glow:"glow"===i?.fill_mode||e}function qn(e,t,i,n){if(!t||!i||t===i)return e;const r="/files/"+t+"/",o="/files/"+i+"/";return e.map(e=>{if(!e.url.includes(r))return e;const t=e.url.split(r)[1]||"",[i,s]=[t.split("?")[0],t.includes("?")?"?"+t.split("?")[1]:""];if(n){const t=n[decodeURIComponent(i)]??n[i];return t?{...e,url:e.url.split(r+i)[0]+o+encodeURIComponent(t)+s}:e}return{...e,url:e.url.split(r).join(o)}})}function jn(e,t=1){const i=Number(e);return Number.isFinite(i)&&i>0?Math.min(3,Math.max(.5,i)):t}function Wn(e,t,i){let n=null,r=null;for(const o of t){if(!(Math.abs(o[0]-e[0])<1e-6&&Math.abs(o[1]-e[1])<1e-6)){if(Math.abs(o[0]-e[0])<=i){const t=Math.abs(o[1]-e[1]);t>1e-6&&(!n||t1e-6&&(!r||t"number"==typeof e&&Number.isFinite(e),nr=(e,t,i)=>Math.min(i,Math.max(t,e));function rr(e){return e.elevation<=-6?"night":e.elevation>=6?"day":e.rising?"dawn":"dusk"}function or(e){const t=(Math.floor(Number(e)||0)%1440+1440)%1440;return t>=300&&t<480?"dawn":t>=480&&t<1080?"day":t>=1080&&t<1260?"dusk":"night"}function sr(e){const t=rr(e),i=e.azimuth*Math.PI/180;return{sunX:50-42*Math.sin(i),sunY:78-nr(e.elevation,0,90)/90*64,sunOpacity:"night"===t?0:nr((e.elevation+6)/12,0,1)}}function ar(e){const t=(Math.floor(Number(e)||0)%1440+1440)%1440;if(t<300||t>=1260)return{sunX:50,sunY:78,sunOpacity:0};const i=(t-300)/960,n=(t-300)/120,r=(1260-t)/120;return{sunX:8+84*i,sunY:78-64*Math.sin(i*Math.PI),sunOpacity:Math.max(.18,Math.min(n,r,1))}}function lr(e,t=new Date){const i=function(e){const t=e?.states?.["sun.sun"]?.attributes;return t&&ir(t.azimuth)&&ir(t.elevation)&&"boolean"==typeof t.rising?{azimuth:Qn(t.azimuth),elevation:t.elevation,rising:t.rising}:null}(e);if(i)return{phase:rr(i),source:"sun",...sr(i)};const n="number"==typeof t?t:function(e=new Date){return 60*e.getHours()+e.getMinutes()}(t);return{phase:or(n),source:"clock",...ar(n)}}function cr(e){return`${e.source}|${e.phase}|${e.sunX.toFixed(2)}|${e.sunY.toFixed(2)}|`+e.sunOpacity.toFixed(3)}const hr=[[-90,"#070c14"],[-12,"#070c14"],[-4,"#131a28"],[0,"#4a3527"],[10,"#e8ddcf"],[30,"#ffffff"],[90,"#ffffff"]],dr=e=>Math.min(1,Math.max(0,e));function ur(e,t,i=6){const n=e.angle*Math.PI/180,r=[Math.sin(n),-Math.cos(n)],o=n=>{const o=[e.x+r[0]*i*n,e.y+r[1]*i*n];return t.find(e=>e.poly.length>=3&&mi(o,e.poly))||null},s=o(1),a=o(-1);return s&&a?null:s||a?s?{normal:[-r[0],-r[1]],roomId:s.id}:{normal:r,roomId:a.id}:null}function pr(e,t,i){return i>0&&e[0]*t[0]+e[1]*t[1]>.05}function _r(e,t,i,n){return[[e[0],e[1]],[t[0],t[1]],[t[0]+i[0]*n,t[1]+i[1]*n],[e[0]+i[0]*n,e[1]+i[1]*n]]}function mr(e,t){return gr(e,t)}function gr(...e){try{if(!e.length||e.some(e=>e.length<3))return[];const t=e.map(e=>[[...e.map(e=>[e[0],e[1]]),[e[0][0],e[0][1]]]]),i=Ut(t[0],...t.slice(1)),n=[];for(const e of i){const t=e[0];!Array.isArray(t)||t.length<4||n.push(t.slice(0,t.length-1).map(e=>[e[0],e[1]]))}return n}catch{return[]}}function fr(e,t,i,n,r,o,s,a="inner"){if(!(n>0))return[];const l=er(i,r),c=[-l[0],-l[1]],h=function(e){const t=Math.min(90,Math.max(0,e));return.7*(.8+1.7*Math.pow(1-t/90,1.6))}(n),d=[];for(const i of t){if(!(i.length>0))continue;const t=ur(i,e);if(!t||!pr(t.normal,l,n))continue;const r=e.find(e=>e.id===t.roomId);if(!r)continue;const u=o&&o[t.roomId]||r.poly,p=i.angle*Math.PI/180,_=i.length/2,m=[-t.normal[0],-t.normal[1]],g=Math.max(0,s?.[i.id]||0),f=Math.cos(p)*_,v=Math.sin(p)*_,y="outer"===a?-1:1,b=i.x+m[0]*g*y/2,w=i.y+m[1]*g*y/2,k=[b-f,w-v],x=[b+f,w+v],S=h*i.length,$=_r(k,x,c,S);let M,R=mr($,u);if("outer"===a&&g>0){const e=i.x+m[0]*g/2,t=i.y+m[1]*g/2,n=[e-f,t-v],r=[e+f,t+v],o=[[b-f,w-v],[b+f,w+v],[e+f,t+v],[e-f,t-v]];R=[...gr($,_r(n,r,c,S),u),...gr($,o)],M=[k,x,n,r]}if(!R.length)continue;const C=c[0]*m[0]+c[1]*m[1];d.push({openingId:i.id,roomId:t.roomId,polys:R,a:k,b:x,rimSources:M,dir:c,len:S,normal:m,depth:S*C})}return d}const vr=e=>"number"==typeof e&&Number.isInteger(e)&&e>=0&&e<=359?e:null;function yr(e,t){const i=vr(t?.north_deg);return null!==i?i:vr(e?.north_deg)}function br(e){return"outer"===e?.sun_ray_origin?"outer":"inner"}function wr(e,t){const i=e=>"static"===e||"daynight"===e?e:null;return i(t?.bg_mode)??i(e?.bg_mode)??"static"}function kr(e,t){const i=t?.sun_rays;return"boolean"==typeof i?i:!0===e?.sun_rays}function xr(e){const t=e?.states?.["sun.sun"]?.attributes,i=Number(t?.azimuth),n=Number(t?.elevation);return Number.isFinite(i)&&Number.isFinite(n)?{azimuth:i,elevation:n}:null}const Sr=["dawn","day","dusk","night"];function $r(e){if(!e)return"";const t=tr[e.phase];return[`--hp-day-cycle-outline-near:${t.outlineNear}`,`--hp-day-cycle-outline-mid:${t.outlineMid}`,`--hp-day-cycle-outline-far:${t.outlineFar}`].join(";")}function Mr(e,t=1){if(!e)return G;const i=[`--hp-day-cycle-sun-x:${e.sunX.toFixed(2)}%`,`--hp-day-cycle-sun-y:${e.sunY.toFixed(2)}%`,`--hp-day-cycle-sun-opacity:${e.sunOpacity.toFixed(3)}`,`opacity:${Math.min(1,Math.max(0,t)).toFixed(4)}`].join(";");return j`