refactor(editor): диалог «Оптимизировать планы» — свой модуль с узким портом (#642)

Первый вынос из монолита по образцу live-*/RadarSetupController.
src/optimize-plans-dialog.ts: OptimizePlansDialogState, чистые
preflightDiagnostics/preflightVersionsDiffer и класс OptimizePlansDialog
(open/preview/toggleLivePositions/run/copyDiagnostics/
reportPreflightFailure/render, clipboardFallback) за портом из 18 членов.
Модуль не знает HouseplanEditorHostPort; импортирует его только рантайм,
карточка берёт тип.

Инлайн-фолбэк буфера обмена — WeakMap по объекту диалога
(CODE-REVIEW-295-r1 M2), дедуп dev-лога — поле класса: из карточки и порта
ушли _preflightClipboardFallback и _reportedPreflightFingerprint, пять
делегатов и две стрелки-заглушки. Харнесс (13 смоков, wall-draw-click,
golden) зовёт card._editorRuntime.optimizePlans.* — меняется только адрес.

11 текстовых утверждений i18n.test.mjs о разметке и тосте диалога и гварды
8 мутантов переехали в юнит test/optimize-plans-dialog.test.mjs
(test-build); новый мутант optimize-dialog-imports-host-port.

monolith-baseline: delegates 159→154, portMembers 350→348,
hostRefs 4948→4869, portPrivates 96→94, harnessPrivates 107→101,
bundleBytes 2499647→2499182. Потолки ядер опущены на выигрыш;
потолок lazy editor gzip пересчитан (+555 Б gzip при −465 Б сырых).

Issue: #642
User-Visible: no
This commit is contained in:
Claude
2026-09-24 08:00:58 +00:00
committed by claude[bot]
parent 79ee16546d
commit 66ae952c2a
70 changed files with 1833 additions and 1208 deletions
+138 -138
View File
@@ -1,127 +1,127 @@
{
"schema": 1,
"fingerprint": "be980214e65258ad0c8ec0480b3b70c46a1e6f817bba2cda8d2f16c104021db6",
"fingerprint": "d85694de8aee015f4930ff31f4c2022c14e45b0ad38f1dd1e723229f27f1e7b1",
"entry": "houseplan-card.js",
"panelEntry": "houseplan-panel.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-e9vxRZcR.js",
"houseplan-assets/houseplan-card-C2ifrS7A.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 289449,
"initialViewGzipBytes": 289273,
"initialPanelFiles": [
"houseplan-assets/houseplan-card-e9vxRZcR.js",
"houseplan-assets/houseplan-card-C2ifrS7A.js",
"houseplan-panel.js"
],
"initialPanelGzipBytes": 290971,
"initialPanelGzipBytes": 290796,
"initialPanelOnlyFiles": [
"houseplan-panel.js"
],
"initialPanelOnlyGzipBytes": 2324,
"lazyFiles": [
"houseplan-assets/backdrop-pick-YbdnEEmM.js",
"houseplan-assets/de-CjsIUY-d.js",
"houseplan-assets/editor-Dv3uqeSS.js",
"houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"houseplan-assets/fr-D2W98VDc.js",
"houseplan-assets/furniture-plan-art.generated-YwpfkuFp.js",
"houseplan-assets/houseplan-editor-runtime--nYeDmTG.js",
"houseplan-assets/houseplan-onboarding-runtime-zgKhvtTD.js",
"houseplan-assets/hp-zigbee-topology-overlay-C5T09STo.js",
"houseplan-assets/iso-scene-render-3HN3TF4R.js",
"houseplan-assets/live-interaction-runtime-kRE37k2_.js",
"houseplan-assets/pdf-export-DKVHRlMO.js",
"houseplan-assets/summary-panel-runtime-loaded-aaGs9bci.js",
"houseplan-assets/zigbee-topology-CXRVgVl2.js",
"houseplan-assets/zigbee-topology-runtime-C4WynS64.js"
"houseplan-assets/backdrop-pick-CAEOSiNJ.js",
"houseplan-assets/de-C_-FOd3R.js",
"houseplan-assets/editor-CuOqOWa_.js",
"houseplan-assets/form-kit.styles-ORjqyA2O.js",
"houseplan-assets/fr-BubWZSkS.js",
"houseplan-assets/furniture-plan-art.generated-Ci984yNn.js",
"houseplan-assets/houseplan-editor-runtime-B5TSesBb.js",
"houseplan-assets/houseplan-onboarding-runtime-BgE55y_R.js",
"houseplan-assets/hp-zigbee-topology-overlay-DQp1tIHa.js",
"houseplan-assets/iso-scene-render-DpO3ezuP.js",
"houseplan-assets/live-interaction-runtime-CPQNHLqJ.js",
"houseplan-assets/pdf-export-CFT_MzmM.js",
"houseplan-assets/summary-panel-runtime-loaded-BzQmPxkY.js",
"houseplan-assets/zigbee-topology-BIziY8_4.js",
"houseplan-assets/zigbee-topology-runtime-Sxlr6W0z.js"
],
"lazyGzipBytes": 460916,
"lazyGzipBytes": 461471,
"lazyEditorFiles": [
"houseplan-assets/backdrop-pick-YbdnEEmM.js",
"houseplan-assets/editor-Dv3uqeSS.js",
"houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"houseplan-assets/furniture-plan-art.generated-YwpfkuFp.js",
"houseplan-assets/houseplan-editor-runtime--nYeDmTG.js",
"houseplan-assets/zigbee-topology-CXRVgVl2.js"
"houseplan-assets/backdrop-pick-CAEOSiNJ.js",
"houseplan-assets/editor-CuOqOWa_.js",
"houseplan-assets/form-kit.styles-ORjqyA2O.js",
"houseplan-assets/furniture-plan-art.generated-Ci984yNn.js",
"houseplan-assets/houseplan-editor-runtime-B5TSesBb.js",
"houseplan-assets/zigbee-topology-BIziY8_4.js"
],
"lazyEditorGzipBytes": 244420,
"lazyEditorGzipBytes": 244976,
"lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-YbdnEEmM.js",
"houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"houseplan-assets/houseplan-onboarding-runtime-zgKhvtTD.js"
"houseplan-assets/backdrop-pick-CAEOSiNJ.js",
"houseplan-assets/form-kit.styles-ORjqyA2O.js",
"houseplan-assets/houseplan-onboarding-runtime-BgE55y_R.js"
],
"lazyOnboardingGzipBytes": 34521,
"lazyOnboardingGzipBytes": 34523,
"lazyLocaleFiles": [
"houseplan-assets/de-CjsIUY-d.js",
"houseplan-assets/fr-D2W98VDc.js"
"houseplan-assets/de-C_-FOd3R.js",
"houseplan-assets/fr-BubWZSkS.js"
],
"lazyLocaleGzipBytes": 55255,
"lazyLocaleGzipBytes": 55257,
"lazyIsometricFiles": [
"houseplan-assets/iso-scene-render-3HN3TF4R.js"
"houseplan-assets/iso-scene-render-DpO3ezuP.js"
],
"lazyIsometricGzipBytes": 17640,
"lazyFurnitureArtFiles": [
"houseplan-assets/furniture-plan-art.generated-YwpfkuFp.js"
"houseplan-assets/furniture-plan-art.generated-Ci984yNn.js"
],
"lazyFurnitureArtGzipBytes": 16940,
"lazyPdfFiles": [
"houseplan-assets/furniture-plan-art.generated-YwpfkuFp.js",
"houseplan-assets/pdf-export-DKVHRlMO.js"
"houseplan-assets/furniture-plan-art.generated-Ci984yNn.js",
"houseplan-assets/pdf-export-CFT_MzmM.js"
],
"lazyPdfGzipBytes": 126827,
"lazyPdfGzipBytes": 126826,
"files": [
{
"path": "houseplan-assets/backdrop-pick-YbdnEEmM.js",
"sha256": "07acc6fc3e12ba2fe3e1b07e19a3f57308a0834a03db3c01bdba22ea43b9a7fd",
"path": "houseplan-assets/backdrop-pick-CAEOSiNJ.js",
"sha256": "37be8583306fa604aed0f7f79f7a6c3eb8e373de8e5d476fb4593881b7954f93",
"rawBytes": 76524,
"gzipBytes": 24571,
"gzipBytes": 24572,
"isEntry": false,
"imports": [
"houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/form-kit.styles-ORjqyA2O.js",
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/de-CjsIUY-d.js",
"sha256": "25fa2d8f19df083532e8f022d86c21d290f3e79badaf7b4d058158c50a02286c",
"path": "houseplan-assets/de-C_-FOd3R.js",
"sha256": "033535ad61de5d4453c3b3729cf2afb69ed996267cbb83ebd2111b0ce6cad359",
"rawBytes": 92247,
"gzipBytes": 27864,
"gzipBytes": 27865,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/editor-Dv3uqeSS.js",
"sha256": "b1cdd26dec11ae7d904a675fbc27964757819886d1034ab63d2c9d91b42e3655",
"path": "houseplan-assets/editor-CuOqOWa_.js",
"sha256": "350885825a2046833dcef868485cae1efe99389d088fd502bd166d1ecc75b2a7",
"rawBytes": 3833,
"gzipBytes": 1583,
"gzipBytes": 1581,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"sha256": "aee7494545b43e2c932163c572b19483d9ac35c022daf437bcfd3aa21589aa07",
"path": "houseplan-assets/form-kit.styles-ORjqyA2O.js",
"sha256": "c6899e84bdfc9d83f635e63317260c6e3e0ae85104d966e0e297d56abcf45d91",
"rawBytes": 25600,
"gzipBytes": 5055,
"gzipBytes": 5056,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/fr-D2W98VDc.js",
"sha256": "12e70d1138d31d87f8c7f25d750bef3ecb7c84e23925845c101f0af4298208c0",
"path": "houseplan-assets/fr-BubWZSkS.js",
"sha256": "6243e53b2d25b50f23e7b8544cf24ae2634f3d985d0ebb05ad881628121693f4",
"rawBytes": 94579,
"gzipBytes": 27391,
"gzipBytes": 27392,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/furniture-plan-art.generated-YwpfkuFp.js",
"sha256": "63e67cda0c59f37fee93410ae4193ae79d730b83293eea331edefaf63e280d11",
"path": "houseplan-assets/furniture-plan-art.generated-Ci984yNn.js",
"sha256": "aac82444a5129c8991694a9a5421a63fc23479d41ed2cf44be2bba9cdb8bac38",
"rawBytes": 52035,
"gzipBytes": 16940,
"isEntry": false,
@@ -129,184 +129,184 @@
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-e9vxRZcR.js",
"sha256": "98c44bf6f915d6121132c133cc12b2e27ea344f1c8203e7af54741f317aa1a5e",
"rawBytes": 1022206,
"gzipBytes": 288647,
"path": "houseplan-assets/houseplan-card-C2ifrS7A.js",
"sha256": "6e2ecbe962122cfa7599c75e5ca8815d27c98b754cc437b7628b4ddafef10d9f",
"rawBytes": 1021428,
"gzipBytes": 288472,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-CjsIUY-d.js",
"houseplan-assets/editor-Dv3uqeSS.js",
"houseplan-assets/fr-D2W98VDc.js",
"houseplan-assets/furniture-plan-art.generated-YwpfkuFp.js",
"houseplan-assets/houseplan-editor-runtime--nYeDmTG.js",
"houseplan-assets/houseplan-onboarding-runtime-zgKhvtTD.js",
"houseplan-assets/hp-zigbee-topology-overlay-C5T09STo.js",
"houseplan-assets/iso-scene-render-3HN3TF4R.js",
"houseplan-assets/live-interaction-runtime-kRE37k2_.js",
"houseplan-assets/pdf-export-DKVHRlMO.js",
"houseplan-assets/summary-panel-runtime-loaded-aaGs9bci.js"
"houseplan-assets/de-C_-FOd3R.js",
"houseplan-assets/editor-CuOqOWa_.js",
"houseplan-assets/fr-BubWZSkS.js",
"houseplan-assets/furniture-plan-art.generated-Ci984yNn.js",
"houseplan-assets/houseplan-editor-runtime-B5TSesBb.js",
"houseplan-assets/houseplan-onboarding-runtime-BgE55y_R.js",
"houseplan-assets/hp-zigbee-topology-overlay-DQp1tIHa.js",
"houseplan-assets/iso-scene-render-DpO3ezuP.js",
"houseplan-assets/live-interaction-runtime-CPQNHLqJ.js",
"houseplan-assets/pdf-export-CFT_MzmM.js",
"houseplan-assets/summary-panel-runtime-loaded-BzQmPxkY.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime--nYeDmTG.js",
"sha256": "f476a861b5a2d77cd2ecea724c57d4e9e6dce6fa161eb18cc9479d2ec9752641",
"rawBytes": 678218,
"gzipBytes": 188846,
"path": "houseplan-assets/houseplan-editor-runtime-B5TSesBb.js",
"sha256": "7bad833f2fd60af11c8411e56b97431c71ee3e4fff685de3019a9ac14e5bc1ba",
"rawBytes": 678531,
"gzipBytes": 189399,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-YbdnEEmM.js",
"houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"houseplan-assets/furniture-plan-art.generated-YwpfkuFp.js",
"houseplan-assets/houseplan-card-e9vxRZcR.js",
"houseplan-assets/zigbee-topology-CXRVgVl2.js"
"houseplan-assets/backdrop-pick-CAEOSiNJ.js",
"houseplan-assets/form-kit.styles-ORjqyA2O.js",
"houseplan-assets/furniture-plan-art.generated-Ci984yNn.js",
"houseplan-assets/houseplan-card-C2ifrS7A.js",
"houseplan-assets/zigbee-topology-BIziY8_4.js"
],
"dynamicImports": [
"houseplan-assets/zigbee-topology-runtime-C4WynS64.js"
"houseplan-assets/zigbee-topology-runtime-Sxlr6W0z.js"
]
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-zgKhvtTD.js",
"sha256": "5613ece2554c3ee9afc3e71dce63370d3e0bbeab9489e297ffaee74f33670e6f",
"path": "houseplan-assets/houseplan-onboarding-runtime-BgE55y_R.js",
"sha256": "1a16adf7c3ab18db3a9773930103843470acdeb2fde3870110c20a069cd28876",
"rawBytes": 15986,
"gzipBytes": 4895,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-YbdnEEmM.js",
"houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/backdrop-pick-CAEOSiNJ.js",
"houseplan-assets/form-kit.styles-ORjqyA2O.js",
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/hp-zigbee-topology-overlay-C5T09STo.js",
"sha256": "d836d918b89ee5685f7d2d10b194cf17feb7ca956c2112c78c4d62db7042ef24",
"path": "houseplan-assets/hp-zigbee-topology-overlay-DQp1tIHa.js",
"sha256": "13cf97cdc63e8b66108521655d6e4585452fcf02ce9f4fc0b0bf19c13cc6f099",
"rawBytes": 10759,
"gzipBytes": 3686,
"gzipBytes": 3685,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js",
"houseplan-assets/zigbee-topology-CXRVgVl2.js",
"houseplan-assets/zigbee-topology-runtime-C4WynS64.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js",
"houseplan-assets/zigbee-topology-BIziY8_4.js",
"houseplan-assets/zigbee-topology-runtime-Sxlr6W0z.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/iso-scene-render-3HN3TF4R.js",
"sha256": "0c1137699d170125b0b3a6a7dd5177a06e270d74e8b3020711c100b4c59bbe0d",
"path": "houseplan-assets/iso-scene-render-DpO3ezuP.js",
"sha256": "c979378b329bca0dbd23ddbae6ca2cad763bb5754959e9b98f395197d915a8b5",
"rawBytes": 51983,
"gzipBytes": 17640,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/live-interaction-runtime-kRE37k2_.js",
"sha256": "e0537b8b7d78df3e70208e5601b95b538509265184027a62b559c43626372385",
"path": "houseplan-assets/live-interaction-runtime-CPQNHLqJ.js",
"sha256": "10e83f4eb0bdf1e4b0b0a4c9e377ade059bf5169488fa360821625a4df4bc91f",
"rawBytes": 8216,
"gzipBytes": 3203,
"gzipBytes": 3206,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/pdf-export-DKVHRlMO.js",
"sha256": "fef91b049f58622de45132f31b3ab7f606df5db8eee3fc68d3809b2c5ece7e5d",
"path": "houseplan-assets/pdf-export-CFT_MzmM.js",
"sha256": "03ee0fc3e88bc84e94c1a51fadc2e65a17635ba53ed875f1cdb794c3eb989106",
"rawBytes": 236264,
"gzipBytes": 109887,
"gzipBytes": 109886,
"isEntry": false,
"imports": [
"houseplan-assets/furniture-plan-art.generated-YwpfkuFp.js",
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/furniture-plan-art.generated-Ci984yNn.js",
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/summary-panel-editor-Bj45k8M3.js",
"sha256": "1463acf70394eb7c8fc09b8182b227648b00919bb2fc5ad6a6ae189b1a051a2e",
"path": "houseplan-assets/summary-panel-editor-11x1Zz63.js",
"sha256": "2d4be3e90f3c0329c33b6465d57c82fc2ba93e30097838cd042c69f0cc0f08be",
"rawBytes": 14862,
"gzipBytes": 3423,
"gzipBytes": 3426,
"isEntry": false,
"imports": [
"houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"houseplan-assets/houseplan-card-e9vxRZcR.js",
"houseplan-assets/summary-panel-runtime-loaded-aaGs9bci.js"
"houseplan-assets/form-kit.styles-ORjqyA2O.js",
"houseplan-assets/houseplan-card-C2ifrS7A.js",
"houseplan-assets/summary-panel-runtime-loaded-BzQmPxkY.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/summary-panel-metrics-3K7HlQXp.js",
"sha256": "246a3ee30014c9096527044921c104b76cef9555ebd1b2fbfcaeea54daf010cc",
"path": "houseplan-assets/summary-panel-metrics-BwUdppyx.js",
"sha256": "5dbb467356ea155e5d4dee21c562cbfdf0a763b93d728f8227f7731b91837068",
"rawBytes": 2611,
"gzipBytes": 1306,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/summary-panel-runtime-loaded-aaGs9bci.js",
"sha256": "527c40315a7cbbfa84289d6c8360688df121f368bf2609488e0b3b527ed2988a",
"path": "houseplan-assets/summary-panel-runtime-loaded-BzQmPxkY.js",
"sha256": "6e0e9808f1da372aef041d74e46c91e29d2d5fd98a9fbe24ee54debe58c06ee3",
"rawBytes": 72637,
"gzipBytes": 20166,
"gzipBytes": 20163,
"isEntry": false,
"imports": [
"houseplan-assets/form-kit.styles-Dlhk9WKB.js",
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/form-kit.styles-ORjqyA2O.js",
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": [
"houseplan-assets/summary-panel-editor-Bj45k8M3.js",
"houseplan-assets/summary-panel-metrics-3K7HlQXp.js"
"houseplan-assets/summary-panel-editor-11x1Zz63.js",
"houseplan-assets/summary-panel-metrics-BwUdppyx.js"
]
},
{
"path": "houseplan-assets/zigbee-topology-CXRVgVl2.js",
"sha256": "a68916a24db8c6acc389707ad40f95d8963d4521e40c09e6fa32b6430584569a",
"path": "houseplan-assets/zigbee-topology-BIziY8_4.js",
"sha256": "be1428736b1fcd653bec4a452d4895d8cfea015cc143b8560f5c6065c8b6ffea",
"rawBytes": 18962,
"gzipBytes": 7425,
"gzipBytes": 7428,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/zigbee-topology-runtime-C4WynS64.js",
"sha256": "598d78eb03a6b75e7bf9ce8ac7fdbc7ee514d6c7f056e8651309c541313ced0e",
"path": "houseplan-assets/zigbee-topology-runtime-Sxlr6W0z.js",
"sha256": "af36ce4a7b2e9b6992e2c74a19e63f197a1960317fad3bb8f193d93ccccb84b8",
"rawBytes": 3942,
"gzipBytes": 1764,
"gzipBytes": 1763,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js",
"houseplan-assets/zigbee-topology-CXRVgVl2.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js",
"houseplan-assets/zigbee-topology-BIziY8_4.js"
],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "ff5753ceb4dce57c6f1701baad303c37770735cb53b2a61c14e1225e07ac898b",
"sha256": "9a30c8176149f7b6b78431e5f876dd8ab3f86676bf31ecfbd8952821812a46ed",
"rawBytes": 1205,
"gzipBytes": 802,
"gzipBytes": 801,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
},
{
"path": "houseplan-panel.js",
"sha256": "90fb829ea2a8310205a7bc7c8d5d57bd38eedb0d62c961eed13d3bc3119b011a",
"sha256": "e712ffa4a818f355510e4eee5ed9438c6f89ac60797f0838bba4b2298cb35d24",
"rawBytes": 6165,
"gzipBytes": 2324,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-e9vxRZcR.js"
"houseplan-assets/houseplan-card-C2ifrS7A.js"
],
"dynamicImports": []
}
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="be980214e65258ad0c8ec0480b3b70c46a1e6f817bba2cda8d2f16c104021db6";import{A as e,c as a,s as t,l as i,d as n,ap as s,h as r,j as o,g as l,dH as c,dI as p,dJ as d,cL as h,dK as u,cK as m,dL as g,cQ as _,cP as b,dM as f,bs as v,br as w,bt as y,av as k,aC as $,aD as x,dN as S}from"./houseplan-card-e9vxRZcR.js";import{c as C,f as M,C as L}from"./form-kit.styles-Dlhk9WKB.js";const z=C+M(L,{withSwitch:!1}),P=new WeakSet;let D=null;function T(e){const a=e.renderRoot;if(!a||P.has(a))return;const t=a.ownerDocument??globalThis.document,i=t?.defaultView?.CSSStyleSheet;if(i&&"adoptedStyleSheets"in a)return D||(D=new i,D.replaceSync(z)),a.adoptedStyleSheets=[...a.adoptedStyleSheets,D],void P.add(a);if(a.querySelector("style[data-hp-form-kit]"))return void P.add(a);const n=t.createElement("style");n.dataset.hpFormKit="true",n.textContent=z,a.appendChild(n),P.add(a)}function H({title:t,help:i,body:n,id:s}){return a`<section class="hpf-card" data-card=${s??e}>
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d85694de8aee015f4930ff31f4c2022c14e45b0ad38f1dd1e723229f27f1e7b1";import{A as e,c as a,s as t,l as i,d as n,ap as s,h as r,j as o,g as l,dH as c,dI as p,dJ as d,cN as h,dK as u,cM as m,dL as g,cS as _,cR as b,dM as f,bt as v,bs as w,bu as y,av as k,aC as $,aD as x,dN as S}from"./houseplan-card-C2ifrS7A.js";import{c as C,f as M,C as L}from"./form-kit.styles-ORjqyA2O.js";const z=C+M(L,{withSwitch:!1}),P=new WeakSet;let D=null;function T(e){const a=e.renderRoot;if(!a||P.has(a))return;const t=a.ownerDocument??globalThis.document,i=t?.defaultView?.CSSStyleSheet;if(i&&"adoptedStyleSheets"in a)return D||(D=new i,D.replaceSync(z)),a.adoptedStyleSheets=[...a.adoptedStyleSheets,D],void P.add(a);if(a.querySelector("style[data-hp-form-kit]"))return void P.add(a);const n=t.createElement("style");n.dataset.hpFormKit="true",n.textContent=z,a.appendChild(n),P.add(a)}function H({title:t,help:i,body:n,id:s}){return a`<section class="hpf-card" data-card=${s??e}>
${t?a`<div class="hpf-head"><h3>${t}</h3>${i??e}</div>`:e}
<div class="hpf-body">${n}</div>
</section>`}function E({title:t,help:i}){return a`<div class="hpf-sub"><h4>${t}</h4>${i??e}</div>`}function F({label:t,htmlFor:i,help:n,control:s,hint:r,error:o}){return a`<div class="hpf-field">
File diff suppressed because one or more lines are too long
@@ -1,14 +1,14 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="be980214e65258ad0c8ec0480b3b70c46a1e6f817bba2cda8d2f16c104021db6";import{aD as e,l as o,aG as t,ee as s,A as a,ef as i,eg as l,eh as n,E as r,c}from"./houseplan-card-e9vxRZcR.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d85694de8aee015f4930ff31f4c2022c14e45b0ad38f1dd1e723229f27f1e7b1";import{aD as e,l as o,aG as t,ee as s,A as a,ef as i,eg as l,eh as n,E as r,c}from"./houseplan-card-C2ifrS7A.js";class f extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,f={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},h=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
.hass=${this.hass}
.data=${this._formData}
.schema=${e}
.computeLabel=${e=>h[e.name]||e.name}
.computeLabel=${e=>f[e.name]||e.name}
@value-changed=${this._valueChanged}
></ha-form>`;return c`
${d(f.slice(0,3))}
${d(h.slice(0,3))}
${_?c`<div class="default-floor-error" role="alert"
style="color:var(--error-color,#db4437);margin:-4px 0 12px;overflow-wrap:anywhere">
${t(s,"editor.default_floor_missing",{id:_})}
</div>`:a}
${d(f.slice(3))}
`}_valueChanged(e){const o={...this._config,...e.detail.value};""===o.floor?delete o.floor:o.floor===this._floorToken&&(o.floor=this._config?.floor);const t=new Event("config-changed",{bubbles:!0,composed:!0});t.detail={config:o},this.dispatchEvent(t)}}h.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",h);
${d(h.slice(3))}
`}_valueChanged(e){const o={...this._config,...e.detail.value};""===o.floor?delete o.floor:o.floor===this._floorToken&&(o.floor=this._config?.floor);const t=new Event("config-changed",{bubbles:!0,composed:!0});t.detail={config:o},this.dispatchEvent(t)}}f.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",f);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="be980214e65258ad0c8ec0480b3b70c46a1e6f817bba2cda8d2f16c104021db6";import{c as a,A as e}from"./houseplan-card-e9vxRZcR.js";import{s,n as t,a as l,m as r,b as o,c as i,d as u}from"./summary-panel-runtime-loaded-aaGs9bci.js";import"./form-kit.styles-Dlhk9WKB.js";const m=m=>{const{host:c,dialog:d,problems:n,t:b}=m,y=n.find(a=>"error"===a.kind),$=d.localShow!==d.baseLocalShow||!d.localOnly&&!s(t(d.draft),d.base),p=$&&!d.busy&&!y,v=a=>n.find(e=>e.path===a),h=a=>a?b(`summary.problem.${a.code}`):"",k=()=>m.close(),g=a`<label class="summary-switch" for="summary-local-show">
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d85694de8aee015f4930ff31f4c2022c14e45b0ad38f1dd1e723229f27f1e7b1";import{c as a,A as e}from"./houseplan-card-C2ifrS7A.js";import{s,n as t,a as l,m as r,b as o,c as i,d as u}from"./summary-panel-runtime-loaded-BzQmPxkY.js";import"./form-kit.styles-ORjqyA2O.js";const m=m=>{const{host:c,dialog:d,problems:n,t:b}=m,y=n.find(a=>"error"===a.kind),$=d.localShow!==d.baseLocalShow||!d.localOnly&&!s(t(d.draft),d.base),p=$&&!d.busy&&!y,v=a=>n.find(e=>e.path===a),h=a=>a?b(`summary.problem.${a.code}`):"",k=()=>m.close(),g=a`<label class="summary-switch" for="summary-local-show">
<span class="summary-switch-caption"><strong>${b("summary.show_local")}</strong>
<small id="summary-local-show-hint">${b("summary.show_local_hint")}</small></span>
<input id="summary-local-show" data-summary-local-show type="checkbox"
@@ -1 +0,0 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="be980214e65258ad0c8ec0480b3b70c46a1e6f817bba2cda8d2f16c104021db6";import{ek as e,N as t,a$ as n,L as i,ae as o,ac as r,bT as s,bS as a,a_ as c,aZ as l,b0 as d,el as u,em as f,bV as m,en as g}from"./houseplan-card-e9vxRZcR.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=d(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const o=String(i.binding||"").indexOf(":");if(o<1)continue;const r=i.binding.slice(0,o),s=i.binding.slice(o+1),a="device"===r?e.registry.devices?.[s]:null,c="entity"===r?e.registry.entities?.[s]:null,l="device"===r?s:c?.device_id,d="device"===r?a?.area_id:c?.area_id||l&&e.registry.devices?.[l]?.area_id,u="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||d||"",f=u&&e.areaToSpace[u]||i.space||e.firstSpaceId;l&&e.registry.devices?.[l]&&e.spaceIds.has(f)&&(!n.devices.has(l)||"entity"===r&&n.liveEntities.has(s))&&t.add(l)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=c(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,o,r);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:l(e.rooms,t.walls,t.openCuts,i,t.cellCm,o,r)}}function*b(c,l,d=_){try{let u=0;for(const f of l){const l=c.spaces.find(e=>String(e?.id)===f.id);if(!l)continue;const m=e(l,f),g=d(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const c=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,o,r,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(c,m.physicalBodies)),yield}const _=m.cellCm/o;u+=a(v)*_*_/1e4}return u}catch{return null}}function h(e,t,n=_){const i=b(e,t,n);let o=i.next();for(;!o.done;)o=i.next();return o.value}function p(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=u(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{b as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,p as summarySystemValue,h as totalCleanFloorAreaM2};
@@ -0,0 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d85694de8aee015f4930ff31f4c2022c14e45b0ad38f1dd1e723229f27f1e7b1";import{ek as e,N as t,a$ as n,L as i,ae as o,ac as r,bV as s,bU as a,a_ as l,aZ as c,b0 as d,el as u,em as f,bX as m,en as g}from"./houseplan-card-C2ifrS7A.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=d(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const o=String(i.binding||"").indexOf(":");if(o<1)continue;const r=i.binding.slice(0,o),s=i.binding.slice(o+1),a="device"===r?e.registry.devices?.[s]:null,l="entity"===r?e.registry.entities?.[s]:null,c="device"===r?s:l?.device_id,d="device"===r?a?.area_id:l?.area_id||c&&e.registry.devices?.[c]?.area_id,u="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||d||"",f=u&&e.areaToSpace[u]||i.space||e.firstSpaceId;c&&e.registry.devices?.[c]&&e.spaceIds.has(f)&&(!n.devices.has(c)||"entity"===r&&n.liveEntities.has(s))&&t.add(c)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=l(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,o,r);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:c(e.rooms,t.walls,t.openCuts,i,t.cellCm,o,r)}}function*h(l,c,d=_){try{let u=0;for(const f of c){const c=l.spaces.find(e=>String(e?.id)===f.id);if(!c)continue;const m=e(c,f),g=d(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const l=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,o,r,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(l,m.physicalBodies)),yield}const _=m.cellCm/o;u+=a(v)*_*_/1e4}return u}catch{return null}}function p(e,t,n=_){const i=h(e,t,n);let o=i.next();for(;!o.done;)o=i.next();return o.value}function b(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=u(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{h as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,b as summarySystemValue,p as totalCleanFloorAreaM2};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="be980214e65258ad0c8ec0480b3b70c46a1e6f817bba2cda8d2f16c104021db6";import{n as t,b as n}from"./zigbee-topology-CXRVgVl2.js";import{aM as e}from"./houseplan-card-e9vxRZcR.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function m(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function g(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{f=t,g=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&b.push(p),await m(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await m(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d85694de8aee015f4930ff31f4c2022c14e45b0ad38f1dd1e723229f27f1e7b1";import{n as t,b as n}from"./zigbee-topology-BIziY8_4.js";import{aM as e}from"./houseplan-card-C2ifrS7A.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function f(t){if(!0!==t?.user?.is_admin)throw a("permission")}function p(n){const e=i(n);return e?c(e,"zha",async()=>{if(f(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function m(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function g(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(f(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,p=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{p=t,g=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const f=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&p?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof f&&b.push(f),await m(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await m(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{p as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
+1 -1
View File
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="be980214e65258ad0c8ec0480b3b70c46a1e6f817bba2cda8d2f16c104021db6";try{await import("./houseplan-assets/houseplan-card-e9vxRZcR.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale houseplan-card.js: the implementation chunk is unavailable",e)}
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d85694de8aee015f4930ff31f4c2022c14e45b0ad38f1dd1e723229f27f1e7b1";try{await import("./houseplan-assets/houseplan-card-C2ifrS7A.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale houseplan-card.js: the implementation chunk is unavailable",e)}
+1 -1
View File
File diff suppressed because one or more lines are too long