sldeditor 0.27.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/OneLineEditor.d.ts +5 -1
  2. package/dist/OneLineEditor.d.ts.map +1 -1
  3. package/dist/canvas/CanvasSvg.d.ts.map +1 -1
  4. package/dist/canvas/ElementHoverLabel.d.ts.map +1 -1
  5. package/dist/canvas/HealthLayer.d.ts +11 -0
  6. package/dist/canvas/HealthLayer.d.ts.map +1 -0
  7. package/dist/canvas/fit-to-content.d.ts +6 -0
  8. package/dist/canvas/fit-to-content.d.ts.map +1 -1
  9. package/dist/compiler/compile.d.ts.map +1 -1
  10. package/dist/components/HealthPanel.d.ts +8 -0
  11. package/dist/components/HealthPanel.d.ts.map +1 -0
  12. package/dist/components/PropertyPanel.d.ts.map +1 -1
  13. package/dist/components/ViewToolbar.d.ts.map +1 -1
  14. package/dist/health/check.d.ts +78 -0
  15. package/dist/health/check.d.ts.map +1 -0
  16. package/dist/health/index.d.ts +3 -0
  17. package/dist/health/index.d.ts.map +1 -0
  18. package/dist/health/present.d.ts +19 -0
  19. package/dist/health/present.d.ts.map +1 -0
  20. package/dist/health/roles.d.ts +42 -0
  21. package/dist/health/roles.d.ts.map +1 -0
  22. package/dist/health/use-health.d.ts +8 -0
  23. package/dist/health/use-health.d.ts.map +1 -0
  24. package/dist/hooks/use-host-actions.d.ts +11 -0
  25. package/dist/hooks/use-host-actions.d.ts.map +1 -1
  26. package/dist/hooks/use-panels.d.ts +8 -0
  27. package/dist/hooks/use-panels.d.ts.map +1 -1
  28. package/dist/i18n/library.d.ts.map +1 -1
  29. package/dist/i18n/locales/ar.d.ts +1 -1
  30. package/dist/i18n/locales/ar.d.ts.map +1 -1
  31. package/dist/i18n/locales/de.d.ts +1 -1
  32. package/dist/i18n/locales/de.d.ts.map +1 -1
  33. package/dist/i18n/locales/es.d.ts +1 -1
  34. package/dist/i18n/locales/es.d.ts.map +1 -1
  35. package/dist/i18n/locales/fa.d.ts +1 -1
  36. package/dist/i18n/locales/fa.d.ts.map +1 -1
  37. package/dist/i18n/locales/fr.d.ts +1 -1
  38. package/dist/i18n/locales/fr.d.ts.map +1 -1
  39. package/dist/i18n/locales/he.d.ts +1 -1
  40. package/dist/i18n/locales/he.d.ts.map +1 -1
  41. package/dist/i18n/locales/index.d.ts +9 -9
  42. package/dist/i18n/locales/ja.d.ts +1 -1
  43. package/dist/i18n/locales/ja.d.ts.map +1 -1
  44. package/dist/i18n/locales/pt.d.ts +1 -1
  45. package/dist/i18n/locales/pt.d.ts.map +1 -1
  46. package/dist/i18n/locales/ru.d.ts +1 -1
  47. package/dist/i18n/locales/ru.d.ts.map +1 -1
  48. package/dist/i18n/messages.d.ts +213 -9
  49. package/dist/i18n/messages.d.ts.map +1 -1
  50. package/dist/index.d.ts +3 -0
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/lib/kind-families.d.ts +39 -0
  53. package/dist/lib/kind-families.d.ts.map +1 -0
  54. package/dist/model/types.d.ts +7 -0
  55. package/dist/model/types.d.ts.map +1 -1
  56. package/dist/sldeditor.cjs +63 -58
  57. package/dist/sldeditor.cjs.map +1 -1
  58. package/dist/sldeditor.js +10470 -8453
  59. package/dist/sldeditor.js.map +1 -1
  60. package/dist/store/store.d.ts +12 -0
  61. package/dist/store/store.d.ts.map +1 -1
  62. package/dist/style.css +1 -1
  63. package/package.json +1 -1
@@ -1,234 +1,239 @@
1
- "use strict";var GS=Object.defineProperty;var VS=(e,t,n)=>t in e?GS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qe=(e,t,n)=>VS(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),C=require("react"),_s=require("react-dom");function KS(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ee=KS(C);/**
1
+ "use strict";var OC=Object.defineProperty;var RC=(e,t,n)=>t in e?OC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var lt=(e,t,n)=>RC(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),$=require("react"),Hi=require("react-dom");function LC(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const qe=LC($);/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const XS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cs=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();/**
6
+ */const BC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Fi=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();/**
7
7
  * @license lucide-react v0.469.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */var US={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
11
+ */var HC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12
12
  * @license lucide-react v0.469.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const YS=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:i,iconNode:s,...l},a)=>C.createElement("svg",{ref:a,...US,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Cs("lucide",r),...l},[...s.map(([d,u])=>C.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
16
+ */const FC=$.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:a,iconNode:i,...l},s)=>$.createElement("svg",{ref:s,...HC,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Fi("lucide",r),...l},[...i.map(([d,u])=>$.createElement(d,u)),...Array.isArray(a)?a:[a]]));/**
17
17
  * @license lucide-react v0.469.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const se=(e,t)=>{const n=C.forwardRef(({className:o,...r},i)=>C.createElement(YS,{ref:i,iconNode:t,className:Cs(`lucide-${XS(e)}`,o),...r}));return n.displayName=`${e}`,n};/**
21
+ */const ge=(e,t)=>{const n=$.forwardRef(({className:o,...r},a)=>$.createElement(FC,{ref:a,iconNode:t,className:Fi(`lucide-${BC(e)}`,o),...r}));return n.displayName=`${e}`,n};/**
22
22
  * @license lucide-react v0.469.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const js=se("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/**
26
+ */const Wi=ge("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/**
27
27
  * @license lucide-react v0.469.0 - ISC
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
- */const ZS=se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
31
+ */const WC=ge("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
32
32
  * @license lucide-react v0.469.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */const As=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
36
+ */const qi=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
37
37
  * @license lucide-react v0.469.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
- */const QS=se("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
41
+ */const qC=ge("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
42
42
  * @license lucide-react v0.469.0 - ISC
43
43
  *
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
- */const JS=se("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
46
+ */const VC=ge("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
47
47
  * @license lucide-react v0.469.0 - ISC
48
48
  *
49
49
  * This source code is licensed under the ISC license.
50
50
  * See the LICENSE file in the root directory of this source tree.
51
- */const $s=se("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
51
+ */const Vi=ge("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
52
52
  * @license lucide-react v0.469.0 - ISC
53
53
  *
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const Es=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
56
+ */const Gi=ge("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
57
57
  * @license lucide-react v0.469.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
- */const e_=se("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
61
+ */const GC=ge("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
62
62
  * @license lucide-react v0.469.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
- */const Ro=se("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
66
+ */const tr=ge("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
67
67
  * @license lucide-react v0.469.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
71
- */const t_=se("FileBox",[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]]);/**
71
+ */const KC=ge("FileBox",[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]]);/**
72
72
  * @license lucide-react v0.469.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
- */const n_=se("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
76
+ */const UC=ge("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
77
77
  * @license lucide-react v0.469.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
- */const o_=se("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
81
+ */const XC=ge("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
82
82
  * @license lucide-react v0.469.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
- */const r_=se("FileType",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]]);/**
86
+ */const YC=ge("FileType",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]]);/**
87
87
  * @license lucide-react v0.469.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const Ns=se("FlipHorizontal",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3",key:"1i73f7"}],["path",{d:"M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3",key:"saxlbk"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 2v2",key:"tus03m"}]]);/**
91
+ */const Ki=ge("FlipHorizontal",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3",key:"1i73f7"}],["path",{d:"M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3",key:"saxlbk"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 2v2",key:"tus03m"}]]);/**
92
92
  * @license lucide-react v0.469.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const Gr=se("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
96
+ */const la=ge("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
97
97
  * @license lucide-react v0.469.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const i_=se("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/**
101
+ */const ZC=ge("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/**
102
102
  * @license lucide-react v0.469.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
- */const s_=se("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
106
+ */const QC=ge("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
107
107
  * @license lucide-react v0.469.0 - ISC
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const Hn=se("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
111
+ */const ao=ge("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
112
112
  * @license lucide-react v0.469.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
- */const Ts=se("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
116
+ */const Ui=ge("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
117
117
  * @license lucide-react v0.469.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
120
120
  * See the LICENSE file in the root directory of this source tree.
121
- */const a_=se("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
121
+ */const JC=ge("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
122
122
  * @license lucide-react v0.469.0 - ISC
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
- */const lr=se("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
126
+ */const $r=ge("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
127
127
  * @license lucide-react v0.469.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
- */const l_=se("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);/**
131
+ */const ej=ge("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);/**
132
132
  * @license lucide-react v0.469.0 - ISC
133
133
  *
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
- */const c_=se("PanelBottomClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"m15 8-3 3-3-3",key:"1oxy1z"}]]);/**
136
+ */const tj=ge("PanelBottomClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"m15 8-3 3-3-3",key:"1oxy1z"}]]);/**
137
137
  * @license lucide-react v0.469.0 - ISC
138
138
  *
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
- */const Is=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
141
+ */const Xi=ge("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
142
142
  * @license lucide-react v0.469.0 - ISC
143
143
  *
144
144
  * This source code is licensed under the ISC license.
145
145
  * See the LICENSE file in the root directory of this source tree.
146
- */const cr=se("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
146
+ */const Ar=ge("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
147
147
  * @license lucide-react v0.469.0 - ISC
148
148
  *
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
- */const Ps=se("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
151
+ */const Yi=ge("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
152
152
  * @license lucide-react v0.469.0 - ISC
153
153
  *
154
154
  * This source code is licensed under the ISC license.
155
155
  * See the LICENSE file in the root directory of this source tree.
156
- */const Vr=se("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
156
+ */const ca=ge("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
157
157
  * @license lucide-react v0.469.0 - ISC
158
158
  *
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
- */const zs=se("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
161
+ */const Zi=ge("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
162
162
  * @license lucide-react v0.469.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
- */const d_=se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
166
+ */const nj=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
167
167
  * @license lucide-react v0.469.0 - ISC
168
168
  *
169
169
  * This source code is licensed under the ISC license.
170
170
  * See the LICENSE file in the root directory of this source tree.
171
- */const Ms=se("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
171
+ */const Qi=ge("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
172
172
  * @license lucide-react v0.469.0 - ISC
173
173
  *
174
174
  * This source code is licensed under the ISC license.
175
175
  * See the LICENSE file in the root directory of this source tree.
176
- */const u_=se("Slash",[["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
176
+ */const oj=ge("Slash",[["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
177
177
  * @license lucide-react v0.469.0 - ISC
178
178
  *
179
179
  * This source code is licensed under the ISC license.
180
180
  * See the LICENSE file in the root directory of this source tree.
181
- */const m_=se("Spline",[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]]);/**
181
+ */const rj=ge("Spline",[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]]);/**
182
182
  * @license lucide-react v0.469.0 - ISC
183
183
  *
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
- */const p_=se("SquareDashed",[["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M21 19a2 2 0 0 1-2 2",key:"1j7049"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h1",key:"15o7lz"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v1",key:"mxsmne"}],["path",{d:"M3 14v1",key:"vnatye"}],["path",{d:"M21 14v1",key:"169vum"}]]);/**
186
+ */const aj=ge("SquareDashed",[["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M21 19a2 2 0 0 1-2 2",key:"1j7049"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h1",key:"15o7lz"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v1",key:"mxsmne"}],["path",{d:"M3 14v1",key:"vnatye"}],["path",{d:"M21 14v1",key:"169vum"}]]);/**
187
187
  * @license lucide-react v0.469.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
- */const h_=se("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
191
+ */const ij=ge("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
192
192
  * @license lucide-react v0.469.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const f_=se("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
196
+ */const sj=ge("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
197
197
  * @license lucide-react v0.469.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
- */const Ds=se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
201
+ */const lj=ge("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
202
202
  * @license lucide-react v0.469.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
- */const Rs=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
206
+ */const Ji=ge("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
207
207
  * @license lucide-react v0.469.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
210
210
  * See the LICENSE file in the root directory of this source tree.
211
- */const Fn=se("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
211
+ */const es=ge("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
212
212
  * @license lucide-react v0.469.0 - ISC
213
213
  *
214
214
  * This source code is licensed under the ISC license.
215
215
  * See the LICENSE file in the root directory of this source tree.
216
- */const Qt=se("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
216
+ */const io=ge("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
217
217
  * @license lucide-react v0.469.0 - ISC
218
218
  *
219
219
  * This source code is licensed under the ISC license.
220
220
  * See the LICENSE file in the root directory of this source tree.
221
- */const Jn=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Os(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Os(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Ls(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Os(e))&&(o&&(o+=" "),o+=t);return o}const dr="-",g_=e=>{const t=y_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const l=s.split(dr);return l[0]===""&&l.length!==1&&l.shift(),Bs(l,t)||b_(s)},getConflictingClassGroupIds:(s,l)=>{const a=n[s]||[];return l&&o[s]?[...a,...o[s]]:a}}},Bs=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Bs(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(dr);return(s=t.validators.find(({validator:l})=>l(i)))==null?void 0:s.classGroupId},Kr=/^\[(.+)\]$/,b_=e=>{if(Kr.test(e)){const t=Kr.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},y_=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return w_(Object.entries(e.classGroups),n).forEach(([i,s])=>{Oo(s,o,i,t)}),o},Oo=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:Xr(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(x_(r)){Oo(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{Oo(s,Xr(t,i),n,o)})})},Xr=(e,t)=>{let n=e;return t.split(dr).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},x_=e=>e.isThemeGetter,w_=(e,t)=>t?e.map(([n,o])=>{const r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,l])=>[t+s,l])):i);return[n,r]}):e,v_=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return r(i,s),s},set(i,s){n.has(i)?n.set(i,s):r(i,s)}}},Hs="!",k_=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],i=t.length,s=l=>{const a=[];let d=0,u=0,m;for(let b=0;b<l.length;b++){let y=l[b];if(d===0){if(y===r&&(o||l.slice(b,b+i)===t)){a.push(l.slice(u,b)),u=b+i;continue}if(y==="/"){m=b;continue}}y==="["?d++:y==="]"&&d--}const p=a.length===0?l:l.substring(u),h=p.startsWith(Hs),g=h?p.substring(1):p,f=m&&m>u?m-u:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:f}};return n?l=>n({className:l,parseClassName:s}):s},S_=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},__=e=>({cache:v_(e.cacheSize),parseClassName:k_(e),...g_(e)}),C_=/\s+/,j_=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(C_);let l="";for(let a=s.length-1;a>=0;a-=1){const d=s[a],{modifiers:u,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:h}=n(d);let g=!!h,f=o(g?p.substring(0,h):p);if(!f){if(!g){l=d+(l.length>0?" "+l:l);continue}if(f=o(p),!f){l=d+(l.length>0?" "+l:l);continue}g=!1}const b=S_(u).join(":"),y=m?b+Hs:b,v=y+f;if(i.includes(v))continue;i.push(v);const j=r(f,g);for(let S=0;S<j.length;++S){const N=j[S];i.push(y+N)}l=d+(l.length>0?" "+l:l)}return l};function A_(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Fs(t))&&(o&&(o+=" "),o+=n);return o}const Fs=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Fs(e[o]))&&(n&&(n+=" "),n+=t);return n};function $_(e,...t){let n,o,r,i=s;function s(a){const d=t.reduce((u,m)=>m(u),e());return n=__(d),o=n.cache.get,r=n.cache.set,i=l,l(a)}function l(a){const d=o(a);if(d)return d;const u=j_(a,n);return r(a,u),u}return function(){return i(A_.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ws=/^\[(?:([a-z-]+):)?(.+)\]$/i,E_=/^\d+\/\d+$/,N_=new Set(["px","full","screen"]),T_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,M_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qe=e=>Et(e)||N_.has(e)||E_.test(e),st=e=>It(e,"length",W_),Et=e=>!!e&&!Number.isNaN(Number(e)),wo=e=>It(e,"number",Et),qt=e=>!!e&&Number.isInteger(Number(e)),D_=e=>e.endsWith("%")&&Et(e.slice(0,-1)),oe=e=>Ws.test(e),at=e=>T_.test(e),R_=new Set(["length","size","percentage"]),O_=e=>It(e,R_,qs),L_=e=>It(e,"position",qs),B_=new Set(["image","url"]),H_=e=>It(e,B_,G_),F_=e=>It(e,"",q_),Gt=()=>!0,It=(e,t,n)=>{const o=Ws.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},W_=e=>I_.test(e)&&!P_.test(e),qs=()=>!1,q_=e=>z_.test(e),G_=e=>M_.test(e),V_=()=>{const e=we("colors"),t=we("spacing"),n=we("blur"),o=we("brightness"),r=we("borderColor"),i=we("borderRadius"),s=we("borderSpacing"),l=we("borderWidth"),a=we("contrast"),d=we("grayscale"),u=we("hueRotate"),m=we("invert"),p=we("gap"),h=we("gradientColorStops"),g=we("gradientColorStopPositions"),f=we("inset"),b=we("margin"),y=we("opacity"),v=we("padding"),j=we("saturate"),S=we("scale"),N=we("sepia"),W=we("skew"),ne=we("space"),pe=we("translate"),$=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",oe,t],V=()=>[oe,t],F=()=>["",Qe,st],K=()=>["auto",Et,oe],ie=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],he=()=>["solid","dashed","dotted","double","none"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>["start","end","center","between","around","evenly","stretch"],ce=()=>["","0",oe],be=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ce=()=>[Et,oe];return{cacheSize:500,separator:":",theme:{colors:[Gt],spacing:[Qe,st],blur:["none","",at,oe],brightness:Ce(),borderColor:[e],borderRadius:["none","","full",at,oe],borderSpacing:V(),borderWidth:F(),contrast:Ce(),grayscale:ce(),hueRotate:Ce(),invert:ce(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[D_,st],inset:H(),margin:H(),opacity:Ce(),padding:V(),saturate:Ce(),scale:Ce(),sepia:ce(),skew:Ce(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[at]}],"break-after":[{"break-after":be()}],"break-before":[{"break-before":be()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ie(),oe]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",qt,oe]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:ce()}],shrink:[{shrink:ce()}],order:[{order:["first","last","none",qt,oe]}],"grid-cols":[{"grid-cols":[Gt]}],"col-start-end":[{col:["auto",{span:["full",qt,oe]},oe]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[Gt]}],"row-start-end":[{row:["auto",{span:[qt,oe]},oe]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...fe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...fe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...fe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[ne]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ne]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[at]},at]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",at,st]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wo]}],"font-family":[{font:[Gt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",oe]}],"line-clamp":[{"line-clamp":["none",Et,wo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qe,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qe,st]}],"underline-offset":[{"underline-offset":["auto",Qe,oe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ie(),L_]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",O_]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},H_]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...he(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:he()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...he()]}],"outline-offset":[{"outline-offset":[Qe,oe]}],"outline-w":[{outline:[Qe,st]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Qe,st]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",at,F_]}],"shadow-color":[{shadow:[Gt]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...ae(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ae()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",at,oe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[m]}],saturate:[{saturate:[j]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:Ce()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:Ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[qt,oe]}],"translate-x":[{"translate-x":[pe]}],"translate-y":[{"translate-y":[pe]}],"skew-x":[{"skew-x":[W]}],"skew-y":[{"skew-y":[W]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qe,st,wo]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},K_=$_(V_);function Se(...e){return K_(Ls(e))}const Gs=C.createContext(null);function X_(){const e=C.useContext(Gs);if(!e)throw new Error("useContextMenu must be used inside <ContextMenuHost>");return e}const kn=8;function U_({children:e}){const[t,n]=C.useState({open:!1,x:0,y:0,items:[]}),[o,r]=C.useState(null),i=C.useRef(null),s=C.useCallback(()=>{n(d=>d.open?{...d,open:!1}:d)},[]),l=C.useCallback((d,u,m)=>{r(null),n({open:!0,x:d,y:u,items:m})},[]),a=C.useMemo(()=>({open:l,close:s}),[l,s]);return C.useLayoutEffect(()=>{if(!t.open||!i.current)return;const d=i.current.getBoundingClientRect();let u=t.x,m=t.y;u+d.width>window.innerWidth-kn&&(u=Math.max(kn,t.x-d.width)),m+d.height>window.innerHeight-kn&&(m=Math.max(kn,t.y-d.height)),r({left:u,top:m})},[t]),C.useEffect(()=>{if(!t.open)return;const d=h=>{i.current&&!i.current.contains(h.target)&&s()},u=h=>{h.key==="Escape"&&(h.preventDefault(),s())},m=()=>s(),p=()=>s();return document.addEventListener("pointerdown",d,!0),document.addEventListener("keydown",u,!0),window.addEventListener("wheel",m,{passive:!0}),window.addEventListener("blur",p),()=>{document.removeEventListener("pointerdown",d,!0),document.removeEventListener("keydown",u,!0),window.removeEventListener("wheel",m),window.removeEventListener("blur",p)}},[t.open,s]),c.jsxs(Gs.Provider,{value:a,children:[e,t.open&&c.jsx("div",{ref:i,role:"menu","aria-orientation":"vertical",className:"ole-glass fixed z-50 min-w-[200px] rounded-md border border-border p-1 text-sm shadow-md",style:{left:(o==null?void 0:o.left)??t.x,top:(o==null?void 0:o.top)??t.y,visibility:o?"visible":"hidden"},onContextMenu:d=>d.preventDefault(),children:t.items.map((d,u)=>{if(d.type==="separator")return c.jsx("div",{role:"separator",className:"my-1 h-px bg-border"},`sep-${u}`);const m=d.icon;return c.jsxs("button",{type:"button",role:"menuitem",disabled:d.disabled,className:Se("flex w-full items-center justify-between gap-3 rounded-sm px-2 py-1.5 text-left","hover:bg-accent hover:text-accent-foreground","focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:outline-none",d.destructive&&"text-destructive hover:bg-destructive/10 hover:text-destructive",d.disabled&&"pointer-events-none text-muted-foreground opacity-60"),onClick:()=>{s(),d.onSelect()},children:[c.jsxs("span",{className:"flex items-center gap-2",children:[m?c.jsx(m,{className:"size-4"}):null,c.jsx("span",{children:d.label})]}),d.shortcut?c.jsx("span",{className:"text-xs text-muted-foreground",children:d.shortcut}):null]},`${d.label}-${u}`)})})]})}const Ur=e=>{let t;const n=new Set,o=(d,u)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const p=t;t=u??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(h=>h(t,p))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=t=e(o,r,l);return l},Vs=(e=>e?Ur(e):Ur),Y_=e=>e;function Ks(e,t=Y_){const n=C.useSyncExternalStore(e.subscribe,C.useCallback(()=>t(e.getState()),[e,t]),C.useCallback(()=>t(e.getInitialState()),[e,t]));return C.useDebugValue(n),n}const Yr=e=>{const t=Vs(e),n=o=>Ks(t,o);return Object.assign(n,t),n},mn=(e=>e?Yr(e):Yr),Z_={"common.unnamed":"Sin título","common.close":"Cerrar","common.yes":"Sí","common.no":"No","topbar.theme.toLight":"Cambiar a claro","topbar.theme.toDark":"Cambiar a oscuro","topbar.theme.currentDark":"Actual: tema oscuro","topbar.theme.currentLight":"Actual: tema claro","topbar.lang.toEnglish":"Cambiar a inglés","topbar.lang.toChinese":"Cambiar a chino","topbar.lang.currentEnglish":"Actual: inglés","topbar.lang.currentChinese":"Actual: chino","topbar.export.label":"Exportar","topbar.export.tooltip":"SVG vectorial (editable), mapa de bits PNG (2× HiDPI) o DXF (CAD)","topbar.export.pngFailed":"Error al exportar PNG: {err}","topbar.export.dxfFailed":"Error al exportar DXF: {err}","topbar.file.label":"Archivo","topbar.file.tooltip":"Abrir un diagrama .json local, guardar o guardar como","topbar.file.current":"Actual: {name}","topbar.file.new":"Nuevo","topbar.file.open":"Abrir…","topbar.file.save":"Guardar","topbar.file.saveAs":"Guardar como…","topbar.file.newConfirm":"Crear uno nuevo descartará los cambios sin guardar. ¿Continuar?","topbar.file.openFailed":"Error al abrir: {err}","topbar.file.saveFailed":"Error al guardar: {err}","topbar.file.fileDescription":"Diagrama de OneLineEditor","outline.title":"Esquema","outline.collapse":"Contraer","outline.collapseAria":"Contraer esquema","outline.empty":"(Sin elementos — arrastra desde la biblioteca para empezar)","props.title":"Propiedades","props.node":"Nodo eléctrico","props.wire":"Cable","props.bus":"Barra","props.junction":"Empalme","props.junctionPos":"Posición","props.nSelected":"{n} seleccionados","props.empty":"Nada seleccionado","props.multi":"{n} objetos seleccionados","props.name":"Nombre","props.note":"Nota","props.label":"Etiqueta","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nodo eléctrico {id} no encontrado","props.wireNotFound":"Cable {id} no encontrado","props.nodeStats":"{terminals} terminales · {elements} elementos","props.selectElement":"Seleccionar {label}","props.selectWholeNode":"Seleccionar todo el nodo eléctrico","props.annText":"Texto","props.annRect":"Rectángulo","props.annEllipse":"Elipse","props.annLine":"Línea","props.annTable":"Tabla","props.annNotFound":"Anotación {id} no encontrada","props.annLabel":"Etiqueta","props.annLabelPlaceholder":"ej.: Tablero n.º 1","props.color":"Color","props.size":"Tamaño","props.sizeReset":"Restablecer al 100 %","props.labelShown":"Visible","props.labelHidden":"Oculta","props.color.default":"Predeterminado","props.color.red":"Rojo","props.color.amber":"Ámbar","props.color.green":"Verde","props.color.blue":"Azul","props.color.gray":"Gris","props.annStroke":"Trazo","props.annStrokeSolid":"Sólido","props.annStrokeDashed":"Discontinuo","props.annStrokeDotted":"Punteado","props.annStrokeWidth":"Grosor","props.annWidthThin":"Fino","props.annWidthMedium":"Medio","props.annWidthThick":"Grueso","props.annFill":"Relleno","props.annFillNone":"Ninguno","props.annFillTint":"Tinte","props.annArrow":"Flechas","props.annArrowNone":"Ninguna","props.annArrowEnd":"Un extremo","props.annArrowBoth":"Ambos extremos","props.annFontSize":"Tamaño de fuente","props.annRows":"Filas","props.annCols":"Columnas","view.zoomOut":"Alejar","view.zoomOutHint":"Aleja un nivel; también rueda ↓ o ⌘−","view.reset":"Restablecer a 100%","view.current":"Actual {z}%","view.zoomIn":"Acercar","view.zoomInHint":"Acerca un nivel; también rueda ↑ o ⌘+","view.fit":"Ajustar vista","view.fitHint":"Ajusta el zoom y centra todo el dibujo automáticamente","view.gridHide":"Ocultar cuadrícula","view.gridShow":"Mostrar cuadrícula","view.gridHotkey":"G","view.gridHideHint":"También desactiva el ajuste a cuadrícula (colocación libre)","view.gridShowHint":"También activa el ajuste a cuadrícula (ajusta a 10px al arrastrar)","view.gridHideAria":"Ocultar cuadrícula y desactivar ajuste","view.gridShowAria":"Mostrar cuadrícula y activar ajuste","view.label":"Etiquetas","view.labelOff":"Ninguna","view.labelId":"ID","view.labelAll":"ID + parámetros","view.labelHint":"Visibilidad y tamaño de las etiquetas (también en la exportación)","view.labelSize":"Tamaño","view.labelSizeSmaller":"Reducir el tamaño de las etiquetas","view.labelSizeLarger":"Aumentar el tamaño de las etiquetas","view.standard":"Norma de símbolos","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Solo cambia el dibujo de los símbolos: el cableado, las posiciones y los valores no se tocan. El interruptor y el fusible se dibujan distinto.","view.labelSizeReset":"Restablecer el tamaño de las etiquetas","library.title":"Biblioteca","tool.draw":"Dibujar","tool.drawHint":"Texto, cajas, círculos, líneas y tablas — anotación libre sobre el dibujo","library.empty":"No hay elementos coincidentes","cat.custom":"En este dibujo","library.customTag":"propio","library.customHint":"Definido por este dibujo — no está en la biblioteca de nadie más","library.createComponent":"Nuevo componente…","library.searchPlaceholder":"Buscar elementos…","library.searchAria":"Buscar elementos","library.clearSearch":"Borrar búsqueda","library.itemHint":"Haz clic para entrar en modo de colocación, o arrastra al lienzo","tool.select":"Seleccionar","tool.selectHint":"Clic para elegir, arrastra un marco para varios, clic derecho para el menú","tool.pan":"Desplazar","tool.panHint":"Arrastra el lienzo; la barra espaciadora lo activa temporalmente","tool.wire":"Cable","tool.wireHint":"Arrastra desde un pin/barra/empalme; soltar en espacio vacío crea un empalme, soltar sobre un cable lo conecta","tool.bus":"Barra","tool.busHint":"Arrastra en el lienzo: pulsa para fijar el inicio, suelta para fijar el final","tool.junction":"Empalme","tool.junctionHint":"Haz clic en el lienzo para colocar un empalme (nodo); los cables se conectan a él libremente","tool.place":"Colocar","tool.placeHint":"Haz clic para colocar; o arrastra desde un terminal/barra para colocar y conectar","tool.text":"Texto","tool.textHint":"Haz clic en el lienzo para colocar una nota de texto; haz doble clic en una existente para editarla","tool.rect":"Rectángulo","tool.rectHint":"Arrastra para dibujar un rectángulo / marco de grupo (discontinuo por defecto); Mayús para un cuadrado","tool.ellipse":"Elipse","tool.ellipseHint":"Arrastra para dibujar una elipse; mantén Mayús para un círculo","tool.line":"Línea","tool.lineHint":"Arrastra para dibujar una línea de anotación; Mayús ajusta a 45°; las flechas se configuran en el panel","tool.table":"Tabla","tool.tableHint":"Arrastra para definir columnas × filas (conteo en vivo), o haz clic para una tabla predeterminada; haz doble clic en las celdas para escribir","mode.selectWithSel":"Arrastra elementos · arrastra terminales para conectar · clic derecho para el menú","mode.selectEmpty":"Clic para elegir · arrastra para mover · marco para varios · clic derecho para el menú","mode.pan":"Arrastra el lienzo · desplaza la rueda para hacer zoom · mantén Espacio para desplazar en cualquier herramienta","mode.wireDragging":"Suelta sobre un pin/barra/empalme; soltar en espacio vacío crea un empalme","mode.wireInit":"Pulsa sobre cualquier punto de conexión o espacio vacío, arrastra hasta el destino y suelta","mode.busDragging":"Arrastrar fija la dirección de la barra; soltar fija el final","mode.busInit":"Pulsa en el lienzo para fijar el inicio, arrastra y suelta para fijar el final","mode.junction":"Haz clic en el lienzo para colocar un empalme","mode.placeNoKind":"Elige un tipo de elemento de la biblioteca a la izquierda","mode.placeFromTerm":"Suelta en el destino — el nuevo elemento se conectará al terminal de origen","mode.placeNormal":"Haz clic en un espacio vacío para colocar; o arrastra desde un terminal / barra para colocar y conectar","mode.text":"Clic para colocar texto · doble clic para editar · arrastra la selección para mover · Supr para eliminar","mode.rect":"Arrastra para dibujar un rectángulo · Mayús para cuadrado · redimensiona y etiqueta al soltar","mode.ellipse":"Arrastra para dibujar una elipse · Mayús para círculo · redimensiona, recolorea y etiqueta al soltar","mode.line":"Arrastra para dibujar una línea · Mayús ajusta a 45° · añade flechas en el panel al soltar","mode.table":"Arrastra para definir la cuadrícula, o haz clic para una tabla de 3×3 · doble clic en las celdas para escribir","mode.annTextSel":"Haz clic en el texto para editar · arrastra para mover · Supr para eliminar","mode.annTableSel":"Haz clic en una celda para completarla · arrastra para mover · Supr para eliminar","mode.annShapeSel":"Arrastra para mover · arrastra los controladores para redimensionar · cambia el estilo en el panel · Supr para eliminar","mode.annEditing":"Escribe · Intro para confirmar · Esc para cancelar · o los botones ✓ / ✕","mode.escSelect":"Esc borra la selección","mode.escOther":"Clic derecho / Esc para cancelar","tool.placeNoKindTooltip":"Elige un tipo en la biblioteca a la izquierda y luego haz clic en el lienzo","tool.undo":"Deshacer","tool.undoHint":"Deshace la última edición (mover / rotar / eliminar, etc.)","tool.redo":"Rehacer","tool.redoHint":"Rehace la última edición deshecha","layout.label":"Diseño","layout.hint":"Organiza automáticamente todo el diagrama o solo la selección, y rellena los huecos","layout.allAuto":"Organizar todo automáticamente","layout.selAuto":"Organizar la selección automáticamente","layout.allFill":"Rellenar sin colocar","layout.selFill":"Rellenar los no colocados en la selección","tool.more":"Más","tool.moreHint":"Deshacer / rehacer / diseño","view.menu":"Vista","view.menuHint":"Zoom, ajuste, cuadrícula","ctx.ariaNode":"Acciones del nodo","ctx.ariaWire":"Acciones del cable","ctx.ariaElement":"Acciones del elemento","ctx.ariaEdit":"Acciones de edición","ctx.done":"Listo","ctx.cancel":"Cancelar","ctx.rotate":"Rotar 90°","ctx.rotateHint":"Rota la selección en sentido horario; los cables se re-enrutan a los nuevos terminales","ctx.mirror":"Reflejar horizontalmente","ctx.mirrorTitle":"Reflejar","ctx.mirrorHint":"Invierte la selección de izquierda a derecha","ctx.delete":"Eliminar","ctx.color":"Color","ctx.colorDefault":"Predeterminado","ctx.colorRed":"Rojo","ctx.colorAmber":"Ámbar","ctx.colorGreen":"Verde","ctx.colorBlue":"Azul","ctx.colorGray":"Gris","ctx.deleteHintNode":"Desconecta todos los cables de este nodo (los elementos permanecen)","ctx.deleteHintWire":"Elimina solo este cable (los demás del mismo nodo permanecen)","ctx.deleteHintElement":"Elimina la selección y sus cables","ctx.resetWirePath":"Restablecer al enrutado automático","ctx.resetWirePathHint":"Descarta los ángulos manuales y deja que el enrutador vuelva a trazar este cable","menu.undo":"Deshacer","menu.redo":"Rehacer","menu.cut":"Cortar","menu.copy":"Copiar","menu.paste":"Pegar","menu.rotate":"Rotar 90°","menu.mirror":"Reflejar","menu.resetLabel":"Restablecer posición de la etiqueta","menu.selectAll":"Seleccionar todo","menu.disconnect":"Desconectar este cable","menu.delete":"Eliminar","io.parseFailed":"Error al analizar JSON: {err}","io.notObject":"El archivo no es un objeto JSON","io.versionMismatch":'Versión incompatible: se esperaba "1", se obtuvo {actual}',"io.elementsMissing":"`elements` falta o no es un array","compile.duplicateId":'ID de elemento duplicado: "{id}"',"compile.unknownKind":'Tipo de elemento desconocido kind="{kind}"',"compile.invalidTermRef":'Referencia de terminal no válida "{ref}"',"compile.elementMissing":'Referencia a un elemento desconocido "{id}"',"compile.missingPin":'El elemento "{id}" (kind={kind}) no tiene el pin "{pin}"; disponibles: {available}',"compile.singleTerminal":"El nodo solo tiene un terminal — ignorado","compile.layoutMissingElement":'La clave de layout "{id}" hace referencia a un elemento desconocido',"compile.elementUnconnected":'El elemento "{id}" no tiene conexiones',"cat.busbar":"Barras / cableado","cat.switching":"Conmutación","cat.protection":"Protección","cat.motor-control":"Control de motores","cat.transformer":"Transformadores","cat.instrument-transformer":"Transformadores de medida","cat.measurement":"Medición","cat.source":"Fuentes","cat.load":"Cargas","cat.storage":"Almacenamiento","cat.compensation":"Compensación","cat.grounding":"Puesta a tierra","cat.renewable":"Renovables / electrónica de potencia","onboard.title":"Inicio rápido","onboard.step1.title":"Coloca un componente","onboard.step1.body":"Elige la herramienta Colocar (P) y arrastra un tipo de la biblioteca al lienzo","onboard.step2.title":"Conéctalo","onboard.step2.body":"Usa la herramienta Cable (W): arrastra de un pin a otro — arrastra a un espacio vacío para crear un empalme","onboard.step3.title":"Una barra es un riel compartido, no un cable","onboard.step3.body":"Usa la herramienta Barra (B) solo cuando varios circuitos comparten un mismo riel. No uses una barra para unir dos dispositivos — simplemente conecta los pines con un cable (W).","onboard.dismiss":"Entendido"},Q_={"arc-suppression-coil.name":"Bobina de extinción de arco","arrester.name":"Descargador de sobretensiones (FBL)","async-motor.name":"Motor asíncrono","autotransformer.name":"Autotransformador","battery.name":"Almacenamiento en batería","breaker.name":"Interruptor automático (QF)","busbar.name":"Tramo de barra","converter-bidir.name":"Convertidor bidireccional (PCS)","dc-dc-converter.name":"Convertidor CC/CC","mppt.name":"Controlador MPPT","ct.name":"Transformador de corriente (CT)","disconnector.name":"Seccionador (QS)","earth.name":"Tierra","earthing-switch.name":"Seccionador de puesta a tierra (QE)","fuse.name":"Fusible (FU)","generator.name":"Generador (G)","grid-source.name":"Fuente de red","grounding-transformer.name":"Transformador de puesta a tierra (zig-zag)","inverter.name":"Inversor (CC→CA)","load-switch.name":"Interruptor de carga","load.name":"Carga","luminaire.name":"Luminaria (carga de alumbrado)","panelboard.name":"Tablero de distribución","ngr.name":"Resistencia de puesta a tierra del neutro (NGR)","pt.name":"Transformador de tensión (PT)","pv.name":"Módulo fotovoltaico","rectifier.name":"Rectificador (CA→CC)","series-reactor.name":"Reactor serie","shunt-capacitor.name":"Condensador en derivación","shunt-reactor.name":"Reactor en derivación","sync-motor.name":"Motor síncrono","transformer-2w.name":"Transformador de dos devanados","transformer-3w.name":"Transformador de tres devanados","wind-turbine.name":"Aerogenerador","gfci-breaker.name":"Interruptor GFCI (RCBO)","rcd.name":"Dispositivo de corriente residual (RCD)","recloser.name":"Reconectador","energy-meter.name":"Medidor de energía (Wh)","voltmeter.name":"Voltímetro (V)","ammeter.name":"Amperímetro (A)","wattmeter.name":"Vatímetro (W)","frequency-meter.name":"Frecuencímetro (Hz)","contactor.name":"Contactor (KM)","motor-starter.name":"Arrancador de motor","thermal-overload.name":"Relé de sobrecarga térmica","vfd.name":"Variador de frecuencia (VFD)","soft-starter.name":"Arrancador suave","transfer-switch.name":"Conmutador de transferencia (ATS)","dc-disconnector.name":"Seccionador de CC","dc-combiner.name":"Caja combinadora de CC","ev-charger.name":"Cargador de VE","arc-suppression-coil.desc":"Puesta a tierra resonante del neutro: inductor a tierra","busbar.desc":"Tramo de barra única extensible con múltiples derivaciones","converter-bidir.desc":"Convertidor de almacenamiento: CA ↔ CC bidireccional","dc-dc-converter.desc":"Convertidor CC/CC / cargador CC (IEC 60617)","mppt.desc":"Controlador de carga solar MPPT (CC/CC, seguimiento del punto de máxima potencia)","earthing-switch.desc":"Seccionador + conexión a tierra, un solo puerto","grid-source.desc":"Barra infinita / red externa","grounding-transformer.desc":"Transformador estrella-zigzag para puesta a tierra del neutro","load.desc":"Carga abstracta (flecha de salida de corriente)","luminaire.desc":"Carga de alumbrado (símbolo general de luminaria IEC 60617)","ngr.desc":"Puesta a tierra de baja resistencia: neutro del transformador a tierra","series-reactor.desc":"Mismo símbolo que el reactor en derivación; se distingue por el uso","wind-turbine.desc":"Turbina eólica: generador + marca de rotor de tres palas","gfci-breaker.desc":"Interruptor de corriente residual con protección de sobrecorriente (UL943 / IEC 61009). GFCI en Norteamérica / RCBO en Europa.","rcd.desc":"Interruptor de corriente residual sin protección de sobrecorriente (IEC 61008).","recloser.desc":"Reconectador automático de media tensión.","energy-meter.desc":"Medidor de energía activa (kWh) — acometida / submedición.","contactor.desc":"Contactor de circuito principal; se usa normalmente con un relé de sobrecarga térmica y un motor.","motor-starter.desc":"Arrancador de motor (símbolo general IEC 60617).","thermal-overload.desc":"Relé de sobrecarga térmica del motor; se ubica entre el contactor y el motor.","vfd.desc":"Variador de frecuencia para el control de velocidad de motores de inducción.","soft-starter.desc":"Arrancador suave de motor (arranque a tensión reducida basado en tiristores).","transfer-switch.desc":"Conmutador de transferencia de dos fuentes (ATS / manual). Dos entradas de fuente + una salida de carga, con enclavamiento mecánico.","dc-disconnector.desc":"Seccionador de CC — aislamiento del lado de CC de cadenas fotovoltaicas / baterías.","dc-combiner.desc":"Caja combinadora de cadenas fotovoltaicas (ejemplo de 4 entradas).","ev-charger.desc":"Estación de carga para vehículos eléctricos.","breaker.state.open":"Abierto","disconnector.state.open":"Abierto","earthing-switch.state.open":"Abierto","fuse.state.blown":"Fundido","load-switch.state.open":"Abierto","gfci-breaker.state.open":"Abierto","rcd.state.open":"Abierto","recloser.state.open":"Abierto","contactor.state.open":"Abierto","thermal-overload.state.tripped":"Disparado","transfer-switch.state.position":"Posición (normal/emergencia/apagado)","dc-disconnector.state.open":"Abierto","battery.param.E":"Capacidad","busbar.param.Un":"Tensión nominal","converter-bidir.param.S":"Capacidad","dc-dc-converter.param.P":"Potencia","mppt.param.I":"Corriente nominal","load.param.P":"Potencia activa","load.param.cosphi":"Factor de potencia","ngr.param.R":"Resistencia","shunt-capacitor.param.Q":"Potencia reactiva","shunt-capacitor.param.stages":"Etapas","transformer-2w.param.S":"Capacidad","transformer-2w.param.ratio":"Relación de transformación","gfci-breaker.param.In":"Corriente nominal","panelboard.param.In":"Corriente nominal","gfci-breaker.param.IDn":"Corriente diferencial de actuación","rcd.param.IDn":"Corriente diferencial de actuación","breaker.param.In":"Corriente nominal","breaker.param.poles":"Polos","breaker.param.Icu":"Poder de corte","disconnector.param.In":"Corriente nominal","fuse.param.In":"Corriente nominal","resistor.name":"Resistor (R)","capacitor.name":"Condensador (C)","diode.name":"Diodo (D)","indicator-light.name":"Luz indicadora (HL)","push-button.name":"Pulsador (SB)","relay-coil.name":"Bobina de relé (KA)","make-contact.name":"Contacto normalmente abierto (NO)","break-contact.name":"Contacto normalmente cerrado (NC)","bell.name":"Timbre (HA)","terminal.name":"Terminal / empalme (X)","fuse-switch-disconnector.name":"Seccionador-fusible","socket-outlet.name":"Toma de corriente / conector","inductor.name":"Inductor (L)","voltage-regulator.name":"Regulador de tensión (T)","dc-motor.name":"Motor de CC (M)","heater.name":"Elemento calefactor (EH)","selector-switch.name":"Conmutador selector (SA)","limit-switch.name":"Interruptor de límite (SQ)","proximity-switch.name":"Interruptor de proximidad (SQ)","time-relay.name":"Relé de tiempo (KT)","buzzer.name":"Zumbador (HA)","siren.name":"Sirena (HA)","thermocouple.name":"Termopar (BT)","thyristor.name":"Tiristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diodo Zener (D)","igbt.name":"IGBT","plc.name":"PLC / controlador","ups.name":"SAI (UPS)","power-supply.name":"Fuente de alimentación (PS)","genset.name":"Grupo electrógeno (G)","protective-relay.name":"Relé de protección","overcurrent-relay.name":"Relé de sobrecorriente (50/51)","undervoltage-relay.name":"Relé de baja tensión (27)","reverse-power-relay.name":"Relé de potencia inversa (32)","distance-relay.name":"Relé de distancia (21)","phase-failure-relay.name":"Relé de falla de fase","buchholz-relay.name":"Relé Buchholz (63)","power-factor-meter.name":"Medidor de factor de potencia (cosφ)","synchronoscope.name":"Sincronoscopio","varmeter.name":"Varímetro (var)","resistor.desc":"Resistor general / limitador de corriente / resistor de frenado.","capacitor.desc":"Condensador general / de filtro / del bus de CC. Usa el condensador en derivación para corrección del factor de potencia.","diode.desc":"Diodo rectificador / de rueda libre / de protección. t1 = ánodo (arriba), t2 = cátodo (abajo).","indicator-light.desc":"Luz indicadora de señal / estado.","push-button.desc":"Pulsador manual con retorno automático (contacto NA).","relay-coil.desc":"Bobina de accionamiento de relé / contactor (caja).","make-contact.desc":"Contacto auxiliar normalmente abierto (NA).","break-contact.desc":"Contacto auxiliar normalmente cerrado (NC).","bell.desc":"Timbre de señal / alarma.","terminal.desc":"Terminal / caja de empalme / nodo de conexión.","fuse-switch-disconnector.desc":"Seccionador-fusible bajo carga.","socket-outlet.desc":"Toma de corriente / conector multipolar.","inductor.desc":"Inductor general / bobina / choque.","voltage-regulator.desc":"Regulador de tensión de inducción / autotransformador ajustable.","dc-motor.desc":"Motor de CC (símbolo general de excitación serie).","heater.desc":"Elemento calefactor resistivo / carga de calefacción.","selector-switch.desc":"Conmutador selector / de cambio (rotativo, de posición fija).","limit-switch.desc":"Interruptor de carrera / posición (NA, accionamiento mecánico).","proximity-switch.desc":"Sensor de proximidad / interruptor de proximidad sin contacto.","time-relay.desc":"Bobina de relé de temporización (acción retardada).","buzzer.desc":"Zumbador de señal.","siren.desc":"Sirena / alarma sonora.","thermocouple.desc":"Sensor de temperatura de termopar.","thyristor.desc":"Tiristor triodo de bloqueo inverso / SCR. t1 = ánodo (arriba), t2 = cátodo (abajo).","triac.desc":"Tiristor triodo bidireccional (TRIAC).","zener-diode.desc":"Diodo Zener / regulador de tensión. t1 = ánodo (arriba), t2 = cátodo (abajo).","igbt.desc":"IGBT de canal N en modo de enriquecimiento. t1 = colector (arriba), t2 = emisor (abajo), t_g = puerta.","plc.desc":"Controlador lógico programable (PLC).","ups.desc":"Sistema de alimentación ininterrumpida en línea / en espera (UPS).","power-supply.desc":"Fuente de alimentación conmutada CA→CC / fuente de CC. t_ac arriba (~), t_dc abajo (=).","genset.desc":"Grupo electrógeno diésel / a gas.","protective-relay.desc":"Relé de medida / protección, símbolo general (IEC 60617).","overcurrent-relay.desc":"Relé de protección de sobrecorriente (ANSI 50/51).","undervoltage-relay.desc":"Relé de protección de baja tensión (ANSI 27).","reverse-power-relay.desc":"Relé de protección de potencia inversa / corriente inversa (ANSI 32).","distance-relay.desc":"Relé de protección de distancia / baja impedancia (ANSI 21).","phase-failure-relay.desc":"Relé de protección de falla de fase / pérdida de fase.","buchholz-relay.desc":"Relé Buchholz / de gas (ANSI 63).","power-factor-meter.desc":"Medidor de factor de potencia (cosφ).","synchronoscope.desc":"Indicador de sincronización / sincronoscopio.","varmeter.desc":"Medidor de potencia reactiva (var).","make-contact.state.closed":"Cerrado","break-contact.state.open":"Abierto","fuse-switch-disconnector.state.open":"Abierto","selector-switch.state.open":"Abierto","limit-switch.state.closed":"Cerrado","resistor.param.R":"Resistencia","resistor.param.P":"Potencia nominal","capacitor.param.C":"Capacitancia","capacitor.param.Un":"Tensión nominal","indicator-light.param.color":"Color","inductor.param.L":"Inductancia","inductor.param.In":"Corriente nominal","voltage-regulator.param.ratio":"Rango de regulación","heater.param.P":"Potencia","ups.param.S":"Capacidad","power-supply.param.Vdc":"Tensión de salida","genset.param.P":"Potencia"},J_={ui:Z_,library:Q_},eC={"common.unnamed":"Sans titre","common.close":"Fermer","common.yes":"Oui","common.no":"Non","topbar.theme.toLight":"Passer au thème clair","topbar.theme.toDark":"Passer au thème sombre","topbar.theme.currentDark":"Actuel : thème sombre","topbar.theme.currentLight":"Actuel : thème clair","topbar.lang.toEnglish":"Passer à l'anglais","topbar.lang.toChinese":"Passer au chinois","topbar.lang.currentEnglish":"Actuel : anglais","topbar.lang.currentChinese":"Actuel : chinois","topbar.export.label":"Exporter","topbar.export.tooltip":"SVG vectoriel (modifiable), PNG bitmap (2× HiDPI) ou DXF (CAO)","topbar.export.pngFailed":"Échec de l'export PNG : {err}","topbar.export.dxfFailed":"Échec de l'export DXF : {err}","topbar.file.label":"Fichier","topbar.file.tooltip":"Ouvrir un schéma .json local, enregistrer, ou enregistrer sous","topbar.file.current":"Actuel : {name}","topbar.file.new":"Nouveau","topbar.file.open":"Ouvrir…","topbar.file.save":"Enregistrer","topbar.file.saveAs":"Enregistrer sous…","topbar.file.newConfirm":"Créer un nouveau schéma effacera les modifications non enregistrées. Continuer ?","topbar.file.openFailed":"Échec de l'ouverture : {err}","topbar.file.saveFailed":"Échec de l'enregistrement : {err}","topbar.file.fileDescription":"Schéma OneLineEditor","outline.title":"Plan","outline.collapse":"Réduire","outline.collapseAria":"Réduire le plan","outline.empty":"(Aucun élément — glissez depuis la bibliothèque pour commencer)","props.title":"Propriétés","props.node":"Nœud électrique","props.wire":"Fil","props.bus":"Jeu de barres","props.junction":"Jonction","props.junctionPos":"Position","props.nSelected":"{n} sélectionné(s)","props.empty":"Aucune sélection","props.multi":"{n} objets sélectionnés","props.name":"Nom","props.note":"Note","props.label":"Repère","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nœud électrique {id} introuvable","props.wireNotFound":"Fil {id} introuvable","props.nodeStats":"{terminals} bornes · {elements} éléments","props.selectElement":"Sélectionner {label}","props.selectWholeNode":"Sélectionner tout le nœud électrique","props.annText":"Texte","props.annRect":"Rectangle","props.annEllipse":"Ellipse","props.annLine":"Ligne","props.annTable":"Tableau","props.annNotFound":"Annotation {id} introuvable","props.annLabel":"Étiquette","props.annLabelPlaceholder":"ex. : Tableau n°1","props.color":"Couleur","props.size":"Taille","props.sizeReset":"Revenir à 100 %","props.labelShown":"Visible","props.labelHidden":"Masqué","props.color.default":"Par défaut","props.color.red":"Rouge","props.color.amber":"Ambre","props.color.green":"Vert","props.color.blue":"Bleu","props.color.gray":"Gris","props.annStroke":"Trait","props.annStrokeSolid":"Continu","props.annStrokeDashed":"Pointillé","props.annStrokeDotted":"Pointillé fin","props.annStrokeWidth":"Épaisseur","props.annWidthThin":"Fin","props.annWidthMedium":"Moyen","props.annWidthThick":"Épais","props.annFill":"Remplissage","props.annFillNone":"Aucun","props.annFillTint":"Teinte","props.annArrow":"Flèches","props.annArrowNone":"Aucune","props.annArrowEnd":"Extrémité","props.annArrowBoth":"Les deux","props.annFontSize":"Taille de police","props.annRows":"Lignes","props.annCols":"Colonnes","view.zoomOut":"Zoom arrière","view.zoomOutHint":"Zoom arrière par palier ; aussi molette ↓ ou ⌘−","view.reset":"Réinitialiser à 100 %","view.current":"Actuel {z} %","view.zoomIn":"Zoom avant","view.zoomInHint":"Zoom avant par palier ; aussi molette ↑ ou ⌘+","view.fit":"Ajuster la vue","view.fitHint":"Zoom automatique et centrage sur tout le schéma","view.gridHide":"Masquer la grille","view.gridShow":"Afficher la grille","view.gridHotkey":"G","view.gridHideHint":"Désactive aussi l'aimantation à la grille (placement libre)","view.gridShowHint":"Active aussi l'aimantation à la grille (alignement sur 10 px au glisser)","view.gridHideAria":"Masquer la grille et désactiver l'aimantation","view.gridShowAria":"Afficher la grille et activer l'aimantation","view.label":"Étiquettes","view.labelOff":"Aucune","view.labelId":"ID","view.labelAll":"ID + paramètres","view.labelHint":"Visibilité et taille des étiquettes (export compris)","view.labelSize":"Taille","view.labelSizeSmaller":"Réduire la taille des étiquettes","view.labelSizeLarger":"Agrandir la taille des étiquettes","view.standard":"Norme des symboles","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Ne change que le tracé des symboles — câblage, positions et calibres restent intacts. Le disjoncteur et le fusible diffèrent entre les deux.","view.labelSizeReset":"Réinitialiser la taille des étiquettes","library.title":"Bibliothèque","tool.draw":"Dessiner","tool.drawHint":"Texte, cadres, cercles, lignes et tableaux — annotation libre sur le schéma","library.empty":"Aucun élément correspondant","cat.custom":"Dans ce schéma","library.customTag":"perso","library.customHint":"Défini par ce schéma — absent de toute autre bibliothèque","library.createComponent":"Nouveau composant…","library.searchPlaceholder":"Rechercher des éléments…","library.searchAria":"Rechercher des éléments","library.clearSearch":"Effacer la recherche","library.itemHint":"Cliquez pour passer en mode placement, ou glissez sur le plan de travail","tool.select":"Sélection","tool.selectHint":"Cliquez pour choisir, tracez un cadre pour une sélection multiple, clic droit pour le menu","tool.pan":"Déplacement","tool.panHint":"Faites glisser le plan de travail ; Espace bascule temporairement","tool.wire":"Fil","tool.wireHint":"Glissez depuis une borne/un jeu de barres/une jonction ; vers un espace vide crée une jonction, sur un fil crée un piquage","tool.bus":"Jeu de barres","tool.busHint":"Glissez sur le plan de travail — appuyez pour définir le début, relâchez pour définir la fin","tool.junction":"Jonction","tool.junctionHint":"Cliquez sur le plan de travail pour placer une jonction (nœud) ; les fils s'y raccordent librement","tool.place":"Placer","tool.placeHint":"Cliquez pour placer ; ou glissez depuis une borne/un jeu de barres pour placer et connecter","tool.text":"Texte","tool.textHint":"Cliquez sur le plan de travail pour placer une note texte ; double-cliquez sur une note existante pour la modifier","tool.rect":"Rectangle","tool.rectHint":"Glissez pour dessiner un rectangle / cadre de groupe (pointillé par défaut) ; Maj pour un carré","tool.ellipse":"Ellipse","tool.ellipseHint":"Glissez pour dessiner une ellipse ; Maj pour un cercle","tool.line":"Ligne","tool.lineHint":"Glissez pour dessiner une ligne d'annotation ; Maj aligne à 45° ; les flèches se règlent dans le panneau","tool.table":"Tableau","tool.tableHint":"Glissez pour définir colonnes × lignes (comptage en direct), ou cliquez pour un tableau par défaut ; double-cliquez sur les cellules pour saisir du texte","mode.selectWithSel":"Glissez les éléments · glissez les bornes pour câbler · clic droit pour le menu","mode.selectEmpty":"Cliquez pour choisir · glissez pour déplacer · tracez un cadre pour une sélection multiple · clic droit pour le menu","mode.pan":"Glissez le plan de travail · molette pour zoomer · maintenez Espace pour déplacer avec n'importe quel outil","mode.wireDragging":"Relâchez sur une borne/un jeu de barres/une jonction ; relâcher dans un espace vide crée une jonction","mode.wireInit":"Appuyez sur un point de connexion ou un espace vide, glissez vers une cible et relâchez","mode.busDragging":"Le glissement définit la direction du jeu de barres ; le relâchement définit la fin","mode.busInit":"Appuyez sur le plan de travail pour définir le début, glissez, relâchez pour définir la fin","mode.junction":"Cliquez sur le plan de travail pour placer une jonction","mode.placeNoKind":"Choisissez un type d'élément dans la bibliothèque à gauche","mode.placeFromTerm":"Relâchez sur la cible — le nouvel élément se connectera à la borne source","mode.placeNormal":"Cliquez sur un espace vide pour placer ; ou glissez depuis une borne / un jeu de barres pour placer et connecter","mode.text":"Cliquez pour placer du texte · double-cliquez pour modifier · glissez la sélection pour déplacer · Suppr pour retirer","mode.rect":"Glissez pour dessiner un rectangle · Maj pour un carré · redimensionnez et nommez-le après relâchement","mode.ellipse":"Glissez pour dessiner une ellipse · Maj pour un cercle · redimensionnez, recolorez et nommez après relâchement","mode.line":"Glissez pour dessiner une ligne · Maj aligne à 45° · ajoutez des flèches dans le panneau après relâchement","mode.table":"Glissez pour définir la grille, ou cliquez pour un tableau 3×3 · double-cliquez sur les cellules pour saisir du texte","mode.annTextSel":"Cliquez sur le texte pour modifier · glissez pour déplacer · Suppr pour retirer","mode.annTableSel":"Cliquez sur une cellule pour la remplir · glissez pour déplacer · Suppr pour retirer","mode.annShapeSel":"Glissez pour déplacer · glissez les poignées pour redimensionner · modifiez le style dans le panneau · Suppr pour retirer","mode.annEditing":"Saisissez · Entrée pour valider · Échap pour annuler · ou les boutons ✓ / ✕","mode.escSelect":"Échap efface la sélection","mode.escOther":"Clic droit / Échap pour annuler","tool.placeNoKindTooltip":"Choisissez un type dans la bibliothèque à gauche, puis cliquez sur le plan de travail","tool.undo":"Annuler","tool.undoHint":"Annule la dernière modification (déplacement / rotation / suppression, etc.)","tool.redo":"Rétablir","tool.redoHint":"Rétablit la dernière modification annulée","layout.label":"Disposition","layout.hint":"Disposition automatique de tout le schéma ou de la sélection, comble les espaces vides","layout.allAuto":"Tout disposer automatiquement","layout.selAuto":"Disposer la sélection automatiquement","layout.allFill":"Combler les éléments non placés","layout.selFill":"Combler les éléments non placés de la sélection","tool.more":"Plus","tool.moreHint":"Annuler / rétablir / disposition","view.menu":"Affichage","view.menuHint":"Zoom, ajustement, grille","ctx.ariaNode":"Actions sur le nœud","ctx.ariaWire":"Actions sur le fil","ctx.ariaElement":"Actions sur l'élément","ctx.ariaEdit":"Actions d'édition","ctx.done":"Terminé","ctx.cancel":"Annuler","ctx.rotate":"Pivoter de 90°","ctx.rotateHint":"Fait pivoter la sélection dans le sens horaire ; les fils se réacheminent vers les nouvelles bornes","ctx.mirror":"Miroir horizontal","ctx.mirrorTitle":"Miroir","ctx.mirrorHint":"Retourne la sélection horizontalement","ctx.delete":"Supprimer","ctx.color":"Couleur","ctx.colorDefault":"Par défaut","ctx.colorRed":"Rouge","ctx.colorAmber":"Ambre","ctx.colorGreen":"Vert","ctx.colorBlue":"Bleu","ctx.colorGray":"Gris","ctx.deleteHintNode":"Déconnecte tous les fils de ce nœud (les éléments restent)","ctx.deleteHintWire":"Retire uniquement ce fil (les autres fils du même nœud restent)","ctx.deleteHintElement":"Retire la sélection et ses fils","ctx.resetWirePath":"Revenir au routage automatique","ctx.resetWirePathHint":"Supprime les coudes manuels et laisse le routeur retracer ce fil","menu.undo":"Annuler","menu.redo":"Rétablir","menu.cut":"Couper","menu.copy":"Copier","menu.paste":"Coller","menu.rotate":"Pivoter de 90°","menu.mirror":"Miroir","menu.resetLabel":"Réinitialiser la position du libellé","menu.selectAll":"Tout sélectionner","menu.disconnect":"Déconnecter ce fil","menu.delete":"Supprimer","io.parseFailed":"Échec de l'analyse JSON : {err}","io.notObject":"Le fichier n'est pas un objet JSON","io.versionMismatch":"Version incompatible : attendu « 1 », obtenu {actual}","io.elementsMissing":"`elements` est manquant ou n'est pas un tableau","compile.duplicateId":"Identifiant d'élément dupliqué : « {id} »","compile.unknownKind":"Type d'élément inconnu kind=« {kind} »","compile.invalidTermRef":"Référence de borne invalide « {ref} »","compile.elementMissing":"Référence à un élément inconnu « {id} »","compile.missingPin":"L'élément « {id} » (kind={kind}) n'a pas de broche « {pin} » ; disponibles : {available}","compile.singleTerminal":"Le nœud n'a qu'une seule borne — ignoré","compile.layoutMissingElement":"la clé de disposition « {id} » référence un élément inconnu","compile.elementUnconnected":"L'élément « {id} » n'a aucune connexion","cat.busbar":"Jeux de barres / câblage","cat.switching":"Appareillage de coupure","cat.protection":"Protection","cat.motor-control":"Commande de moteur","cat.transformer":"Transformateur","cat.instrument-transformer":"Transformateur de mesure","cat.measurement":"Mesure","cat.source":"Source","cat.load":"Charge","cat.storage":"Stockage","cat.compensation":"Compensation","cat.grounding":"Mise à la terre","cat.renewable":"Énergies renouvelables / électronique de puissance","onboard.title":"Démarrage rapide","onboard.step1.title":"Placer un composant","onboard.step1.body":"Choisissez l'outil Placer (P) et glissez un type depuis la bibliothèque sur le plan de travail","onboard.step2.title":"Câblez-le","onboard.step2.body":"Utilisez l'outil Fil (W) : glissez d'une broche à une autre — glissez vers un espace vide pour créer une jonction","onboard.step3.title":"Un jeu de barres est un rail commun, pas un fil","onboard.step3.body":"Utilisez l'outil Jeu de barres (B) uniquement lorsque plusieurs circuits partagent un même rail. N'utilisez pas un jeu de barres pour relier deux appareils — câblez simplement les broches (W).","onboard.dismiss":"Compris"},tC={"arc-suppression-coil.name":"Bobine d'extinction d'arc","arrester.name":"Parafoudre (FBL)","async-motor.name":"Moteur asynchrone","autotransformer.name":"Autotransformateur","battery.name":"Stockage par batterie","breaker.name":"Disjoncteur (QF)","busbar.name":"Segment de jeu de barres","converter-bidir.name":"Convertisseur bidirectionnel (PCS)","dc-dc-converter.name":"Convertisseur DC/DC","mppt.name":"Régulateur MPPT","ct.name":"Transformateur de courant (CT)","disconnector.name":"Sectionneur (QS)","earth.name":"Terre","earthing-switch.name":"Sectionneur de terre (QE)","fuse.name":"Fusible (FU)","generator.name":"Générateur (G)","grid-source.name":"Source réseau","grounding-transformer.name":"Transformateur de mise à la terre (zigzag)","inverter.name":"Onduleur (DC→AC)","load-switch.name":"Interrupteur de charge","load.name":"Charge","luminaire.name":"Luminaire (charge d'éclairage)","panelboard.name":"Tableau de répartition","ngr.name":"Résistance de mise à la terre du neutre (NGR)","pt.name":"Transformateur de tension (PT)","pv.name":"Module photovoltaïque","rectifier.name":"Redresseur (AC→DC)","series-reactor.name":"Réactance série","shunt-capacitor.name":"Condensateur shunt","shunt-reactor.name":"Réactance shunt","sync-motor.name":"Moteur synchrone","transformer-2w.name":"Transformateur à deux enroulements","transformer-3w.name":"Transformateur à trois enroulements","wind-turbine.name":"Éolienne","gfci-breaker.name":"Disjoncteur différentiel (RCBO)","rcd.name":"Dispositif différentiel résiduel (RCD)","recloser.name":"Réenclencheur","energy-meter.name":"Compteur d'énergie (Wh)","voltmeter.name":"Voltmètre (V)","ammeter.name":"Ampèremètre (A)","wattmeter.name":"Wattmètre (W)","frequency-meter.name":"Fréquencemètre (Hz)","contactor.name":"Contacteur (KM)","motor-starter.name":"Démarreur de moteur","thermal-overload.name":"Relais thermique de surcharge","vfd.name":"Variateur de fréquence (VFD)","soft-starter.name":"Démarreur progressif","transfer-switch.name":"Commutateur de transfert (ATS)","dc-disconnector.name":"Sectionneur DC","dc-combiner.name":"Boîtier de raccordement DC","ev-charger.name":"Borne de recharge VE","arc-suppression-coil.desc":"Mise à la terre résonante du neutre : bobine reliée à la terre","busbar.desc":"Segment de jeu de barres simple extensible avec piquages multiples","converter-bidir.desc":"Convertisseur de stockage : bidirectionnel AC ↔ DC","dc-dc-converter.desc":"Convertisseur DC/DC / chargeur DC (IEC 60617)","mppt.desc":"Régulateur de charge solaire MPPT (DC/DC, recherche du point de puissance maximale)","earthing-switch.desc":"Sectionneur + liaison à la terre, à un seul accès","grid-source.desc":"Jeu de barres infini / réseau externe","grounding-transformer.desc":"Transformateur étoile-zigzag pour mise à la terre du neutre","load.desc":"Charge abstraite (flèche de sortie de courant)","luminaire.desc":"Charge d'éclairage (symbole général de luminaire CEI 60617)","ngr.desc":"Mise à la terre à faible résistance : neutre du transformateur relié à la terre","series-reactor.desc":"Même symbole que la réactance shunt ; distingué par l'usage","wind-turbine.desc":"Éolienne : génératrice + repère de rotor tripale","gfci-breaker.desc":"Disjoncteur différentiel avec protection contre les surintensités (UL943 / IEC 61009). GFCI en Amérique du Nord / RCBO en Europe.","rcd.desc":"Disjoncteur différentiel sans protection contre les surintensités (IEC 61008).","recloser.desc":"Réenclencheur automatique moyenne tension.","energy-meter.desc":"Compteur d'énergie active (kWh) — entrée de service / sous-comptage.","contactor.desc":"Contacteur de circuit principal ; généralement utilisé avec un relais thermique et un moteur.","motor-starter.desc":"Démarreur de moteur (symbole général IEC 60617).","thermal-overload.desc":"Relais thermique de surcharge moteur ; placé entre le contacteur et le moteur.","vfd.desc":"Variateur de fréquence pour le contrôle de vitesse des moteurs asynchrones.","soft-starter.desc":"Démarreur progressif de moteur (démarrage à tension réduite à base de thyristors).","transfer-switch.desc":"Commutateur de transfert à deux sources (ATS / manuel). Deux entrées source + une sortie charge, verrouillées mécaniquement.","dc-disconnector.desc":"Sectionneur DC — isolement côté DC d'une chaîne photovoltaïque / batterie.","dc-combiner.desc":"Boîtier de raccordement de chaînes photovoltaïques (exemple à 4 entrées).","ev-charger.desc":"Borne de recharge pour véhicule électrique.","breaker.state.open":"Ouvert","disconnector.state.open":"Ouvert","earthing-switch.state.open":"Ouvert","fuse.state.blown":"Fondu","load-switch.state.open":"Ouvert","gfci-breaker.state.open":"Ouvert","rcd.state.open":"Ouvert","recloser.state.open":"Ouvert","contactor.state.open":"Ouvert","thermal-overload.state.tripped":"Déclenché","transfer-switch.state.position":"Position (normal/secours/arrêt)","dc-disconnector.state.open":"Ouvert","battery.param.E":"Capacité","busbar.param.Un":"Tension nominale","converter-bidir.param.S":"Puissance apparente","dc-dc-converter.param.P":"Puissance","mppt.param.I":"Courant nominal","load.param.P":"Puissance active","load.param.cosphi":"Facteur de puissance","ngr.param.R":"Résistance","shunt-capacitor.param.Q":"Puissance réactive","shunt-capacitor.param.stages":"Gradins","transformer-2w.param.S":"Puissance apparente","transformer-2w.param.ratio":"Rapport de transformation","gfci-breaker.param.In":"Courant nominal","panelboard.param.In":"Courant nominal","gfci-breaker.param.IDn":"Courant différentiel résiduel nominal","rcd.param.IDn":"Courant différentiel résiduel nominal","breaker.param.In":"Courant nominal","breaker.param.poles":"Pôles","breaker.param.Icu":"Pouvoir de coupure","disconnector.param.In":"Courant nominal","fuse.param.In":"Courant nominal","resistor.name":"Résistance (R)","capacitor.name":"Condensateur (C)","diode.name":"Diode (D)","indicator-light.name":"Voyant lumineux (HL)","push-button.name":"Bouton-poussoir (SB)","relay-coil.name":"Bobine de relais (KA)","make-contact.name":"Contact à fermeture (NO)","break-contact.name":"Contact à ouverture (NC)","bell.name":"Sonnerie (HA)","terminal.name":"Borne / jonction (X)","fuse-switch-disconnector.name":"Interrupteur-sectionneur à fusibles","socket-outlet.name":"Prise de courant / connecteur","inductor.name":"Bobine d'inductance (L)","voltage-regulator.name":"Régulateur de tension (T)","dc-motor.name":"Moteur à courant continu (M)","heater.name":"Élément chauffant (EH)","selector-switch.name":"Commutateur sélecteur (SA)","limit-switch.name":"Interrupteur de fin de course (SQ)","proximity-switch.name":"Détecteur de proximité (SQ)","time-relay.name":"Relais temporisé (KT)","buzzer.name":"Avertisseur sonore (HA)","siren.name":"Sirène (HA)","thermocouple.name":"Thermocouple (BT)","thyristor.name":"Thyristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diode Zener (D)","igbt.name":"IGBT","plc.name":"Automate programmable (API) / contrôleur","ups.name":"ASI","power-supply.name":"Alimentation (PS)","genset.name":"Groupe électrogène (G)","protective-relay.name":"Relais de protection","overcurrent-relay.name":"Relais de surintensité (50/51)","undervoltage-relay.name":"Relais de sous-tension (27)","reverse-power-relay.name":"Relais de retour de puissance (32)","distance-relay.name":"Relais de distance (21)","phase-failure-relay.name":"Relais de manque de phase","buchholz-relay.name":"Relais Buchholz (63)","power-factor-meter.name":"Cosphimètre (cosφ)","synchronoscope.name":"Synchronoscope","varmeter.name":"Varmètre (var)","resistor.desc":"Résistance générale / de limitation de courant / de freinage.","capacitor.desc":"Condensateur général / de filtrage / de bus DC. Utilisez le condensateur shunt pour la compensation du facteur de puissance.","diode.desc":"Diode de redressement / roue libre / protection. t1 = anode (haut), t2 = cathode (bas).","indicator-light.desc":"Voyant lumineux de signalisation / d'état.","push-button.desc":"Bouton-poussoir manuel à rappel automatique (contact à fermeture NO).","relay-coil.desc":"Bobine de commande de relais / contacteur (rectangle).","make-contact.desc":"Contact auxiliaire normalement ouvert (à fermeture).","break-contact.desc":"Contact auxiliaire normalement fermé (à ouverture).","bell.desc":"Sonnerie de signalisation / d'alarme.","terminal.desc":"Borne / boîte de jonction / nœud de connexion.","fuse-switch-disconnector.desc":"Interrupteur-sectionneur à fusibles, manœuvrable en charge.","socket-outlet.desc":"Prise de courant / connecteur multipolaire.","inductor.desc":"Bobine d'inductance générale / self / self de choc.","voltage-regulator.desc":"Régulateur de tension à induction réglable / autotransformateur.","dc-motor.desc":"Moteur à courant continu (symbole général à excitation série).","heater.desc":"Élément chauffant résistif / charge de chauffage.","selector-switch.desc":"Commutateur sélecteur / à came rotatif (à position maintenue).","limit-switch.desc":"Interrupteur de fin de course / de position (NO, à commande mécanique).","proximity-switch.desc":"Capteur de proximité / détecteur de proximité sans contact.","time-relay.desc":"Bobine de relais temporisé (à fonctionnement retardé).","buzzer.desc":"Avertisseur sonore de signalisation.","siren.desc":"Sirène sonore / d'alarme.","thermocouple.desc":"Capteur de température à thermocouple.","thyristor.desc":"Thyristor triode à blocage inverse / SCR. t1 = anode (haut), t2 = cathode (bas).","triac.desc":"Thyristor triode bidirectionnel (TRIAC).","zener-diode.desc":"Diode Zener / de régulation de tension. t1 = anode (haut), t2 = cathode (bas).","igbt.desc":"IGBT à enrichissement canal N. t1 = collecteur (haut), t2 = émetteur (bas), t_g = grille.","plc.desc":"Automate programmable industriel (API).","ups.desc":"Alimentation sans interruption (ASI) online / standby.","power-supply.desc":"Alimentation à découpage AC→DC / alimentation DC. t_ac en haut (~), t_dc en bas (=).","genset.desc":"Groupe électrogène diesel / gaz.","protective-relay.desc":"Relais de mesure / protection, symbole général (IEC 60617).","overcurrent-relay.desc":"Relais de protection contre les surintensités (ANSI 50/51).","undervoltage-relay.desc":"Relais de protection contre les sous-tensions (ANSI 27).","reverse-power-relay.desc":"Relais de protection contre le retour de puissance / de courant (ANSI 32).","distance-relay.desc":"Relais de protection de distance / à minimum d'impédance (ANSI 21).","phase-failure-relay.desc":"Relais de protection contre le manque / la perte de phase.","buchholz-relay.desc":"Relais Buchholz / à gaz (ANSI 63).","power-factor-meter.desc":"Cosphimètre (cosφ).","synchronoscope.desc":"Indicateur de synchronisation / synchronoscope.","varmeter.desc":"Varmètre (mesure de puissance réactive, var).","make-contact.state.closed":"Fermé","break-contact.state.open":"Ouvert","fuse-switch-disconnector.state.open":"Ouvert","selector-switch.state.open":"Ouvert","limit-switch.state.closed":"Fermé","resistor.param.R":"Résistance","resistor.param.P":"Puissance nominale","capacitor.param.C":"Capacité","capacitor.param.Un":"Tension nominale","indicator-light.param.color":"Couleur","inductor.param.L":"Inductance","inductor.param.In":"Courant nominal","voltage-regulator.param.ratio":"Plage de régulation","heater.param.P":"Puissance","ups.param.S":"Puissance apparente","power-supply.param.Vdc":"Tension de sortie","genset.param.P":"Puissance"},nC={ui:eC,library:tC},oC={"common.unnamed":"Unbenannt","common.close":"Schließen","common.yes":"Ja","common.no":"Nein","topbar.theme.toLight":"Zu Hell wechseln","topbar.theme.toDark":"Zu Dunkel wechseln","topbar.theme.currentDark":"Aktuell: Dunkles Thema","topbar.theme.currentLight":"Aktuell: Helles Thema","topbar.lang.toEnglish":"Zu Englisch wechseln","topbar.lang.toChinese":"Zu Chinesisch wechseln","topbar.lang.currentEnglish":"Aktuell: Englisch","topbar.lang.currentChinese":"Aktuell: Chinesisch","topbar.export.label":"Exportieren","topbar.export.tooltip":"SVG-Vektor (editierbar), PNG-Bitmap (2× HiDPI) oder DXF (CAD)","topbar.export.pngFailed":"PNG-Export fehlgeschlagen: {err}","topbar.export.dxfFailed":"DXF-Export fehlgeschlagen: {err}","topbar.file.label":"Datei","topbar.file.tooltip":"Lokales .json-Diagramm öffnen, speichern oder speichern unter","topbar.file.current":"Aktuell: {name}","topbar.file.new":"Neu","topbar.file.open":"Öffnen…","topbar.file.save":"Speichern","topbar.file.saveAs":"Speichern unter…","topbar.file.newConfirm":"Bei „Neu“ gehen nicht gespeicherte Änderungen verloren. Fortfahren?","topbar.file.openFailed":"Öffnen fehlgeschlagen: {err}","topbar.file.saveFailed":"Speichern fehlgeschlagen: {err}","topbar.file.fileDescription":"OneLineEditor-Diagramm","outline.title":"Gliederung","outline.collapse":"Einklappen","outline.collapseAria":"Gliederung einklappen","outline.empty":"(Keine Elemente — aus der Bibliothek hierher ziehen, um zu starten)","props.title":"Eigenschaften","props.node":"Elektrischer Knoten","props.wire":"Leitung","props.bus":"Sammelschiene","props.junction":"Verbindungspunkt","props.junctionPos":"Position","props.nSelected":"{n} ausgewählt","props.empty":"Nichts ausgewählt","props.multi":"{n} Objekte ausgewählt","props.name":"Name","props.note":"Notiz","props.label":"Beschriftung","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Elektrischer Knoten {id} nicht gefunden","props.wireNotFound":"Leitung {id} nicht gefunden","props.nodeStats":"{terminals} Anschlüsse · {elements} Elemente","props.selectElement":"{label} auswählen","props.selectWholeNode":"Gesamten elektrischen Knoten auswählen","props.annText":"Text","props.annRect":"Rechteck","props.annEllipse":"Ellipse","props.annLine":"Linie","props.annTable":"Tabelle","props.annNotFound":"Beschriftung {id} nicht gefunden","props.annLabel":"Bezeichnung","props.annLabelPlaceholder":"z. B. Verteiler 1","props.color":"Farbe","props.size":"Größe","props.sizeReset":"Auf 100 % zurücksetzen","props.labelShown":"Sichtbar","props.labelHidden":"Ausgeblendet","props.color.default":"Standard","props.color.red":"Rot","props.color.amber":"Bernstein","props.color.green":"Grün","props.color.blue":"Blau","props.color.gray":"Grau","props.annStroke":"Linienart","props.annStrokeSolid":"Durchgezogen","props.annStrokeDashed":"Gestrichelt","props.annStrokeDotted":"Gepunktet","props.annStrokeWidth":"Stärke","props.annWidthThin":"Dünn","props.annWidthMedium":"Mittel","props.annWidthThick":"Dick","props.annFill":"Füllung","props.annFillNone":"Keine","props.annFillTint":"Farbton","props.annArrow":"Pfeile","props.annArrowNone":"Keine","props.annArrowEnd":"Einseitig","props.annArrowBoth":"Beidseitig","props.annFontSize":"Schriftgröße","props.annRows":"Zeilen","props.annCols":"Spalten","view.zoomOut":"Verkleinern","view.zoomOutHint":"Stufenweise verkleinern; auch Mausrad ↓ oder ⌘−","view.reset":"Auf 100 % zurücksetzen","view.current":"Aktuell {z} %","view.zoomIn":"Vergrößern","view.zoomInHint":"Stufenweise vergrößern; auch Mausrad ↑ oder ⌘+","view.fit":"Ansicht einpassen","view.fitHint":"Die ganze Zeichnung automatisch zoomen und zentrieren","view.gridHide":"Raster ausblenden","view.gridShow":"Raster einblenden","view.gridHotkey":"G","view.gridHideHint":"Deaktiviert auch das Einrasten am Raster (freie Platzierung)","view.gridShowHint":"Aktiviert auch das Einrasten am Raster (rastet beim Ziehen auf 10 px ein)","view.gridHideAria":"Raster ausblenden und Einrasten deaktivieren","view.gridShowAria":"Raster einblenden und Einrasten aktivieren","view.label":"Beschriftungen","view.labelOff":"Aus","view.labelId":"ID","view.labelAll":"ID + Parameter","view.labelHint":"Sichtbarkeit und Schriftgröße der Beschriftungen (auch beim Export)","view.labelSize":"Größe","view.labelSizeSmaller":"Beschriftungen verkleinern","view.labelSizeLarger":"Beschriftungen vergrößern","view.standard":"Symbolnorm","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Ändert nur die Darstellung der Symbole — Verdrahtung, Positionen und Kennwerte bleiben unberührt. Leistungsschalter und Sicherung werden unterschiedlich gezeichnet.","view.labelSizeReset":"Schriftgröße zurücksetzen","library.title":"Bibliothek","tool.draw":"Zeichnen","tool.drawHint":"Text, Rahmen, Kreise, Linien und Tabellen — freie Anmerkungen über der Zeichnung","library.empty":"Keine passenden Elemente","cat.custom":"In dieser Zeichnung","library.customTag":"eigen","library.customHint":"Von dieser Zeichnung definiert — in keiner anderen Bibliothek vorhanden","library.createComponent":"Neue Komponente…","library.searchPlaceholder":"Elemente suchen…","library.searchAria":"Elemente suchen","library.clearSearch":"Suche löschen","library.itemHint":"Klicken für Platzierungsmodus oder auf die Zeichenfläche ziehen","tool.select":"Auswählen","tool.selectHint":"Klicken zum Auswählen, Rahmen für Mehrfachauswahl, Rechtsklick für Menü","tool.pan":"Verschieben","tool.panHint":"Zeichenfläche ziehen; Leertaste schaltet vorübergehend um","tool.wire":"Leitung","tool.wireHint":"Von einem Anschluss/einer Sammelschiene/einem Verbindungspunkt ziehen; auf freie Fläche setzt einen Verbindungspunkt, auf eine Leitung setzt einen Abzweig","tool.bus":"Sammelschiene","tool.busHint":"Auf der Zeichenfläche ziehen — drücken für Anfang, loslassen für Ende","tool.junction":"Verbindungspunkt","tool.junctionHint":"Auf die Zeichenfläche klicken, um einen Verbindungspunkt (Knoten) zu setzen; Leitungen können frei daran angeschlossen werden","tool.place":"Platzieren","tool.placeHint":"Klicken zum Platzieren; oder von einem Anschluss/einer Sammelschiene ziehen, um zu platzieren und zu verbinden","tool.text":"Text","tool.textHint":"Auf die Zeichenfläche klicken, um eine Textnotiz zu setzen; Doppelklick auf vorhandenen Text zum Bearbeiten","tool.rect":"Rechteck","tool.rectHint":"Ziehen, um ein Rechteck / einen Gruppenrahmen zu zeichnen (standardmäßig gestrichelt); Shift für ein Quadrat","tool.ellipse":"Ellipse","tool.ellipseHint":"Ziehen, um eine Ellipse zu zeichnen; Shift für einen Kreis","tool.line":"Linie","tool.lineHint":"Ziehen, um eine Beschriftungslinie zu zeichnen; Shift rastet auf 45°; Pfeile im Panel einstellen","tool.table":"Tabelle","tool.tableHint":"Ziehen, um Spalten × Zeilen aufzuziehen (Live-Anzeige), oder klicken für eine Standardtabelle; Doppelklick auf Zellen zum Eintippen","mode.selectWithSel":"Elemente ziehen · Anschlüsse ziehen zum Verbinden · Rechtsklick für Menü","mode.selectEmpty":"Klicken zum Auswählen · Ziehen zum Verschieben · Rahmen für Mehrfachauswahl · Rechtsklick für Menü","mode.pan":"Zeichenfläche ziehen · Mausrad zum Zoomen · Leertaste gedrückt halten, um in jedem Werkzeug zu verschieben","mode.wireDragging":"Auf einem Anschluss/einer Sammelschiene/einem Verbindungspunkt loslassen; Loslassen auf freier Fläche setzt einen Verbindungspunkt","mode.wireInit":"Auf einem beliebigen Verbindungspunkt oder freier Fläche drücken, zum Ziel ziehen und loslassen","mode.busDragging":"Ziehen legt die Richtung der Sammelschiene fest; Loslassen legt das Ende fest","mode.busInit":"Auf der Zeichenfläche drücken für den Anfang, ziehen, loslassen für das Ende","mode.junction":"Auf die Zeichenfläche klicken, um einen Verbindungspunkt zu setzen","mode.placeNoKind":"Einen Elementtyp aus der Bibliothek links auswählen","mode.placeFromTerm":"Am Ziel loslassen — das neue Element wird mit dem Quellanschluss verbunden","mode.placeNormal":"Auf freie Fläche klicken zum Platzieren; oder von einem Anschluss / einer Sammelschiene ziehen, um zu platzieren und zu verbinden","mode.text":"Klicken, um Text zu setzen · Doppelklick zum Bearbeiten · Ziehen zum Verschieben der Auswahl · Entf zum Entfernen","mode.rect":"Ziehen, um ein Rechteck zu zeichnen · Shift für Quadrat · nach dem Loslassen skalieren und beschriften","mode.ellipse":"Ziehen, um eine Ellipse zu zeichnen · Shift für Kreis · nach dem Loslassen skalieren, umfärben und beschriften","mode.line":"Ziehen, um eine Linie zu zeichnen · Shift rastet auf 45° · Pfeile nach dem Loslassen im Panel hinzufügen","mode.table":"Ziehen, um das Raster aufzuziehen, oder klicken für eine 3×3-Tabelle · Doppelklick auf Zellen zum Eintippen","mode.annTextSel":"Text anklicken zum Bearbeiten · Ziehen zum Verschieben · Entf zum Entfernen","mode.annTableSel":"Zelle anklicken zum Ausfüllen · Ziehen zum Verschieben · Entf zum Entfernen","mode.annShapeSel":"Ziehen zum Verschieben · Anfasser ziehen zum Skalieren · Stil im Panel ändern · Entf zum Entfernen","mode.annEditing":"Eingeben · Enter zum Bestätigen · Esc zum Abbrechen · oder die ✓ / ✕ Schaltflächen","mode.escSelect":"Esc hebt die Auswahl auf","mode.escOther":"Rechtsklick / Esc zum Abbrechen","tool.placeNoKindTooltip":"Einen Typ in der Bibliothek links auswählen, dann auf die Zeichenfläche klicken","tool.undo":"Rückgängig","tool.undoHint":"Letzte Änderung rückgängig machen (Verschieben / Drehen / Löschen usw.)","tool.redo":"Wiederholen","tool.redoHint":"Letzte rückgängig gemachte Änderung wiederherstellen","layout.label":"Layout","layout.hint":"Gesamtes Diagramm oder nur die Auswahl automatisch anordnen, Lücken auffüllen","layout.allAuto":"Alles automatisch anordnen","layout.selAuto":"Auswahl automatisch anordnen","layout.allFill":"Nicht platzierte auffüllen","layout.selFill":"Nicht platzierte in Auswahl auffüllen","tool.more":"Mehr","tool.moreHint":"Rückgängig / Wiederholen / Layout","view.menu":"Ansicht","view.menuHint":"Zoom, Einpassen, Raster","ctx.ariaNode":"Knotenaktionen","ctx.ariaWire":"Leitungsaktionen","ctx.ariaElement":"Elementaktionen","ctx.ariaEdit":"Bearbeitungsaktionen","ctx.done":"Fertig","ctx.cancel":"Abbrechen","ctx.rotate":"Um 90° drehen","ctx.rotateHint":"Auswahl im Uhrzeigersinn drehen; Leitungen werden über neue Anschlüsse neu geführt","ctx.mirror":"Horizontal spiegeln","ctx.mirrorTitle":"Spiegeln","ctx.mirrorHint":"Auswahl links-rechts spiegeln","ctx.delete":"Löschen","ctx.color":"Farbe","ctx.colorDefault":"Standard","ctx.colorRed":"Rot","ctx.colorAmber":"Bernstein","ctx.colorGreen":"Grün","ctx.colorBlue":"Blau","ctx.colorGray":"Grau","ctx.deleteHintNode":"Alle Leitungen an diesem Knoten trennen (Elemente bleiben erhalten)","ctx.deleteHintWire":"Nur diese Leitung entfernen (andere Leitungen am selben Knoten bleiben erhalten)","ctx.deleteHintElement":"Auswahl und ihre Leitungen entfernen","ctx.resetWirePath":"Auf automatische Führung zurücksetzen","ctx.resetWirePathHint":"Manuelle Eckpunkte verwerfen und die Leitung automatisch neu zeichnen lassen","menu.undo":"Rückgängig","menu.redo":"Wiederholen","menu.cut":"Ausschneiden","menu.copy":"Kopieren","menu.paste":"Einfügen","menu.rotate":"Um 90° drehen","menu.mirror":"Spiegeln","menu.resetLabel":"Beschriftung zurücksetzen","menu.selectAll":"Alles auswählen","menu.disconnect":"Diese Leitung trennen","menu.delete":"Löschen","io.parseFailed":"JSON-Parsing fehlgeschlagen: {err}","io.notObject":"Datei ist kein JSON-Objekt","io.versionMismatch":"Versionskonflikt: erwartet „1“, erhalten {actual}","io.elementsMissing":"`elements` fehlt oder ist kein Array","compile.duplicateId":"Doppelte Element-ID: „{id}“","compile.unknownKind":'Unbekannter Elementtyp kind="{kind}"',"compile.invalidTermRef":"Ungültige Anschlussreferenz „{ref}“","compile.elementMissing":"Verweis auf unbekanntes Element „{id}“","compile.missingPin":"Element „{id}“ (kind={kind}) hat keinen Pin „{pin}“; verfügbar: {available}","compile.singleTerminal":"Knoten hat nur einen Anschluss — ignoriert","compile.layoutMissingElement":"layout-Schlüssel „{id}“ verweist auf ein unbekanntes Element","compile.elementUnconnected":"Element „{id}“ hat keine Verbindungen","cat.busbar":"Sammelschiene / Verdrahtung","cat.switching":"Schalten","cat.protection":"Schutz","cat.motor-control":"Motorsteuerung","cat.transformer":"Transformator","cat.instrument-transformer":"Messwandler","cat.measurement":"Messung","cat.source":"Quelle","cat.load":"Last","cat.storage":"Speicher","cat.compensation":"Kompensation","cat.grounding":"Erdung","cat.renewable":"Erneuerbare Energien / Leistungselektronik","onboard.title":"Schnellstart","onboard.step1.title":"Ein Bauteil platzieren","onboard.step1.body":"Werkzeug Platzieren (P) wählen und einen Typ aus der Bibliothek auf die Zeichenfläche ziehen","onboard.step2.title":"Verdrahten","onboard.step2.body":"Werkzeug Leitung (W) verwenden: von einem Anschluss zum anderen ziehen — auf freie Fläche ziehen setzt einen Verbindungspunkt","onboard.step3.title":"Eine Sammelschiene ist eine gemeinsame Schiene, keine Leitung","onboard.step3.body":"Das Werkzeug Sammelschiene (B) nur verwenden, wenn sich mehrere Stromkreise eine Schiene teilen. Keine Sammelschiene benutzen, um zwei Geräte zu verbinden — einfach die Anschlüsse direkt verdrahten (W).","onboard.dismiss":"Verstanden"},rC={"arc-suppression-coil.name":"Erdschlusslöschspule","arrester.name":"Überspannungsableiter (FBL)","async-motor.name":"Asynchronmotor","autotransformer.name":"Spartransformator","battery.name":"Batteriespeicher","breaker.name":"Leistungsschalter (QF)","busbar.name":"Sammelschienenabschnitt","converter-bidir.name":"Bidirektionaler Umrichter (PCS)","dc-dc-converter.name":"DC/DC-Wandler","mppt.name":"MPPT-Regler","ct.name":"Stromwandler (CT)","disconnector.name":"Trennschalter (QS)","earth.name":"Erde","earthing-switch.name":"Erdungsschalter (QE)","fuse.name":"Sicherung (FU)","generator.name":"Generator (G)","grid-source.name":"Netzeinspeisung","grounding-transformer.name":"Erdungstransformator (Zickzack)","inverter.name":"Wechselrichter (DC→AC)","load-switch.name":"Lastschalter","load.name":"Last","luminaire.name":"Leuchte (Beleuchtungslast)","panelboard.name":"Verteilerschrank / Lastzentrum","ngr.name":"Sternpunkt-Erdungswiderstand (NGR)","pt.name":"Spannungswandler (PT)","pv.name":"PV-Modul","rectifier.name":"Gleichrichter (AC→DC)","series-reactor.name":"Längsdrosselspule","shunt-capacitor.name":"Kompensationskondensator","shunt-reactor.name":"Querdrosselspule","sync-motor.name":"Synchronmotor","transformer-2w.name":"Zweiwicklungstransformator","transformer-3w.name":"Dreiwicklungstransformator","wind-turbine.name":"Windenergieanlage","gfci-breaker.name":"GFCI-Leistungsschalter (RCBO)","rcd.name":"Fehlerstrom-Schutzeinrichtung (RCD)","recloser.name":"Recloser","energy-meter.name":"Energiezähler (Wh)","voltmeter.name":"Spannungsmesser (V)","ammeter.name":"Amperemeter (A)","wattmeter.name":"Wattmeter (W)","frequency-meter.name":"Frequenzmesser (Hz)","contactor.name":"Schütz (KM)","motor-starter.name":"Motorstarter","thermal-overload.name":"Thermisches Überlastrelais","vfd.name":"Frequenzumrichter (VFD)","soft-starter.name":"Sanftstarter","transfer-switch.name":"Netzumschalter (ATS)","dc-disconnector.name":"Gleichstrom-Trennschalter","dc-combiner.name":"Generatoranschlusskasten","ev-charger.name":"EV-Ladestation","arc-suppression-coil.desc":"Resonante Sternpunkterdung: Induktivität gegen Erde","busbar.desc":"Dehnbarer Einzelsammelschienenabschnitt mit mehreren Abzweigen","converter-bidir.desc":"Speicherumrichter: bidirektional AC ↔ DC","dc-dc-converter.desc":"DC/DC-Wandler / Gleichstromladegerät (IEC 60617)","mppt.desc":"MPPT-Solarladeregler (DC/DC, Maximum-Power-Point-Tracking)","earthing-switch.desc":"Trennschalter + Erdverbindung, ein Anschluss","grid-source.desc":"Starres Netz / externes Versorgungsnetz","grounding-transformer.desc":"Stern-Zickzack-Transformator zur Sternpunkterdung","load.desc":"Abstrakte Last (Pfeil für Stromabgang)","luminaire.desc":"Beleuchtungslast (allgemeines Leuchtensymbol IEC 60617)","ngr.desc":"Niederohmige Erdung: Transformator-Sternpunkt gegen Erde","series-reactor.desc":"Gleiches Symbol wie die Querdrosselspule; Unterscheidung nach Verwendungszweck","wind-turbine.desc":"Windenergieanlage: Generator + Drei-Blatt-Rotor-Kennzeichnung","gfci-breaker.desc":"Fehlerstromschutzschalter mit Überstromschutz (UL943 / IEC 61009). In Nordamerika GFCI, in Europa RCBO.","rcd.desc":"Fehlerstromschutzschalter ohne Überstromschutz (IEC 61008).","recloser.desc":"Automatischer Mittelspannungs-Recloser.","energy-meter.desc":"Wirkarbeitszähler (kWh) — Hausanschluss / Unterzähler.","contactor.desc":"Hauptstromkreis-Schütz, meist zusammen mit einem Thermorelais und einem Motor verwendet.","motor-starter.desc":"Motorstarter (allgemeines Symbol nach IEC 60617).","thermal-overload.desc":"Thermisches Überlastschutzrelais für Motoren; sitzt zwischen Schütz und Motor.","vfd.desc":"Frequenzumrichter zur Drehzahlregelung von Asynchronmotoren.","soft-starter.desc":"Sanftstarter für Motoren (thyristorbasiertes Anlaufen mit reduzierter Spannung).","transfer-switch.desc":"Umschalter für zwei Quellen (automatisch/manuell). Zwei Quelleneingänge + ein Lastausgang, mechanisch verriegelt.","dc-disconnector.desc":"Gleichstrom-Trennschalter — Trennung auf der Gleichstromseite von PV-Strings / Batteriespeichern.","dc-combiner.desc":"PV-String-Generatoranschlusskasten (Beispiel mit 4 Eingängen).","ev-charger.desc":"Ladestation für Elektrofahrzeuge.","breaker.state.open":"Offen","disconnector.state.open":"Offen","earthing-switch.state.open":"Offen","fuse.state.blown":"Durchgebrannt","load-switch.state.open":"Offen","gfci-breaker.state.open":"Offen","rcd.state.open":"Offen","recloser.state.open":"Offen","contactor.state.open":"Offen","thermal-overload.state.tripped":"Ausgelöst","transfer-switch.state.position":"Position (normal/Notbetrieb/aus)","dc-disconnector.state.open":"Offen","battery.param.E":"Kapazität","busbar.param.Un":"Bemessungsspannung","converter-bidir.param.S":"Nennleistung","dc-dc-converter.param.P":"Leistung","mppt.param.I":"Bemessungsstrom","load.param.P":"Wirkleistung","load.param.cosphi":"Leistungsfaktor","ngr.param.R":"Widerstand","shunt-capacitor.param.Q":"Blindleistung","shunt-capacitor.param.stages":"Stufen","transformer-2w.param.S":"Nennleistung","transformer-2w.param.ratio":"Übersetzungsverhältnis","gfci-breaker.param.In":"Bemessungsstrom","panelboard.param.In":"Bemessungsstrom","gfci-breaker.param.IDn":"Bemessungsdifferenzstrom","rcd.param.IDn":"Bemessungsdifferenzstrom","breaker.param.In":"Bemessungsstrom","breaker.param.poles":"Polzahl","breaker.param.Icu":"Ausschaltvermögen","disconnector.param.In":"Bemessungsstrom","fuse.param.In":"Bemessungsstrom","resistor.name":"Widerstand (R)","capacitor.name":"Kondensator (C)","diode.name":"Diode (D)","indicator-light.name":"Meldeleuchte (HL)","push-button.name":"Taster (SB)","relay-coil.name":"Relaisspule (KA)","make-contact.name":"Schließer (NO)","break-contact.name":"Öffner (NC)","bell.name":"Klingel (HA)","terminal.name":"Klemme / Verbindungspunkt (X)","fuse-switch-disconnector.name":"Sicherungslasttrennschalter","socket-outlet.name":"Steckdose / Steckverbinder","inductor.name":"Spule (L)","voltage-regulator.name":"Spannungsregler (T)","dc-motor.name":"Gleichstrommotor (M)","heater.name":"Heizelement (EH)","selector-switch.name":"Wahlschalter (SA)","limit-switch.name":"Endschalter (SQ)","proximity-switch.name":"Näherungsschalter (SQ)","time-relay.name":"Zeitrelais (KT)","buzzer.name":"Summer (HA)","siren.name":"Sirene (HA)","thermocouple.name":"Thermoelement (BT)","thyristor.name":"Thyristor (V)","triac.name":"Triac (V)","zener-diode.name":"Z-Diode (D)","igbt.name":"IGBT","plc.name":"SPS / Steuerung","ups.name":"USV","power-supply.name":"Netzteil (PS)","genset.name":"Generatoraggregat (G)","protective-relay.name":"Schutzrelais","overcurrent-relay.name":"Überstromrelais (50/51)","undervoltage-relay.name":"Unterspannungsrelais (27)","reverse-power-relay.name":"Rückleistungsrelais (32)","distance-relay.name":"Distanzrelais (21)","phase-failure-relay.name":"Phasenausfallrelais","buchholz-relay.name":"Buchholzrelais (63)","power-factor-meter.name":"Leistungsfaktormesser (cosφ)","synchronoscope.name":"Synchronoskop","varmeter.name":"Blindleistungsmesser (var)","resistor.desc":"Allgemeiner Widerstand / Vorwiderstand / Bremswiderstand.","capacitor.desc":"Allgemeiner / Filter- / Zwischenkreiskondensator. Für Blindleistungskompensation den Kompensationskondensator verwenden.","diode.desc":"Gleichrichter- / Freilauf- / Schutzdiode. t1 = Anode (oben), t2 = Kathode (unten).","indicator-light.desc":"Signal- / Zustandsmeldeleuchte.","push-button.desc":"Handbetätigter Taster mit selbsttätiger Rückstellung (Schließer).","relay-coil.desc":"Betätigungsspule eines Relais / Schützes (Rechtecksymbol).","make-contact.desc":"Normalerweise geöffneter Hilfskontakt (Schließer).","break-contact.desc":"Normalerweise geschlossener Hilfskontakt (Öffner).","bell.desc":"Signalglocke / Alarmglocke.","terminal.desc":"Klemme / Abzweigdose / Verbindungsknoten.","fuse-switch-disconnector.desc":"Lastschaltbarer Sicherungslasttrennschalter.","socket-outlet.desc":"Steckdose / mehrpoliger Steckverbinder.","inductor.desc":"Allgemeine Spule / Induktivität / Drossel.","voltage-regulator.desc":"Regelbarer Induktions- / Spartransformator-Spannungsregler.","dc-motor.desc":"Gleichstrommotor (allgemeines Symbol, Reihenschluss).","heater.desc":"Ohmsches Heizelement / Heizlast.","selector-switch.desc":"Wahl-/Umschalter (Drehschalter, rastend).","limit-switch.desc":"Positions-/Endschalter (Schließer, mechanisch betätigt).","proximity-switch.desc":"Näherungssensor / berührungsloser Näherungsschalter.","time-relay.desc":"Zeitverzögerungsrelais (ansprechverzögert).","buzzer.desc":"Signalsummer.","siren.desc":"Akustische Sirene / Alarmsignal.","thermocouple.desc":"Thermoelement-Temperaturfühler.","thyristor.desc":"Rückwärtssperrender Thyristor. t1 = Anode (oben), t2 = Kathode (unten).","triac.desc":"Bidirektionaler Thyristor (Triac).","zener-diode.desc":"Z-Diode / Spannungsreferenzdiode. t1 = Anode (oben), t2 = Kathode (unten).","igbt.desc":"N-Kanal-Anreicherungs-IGBT. t1 = Kollektor (oben), t2 = Emitter (unten), t_g = Gate.","plc.desc":"Speicherprogrammierbare Steuerung (SPS).","ups.desc":"Online- / Standby-unterbrechungsfreie Stromversorgung.","power-supply.desc":"AC→DC-Schaltnetzteil / Gleichstromnetzteil. t_ac oben (~), t_dc unten (=).","genset.desc":"Diesel-/Gas-Generatoraggregat.","protective-relay.desc":"Mess- / Schutzrelais, allgemeines Symbol (IEC 60617).","overcurrent-relay.desc":"Überstromschutzrelais (ANSI 50/51).","undervoltage-relay.desc":"Unterspannungsschutzrelais (ANSI 27).","reverse-power-relay.desc":"Rückleistungs-/Rückstromschutzrelais (ANSI 32).","distance-relay.desc":"Distanz-/Unterimpedanzschutzrelais (ANSI 21).","phase-failure-relay.desc":"Phasenausfall-/Phasenverlustschutzrelais.","buchholz-relay.desc":"Buchholzrelais / Gasrelais (ANSI 63).","power-factor-meter.desc":"Leistungsfaktormesser (cosφ).","synchronoscope.desc":"Synchronisieranzeige / Synchronoskop.","varmeter.desc":"Blindleistungsmesser (var).","make-contact.state.closed":"Geschlossen","break-contact.state.open":"Offen","fuse-switch-disconnector.state.open":"Offen","selector-switch.state.open":"Offen","limit-switch.state.closed":"Geschlossen","resistor.param.R":"Widerstand","resistor.param.P":"Bemessungsleistung","capacitor.param.C":"Kapazität","capacitor.param.Un":"Bemessungsspannung","indicator-light.param.color":"Farbe","inductor.param.L":"Induktivität","inductor.param.In":"Bemessungsstrom","voltage-regulator.param.ratio":"Regelbereich","heater.param.P":"Leistung","ups.param.S":"Nennleistung","power-supply.param.Vdc":"Ausgangsspannung","genset.param.P":"Leistung"},iC={ui:oC,library:rC},sC={"common.unnamed":"Sem título","common.close":"Fechar","common.yes":"Sim","common.no":"Não","topbar.theme.toLight":"Mudar para claro","topbar.theme.toDark":"Mudar para escuro","topbar.theme.currentDark":"Atual: tema escuro","topbar.theme.currentLight":"Atual: tema claro","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Atual: inglês","topbar.lang.currentChinese":"Atual: chinês","topbar.export.label":"Exportar","topbar.export.tooltip":"SVG vetorial (editável), PNG bitmap (2× HiDPI) ou DXF (CAD)","topbar.export.pngFailed":"Falha ao exportar PNG: {err}","topbar.export.dxfFailed":"Falha ao exportar DXF: {err}","topbar.file.label":"Arquivo","topbar.file.tooltip":"Abrir um diagrama .json local, salvar ou salvar como","topbar.file.current":"Atual: {name}","topbar.file.new":"Novo","topbar.file.open":"Abrir…","topbar.file.save":"Salvar","topbar.file.saveAs":"Salvar como…","topbar.file.newConfirm":"Criar um novo diagrama descartará as alterações não salvas. Continuar?","topbar.file.openFailed":"Falha ao abrir: {err}","topbar.file.saveFailed":"Falha ao salvar: {err}","topbar.file.fileDescription":"Diagrama OneLineEditor","outline.title":"Estrutura","outline.collapse":"Recolher","outline.collapseAria":"Recolher estrutura","outline.empty":"(Nenhum elemento — arraste da biblioteca para começar)","props.title":"Propriedades","props.node":"Nó elétrico","props.wire":"Fio","props.bus":"Barramento","props.junction":"Junção","props.junctionPos":"Posição","props.nSelected":"{n} selecionado(s)","props.empty":"Nada selecionado","props.multi":"{n} objetos selecionados","props.name":"Nome","props.note":"Nota","props.label":"Rótulo","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nó elétrico {id} não encontrado","props.wireNotFound":"Fio {id} não encontrado","props.nodeStats":"{terminals} terminais · {elements} elementos","props.selectElement":"Selecionar {label}","props.selectWholeNode":"Selecionar todo o nó elétrico","props.annText":"Texto","props.annRect":"Retângulo","props.annEllipse":"Elipse","props.annLine":"Linha","props.annTable":"Tabela","props.annNotFound":"Anotação {id} não encontrada","props.annLabel":"Rótulo","props.annLabelPlaceholder":"ex.: Quadro nº 1","props.color":"Cor","props.size":"Tamanho","props.sizeReset":"Voltar para 100%","props.labelShown":"Visível","props.labelHidden":"Oculto","props.color.default":"Padrão","props.color.red":"Vermelho","props.color.amber":"Âmbar","props.color.green":"Verde","props.color.blue":"Azul","props.color.gray":"Cinza","props.annStroke":"Traço","props.annStrokeSolid":"Sólido","props.annStrokeDashed":"Tracejado","props.annStrokeDotted":"Pontilhado","props.annStrokeWidth":"Espessura","props.annWidthThin":"Fina","props.annWidthMedium":"Média","props.annWidthThick":"Grossa","props.annFill":"Preenchimento","props.annFillNone":"Nenhum","props.annFillTint":"Tonalidade","props.annArrow":"Setas","props.annArrowNone":"Nenhuma","props.annArrowEnd":"Simples","props.annArrowBoth":"Dupla","props.annFontSize":"Tamanho da fonte","props.annRows":"Linhas","props.annCols":"Colunas","view.zoomOut":"Reduzir zoom","view.zoomOutHint":"Reduz o zoom por etapas; também roda ↓ ou ⌘−","view.reset":"Redefinir para 100%","view.current":"Atual {z}%","view.zoomIn":"Aumentar zoom","view.zoomInHint":"Aumenta o zoom por etapas; também roda ↑ ou ⌘+","view.fit":"Ajustar à tela","view.fitHint":"Aplica zoom automático e centraliza o desenho inteiro","view.gridHide":"Ocultar grade","view.gridShow":"Mostrar grade","view.gridHotkey":"G","view.gridHideHint":"Também desativa o encaixe à grade (posicionamento livre)","view.gridShowHint":"Também ativa o encaixe à grade (encaixa em 10px ao arrastar)","view.gridHideAria":"Ocultar grade e desativar encaixe","view.gridShowAria":"Mostrar grade e ativar encaixe","view.label":"Rótulos","view.labelOff":"Nenhum","view.labelId":"ID","view.labelAll":"ID + parâmetros","view.labelHint":"Visibilidade e tamanho dos rótulos (também na exportação)","view.labelSize":"Tamanho","view.labelSizeSmaller":"Diminuir o tamanho dos rótulos","view.labelSizeLarger":"Aumentar o tamanho dos rótulos","view.standard":"Norma dos símbolos","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Muda apenas o desenho dos símbolos — fiação, posições e valores não são alterados. Disjuntor e fusível diferem entre as duas.","view.labelSizeReset":"Redefinir o tamanho dos rótulos","library.title":"Biblioteca","tool.draw":"Desenhar","tool.drawHint":"Texto, caixas, círculos, linhas e tabelas — anotação livre sobre o desenho","library.empty":"Nenhum elemento encontrado","cat.custom":"Neste desenho","library.customTag":"próprio","library.customHint":"Definido por este desenho — não está na biblioteca de mais ninguém","library.createComponent":"Novo componente…","library.searchPlaceholder":"Buscar elementos…","library.searchAria":"Buscar elementos","library.clearSearch":"Limpar busca","library.itemHint":"Clique para entrar no modo de posicionamento ou arraste até a tela","tool.select":"Selecionar","tool.selectHint":"Clique para selecionar, arraste para selecionar vários, botão direito para o menu","tool.pan":"Panorâmica","tool.panHint":"Arraste a tela; a barra de espaço alterna temporariamente","tool.wire":"Fio","tool.wireHint":"Arraste de um pino/barramento/junção; soltar em espaço vazio cria uma junção, sobre um fio existente cria uma derivação","tool.bus":"Barramento","tool.busHint":"Arraste na tela — pressione para definir o início, solte para definir o fim","tool.junction":"Junção","tool.junctionHint":"Clique na tela para posicionar uma junção (nó); os fios se conectam livremente a ela","tool.place":"Posicionar","tool.placeHint":"Clique para posicionar; ou arraste de um terminal/barramento para posicionar e conectar","tool.text":"Texto","tool.textHint":"Clique na tela para inserir uma anotação de texto; clique duas vezes em uma existente para editar","tool.rect":"Retângulo","tool.rectHint":"Arraste para desenhar um retângulo / moldura de grupo (tracejado por padrão); Shift para um quadrado","tool.ellipse":"Elipse","tool.ellipseHint":"Arraste para desenhar uma elipse; Shift para um círculo","tool.line":"Linha","tool.lineHint":"Arraste para desenhar uma linha de anotação; Shift trava em 45°; as setas ficam no painel","tool.table":"Tabela","tool.tableHint":"Arraste para definir colunas × linhas (contagem em tempo real), ou clique para uma tabela padrão; clique duas vezes nas células para digitar","mode.selectWithSel":"Arraste elementos para mover · arraste terminais para conectar · botão direito para o menu","mode.selectEmpty":"Clique para selecionar · arraste para mover · seleção múltipla por área · botão direito para o menu","mode.pan":"Arraste a tela · role para o zoom · segure Espaço para deslocar em qualquer ferramenta","mode.wireDragging":"Solte em um pino/barramento/junção; soltar em espaço vazio cria uma junção","mode.wireInit":"Pressione em qualquer ponto de conexão ou espaço vazio, arraste até o destino e solte","mode.busDragging":"O arraste define a direção do barramento; soltar define o fim","mode.busInit":"Pressione na tela para definir o início, arraste, solte para definir o fim","mode.junction":"Clique na tela para posicionar uma junção","mode.placeNoKind":"Escolha um tipo de elemento na biblioteca à esquerda","mode.placeFromTerm":"Solte no destino — o novo elemento se conectará de volta ao terminal de origem","mode.placeNormal":"Clique em um espaço vazio para posicionar; ou arraste de um terminal/barramento para posicionar e conectar","mode.text":"Clique para inserir texto · clique duas vezes para editar · arraste o selecionado para mover · Del para remover","mode.rect":"Arraste para desenhar um retângulo · Shift para quadrado · redimensione e rotule após soltar","mode.ellipse":"Arraste para desenhar uma elipse · Shift para círculo · redimensione, recolora e rotule após soltar","mode.line":"Arraste para desenhar uma linha · Shift trava em 45° · adicione setas no painel após soltar","mode.table":"Arraste para definir a grade, ou clique para uma tabela 3×3 · clique duas vezes nas células para digitar","mode.annTextSel":"Clique no texto para editar · arraste para mover · Del para remover","mode.annTableSel":"Clique em uma célula para preencher · arraste para mover · Del para remover","mode.annShapeSel":"Arraste para mover · arraste as alças para redimensionar · reestilize no painel · Del para remover","mode.annEditing":"Digite · Enter para confirmar · Esc para cancelar · ou os botões ✓ / ✕","mode.escSelect":"Esc limpa a seleção","mode.escOther":"Botão direito / Esc para cancelar","tool.placeNoKindTooltip":"Escolha um tipo na biblioteca à esquerda e clique na tela","tool.undo":"Desfazer","tool.undoHint":"Desfaz a última edição (mover / girar / excluir etc.)","tool.redo":"Refazer","tool.redoHint":"Refaz a última edição desfeita","layout.label":"Layout","layout.hint":"Aplica o layout automático a todo o diagrama ou apenas à seleção, preenchendo lacunas","layout.allAuto":"Reaplicar layout automático","layout.selAuto":"Reaplicar layout automático na seleção","layout.allFill":"Preencher não posicionados","layout.selFill":"Preencher não posicionados na seleção","tool.more":"Mais","tool.moreHint":"Desfazer / refazer / layout","view.menu":"Visualização","view.menuHint":"Zoom, ajuste, grade","ctx.ariaNode":"Ações do nó","ctx.ariaWire":"Ações do fio","ctx.ariaElement":"Ações do elemento","ctx.ariaEdit":"Ações de edição","ctx.done":"Concluído","ctx.cancel":"Cancelar","ctx.rotate":"Girar 90°","ctx.rotateHint":"Gira a seleção no sentido horário; os fios se reconectam pelos novos terminais","ctx.mirror":"Espelhar horizontalmente","ctx.mirrorTitle":"Espelhar","ctx.mirrorHint":"Inverte a seleção da esquerda para a direita","ctx.delete":"Excluir","ctx.color":"Cor","ctx.colorDefault":"Padrão","ctx.colorRed":"Vermelho","ctx.colorAmber":"Âmbar","ctx.colorGreen":"Verde","ctx.colorBlue":"Azul","ctx.colorGray":"Cinza","ctx.deleteHintNode":"Desconecta todos os fios deste nó (os elementos permanecem)","ctx.deleteHintWire":"Remove apenas este fio (os demais no mesmo nó permanecem)","ctx.deleteHintElement":"Remove a seleção e seus fios","ctx.resetWirePath":"Redefinir para roteamento automático","ctx.resetWirePathHint":"Remove os vértices manuais e deixa o roteador redesenhar este fio","menu.undo":"Desfazer","menu.redo":"Refazer","menu.cut":"Recortar","menu.copy":"Copiar","menu.paste":"Colar","menu.rotate":"Girar 90°","menu.mirror":"Espelhar","menu.resetLabel":"Redefinir posição do rótulo","menu.selectAll":"Selecionar tudo","menu.disconnect":"Desconectar este fio","menu.delete":"Excluir","io.parseFailed":"Falha ao interpretar o JSON: {err}","io.notObject":"O arquivo não é um objeto JSON","io.versionMismatch":'Versão incompatível: esperado "1", recebido {actual}',"io.elementsMissing":"`elements` está ausente ou não é um array","compile.duplicateId":'ID de elemento duplicado: "{id}"',"compile.unknownKind":'Tipo de elemento desconhecido kind="{kind}"',"compile.invalidTermRef":'Referência de terminal inválida "{ref}"',"compile.elementMissing":'Referência a um elemento desconhecido "{id}"',"compile.missingPin":'O elemento "{id}" (kind={kind}) não possui o pino "{pin}"; disponíveis: {available}',"compile.singleTerminal":"O nó possui apenas um terminal — ignorado","compile.layoutMissingElement":'A chave de layout "{id}" referencia um elemento desconhecido',"compile.elementUnconnected":'O elemento "{id}" não possui nenhuma conexão',"cat.busbar":"Barramento / fiação","cat.switching":"Manobra","cat.protection":"Proteção","cat.motor-control":"Controle de motores","cat.transformer":"Transformador","cat.instrument-transformer":"Transformador de instrumento","cat.measurement":"Medição","cat.source":"Fonte","cat.load":"Carga","cat.storage":"Armazenamento","cat.compensation":"Compensação","cat.grounding":"Aterramento","cat.renewable":"Renováveis / eletrônica de potência","onboard.title":"Início rápido","onboard.step1.title":"Posicione um componente","onboard.step1.body":"Escolha a ferramenta Posicionar (P) e arraste um tipo da biblioteca até a tela","onboard.step2.title":"Conecte os fios","onboard.step2.body":"Use a ferramenta Fio (W): arraste de um pino a outro — arraste até um espaço vazio para criar uma junção","onboard.step3.title":"Um barramento é um trilho compartilhado, não um fio","onboard.step3.body":"Use a ferramenta Barramento (B) somente quando vários circuitos compartilham o mesmo trilho. Não use um barramento para ligar dois dispositivos — apenas conecte os pinos (W).","onboard.dismiss":"Entendi"},aC={"arc-suppression-coil.name":"Bobina de supressão de arco","arrester.name":"Para-raios (FBL)","async-motor.name":"Motor de indução","autotransformer.name":"Autotransformador","battery.name":"Armazenamento em bateria","breaker.name":"Disjuntor (QF)","busbar.name":"Segmento de barramento","converter-bidir.name":"Conversor bidirecional (PCS)","dc-dc-converter.name":"Conversor CC/CC","mppt.name":"Controlador MPPT","ct.name":"Transformador de corrente (CT)","disconnector.name":"Seccionador (QS)","earth.name":"Terra","earthing-switch.name":"Chave de aterramento (QE)","fuse.name":"Fusível (FU)","generator.name":"Gerador (G)","grid-source.name":"Fonte da rede","grounding-transformer.name":"Transformador de aterramento (zig-zag)","inverter.name":"Inversor (CC→CA)","load-switch.name":"Chave de carga","load.name":"Carga","luminaire.name":"Luminária (carga de iluminação)","panelboard.name":"Quadro de distribuição","ngr.name":"Resistor de aterramento de neutro (NGR)","pt.name":"Transformador de tensão (PT)","pv.name":"Módulo fotovoltaico","rectifier.name":"Retificador (CA→CC)","series-reactor.name":"Reator série","shunt-capacitor.name":"Capacitor em derivação","shunt-reactor.name":"Reator em derivação","sync-motor.name":"Motor síncrono","transformer-2w.name":"Transformador de dois enrolamentos","transformer-3w.name":"Transformador de três enrolamentos","wind-turbine.name":"Aerogerador","gfci-breaker.name":"Disjuntor GFCI (RCBO)","rcd.name":"Dispositivo de corrente residual (RCD)","recloser.name":"Religador","energy-meter.name":"Medidor de energia (Wh)","voltmeter.name":"Voltímetro (V)","ammeter.name":"Amperímetro (A)","wattmeter.name":"Wattímetro (W)","frequency-meter.name":"Frequencímetro (Hz)","contactor.name":"Contator (KM)","motor-starter.name":"Chave de partida de motor","thermal-overload.name":"Relé de sobrecarga térmica","vfd.name":"Inversor de frequência (VFD)","soft-starter.name":"Chave de partida suave","transfer-switch.name":"Chave de transferência (ATS)","dc-disconnector.name":"Seccionador CC","dc-combiner.name":"Caixa combinadora CC","ev-charger.name":"Carregador de veículo elétrico (VE)","arc-suppression-coil.desc":"Aterramento ressonante de neutro: indutor ligado à terra","busbar.desc":"Segmento de barramento único e extensível, com múltiplas derivações","converter-bidir.desc":"Conversor de armazenamento: CA ↔ CC bidirecional","dc-dc-converter.desc":"Conversor CC/CC / carregador CC (IEC 60617)","mppt.desc":"Controlador de carga solar MPPT (CC/CC, rastreamento do ponto de máxima potência)","earthing-switch.desc":"Seccionador + conexão à terra, porta única","grid-source.desc":"Barramento infinito / rede externa","grounding-transformer.desc":"Transformador estrela-zigue-zague para aterramento de neutro","load.desc":"Carga abstrata (seta de saída de corrente)","luminaire.desc":"Carga de iluminação (símbolo geral de luminária IEC 60617)","ngr.desc":"Aterramento de baixa resistência: neutro do transformador à terra","series-reactor.desc":"Mesmo símbolo do reator em derivação; diferenciado pelo uso","wind-turbine.desc":"Aerogerador: gerador + marca de rotor de três pás","gfci-breaker.desc":"Disjuntor de corrente residual com proteção contra sobrecorrente (UL943 / IEC 61009). GFCI na América do Norte / RCBO na Europa.","rcd.desc":"Disjuntor de corrente residual sem proteção contra sobrecorrente (IEC 61008).","recloser.desc":"Religador automático de média tensão.","energy-meter.desc":"Medidor de energia ativa (kWh) — entrada de serviço / submedição.","contactor.desc":"Contator de circuito principal; normalmente usado com um relé de sobrecarga térmica e um motor.","motor-starter.desc":"Chave de partida de motor (símbolo geral IEC 60617).","thermal-overload.desc":"Relé de sobrecarga térmica do motor; posicionado entre o contator e o motor.","vfd.desc":"Inversor de frequência (Variable Frequency Drive) para controle de velocidade de motores de indução.","soft-starter.desc":"Chave de partida suave do motor (partida a tensão reduzida com tiristores).","transfer-switch.desc":"Chave de transferência de duas fontes (ATS / manual). Duas entradas de fonte + uma saída de carga, com intertravamento mecânico.","dc-disconnector.desc":"Seccionador CC — isolamento do lado CC de string fotovoltaica / bateria.","dc-combiner.desc":"Caixa combinadora de strings fotovoltaicos (exemplo com 4 entradas).","ev-charger.desc":"Estação de recarga de veículos elétricos.","breaker.state.open":"Aberto","disconnector.state.open":"Aberto","earthing-switch.state.open":"Aberto","fuse.state.blown":"Queimado","load-switch.state.open":"Aberto","gfci-breaker.state.open":"Aberto","rcd.state.open":"Aberto","recloser.state.open":"Aberto","contactor.state.open":"Aberto","thermal-overload.state.tripped":"Atuado","transfer-switch.state.position":"Posição (normal/emergência/desligado)","dc-disconnector.state.open":"Aberto","battery.param.E":"Capacidade","busbar.param.Un":"Tensão nominal","converter-bidir.param.S":"Capacidade","dc-dc-converter.param.P":"Potência","mppt.param.I":"Corrente nominal","load.param.P":"Potência ativa","load.param.cosphi":"Fator de potência","ngr.param.R":"Resistência","shunt-capacitor.param.Q":"Potência reativa","shunt-capacitor.param.stages":"Estágios","transformer-2w.param.S":"Capacidade","transformer-2w.param.ratio":"Relação de transformação","gfci-breaker.param.In":"Corrente nominal","panelboard.param.In":"Corrente nominal","gfci-breaker.param.IDn":"Corrente residual de atuação","rcd.param.IDn":"Corrente residual de atuação","breaker.param.In":"Corrente nominal","breaker.param.poles":"Polos","breaker.param.Icu":"Capacidade de interrupção","disconnector.param.In":"Corrente nominal","fuse.param.In":"Corrente nominal","resistor.name":"Resistor (R)","capacitor.name":"Capacitor (C)","diode.name":"Diodo (D)","indicator-light.name":"Lâmpada de sinalização (HL)","push-button.name":"Botoeira (SB)","relay-coil.name":"Bobina de relé (KA)","make-contact.name":"Contato normalmente aberto (NO)","break-contact.name":"Contato normalmente fechado (NC)","bell.name":"Campainha (HA)","terminal.name":"Terminal / junção (X)","fuse-switch-disconnector.name":"Chave seccionadora-fusível","socket-outlet.name":"Tomada / conector","inductor.name":"Indutor (L)","voltage-regulator.name":"Regulador de tensão (T)","dc-motor.name":"Motor CC (M)","heater.name":"Elemento de aquecimento (EH)","selector-switch.name":"Chave seletora (SA)","limit-switch.name":"Chave fim de curso (SQ)","proximity-switch.name":"Chave de proximidade (SQ)","time-relay.name":"Relé temporizador (KT)","buzzer.name":"Zumbidor (HA)","siren.name":"Sirene (HA)","thermocouple.name":"Termopar (BT)","thyristor.name":"Tiristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diodo zener (D)","igbt.name":"IGBT","plc.name":"CLP / controlador","ups.name":"No-break (UPS)","power-supply.name":"Fonte de alimentação (PS)","genset.name":"Grupo gerador (G)","protective-relay.name":"Relé de proteção","overcurrent-relay.name":"Relé de sobrecorrente (50/51)","undervoltage-relay.name":"Relé de subtensão (27)","reverse-power-relay.name":"Relé de potência reversa (32)","distance-relay.name":"Relé de distância (21)","phase-failure-relay.name":"Relé de falta de fase","buchholz-relay.name":"Relé Buchholz (63)","power-factor-meter.name":"Medidor de fator de potência (cosφ)","synchronoscope.name":"Sincronoscópio","varmeter.name":"Varímetro (var)","resistor.desc":"Resistor geral / limitador de corrente / resistor de frenagem.","capacitor.desc":"Capacitor geral / de filtro / do barramento CC. Use o capacitor em derivação para correção do fator de potência.","diode.desc":"Diodo retificador / de roda livre / de proteção. t1 = ânodo (topo), t2 = cátodo (base).","indicator-light.desc":"Lâmpada de sinalização / indicação de status.","push-button.desc":"Botoeira manual, retorno automático (contato NA).","relay-coil.desc":"Bobina de acionamento de relé / contator (caixa).","make-contact.desc":"Contato auxiliar normalmente aberto (NA).","break-contact.desc":"Contato auxiliar normalmente fechado (NF).","bell.desc":"Campainha de sinalização / alarme.","terminal.desc":"Terminal / caixa de junção / nó de conexão.","fuse-switch-disconnector.desc":"Chave seccionadora-fusível sob carga.","socket-outlet.desc":"Tomada de energia / conector multipolar.","inductor.desc":"Indutor geral / bobina / reator.","voltage-regulator.desc":"Regulador de tensão ajustável do tipo indução / autotransformador.","dc-motor.desc":"Motor CC (símbolo geral de campo série).","heater.desc":"Elemento resistivo de aquecimento / carga térmica.","selector-switch.desc":"Chave seletora / comutadora (rotativa, com retenção de posição).","limit-switch.desc":"Chave fim de curso / de posição (NA, acionamento mecânico).","proximity-switch.desc":"Sensor de proximidade / chave de proximidade sem contato.","time-relay.desc":"Bobina de relé temporizado (de operação retardada).","buzzer.desc":"Zumbidor de sinalização.","siren.desc":"Sirene sonora / de alarme.","thermocouple.desc":"Sensor de temperatura por termopar.","thyristor.desc":"Tiristor triodo de bloqueio reverso / SCR. t1 = ânodo (topo), t2 = cátodo (base).","triac.desc":"Tiristor triodo bidirecional (TRIAC).","zener-diode.desc":"Diodo zener / regulador de tensão. t1 = ânodo (topo), t2 = cátodo (base).","igbt.desc":"IGBT de canal N, modo intensificação. t1 = coletor (topo), t2 = emissor (base), t_g = gate.","plc.desc":"Controlador lógico programável (CLP).","ups.desc":"No-break online / standby (fonte de alimentação ininterrupta).","power-supply.desc":"Fonte chaveada CA→CC / fonte CC. t_ac no topo (~), t_dc na base (=).","genset.desc":"Grupo gerador a diesel / gás.","protective-relay.desc":"Relé de medição / proteção, símbolo geral (IEC 60617).","overcurrent-relay.desc":"Relé de proteção de sobrecorrente (ANSI 50/51).","undervoltage-relay.desc":"Relé de proteção de subtensão (ANSI 27).","reverse-power-relay.desc":"Relé de proteção de potência reversa / corrente reversa (ANSI 32).","distance-relay.desc":"Relé de proteção de distância / subimpedância (ANSI 21).","phase-failure-relay.desc":"Relé de proteção de falta de fase / perda de fase.","buchholz-relay.desc":"Relé Buchholz / relé de gás (ANSI 63).","power-factor-meter.desc":"Medidor de fator de potência (cosφ).","synchronoscope.desc":"Indicador de sincronismo / sincronoscópio.","varmeter.desc":"Medidor de potência reativa (var).","make-contact.state.closed":"Fechado","break-contact.state.open":"Aberto","fuse-switch-disconnector.state.open":"Aberto","selector-switch.state.open":"Aberto","limit-switch.state.closed":"Fechado","resistor.param.R":"Resistência","resistor.param.P":"Potência nominal","capacitor.param.C":"Capacitância","capacitor.param.Un":"Tensão nominal","indicator-light.param.color":"Cor","inductor.param.L":"Indutância","inductor.param.In":"Corrente nominal","voltage-regulator.param.ratio":"Faixa de regulação","heater.param.P":"Potência","ups.param.S":"Capacidade","power-supply.param.Vdc":"Tensão de saída","genset.param.P":"Potência"},lC={ui:sC,library:aC},cC={"common.unnamed":"無題","common.close":"閉じる","common.yes":"はい","common.no":"いいえ","topbar.theme.toLight":"ライトモードに切り替え","topbar.theme.toDark":"ダークモードに切り替え","topbar.theme.currentDark":"現在:ダークテーマ","topbar.theme.currentLight":"現在:ライトテーマ","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"現在:中国語","topbar.export.label":"エクスポート","topbar.export.tooltip":"SVGベクター(編集可能)、PNGビットマップ(2倍高精細)、またはDXF(CAD用)","topbar.export.pngFailed":"PNGのエクスポートに失敗しました:{err}","topbar.export.dxfFailed":"DXFのエクスポートに失敗しました:{err}","topbar.file.label":"ファイル","topbar.file.tooltip":"ローカルの .json 図面を開く、保存、または名前を付けて保存","topbar.file.current":"現在:{name}","topbar.file.new":"新規","topbar.file.open":"開く…","topbar.file.save":"保存","topbar.file.saveAs":"名前を付けて保存…","topbar.file.newConfirm":"新規作成すると保存されていない変更は破棄されます。続行しますか?","topbar.file.openFailed":"開けませんでした:{err}","topbar.file.saveFailed":"保存に失敗しました:{err}","topbar.file.fileDescription":"OneLineEditor 図面","outline.title":"アウトライン","outline.collapse":"折りたたむ","outline.collapseAria":"アウトラインを折りたたむ","outline.empty":"(要素がありません — ライブラリからドラッグして開始)","props.title":"プロパティ","props.node":"電気ノード","props.wire":"配線","props.bus":"母線","props.junction":"接続点","props.junctionPos":"位置","props.nSelected":"{n} 個選択中","props.empty":"選択なし","props.multi":"{n} 個のオブジェクトを選択中","props.name":"名前","props.note":"メモ","props.label":"ラベル","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"電気ノード {id} が見つかりません","props.wireNotFound":"配線 {id} が見つかりません","props.nodeStats":"端子 {terminals} 個 · 要素 {elements} 個","props.selectElement":"{label} を選択","props.selectWholeNode":"電気ノード全体を選択","props.annText":"テキスト","props.annRect":"矩形","props.annEllipse":"楕円","props.annLine":"線","props.annTable":"表","props.annNotFound":"注釈 {id} が見つかりません","props.annLabel":"ラベル","props.annLabelPlaceholder":"例:配電盤 1","props.color":"色","props.size":"サイズ","props.sizeReset":"100% に戻す","props.labelShown":"表示","props.labelHidden":"非表示","props.color.default":"既定","props.color.red":"赤","props.color.amber":"橙","props.color.green":"緑","props.color.blue":"青","props.color.gray":"グレー","props.annStroke":"線種","props.annStrokeSolid":"実線","props.annStrokeDashed":"破線","props.annStrokeDotted":"点線","props.annStrokeWidth":"線の太さ","props.annWidthThin":"細","props.annWidthMedium":"中","props.annWidthThick":"太","props.annFill":"塗りつぶし","props.annFillNone":"なし","props.annFillTint":"淡色","props.annArrow":"矢印","props.annArrowNone":"なし","props.annArrowEnd":"片側","props.annArrowBoth":"両側","props.annFontSize":"フォントサイズ","props.annRows":"行数","props.annCols":"列数","view.zoomOut":"ズームアウト","view.zoomOutHint":"段階的にズームアウト。ホイール ↓ や ⌘− でも可","view.reset":"100% にリセット","view.current":"現在 {z}%","view.zoomIn":"ズームイン","view.zoomInHint":"段階的にズームイン。ホイール ↑ や ⌘+ でも可","view.fit":"全体表示","view.fitHint":"図面全体を自動でズームして中央に配置","view.gridHide":"グリッドを非表示","view.gridShow":"グリッドを表示","view.gridHotkey":"G","view.gridHideHint":"グリッドへのスナップも無効化(自由配置)","view.gridShowHint":"グリッドへのスナップも有効化(ドラッグ時に10pxにスナップ)","view.gridHideAria":"グリッドを非表示にしてスナップを無効化","view.gridShowAria":"グリッドを表示してスナップを有効化","view.label":"ラベル","view.labelOff":"オフ","view.labelId":"ID","view.labelAll":"ID + パラメータ","view.labelHint":"ラベルの表示と文字サイズ(書き出しにも反映)","view.labelSize":"サイズ","view.labelSizeSmaller":"ラベルを小さく","view.labelSizeLarger":"ラベルを大きく","view.standard":"シンボル規格","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"シンボルの描き方だけが変わります。結線・位置・定格はそのままです。遮断器とヒューズが規格間で異なります。","view.labelSizeReset":"既定のサイズに戻す","library.title":"ライブラリ","tool.draw":"作図","tool.drawHint":"テキスト・枠・円・線・表 — 図面上の自由な注記","library.empty":"該当する要素がありません","cat.custom":"この図面で定義","library.customTag":"独自","library.customHint":"この図面が持つ部品 — 他の人のライブラリにはありません","library.createComponent":"新しい部品…","library.searchPlaceholder":"要素を検索…","library.searchAria":"要素を検索","library.clearSearch":"検索をクリア","library.itemHint":"クリックで配置モードに入る、またはキャンバスへドラッグ","tool.select":"選択","tool.selectHint":"クリックで選択、範囲選択で複数選択、右クリックでメニュー","tool.pan":"パン","tool.panHint":"キャンバスをドラッグ。スペースキーで一時的に切替","tool.wire":"配線","tool.wireHint":"ピン/母線/接続点からドラッグ。空白部分へドロップすると接続点を新設、配線上へドロップすると分岐点を作成","tool.bus":"母線","tool.busHint":"キャンバス上でドラッグ — 押下で始点、離すと終点を設定","tool.junction":"接続点","tool.junctionHint":"キャンバスをクリックして接続点(ノード)を配置。配線を自由に接続可能","tool.place":"配置","tool.placeHint":"クリックで配置。端子/母線からドラッグすると配置と同時に接続","tool.text":"テキスト","tool.textHint":"キャンバスをクリックしてテキスト注釈を配置。既存の注釈はダブルクリックで編集","tool.rect":"矩形","tool.rectHint":"ドラッグで矩形/グループ枠を描画(既定は破線)。Shiftで正方形","tool.ellipse":"楕円","tool.ellipseHint":"ドラッグで楕円を描画。Shift で正円になります","tool.line":"線","tool.lineHint":"ドラッグで注釈線を描画。Shiftで45°に固定。矢印はパネルで設定","tool.table":"表","tool.tableHint":"ドラッグで列×行を指定(リアルタイム表示)、またはクリックで既定サイズの表を配置。セルはダブルクリックで入力","mode.selectWithSel":"要素をドラッグして移動 · 端子をドラッグして配線 · 右クリックでメニュー","mode.selectEmpty":"クリックで選択 · ドラッグで移動 · 範囲選択で複数選択 · 右クリックでメニュー","mode.pan":"キャンバスをドラッグ · スクロールでズーム · どのツールでもスペース長押しでパン","mode.wireDragging":"ピン/母線/接続点上で離す。空白部分で離すと接続点を新設","mode.wireInit":"任意の接続点または空白部分を押下し、目標にドラッグして離す","mode.busDragging":"ドラッグで母線の方向を決定。離すと終点を設定","mode.busInit":"キャンバスを押下して始点を設定し、ドラッグして終点で離す","mode.junction":"キャンバスをクリックして接続点を配置","mode.placeNoKind":"左側のライブラリから要素の種類を選択してください","mode.placeFromTerm":"目標位置で離すと、新しい要素が元の端子に接続されます","mode.placeNormal":"空白部分をクリックして配置。端子/母線からドラッグすると配置と同時に接続","mode.text":"クリックでテキストを配置 · ダブルクリックで編集 · 選択してドラッグで移動 · Delで削除","mode.rect":"ドラッグで矩形を描画 · Shiftで正方形 · 離した後にサイズ変更やラベル設定が可能","mode.ellipse":"ドラッグで楕円を描画 · Shift で正円 · 離した後にサイズ変更・色変更・ラベル設定が可能","mode.line":"ドラッグで線を描画 · Shiftで45°に固定 · 離した後にパネルで矢印を追加","mode.table":"ドラッグでマス目を指定、またはクリックで3×3の表を配置 · セルはダブルクリックで入力","mode.annTextSel":"テキストをクリックして編集 · ドラッグで移動 · Delで削除","mode.annTableSel":"セルをクリックして入力 · ドラッグで移動 · Delで削除","mode.annShapeSel":"ドラッグで移動 · ハンドルをドラッグしてサイズ変更 · パネルでスタイルを変更 · Delで削除","mode.annEditing":"入力 · Enterで確定 · Escでキャンセル · または ✓ / ✕ ボタン","mode.escSelect":"Escで選択を解除","mode.escOther":"右クリック/Escでキャンセル","tool.placeNoKindTooltip":"左側のライブラリで種類を選択してから、キャンバスをクリック","tool.undo":"元に戻す","tool.undoHint":"直前の編集を元に戻す(移動/回転/削除など)","tool.redo":"やり直す","tool.redoHint":"元に戻した操作をやり直す","layout.label":"レイアウト","layout.hint":"図面全体または選択部分を自動レイアウトし、空きを埋める","layout.allAuto":"すべて自動レイアウト","layout.selAuto":"選択部分を自動レイアウト","layout.allFill":"未配置を埋める","layout.selFill":"選択部分の未配置を埋める","tool.more":"その他","tool.moreHint":"元に戻す/やり直す/レイアウト","view.menu":"表示","view.menuHint":"ズーム・全体表示・グリッド","ctx.ariaNode":"ノード操作","ctx.ariaWire":"配線操作","ctx.ariaElement":"要素操作","ctx.ariaEdit":"編集操作","ctx.done":"完了","ctx.cancel":"キャンセル","ctx.rotate":"90°回転","ctx.rotateHint":"選択部分を時計回りに回転。配線は新しい端子位置に合わせて再配線","ctx.mirror":"左右反転","ctx.mirrorTitle":"反転","ctx.mirrorHint":"選択部分を左右反転","ctx.delete":"削除","ctx.color":"色","ctx.colorDefault":"既定","ctx.colorRed":"赤","ctx.colorAmber":"琥珀","ctx.colorGreen":"緑","ctx.colorBlue":"青","ctx.colorGray":"グレー","ctx.deleteHintNode":"このノードのすべての配線を切断(要素は残る)","ctx.deleteHintWire":"この配線のみを削除(同じノードの他の配線は残る)","ctx.deleteHintElement":"選択部分とその配線を削除","ctx.resetWirePath":"自動配線に戻す","ctx.resetWirePathHint":"手動で調整した折れ点を破棄し、自動ルーティングで再描画","menu.undo":"元に戻す","menu.redo":"やり直す","menu.cut":"切り取り","menu.copy":"コピー","menu.paste":"貼り付け","menu.rotate":"90°回転","menu.mirror":"反転","menu.resetLabel":"ラベル位置をリセット","menu.selectAll":"すべて選択","menu.disconnect":"この配線を切断","menu.delete":"削除","io.parseFailed":"JSONの解析に失敗しました:{err}","io.notObject":"ファイルがJSONオブジェクトではありません","io.versionMismatch":'バージョン不一致:"1" が必要ですが、{actual} でした',"io.elementsMissing":"`elements` が存在しないか、配列ではありません","compile.duplicateId":'要素IDが重複しています:"{id}"',"compile.unknownKind":'不明な要素種別 kind="{kind}"',"compile.invalidTermRef":'無効な端子参照 "{ref}"',"compile.elementMissing":'存在しない要素への参照 "{id}"',"compile.missingPin":'要素 "{id}"(kind={kind})にピン "{pin}" がありません。使用可能:{available}',"compile.singleTerminal":"ノードに端子が1つしかないため無視されました","compile.layoutMissingElement":'layoutキー "{id}" が存在しない要素を参照しています',"compile.elementUnconnected":'要素 "{id}" に接続がありません',"cat.busbar":"母線/配線","cat.switching":"開閉器","cat.protection":"保護","cat.motor-control":"電動機制御","cat.transformer":"変圧器","cat.instrument-transformer":"計器用変成器","cat.measurement":"計測","cat.source":"電源","cat.load":"負荷","cat.storage":"蓄電","cat.compensation":"無効電力補償","cat.grounding":"接地","cat.renewable":"再生可能エネルギー/パワーエレクトロニクス","onboard.title":"クイックスタート","onboard.step1.title":"部品を配置","onboard.step1.body":"配置ツール(P)を選び、ライブラリから種類をキャンバスへドラッグ","onboard.step2.title":"配線する","onboard.step2.body":"配線ツール(W)を使用:ピンから別のピンへドラッグ。空白部分へドラッグすると接続点を新設","onboard.step3.title":"母線は共用レールであり、配線ではありません","onboard.step3.body":"複数の回路が1本のレールを共有する場合のみ母線ツール(B)を使用してください。2つの機器をつなぐために母線を使わないでください — 配線ツール(W)でピン同士を直接つないでください。","onboard.dismiss":"了解"},dC={"arc-suppression-coil.name":"消弧コイル","arrester.name":"避雷器 (FBL)","async-motor.name":"誘導電動機","autotransformer.name":"単巻変圧器","battery.name":"蓄電池","breaker.name":"遮断器 (QF)","busbar.name":"母線区間","converter-bidir.name":"双方向コンバータ (PCS)","dc-dc-converter.name":"DC/DCコンバータ","mppt.name":"MPPTコントローラ","ct.name":"変流器 (CT)","disconnector.name":"断路器 (QS)","earth.name":"接地","earthing-switch.name":"接地開閉器 (QE)","fuse.name":"ヒューズ (FU)","generator.name":"発電機 (G)","grid-source.name":"系統電源","grounding-transformer.name":"接地変圧器(ジグザグ結線)","inverter.name":"インバータ (DC→AC)","load-switch.name":"負荷開閉器","load.name":"負荷","luminaire.name":"照明器具(照明負荷)","panelboard.name":"分電盤","ngr.name":"中性点接地抵抗器 (NGR)","pt.name":"計器用変圧器 (PT)","pv.name":"太陽電池モジュール","rectifier.name":"整流器 (AC→DC)","series-reactor.name":"直列リアクトル","shunt-capacitor.name":"並列コンデンサ","shunt-reactor.name":"並列リアクトル","sync-motor.name":"同期電動機","transformer-2w.name":"二巻線変圧器","transformer-3w.name":"三巻線変圧器","wind-turbine.name":"風力発電機","gfci-breaker.name":"漏電遮断器 (RCBO)","rcd.name":"漏電遮断器 (RCD)","recloser.name":"リクローザ","energy-meter.name":"電力量計 (Wh)","voltmeter.name":"電圧計 (V)","ammeter.name":"電流計 (A)","wattmeter.name":"電力計 (W)","frequency-meter.name":"周波数計 (Hz)","contactor.name":"電磁接触器 (KM)","motor-starter.name":"電動機始動器","thermal-overload.name":"熱動過負荷継電器","vfd.name":"可変周波数ドライブ (VFD)","soft-starter.name":"ソフトスターター","transfer-switch.name":"自動切替開閉器 (ATS)","dc-disconnector.name":"直流断路器","dc-combiner.name":"直流接続箱","ev-charger.name":"EV充電器","arc-suppression-coil.desc":"共振接地方式:中性点と大地間にリアクトルを接続","busbar.desc":"複数の分岐に対応する伸縮可能な単一母線区間","converter-bidir.desc":"蓄電用コンバータ:双方向 AC ↔ DC 変換","dc-dc-converter.desc":"DC/DCコンバータ/直流充電器(IEC 60617)","mppt.desc":"MPPT太陽光充電コントローラ(DC/DC、最大電力点追従)","earthing-switch.desc":"断路器と接地接続を兼ねる単一ポート機器","grid-source.desc":"無限大母線/外部系統","grounding-transformer.desc":"中性点接地用のスター・ジグザグ結線変圧器","load.desc":"抽象負荷(電流流出方向の矢印)","luminaire.desc":"照明負荷(IEC 60617 照明器具一般図記号)","ngr.desc":"低抵抗接地:変圧器中性点と大地間に接続","series-reactor.desc":"並列リアクトルと同一記号。用途によって区別","wind-turbine.desc":"風力発電機:発電機と三枚羽根ローターの記号","gfci-breaker.desc":"過電流保護付き漏電遮断器(UL943 / IEC 61009)。北米ではGFCI、欧州ではRCBOと呼ばれる。","rcd.desc":"過電流保護なしの漏電遮断器(IEC 61008)。","recloser.desc":"中電圧用自動再閉路装置。","energy-meter.desc":"有効電力量計(kWh)— 引込口/子メーター用。","contactor.desc":"主回路用電磁接触器。通常、熱動過負荷継電器や電動機と組み合わせて使用。","motor-starter.desc":"電動機始動器(IEC 60617 一般記号)。","thermal-overload.desc":"電動機用熱動過負荷継電器。接触器と電動機の間に設置。","vfd.desc":"誘導電動機の速度制御用可変周波数ドライブ。","soft-starter.desc":"電動機用ソフトスターター(サイリスタによる低電圧始動方式)。","transfer-switch.desc":"二電源切替開閉器(自動/手動)。2つの電源入力と1つの負荷出力を持ち、機械的にインターロックされる。","dc-disconnector.desc":"直流断路器 — 太陽光ストリングや蓄電池の直流側を切り離す。","dc-combiner.desc":"太陽光ストリング用接続箱(4入力の例)。","ev-charger.desc":"電気自動車用充電ステーション。","breaker.state.open":"開","disconnector.state.open":"開","earthing-switch.state.open":"開","fuse.state.blown":"溶断","load-switch.state.open":"開","gfci-breaker.state.open":"開","rcd.state.open":"開","recloser.state.open":"開","contactor.state.open":"開","thermal-overload.state.tripped":"動作","transfer-switch.state.position":"位置(通常/非常用/オフ)","dc-disconnector.state.open":"開","battery.param.E":"容量","busbar.param.Un":"定格電圧","converter-bidir.param.S":"容量","dc-dc-converter.param.P":"電力","mppt.param.I":"定格電流","load.param.P":"有効電力","load.param.cosphi":"力率","ngr.param.R":"抵抗","shunt-capacitor.param.Q":"無効電力容量","shunt-capacitor.param.stages":"段数","transformer-2w.param.S":"容量","transformer-2w.param.ratio":"巻数比","gfci-breaker.param.In":"定格電流","panelboard.param.In":"定格電流","gfci-breaker.param.IDn":"定格感度電流","rcd.param.IDn":"定格感度電流","breaker.param.In":"定格電流","breaker.param.poles":"極数","breaker.param.Icu":"定格遮断容量","disconnector.param.In":"定格電流","fuse.param.In":"定格電流","resistor.name":"抵抗器 (R)","capacitor.name":"コンデンサ (C)","diode.name":"ダイオード (D)","indicator-light.name":"表示灯 (HL)","push-button.name":"押しボタンスイッチ (SB)","relay-coil.name":"リレーコイル (KA)","make-contact.name":"a接点 (NO)","break-contact.name":"b接点 (NC)","bell.name":"ベル (HA)","terminal.name":"端子台/接続点 (X)","fuse-switch-disconnector.name":"ヒューズ付断路器","socket-outlet.name":"コンセント/コネクタ","inductor.name":"インダクタ (L)","voltage-regulator.name":"電圧調整器 (T)","dc-motor.name":"直流電動機 (M)","heater.name":"発熱体 (EH)","selector-switch.name":"切替スイッチ (SA)","limit-switch.name":"リミットスイッチ (SQ)","proximity-switch.name":"近接スイッチ (SQ)","time-relay.name":"タイムリレー (KT)","buzzer.name":"ブザー (HA)","siren.name":"サイレン (HA)","thermocouple.name":"熱電対 (BT)","thyristor.name":"サイリスタ/SCR (V)","triac.name":"トライアック (V)","zener-diode.name":"ツェナーダイオード (D)","igbt.name":"IGBT","plc.name":"PLC/コントローラ","ups.name":"UPS","power-supply.name":"電源装置 (PS)","genset.name":"発電機セット (G)","protective-relay.name":"保護継電器","overcurrent-relay.name":"過電流継電器 (50/51)","undervoltage-relay.name":"不足電圧継電器 (27)","reverse-power-relay.name":"逆電力継電器 (32)","distance-relay.name":"距離継電器 (21)","phase-failure-relay.name":"欠相継電器","buchholz-relay.name":"ブッフホルツ継電器 (63)","power-factor-meter.name":"力率計 (cosφ)","synchronoscope.name":"同期検定器","varmeter.name":"無効電力計 (var)","resistor.desc":"汎用抵抗器/限流抵抗/制動抵抗。","capacitor.desc":"汎用/フィルタ/直流母線用コンデンサ。力率改善には並列コンデンサを使用。","diode.desc":"整流/還流/保護用ダイオード。t1 = アノード(上)、t2 = カソード(下)。","indicator-light.desc":"信号/状態表示灯。","push-button.desc":"手動押しボタン、自動復帰式(a接点)。","relay-coil.desc":"リレー/接触器の操作コイル(箱形記号)。","make-contact.desc":"常開補助接点(a接点)。","break-contact.desc":"常閉補助接点(b接点)。","bell.desc":"信号ベル/警報ベル。","terminal.desc":"端子台/接続箱/接続ノード。","fuse-switch-disconnector.desc":"負荷時開閉可能なヒューズ付断路器。","socket-outlet.desc":"電源コンセント/多極コネクタ。","inductor.desc":"汎用インダクタ/コイル/チョーク。","voltage-regulator.desc":"誘導形/単巻変圧器形の可変電圧調整器。","dc-motor.desc":"直流電動機(直巻界磁の一般記号)。","heater.desc":"抵抗発熱体/加熱負荷。","selector-switch.desc":"切替スイッチ(回転式、保持形)。","limit-switch.desc":"行程/位置スイッチ(a接点、機械操作式)。","proximity-switch.desc":"近接センサー/非接触式近接スイッチ。","time-relay.desc":"限時(動作遅延)リレーコイル。","buzzer.desc":"信号ブザー。","siren.desc":"音響サイレン/警報器。","thermocouple.desc":"熱電対温度センサー。","thyristor.desc":"逆阻止三端子サイリスタ/SCR。t1 = アノード(上)、t2 = カソード(下)。","triac.desc":"双方向三端子サイリスタ(トライアック)。","zener-diode.desc":"ツェナー/定電圧ダイオード。t1 = アノード(上)、t2 = カソード(下)。","igbt.desc":"Nチャネルエンハンスメント形IGBT。t1 = コレクタ(上)、t2 = エミッタ(下)、t_g = ゲート。","plc.desc":"プログラマブルロジックコントローラ(PLC)。","ups.desc":"オンライン/常時商用給電式無停電電源装置。","power-supply.desc":"AC→DCスイッチング/直流電源装置。t_ac は上(~)、t_dc は下(=)。","genset.desc":"ディーゼル/ガス発電機セット。","protective-relay.desc":"計測/保護継電器の一般記号(IEC 60617)。","overcurrent-relay.desc":"過電流保護継電器(ANSI 50/51)。","undervoltage-relay.desc":"不足電圧保護継電器(ANSI 27)。","reverse-power-relay.desc":"逆電力/逆電流保護継電器(ANSI 32)。","distance-relay.desc":"距離/低インピーダンス保護継電器(ANSI 21)。","phase-failure-relay.desc":"欠相保護継電器。","buchholz-relay.desc":"ブッフホルツ/ガス継電器(ANSI 63)。","power-factor-meter.desc":"力率計(cosφ)。","synchronoscope.desc":"同期検定器/同期指示計。","varmeter.desc":"無効電力計(var)。","make-contact.state.closed":"閉","break-contact.state.open":"開","fuse-switch-disconnector.state.open":"開","selector-switch.state.open":"開","limit-switch.state.closed":"閉","resistor.param.R":"抵抗","resistor.param.P":"定格電力","capacitor.param.C":"静電容量","capacitor.param.Un":"定格電圧","indicator-light.param.color":"色","inductor.param.L":"インダクタンス","inductor.param.In":"定格電流","voltage-regulator.param.ratio":"調整範囲","heater.param.P":"電力","ups.param.S":"容量","power-supply.param.Vdc":"出力電圧","genset.param.P":"電力"},uC={ui:cC,library:dC},mC={"common.unnamed":"Без имени","common.close":"Закрыть","common.yes":"Да","common.no":"Нет","topbar.theme.toLight":"Переключить на светлую","topbar.theme.toDark":"Переключить на тёмную","topbar.theme.currentDark":"Текущая: тёмная тема","topbar.theme.currentLight":"Текущая: светлая тема","topbar.lang.toEnglish":"Переключить на английский","topbar.lang.toChinese":"Переключить на китайский","topbar.lang.currentEnglish":"Текущий: английский","topbar.lang.currentChinese":"Текущий: китайский","topbar.export.label":"Экспорт","topbar.export.tooltip":"Векторный SVG (редактируемый), растровый PNG (2× HiDPI) или DXF (для CAD)","topbar.export.pngFailed":"Не удалось экспортировать PNG: {err}","topbar.export.dxfFailed":"Не удалось экспортировать DXF: {err}","topbar.file.label":"Файл","topbar.file.tooltip":"Открыть локальную схему .json, сохранить или сохранить как","topbar.file.current":"Текущий: {name}","topbar.file.new":"Новый","topbar.file.open":"Открыть…","topbar.file.save":"Сохранить","topbar.file.saveAs":"Сохранить как…","topbar.file.newConfirm":"Создание нового файла отменит все несохранённые изменения. Продолжить?","topbar.file.openFailed":"Не удалось открыть: {err}","topbar.file.saveFailed":"Не удалось сохранить: {err}","topbar.file.fileDescription":"Схема OneLineEditor","outline.title":"Структура","outline.collapse":"Свернуть","outline.collapseAria":"Свернуть структуру","outline.empty":"(Нет элементов — перетащите из библиотеки, чтобы начать)","props.title":"Свойства","props.node":"Электрический узел","props.wire":"Провод","props.bus":"Шина","props.junction":"Соединение","props.junctionPos":"Положение","props.nSelected":"Выбрано: {n}","props.empty":"Ничего не выбрано","props.multi":"Выбрано объектов: {n}","props.name":"Название","props.note":"Заметка","props.label":"Метка","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Электрический узел {id} не найден","props.wireNotFound":"Провод {id} не найден","props.nodeStats":"{terminals} выводов · {elements} элементов","props.selectElement":"Выбрать {label}","props.selectWholeNode":"Выбрать весь электрический узел","props.annText":"Текст","props.annRect":"Прямоугольник","props.annEllipse":"Эллипс","props.annLine":"Линия","props.annTable":"Таблица","props.annNotFound":"Аннотация {id} не найдена","props.annLabel":"Подпись","props.annLabelPlaceholder":"например, Щит №1","props.color":"Цвет","props.size":"Размер","props.sizeReset":"Сбросить до 100 %","props.labelShown":"Показана","props.labelHidden":"Скрыта","props.color.default":"По умолчанию","props.color.red":"Красный","props.color.amber":"Янтарный","props.color.green":"Зелёный","props.color.blue":"Синий","props.color.gray":"Серый","props.annStroke":"Обводка","props.annStrokeSolid":"Сплошная","props.annStrokeDashed":"Пунктирная","props.annStrokeDotted":"Точечная","props.annStrokeWidth":"Толщина","props.annWidthThin":"Тонкая","props.annWidthMedium":"Средняя","props.annWidthThick":"Толстая","props.annFill":"Заливка","props.annFillNone":"Нет","props.annFillTint":"Оттенок","props.annArrow":"Стрелки","props.annArrowNone":"Нет","props.annArrowEnd":"В конце","props.annArrowBoth":"С двух сторон","props.annFontSize":"Размер шрифта","props.annRows":"Строки","props.annCols":"Столбцы","view.zoomOut":"Уменьшить","view.zoomOutHint":"Уменьшение на шаг; также колесо ↓ или ⌘−","view.reset":"Сбросить на 100%","view.current":"Текущий масштаб {z}%","view.zoomIn":"Увеличить","view.zoomInHint":"Увеличение на шаг; также колесо ↑ или ⌘+","view.fit":"Вписать в экран","view.fitHint":"Автоматически масштабировать и центрировать всю схему","view.gridHide":"Скрыть сетку","view.gridShow":"Показать сетку","view.gridHotkey":"G","view.gridHideHint":"Также отключает привязку к сетке (свободное размещение)","view.gridShowHint":"Также включает привязку к сетке (шаг 10 px при перетаскивании)","view.gridHideAria":"Скрыть сетку и отключить привязку","view.gridShowAria":"Показать сетку и включить привязку","view.label":"Подписи","view.labelOff":"Выкл","view.labelId":"ID","view.labelAll":"ID + параметры","view.labelHint":"Видимость и размер подписей (в том числе при экспорте)","view.labelSize":"Размер","view.labelSizeSmaller":"Уменьшить размер подписей","view.labelSizeLarger":"Увеличить размер подписей","view.standard":"Стандарт обозначений","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Меняется только начертание символов — схема соединений, положения и параметры не затрагиваются. Выключатель и предохранитель рисуются по-разному.","view.labelSizeReset":"Сбросить размер подписей","library.title":"Библиотека","tool.draw":"Рисование","tool.drawHint":"Текст, рамки, круги, линии и таблицы — свободные пометки поверх схемы","library.empty":"Нет подходящих элементов","cat.custom":"В этой схеме","library.customTag":"своё","library.customHint":"Определён этой схемой — его нет в чужой библиотеке","library.createComponent":"Новый компонент…","library.searchPlaceholder":"Поиск элементов…","library.searchAria":"Поиск элементов","library.clearSearch":"Очистить поиск","library.itemHint":"Нажмите, чтобы включить режим размещения, или перетащите на холст","tool.select":"Выбор","tool.selectHint":"Клик — выбрать один, рамка — несколько, правая кнопка — меню","tool.pan":"Рука","tool.panHint":"Перетаскивайте холст; пробел временно переключает инструмент","tool.wire":"Провод","tool.wireHint":"Тяните от вывода / шины / точки соединения; в пустое место — создаст точку соединения, на провод — врежется в него","tool.bus":"Шина","tool.busHint":"Тяните по холсту — нажатие задаёт начало, отпускание — конец","tool.junction":"Соединение","tool.junctionHint":"Нажмите на холст, чтобы поставить точку соединения (узел); провода свободно подключаются к ней","tool.place":"Элемент","tool.placeHint":"Нажмите, чтобы разместить; или перетащите от вывода / шины, чтобы разместить и подключить","tool.text":"Текст","tool.textHint":"Нажмите на холст, чтобы добавить текстовую заметку; дважды щёлкните существующую, чтобы изменить","tool.rect":"Прямоугольник","tool.rectHint":"Перетащите, чтобы нарисовать прямоугольник / рамку группы (по умолчанию пунктирную); Shift — квадрат","tool.ellipse":"Эллипс","tool.ellipseHint":"Перетащите, чтобы нарисовать эллипс; Shift — окружность","tool.line":"Линия","tool.lineHint":"Перетащите, чтобы нарисовать линию-аннотацию; Shift — привязка к 45°; стрелки настраиваются в панели","tool.table":"Таблица","tool.tableHint":"Перетащите, чтобы задать столбцы × строки (счётчик в реальном времени), или нажмите для таблицы по умолчанию; дважды щёлкните ячейку, чтобы ввести текст","mode.selectWithSel":"Перетаскивайте элементы · тяните от вывода, чтобы провести провод · правая кнопка — меню","mode.selectEmpty":"Клик — выбрать · перетаскивание — переместить · рамка — несколько · правая кнопка — меню","mode.pan":"Перетаскивайте холст · колесо — масштаб · удерживайте пробел для панорамирования в любом инструменте","mode.wireDragging":"Отпустите на выводе / шине / точке соединения; отпускание в пустом месте создаст точку соединения","mode.wireInit":"Нажмите на любой точке подключения или в пустом месте, перетащите к цели и отпустите","mode.busDragging":"Перетаскивание задаёт направление шины; отпускание — конец","mode.busInit":"Нажмите на холст, чтобы задать начало, тяните и отпустите, чтобы задать конец","mode.junction":"Нажмите на холст, чтобы поставить точку соединения","mode.placeNoKind":"Выберите тип элемента в библиотеке слева","mode.placeFromTerm":"Отпустите у цели — новый элемент подключится к исходному выводу","mode.placeNormal":"Нажмите в пустом месте, чтобы разместить; или перетащите от вывода / шины, чтобы разместить и подключить","mode.text":"Нажмите, чтобы добавить текст · двойной клик — редактировать · перетаскивание выбранного — переместить · Del — удалить","mode.rect":"Перетащите, чтобы нарисовать прямоугольник · Shift — квадрат · после отпускания измените размер и подпись","mode.ellipse":"Перетащите, чтобы нарисовать эллипс · Shift — окружность · после отпускания измените размер, цвет и подпись","mode.line":"Перетащите, чтобы нарисовать линию · Shift — привязка к 45° · стрелки добавьте в панели после отпускания","mode.table":"Перетащите, чтобы задать сетку, или нажмите для таблицы 3×3 · дважды щёлкните ячейку, чтобы ввести текст","mode.annTextSel":"Нажмите на текст, чтобы редактировать · перетащите, чтобы переместить · Del — удалить","mode.annTableSel":"Нажмите на ячейку, чтобы заполнить её · перетащите, чтобы переместить · Del — удалить","mode.annShapeSel":"Перетащите, чтобы переместить · тяните за маркеры, чтобы изменить размер · стиль — в панели · Del — удалить","mode.annEditing":"Введите текст · Enter — подтвердить · Esc — отмена · или кнопки ✓ / ✕","mode.escSelect":"Esc — снять выделение","mode.escOther":"Правая кнопка / Esc — отмена","tool.placeNoKindTooltip":"Выберите тип в библиотеке слева, затем нажмите на холст","tool.undo":"Отменить","tool.undoHint":"Отменить последнее действие (перемещение / поворот / удаление и т. д.)","tool.redo":"Повторить","tool.redoHint":"Повторить последнее отменённое действие","layout.label":"Компоновка","layout.hint":"Автоматически расставить всю схему или только выделенное, заполнить пропуски","layout.allAuto":"Автокомпоновка всей схемы","layout.selAuto":"Автокомпоновка выделенного","layout.allFill":"Расставить неразмещённые","layout.selFill":"Расставить неразмещённые в выделении","tool.more":"Ещё","tool.moreHint":"Отмена / повтор / компоновка","view.menu":"Вид","view.menuHint":"Масштаб, вписать, сетка","ctx.ariaNode":"Действия с узлом","ctx.ariaWire":"Действия с проводом","ctx.ariaElement":"Действия с элементом","ctx.ariaEdit":"Действия редактирования","ctx.done":"Готово","ctx.cancel":"Отмена","ctx.rotate":"Повернуть на 90°","ctx.rotateHint":"Повернуть выделенное по часовой стрелке; провода перестроятся через новые выводы","ctx.mirror":"Зеркально по горизонтали","ctx.mirrorTitle":"Зеркало","ctx.mirrorHint":"Отразить выделенное слева направо","ctx.delete":"Удалить","ctx.color":"Цвет","ctx.colorDefault":"По умолчанию","ctx.colorRed":"Красный","ctx.colorAmber":"Янтарный","ctx.colorGreen":"Зелёный","ctx.colorBlue":"Синий","ctx.colorGray":"Серый","ctx.deleteHintNode":"Отключить все провода этого узла (элементы останутся)","ctx.deleteHintWire":"Удалить только этот провод (остальные провода узла останутся)","ctx.deleteHintElement":"Удалить выделенное и его провода","ctx.resetWirePath":"Сбросить на автотрассировку","ctx.resetWirePathHint":"Убрать вручную заданные изгибы и позволить перерисовать провод автоматически","menu.undo":"Отменить","menu.redo":"Повторить","menu.cut":"Вырезать","menu.copy":"Копировать","menu.paste":"Вставить","menu.rotate":"Повернуть на 90°","menu.mirror":"Зеркально","menu.resetLabel":"Сбросить положение подписи","menu.selectAll":"Выбрать всё","menu.disconnect":"Отключить этот провод","menu.delete":"Удалить","io.parseFailed":"Ошибка разбора JSON: {err}","io.notObject":"Файл не является объектом JSON","io.versionMismatch":'Несовпадение версии: ожидалась "1", получено {actual}',"io.elementsMissing":"Поле `elements` отсутствует или не является массивом","compile.duplicateId":'Повторяющийся ID элемента: "{id}"',"compile.unknownKind":'Неизвестный тип элемента kind="{kind}"',"compile.invalidTermRef":'Некорректная ссылка на вывод "{ref}"',"compile.elementMissing":'Ссылка на несуществующий элемент "{id}"',"compile.missingPin":'У элемента "{id}" (kind={kind}) нет вывода "{pin}"; доступны: {available}',"compile.singleTerminal":"Узел содержит только один вывод — проигнорирован","compile.layoutMissingElement":'Ключ layout "{id}" ссылается на несуществующий элемент',"compile.elementUnconnected":'Элемент "{id}" не имеет подключений',"cat.busbar":"Шины / проводка","cat.switching":"Коммутация","cat.protection":"Защита","cat.motor-control":"Управление двигателем","cat.transformer":"Трансформаторы","cat.instrument-transformer":"Измерительные трансформаторы","cat.measurement":"Измерения","cat.source":"Источники","cat.load":"Нагрузка","cat.storage":"Накопители","cat.compensation":"Компенсация","cat.grounding":"Заземление","cat.renewable":"Возобновляемая энергетика / силовая электроника","onboard.title":"Быстрый старт","onboard.step1.title":"Разместите элемент","onboard.step1.body":"Выберите инструмент «Элемент» (P) и перетащите элемент из библиотеки на холст","onboard.step2.title":"Соедините проводом","onboard.step2.body":"Используйте инструмент «Провод» (W): тяните от одного вывода к другому — перетаскивание в пустое место создаст точку соединения","onboard.step3.title":"Шина — это общая линия, а не провод","onboard.step3.body":"Используйте инструмент «Шина» (B), только если несколько цепей используют одну общую линию. Не используйте шину для соединения двух устройств — просто соедините выводы проводом (W).","onboard.dismiss":"Понятно"},pC={"arc-suppression-coil.name":"Дугогасящая катушка","arrester.name":"Разрядник (FBL)","async-motor.name":"Асинхронный двигатель","autotransformer.name":"Автотрансформатор","battery.name":"Аккумуляторная батарея (накопитель)","breaker.name":"Автоматический выключатель (QF)","busbar.name":"Секция шины","converter-bidir.name":"Двунаправленный преобразователь (PCS)","dc-dc-converter.name":"Преобразователь DC/DC","mppt.name":"Контроллер MPPT","ct.name":"Трансформатор тока (CT)","disconnector.name":"Разъединитель (QS)","earth.name":"Земля","earthing-switch.name":"Заземляющий разъединитель (QE)","fuse.name":"Предохранитель (FU)","generator.name":"Генератор (G)","grid-source.name":"Источник от энергосистемы","grounding-transformer.name":"Заземляющий трансформатор (зигзаг)","inverter.name":"Инвертор (DC→AC)","load-switch.name":"Выключатель нагрузки","load.name":"Нагрузка","luminaire.name":"Светильник (осветительная нагрузка)","panelboard.name":"Распределительный щит","ngr.name":"Резистор заземления нейтрали (NGR)","pt.name":"Трансформатор напряжения (PT)","pv.name":"Фотоэлектрический модуль","rectifier.name":"Выпрямитель (AC→DC)","series-reactor.name":"Последовательный реактор","shunt-capacitor.name":"Шунтирующий конденсатор","shunt-reactor.name":"Шунтирующий реактор","sync-motor.name":"Синхронный двигатель","transformer-2w.name":"Двухобмоточный трансформатор","transformer-3w.name":"Трёхобмоточный трансформатор","wind-turbine.name":"Ветрогенератор","gfci-breaker.name":"Дифференциальный автомат (RCBO)","rcd.name":"Устройство защитного отключения (RCD)","recloser.name":"Реклоузер","energy-meter.name":"Счётчик электроэнергии (Wh)","voltmeter.name":"Вольтметр (V)","ammeter.name":"Амперметр (A)","wattmeter.name":"Ваттметр (W)","frequency-meter.name":"Частотомер (Hz)","contactor.name":"Контактор (KM)","motor-starter.name":"Магнитный пускатель","thermal-overload.name":"Тепловое реле перегрузки","vfd.name":"Частотный преобразователь (VFD)","soft-starter.name":"Устройство плавного пуска","transfer-switch.name":"Устройство АВР (ATS)","dc-disconnector.name":"Разъединитель постоянного тока","dc-combiner.name":"Объединительная коробка постоянного тока","ev-charger.name":"Зарядная станция для электромобилей","arc-suppression-coil.desc":"Резонансное заземление нейтрали: катушка индуктивности на землю","busbar.desc":"Растягиваемая секция одиночной шины с несколькими отводами","converter-bidir.desc":"Преобразователь для накопителя: двунаправленный AC ↔ DC","dc-dc-converter.desc":"Преобразователь DC/DC / зарядное устройство постоянного тока (IEC 60617)","mppt.desc":"Солнечный контроллер заряда MPPT (DC/DC, отслеживание точки максимальной мощности)","earthing-switch.desc":"Разъединитель + соединение с землёй, один порт","grid-source.desc":"Шина бесконечной мощности / внешняя энергосистема","grounding-transformer.desc":"Трансформатор со схемой звезда-зигзаг для заземления нейтрали","load.desc":"Абстрактная нагрузка (стрелка исходящего тока)","luminaire.desc":"Осветительная нагрузка (общий символ светильника МЭК 60617)","ngr.desc":"Заземление через малое сопротивление: нейтраль трансформатора на землю","series-reactor.desc":"То же обозначение, что и у шунтирующего реактора; различаются по способу применения","wind-turbine.desc":"Ветрогенератор: генератор + значок трёхлопастного ротора","gfci-breaker.desc":"Дифференциальный автомат со встроенной защитой от сверхтока (UL943 / IEC 61009). В США — GFCI, в Европе — RCBO.","rcd.desc":"Устройство защитного отключения без защиты от сверхтока (IEC 61008).","recloser.desc":"Автоматический реклоузер среднего напряжения.","energy-meter.desc":"Счётчик активной энергии (кВт·ч) — на вводе / субсчётчик.","contactor.desc":"Контактор главной цепи; обычно используется совместно с тепловым реле и двигателем.","motor-starter.desc":"Пускатель двигателя (общее обозначение по IEC 60617).","thermal-overload.desc":"Тепловое реле перегрузки двигателя; устанавливается между контактором и двигателем.","vfd.desc":"Частотный преобразователь для регулирования скорости асинхронного двигателя.","soft-starter.desc":"Устройство плавного пуска двигателя (тиристорный пуск при пониженном напряжении).","transfer-switch.desc":"Переключатель между двумя источниками (АВР / ручной). Два входа источников + один выход нагрузки, механически сблокированы.","dc-disconnector.desc":"Разъединитель постоянного тока — изоляция стороны DC солнечной цепочки / батареи.","dc-combiner.desc":"Объединительная коробка солнечных цепочек (пример на 4 входа).","ev-charger.desc":"Зарядная станция для электромобилей.","breaker.state.open":"Разомкнут","disconnector.state.open":"Разомкнут","earthing-switch.state.open":"Разомкнут","fuse.state.blown":"Перегорел","load-switch.state.open":"Разомкнут","gfci-breaker.state.open":"Разомкнут","rcd.state.open":"Разомкнут","recloser.state.open":"Разомкнут","contactor.state.open":"Разомкнут","thermal-overload.state.tripped":"Сработало","transfer-switch.state.position":"Положение (нормальное/аварийное/откл.)","dc-disconnector.state.open":"Разомкнут","battery.param.E":"Ёмкость","busbar.param.Un":"Номинальное напряжение","converter-bidir.param.S":"Мощность","dc-dc-converter.param.P":"Мощность","mppt.param.I":"Номинальный ток","load.param.P":"Активная мощность","load.param.cosphi":"Коэффициент мощности","ngr.param.R":"Сопротивление","shunt-capacitor.param.Q":"Реактивная мощность","shunt-capacitor.param.stages":"Ступени","transformer-2w.param.S":"Мощность","transformer-2w.param.ratio":"Коэффициент трансформации","gfci-breaker.param.In":"Номинальный ток","panelboard.param.In":"Номинальный ток","gfci-breaker.param.IDn":"Номинальный отключающий дифференциальный ток","rcd.param.IDn":"Номинальный отключающий дифференциальный ток","breaker.param.In":"Номинальный ток","breaker.param.poles":"Число полюсов","breaker.param.Icu":"Отключающая способность","disconnector.param.In":"Номинальный ток","fuse.param.In":"Номинальный ток","resistor.name":"Резистор (R)","capacitor.name":"Конденсатор (C)","diode.name":"Диод (D)","indicator-light.name":"Сигнальная лампа (HL)","push-button.name":"Кнопка (SB)","relay-coil.name":"Катушка реле (KA)","make-contact.name":"Замыкающий контакт (NO)","break-contact.name":"Размыкающий контакт (NC)","bell.name":"Звонок (HA)","terminal.name":"Клемма / соединение (X)","fuse-switch-disconnector.name":"Предохранитель-разъединитель","socket-outlet.name":"Розетка / разъём","inductor.name":"Катушка индуктивности (L)","voltage-regulator.name":"Регулятор напряжения (T)","dc-motor.name":"Двигатель постоянного тока (M)","heater.name":"Нагревательный элемент (EH)","selector-switch.name":"Переключатель (SA)","limit-switch.name":"Концевой выключатель (SQ)","proximity-switch.name":"Бесконтактный выключатель (SQ)","time-relay.name":"Реле времени (KT)","buzzer.name":"Зуммер (HA)","siren.name":"Сирена (HA)","thermocouple.name":"Термопара (BT)","thyristor.name":"Тиристор / SCR (V)","triac.name":"Симистор (V)","zener-diode.name":"Стабилитрон (D)","igbt.name":"IGBT","plc.name":"ПЛК / контроллер","ups.name":"ИБП (UPS)","power-supply.name":"Источник питания (PS)","genset.name":"Генераторная установка (G)","protective-relay.name":"Защитное реле","overcurrent-relay.name":"Реле максимального тока (50/51)","undervoltage-relay.name":"Реле минимального напряжения (27)","reverse-power-relay.name":"Реле обратной мощности (32)","distance-relay.name":"Дистанционное реле (21)","phase-failure-relay.name":"Реле обрыва фазы","buchholz-relay.name":"Реле Бухгольца (63)","power-factor-meter.name":"Измеритель коэффициента мощности (cosφ)","synchronoscope.name":"Синхроноскоп","varmeter.name":"Варметр (var)","resistor.desc":"Общий резистор / токоограничивающий / тормозной резистор.","capacitor.desc":"Общий / фильтрующий конденсатор / конденсатор шины DC. Для компенсации коэффициента мощности используйте шунтирующий конденсатор.","diode.desc":"Выпрямительный / обратный / защитный диод. t1 = анод (сверху), t2 = катод (снизу).","indicator-light.desc":"Сигнальная лампа состояния.","push-button.desc":"Кнопка ручного управления с автоматическим возвратом (замыкающий контакт NO).","relay-coil.desc":"Катушка управления реле / контактора (обозначение — прямоугольник).","make-contact.desc":"Нормально разомкнутый вспомогательный контакт (замыкающий).","break-contact.desc":"Нормально замкнутый вспомогательный контакт (размыкающий).","bell.desc":"Сигнальный звонок / звонок тревоги.","terminal.desc":"Клемма / клеммная коробка / узел соединения.","fuse-switch-disconnector.desc":"Предохранитель-разъединитель, коммутируемый под нагрузкой.","socket-outlet.desc":"Силовая розетка / многополюсный разъём.","inductor.desc":"Общая катушка индуктивности / дроссель.","voltage-regulator.desc":"Регулируемый индукционный регулятор напряжения / автотрансформаторный регулятор.","dc-motor.desc":"Двигатель постоянного тока (общее обозначение с последовательным возбуждением).","heater.desc":"Резистивный нагревательный элемент / тепловая нагрузка.","selector-switch.desc":"Избирательный переключатель (поворотный, с фиксацией положений).","limit-switch.desc":"Концевой выключатель положения (NO, механическое воздействие).","proximity-switch.desc":"Датчик приближения / бесконтактный выключатель.","time-relay.desc":"Катушка реле времени (с задержкой срабатывания).","buzzer.desc":"Сигнальный зуммер.","siren.desc":"Звуковая сирена / сигнализация.","thermocouple.desc":"Термопарный датчик температуры.","thyristor.desc":"Тиристор с обратной блокировкой (SCR). t1 = анод (сверху), t2 = катод (снизу).","triac.desc":"Двунаправленный триодный тиристор (симистор).","zener-diode.desc":"Стабилитрон / регулирующий диод. t1 = анод (сверху), t2 = катод (снизу).","igbt.desc":"IGBT-транзистор с N-каналом обогащённого типа. t1 = коллектор (сверху), t2 = эмиттер (снизу), t_g = затвор.","plc.desc":"Программируемый логический контроллер (ПЛК).","ups.desc":"Источник бесперебойного питания (онлайн / резервный).","power-supply.desc":"Импульсный источник питания AC→DC / источник постоянного тока. t_ac сверху (~), t_dc снизу (=).","genset.desc":"Дизельная / газовая генераторная установка.","protective-relay.desc":"Измерительное / защитное реле, общее обозначение (IEC 60617).","overcurrent-relay.desc":"Реле максимальной токовой защиты (ANSI 50/51).","undervoltage-relay.desc":"Реле защиты минимального напряжения (ANSI 27).","reverse-power-relay.desc":"Реле защиты от обратной мощности / обратного тока (ANSI 32).","distance-relay.desc":"Дистанционное реле защиты по сопротивлению (ANSI 21).","phase-failure-relay.desc":"Реле защиты от обрыва / потери фазы.","buchholz-relay.desc":"Газовое реле Бухгольца (ANSI 63).","power-factor-meter.desc":"Измеритель коэффициента мощности (cosφ).","synchronoscope.desc":"Индикатор синхронизации / синхроноскоп.","varmeter.desc":"Измеритель реактивной мощности (var).","make-contact.state.closed":"Замкнут","break-contact.state.open":"Разомкнут","fuse-switch-disconnector.state.open":"Разомкнут","selector-switch.state.open":"Разомкнут","limit-switch.state.closed":"Замкнут","resistor.param.R":"Сопротивление","resistor.param.P":"Номинальная мощность","capacitor.param.C":"Ёмкость","capacitor.param.Un":"Номинальное напряжение","indicator-light.param.color":"Цвет","inductor.param.L":"Индуктивность","inductor.param.In":"Номинальный ток","voltage-regulator.param.ratio":"Диапазон регулирования","heater.param.P":"Мощность","ups.param.S":"Мощность","power-supply.param.Vdc":"Выходное напряжение","genset.param.P":"Мощность"},hC={ui:mC,library:pC},fC={"common.unnamed":"بدون عنوان","common.close":"بستن","common.yes":"بله","common.no":"خیر","topbar.theme.toLight":"تغییر به حالت روشن","topbar.theme.toDark":"تغییر به حالت تیره","topbar.theme.currentDark":"فعلی: پوسته تیره","topbar.theme.currentLight":"فعلی: پوسته روشن","topbar.lang.toEnglish":"تغییر به انگلیسی","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"فعلی: انگلیسی","topbar.lang.currentChinese":"فعلی: چینی","topbar.export.label":"خروجی","topbar.export.tooltip":"وکتور SVG (قابل ویرایش)، تصویر PNG (2× کیفیت بالا) یا DXF (CAD)","topbar.export.pngFailed":"خروجی PNG ناموفق بود: {err}","topbar.export.dxfFailed":"خروجی DXF ناموفق بود: {err}","topbar.file.label":"فایل","topbar.file.tooltip":"باز کردن یک نمودار .json محلی، ذخیره، یا ذخیره با نام دیگر","topbar.file.current":"فعلی: {name}","topbar.file.new":"جدید","topbar.file.open":"باز کردن…","topbar.file.save":"ذخیره","topbar.file.saveAs":"ذخیره با نام دیگر…","topbar.file.newConfirm":"ایجاد فایل جدید تغییرات ذخیره‌نشده را از بین می‌برد. ادامه می‌دهید؟","topbar.file.openFailed":"باز کردن ناموفق بود: {err}","topbar.file.saveFailed":"ذخیره ناموفق بود: {err}","topbar.file.fileDescription":"نمودار OneLineEditor","outline.title":"طرح کلی","outline.collapse":"جمع کردن","outline.collapseAria":"جمع کردن طرح کلی","outline.empty":"(هیچ عنصری نیست — برای شروع از کتابخانه بکشید)","props.title":"ویژگی‌ها","props.node":"گره الکتریکی","props.wire":"سیم","props.bus":"شینه","props.junction":"نقطه اتصال","props.junctionPos":"موقعیت","props.nSelected":"{n} مورد انتخاب‌شده","props.empty":"چیزی انتخاب نشده","props.multi":"{n} مورد انتخاب شده","props.name":"نام","props.note":"یادداشت","props.label":"برچسب","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"گره الکتریکی {id} یافت نشد","props.wireNotFound":"سیم {id} یافت نشد","props.nodeStats":"{terminals} ترمینال · {elements} عنصر","props.selectElement":"انتخاب {label}","props.selectWholeNode":"انتخاب کل گره الکتریکی","props.annText":"متن","props.annRect":"مستطیل","props.annEllipse":"بیضی","props.annLine":"خط","props.annTable":"جدول","props.annNotFound":"حاشیه‌نویسی {id} یافت نشد","props.annLabel":"برچسب","props.annLabelPlaceholder":"مثلاً: تابلو شماره 1","props.color":"رنگ","props.size":"اندازه","props.sizeReset":"بازگشت به ۱۰۰٪","props.labelShown":"نمایان","props.labelHidden":"پنهان","props.color.default":"پیش‌فرض","props.color.red":"قرمز","props.color.amber":"کهربایی","props.color.green":"سبز","props.color.blue":"آبی","props.color.gray":"خاکستری","props.annStroke":"نوع خط","props.annStrokeSolid":"ممتد","props.annStrokeDashed":"خط‌چین","props.annStrokeDotted":"نقطه‌چین","props.annStrokeWidth":"ضخامت","props.annWidthThin":"نازک","props.annWidthMedium":"متوسط","props.annWidthThick":"ضخیم","props.annFill":"پرکردن","props.annFillNone":"هیچ","props.annFillTint":"ته‌رنگ","props.annArrow":"پیکان‌ها","props.annArrowNone":"هیچ‌کدام","props.annArrowEnd":"انتها","props.annArrowBoth":"دوطرفه","props.annFontSize":"اندازه فونت","props.annRows":"ردیف‌ها","props.annCols":"ستون‌ها","view.zoomOut":"کوچک‌نمایی","view.zoomOutHint":"کوچک‌نمایی پله‌ای؛ همچنین چرخ ماوس ↓ یا ⌘−","view.reset":"بازنشانی به 100%","view.current":"فعلی {z}%","view.zoomIn":"بزرگ‌نمایی","view.zoomInHint":"بزرگ‌نمایی پله‌ای؛ همچنین چرخ ماوس ↑ یا ⌘+","view.fit":"تنظیم نما","view.fitHint":"بزرگ‌نمایی خودکار و وسط‌چین کردن کل نقشه","view.gridHide":"پنهان کردن شبکه","view.gridShow":"نمایش شبکه","view.gridHotkey":"G","view.gridHideHint":"چسبیدن به شبکه را نیز غیرفعال می‌کند (جای‌گذاری آزاد)","view.gridShowHint":"چسبیدن به شبکه را نیز فعال می‌کند (چسبیدن به 10 پیکسل هنگام کشیدن)","view.gridHideAria":"پنهان کردن شبکه و غیرفعال کردن چسبیدن","view.gridShowAria":"نمایش شبکه و فعال کردن چسبیدن","view.label":"برچسب‌ها","view.labelOff":"خاموش","view.labelId":"شناسه","view.labelAll":"شناسه + پارامترها","view.labelHint":"نمایش و اندازهٔ برچسب‌ها (در خروجی هم اعمال می‌شود)","view.labelSize":"اندازه","view.labelSizeSmaller":"کوچک‌کردن برچسب‌ها","view.labelSizeLarger":"بزرگ‌کردن برچسب‌ها","view.standard":"استاندارد نمادها","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"فقط شکل نمادها را تغییر می‌دهد؛ سیم‌کشی، موقعیت‌ها و مقادیر دست‌نخورده می‌مانند. کلید مدار و فیوز در دو استاندارد متفاوت‌اند.","view.labelSizeReset":"بازنشانی اندازهٔ برچسب‌ها","library.title":"کتابخانه","tool.draw":"ترسیم","tool.drawHint":"متن، کادر، دایره، خط و جدول — یادداشت آزاد روی نقشه","library.empty":"عنصر منطبقی یافت نشد","cat.custom":"در این نقشه","library.customTag":"سفارشی","library.customHint":"تعریف‌شده در همین نقشه — در کتابخانهٔ دیگران نیست","library.createComponent":"قطعهٔ جدید…","library.searchPlaceholder":"جستجوی عناصر…","library.searchAria":"جستجوی عناصر","library.clearSearch":"پاک کردن جستجو","library.itemHint":"کلیک کنید تا وارد حالت قرارگیری شوید، یا به بوم بکشید","tool.select":"انتخاب","tool.selectHint":"برای انتخاب کلیک کنید، برای چند مورد کادر بکشید، برای منو راست‌کلیک کنید","tool.pan":"جابجایی","tool.panHint":"بوم را بکشید؛ کلید Space به‌طور موقت این حالت را فعال می‌کند","tool.wire":"سیم‌کشی","tool.wireHint":"از یک پایه/شینه/نقطه اتصال بکشید؛ رها کردن در فضای خالی یک نقطه اتصال می‌سازد، رها کردن روی یک سیم به آن متصل می‌شود","tool.bus":"شینه","tool.busHint":"روی بوم بکشید — با فشردن نقطه شروع و با رها کردن نقطه پایان تعیین می‌شود","tool.junction":"نقطه اتصال","tool.junctionHint":"برای قرار دادن یک نقطه اتصال (گره) روی بوم کلیک کنید؛ سیم‌ها آزادانه به آن متصل می‌شوند","tool.place":"قرار دادن","tool.placeHint":"برای قرار دادن کلیک کنید؛ یا از یک ترمینال/شینه بکشید تا هم‌زمان قرار داده و متصل شود","tool.text":"متن","tool.textHint":"برای قرار دادن یادداشت متنی روی بوم کلیک کنید؛ برای ویرایش یک مورد موجود دوبار کلیک کنید","tool.rect":"مستطیل","tool.rectHint":"برای رسم یک مستطیل / قاب گروه بکشید (به‌طور پیش‌فرض خط‌چین)؛ Shift برای مربع","tool.ellipse":"بیضی","tool.ellipseHint":"برای رسم بیضی بکشید؛ Shift را نگه دارید تا دایره شود","tool.line":"خط","tool.lineHint":"برای رسم یک خط حاشیه‌نویسی بکشید؛ Shift به 45° می‌چسبد؛ پیکان‌ها در پنل تنظیم می‌شوند","tool.table":"جدول","tool.tableHint":"برای تعیین ستون × ردیف بکشید (شمارش زنده)، یا برای جدول پیش‌فرض کلیک کنید؛ برای تایپ در سلول‌ها دوبار کلیک کنید","mode.selectWithSel":"عناصر را بکشید · ترمینال‌ها را برای سیم‌کشی بکشید · برای منو راست‌کلیک کنید","mode.selectEmpty":"برای انتخاب کلیک کنید · برای جابجایی بکشید · برای چند مورد کادر بکشید · برای منو راست‌کلیک کنید","mode.pan":"بوم را بکشید · برای بزرگ‌نمایی اسکرول کنید · برای جابجایی در هر ابزاری Space را نگه دارید","mode.wireDragging":"روی یک پایه/شینه/نقطه اتصال رها کنید؛ رها کردن در فضای خالی یک نقطه اتصال می‌سازد","mode.wireInit":"روی هر نقطه اتصال یا فضای خالی فشار دهید، به سمت مقصد بکشید و رها کنید","mode.busDragging":"کشیدن جهت شینه را تعیین می‌کند؛ رها کردن پایان را مشخص می‌کند","mode.busInit":"برای تعیین شروع روی بوم فشار دهید، بکشید، برای پایان رها کنید","mode.junction":"برای قرار دادن یک نقطه اتصال روی بوم کلیک کنید","mode.placeNoKind":"یک نوع عنصر را از کتابخانه سمت چپ انتخاب کنید","mode.placeFromTerm":"در مقصد رها کنید — عنصر جدید به ترمینال مبدأ متصل می‌شود","mode.placeNormal":"برای قرار دادن روی فضای خالی کلیک کنید؛ یا از یک ترمینال/شینه بکشید تا هم‌زمان قرار داده و متصل شود","mode.text":"برای قرار دادن متن کلیک کنید · برای ویرایش دوبار کلیک کنید · برای جابجایی انتخاب‌شده بکشید · Del برای حذف","mode.rect":"برای رسم مستطیل بکشید · Shift برای مربع · پس از رها کردن اندازه و برچسب آن را تغییر دهید","mode.ellipse":"برای رسم بیضی بکشید · Shift برای دایره · پس از رها کردن اندازه، رنگ و برچسب را تغییر دهید","mode.line":"برای رسم خط بکشید · Shift به 45° می‌چسبد · پس از رها کردن پیکان را در پنل اضافه کنید","mode.table":"برای تعیین شبکه بکشید، یا برای جدول 3×3 کلیک کنید · برای تایپ در سلول‌ها دوبار کلیک کنید","mode.annTextSel":"برای ویرایش روی متن کلیک کنید · برای جابجایی بکشید · Del برای حذف","mode.annTableSel":"برای پر کردن روی یک سلول کلیک کنید · برای جابجایی بکشید · Del برای حذف","mode.annShapeSel":"برای جابجایی بکشید · برای تغییر اندازه دستگیره‌ها را بکشید · سبک را در پنل تغییر دهید · Del برای حذف","mode.annEditing":"تایپ کنید · Enter برای تأیید · Esc برای لغو · یا دکمه‌های ✓ / ✕","mode.escSelect":"Esc انتخاب را پاک می‌کند","mode.escOther":"راست‌کلیک / Esc برای لغو","tool.placeNoKindTooltip":"یک نوع را از کتابخانه سمت چپ انتخاب کنید، سپس روی بوم کلیک کنید","tool.undo":"واگرد","tool.undoHint":"واگرد آخرین ویرایش (جابجایی / چرخش / حذف و غیره)","tool.redo":"بازانجام","tool.redoHint":"بازانجام آخرین ویرایش واگردشده","layout.label":"چیدمان","layout.hint":"چیدمان خودکار کل نمودار یا فقط انتخاب‌شده، پر کردن فضاهای خالی","layout.allAuto":"چیدمان خودکار همه","layout.selAuto":"چیدمان خودکار انتخاب‌شده","layout.allFill":"پر کردن قرارنگرفته‌ها","layout.selFill":"پر کردن قرارنگرفته‌ها در انتخاب‌شده","tool.more":"بیشتر","tool.moreHint":"واگرد / بازانجام / چیدمان","view.menu":"نما","view.menuHint":"بزرگ‌نمایی، تنظیم نما، شبکه","ctx.ariaNode":"عملیات گره","ctx.ariaWire":"عملیات سیم","ctx.ariaElement":"عملیات عنصر","ctx.ariaEdit":"عملیات ویرایش","ctx.done":"انجام شد","ctx.cancel":"لغو","ctx.rotate":"چرخش 90°","ctx.rotateHint":"چرخش انتخاب‌شده در جهت عقربه‌های ساعت؛ سیم‌ها از ترمینال‌های جدید مسیریابی می‌شوند","ctx.mirror":"قرینه افقی","ctx.mirrorTitle":"قرینه","ctx.mirrorHint":"برگرداندن انتخاب‌شده از چپ به راست","ctx.delete":"حذف","ctx.color":"رنگ","ctx.colorDefault":"پیش‌فرض","ctx.colorRed":"قرمز","ctx.colorAmber":"کهربایی","ctx.colorGreen":"سبز","ctx.colorBlue":"آبی","ctx.colorGray":"خاکستری","ctx.deleteHintNode":"قطع تمام سیم‌های این گره (عناصر باقی می‌مانند)","ctx.deleteHintWire":"فقط این سیم حذف می‌شود (سیم‌های دیگر همان گره باقی می‌مانند)","ctx.deleteHintElement":"حذف انتخاب‌شده و سیم‌های آن","ctx.resetWirePath":"بازنشانی به مسیریابی خودکار","ctx.resetWirePathHint":"گوشه‌های دستی حذف می‌شود و مسیریاب این سیم را دوباره رسم می‌کند","menu.undo":"واگرد","menu.redo":"بازانجام","menu.cut":"برش","menu.copy":"کپی","menu.paste":"جای‌گذاری","menu.rotate":"چرخش 90°","menu.mirror":"قرینه","menu.resetLabel":"بازنشانی جای برچسب","menu.selectAll":"انتخاب همه","menu.disconnect":"قطع این سیم","menu.delete":"حذف","io.parseFailed":"تجزیه JSON ناموفق بود: {err}","io.notObject":"فایل یک شیء JSON نیست","io.versionMismatch":'عدم تطابق نسخه: مقدار مورد انتظار "1"، مقدار دریافتی {actual}',"io.elementsMissing":"`elements` وجود ندارد یا آرایه نیست","compile.duplicateId":'شناسه عنصر تکراری: "{id}"',"compile.unknownKind":'نوع عنصر ناشناخته kind="{kind}"',"compile.invalidTermRef":'ارجاع ترمینال نامعتبر "{ref}"',"compile.elementMissing":'ارجاع به عنصر ناشناخته "{id}"',"compile.missingPin":'عنصر "{id}" (kind={kind}) پایه "{pin}" را ندارد؛ پایه‌های موجود: {available}',"compile.singleTerminal":"گره فقط یک ترمینال دارد — نادیده گرفته شد","compile.layoutMissingElement":'کلید layout با شناسه "{id}" به عنصری ناشناخته ارجاع می‌دهد',"compile.elementUnconnected":'عنصر "{id}" هیچ اتصالی ندارد',"cat.busbar":"شینه / سیم‌کشی","cat.switching":"کلیدزنی","cat.protection":"حفاظت","cat.motor-control":"کنترل موتور","cat.transformer":"ترانسفورماتور","cat.instrument-transformer":"ترانسفورماتور اندازه‌گیری","cat.measurement":"اندازه‌گیری","cat.source":"منبع","cat.load":"بار","cat.storage":"ذخیره‌سازی","cat.compensation":"جبران‌سازی","cat.grounding":"اتصال زمین","cat.renewable":"انرژی‌های تجدیدپذیر / الکترونیک قدرت","onboard.title":"شروع سریع","onboard.step1.title":"قرار دادن یک قطعه","onboard.step1.body":"ابزار قرار دادن (P) را انتخاب کنید و یک نوع را از کتابخانه به بوم بکشید","onboard.step2.title":"سیم‌کشی کنید","onboard.step2.body":"از ابزار سیم‌کشی (W) استفاده کنید: از یک پایه به پایه دیگر بکشید — برای ساخت یک نقطه اتصال به فضای خالی بکشید","onboard.step3.title":"شینه یک ریل مشترک است، نه یک سیم","onboard.step3.body":"ابزار شینه (B) را فقط زمانی استفاده کنید که چند مدار یک ریل مشترک دارند. از شینه برای اتصال دو دستگاه استفاده نکنید — فقط پایه‌ها را سیم‌کشی کنید (W).","onboard.dismiss":"متوجه شدم"},gC={"arc-suppression-coil.name":"سلف خاموش‌کننده قوس","arrester.name":"برقگیر (FBL)","async-motor.name":"موتور آسنکرون","autotransformer.name":"اتوترانسفورماتور","battery.name":"ذخیره‌سازی باتری","breaker.name":"کلید اتوماتیک (QF)","busbar.name":"قطعه شینه","converter-bidir.name":"مبدل دوطرفه (PCS)","dc-dc-converter.name":"مبدل DC/DC","mppt.name":"کنترلر MPPT","ct.name":"ترانسفورماتور جریان (CT)","disconnector.name":"سکسیونر (QS)","earth.name":"زمین","earthing-switch.name":"کلید ارت (QE)","fuse.name":"فیوز (FU)","generator.name":"ژنراتور (G)","grid-source.name":"منبع شبکه سراسری","grounding-transformer.name":"ترانسفورماتور زمین (زیگزاگ)","inverter.name":"اینورتر (DC→AC)","load-switch.name":"کلید قطع بار","load.name":"بار","luminaire.name":"چراغ (بار روشنایی)","panelboard.name":"تابلو برق / مرکز بار","ngr.name":"مقاومت زمین نوترال (NGR)","pt.name":"ترانسفورماتور ولتاژ (PT)","pv.name":"ماژول فتوولتائیک","rectifier.name":"یکسوکننده (AC→DC)","series-reactor.name":"راکتور سری","shunt-capacitor.name":"خازن موازی","shunt-reactor.name":"راکتور موازی","sync-motor.name":"موتور سنکرون","transformer-2w.name":"ترانسفورماتور دو سیم‌پیچ","transformer-3w.name":"ترانسفورماتور سه سیم‌پیچ","wind-turbine.name":"توربین بادی","gfci-breaker.name":"کلید GFCI (RCBO)","rcd.name":"کلید جریان نشتی (RCD)","recloser.name":"ریکلوزر","energy-meter.name":"کنتور انرژی (Wh)","voltmeter.name":"ولت‌متر (V)","ammeter.name":"آمپرمتر (A)","wattmeter.name":"وات‌متر (W)","frequency-meter.name":"فرکانس‌متر (Hz)","contactor.name":"کنتاکتور (KM)","motor-starter.name":"راه‌انداز موتور","thermal-overload.name":"رله اضافه‌بار حرارتی","vfd.name":"درایو فرکانس متغیر (VFD)","soft-starter.name":"راه‌انداز نرم","transfer-switch.name":"کلید انتقال اتوماتیک (ATS)","dc-disconnector.name":"سکسیونر DC","dc-combiner.name":"جعبه ترکیب‌کننده DC","ev-charger.name":"شارژر خودرو برقی","arc-suppression-coil.desc":"اتصال زمین تشدیدی نقطه نوترال: سلف به زمین","busbar.desc":"قطعه شینه تک با قابلیت کشش و چند انشعاب","converter-bidir.desc":"مبدل ذخیره‌ساز: دوطرفه AC ↔ DC","dc-dc-converter.desc":"مبدل DC/DC / شارژر DC (IEC 60617)","mppt.desc":"کنترلر شارژ خورشیدی MPPT (DC/DC، ردیابی نقطه توان بیشینه)","earthing-switch.desc":"سکسیونر + اتصال زمین، تک‌پورت","grid-source.desc":"شینه بی‌نهایت / شبکه خارجی","grounding-transformer.desc":"ترانسفورماتور ستاره-زیگزاگ برای اتصال زمین نقطه نوترال","load.desc":"بار انتزاعی (پیکان خروجی جریان)","luminaire.desc":"بار روشنایی (نماد عمومی چراغ IEC 60617)","ngr.desc":"اتصال زمین با مقاومت کم: نوترال ترانسفورماتور به زمین","series-reactor.desc":"نماد مشابه راکتور موازی؛ تمایز بر اساس کاربرد","wind-turbine.desc":"توربین بادی: ژنراتور + نشان روتور سه‌پره","gfci-breaker.desc":"کلید جریان نشتی با حفاظت اضافه‌جریان (UL943 / IEC 61009). GFCI در آمریکای شمالی / RCBO در اروپا.","rcd.desc":"کلید جریان نشتی بدون حفاظت اضافه‌جریان (IEC 61008).","recloser.desc":"ریکلوزر خودکار فشار متوسط.","energy-meter.desc":"کنتور انرژی اکتیو (kWh) — ورودی سرویس / زیرکنتور.","contactor.desc":"کنتاکتور مدار اصلی؛ معمولاً همراه با رله اضافه‌بار حرارتی و موتور استفاده می‌شود.","motor-starter.desc":"راه‌انداز موتور (نماد عمومی IEC 60617).","thermal-overload.desc":"رله اضافه‌بار حرارتی موتور؛ بین کنتاکتور و موتور قرار می‌گیرد.","vfd.desc":"درایو فرکانس متغیر برای کنترل سرعت موتور القایی.","soft-starter.desc":"راه‌انداز نرم موتور (راه‌اندازی با ولتاژ کاهش‌یافته بر پایه تریستور).","transfer-switch.desc":"کلید انتقال دو منبعی (ATS / دستی). دو ورودی منبع + یک خروجی بار، با قفل مکانیکی متقابل.","dc-disconnector.desc":"کلید ایزوله DC — ایزوله‌سازی سمت DC رشته فتوولتائیک / باتری.","dc-combiner.desc":"جعبه ترکیب‌کننده رشته‌های فتوولتائیک (نمونه 4 ورودی).","ev-charger.desc":"ایستگاه شارژ خودرو برقی.","breaker.state.open":"باز","disconnector.state.open":"باز","earthing-switch.state.open":"باز","fuse.state.blown":"سوخته","load-switch.state.open":"باز","gfci-breaker.state.open":"باز","rcd.state.open":"باز","recloser.state.open":"باز","contactor.state.open":"باز","thermal-overload.state.tripped":"تریپ‌کرده","transfer-switch.state.position":"موقعیت (عادی/اضطراری/خاموش)","dc-disconnector.state.open":"باز","battery.param.E":"ظرفیت","busbar.param.Un":"ولتاژ نامی","converter-bidir.param.S":"ظرفیت","dc-dc-converter.param.P":"توان","mppt.param.I":"جریان نامی","load.param.P":"توان اکتیو","load.param.cosphi":"ضریب توان","ngr.param.R":"مقاومت","shunt-capacitor.param.Q":"ظرفیت راکتیو","shunt-capacitor.param.stages":"پله‌ها","transformer-2w.param.S":"ظرفیت","transformer-2w.param.ratio":"نسبت تبدیل","gfci-breaker.param.In":"جریان نامی","panelboard.param.In":"جریان نامی","gfci-breaker.param.IDn":"جریان عملکرد نشتی","rcd.param.IDn":"جریان عملکرد نشتی","breaker.param.In":"جریان نامی","breaker.param.poles":"تعداد قطب","breaker.param.Icu":"قدرت قطع","disconnector.param.In":"جریان نامی","fuse.param.In":"جریان نامی","resistor.name":"مقاومت (R)","capacitor.name":"خازن (C)","diode.name":"دیود (D)","indicator-light.name":"چراغ نشانگر (HL)","push-button.name":"کلید فشاری (SB)","relay-coil.name":"بوبین رله (KA)","make-contact.name":"کنتاکت باز (NO)","break-contact.name":"کنتاکت بسته (NC)","bell.name":"زنگ (HA)","terminal.name":"ترمینال / اتصال (X)","fuse-switch-disconnector.name":"سکسیونر-کلید فیوزدار","socket-outlet.name":"پریز / کانکتور","inductor.name":"سلف (L)","voltage-regulator.name":"تنظیم‌کننده ولتاژ (T)","dc-motor.name":"موتور DC (M)","heater.name":"المنت حرارتی (EH)","selector-switch.name":"کلید سلکتور (SA)","limit-switch.name":"کلید حد (SQ)","proximity-switch.name":"کلید مجاورتی (SQ)","time-relay.name":"رله زمانی (KT)","buzzer.name":"بازر (HA)","siren.name":"آژیر (HA)","thermocouple.name":"ترموکوپل (BT)","thyristor.name":"تریستور / SCR (V)","triac.name":"تریاک (V)","zener-diode.name":"دیود زنر (D)","igbt.name":"IGBT","plc.name":"PLC / کنترلر","ups.name":"UPS","power-supply.name":"منبع تغذیه (PS)","genset.name":"مجموعه ژنراتور (G)","protective-relay.name":"رله حفاظتی","overcurrent-relay.name":"رله اضافه‌جریان (50/51)","undervoltage-relay.name":"رله کاهش ولتاژ (27)","reverse-power-relay.name":"رله توان معکوس (32)","distance-relay.name":"رله دیستانس (21)","phase-failure-relay.name":"رله قطع فاز","buchholz-relay.name":"رله بوخهلتس (63)","power-factor-meter.name":"ضریب توان‌متر (cosφ)","synchronoscope.name":"سنکرونوسکوپ","varmeter.name":"وارمتر (var)","resistor.desc":"مقاومت عمومی / محدودکننده جریان / مقاومت ترمزی.","capacitor.desc":"خازن عمومی / فیلتر / باس DC. برای اصلاح ضریب توان از خازن موازی استفاده کنید.","diode.desc":"دیود یکسوساز / آزادگرد / حفاظتی. t1 = آند (بالا)، t2 = کاتد (پایین).","indicator-light.desc":"چراغ نشانگر سیگنال / وضعیت.","push-button.desc":"کلید فشاری دستی، بازگشت خودکار (کنتاکت باز).","relay-coil.desc":"بوبین عملکرد رله / کنتاکتور (جعبه).","make-contact.desc":"کنتاکت کمکی نرمال باز (NO).","break-contact.desc":"کنتاکت کمکی نرمال بسته (NC).","bell.desc":"زنگ سیگنال / زنگ هشدار.","terminal.desc":"ترمینال / جعبه تقسیم / گره اتصال.","fuse-switch-disconnector.desc":"سکسیونر-کلید فیوزدار قابل قطع زیر بار.","socket-outlet.desc":"پریز برق / کانکتور چندقطبی.","inductor.desc":"سلف عمومی / بوبین / خفه‌کن.","voltage-regulator.desc":"تنظیم‌کننده ولتاژ القایی / اتوترانسفورماتوری قابل تنظیم.","dc-motor.desc":"موتور DC (نماد عمومی تحریک سری).","heater.desc":"المنت حرارتی مقاومتی / بار حرارتی.","selector-switch.desc":"کلید سلکتور / تغییر وضعیت (دوار، پایدار).","limit-switch.desc":"کلید حد حرکت / موقعیت (NO، عملکرد مکانیکی).","proximity-switch.desc":"سنسور مجاورتی / کلید مجاورتی بدون تماس.","time-relay.desc":"بوبین رله با تأخیر زمانی (عملکرد کند).","buzzer.desc":"بازر سیگنال.","siren.desc":"آژیر صوتی / هشدار.","thermocouple.desc":"سنسور دمای ترموکوپل.","thyristor.desc":"تریستور سه‌پایه مسدودکننده معکوس / SCR. t1 = آند (بالا)، t2 = کاتد (پایین).","triac.desc":"تریستور سه‌پایه دوطرفه (TRIAC).","zener-diode.desc":"دیود زنر / تنظیم‌کننده ولتاژ. t1 = آند (بالا)، t2 = کاتد (پایین).","igbt.desc":"IGBT کانال N از نوع تقویتی. t1 = کلکتور (بالا)، t2 = امیتر (پایین)، t_g = گیت.","plc.desc":"کنترل‌کننده منطقی قابل برنامه‌ریزی (PLC).","ups.desc":"منبع تغذیه بی‌وقفه آنلاین / استندبای (UPS).","power-supply.desc":"منبع تغذیه سوییچینگ AC→DC / منبع تغذیه DC. t_ac بالا (~)، t_dc پایین (=).","genset.desc":"مجموعه ژنراتور دیزلی / گازی.","protective-relay.desc":"رله اندازه‌گیری / حفاظتی، نماد عمومی (IEC 60617).","overcurrent-relay.desc":"رله حفاظت اضافه‌جریان (ANSI 50/51).","undervoltage-relay.desc":"رله حفاظت کاهش ولتاژ (ANSI 27).","reverse-power-relay.desc":"رله حفاظت توان معکوس / جریان معکوس (ANSI 32).","distance-relay.desc":"رله حفاظت دیستانس / امپدانس کاهشی (ANSI 21).","phase-failure-relay.desc":"رله حفاظت قطع فاز / افت فاز.","buchholz-relay.desc":"رله بوخهلتس / گازی (ANSI 63).","power-factor-meter.desc":"ضریب توان‌متر (cosφ).","synchronoscope.desc":"نشانگر همزمان‌سازی / سنکرونوسکوپ.","varmeter.desc":"توان راکتیومتر (var).","make-contact.state.closed":"بسته","break-contact.state.open":"باز","fuse-switch-disconnector.state.open":"باز","selector-switch.state.open":"باز","limit-switch.state.closed":"بسته","resistor.param.R":"مقاومت","resistor.param.P":"توان نامی","capacitor.param.C":"ظرفیت خازنی","capacitor.param.Un":"ولتاژ نامی","indicator-light.param.color":"رنگ","inductor.param.L":"اندوکتانس","inductor.param.In":"جریان نامی","voltage-regulator.param.ratio":"محدوده تنظیم","heater.param.P":"توان","ups.param.S":"ظرفیت","power-supply.param.Vdc":"ولتاژ خروجی","genset.param.P":"توان"},bC={ui:fC,library:gC},yC={"common.unnamed":"بلا اسم","common.close":"إغلاق","common.yes":"نعم","common.no":"لا","topbar.theme.toLight":"التبديل إلى الوضع الفاتح","topbar.theme.toDark":"التبديل إلى الوضع الداكن","topbar.theme.currentDark":"الحالي: السمة الداكنة","topbar.theme.currentLight":"الحالي: السمة الفاتحة","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"الحالي: الإنجليزية","topbar.lang.currentChinese":"الحالي: الصينية","topbar.export.label":"تصدير","topbar.export.tooltip":"SVG متجهي (قابل للتحرير)، PNG نقطي (بدقة 2×)، أو DXF (لبرامج CAD)","topbar.export.pngFailed":"فشل تصدير PNG: {err}","topbar.export.dxfFailed":"فشل تصدير DXF: {err}","topbar.file.label":"ملف","topbar.file.tooltip":"افتح مخططًا محليًا بصيغة .json، احفظ، أو احفظ باسم","topbar.file.current":"الحالي: {name}","topbar.file.new":"جديد","topbar.file.open":"فتح…","topbar.file.save":"حفظ","topbar.file.saveAs":"حفظ باسم…","topbar.file.newConfirm":"سيؤدي إنشاء ملف جديد إلى فقدان أي تغييرات غير محفوظة. هل تريد المتابعة؟","topbar.file.openFailed":"فشل الفتح: {err}","topbar.file.saveFailed":"فشل الحفظ: {err}","topbar.file.fileDescription":"مخطط OneLineEditor","outline.title":"المخطط التفصيلي","outline.collapse":"طي","outline.collapseAria":"طي المخطط التفصيلي","outline.empty":"(لا توجد عناصر — اسحب من المكتبة للبدء)","props.title":"الخصائص","props.node":"العقدة الكهربائية","props.wire":"السلك","props.bus":"الشريط الناقل","props.junction":"نقطة الوصل","props.junctionPos":"الموضع","props.nSelected":"تم تحديد {n}","props.empty":"لا يوجد تحديد","props.multi":"تم تحديد {n} كائن","props.name":"الاسم","props.note":"ملاحظة","props.label":"التسمية","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"العقدة الكهربائية {id} غير موجودة","props.wireNotFound":"السلك {id} غير موجود","props.nodeStats":"{terminals} طرف · {elements} عنصر","props.selectElement":"تحديد {label}","props.selectWholeNode":"تحديد العقدة الكهربائية بالكامل","props.annText":"نص","props.annRect":"مستطيل","props.annEllipse":"بيضاوي","props.annLine":"خط","props.annTable":"جدول","props.annNotFound":"التعليق التوضيحي {id} غير موجود","props.annLabel":"التسمية","props.annLabelPlaceholder":"مثال: لوحة رقم 1","props.color":"اللون","props.size":"الحجم","props.sizeReset":"إعادة إلى 100%","props.labelShown":"ظاهرة","props.labelHidden":"مخفية","props.color.default":"افتراضي","props.color.red":"أحمر","props.color.amber":"كهرماني","props.color.green":"أخضر","props.color.blue":"أزرق","props.color.gray":"رمادي","props.annStroke":"نمط الخط","props.annStrokeSolid":"متصل","props.annStrokeDashed":"متقطع","props.annStrokeDotted":"منقّط","props.annStrokeWidth":"سماكة الخط","props.annWidthThin":"رفيع","props.annWidthMedium":"متوسط","props.annWidthThick":"سميك","props.annFill":"التعبئة","props.annFillNone":"بلا","props.annFillTint":"تظليل","props.annArrow":"الأسهم","props.annArrowNone":"بلا","props.annArrowEnd":"طرف واحد","props.annArrowBoth":"الطرفان","props.annFontSize":"حجم الخط","props.annRows":"الصفوف","props.annCols":"الأعمدة","view.zoomOut":"تصغير","view.zoomOutHint":"تصغير تدريجي؛ أو عجلة الفأرة ↓ أو ⌘−","view.reset":"إعادة الضبط إلى 100%","view.current":"الحالي {z}%","view.zoomIn":"تكبير","view.zoomInHint":"تكبير تدريجي؛ أو عجلة الفأرة ↑ أو ⌘+","view.fit":"احتواء العرض","view.fitHint":"تكبير/تصغير تلقائي وتوسيط المخطط بالكامل","view.gridHide":"إخفاء الشبكة","view.gridShow":"إظهار الشبكة","view.gridHotkey":"G","view.gridHideHint":"يعطّل أيضًا الانجذاب إلى الشبكة (وضع حر)","view.gridShowHint":"يفعّل أيضًا الانجذاب إلى الشبكة (ينجذب إلى 10 بكسل عند السحب)","view.gridHideAria":"إخفاء الشبكة وتعطيل الانجذاب","view.gridShowAria":"إظهار الشبكة وتفعيل الانجذاب","view.label":"التسميات","view.labelOff":"إيقاف","view.labelId":"المعرّف","view.labelAll":"المعرّف + المعاملات","view.labelHint":"إظهار التسميات وحجم خطها (ينطبق على التصدير أيضًا)","view.labelSize":"الحجم","view.labelSizeSmaller":"تصغير خط التسميات","view.labelSizeLarger":"تكبير خط التسميات","view.standard":"معيار الرموز","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"يغيّر رسم الرموز فقط — التوصيلات والمواضع والقيم تبقى كما هي. القاطع والمنصهر يختلفان بين المعيارين.","view.labelSizeReset":"إعادة تعيين حجم التسميات","library.title":"المكتبة","tool.draw":"رسم","tool.drawHint":"نصوص وأطر ودوائر وخطوط وجداول — تعليقات حرة فوق المخطط","library.empty":"لا توجد عناصر مطابقة","cat.custom":"في هذا المخطط","library.customTag":"مخصّص","library.customHint":"معرَّف في هذا المخطط — لا يوجد في مكتبة أحد آخر","library.createComponent":"مكوّن جديد…","library.searchPlaceholder":"البحث في العناصر…","library.searchAria":"البحث في العناصر","library.clearSearch":"مسح البحث","library.itemHint":"انقر للدخول في وضع الإضافة، أو اسحب إلى لوحة الرسم","tool.select":"تحديد","tool.selectHint":"انقر للاختيار، حدد بالسحب لاختيار عدة عناصر، أو انقر بالزر الأيمن لفتح القائمة","tool.pan":"تحريك","tool.panHint":"اسحب لوحة الرسم؛ مفتاح المسافة يبدّل مؤقتًا","tool.wire":"سلك","tool.wireHint":"اسحب من طرف/شريط ناقل/نقطة وصل؛ السحب إلى مساحة فارغة يُنشئ نقطة وصل، وإلى سلك موجود يصل به","tool.bus":"الشريط الناقل","tool.busHint":"اسحب على لوحة الرسم — اضغط لتحديد نقطة البداية، وحرر لتحديد نقطة النهاية","tool.junction":"نقطة الوصل","tool.junctionHint":"انقر على لوحة الرسم لوضع نقطة وصل (عقدة)؛ يمكن للأسلاك الاتصال بها بحرية","tool.place":"إضافة","tool.placeHint":"انقر للوضع؛ أو اسحب من طرف/شريط ناقل للوضع والتوصيل معًا","tool.text":"نص","tool.textHint":"انقر على لوحة الرسم لوضع ملاحظة نصية؛ انقر نقرًا مزدوجًا على ملاحظة موجودة لتحريرها","tool.rect":"مستطيل","tool.rectHint":"اسحب لرسم مستطيل / إطار تجميع (متقطع افتراضيًا)؛ اضغط Shift لرسم مربع","tool.ellipse":"بيضاوي","tool.ellipseHint":"اسحب لرسم شكل بيضاوي؛ اضغط Shift لرسم دائرة","tool.line":"خط","tool.lineHint":"اسحب لرسم خط توضيحي؛ Shift يقيّده بزاوية 45°؛ إعدادات الأسهم في لوحة الخصائص","tool.table":"جدول","tool.tableHint":"اسحب لتحديد عدد الأعمدة × الصفوف (يظهر العدد مباشرة)، أو انقر لوضع جدول افتراضي؛ انقر نقرًا مزدوجًا على الخلايا للكتابة","mode.selectWithSel":"اسحب العناصر · اسحب الأطراف للتوصيل · انقر بالزر الأيمن لفتح القائمة","mode.selectEmpty":"انقر للاختيار · اسحب للتحريك · حدد بالسحب لاختيار عدة عناصر · انقر بالزر الأيمن لفتح القائمة","mode.pan":"اسحب لوحة الرسم · مرّر للتكبير/التصغير · اضغط مطولاً على المسافة للتحريك في أي أداة","mode.wireDragging":"حرر على طرف/شريط ناقل/نقطة وصل؛ التحرير في مساحة فارغة يُنشئ نقطة وصل","mode.wireInit":"اضغط على أي نقطة اتصال أو مساحة فارغة، اسحب إلى الهدف ثم حرر","mode.busDragging":"السحب يحدد اتجاه الشريط الناقل؛ التحرير يحدد نقطة النهاية","mode.busInit":"اضغط على لوحة الرسم لتحديد البداية، اسحب، ثم حرر لتحديد النهاية","mode.junction":"انقر على لوحة الرسم لوضع نقطة وصل","mode.placeNoKind":"اختر نوع عنصر من المكتبة على اليسار","mode.placeFromTerm":"حرر عند الهدف — سيتصل العنصر الجديد بالطرف المصدر","mode.placeNormal":"انقر على مساحة فارغة للوضع؛ أو اسحب من طرف / شريط ناقل للوضع والتوصيل معًا","mode.text":"انقر لوضع نص · انقر نقرًا مزدوجًا للتحرير · اسحب العنصر المحدد للتحريك · Del للحذف","mode.rect":"اسحب لرسم مستطيل · Shift لرسم مربع · غيّر حجمه وأضف تسمية بعد التحرير","mode.ellipse":"اسحب لرسم شكل بيضاوي · Shift لرسم دائرة · غيّر حجمه ولونه وأضف تسمية بعد التحرير","mode.line":"اسحب لرسم خط · Shift يقيّده بزاوية 45° · أضف الأسهم في اللوحة بعد التحرير","mode.table":"اسحب لتحديد شبكة الجدول، أو انقر لوضع جدول 3×3 · انقر نقرًا مزدوجًا على الخلايا للكتابة","mode.annTextSel":"انقر على النص للتحرير · اسحب للتحريك · Del للحذف","mode.annTableSel":"انقر على خلية لملئها · اسحب للتحريك · Del للحذف","mode.annShapeSel":"اسحب للتحريك · اسحب المقابض لتغيير الحجم · غيّر النمط في اللوحة · Del للحذف","mode.annEditing":"اكتب · Enter للتأكيد · Esc للإلغاء · أو زرّي ✓ / ✕","mode.escSelect":"Esc لإلغاء التحديد","mode.escOther":"انقر بالزر الأيمن / Esc للإلغاء","tool.placeNoKindTooltip":"اختر نوعًا من المكتبة على اليسار، ثم انقر على لوحة الرسم","tool.undo":"تراجع","tool.undoHint":"تراجع عن آخر تعديل (تحريك / تدوير / حذف، إلخ)","tool.redo":"إعادة","tool.redoHint":"إعادة آخر تعديل تم التراجع عنه","layout.label":"التخطيط","layout.hint":"تخطيط تلقائي للمخطط بالكامل أو للتحديد فقط، وملء الفراغات","layout.allAuto":"تخطيط تلقائي للكل","layout.selAuto":"تخطيط تلقائي للتحديد","layout.allFill":"ملء العناصر غير الموضوعة","layout.selFill":"ملء العناصر غير الموضوعة في التحديد","tool.more":"المزيد","tool.moreHint":"تراجع / إعادة / تخطيط","view.menu":"العرض","view.menuHint":"تكبير، احتواء، شبكة","ctx.ariaNode":"إجراءات العقدة","ctx.ariaWire":"إجراءات السلك","ctx.ariaElement":"إجراءات العنصر","ctx.ariaEdit":"إجراءات التحرير","ctx.done":"تم","ctx.cancel":"إلغاء","ctx.rotate":"تدوير 90°","ctx.rotateHint":"تدوير التحديد باتجاه عقارب الساعة؛ تُعاد الأسلاك توجيهها عبر الأطراف الجديدة","ctx.mirror":"عكس أفقيًا","ctx.mirrorTitle":"عكس","ctx.mirrorHint":"قلب التحديد أفقيًا","ctx.delete":"حذف","ctx.color":"اللون","ctx.colorDefault":"افتراضي","ctx.colorRed":"أحمر","ctx.colorAmber":"كهرماني","ctx.colorGreen":"أخضر","ctx.colorBlue":"أزرق","ctx.colorGray":"رمادي","ctx.deleteHintNode":"فصل كل الأسلاك المتصلة بهذه العقدة (تبقى العناصر)","ctx.deleteHintWire":"إزالة هذا السلك فقط (تبقى الأسلاك الأخرى على نفس العقدة)","ctx.deleteHintElement":"إزالة التحديد وأسلاكه","ctx.resetWirePath":"إعادة الضبط إلى التوجيه التلقائي","ctx.resetWirePathHint":"تجاهل النقاط اليدوية ودع الموجّه يعيد رسم هذا السلك","menu.undo":"تراجع","menu.redo":"إعادة","menu.cut":"قص","menu.copy":"نسخ","menu.paste":"لصق","menu.rotate":"تدوير 90°","menu.mirror":"عكس","menu.resetLabel":"إعادة ضبط موضع التسمية","menu.selectAll":"تحديد الكل","menu.disconnect":"فصل هذا السلك","menu.delete":"حذف","io.parseFailed":"فشل تحليل JSON: {err}","io.notObject":"الملف ليس كائن JSON","io.versionMismatch":'عدم تطابق الإصدار: المتوقع "1"، والفعلي {actual}',"io.elementsMissing":"الحقل `elements` مفقود أو ليس مصفوفة","compile.duplicateId":'معرّف عنصر مكرر: "{id}"',"compile.unknownKind":'نوع عنصر غير معروف kind="{kind}"',"compile.invalidTermRef":'إشارة طرف غير صالحة "{ref}"',"compile.elementMissing":'إشارة إلى عنصر غير موجود "{id}"',"compile.missingPin":'العنصر "{id}" (kind={kind}) لا يحتوي على طرف "{pin}"؛ المتاح: {available}',"compile.singleTerminal":"العقدة تحتوي على طرف واحد فقط — تم تجاهلها","compile.layoutMissingElement":'مفتاح layout "{id}" يشير إلى عنصر غير موجود',"compile.elementUnconnected":'العنصر "{id}" لا يحتوي على أي اتصالات',"cat.busbar":"الشريط الناقل / التوصيلات","cat.switching":"المفاتيح والقواطع","cat.protection":"الحماية","cat.motor-control":"التحكم بالمحركات","cat.transformer":"المحولات","cat.instrument-transformer":"محولات القياس","cat.measurement":"القياس","cat.source":"المصادر","cat.load":"الأحمال","cat.storage":"التخزين","cat.compensation":"التعويض","cat.grounding":"التأريض","cat.renewable":"الطاقة المتجددة / الإلكترونيات الكهربائية","onboard.title":"البدء السريع","onboard.step1.title":"وضع عنصر","onboard.step1.body":"اختر أداة الإضافة (P) واسحب نوعًا من المكتبة إلى لوحة الرسم","onboard.step2.title":"وصّله","onboard.step2.body":"استخدم أداة السلك (W): اسحب من طرف إلى آخر — السحب إلى مساحة فارغة يضع نقطة وصل","onboard.step3.title":"الشريط الناقل قضيب مشترك، وليس سلكًا","onboard.step3.body":"استخدم أداة الشريط الناقل (B) فقط عندما تشترك عدة دوائر في قضيب واحد. لا تستخدم الشريط الناقل لربط جهازين — فقط وصّل الأطراف بسلك (W).","onboard.dismiss":"فهمت"},xC={"arc-suppression-coil.name":"ملف إخماد القوس","arrester.name":"مانع الصواعق (FBL)","async-motor.name":"محرك غير متزامن","autotransformer.name":"محول ذاتي","battery.name":"بطارية التخزين","breaker.name":"قاطع الدائرة (QF)","busbar.name":"مقطع الشريط الناقل","converter-bidir.name":"محوّل ثنائي الاتجاه (PCS)","dc-dc-converter.name":"محول DC/DC","mppt.name":"وحدة تحكم MPPT","ct.name":"محول التيار (CT)","disconnector.name":"مفتاح العزل (QS)","earth.name":"أرضي","earthing-switch.name":"مفتاح التأريض (QE)","fuse.name":"منصهر (FU)","generator.name":"مولد (G)","grid-source.name":"مصدر الشبكة","grounding-transformer.name":"محول التأريض (توصيل متعرج)","inverter.name":"عاكس (DC→AC)","load-switch.name":"مفتاح قطع الحمل","load.name":"حمل","luminaire.name":"مصباح (حمل إنارة)","panelboard.name":"لوحة توزيع / مركز أحمال","ngr.name":"مقاومة تأريض المحايد (NGR)","pt.name":"محول الجهد (PT)","pv.name":"وحدة كهروضوئية","rectifier.name":"مقوّم (AC→DC)","series-reactor.name":"مفاعل توالي","shunt-capacitor.name":"مكثف توازي","shunt-reactor.name":"مفاعل توازي","sync-motor.name":"محرك متزامن","transformer-2w.name":"محول ثنائي الملفات","transformer-3w.name":"محول ثلاثي الملفات","wind-turbine.name":"توربين رياح","gfci-breaker.name":"قاطع GFCI (RCBO)","rcd.name":"جهاز التيار المتبقي (RCD)","recloser.name":"قاطع إعادة التوصيل (Recloser)","energy-meter.name":"عداد الطاقة (Wh)","voltmeter.name":"فولتميتر (V)","ammeter.name":"أميتر (A)","wattmeter.name":"واتميتر (W)","frequency-meter.name":"مقياس التردد (Hz)","contactor.name":"كونتاكتور (KM)","motor-starter.name":"مشغّل محرك","thermal-overload.name":"مرحل الحمل الزائد الحراري","vfd.name":"مشغّل بتردد متغير (VFD)","soft-starter.name":"مشغّل ناعم","transfer-switch.name":"مفتاح تحويل (ATS)","dc-disconnector.name":"مفتاح عزل التيار المستمر","dc-combiner.name":"صندوق تجميع التيار المستمر","ev-charger.name":"شاحن السيارات الكهربائية","arc-suppression-coil.desc":"تأريض محايد رنيني: ملف حثي متصل بالأرض","busbar.desc":"مقطع شريط ناقل واحد قابل للتمديد بعدة نقاط تفريع","converter-bidir.desc":"محول تخزين: تيار متردد ↔ تيار مستمر ثنائي الاتجاه","dc-dc-converter.desc":"محول DC/DC / شاحن تيار مستمر (IEC 60617)","mppt.desc":"وحدة تحكم شمسية MPPT (DC/DC، تتبع نقطة القدرة القصوى)","earthing-switch.desc":"مفتاح عزل + اتصال أرضي، منفذ واحد","grid-source.desc":"شريط ناقل لانهائي / شبكة خارجية","grounding-transformer.desc":"محول نجمي-متعرج لتأريض المحايد","load.desc":"حمل تجريدي (سهم خروج التيار)","luminaire.desc":"حمل إنارة (رمز عام للمصباح وفق IEC 60617)","ngr.desc":"تأريض بمقاومة منخفضة: محايد المحول إلى الأرض","series-reactor.desc":"نفس رمز مفاعل التوازي؛ يُميَّز حسب الاستخدام","wind-turbine.desc":"توربين رياح: مولد + علامة دوار ثلاثي الريش","gfci-breaker.desc":"قاطع تيار متبقٍ مزود بحماية من التيار الزائد (UL943 / IEC 61009). يُعرف بـ GFCI في أمريكا الشمالية و RCBO في أوروبا.","rcd.desc":"قاطع تيار متبقٍ بدون حماية من التيار الزائد (IEC 61008).","recloser.desc":"قاطع إعادة غلق تلقائي للجهد المتوسط.","energy-meter.desc":"عداد طاقة فعالة (kWh) — عند نقطة الدخول أو كعداد فرعي.","contactor.desc":"كونتاكتور الدائرة الرئيسية؛ يُستخدم عادةً مع مرحل حمل زائد حراري ومحرك.","motor-starter.desc":"مشغّل محرك (الرمز العام IEC 60617).","thermal-overload.desc":"مرحل حمل زائد حراري للمحرك؛ يوضع بين الكونتاكتور والمحرك.","vfd.desc":"مشغّل بتردد متغير للتحكم في سرعة المحرك الحثي.","soft-starter.desc":"مشغّل ناعم للمحرك (تشغيل بجهد مخفّض باستخدام الثايرستور).","transfer-switch.desc":"مفتاح تحويل بمصدرين (ATS / يدوي). مدخلا مصدرين + مخرج حمل واحد، مع تأمين ميكانيكي متبادل.","dc-disconnector.desc":"مفتاح عزل للتيار المستمر — لعزل جانب التيار المستمر لسلسلة الألواح الكهروضوئية / البطارية.","dc-combiner.desc":"صندوق تجميع لسلاسل الألواح الكهروضوئية (مثال بأربعة مداخل).","ev-charger.desc":"محطة شحن السيارات الكهربائية.","breaker.state.open":"مفتوح","disconnector.state.open":"مفتوح","earthing-switch.state.open":"مفتوح","fuse.state.blown":"محترق","load-switch.state.open":"مفتوح","gfci-breaker.state.open":"مفتوح","rcd.state.open":"مفتوح","recloser.state.open":"مفتوح","contactor.state.open":"مفتوح","thermal-overload.state.tripped":"متعثر","transfer-switch.state.position":"الموضع (عادي/طوارئ/إيقاف)","dc-disconnector.state.open":"مفتوح","battery.param.E":"السعة","busbar.param.Un":"الجهد الاسمي","converter-bidir.param.S":"السعة","dc-dc-converter.param.P":"القدرة","mppt.param.I":"التيار الاسمي","load.param.P":"القدرة الفعالة","load.param.cosphi":"معامل القدرة","ngr.param.R":"المقاومة","shunt-capacitor.param.Q":"القدرة التفاعلية","shunt-capacitor.param.stages":"المراحل","transformer-2w.param.S":"السعة","transformer-2w.param.ratio":"نسبة التحويل","gfci-breaker.param.In":"التيار الاسمي","panelboard.param.In":"التيار المقنن","gfci-breaker.param.IDn":"تيار التشغيل المتبقي","rcd.param.IDn":"تيار التشغيل المتبقي","breaker.param.In":"التيار الاسمي","breaker.param.poles":"عدد الأقطاب","breaker.param.Icu":"قدرة القطع","disconnector.param.In":"التيار الاسمي","fuse.param.In":"التيار الاسمي","resistor.name":"مقاومة (R)","capacitor.name":"مكثف (C)","diode.name":"ديود (D)","indicator-light.name":"مصباح إشارة (HL)","push-button.name":"زر ضغط (SB)","relay-coil.name":"ملف مرحل (KA)","make-contact.name":"تماس مفتوح عادةً (NO)","break-contact.name":"تماس مغلق عادةً (NC)","bell.name":"جرس (HA)","terminal.name":"طرف / نقطة وصل (X)","fuse-switch-disconnector.name":"مفتاح فصل مزود بمصهر","socket-outlet.name":"مقبس / موصل","inductor.name":"ملف حثي (L)","voltage-regulator.name":"منظم الجهد (T)","dc-motor.name":"محرك تيار مستمر (M)","heater.name":"عنصر تسخين (EH)","selector-switch.name":"مفتاح اختيار (SA)","limit-switch.name":"مفتاح حدّي (SQ)","proximity-switch.name":"مفتاح تقارب (SQ)","time-relay.name":"مرحل زمني (KT)","buzzer.name":"طنّان (HA)","siren.name":"صفارة إنذار (HA)","thermocouple.name":"مزدوجة حرارية (BT)","thyristor.name":"ثايرستور / SCR (V)","triac.name":"ترياك (V)","zener-diode.name":"ديود زينر (D)","igbt.name":"IGBT","plc.name":"PLC / متحكم","ups.name":"UPS","power-supply.name":"مزود طاقة (PS)","genset.name":"مجموعة مولد (G)","protective-relay.name":"مرحل حماية","overcurrent-relay.name":"مرحل تيار زائد (50/51)","undervoltage-relay.name":"مرحل انخفاض الجهد (27)","reverse-power-relay.name":"مرحل القدرة العكسية (32)","distance-relay.name":"مرحل مسافة (21)","phase-failure-relay.name":"مرحل فقد الطور","buchholz-relay.name":"مرحل بوخهولز (63)","power-factor-meter.name":"مقياس معامل القدرة (cosφ)","synchronoscope.name":"مقياس التزامن","varmeter.name":"مقياس القدرة التفاعلية (var)","resistor.desc":"مقاومة عامة / للحد من التيار / مقاومة كبح.","capacitor.desc":"مكثف عام / للترشيح / لناقل التيار المستمر. استخدم مكثف التوازي لتصحيح معامل القدرة.","diode.desc":"ديود تقويم / تدوير حر / حماية. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","indicator-light.desc":"مصباح إشارة / حالة.","push-button.desc":"زر ضغط يدوي، رجوع تلقائي (تماس مفتوح عادةً).","relay-coil.desc":"ملف تشغيل مرحل / كونتاكتور (صندوق).","make-contact.desc":"تماس مساعد مفتوح عادةً (توصيل عند التشغيل).","break-contact.desc":"تماس مساعد مغلق عادةً (فصل عند التشغيل).","bell.desc":"جرس إشارة / جرس إنذار.","terminal.desc":"طرف / صندوق توصيل / عقدة اتصال.","fuse-switch-disconnector.desc":"مفتاح فصل مزود بمصهر يعمل تحت الحمل.","socket-outlet.desc":"مقبس كهربائي / موصل متعدد الأقطاب.","inductor.desc":"ملف حثي عام / وشيعة / خانق.","voltage-regulator.desc":"منظم جهد حثي قابل للتعديل / محول ذاتي.","dc-motor.desc":"محرك تيار مستمر (الرمز العام لملف المجال التوالي).","heater.desc":"عنصر تسخين مقاوم / حمل تسخين.","selector-switch.desc":"مفتاح اختيار / تحويل (دوّار، يثبت في وضعه).","limit-switch.desc":"مفتاح حركة / موضع (مفتوح عادةً، يعمل ميكانيكيًا).","proximity-switch.desc":"حساس تقارب / مفتاح تقارب بلا تماس.","time-relay.desc":"ملف مرحل زمني (تأخير التشغيل).","buzzer.desc":"طنّان إشارة.","siren.desc":"صفارة إنذار صوتية.","thermocouple.desc":"حساس حرارة من نوع مزدوجة حرارية.","thyristor.desc":"ثايرستور ثلاثي الأطراف حاجب عكسي / SCR. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","triac.desc":"ثايرستور ثلاثي ثنائي الاتجاه (TRIAC).","zener-diode.desc":"ديود زينر / منظم جهد. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","igbt.desc":"IGBT معزز قناة-N. t1 = المجمّع (أعلى)، t2 = الباعث (أسفل)، t_g = البوابة.","plc.desc":"متحكم منطقي قابل للبرمجة (PLC).","ups.desc":"مزود طاقة غير منقطع (UPS) خطي / احتياطي.","power-supply.desc":"مزود طاقة بتحويل مفتاح AC→DC / تيار مستمر. t_ac أعلى (~)، t_dc أسفل (=).","genset.desc":"مجموعة مولد ديزل / غاز.","protective-relay.desc":"مرحل قياس / حماية، رمز عام (IEC 60617).","overcurrent-relay.desc":"مرحل حماية من التيار الزائد (ANSI 50/51).","undervoltage-relay.desc":"مرحل حماية من انخفاض الجهد (ANSI 27).","reverse-power-relay.desc":"مرحل حماية من القدرة العكسية / التيار العكسي (ANSI 32).","distance-relay.desc":"مرحل حماية مسافة / انخفاض الممانعة (ANSI 21).","phase-failure-relay.desc":"مرحل حماية من فقد الطور.","buchholz-relay.desc":"مرحل بوخهولز / الغاز (ANSI 63).","power-factor-meter.desc":"مقياس معامل القدرة (cosφ).","synchronoscope.desc":"مؤشر التزامن / مقياس التزامن.","varmeter.desc":"مقياس القدرة التفاعلية (var).","make-contact.state.closed":"مغلق","break-contact.state.open":"مفتوح","fuse-switch-disconnector.state.open":"مفتوح","selector-switch.state.open":"مفتوح","limit-switch.state.closed":"مغلق","resistor.param.R":"المقاومة","resistor.param.P":"القدرة الاسمية","capacitor.param.C":"السعة الكهربائية","capacitor.param.Un":"الجهد الاسمي","indicator-light.param.color":"اللون","inductor.param.L":"المحاثة","inductor.param.In":"التيار الاسمي","voltage-regulator.param.ratio":"نطاق التنظيم","heater.param.P":"القدرة","ups.param.S":"السعة","power-supply.param.Vdc":"جهد الخرج","genset.param.P":"القدرة"},wC={ui:yC,library:xC},vC={"common.unnamed":"ללא שם","common.close":"סגור","common.yes":"כן","common.no":"לא","topbar.theme.toLight":"עבור למצב בהיר","topbar.theme.toDark":"עבור למצב כהה","topbar.theme.currentDark":"נוכחי: ערכת נושא כהה","topbar.theme.currentLight":"נוכחי: ערכת נושא בהירה","topbar.lang.toEnglish":"עבור לאנגלית","topbar.lang.toChinese":"עבור לסינית","topbar.lang.currentEnglish":"נוכחי: אנגלית","topbar.lang.currentChinese":"נוכחי: סינית","topbar.export.label":"ייצוא","topbar.export.tooltip":"SVG וקטורי (ניתן לעריכה), PNG (2×, רזולוציה גבוהה), או DXF (CAD)","topbar.export.pngFailed":"ייצוא PNG נכשל: {err}","topbar.export.dxfFailed":"ייצוא DXF נכשל: {err}","topbar.file.label":"קובץ","topbar.file.tooltip":"פתחו תרשים .json מקומי, שמרו, או שמרו בשם","topbar.file.current":"נוכחי: {name}","topbar.file.new":"חדש","topbar.file.open":"פתח…","topbar.file.save":"שמור","topbar.file.saveAs":"שמור בשם…","topbar.file.newConfirm":"יצירת קובץ חדש תמחק שינויים שלא נשמרו. להמשיך?","topbar.file.openFailed":"פתיחה נכשלה: {err}","topbar.file.saveFailed":"שמירה נכשלה: {err}","topbar.file.fileDescription":"תרשים OneLineEditor","outline.title":"מבנה","outline.collapse":"כווץ","outline.collapseAria":"כווץ את המבנה","outline.empty":"(אין רכיבים — גררו מהספרייה כדי להתחיל)","props.title":"מאפיינים","props.node":"צומת חשמלי","props.wire":"תיל","props.bus":"פס צבירה","props.junction":"מחבר","props.junctionPos":"מיקום","props.nSelected":"{n} נבחרו","props.empty":"לא נבחר דבר","props.multi":"{n} פריטים נבחרו","props.name":"שם","props.note":"הערה","props.label":"תווית","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"צומת חשמלי {id} לא נמצא","props.wireNotFound":"תיל {id} לא נמצא","props.nodeStats":"{terminals} הדקים · {elements} רכיבים","props.selectElement":"בחר {label}","props.selectWholeNode":"בחר את כל הצומת החשמלי","props.annText":"טקסט","props.annRect":"מלבן","props.annEllipse":"אליפסה","props.annLine":"קו","props.annTable":"טבלה","props.annNotFound":"סימון {id} לא נמצא","props.annLabel":"תווית","props.annLabelPlaceholder":"לדוגמה: לוח 1#","props.color":"צבע","props.size":"גודל","props.sizeReset":"איפוס ל-100%","props.labelShown":"מוצגת","props.labelHidden":"מוסתרת","props.color.default":"ברירת מחדל","props.color.red":"אדום","props.color.amber":"ענבר","props.color.green":"ירוק","props.color.blue":"כחול","props.color.gray":"אפור","props.annStroke":"סוג קו","props.annStrokeSolid":"רציף","props.annStrokeDashed":"מקווקו","props.annStrokeDotted":"מנוקד","props.annStrokeWidth":"עובי","props.annWidthThin":"דק","props.annWidthMedium":"בינוני","props.annWidthThick":"עבה","props.annFill":"מילוי","props.annFillNone":"ללא","props.annFillTint":"גוון","props.annArrow":"חיצים","props.annArrowNone":"ללא","props.annArrowEnd":"קצה אחד","props.annArrowBoth":"שני קצוות","props.annFontSize":"גודל גופן","props.annRows":"שורות","props.annCols":"עמודות","view.zoomOut":"הקטן תצוגה","view.zoomOutHint":"הקטנה מדורגת; ניתן גם עם גלגלת ↓ או ⌘−","view.reset":"אפס ל-100%","view.current":"נוכחי {z}%","view.zoomIn":"הגדל תצוגה","view.zoomInHint":"הגדלה מדורגת; ניתן גם עם גלגלת ↑ או ⌘+","view.fit":"התאם תצוגה","view.fitHint":"מתאים אוטומטית ומרכז את כל השרטוט","view.gridHide":"הסתר רשת","view.gridShow":"הצג רשת","view.gridHotkey":"G","view.gridHideHint":"גם מבטל הצמדה לרשת (מיקום חופשי)","view.gridShowHint":"גם מפעיל הצמדה לרשת (הצמדה ל-10px בגרירה)","view.gridHideAria":"הסתר רשת ובטל הצמדה","view.gridShowAria":"הצג רשת והפעל הצמדה","view.label":"תוויות","view.labelOff":"כבוי","view.labelId":"מזהה","view.labelAll":"מזהה + פרמטרים","view.labelHint":"תצוגת תוויות וגודל הגופן (חל גם על הייצוא)","view.labelSize":"גודל","view.labelSizeSmaller":"הקטנת גופן התוויות","view.labelSizeLarger":"הגדלת גופן התוויות","view.standard":"תקן הסמלים","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"משנה רק את ציור הסמלים — החיווט, המיקומים והנתונים נשארים כפי שהם. מפסק זרם ונתיך משורטטים אחרת בכל תקן.","view.labelSizeReset":"איפוס גודל התוויות","library.title":"ספריית רכיבים","tool.draw":"ציור","tool.drawHint":"טקסט, מסגרות, עיגולים, קווים וטבלאות — הערות חופשיות על השרטוט","library.empty":"לא נמצאו רכיבים תואמים","cat.custom":"בשרטוט הזה","library.customTag":"מותאם","library.customHint":"מוגדר בשרטוט הזה — לא קיים בספרייה של אף אחד אחר","library.createComponent":"רכיב חדש…","library.searchPlaceholder":"חיפוש רכיבים…","library.searchAria":"חיפוש רכיבים","library.clearSearch":"נקה חיפוש","library.itemHint":"לחצו כדי להיכנס למצב מיקום, או גררו אל הקנבס","tool.select":"בחירה","tool.selectHint":"לחיצה לבחירת רכיב, גרירת מסגרת לבחירה מרובה, קליק ימני לתפריט","tool.pan":"הזזה","tool.panHint":"גררו את הקנבס; מקש הרווח מפעיל זמנית","tool.wire":"תיל","tool.wireHint":"גררו מהדק / פס צבירה / מחבר; גרירה לשטח ריק יוצרת מחבר חדש, וגרירה על תיל קיים מתחברת אליו","tool.bus":"פס צבירה","tool.busHint":"גררו על הקנבס — לחצו לקביעת נקודת ההתחלה, שחררו לקביעת הסיום","tool.junction":"מחבר","tool.junctionHint":"לחצו על הקנבס כדי להציב מחבר (צומת); ניתן לחבר אליו תילים בחופשיות","tool.place":"הצבה","tool.placeHint":"לחצו כדי להציב; או גררו מהדק / פס צבירה כדי להציב ולחבר בו-זמנית","tool.text":"טקסט","tool.textHint":"לחצו על הקנבס כדי להוסיף הערת טקסט; לחיצה כפולה על הערה קיימת לעריכה","tool.rect":"מלבן","tool.rectHint":"גררו כדי לצייר מלבן / מסגרת קיבוץ (מקווקו כברירת מחדל); Shift לריבוע","tool.ellipse":"אליפסה","tool.ellipseHint":"גררו לציור אליפסה; החזיקו Shift לעיגול","tool.line":"קו","tool.lineHint":"גררו כדי לצייר קו סימון; Shift מצמיד ל-45°; חיצים זמינים בפאנל המאפיינים","tool.table":"טבלה","tool.tableHint":"גררו כדי לקבוע עמודות × שורות (ספירה חיה), או לחצו לטבלת ברירת מחדל; לחיצה כפולה על תא להקלדה","mode.selectWithSel":"גררו רכיבים · גררו מהדקים כדי לחווט · קליק ימני לתפריט","mode.selectEmpty":"לחצו לבחירה · גררו להזזה · מסגרת לבחירה מרובה · קליק ימני לתפריט","mode.pan":"גררו את הקנבס · גלגלת לזום · החזיקו Space כדי להזיז בכל כלי","mode.wireDragging":"שחררו על הדק / פס צבירה / מחבר; שחרור בשטח ריק יוצר מחבר חדש","mode.wireInit":"לחצו על כל נקודת חיבור או שטח ריק, גררו ליעד ושחררו","mode.busDragging":"הגרירה קובעת את כיוון הפס; השחרור קובע את הסיום","mode.busInit":"לחצו על הקנבס לקביעת ההתחלה, גררו, ושחררו לקביעת הסיום","mode.junction":"לחצו על הקנבס כדי להציב מחבר","mode.placeNoKind":"בחרו סוג רכיב מהספרייה בצד שמאל","mode.placeFromTerm":"שחררו ביעד — הרכיב החדש יתחבר בחזרה להדק המקור","mode.placeNormal":"לחצו על שטח ריק כדי להציב; או גררו מהדק / פס צבירה כדי להציב ולחבר","mode.text":"לחצו להוספת טקסט · לחיצה כפולה לעריכה · גררו רכיב נבחר להזזה · Del להסרה","mode.rect":"גררו לציור מלבן · Shift לריבוע · שנו גודל והוסיפו תווית לאחר השחרור","mode.ellipse":"גררו לציור אליפסה · Shift לעיגול · שנו גודל, צבע והוסיפו תווית לאחר השחרור","mode.line":"גררו לציור קו · Shift מצמיד ל-45° · הוסיפו חיצים בפאנל לאחר השחרור","mode.table":"גררו לקביעת הרשת, או לחצו לטבלת 3×3 · לחיצה כפולה על תא להקלדה","mode.annTextSel":"לחצו על הטקסט לעריכה · גררו להזזה · Del להסרה","mode.annTableSel":"לחצו על תא למילוי · גררו להזזה · Del להסרה","mode.annShapeSel":"גררו להזזה · גררו את הידיות לשינוי גודל · שנו סגנון בפאנל · Del להסרה","mode.annEditing":"הקלידו · Enter לאישור · Esc לביטול · או כפתורי ✓ / ✕","mode.escSelect":"Esc מנקה את הבחירה","mode.escOther":"קליק ימני / Esc לביטול","tool.placeNoKindTooltip":"בחרו סוג רכיב בספרייה בצד שמאל, ואז לחצו על הקנבס","tool.undo":"בטל","tool.undoHint":"בטל את הפעולה האחרונה (הזזה / סיבוב / מחיקה וכו׳)","tool.redo":"בצע שוב","tool.redoHint":"בצע שוב את הפעולה האחרונה שבוטלה","layout.label":"פריסה","layout.hint":"פריסה אוטומטית של כל התרשים או רק של הבחירה, ומילוי פערים","layout.allAuto":"פריסה אוטומטית לכל התרשים","layout.selAuto":"פריסה אוטומטית לבחירה","layout.allFill":"מלא רכיבים לא ממוקמים","layout.selFill":"מלא רכיבים לא ממוקמים בבחירה","tool.more":"עוד","tool.moreHint":"בטל / בצע שוב / פריסה","view.menu":"תצוגה","view.menuHint":"זום, התאמה, רשת","ctx.ariaNode":"פעולות על צומת","ctx.ariaWire":"פעולות על תיל","ctx.ariaElement":"פעולות על רכיב","ctx.ariaEdit":"פעולות עריכה","ctx.done":"סיום","ctx.cancel":"ביטול","ctx.rotate":"סובב 90°","ctx.rotateHint":"סובב את הבחירה בכיוון השעון; התילים ינותבו מחדש דרך ההדקים החדשים","ctx.mirror":"שקף אופקית","ctx.mirrorTitle":"שיקוף","ctx.mirrorHint":"הפוך את הבחירה מימין לשמאל","ctx.delete":"מחק","ctx.color":"צבע","ctx.colorDefault":"ברירת מחדל","ctx.colorRed":"אדום","ctx.colorAmber":"ענבר","ctx.colorGreen":"ירוק","ctx.colorBlue":"כחול","ctx.colorGray":"אפור","ctx.deleteHintNode":"נתק את כל התילים בצומת זה (הרכיבים נשארים)","ctx.deleteHintWire":"הסר רק את התיל הזה (תילים אחרים באותו צומת נשארים)","ctx.deleteHintElement":"הסר את הבחירה ואת התילים המחוברים אליה","ctx.resetWirePath":"אפס לניתוב אוטומטי","ctx.resetWirePathHint":"הסר פינות ידניות ותן לניתוב האוטומטי לצייר מחדש את התיל","menu.undo":"בטל","menu.redo":"בצע שוב","menu.cut":"גזור","menu.copy":"העתק","menu.paste":"הדבק","menu.rotate":"סובב 90°","menu.mirror":"שיקוף","menu.resetLabel":"איפוס מיקום התווית","menu.selectAll":"בחר הכל","menu.disconnect":"נתק תיל זה","menu.delete":"מחק","io.parseFailed":"ניתוח JSON נכשל: {err}","io.notObject":"הקובץ אינו אובייקט JSON","io.versionMismatch":'אי-התאמת גרסה: צפוי "1", התקבל {actual}',"io.elementsMissing":"השדה `elements` חסר או שאינו מערך","compile.duplicateId":'מזהה רכיב כפול: "{id}"',"compile.unknownKind":'סוג רכיב לא ידוע kind="{kind}"',"compile.invalidTermRef":'הפניית הדק לא תקינה "{ref}"',"compile.elementMissing":'הפניה לרכיב לא ידוע "{id}"',"compile.missingPin":'לרכיב "{id}" (kind={kind}) אין הדק "{pin}"; זמינים: {available}',"compile.singleTerminal":"לצומת יש הדק אחד בלבד — הצומת נדחה","compile.layoutMissingElement":'מפתח ה-layout "{id}" מפנה לרכיב לא ידוע',"compile.elementUnconnected":'לרכיב "{id}" אין חיבורים',"cat.busbar":"פס צבירה / חיווט","cat.switching":"מיתוג","cat.protection":"הגנה","cat.motor-control":"בקרת מנועים","cat.transformer":"שנאים","cat.instrument-transformer":"שנאי מדידה","cat.measurement":"מדידה","cat.source":"מקור","cat.load":"עומס","cat.storage":"אגירת אנרגיה","cat.compensation":"פיצוי הספק מגיב","cat.grounding":"הארקה","cat.renewable":"אנרגיה מתחדשת / אלקטרוניקת הספק","onboard.title":"התחלה מהירה","onboard.step1.title":"הציבו רכיב","onboard.step1.body":"בחרו בכלי הצבה (P) וגררו סוג רכיב מהספרייה אל הקנבס","onboard.step2.title":"חברו בתילים","onboard.step2.body":"השתמשו בכלי תיל (W): גררו מהדק אחד לאחר — גרירה לשטח ריק תיצור מחבר","onboard.step3.title":"פס צבירה הוא פס משותף, לא תיל","onboard.step3.body":"השתמשו בכלי פס צבירה (B) רק כשכמה מעגלים חולקים פס אחד. אל תשתמשו בפס צבירה כדי לחבר שני התקנים — פשוט חברו את ההדקים בתיל (W).","onboard.dismiss":"הבנתי"},kC={"arc-suppression-coil.name":"סליל דעיכת קשת","arrester.name":"מגן ברקים (FBL)","async-motor.name":"מנוע אסינכרוני","autotransformer.name":"שנאי אוטו","battery.name":"אגירת מצברים","breaker.name":"מפסק (QF)","busbar.name":"קטע פס צבירה","converter-bidir.name":"ממיר דו-כיווני (PCS)","dc-dc-converter.name":"ממיר DC/DC","mppt.name":"בקר MPPT","ct.name":"שנאי זרם (CT)","disconnector.name":"מנתק (QS)","earth.name":"הארקה","earthing-switch.name":"מפסק הארקה (QE)","fuse.name":"נתיך (FU)","generator.name":"גנרטור (G)","grid-source.name":"מקור הזנה מהרשת","grounding-transformer.name":"שנאי הארקה (זיגזג)","inverter.name":"ממיר (DC→AC)","load-switch.name":"מפסק עומס","load.name":"עומס","luminaire.name":"גוף תאורה (עומס תאורה)","panelboard.name":"לוח חשמל","ngr.name":"נגד הארקת נייטרלי (NGR)","pt.name":"שנאי מתח (PT)","pv.name":"מודול פוטו-וולטאי","rectifier.name":"מיישר (AC→DC)","series-reactor.name":"משרן טורי","shunt-capacitor.name":"קבל מקבילי","shunt-reactor.name":"משרן מקבילי","sync-motor.name":"מנוע סינכרוני","transformer-2w.name":"שנאי דו-סלילי","transformer-3w.name":"שנאי תלת-סלילי","wind-turbine.name":"טורבינת רוח","gfci-breaker.name":"מפסק GFCI (RCBO)","rcd.name":"התקן פחת (RCD)","recloser.name":"מפסק שחזור אוטומטי (Recloser)","energy-meter.name":"מונה אנרגיה (Wh)","voltmeter.name":"וולטמטר (V)","ammeter.name":"אמפרמטר (A)","wattmeter.name":"ואטמטר (W)","frequency-meter.name":"מד תדר (Hz)","contactor.name":"מגען (KM)","motor-starter.name":"מתנע מנוע","thermal-overload.name":"ממסר עומס יתר תרמי","vfd.name":"ממיר תדר (VFD)","soft-starter.name":"מתנע רך","transfer-switch.name":"מתג העברה (ATS)","dc-disconnector.name":"מנתק DC","dc-combiner.name":"תיבת ריכוז DC","ev-charger.name":"עמדת טעינה לרכב חשמלי","arc-suppression-coil.desc":"הארקת נייטרלי תהודתית: סליל לאדמה","busbar.desc":"קטע פס יחיד נמתח עם מספר הסתעפויות","converter-bidir.desc":"ממיר אגירה: דו-כיווני AC ↔ DC","dc-dc-converter.desc":"ממיר DC/DC / מטען DC (IEC 60617)","mppt.desc":"בקר טעינה סולארי MPPT (DC/DC, מעקב אחר נקודת ההספק המרבי)","earthing-switch.desc":"מנתק + חיבור הארקה, יציאה בודדת","grid-source.desc":"פס אינסופי / רשת חיצונית","grounding-transformer.desc":"שנאי כוכב-זיגזג להארקת נייטרלי","load.desc":"עומס מופשט (חץ יציאת זרם)","luminaire.desc":"עומס תאורה (סמל כללי לגוף תאורה לפי IEC 60617)","ngr.desc":"הארקה בהתנגדות נמוכה: נייטרלי השנאי לאדמה","series-reactor.desc":"אותו סמל כמו משרן מקבילי; ההבחנה לפי אופן השימוש","wind-turbine.desc":"טורבינת רוח: גנרטור + סימון רוטור תלת-להב","gfci-breaker.desc":"מפסק פחת עם הגנת זרם יתר (UL943 / IEC 61009). מכונה גם GFCI (צפון אמריקה) או RCBO (אירופה).","rcd.desc":"מפסק פחת ללא הגנת זרם יתר (IEC 61008).","recloser.desc":"מפסק שחזור אוטומטי במתח בינוני.","energy-meter.desc":"מונה אנרגיה פעילה (kWh) — כניסת שירות / מונה משנה.","contactor.desc":"מגען למעגל ראשי; משמש בדרך כלל עם ממסר תרמי ומנוע.","motor-starter.desc":"מתנע מנוע (סמל כללי לפי IEC 60617).","thermal-overload.desc":"ממסר עומס יתר תרמי למנוע; ממוקם בין המגען למנוע.","vfd.desc":"ממיר תדר לבקרת מהירות מנוע אסינכרוני.","soft-starter.desc":"מתנע רך למנוע (הפעלה במתח מופחת מבוססת תיריסטורים).","transfer-switch.desc":"מתג העברה דו-מקורי (ATS / ידני). שני מקורות כניסה ויציאת עומס אחת, עם נעילה הדדית ללא הזנה מקבילה.","dc-disconnector.desc":"מנתק DC — בידוד צד DC של מחרוזות פוטו-וולטאיות / מצברים.","dc-combiner.desc":"תיבת ריכוז מחרוזות פוטו-וולטאיות (דוגמה עם 4 כניסות).","ev-charger.desc":"עמדת טעינה לרכב חשמלי.","breaker.state.open":"פתוח","disconnector.state.open":"פתוח","earthing-switch.state.open":"פתוח","fuse.state.blown":"שרוף","load-switch.state.open":"פתוח","gfci-breaker.state.open":"פתוח","rcd.state.open":"פתוח","recloser.state.open":"פתוח","contactor.state.open":"פתוח","thermal-overload.state.tripped":"הופעל","transfer-switch.state.position":"מצב (רגיל/חירום/כבוי)","dc-disconnector.state.open":"פתוח","battery.param.E":"קיבולת","busbar.param.Un":"מתח נקוב","converter-bidir.param.S":"הספק נקוב","dc-dc-converter.param.P":"הספק","mppt.param.I":"זרם נקוב","load.param.P":"הספק פעיל","load.param.cosphi":"מקדם הספק","ngr.param.R":"התנגדות","shunt-capacitor.param.Q":"הספק מגיב","shunt-capacitor.param.stages":"מדרגות","transformer-2w.param.S":"הספק נקוב","transformer-2w.param.ratio":"יחס תמורה","gfci-breaker.param.In":"זרם נקוב","panelboard.param.In":"זרם נקוב","gfci-breaker.param.IDn":"זרם ניתוק פחת","rcd.param.IDn":"זרם ניתוק פחת","breaker.param.In":"זרם נקוב","breaker.param.poles":"מספר קטבים","breaker.param.Icu":"כושר ניתוק","disconnector.param.In":"זרם נקוב","fuse.param.In":"זרם נקוב","resistor.name":"נגד (R)","capacitor.name":"קבל (C)","diode.name":"דיודה (D)","indicator-light.name":"נורית חיווי (HL)","push-button.name":"לחצן (SB)","relay-coil.name":"סליל ממסר (KA)","make-contact.name":"מגע נורמלי-פתוח (NO)","break-contact.name":"מגע נורמלי-סגור (NC)","bell.name":"פעמון (HA)","terminal.name":"הדק / צומת (X)","fuse-switch-disconnector.name":"מפסק-מנתק עם נתיכים","socket-outlet.name":"שקע / מחבר","inductor.name":"משרן (L)","voltage-regulator.name":"ווסת מתח (T)","dc-motor.name":"מנוע DC (M)","heater.name":"גוף חימום (EH)","selector-switch.name":"מתג בורר (SA)","limit-switch.name":"מפסק גבול (SQ)","proximity-switch.name":"מתג קרבה (SQ)","time-relay.name":"ממסר זמן (KT)","buzzer.name":"זמזם (HA)","siren.name":"צופר (HA)","thermocouple.name":"תרמוזוג (BT)","thyristor.name":"תיריסטור / SCR (V)","triac.name":"טריאק (V)","zener-diode.name":"דיודת זנר (D)","igbt.name":"IGBT","plc.name":"בקר PLC","ups.name":"אל-פסק (UPS)","power-supply.name":"ספק כוח (PS)","genset.name":"קבוצת גנרטור (G)","protective-relay.name":"ממסר הגנה","overcurrent-relay.name":"ממסר זרם יתר (50/51)","undervoltage-relay.name":"ממסר תת-מתח (27)","reverse-power-relay.name":"ממסר הספק הפוך (32)","distance-relay.name":"ממסר מרחק (21)","phase-failure-relay.name":"ממסר כשל פאזה","buchholz-relay.name":"ממסר בוכהולץ (63)","power-factor-meter.name":"מד מקדם הספק (cosφ)","synchronoscope.name":"סינכרונוסקופ","varmeter.name":"מד הספק מגיב (var)","resistor.desc":"נגד כללי / הגבלת זרם / נגד בלימה.","capacitor.desc":"קבל כללי / סינון / פס DC. לשיפור מקדם הספק השתמשו בקבל מקבילי.","diode.desc":"דיודת יישור / דיודת חופש / דיודת הגנה. t1 = אנודה (למעלה), t2 = קתודה (למטה).","indicator-light.desc":"נורית איתות / חיווי מצב.","push-button.desc":"לחצן ידני עם החזרה אוטומטית (מגע נורמלי-פתוח).","relay-coil.desc":"סליל הפעלה של ממסר / מגען (תיבה).","make-contact.desc":"מגע עזר נורמלי-פתוח (סוגר).","break-contact.desc":"מגע עזר נורמלי-סגור (פותח).","bell.desc":"פעמון איתות / פעמון אזעקה.","terminal.desc":"הדק / תיבת חיבורים / צומת חיבור.","fuse-switch-disconnector.desc":"מפסק-מנתק עם נתיכים לניתוק בעומס.","socket-outlet.desc":"שקע חשמל / מחבר רב-קוטבי.","inductor.desc":"משרן כללי / סליל / דעכן.","voltage-regulator.desc":"ווסת מתח אינדוקטיבי / שנאי-אוטו מתכוונן.","dc-motor.desc":"מנוע DC (סמל כללי, עירור טורי).","heater.desc":"גוף חימום נגדי / עומס חימום.","selector-switch.desc":"מתג בורר / מתג החלפה (סיבובי, נשאר במצב).","limit-switch.desc":"מפסק גבול / מיקום (נורמלי-פתוח, הפעלה מכנית).","proximity-switch.desc":"חיישן קרבה / מתג קרבה ללא מגע.","time-relay.desc":"סליל ממסר השהיית זמן (פעולה מושהית).","buzzer.desc":"זמזם איתות.","siren.desc":"צופר / אזעקה קולית.","thermocouple.desc":"חיישן טמפרטורה מסוג תרמוזוג.","thyristor.desc":"תיריסטור טריודה חוסם-הפוך / SCR. t1 = אנודה (למעלה), t2 = קתודה (למטה).","triac.desc":"תיריסטור טריודה דו-כיווני (TRIAC).","zener-diode.desc":"דיודת זנר / ווסת מתח. t1 = אנודה (למעלה), t2 = קתודה (למטה).","igbt.desc":"IGBT מסוג ערוץ-N. t1 = קולקטור (למעלה), t2 = אמיטר (למטה), t_g = שער.","plc.desc":"בקר לוגי מתוכנת (PLC).","ups.desc":"אל-פסק (UPS) מסוג און-ליין / המתנה.","power-supply.desc":"ספק כוח נדסק (AC→DC) / ספק DC. t_ac למעלה (~), t_dc למטה (=).","genset.desc":"קבוצת גנרטור דיזל / גז.","protective-relay.desc":"ממסר מדידה / הגנה, סמל כללי (IEC 60617).","overcurrent-relay.desc":"ממסר הגנת זרם יתר (ANSI 50/51).","undervoltage-relay.desc":"ממסר הגנת תת-מתח (ANSI 27).","reverse-power-relay.desc":"ממסר הגנה בפני הספק הפוך / זרם הפוך (ANSI 32).","distance-relay.desc":"ממסר הגנת מרחק / תת-עכבה (ANSI 21).","phase-failure-relay.desc":"ממסר הגנה בפני כשל פאזה / אובדן פאזה.","buchholz-relay.desc":"ממסר בוכהולץ / ממסר גז (ANSI 63).","power-factor-meter.desc":"מד מקדם הספק (cosφ).","synchronoscope.desc":"מד סנכרון / סינכרונוסקופ.","varmeter.desc":"מד הספק מגיב (var).","make-contact.state.closed":"סגור","break-contact.state.open":"פתוח","fuse-switch-disconnector.state.open":"פתוח","selector-switch.state.open":"פתוח","limit-switch.state.closed":"סגור","resistor.param.R":"התנגדות","resistor.param.P":"הספק נקוב","capacitor.param.C":"קיבול","capacitor.param.Un":"מתח נקוב","indicator-light.param.color":"צבע","inductor.param.L":"השראות","inductor.param.In":"זרם נקוב","voltage-regulator.param.ratio":"טווח ויסות","heater.param.P":"הספק","ups.param.S":"הספק נקוב","power-supply.param.Vdc":"מתח יציאה","genset.param.P":"הספק"},SC={ui:vC,library:kC},je={es:J_,fr:nC,de:iC,pt:lC,ja:uC,ru:hC,fa:bC,ar:wC,he:SC},Zr={zh:{"common.unnamed":"未命名","common.close":"关闭","common.yes":"是","common.no":"否","topbar.theme.toLight":"切换到亮色","topbar.theme.toDark":"切换到暗色","topbar.theme.currentDark":"当前:暗色主题","topbar.theme.currentLight":"当前:亮色主题","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"当前:中文","topbar.export.label":"导出","topbar.export.tooltip":"SVG 矢量(可编辑)、PNG 位图(2× 高清)或 DXF(CAD)","topbar.export.pngFailed":"导出 PNG 失败:{err}","topbar.export.dxfFailed":"导出 DXF 失败:{err}","topbar.file.label":"文件","topbar.file.tooltip":"打开本地 .json 图、保存、或另存为","topbar.file.current":"当前:{name}","topbar.file.new":"新建","topbar.file.open":"打开…","topbar.file.save":"保存","topbar.file.saveAs":"另存为…","topbar.file.newConfirm":"新建会清空当前未保存的内容,是否继续?","topbar.file.openFailed":"打开失败:{err}","topbar.file.saveFailed":"保存失败:{err}","topbar.file.fileDescription":"OneLineEditor 图纸","outline.title":"大纲","outline.collapse":"折叠","outline.collapseAria":"折叠大纲","outline.empty":"(无设备 — 从元件库拖入开始)","props.title":"属性","props.node":"电气节点","props.wire":"连线","props.bus":"母线","props.junction":"接线柱","props.junctionPos":"位置","props.nSelected":"{n} 选中","props.empty":"未选中","props.multi":"已选中 {n} 项","props.name":"名称","props.note":"备注","props.label":"标注","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"电气节点 {id} 不存在","props.wireNotFound":"连线 {id} 不存在","props.nodeStats":"{terminals} 个端子 · {elements} 个元件","props.selectElement":"选中 {label}","props.selectWholeNode":"选中整个电气节点","props.annText":"文字","props.annRect":"矩形","props.annEllipse":"椭圆","props.annLine":"线条","props.annTable":"表格","props.annNotFound":"标注 {id} 不存在","props.annLabel":"标签","props.annLabelPlaceholder":"如:1#配电柜","props.color":"颜色","props.size":"大小","props.sizeReset":"恢复为 100%","props.labelShown":"显示","props.labelHidden":"隐藏","props.color.default":"默认","props.color.red":"红","props.color.amber":"橙","props.color.green":"绿","props.color.blue":"蓝","props.color.gray":"灰","props.annStroke":"线型","props.annStrokeSolid":"实线","props.annStrokeDashed":"虚线","props.annStrokeDotted":"点线","props.annStrokeWidth":"线宽","props.annWidthThin":"细","props.annWidthMedium":"中","props.annWidthThick":"粗","props.annFill":"填充","props.annFillNone":"无","props.annFillTint":"浅色","props.annArrow":"箭头","props.annArrowNone":"无","props.annArrowEnd":"单向","props.annArrowBoth":"双向","props.annFontSize":"字号","props.annRows":"行数","props.annCols":"列数","view.zoomOut":"缩小","view.zoomOutHint":"按预设档位缩小;也可滚轮 ↓ 或 ⌘−","view.reset":"重置到 100%","view.current":"当前 {z}%","view.zoomIn":"放大","view.zoomInHint":"按预设档位放大;也可滚轮 ↑ 或 ⌘+","view.fit":"适配视图","view.fitHint":"自动缩放并居中,显示整张图纸","view.gridHide":"隐藏网格","view.gridShow":"显示网格","view.gridHotkey":"G","view.gridHideHint":"同时关闭对齐吸附(拖动可自由放置)","view.gridShowHint":"同时开启对齐吸附(拖动会贴到 10px 网格)","view.gridHideAria":"隐藏网格并关闭吸附","view.gridShowAria":"显示网格并开启吸附","view.label":"标签","view.labelOff":"关闭","view.labelId":"仅 ID","view.labelAll":"ID + 参数","view.labelHint":"标签显示方式与字号(同样影响导出与打印)","view.labelSize":"字号","view.labelSizeSmaller":"缩小标签字号","view.labelSizeLarger":"放大标签字号","view.standard":"符号标准","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"只改符号画法,接线、位置和参数都不动。目前断路器和熔断器两种画法不同。","view.labelSizeReset":"恢复默认字号","library.title":"元件库","tool.draw":"绘图","tool.drawHint":"文字、方框、圆、线、表格——图纸上的自由标注","library.empty":"没有匹配的元件","library.customTag":"自定义","library.customHint":"本图自带的元件——其他人的元件库里没有它","library.createComponent":"新建元件…","library.searchPlaceholder":"搜索元件…","library.searchAria":"搜索元件","library.clearSearch":"清除搜索","library.itemHint":"单击进入放置模式或拖到画布","tool.select":"选择","tool.selectHint":"点选元件,框选多个,或右键打开菜单","tool.pan":"平移","tool.panHint":"拖动画布;空格键可临时切换","tool.wire":"连线","tool.wireHint":"从端子/母线/接线柱拖出;拖到空白处会自动新建接线柱,拖到已有连线上可打接点","tool.bus":"母线","tool.busHint":"画布上拖动一段母线,按下定起点、释放定终点","tool.junction":"接线柱","tool.junctionHint":"点击画布放置一个接线柱(接点),连线可自由连到它","tool.place":"元件","tool.placeHint":"点击画布放置;或从端子/母线拖出,同时放置并连接","tool.text":"文字","tool.textHint":"点击画布放置一段文字注释;双击文字可重新编辑","tool.rect":"矩形","tool.rectHint":"拖动绘制矩形 / 分组框(默认虚线);按住 Shift 画正方形","tool.ellipse":"椭圆","tool.ellipseHint":"拖动绘制椭圆;按住 Shift 画正圆","tool.line":"线条","tool.lineHint":"拖动绘制标注线;按住 Shift 按 45° 约束;箭头在属性面板设置","tool.table":"表格","tool.tableHint":"拖动扫出行列(实时显示 列×行),或单击放置默认表格;双击单元格填写","mode.selectWithSel":"拖动元件移动 · 拖端子连线 · 右键打开菜单","mode.selectEmpty":"点选元件 · 拖动移动 · 框选多个 · 右键打开菜单","mode.pan":"拖动画布 · 滚轮缩放 · 按住空格可在其他工具下临时平移","mode.wireDragging":"拖到端子/母线/接线柱释放;空白处释放会新建接线柱","mode.wireInit":"从任意连接点或空白处按下,拖到目标释放;空白处会新建接线柱","mode.busDragging":"拖动决定母线方向,释放定终点","mode.busInit":"在画布按下定起点,拖动后释放定终点","mode.junction":"点击画布放置一个接线柱","mode.placeNoKind":"从左侧元件库选择一种元件","mode.placeFromTerm":"拖到目标位置释放,新元件将连接到起点端子","mode.placeNormal":"点击空白放置;或从已有端子 / 母线拖出,同时放置并连接","mode.text":"点击画布放置文字;双击已有文字可编辑;选中后可拖动 / 删除","mode.rect":"拖动绘制矩形;Shift 正方形;释放后可拉伸并在属性面板加标签","mode.ellipse":"拖动绘制椭圆;Shift 正圆;释放后可拉伸、改色并加标签","mode.line":"拖动绘制线条;Shift 按 45° 约束;释放后可在属性面板加箭头","mode.table":"拖动扫出表格行列,或单击放置 3×3 表格;双击单元格填写内容","mode.annTextSel":"单击文字即可编辑 · 拖动移动 · Del 删除","mode.annTableSel":"单击单元格填写内容 · 拖动移动 · Del 删除","mode.annShapeSel":"拖动移动 · 拖动手柄缩放 · 右侧面板改样式 · Del 删除","mode.annEditing":"输入内容 · Enter 确认 · Esc 取消 · 或用 ✓ / ✕ 按钮","mode.escSelect":"Esc 清除选择","mode.escOther":"右键 / Esc 取消","tool.placeNoKindTooltip":"从左侧元件库选择一个元件后点击画布放置","tool.undo":"撤销","tool.undoHint":"撤销上一次编辑(移动 / 旋转 / 删除等)","tool.redo":"重做","tool.redoHint":"重做被撤销的操作","layout.label":"布局","layout.hint":"自动排版整个图或仅选中范围,并填补空缺","layout.allAuto":"重新自动布局","layout.selAuto":"重新自动布局选区","layout.allFill":"填补未排版位置","layout.selFill":"填补未排版选区","tool.more":"更多","tool.moreHint":"撤销 / 重做 / 布局","view.menu":"视图","view.menuHint":"缩放、适配、网格","ctx.ariaNode":"选中节点操作","ctx.ariaWire":"选中连线操作","ctx.ariaElement":"选中元件操作","ctx.ariaEdit":"编辑操作","ctx.done":"完成","ctx.cancel":"取消","ctx.rotate":"旋转 90°","ctx.rotateHint":"顺时针旋转选中元件,连线随端子自动重排","ctx.mirror":"水平镜像","ctx.mirrorTitle":"镜像","ctx.mirrorHint":"左右翻转选中元件","ctx.delete":"删除","ctx.color":"颜色","ctx.colorDefault":"默认","ctx.colorRed":"红色","ctx.colorAmber":"琥珀","ctx.colorGreen":"绿色","ctx.colorBlue":"蓝色","ctx.colorGray":"灰色","ctx.deleteHintNode":"断开此电气节点上的所有连接(保留元件)","ctx.deleteHintWire":"移除这一根连线(其它同节点连线保留)","ctx.deleteHintElement":"移除选中元件及其连接的连线","ctx.resetWirePath":"恢复自动走线","ctx.resetWirePathHint":"清除手动调整的拐点,让连线回到自动路由","menu.undo":"撤销","menu.redo":"重做","menu.cut":"剪切","menu.copy":"复制","menu.paste":"粘贴","menu.rotate":"旋转 90°","menu.mirror":"镜像","menu.resetLabel":"标签位置复位","menu.selectAll":"全选","menu.disconnect":"断开此连线","menu.delete":"删除","io.parseFailed":"JSON 解析失败:{err}","io.notObject":"文件不是 JSON 对象","io.versionMismatch":'版本不兼容:期望 "1",实际 {actual}',"io.elementsMissing":"elements 字段缺失或不是数组","compile.duplicateId":'元件 ID 重复:"{id}"',"compile.unknownKind":'未知元件类型 kind="{kind}"',"compile.invalidTermRef":'非法端子引用 "{ref}"',"compile.elementMissing":'引用了不存在的元件 "{id}"',"compile.missingPin":'元件 "{id}" (kind={kind}) 没有引脚 "{pin}",可用引脚: {available}',"compile.singleTerminal":"节点只包含一个端子,已忽略","compile.layoutMissingElement":'layout 键 "{id}" 引用了不存在的元件',"compile.elementUnconnected":'元件 "{id}" 没有任何连接',"cat.custom":"本图自定义","cat.busbar":"母线 / 接线","cat.switching":"开关","cat.protection":"保护","cat.motor-control":"电机控制","cat.transformer":"变压器","cat.instrument-transformer":"互感器","cat.measurement":"测量仪表","cat.source":"电源","cat.load":"负荷","cat.storage":"储能","cat.compensation":"无功补偿","cat.grounding":"中性点接地","cat.renewable":"新能源 / 电力电子","onboard.title":"上手三步","onboard.step1.title":"放一个器件","onboard.step1.body":"切到 元件 工具(P),从左侧元件库选一种拖到画布","onboard.step2.title":"拉线连接","onboard.step2.body":"用 连线 工具(W)从一个引脚拖到另一个引脚;拖到空白处会自动新建接线柱","onboard.step3.title":"母线是共用排,不是连线","onboard.step3.body":"几条回路共用一排时才用 母线 工具(B)。别拿母线连两个器件——点对点直接拉线(W)就行。","onboard.dismiss":"知道了"},en:{"common.unnamed":"Untitled","common.close":"Close","common.yes":"Yes","common.no":"No","topbar.theme.toLight":"Switch to light","topbar.theme.toDark":"Switch to dark","topbar.theme.currentDark":"Current: dark theme","topbar.theme.currentLight":"Current: light theme","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"Current: Chinese","topbar.export.label":"Export","topbar.export.tooltip":"SVG vector (editable), PNG bitmap (2× HiDPI), or DXF (CAD)","topbar.export.pngFailed":"PNG export failed: {err}","topbar.export.dxfFailed":"DXF export failed: {err}","topbar.file.label":"File","topbar.file.tooltip":"Open a local .json diagram, save, or save as","topbar.file.current":"Current: {name}","topbar.file.new":"New","topbar.file.open":"Open…","topbar.file.save":"Save","topbar.file.saveAs":"Save as…","topbar.file.newConfirm":"New will discard any unsaved changes. Continue?","topbar.file.openFailed":"Open failed: {err}","topbar.file.saveFailed":"Save failed: {err}","topbar.file.fileDescription":"OneLineEditor diagram","outline.title":"Outline","outline.collapse":"Collapse","outline.collapseAria":"Collapse outline","outline.empty":"(No elements — drag from the library to start)","props.title":"Properties","props.node":"Electrical node","props.wire":"Wire","props.bus":"Bus","props.junction":"Junction","props.junctionPos":"Position","props.nSelected":"{n} selected","props.empty":"Nothing selected","props.multi":"{n} objects selected","props.name":"Name","props.note":"Note","props.label":"Label","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Electrical node {id} not found","props.wireNotFound":"Wire {id} not found","props.nodeStats":"{terminals} terminals · {elements} elements","props.selectElement":"Select {label}","props.selectWholeNode":"Select whole electrical node","props.annText":"Text","props.annRect":"Rectangle","props.annEllipse":"Ellipse","props.annLine":"Line","props.annTable":"Table","props.annNotFound":"Annotation {id} not found","props.annLabel":"Label","props.annLabelPlaceholder":"e.g. Panel #1","props.color":"Color","props.size":"Size","props.sizeReset":"Reset to 100%","props.labelShown":"Shown","props.labelHidden":"Hidden","props.color.default":"Default","props.color.red":"Red","props.color.amber":"Amber","props.color.green":"Green","props.color.blue":"Blue","props.color.gray":"Gray","props.annStroke":"Stroke","props.annStrokeSolid":"Solid","props.annStrokeDashed":"Dashed","props.annStrokeDotted":"Dotted","props.annStrokeWidth":"Weight","props.annWidthThin":"Thin","props.annWidthMedium":"Medium","props.annWidthThick":"Thick","props.annFill":"Fill","props.annFillNone":"None","props.annFillTint":"Tint","props.annArrow":"Arrows","props.annArrowNone":"None","props.annArrowEnd":"End","props.annArrowBoth":"Both","props.annFontSize":"Font size","props.annRows":"Rows","props.annCols":"Columns","view.zoomOut":"Zoom out","view.zoomOutHint":"Step zoom out; also wheel ↓ or ⌘−","view.reset":"Reset to 100%","view.current":"Current {z}%","view.zoomIn":"Zoom in","view.zoomInHint":"Step zoom in; also wheel ↑ or ⌘+","view.fit":"Fit view","view.fitHint":"Auto-zoom and center the whole drawing","view.gridHide":"Hide grid","view.gridShow":"Show grid","view.gridHotkey":"G","view.gridHideHint":"Also disables snap-to-grid (free placement)","view.gridShowHint":"Also enables snap-to-grid (snaps to 10px on drag)","view.gridHideAria":"Hide grid and disable snap","view.gridShowAria":"Show grid and enable snap","view.label":"Labels","view.labelOff":"Off","view.labelId":"ID","view.labelAll":"ID + params","view.labelHint":"Label visibility and type size (applies to exports too)","view.labelSize":"Size","view.labelSizeSmaller":"Smaller label type","view.labelSizeLarger":"Larger label type","view.standard":"Symbol standard","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Changes how symbols are drawn only — wiring, positions and ratings are untouched. Circuit breakers and fuses differ between the two.","view.labelSizeReset":"Reset label size","library.title":"Library","tool.draw":"Draw","tool.drawHint":"Text, boxes, circles, lines and tables — free annotation over the drawing","library.empty":"No matching elements","library.customTag":"custom","library.customHint":"Defined by this drawing — it is not in anyone else's library","library.createComponent":"New component…","library.searchPlaceholder":"Search elements…","library.searchAria":"Search elements","library.clearSearch":"Clear search","library.itemHint":"Click to enter place mode, or drag onto the canvas","tool.select":"Select","tool.selectHint":"Click to pick, marquee for multiple, right-click for menu","tool.pan":"Pan","tool.panHint":"Drag the canvas; Space toggles temporarily","tool.wire":"Wire","tool.wireHint":"Drag from a pin/bus/junction; into empty space drops a junction, onto a wire taps it","tool.bus":"Busbar","tool.busHint":"Drag on the canvas — press to set start, release to set end","tool.junction":"Junction","tool.junctionHint":"Click the canvas to drop a junction (node); wires attach to it freely","tool.place":"Place","tool.placeHint":"Click to place; or drag from a terminal/bus to place and connect","tool.text":"Text","tool.textHint":"Click the canvas to drop a text note; double-click an existing one to edit","tool.rect":"Rectangle","tool.rectHint":"Drag to draw a rectangle / group frame (dashed by default); Shift for a square","tool.ellipse":"Ellipse","tool.ellipseHint":"Drag to draw an ellipse; hold Shift for a circle","tool.line":"Line","tool.lineHint":"Drag to draw an annotation line; Shift snaps to 45°; arrows live in the panel","tool.table":"Table","tool.tableHint":"Drag to sweep out cols × rows (live count), or click for a default table; double-click cells to type","mode.selectWithSel":"Drag elements · drag terminals to wire · right-click for menu","mode.selectEmpty":"Click to pick · drag to move · marquee for multiple · right-click for menu","mode.pan":"Drag the canvas · scroll to zoom · hold Space to pan in any tool","mode.wireDragging":"Release on a pin/bus/junction; release in empty space drops a junction","mode.wireInit":"Press on any connection point or empty space, drag to a target and release","mode.busDragging":"Drag sets bus direction; release sets the end","mode.busInit":"Press on the canvas to set start, drag, release to set end","mode.junction":"Click the canvas to drop a junction","mode.placeNoKind":"Pick an element kind from the library on the left","mode.placeFromTerm":"Release at the target — the new element will connect back to the source terminal","mode.placeNormal":"Click empty space to place; or drag from a terminal / bus to place and connect","mode.text":"Click to drop text · double-click to edit · drag selected to move · Del to remove","mode.rect":"Drag to draw a rectangle · Shift for square · resize and label it after release","mode.ellipse":"Drag to draw an ellipse · Shift for a circle · resize, recolor and label it after release","mode.line":"Drag to draw a line · Shift snaps to 45° · add arrows in the panel after release","mode.table":"Drag to sweep out the grid, or click for a 3×3 table · double-click cells to type","mode.annTextSel":"Click the text to edit · drag to move · Del to remove","mode.annTableSel":"Click a cell to fill it in · drag to move · Del to remove","mode.annShapeSel":"Drag to move · drag handles to resize · restyle in the panel · Del to remove","mode.annEditing":"Type · Enter to confirm · Esc to cancel · or the ✓ / ✕ buttons","mode.escSelect":"Esc clears selection","mode.escOther":"Right-click / Esc to cancel","tool.placeNoKindTooltip":"Pick a kind in the library on the left, then click the canvas","tool.undo":"Undo","tool.undoHint":"Undo the last edit (move / rotate / delete, etc.)","tool.redo":"Redo","tool.redoHint":"Redo the last undone edit","layout.label":"Layout","layout.hint":"Auto-layout the whole diagram or just the selection, fill gaps","layout.allAuto":"Auto-layout all","layout.selAuto":"Auto-layout selection","layout.allFill":"Fill unplaced","layout.selFill":"Fill unplaced in selection","tool.more":"More","tool.moreHint":"Undo / redo / layout","view.menu":"View","view.menuHint":"Zoom, fit, grid","ctx.ariaNode":"Node actions","ctx.ariaWire":"Wire actions","ctx.ariaElement":"Element actions","ctx.ariaEdit":"Editing actions","ctx.done":"Done","ctx.cancel":"Cancel","ctx.rotate":"Rotate 90°","ctx.rotateHint":"Rotate selection clockwise; wires re-route through new terminals","ctx.mirror":"Mirror horizontally","ctx.mirrorTitle":"Mirror","ctx.mirrorHint":"Flip selection left-right","ctx.delete":"Delete","ctx.color":"Colour","ctx.colorDefault":"Default","ctx.colorRed":"Red","ctx.colorAmber":"Amber","ctx.colorGreen":"Green","ctx.colorBlue":"Blue","ctx.colorGray":"Gray","ctx.deleteHintNode":"Disconnect every wire on this node (elements stay)","ctx.deleteHintWire":"Remove only this wire (siblings on the same node stay)","ctx.deleteHintElement":"Remove the selection and its wires","ctx.resetWirePath":"Reset to auto-route","ctx.resetWirePathHint":"Drop manual corners and let the router re-draw this wire","menu.undo":"Undo","menu.redo":"Redo","menu.cut":"Cut","menu.copy":"Copy","menu.paste":"Paste","menu.rotate":"Rotate 90°","menu.mirror":"Mirror","menu.resetLabel":"Reset label position","menu.selectAll":"Select all","menu.disconnect":"Disconnect this wire","menu.delete":"Delete","io.parseFailed":"JSON parse failed: {err}","io.notObject":"File is not a JSON object","io.versionMismatch":'Version mismatch: expected "1", got {actual}',"io.elementsMissing":"`elements` is missing or not an array","compile.duplicateId":'Duplicate element id: "{id}"',"compile.unknownKind":'Unknown element kind="{kind}"',"compile.invalidTermRef":'Invalid terminal reference "{ref}"',"compile.elementMissing":'Reference to unknown element "{id}"',"compile.missingPin":'Element "{id}" (kind={kind}) has no pin "{pin}"; available: {available}',"compile.singleTerminal":"Node has only one terminal — ignored","compile.layoutMissingElement":'layout key "{id}" references an unknown element',"compile.elementUnconnected":'Element "{id}" has no connections',"cat.custom":"In this drawing","cat.busbar":"Busbar / wiring","cat.switching":"Switching","cat.protection":"Protection","cat.motor-control":"Motor control","cat.transformer":"Transformer","cat.instrument-transformer":"Instrument transformer","cat.measurement":"Measurement","cat.source":"Source","cat.load":"Load","cat.storage":"Storage","cat.compensation":"Compensation","cat.grounding":"Grounding","cat.renewable":"Renewables / power electronics","onboard.title":"Quick start","onboard.step1.title":"Place a component","onboard.step1.body":"Pick the Place tool (P) and drag a kind from the library onto the canvas","onboard.step2.title":"Wire it up","onboard.step2.body":"Use the Wire tool (W): drag from one pin to another — drag into empty space to drop a junction","onboard.step3.title":"A busbar is a shared rail, not a wire","onboard.step3.body":"Use the Busbar tool (B) only when several circuits share one rail. Don't use a bus to join two devices — just wire the pins (W).","onboard.dismiss":"Got it"}},Lo={zh:Zr.zh,en:Zr.en,es:je.es.ui,fr:je.fr.ui,de:je.de.ui,pt:je.pt.ui,ja:je.ja.ui,ru:je.ru.ui,fa:je.fa.ui,ar:je.ar.ui,he:je.he.ui},Xs="ole-locale",_C=Object.keys(Lo);function Qr(e){return _C.includes(e)}function CC(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(Xs);if(e&&Qr(e))return e}catch{}if(typeof navigator<"u"&&typeof navigator.language=="string"){const e=navigator.language.toLowerCase();if(e.startsWith("zh"))return"zh";const t=e.slice(0,2);if(Qr(t))return t}return"en"}function Jr(e){try{window.localStorage.setItem(Xs,e)}catch{}}const pn=mn((e,t)=>({locale:CC(),setLocale:n=>{Jr(n),e({locale:n})},toggle:()=>{const n=t().locale==="zh"?"en":"zh";Jr(n),e({locale:n})}}));function Us(e,t){return t?e.replace(/\{(\w+)\}/g,(n,o)=>t[o]!==void 0?String(t[o]):`{${o}}`):e}function Ys(e,t){return Lo[e][t]??Lo.en[t]??t}function Ae(e,t){return Us(Ys(pn.getState().locale,e),t)}function re(){const e=pn(t=>t.locale);return(t,n)=>Us(Ys(e,t),n)}function Zs(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const s=a=>a===null?null:JSON.parse(a,void 0),l=(i=n.getItem(r))!=null?i:null;return l instanceof Promise?l.then(s):s(l)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const Bo=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return Bo(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return Bo(o)(n)}}}},jC=(e,t)=>(n,o,r)=>{let i={storage:Zs(()=>window.localStorage),partialize:b=>b,version:0,merge:(b,y)=>({...y,...b}),...t},s=!1,l=0;const a=new Set,d=new Set;let u=i.storage;if(!u)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...b)},o,r);const m=()=>{const b=i.partialize({...o()});return u.setItem(i.name,{state:b,version:i.version})},p=r.setState;r.setState=(b,y)=>(p(b,y),m());const h=e((...b)=>(n(...b),m()),o,r);r.getInitialState=()=>h;let g;const f=()=>{var b,y;if(!u)return;const v=++l;s=!1,a.forEach(S=>{var N;return S((N=o())!=null?N:h)});const j=((y=i.onRehydrateStorage)==null?void 0:y.call(i,(b=o())!=null?b:h))||void 0;return Bo(u.getItem.bind(u))(i.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==i.version){if(i.migrate){const N=i.migrate(S.state,S.version);return N instanceof Promise?N.then(W=>[!0,W]):[!0,N]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var N;if(v!==l)return;const[W,ne]=S;if(g=i.merge(ne,(N=o())!=null?N:h),n(g,!0),W)return m()}).then(()=>{v===l&&(j==null||j(o(),void 0),g=o(),s=!0,d.forEach(S=>S(g)))}).catch(S=>{v===l&&(j==null||j(void 0,S))})};return r.persist={setOptions:b=>{i={...i,...b},b.storage&&(u=b.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(d.add(b),()=>{d.delete(b)})},i.skipHydration||f(),g||h},AC=jC,Je=.5;function Qs(e){if(e.length<2)return e.map(r=>[r[0],r[1]]);const t=[[e[0][0],e[0][1]]];for(let r=1;r<e.length;r++){const i=t[t.length-1];Math.abs(i[0]-e[r][0])<Je&&Math.abs(i[1]-e[r][1])<Je||t.push([e[r][0],e[r][1]])}if(t.length<2)return t;const n=[t[0]];for(let r=1;r<t.length;r++){const i=n[n.length-1],s=t[r],l=Math.abs(i[0]-s[0]),a=Math.abs(i[1]-s[1]);if(l>Je&&a>Je){const u=(n.length>=2?Math.abs(n[n.length-2][1]-i[1])<Je?"h":"v":null)==="h"?[s[0],i[1]]:[i[0],s[1]];n.push(u)}n.push(s)}const o=[n[0]];for(let r=1;r<n.length-1;r++){const i=o[o.length-1],s=n[r],l=n[r+1],a=Math.abs(i[0]-s[0])<Je&&Math.abs(s[0]-l[0])<Je,d=Math.abs(i[1]-s[1])<Je&&Math.abs(s[1]-l[1])<Je;a||d||o.push(s)}return o.push(n[n.length-1]),o}const ur=.25,mr=4;function Ho(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?1:Math.min(mr,Math.max(ur,e))}function Xe(e){return e.type??"text"}function $C(e){return e.type===void 0||e.type==="text"}const Js="ammeter",ea="电流表 (A)",ta="measurement",na="-22 -42 44 44",oa=44,ra=44,ia='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-15" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">A</text>',sa=[{id:"t_top",x:0,y:-40,orientation:"n"}],aa={kind:"inline"},EC={id:Js,name:ea,category:ta,viewBox:na,width:oa,height:ra,svg:ia,terminals:sa,source:aa},NC=Object.freeze(Object.defineProperty({__proto__:null,category:ta,default:EC,height:ra,id:Js,name:ea,source:aa,svg:ia,terminals:sa,viewBox:na,width:oa},Symbol.toStringTag,{value:"Module"})),la="arc-suppression-coil",ca="消弧线圈",da="grounding",ua="中性点谐振接地:电感线圈连接到地",ma="-12 -32 24 67",pa=24,ha=67,fa='<line x1="0" y1="-30" x2="0" y2="-12" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -12 A 4 4 0 0 1 0 -4 A 4 4 0 0 1 0 4 A 4 4 0 0 1 0 12" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="20" x2="10" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="24" x2="7" y2="24" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="28" x2="4" y2="28" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="32" x2="1.5" y2="32" fill="none" stroke="black" stroke-width="1"/>',ga=[{id:"t_top",x:0,y:-30,orientation:"n"}],ba={kind:"inline"},TC={id:la,name:ca,category:da,description:ua,viewBox:ma,width:pa,height:ha,svg:fa,terminals:ga,source:ba},IC=Object.freeze(Object.defineProperty({__proto__:null,category:da,default:TC,description:ua,height:ha,id:la,name:ca,source:ba,svg:fa,terminals:ga,viewBox:ma,width:pa},Symbol.toStringTag,{value:"Module"})),ya="arrester",xa="避雷器 (FBL)",wa="protection",va="-7 -22 14 44",ka=14,Sa=44,_a='<line x1="0" y1="-20" x2="0" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><polygon points="-2,-8 2,-8 0,-2" fill="black" stroke="black" stroke-width="1"/><rect x="-5" y="-10" width="10" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Ca=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],ja={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_22/en_60617_07_22_03.elmt",qetEnglishName:"Surge diverter; Lightning arrester"},PC={id:ya,name:xa,category:wa,viewBox:va,width:ka,height:Sa,svg:_a,terminals:Ca,source:ja},zC=Object.freeze(Object.defineProperty({__proto__:null,category:wa,default:PC,height:Sa,id:ya,name:xa,source:ja,svg:_a,terminals:Ca,viewBox:va,width:ka},Symbol.toStringTag,{value:"Module"})),Aa="async-motor",$a="异步电动机",Ea="load",Na="-62 -82 64 84",Ta=64,Ia=84,Pa='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">3</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-60" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-80" x2="-10" y2="-53" fill="none" stroke="black" stroke-width="1"/>',za=[{id:"t1",x:-50,y:-80,orientation:"n"},{id:"t2",x:-10,y:-80,orientation:"n"},{id:"t3",x:-30,y:-80,orientation:"n"}],Ma={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_08/en_60617_06_08_01.elmt",qetEnglishName:"Induction motor, three-phase, squirrel cage"},MC={id:Aa,name:$a,category:Ea,viewBox:Na,width:Ta,height:Ia,svg:Pa,terminals:za,source:Ma},DC=Object.freeze(Object.defineProperty({__proto__:null,category:Ea,default:MC,height:Ia,id:Aa,name:$a,source:Ma,svg:Pa,terminals:za,viewBox:Na,width:Ta},Symbol.toStringTag,{value:"Module"})),Da="autotransformer",Ra="自耦变压器",Oa="transformer",La="-62 -112 64 144",Ba=64,Ha=144,Fa='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-110" x2="-30" y2="-90" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -30 A 30 60 0 0 0 -30 -90" fill="none" stroke="black" stroke-width="1"/>',Wa=[{id:"t1",x:-30,y:-110,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],qa={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_06.elmt",qetEnglishName:"Auto-transformer, general symbol"},RC={id:Da,name:Ra,category:Oa,viewBox:La,width:Ba,height:Ha,svg:Fa,terminals:Wa,source:qa},OC=Object.freeze(Object.defineProperty({__proto__:null,category:Oa,default:RC,height:Ha,id:Da,name:Ra,source:qa,svg:Fa,terminals:Wa,viewBox:La,width:Ba},Symbol.toStringTag,{value:"Module"})),Ga="battery",Va="电池储能",Ka="storage",Xa="-12 -12 29 24",Ua=29,Ya=24,Za='<line x1="-10" y1="0" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-5" x2="0" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-10" x2="5" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="0" x2="15" y2="0" fill="none" stroke="black" stroke-width="1"/>',Qa=[{id:"t_left",x:-10,y:0,orientation:"w"},{id:"t_right",x:15,y:0,orientation:"e"}],Ja=[{name:"E",label:"容量",type:"number",unit:"kWh"}],el={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_15/en_60617_06_15_01.elmt",qetEnglishName:"Battery cell"},LC={id:Ga,name:Va,category:Ka,viewBox:Xa,width:Ua,height:Ya,svg:Za,terminals:Qa,params:Ja,source:el},BC=Object.freeze(Object.defineProperty({__proto__:null,category:Ka,default:LC,height:Ya,id:Ga,name:Va,params:Ja,source:el,svg:Za,terminals:Qa,viewBox:Xa,width:Ua},Symbol.toStringTag,{value:"Module"})),tl="bell",nl="电铃 (HA)",ol="control",rl="信号电铃 / 警铃。",il="-32 -32 44 44",sl=44,al=44,ll='<line x1="-30" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -10 A 20 20 0 0 0 -30 -10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/>',cl=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],dl={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_06.elmt",qetEnglishName:"Bell"},HC={id:tl,name:nl,category:ol,description:rl,viewBox:il,width:sl,height:al,svg:ll,terminals:cl,source:dl},FC=Object.freeze(Object.defineProperty({__proto__:null,category:ol,default:HC,description:rl,height:al,id:tl,name:nl,source:dl,svg:ll,terminals:cl,viewBox:il,width:sl},Symbol.toStringTag,{value:"Module"})),ul="break-contact",ml="常闭触点 (NC)",pl="control",hl="常闭辅助触点 (break contact)。",fl="-2 -42 14 64",gl=14,bl=64,yl='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/>',xl=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],wl=[{name:"open",type:"boolean",default:!1,label:"断开"}],vl={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_02/en_60617_07_02_03.elmt",qetEnglishName:"Break contact"},WC={id:ul,name:ml,category:pl,description:hl,viewBox:fl,width:gl,height:bl,svg:yl,terminals:xl,state:wl,source:vl},qC=Object.freeze(Object.defineProperty({__proto__:null,category:pl,default:WC,description:hl,height:bl,id:ul,name:ml,source:vl,state:wl,svg:yl,terminals:xl,viewBox:fl,width:gl},Symbol.toStringTag,{value:"Module"})),kl="breaker",Sl="断路器 (QF)",_l="switching",Cl="-7 -22 15 46",jl=15,Al=46,$l='<polyline points="0,20 0,10 -5,-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-8" x2="-2" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/>',El='<text x="2" y="-10.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">1</text><text x="3" y="21.2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">2</text>',Nl=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Tl=[{name:"open",type:"boolean",default:!1,label:"断开"}],Il=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"poles",label:"极数",type:"number",unit:"P",showOnCanvas:!0},{name:"Icu",label:"分断能力",type:"number",unit:"kA",showOnCanvas:!0}],Pl={x:6,y:-2,anchor:"start"},zl={ansi:{viewBox:"-11 -22 22 44",width:22,height:44,svg:'<line x1="0" y1="-20" x2="0" y2="-9" fill="none" stroke="black" stroke-width="1"/><rect x="-9" y="-9" width="18" height="18" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="9" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/>',label:{x:12,y:-2,anchor:"start"},source:{standard:"IEEE Std 315-1975 (ANSI Y32.2-1975)",clause:"9.4.4",title:"Circuit breaker, other than covered by symbol 9.4.1"}}},Ml={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/11_circuit_breakers/disjoncteur1.elmt",qetEnglishName:"Circuit-breaker"},GC={id:kl,name:Sl,category:_l,viewBox:Cl,width:jl,height:Al,svg:$l,terminalLabelsSvg:El,terminals:Nl,state:Tl,params:Il,label:Pl,variants:zl,source:Ml},VC=Object.freeze(Object.defineProperty({__proto__:null,category:_l,default:GC,height:Al,id:kl,label:Pl,name:Sl,params:Il,source:Ml,state:Tl,svg:$l,terminalLabelsSvg:El,terminals:Nl,variants:zl,viewBox:Cl,width:jl},Symbol.toStringTag,{value:"Module"})),Dl="buchholz-relay",Rl="瓦斯继电器 (63)",Ol="protection",Ll="瓦斯 / 气体继电器 (Buchholz, ANSI 63)。",Bl="-22 -62 44 64",Hl=44,Fl=64,Wl='<rect x="-20" y="-60" width="40" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-5" y="-20" width="10" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-55" x2="0" y2="-50" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -50 A 10 5 0 0 0 0 -40" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -40 A 10 5 0 0 0 0 -50" fill="none" stroke="black" stroke-width="1"/>',ql=[{id:"t_top",x:0,y:-60,orientation:"n"}],Gl={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_18/en_60617_07_18_01.elmt",qetEnglishName:"Buchholz protective device; Gas relay"},KC={id:Dl,name:Rl,category:Ol,description:Ll,viewBox:Bl,width:Hl,height:Fl,svg:Wl,terminals:ql,source:Gl},XC=Object.freeze(Object.defineProperty({__proto__:null,category:Ol,default:KC,description:Ll,height:Fl,id:Dl,name:Rl,source:Gl,svg:Wl,terminals:ql,viewBox:Bl,width:Hl},Symbol.toStringTag,{value:"Module"})),Vl="busbar",Kl="母线段",Xl="busbar",Ul="可拉伸单母线段,多设备挂接",Yl="-42 -4 84 8",Zl=84,Ql=8,Jl='<line x1="-40" y1="0" x2="40" y2="0" stroke="black" stroke-width="3" stroke-linecap="round" fill="none"/>',ec=[{id:"tap",x:0,y:0,orientation:"n"}],tc={axis:"x",minLength:20,naturalSpan:80},nc=[{name:"Un",label:"额定电压",type:"number",unit:"kV",showOnCanvas:!0}],oc={x:0,y:-6,anchor:"middle"},rc={kind:"inline"},UC={id:Vl,name:Kl,category:Xl,description:Ul,viewBox:Yl,width:Zl,height:Ql,svg:Jl,terminals:ec,stretchable:tc,params:nc,label:oc,source:rc},YC=Object.freeze(Object.defineProperty({__proto__:null,category:Xl,default:UC,description:Ul,height:Ql,id:Vl,label:oc,name:Kl,params:nc,source:rc,stretchable:tc,svg:Jl,terminals:ec,viewBox:Yl,width:Zl},Symbol.toStringTag,{value:"Module"})),ic="busduct-tap",sc="母线槽插接段",ac="busbar",lc="带固定插接口的母线槽段,插接口向下引出",cc="-42 -12 84 34",dc=84,uc=34,mc='<line x1="40" y1="0" x2="-40" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-5" x2="-40" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="40" y1="-5" x2="40" y2="5" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="0" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/>',pc=[{id:"t_left",x:-40,y:0,orientation:"w"},{id:"t_right",x:40,y:0,orientation:"e"},{id:"t_tap",x:0,y:20,orientation:"s"}],hc=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"Itap",label:"插接口电流",type:"number",unit:"A",showOnCanvas:!0}],fc={x:0,y:-8,anchor:"middle"},gc={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_17/en_60617_11_17_24.elmt",qetEnglishName:"Straight section with fixed tap-off"},ZC={id:ic,name:sc,category:ac,description:lc,viewBox:cc,width:dc,height:uc,svg:mc,terminals:pc,params:hc,label:fc,source:gc},QC=Object.freeze(Object.defineProperty({__proto__:null,category:ac,default:ZC,description:lc,height:uc,id:ic,label:fc,name:sc,params:hc,source:gc,svg:mc,terminals:pc,viewBox:cc,width:dc},Symbol.toStringTag,{value:"Module"})),bc="busduct",yc="母线槽",xc="busbar",wc="封闭式母线槽直线段(IEC 60617-11-17)",vc="-22 -7 44 14",kc=44,Sc=14,_c='<line x1="20" y1="0" x2="-20" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-5" x2="-20" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-5" x2="20" y2="5" fill="none" stroke="black" stroke-width="1"/>',Cc=[{id:"t_left",x:-20,y:0,orientation:"w"},{id:"t_right",x:20,y:0,orientation:"e"}],jc=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"Un",label:"额定电压",type:"number",unit:"V",showOnCanvas:!0}],Ac={x:0,y:-8,anchor:"middle"},$c={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_17/en_60617_11_17_01.elmt",qetEnglishName:"Straight section, general symbol"},JC={id:bc,name:yc,category:xc,description:wc,viewBox:vc,width:kc,height:Sc,svg:_c,terminals:Cc,params:jc,label:Ac,source:$c},ej=Object.freeze(Object.defineProperty({__proto__:null,category:xc,default:JC,description:wc,height:Sc,id:bc,label:Ac,name:yc,params:jc,source:$c,svg:_c,terminals:Cc,viewBox:vc,width:kc},Symbol.toStringTag,{value:"Module"})),Ec="buzzer",Nc="蜂鸣器 (HA)",Tc="control",Ic="信号蜂鸣器。",Pc="-32 -52 44 64",zc=44,Mc=64,Dc='<line x1="-30" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><path d="M -30 -30 A 20 20 0 0 0 10 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-12" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-12" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/>',Rc=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],Oc={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_10.elmt",qetEnglishName:"Buzzer"},tj={id:Ec,name:Nc,category:Tc,description:Ic,viewBox:Pc,width:zc,height:Mc,svg:Dc,terminals:Rc,source:Oc},nj=Object.freeze(Object.defineProperty({__proto__:null,category:Tc,default:tj,description:Ic,height:Mc,id:Ec,name:Nc,source:Oc,svg:Dc,terminals:Rc,viewBox:Pc,width:zc},Symbol.toStringTag,{value:"Module"})),Lc="capacitor",Bc="电容 (C)",Hc="passive",Fc="通用 / 滤波 / 直流母线电容。无功补偿请用并联电容器。",Wc="-7 -23 14 27",qc=14,Gc=27,Vc='<line x1="-5" y1="2" x2="5" y2="2" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-2" x2="5" y2="-2" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-2" fill="none" stroke="black" stroke-width="1"/>',Kc=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t_bottom",x:0,y:2,orientation:"s"}],Xc=[{name:"C",label:"容值",type:"number",unit:"μF",showOnCanvas:!0},{name:"Un",label:"额定电压",type:"number",unit:"V"}],Uc={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/20_capacitors/capacite.elmt",qetEnglishName:"Capacitor"},oj={id:Lc,name:Bc,category:Hc,description:Fc,viewBox:Wc,width:qc,height:Gc,svg:Vc,terminals:Kc,params:Xc,source:Uc},rj=Object.freeze(Object.defineProperty({__proto__:null,category:Hc,default:oj,description:Fc,height:Gc,id:Lc,name:Bc,params:Xc,source:Uc,svg:Vc,terminals:Kc,viewBox:Wc,width:qc},Symbol.toStringTag,{value:"Module"})),Yc="contactor",Zc="接触器 (KM)",Qc="motor-control",Jc="主回路接触器, 通常配热继电器和电机使用。",ed="-10 -42 15 64",td=15,nd=64,od='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -24.5 A 2.5 2.5 0 0 0 0 -19.5" fill="none" stroke="black" stroke-width="1"/>',rd=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],id=[{name:"open",type:"boolean",default:!0,label:"断开"}],sd={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_02.elmt",qetEnglishName:"Contactor; Main make contact of a contactor"},ij={id:Yc,name:Zc,category:Qc,description:Jc,viewBox:ed,width:td,height:nd,svg:od,terminals:rd,state:id,source:sd},sj=Object.freeze(Object.defineProperty({__proto__:null,category:Qc,default:ij,description:Jc,height:nd,id:Yc,name:Zc,source:sd,state:id,svg:od,terminals:rd,viewBox:ed,width:td},Symbol.toStringTag,{value:"Module"})),ad="converter-bidir",ld="双向变流器 (PCS)",cd="renewable",dd="储能变流器:双向 AC ↔ DC",ud="-42 -42 44 48",md=44,pd=48,hd='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-6" x2="-14" y2="-6" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-6" x2="-4" y2="-6" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/><polyline points="-28,-4 -32,0 -28,4" fill="none" stroke="black" stroke-width="1"/><polyline points="-16,-4 -12,0 -16,4" fill="none" stroke="black" stroke-width="1"/>',fd=[{id:"t_ac",x:-20,y:-40,orientation:"n"},{id:"t_dc",x:-20,y:0,orientation:"s"}],gd=[{name:"S",label:"容量",type:"number",unit:"MVA"}],bd={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_06.elmt",qetEnglishName:"Rectifier/inverter"},aj={id:ad,name:ld,category:cd,description:dd,viewBox:ud,width:md,height:pd,svg:hd,terminals:fd,params:gd,source:bd},lj=Object.freeze(Object.defineProperty({__proto__:null,category:cd,default:aj,description:dd,height:pd,id:ad,name:ld,params:gd,source:bd,svg:hd,terminals:fd,viewBox:ud,width:md},Symbol.toStringTag,{value:"Module"})),yd="ct",xd="电流互感器 (CT)",wd="instrument-transformer",vd="-42 -62 54 64",kd=54,Sd=64,_d='<line x1="-30" y1="-60" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-30" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-20" x2="5" y2="-40" fill="none" stroke="black" stroke-width="1"/>',Cd=[{id:"t1",x:-30,y:-60,orientation:"n"},{id:"t2",x:-30,y:0,orientation:"s"}],jd={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_10.elmt",qetEnglishName:"Current transformer, general symbol"},cj={id:yd,name:xd,category:wd,viewBox:vd,width:kd,height:Sd,svg:_d,terminals:Cd,source:jd},dj=Object.freeze(Object.defineProperty({__proto__:null,category:wd,default:cj,height:Sd,id:yd,name:xd,source:jd,svg:_d,terminals:Cd,viewBox:vd,width:kd},Symbol.toStringTag,{value:"Module"})),Ad="dc-combiner",$d="直流汇流箱",Ed="renewable",Nd="光伏组串汇流箱 (4 路输入示例)。",Td="-27 -32 54 64",Id=54,Pd=64,zd='<rect x="-25" y="-15" width="50" height="30" fill="none" stroke="black" stroke-width="1"/><line x1="-18" y1="-30" x2="-18" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="-6" y1="-30" x2="-6" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-30" x2="6" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="18" y1="-30" x2="18" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><text x="-9" y="5" font-family="Liberation Sans, Arial, sans-serif" font-size="7" fill="#000000">DC</text>',Md=[{id:"t_s1",x:-18,y:-30,orientation:"n"},{id:"t_s2",x:-6,y:-30,orientation:"n"},{id:"t_s3",x:6,y:-30,orientation:"n"},{id:"t_s4",x:18,y:-30,orientation:"n"},{id:"t_dc",x:0,y:30,orientation:"s"}],Dd={kind:"inline"},uj={id:Ad,name:$d,category:Ed,description:Nd,viewBox:Td,width:Id,height:Pd,svg:zd,terminals:Md,source:Dd},mj=Object.freeze(Object.defineProperty({__proto__:null,category:Ed,default:uj,description:Nd,height:Pd,id:Ad,name:$d,source:Dd,svg:zd,terminals:Md,viewBox:Td,width:Id},Symbol.toStringTag,{value:"Module"})),Rd="dc-dc-converter",Od="DC/DC 变换器",Ld="renewable",Bd="DC/DC 变换器 / 直流充电器(IEC 60617)",Hd="-42 -42 44 44",Fd=44,Wd=44,qd='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/>',Gd=[{id:"t_in",x:-20,y:-40,orientation:"n"},{id:"t_out",x:-20,y:0,orientation:"s"}],Vd=[{name:"P",label:"功率",type:"number",unit:"kW"}],Kd={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_02.elmt",qetEnglishName:"DC/DC converter"},pj={id:Rd,name:Od,category:Ld,description:Bd,viewBox:Hd,width:Fd,height:Wd,svg:qd,terminals:Gd,params:Vd,source:Kd},hj=Object.freeze(Object.defineProperty({__proto__:null,category:Ld,default:pj,description:Bd,height:Wd,id:Rd,name:Od,params:Vd,source:Kd,svg:qd,terminals:Gd,viewBox:Hd,width:Fd},Symbol.toStringTag,{value:"Module"})),Xd="dc-disconnector",Ud="直流隔离开关",Yd="switching",Zd="DC isolating switch — 光伏组串 / 储能 直流侧隔离。",Qd="-12 -32 30 64",Jd=30,eu=64,tu='<line x1="0" y1="-30" x2="0" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-4" x2="14" y2="-4" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-1" x2="9" y2="-1" stroke="black" stroke-width="0.8" fill="none"/><line x1="11" y1="-1" x2="14" y2="-1" stroke="black" stroke-width="0.8" fill="none"/>',nu=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],ou=[{name:"open",type:"boolean",default:!1,label:"断开"}],ru={kind:"inline"},fj={id:Xd,name:Ud,category:Yd,description:Zd,viewBox:Qd,width:Jd,height:eu,svg:tu,terminals:nu,state:ou,source:ru},gj=Object.freeze(Object.defineProperty({__proto__:null,category:Yd,default:fj,description:Zd,height:eu,id:Xd,name:Ud,source:ru,state:ou,svg:tu,terminals:nu,viewBox:Qd,width:Jd},Symbol.toStringTag,{value:"Module"})),iu="dc-motor",su="直流电机 (M)",au="load",lu="直流电动机 (串励通用符号)。",cu="-72 -82 89 84",du=89,uu=84,mu='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-40" y1="-20" x2="-20" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-15" x2="-32" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-29" y1="-15" x2="-20" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-70" y1="-80" x2="-70" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-70" y1="-30" x2="-60" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="10" y1="-30" x2="10" y2="-50" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -60 A 5 5 0 0 0 10 -50" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -70 A 5 5 0 0 0 10 -60" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -80 A 5 5 0 0 0 10 -70" fill="none" stroke="black" stroke-width="1"/>',pu=[{id:"t1",x:-70,y:-80,orientation:"n"},{id:"t2",x:10,y:-80,orientation:"n"}],hu={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_05/en_60617_06_05_01.elmt",qetEnglishName:"Series motor, DC"},bj={id:iu,name:su,category:au,description:lu,viewBox:cu,width:du,height:uu,svg:mu,terminals:pu,source:hu},yj=Object.freeze(Object.defineProperty({__proto__:null,category:au,default:bj,description:lu,height:uu,id:iu,name:su,source:hu,svg:mu,terminals:pu,viewBox:cu,width:du},Symbol.toStringTag,{value:"Module"})),fu="diode",gu="二极管 (D)",bu="passive",yu="整流 / 续流 / 保护二极管。t1=阳极(上), t2=阴极(下)。",xu="-12 -42 24 44",wu=24,vu=44,ku='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/>',Su=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],_u={x:6,y:-20,anchor:"start"},Cu={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_01.elmt",qetEnglishName:"Semiconductor diode, general symbol"},xj={id:fu,name:gu,category:bu,description:yu,viewBox:xu,width:wu,height:vu,svg:ku,terminals:Su,label:_u,source:Cu},wj=Object.freeze(Object.defineProperty({__proto__:null,category:bu,default:xj,description:yu,height:vu,id:fu,label:_u,name:gu,source:Cu,svg:ku,terminals:Su,viewBox:xu,width:wu},Symbol.toStringTag,{value:"Module"})),ju="disconnector",Au="隔离开关 (QS)",$u="switching",Eu="-10 -42 15 64",Nu=15,Tu=64,Iu='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-3" y1="-20" x2="3" y2="-20" fill="none" stroke="black" stroke-width="1"/>',Pu=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],zu=[{name:"open",type:"boolean",default:!1,label:"断开"}],Mu=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],Du={x:6,y:-10,anchor:"start"},Ru={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_06.elmt",qetEnglishName:"Disconnector; Isolator"},vj={id:ju,name:Au,category:$u,viewBox:Eu,width:Nu,height:Tu,svg:Iu,terminals:Pu,state:zu,params:Mu,label:Du,source:Ru},kj=Object.freeze(Object.defineProperty({__proto__:null,category:$u,default:vj,height:Tu,id:ju,label:Du,name:Au,params:Mu,source:Ru,state:zu,svg:Iu,terminals:Pu,viewBox:Eu,width:Nu},Symbol.toStringTag,{value:"Module"})),Ou="distance-relay",Lu="距离继电器 (21)",Bu="protection",Hu="距离 / 低阻抗保护继电器 (ANSI 21)。",Fu="-62 -42 64 44",Wu=64,qu=44,Gu='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-42" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Z &lt;</text>',Vu=[{id:"t_top",x:-30,y:-40,orientation:"n"}],Ku={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_09.elmt",qetEnglishName:"Under-impedance relay"},Sj={id:Ou,name:Lu,category:Bu,description:Hu,viewBox:Fu,width:Wu,height:qu,svg:Gu,terminals:Vu,source:Ku},_j=Object.freeze(Object.defineProperty({__proto__:null,category:Bu,default:Sj,description:Hu,height:qu,id:Ou,name:Lu,source:Ku,svg:Gu,terminals:Vu,viewBox:Fu,width:Wu},Symbol.toStringTag,{value:"Module"})),Xu="earth",Uu="接地",Yu="busbar",Zu="-12 -17 24 34",Qu=24,Ju=34,em='<line x1="-10" y1="0" x2="10" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-15" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="5" x2="7" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="10" x2="4" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0.5" y1="15" x2="-0.5" y2="15" fill="none" stroke="black" stroke-width="1"/>',tm=[{id:"t1",x:0,y:-15,orientation:"n"}],nm={kind:"elmt",path:"91_en_60617/en_60617_02/en_60617_02_15/en_60617_02_15_01.elmt",qetEnglishName:"Earth or ground, general symbol"},Cj={id:Xu,name:Uu,category:Yu,viewBox:Zu,width:Qu,height:Ju,svg:em,terminals:tm,source:nm},jj=Object.freeze(Object.defineProperty({__proto__:null,category:Yu,default:Cj,height:Ju,id:Xu,name:Uu,source:nm,svg:em,terminals:tm,viewBox:Zu,width:Qu},Symbol.toStringTag,{value:"Module"})),om="earthing-switch",rm="接地刀闸 (QE)",im="switching",sm="隔离开关 + 接地连接,单端口",am="-12 -32 24 64",lm=24,cm=64,dm='<line x1="0" y1="-30" x2="0" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="-12" x2="-9" y2="9" stroke="black" stroke-width="1" fill="none"/><line x1="-3" y1="-12" x2="3" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-10" y1="14" x2="10" y2="14" stroke="black" stroke-width="1" fill="none"/><line x1="-7" y1="19" x2="7" y2="19" stroke="black" stroke-width="1" fill="none"/><line x1="-4" y1="24" x2="4" y2="24" stroke="black" stroke-width="1" fill="none"/><line x1="-1.5" y1="29" x2="1.5" y2="29" stroke="black" stroke-width="1" fill="none"/>',um=[{id:"t_top",x:0,y:-30,orientation:"n"}],mm=[{name:"open",type:"boolean",default:!0,label:"断开"}],pm={x:12,y:-8,anchor:"start"},hm={kind:"inline"},Aj={id:om,name:rm,category:im,description:sm,viewBox:am,width:lm,height:cm,svg:dm,terminals:um,state:mm,label:pm,source:hm},$j=Object.freeze(Object.defineProperty({__proto__:null,category:im,default:Aj,description:sm,height:cm,id:om,label:pm,name:rm,source:hm,state:mm,svg:dm,terminals:um,viewBox:am,width:lm},Symbol.toStringTag,{value:"Module"})),fm="energy-meter",gm="电能表 (Wh)",bm="measurement",ym="有功电能表 (kWh) — 服务入口 / 子表。",xm="-22 -36 44 72",wm=44,vm=72,km='<text x="-10" y="19.2" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Wh</text><rect x="-20" y="-10" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Sm=[{id:"t1",x:0,y:-34,orientation:"n"},{id:"t2",x:0,y:34,orientation:"s"}],_m={kind:"elmt",path:"11_singlepole/500_home_installation/40_meters/wattheuremetre_08-04-03_en60617.elmt",qetEnglishName:"Watt hour meter (en_60617)"},Ej={id:fm,name:gm,category:bm,description:ym,viewBox:xm,width:wm,height:vm,svg:km,terminals:Sm,source:_m},Nj=Object.freeze(Object.defineProperty({__proto__:null,category:bm,default:Ej,description:ym,height:vm,id:fm,name:gm,source:_m,svg:km,terminals:Sm,viewBox:xm,width:wm},Symbol.toStringTag,{value:"Module"})),Cm="ev-charger",jm="EV 充电桩",Am="load",$m="电动汽车充电站 / 充电桩。",Em="-17 -27 34 49",Nm=34,Tm=49,Im='<line x1="0" y1="-25" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-15" y="-15" width="30" height="35" fill="none" stroke="black" stroke-width="1"/><rect x="-9" y="-8" width="14" height="6" fill="none" stroke="black" stroke-width="0.8"/><rect x="5" y="-7" width="2" height="4" fill="black"/><text x="-9" y="13" font-family="Liberation Sans, Arial, sans-serif" font-size="7" fill="#000000">EV</text>',Pm=[{id:"t_top",x:0,y:-25,orientation:"n"}],zm={kind:"inline"},Tj={id:Cm,name:jm,category:Am,description:$m,viewBox:Em,width:Nm,height:Tm,svg:Im,terminals:Pm,source:zm},Ij=Object.freeze(Object.defineProperty({__proto__:null,category:Am,default:Tj,description:$m,height:Tm,id:Cm,name:jm,source:zm,svg:Im,terminals:Pm,viewBox:Em,width:Nm},Symbol.toStringTag,{value:"Module"})),Mm="frequency-meter",Dm="频率表 (Hz)",Rm="measurement",Om="-22 -42 44 44",Lm=44,Bm=44,Hm='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Hz</text>',Fm=[{id:"t_top",x:0,y:-40,orientation:"n"}],Wm={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_07.elmt",qetEnglishName:"Frequency meter"},Pj={id:Mm,name:Dm,category:Rm,viewBox:Om,width:Lm,height:Bm,svg:Hm,terminals:Fm,source:Wm},zj=Object.freeze(Object.defineProperty({__proto__:null,category:Rm,default:Pj,height:Bm,id:Mm,name:Dm,source:Wm,svg:Hm,terminals:Fm,viewBox:Om,width:Lm},Symbol.toStringTag,{value:"Module"})),qm="fuse-switch-disconnector",Gm="熔断器式隔离开关",Vm="switching",Km="负荷型熔断器隔离开关 (on-load fuse switch-disconnector)。",Xm="-8 -32 12 64",Um=12,Ym=64,Zm='<line x1="0" y1="30" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="-5" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-13" x2="0" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-3" y1="6" x2="-6" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-6" x2="1" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="5" x2="-3" y2="6" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-6" x2="-6" y2="-5" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-11" rx="1" ry="1" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-13" x2="2" y2="-13" fill="none" stroke="black" stroke-width="1"/>',Qm=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Jm=[{name:"open",type:"boolean",default:!1,label:"断开"}],ep={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_21/en_60617_07_21_09.elmt",qetEnglishName:"Fuse switch-disconnector; On-load isolating fuse switch"},Mj={id:qm,name:Gm,category:Vm,description:Km,viewBox:Xm,width:Um,height:Ym,svg:Zm,terminals:Qm,state:Jm,source:ep},Dj=Object.freeze(Object.defineProperty({__proto__:null,category:Vm,default:Mj,description:Km,height:Ym,id:qm,name:Gm,source:ep,state:Jm,svg:Zm,terminals:Qm,viewBox:Xm,width:Um},Symbol.toStringTag,{value:"Module"})),tp="fuse",np="熔断器 (FU)",op="switching",rp="-7 -32 14 64",ip=14,sp=64,ap='<line x1="0" y1="-30" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><rect x="-5" y="-15" width="10" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',lp=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],cp=[{name:"blown",type:"boolean",default:!1,label:"熔断"}],dp=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],up={x:7,y:-2,anchor:"start"},mp={ansi:{viewBox:"-8 -32 16 64",width:16,height:64,svg:'<line x1="0" y1="-30" x2="0" y2="-14" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -14 A 6 7 0 0 1 0 0 A 6 7 0 0 0 0 14" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="14" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/>',label:{x:9,y:-2,anchor:"start"},source:{standard:"IEEE Std 315-1975 (ANSI Y32.2-1975)",clause:"9.1.1",title:"Fuse (one-time thermal current-overload device), general"}}},pp={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_21/en_60617_07_21_01.elmt",qetEnglishName:"Fuse, general symbol"},Rj={id:tp,name:np,category:op,viewBox:rp,width:ip,height:sp,svg:ap,terminals:lp,state:cp,params:dp,label:up,variants:mp,source:pp},Oj=Object.freeze(Object.defineProperty({__proto__:null,category:op,default:Rj,height:sp,id:tp,label:up,name:np,params:dp,source:pp,state:cp,svg:ap,terminals:lp,variants:mp,viewBox:rp,width:ip},Symbol.toStringTag,{value:"Module"})),hp="generator",fp="发电机 (G)",gp="source",bp="-42 -42 44 44",yp=44,xp=44,wp='<rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-24" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text>',vp=[{id:"t_bottom",x:-20,y:0,orientation:"s"}],kp={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_16/en_60617_06_16_01.elmt",qetEnglishName:"Generator, general symbol"},Lj={id:hp,name:fp,category:gp,viewBox:bp,width:yp,height:xp,svg:wp,terminals:vp,source:kp},Bj=Object.freeze(Object.defineProperty({__proto__:null,category:gp,default:Lj,height:xp,id:hp,name:fp,source:kp,svg:wp,terminals:vp,viewBox:bp,width:yp},Symbol.toStringTag,{value:"Module"})),Sp="genset",_p="发电机组 (G)",Cp="source",jp="柴油 / 燃气发电机组。",Ap="-28 -22 56 64",$p=56,Ep=64,Np='<rect x="-26" y="-20" width="52" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">GEN</text><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Tp=[{id:"t_out",x:0,y:40,orientation:"s"}],Ip=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],Pp={kind:"inline"},Hj={id:Sp,name:_p,category:Cp,description:jp,viewBox:Ap,width:$p,height:Ep,svg:Np,terminals:Tp,params:Ip,source:Pp},Fj=Object.freeze(Object.defineProperty({__proto__:null,category:Cp,default:Hj,description:jp,height:Ep,id:Sp,name:_p,params:Ip,source:Pp,svg:Np,terminals:Tp,viewBox:Ap,width:$p},Symbol.toStringTag,{value:"Module"})),zp="gfci-breaker",Mp="GFCI 断路器 (RCBO)",Dp="protection",Rp="剩余电流断路器带过流保护 (UL943 / IEC 61009)。北美 GFCI / 欧洲 RCBO。",Op="-18 -22 22 44",Lp=22,Bp=44,Hp='<text x="-14" y="13.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">IΔ</text><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="-5,-10 0,10 0,20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-4" x2="-8" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><line x1="-8" y1="-4" x2="-8" y2="-8" fill="none" stroke="black" stroke-width="0.4"/><line x1="-13" y1="-8" x2="-8" y2="-8" fill="none" stroke="black" stroke-width="0.4"/><line x1="-13" y1="-8" x2="-13" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><line x1="-16" y1="-4" x2="-13" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><path d="M -8 1 A 2.5 3.5 0 0 0 -13 1" fill="none" stroke="black" stroke-width="0.4"/><line x1="-8" y1="1" x2="-2" y2="1" fill="none" stroke="black" stroke-width="0.4"/><line x1="-16" y1="1" x2="-13" y2="1" fill="none" stroke="black" stroke-width="0.4"/>',Fp=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Wp=[{name:"open",type:"boolean",default:!1,label:"断开"}],qp=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"IDn",label:"剩余动作电流",type:"number",unit:"mA",default:30,showOnCanvas:!0}],Gp={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/rcbo.elmt",qetEnglishName:"Residual Circuit Breaker with Overload"},Wj={id:zp,name:Mp,category:Dp,description:Rp,viewBox:Op,width:Lp,height:Bp,svg:Hp,terminals:Fp,state:Wp,params:qp,source:Gp},qj=Object.freeze(Object.defineProperty({__proto__:null,category:Dp,default:Wj,description:Rp,height:Bp,id:zp,name:Mp,params:qp,source:Gp,state:Wp,svg:Hp,terminals:Fp,viewBox:Op,width:Lp},Symbol.toStringTag,{value:"Module"})),Vp="grid-source",Kp="系统电源",Xp="source",Up="无穷大母线 / 外部电网",Yp="-16 -31 32 53",Zp=32,Qp=53,Jp='<circle cx="0" cy="-15" r="14" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-12" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">~</text><line x1="0" y1="-1" x2="0" y2="20" stroke="black" stroke-width="1" fill="none"/>',eh=[{id:"t_bottom",x:0,y:20,orientation:"s"}],th={kind:"inline"},Gj={id:Vp,name:Kp,category:Xp,description:Up,viewBox:Yp,width:Zp,height:Qp,svg:Jp,terminals:eh,source:th},Vj=Object.freeze(Object.defineProperty({__proto__:null,category:Xp,default:Gj,description:Up,height:Qp,id:Vp,name:Kp,source:th,svg:Jp,terminals:eh,viewBox:Yp,width:Zp},Symbol.toStringTag,{value:"Module"})),nh="grounding-transformer",oh="接地变 (Z形)",rh="grounding",ih="星-曲折接线变压器,中性点接地用",sh="-62 -152 64 164",ah=64,lh=164,ch='<line x1="-30" y1="-40" x2="-35" y2="-35" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-25" y2="-35" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-35" x2="-40" y2="-38" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-150" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-35" x2="-25" y2="-30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-30" y2="-45" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-45" x2="-25" y2="-48" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-130" x2="-20" y2="-140" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-135" x2="-20" y2="-145" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="0" x2="-20" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="5" x2="-20" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-85" x2="-30" y2="-95" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-95" x2="-20" y2="-100" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-95" x2="-40" y2="-100" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-20" y2="-40" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-40" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/>',dh=[{id:"t1",x:-30,y:-150,orientation:"n"},{id:"t2",x:-30,y:10,orientation:"s"}],uh={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_10/en_60617_06_10_15.elmt",qetEnglishName:"Three-phase transformer, connection star-zigzag with the neutral brought out"},Kj={id:nh,name:oh,category:rh,description:ih,viewBox:sh,width:ah,height:lh,svg:ch,terminals:dh,source:uh},Xj=Object.freeze(Object.defineProperty({__proto__:null,category:rh,default:Kj,description:ih,height:lh,id:nh,name:oh,source:uh,svg:ch,terminals:dh,viewBox:sh,width:ah},Symbol.toStringTag,{value:"Module"})),mh="heater",ph="电加热器 (EH)",hh="load",fh="电阻加热元件 / 电热负荷。",gh="-22 -7 54 14",bh=54,yh=14,xh='<line x1="-20" y1="0" x2="-10" y2="0" fill="none" stroke="black" stroke-width="1"/><rect x="-10" y="-5" width="30" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="0" x2="30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-5" x2="-5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-5" x2="5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="15" y1="-5" x2="15" y2="5" fill="none" stroke="black" stroke-width="1"/>',wh=[{id:"t1",x:-20,y:0,orientation:"w"},{id:"t2",x:30,y:0,orientation:"e"}],vh=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],kh={kind:"elmt",path:"91_en_60617/en_60617_04/en_60617_04_01/en_60617_04_01_12.elmt",qetEnglishName:"Heating element"},Uj={id:mh,name:ph,category:hh,description:fh,viewBox:gh,width:bh,height:yh,svg:xh,terminals:wh,params:vh,source:kh},Yj=Object.freeze(Object.defineProperty({__proto__:null,category:hh,default:Uj,description:fh,height:yh,id:mh,name:ph,params:vh,source:kh,svg:xh,terminals:wh,viewBox:gh,width:bh},Symbol.toStringTag,{value:"Module"})),Sh="igbt",_h="绝缘栅双极晶体管 (IGBT)",Ch="passive",jh="N 沟道增强型 IGBT。t1=集电极(上), t2=发射极(下), t_g=门极。",Ah="-32 -32 54 74",$h=54,Eh=74,Nh='<line x1="0" y1="25" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polyline points="-30,20 -5,20 -5,-20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-15" x2="20" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="20" y2="40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="15" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-25" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-8" x2="0" y2="8" fill="none" stroke="black" stroke-width="1"/><polyline points="10,-24 8,-21 12,-22" fill="none" stroke="black" stroke-width="1"/><polyline points="10,25 11,29 8,27" fill="none" stroke="black" stroke-width="1"/>',Th=[{id:"t1",x:20,y:-30,orientation:"n"},{id:"t2",x:20,y:40,orientation:"s"},{id:"t_g",x:-30,y:20,orientation:"w"}],Ih={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_05/en_60617_05_05_19.elmt",qetEnglishName:"Insulated-gate bipolar transistor (IGBT) enhancement type, N channel"},Zj={id:Sh,name:_h,category:Ch,description:jh,viewBox:Ah,width:$h,height:Eh,svg:Nh,terminals:Th,source:Ih},Qj=Object.freeze(Object.defineProperty({__proto__:null,category:Ch,default:Zj,description:jh,height:Eh,id:Sh,name:_h,source:Ih,svg:Nh,terminals:Th,viewBox:Ah,width:$h},Symbol.toStringTag,{value:"Module"})),Ph="indicator-light",zh="指示灯 (HL)",Mh="control",Dh="信号 / 状态指示灯。",Rh="-12 -22 24 24",Oh=24,Lh=24,Bh='<ellipse cx="0" cy="-10" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-3" x2="7" y2="-17" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-17" x2="7" y2="-3" fill="none" stroke="black" stroke-width="1"/>',Hh=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],Fh=[{name:"color",label:"颜色",type:"string"}],Wh={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_01.elmt",qetEnglishName:"Lamp, general symbol"},Jj={id:Ph,name:zh,category:Mh,description:Dh,viewBox:Rh,width:Oh,height:Lh,svg:Bh,terminals:Hh,params:Fh,source:Wh},eA=Object.freeze(Object.defineProperty({__proto__:null,category:Mh,default:Jj,description:Dh,height:Lh,id:Ph,name:zh,params:Fh,source:Wh,svg:Bh,terminals:Hh,viewBox:Rh,width:Oh},Symbol.toStringTag,{value:"Module"})),qh="inductor",Gh="电感 (L)",Vh="passive",Kh="通用电感 / 线圈 / 扼流圈。",Xh="-17 -32 34 64",Uh=34,Yh=64,Zh='<line x1="0" y1="15" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><path d="M 0 15 A 15 15 0 1 0 -15 0" fill="none" stroke="black" stroke-width="1"/><line x1="-15" y1="0" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>',Qh=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Jh=[{name:"L",label:"电感量",type:"number",unit:"mH",showOnCanvas:!0},{name:"In",label:"额定电流",type:"number",unit:"A"}],ef={x:6,y:0,anchor:"start"},tf={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/30_inductors/inductance.elmt",qetEnglishName:"Inductor"},tA={id:qh,name:Gh,category:Vh,description:Kh,viewBox:Xh,width:Uh,height:Yh,svg:Zh,terminals:Qh,params:Jh,label:ef,source:tf},nA=Object.freeze(Object.defineProperty({__proto__:null,category:Vh,default:tA,description:Kh,height:Yh,id:qh,label:ef,name:Gh,params:Jh,source:tf,svg:Zh,terminals:Qh,viewBox:Xh,width:Uh},Symbol.toStringTag,{value:"Module"})),nf="inverter",of="逆变器 (DC→AC)",rf="renewable",sf="-42 -42 44 44",af=44,lf=44,cf='<g transform="matrix(1 0 0 -1 0 -40)"><path d="M -15 -8 A 5 2.5 0 0 0 -25 -8" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><path d="M -15 -8 A 5 2.5 0 0 0 -5 -8" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/></g>',df=[{id:"t_dc",x:-20,y:0,orientation:"s"},{id:"t_ac",x:-20,y:-40,orientation:"n"}],uf={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_05.elmt",qetEnglishName:"Inverter"},oA={id:nf,name:of,category:rf,viewBox:sf,width:af,height:lf,svg:cf,terminals:df,source:uf},rA=Object.freeze(Object.defineProperty({__proto__:null,category:rf,default:oA,height:lf,id:nf,name:of,source:uf,svg:cf,terminals:df,viewBox:sf,width:af},Symbol.toStringTag,{value:"Module"})),mf="limit-switch",pf="限位开关 (SQ)",hf="control",ff="行程 / 位置开关 (常开, 机械操作)。",gf="-10 -42 12 64",bf=12,yf=64,xf='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-13" x2="-7" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-12" x2="-3" y2="-8" fill="none" stroke="black" stroke-width="1"/>',wf=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],vf=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],kf={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_08/en_60617_07_08_01.elmt",qetEnglishName:"Position switch, make contact"},iA={id:mf,name:pf,category:hf,description:ff,viewBox:gf,width:bf,height:yf,svg:xf,terminals:wf,state:vf,source:kf},sA=Object.freeze(Object.defineProperty({__proto__:null,category:hf,default:iA,description:ff,height:yf,id:mf,name:pf,source:kf,state:vf,svg:xf,terminals:wf,viewBox:gf,width:bf},Symbol.toStringTag,{value:"Module"})),Sf="load-switch",_f="负荷开关",Cf="switching",jf="-10 -42 14 64",Af=14,$f=64,Ef='<line x1="0" y1="-24" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-22" rx="2" ry="2" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-24" x2="2" y2="-24" fill="none" stroke="black" stroke-width="1"/>',Nf=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Tf=[{name:"open",type:"boolean",default:!1,label:"断开"}],If={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_08.elmt",qetEnglishName:"Switch-disconnector; On-load isolating switch"},aA={id:Sf,name:_f,category:Cf,viewBox:jf,width:Af,height:$f,svg:Ef,terminals:Nf,state:Tf,source:If},lA=Object.freeze(Object.defineProperty({__proto__:null,category:Cf,default:aA,height:$f,id:Sf,name:_f,source:If,state:Tf,svg:Ef,terminals:Nf,viewBox:jf,width:Af},Symbol.toStringTag,{value:"Module"})),Pf="load",zf="负荷",Mf="load",Df="抽象负荷(电流流出箭头)",Rf="-8 -22 16 46",Of=16,Lf=46,Bf='<line x1="0" y1="-20" x2="0" y2="10" stroke="black" stroke-width="1" fill="none"/><polygon points="-6,10 6,10 0,22" fill="black" stroke="black" stroke-width="1"/>',Hf=[{id:"t_top",x:0,y:-20,orientation:"n"}],Ff=[{name:"P",label:"有功功率",type:"number",unit:"MW",showOnCanvas:!0},{name:"cosphi",label:"功率因数",type:"number"}],Wf={x:6,y:0,anchor:"start"},qf={kind:"inline"},cA={id:Pf,name:zf,category:Mf,description:Df,viewBox:Rf,width:Of,height:Lf,svg:Bf,terminals:Hf,params:Ff,label:Wf,source:qf},dA=Object.freeze(Object.defineProperty({__proto__:null,category:Mf,default:cA,description:Df,height:Lf,id:Pf,label:Wf,name:zf,params:Ff,source:qf,svg:Bf,terminals:Hf,viewBox:Rf,width:Of},Symbol.toStringTag,{value:"Module"})),Gf="luminaire",Vf="灯具 / 照明负荷",Kf="load",Xf="照明负荷(IEC 60617 荧光灯具通用符号)。区别于 indicator-light:那是面板信号灯,这是回路末端的照明负荷。",Uf="-27 -7 54 14",Yf=54,Zf=14,Qf='<line x1="-25" y1="0" x2="25" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-5" x2="-25" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="-5" x2="25" y2="5" fill="none" stroke="black" stroke-width="1"/>',Jf=[{id:"t_top",x:0,y:0,orientation:"n"}],eg={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_15/en_60617_11_15_04.elmt",qetEnglishName:"Luminaire, general symbol; Fluorescent lamp, general symbol"},uA={id:Gf,name:Vf,category:Kf,description:Xf,viewBox:Uf,width:Yf,height:Zf,svg:Qf,terminals:Jf,source:eg},mA=Object.freeze(Object.defineProperty({__proto__:null,category:Kf,default:uA,description:Xf,height:Zf,id:Gf,name:Vf,source:eg,svg:Qf,terminals:Jf,viewBox:Uf,width:Yf},Symbol.toStringTag,{value:"Module"})),tg="make-contact",ng="常开触点 (NO)",og="control",rg="常开辅助触点 (make contact)。",ig="-10 -42 12 64",sg=12,ag=64,lg='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>',cg=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],dg=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],ug={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_02/en_60617_07_02_01.elmt",qetEnglishName:"Make contact, general symbol; Switch, general symbol"},pA={id:tg,name:ng,category:og,description:rg,viewBox:ig,width:sg,height:ag,svg:lg,terminals:cg,state:dg,source:ug},hA=Object.freeze(Object.defineProperty({__proto__:null,category:og,default:pA,description:rg,height:ag,id:tg,name:ng,source:ug,state:dg,svg:lg,terminals:cg,viewBox:ig,width:sg},Symbol.toStringTag,{value:"Module"})),mg="motor-starter",pg="电机启动器",hg="motor-control",fg="电机启动器 (IEC 60617 通用符号)。",gg="-22 -27 44 54",bg=44,yg=54,xg='<rect x="-20" y="-20" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><polyline points="-20,-20 0,-10 20,-20" fill="none" stroke="black" stroke-width="1"/>',wg=[{id:"t_top",x:0,y:-25,orientation:"n"},{id:"t_bottom",x:0,y:25,orientation:"s"}],vg={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_14/en_60617_07_14_01.elmt",qetEnglishName:"Motor starter, general symbol"},fA={id:mg,name:pg,category:hg,description:fg,viewBox:gg,width:bg,height:yg,svg:xg,terminals:wg,source:vg},gA=Object.freeze(Object.defineProperty({__proto__:null,category:hg,default:fA,description:fg,height:yg,id:mg,name:pg,source:vg,svg:xg,terminals:wg,viewBox:gg,width:bg},Symbol.toStringTag,{value:"Module"})),kg="mppt",Sg="MPPT 控制器",_g="renewable",Cg="MPPT 太阳能充电控制器(DC/DC,最大功率点跟踪)",jg="-42 -42 44 44",Ag=44,$g=44,Eg='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/>',Ng=[{id:"t_pv",x:-20,y:-40,orientation:"n"},{id:"t_bat",x:-20,y:0,orientation:"s"}],Tg=[{name:"I",label:"额定电流",type:"number",unit:"A"}],Ig={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_02.elmt",qetEnglishName:"DC/DC converter"},bA={id:kg,name:Sg,category:_g,description:Cg,viewBox:jg,width:Ag,height:$g,svg:Eg,terminals:Ng,params:Tg,source:Ig},yA=Object.freeze(Object.defineProperty({__proto__:null,category:_g,default:bA,description:Cg,height:$g,id:kg,name:Sg,params:Tg,source:Ig,svg:Eg,terminals:Ng,viewBox:jg,width:Ag},Symbol.toStringTag,{value:"Module"})),Pg="ngr",zg="中性点电阻 (NGR)",Mg="grounding",Dg="小电阻接地:连接变压器中性点到地",Rg="-12 -32 24 62",Og=24,Lg=62,Bg='<line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><rect x="-6" y="-15" width="12" height="22" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="7" x2="0" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="15" x2="10" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="19" x2="7" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="23" x2="4" y2="23" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="27" x2="1.5" y2="27" fill="none" stroke="black" stroke-width="1"/>',Hg=[{id:"t_top",x:0,y:-30,orientation:"n"}],Fg=[{name:"R",label:"电阻",type:"number",unit:"Ω"}],Wg={kind:"inline"},xA={id:Pg,name:zg,category:Mg,description:Dg,viewBox:Rg,width:Og,height:Lg,svg:Bg,terminals:Hg,params:Fg,source:Wg},wA=Object.freeze(Object.defineProperty({__proto__:null,category:Mg,default:xA,description:Dg,height:Lg,id:Pg,name:zg,params:Fg,source:Wg,svg:Bg,terminals:Hg,viewBox:Rg,width:Og},Symbol.toStringTag,{value:"Module"})),qg="overcurrent-relay",Gg="过流继电器 (50/51)",Vg="protection",Kg="过电流保护继电器 (ANSI 50/51)。",Xg="-62 -62 64 64",Ug=64,Yg=64,Zg='<rect x="-60" y="-60" width="60" height="60" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-48" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">5...10A</text>',Qg=[{id:"t_top",x:-30,y:-60,orientation:"n"}],Jg={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_05.elmt",qetEnglishName:"Overcurrent relay"},vA={id:qg,name:Gg,category:Vg,description:Kg,viewBox:Xg,width:Ug,height:Yg,svg:Zg,terminals:Qg,source:Jg},kA=Object.freeze(Object.defineProperty({__proto__:null,category:Vg,default:vA,description:Kg,height:Yg,id:qg,name:Gg,source:Jg,svg:Zg,terminals:Qg,viewBox:Xg,width:Ug},Symbol.toStringTag,{value:"Module"})),eb="panelboard",tb="配电箱",nb="load",ob="配电箱 / 负荷中心(IEC 60617 分配中心符号):顶部进线,底部分路示意",rb="-52 -62 54 64",ib=54,sb=64,ab='<g transform="matrix(1 0 0 -1 0 -60)"><rect x="-50" y="-40" width="50" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-60" x2="-40" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-60" x2="-30" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-60" x2="-20" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-60" x2="-10" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-20" x2="-25" y2="0" fill="none" stroke="black" stroke-width="1"/></g>',lb=[{id:"t_in",x:-25,y:-60,orientation:"n"}],cb=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],db={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_12/en_60617_11_12_07.elmt",qetEnglishName:"Distribution centre"},SA={id:eb,name:tb,category:nb,description:ob,viewBox:rb,width:ib,height:sb,svg:ab,terminals:lb,params:cb,source:db},_A=Object.freeze(Object.defineProperty({__proto__:null,category:nb,default:SA,description:ob,height:sb,id:eb,name:tb,params:cb,source:db,svg:ab,terminals:lb,viewBox:rb,width:ib},Symbol.toStringTag,{value:"Module"})),ub="phase-failure-relay",mb="断相继电器",pb="protection",hb="断相 / 缺相保护继电器。",fb="-62 -42 64 44",gb=64,bb=44,yb='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">m &lt; 3</text>',xb=[{id:"t_top",x:-30,y:-40,orientation:"n"}],wb={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_12.elmt",qetEnglishName:"Phase-failure detection relay"},CA={id:ub,name:mb,category:pb,description:hb,viewBox:fb,width:gb,height:bb,svg:yb,terminals:xb,source:wb},jA=Object.freeze(Object.defineProperty({__proto__:null,category:pb,default:CA,description:hb,height:bb,id:ub,name:mb,source:wb,svg:yb,terminals:xb,viewBox:fb,width:gb},Symbol.toStringTag,{value:"Module"})),vb="plc",kb="PLC / 控制器",Sb="control",_b="可编程逻辑控制器 (PLC)。",Cb="-24 -42 48 84",jb=48,Ab=84,$b='<rect x="-22" y="-22" width="44" height="44" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">PLC</text><line x1="0" y1="-40" x2="0" y2="-22" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="22" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Eb=[{id:"t_top",x:0,y:-40,orientation:"n"},{id:"t_bottom",x:0,y:40,orientation:"s"}],Nb={kind:"inline"},AA={id:vb,name:kb,category:Sb,description:_b,viewBox:Cb,width:jb,height:Ab,svg:$b,terminals:Eb,source:Nb},$A=Object.freeze(Object.defineProperty({__proto__:null,category:Sb,default:AA,description:_b,height:Ab,id:vb,name:kb,source:Nb,svg:$b,terminals:Eb,viewBox:Cb,width:jb},Symbol.toStringTag,{value:"Module"})),Tb="power-factor-meter",Ib="功率因数表 (cosφ)",Pb="measurement",zb="功率因数表 (cosφ)。",Mb="-22 -42 44 44",Db=44,Rb=44,Ob='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-14" y="-6.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">cos φ</text>',Lb=[{id:"t_top",x:0,y:-40,orientation:"n"}],Bb={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_05.elmt",qetEnglishName:"Power-factor meter"},EA={id:Tb,name:Ib,category:Pb,description:zb,viewBox:Mb,width:Db,height:Rb,svg:Ob,terminals:Lb,source:Bb},NA=Object.freeze(Object.defineProperty({__proto__:null,category:Pb,default:EA,description:zb,height:Rb,id:Tb,name:Ib,source:Bb,svg:Ob,terminals:Lb,viewBox:Mb,width:Db},Symbol.toStringTag,{value:"Module"})),Hb="power-supply",Fb="开关电源 (PS)",Wb="source",qb="AC→DC 开关电源 / 直流电源模块。t_ac 上(~), t_dc 下(=)。",Gb="-24 -42 48 84",Vb=48,Kb=84,Xb='<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="8" y="15" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">=</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Ub=[{id:"t_ac",x:0,y:-40,orientation:"n"},{id:"t_dc",x:0,y:40,orientation:"s"}],Yb=[{name:"Vdc",label:"输出电压",type:"number",unit:"V",showOnCanvas:!0}],Zb={kind:"inline"},TA={id:Hb,name:Fb,category:Wb,description:qb,viewBox:Gb,width:Vb,height:Kb,svg:Xb,terminals:Ub,params:Yb,source:Zb},IA=Object.freeze(Object.defineProperty({__proto__:null,category:Wb,default:TA,description:qb,height:Kb,id:Hb,name:Fb,params:Yb,source:Zb,svg:Xb,terminals:Ub,viewBox:Gb,width:Vb},Symbol.toStringTag,{value:"Module"})),Qb="protective-relay",Jb="保护继电器",e0="protection",t0="测量继电器 / 保护继电器通用符号 (IEC 60617)。",n0="-32 -42 64 44",o0=64,r0=44,i0='<polygon points="-2,-22 2,-22 0,-25" fill="black" stroke="black" stroke-width="1"/><polygon points="-2,-22 -2,-19 -6,-20" fill="black" stroke="black" stroke-width="1"/><polygon points="2,-22 2,-19 6,-20" fill="black" stroke="black" stroke-width="1"/><polygon points="-2,-19 0,-17 -3,-15" fill="black" stroke="black" stroke-width="1"/><polygon points="0,-17 2,-19 4,-15" fill="black" stroke="black" stroke-width="1"/><rect x="-2" y="-22" width="4" height="4" rx="0" ry="0" fill="black" stroke="black" stroke-width="1"/><rect x="-30" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',s0=[{id:"t_top",x:0,y:-40,orientation:"n"}],a0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_16/en_60617_07_16_01.elmt",qetEnglishName:"Measuring relay; Device related to a measuring relay"},PA={id:Qb,name:Jb,category:e0,description:t0,viewBox:n0,width:o0,height:r0,svg:i0,terminals:s0,source:a0},zA=Object.freeze(Object.defineProperty({__proto__:null,category:e0,default:PA,description:t0,height:r0,id:Qb,name:Jb,source:a0,svg:i0,terminals:s0,viewBox:n0,width:o0},Symbol.toStringTag,{value:"Module"})),l0="proximity-switch",c0="接近开关 (SQ)",d0="control",u0="接近传感器 / 无触点接近开关。",m0="-12 -32 24 64",p0=24,h0=64,f0='<line x1="0" y1="-30" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="30" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="0,-10 -10,0 0,10 10,0" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-6" x2="-4" y2="6" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="-6" x2="4" y2="6" fill="none" stroke="black" stroke-width="1"/>',g0=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],b0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_19/en_60617_07_19_01.elmt",qetEnglishName:"Proximity sensor"},MA={id:l0,name:c0,category:d0,description:u0,viewBox:m0,width:p0,height:h0,svg:f0,terminals:g0,source:b0},DA=Object.freeze(Object.defineProperty({__proto__:null,category:d0,default:MA,description:u0,height:h0,id:l0,name:c0,source:b0,svg:f0,terminals:g0,viewBox:m0,width:p0},Symbol.toStringTag,{value:"Module"})),y0="pt",x0="电压互感器 (PT)",w0="instrument-transformer",v0="-22 -42 44 115",k0=44,S0=115,_0='<ellipse cx="0" cy="1" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-40" x2="0" y2="-20" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="30" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="-0.13" y1="51" x2="-0.13" y2="71" fill="none" stroke="black" stroke-width="1"/>',C0=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:71,orientation:"s"}],j0={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_13/en_60617_06_13_01A.elmt",qetEnglishName:"Voltage transformer"},RA={id:y0,name:x0,category:w0,viewBox:v0,width:k0,height:S0,svg:_0,terminals:C0,source:j0},OA=Object.freeze(Object.defineProperty({__proto__:null,category:w0,default:RA,height:S0,id:y0,name:x0,source:j0,svg:_0,terminals:C0,viewBox:v0,width:k0},Symbol.toStringTag,{value:"Module"})),A0="push-button",$0="按钮 (SB)",E0="control",N0="手动按钮, 自动复位 (常开 make)。",T0="-37 -42 39 64",I0=39,P0=64,z0='<line x1="-35" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-15" x2="-35" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-15" x2="-30" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-5" x2="-35" y2="-5" fill="none" stroke="black" stroke-width="1"/>',M0=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],D0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_02.elmt",qetEnglishName:"Switch, manually operated, push-button, automatic return"},LA={id:A0,name:$0,category:E0,description:N0,viewBox:T0,width:I0,height:P0,svg:z0,terminals:M0,source:D0},BA=Object.freeze(Object.defineProperty({__proto__:null,category:E0,default:LA,description:N0,height:P0,id:A0,name:$0,source:D0,svg:z0,terminals:M0,viewBox:T0,width:I0},Symbol.toStringTag,{value:"Module"})),R0="pv",O0="光伏组件",L0="renewable",B0="-33 -22 85 64",H0=85,F0=64,W0='<line x1="-16" y1="24" x2="-26" y2="14" fill="none" stroke="black" stroke-width="1"/><line x1="-21" y1="29" x2="-31" y2="19" fill="none" stroke="black" stroke-width="1"/><polygon points="-20,23 -17,20 -15,25" fill="black" stroke="black" stroke-width="1"/><polygon points="-22,25 -25,28 -20,30" fill="black" stroke="black" stroke-width="1"/><rect x="-10" y="-20" width="60" height="60" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="15" y="7.2" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text><line x1="10" y1="20" x2="20" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="15" x2="20" y2="25" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="10" x2="25" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="20" x2="35" y2="20" fill="none" stroke="black" stroke-width="1"/>',q0=[{id:"t_dc",x:0,y:40,orientation:"s"}],G0={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_18/en_60617_06_18_06.elmt",qetEnglishName:"Photovoltaic generator"},HA={id:R0,name:O0,category:L0,viewBox:B0,width:H0,height:F0,svg:W0,terminals:q0,source:G0},FA=Object.freeze(Object.defineProperty({__proto__:null,category:L0,default:HA,height:F0,id:R0,name:O0,source:G0,svg:W0,terminals:q0,viewBox:B0,width:H0},Symbol.toStringTag,{value:"Module"})),V0="rcd",K0="剩余电流装置 (RCD)",X0="protection",U0="不带过流保护的剩余电流断路器 (IEC 61008)。",Y0="-12 -22 19 44",Z0=19,Q0=44,J0='<line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="0,20 0,10 -7,-9" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="13" rx="4.5" ry="2" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,0 -10,0 -10,13 -5,13" fill="none" stroke="black" stroke-width="0.4" stroke-dasharray="4 2"/>',ey=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],ty=[{name:"open",type:"boolean",default:!1,label:"断开"}],ny=[{name:"IDn",label:"剩余动作电流",type:"number",unit:"mA",default:30,showOnCanvas:!0}],oy={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/ddr1.elmt",qetEnglishName:"Residual Circuit Breaker with Overload"},WA={id:V0,name:K0,category:X0,description:U0,viewBox:Y0,width:Z0,height:Q0,svg:J0,terminals:ey,state:ty,params:ny,source:oy},qA=Object.freeze(Object.defineProperty({__proto__:null,category:X0,default:WA,description:U0,height:Q0,id:V0,name:K0,params:ny,source:oy,state:ty,svg:J0,terminals:ey,viewBox:Y0,width:Z0},Symbol.toStringTag,{value:"Module"})),ry="recloser",iy="重合闸 (Recloser)",sy="protection",ay="中压自动重合闸开关。",ly="-12 -32 36 64",cy=36,dy=64,uy='<line x1="0" y1="-30" x2="0" y2="-10" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-13" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-8" x2="2" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-12" x2="2" y2="-8" stroke="black" stroke-width="1" fill="none"/><path d="M 13 -12 A 7 7 0 1 1 6 -5" fill="none" stroke="black" stroke-width="0.8"/><polygon points="4,-7 6,-5 8,-3" fill="black"/><text x="14" y="6" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">AR</text>',my=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],py=[{name:"open",type:"boolean",default:!1,label:"断开"}],hy={kind:"inline"},GA={id:ry,name:iy,category:sy,description:ay,viewBox:ly,width:cy,height:dy,svg:uy,terminals:my,state:py,source:hy},VA=Object.freeze(Object.defineProperty({__proto__:null,category:sy,default:GA,description:ay,height:dy,id:ry,name:iy,source:hy,state:py,svg:uy,terminals:my,viewBox:ly,width:cy},Symbol.toStringTag,{value:"Module"})),fy="rectifier",gy="整流器 (AC→DC)",by="renewable",yy="-42 -42 44 44",xy=44,wy=44,vy='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/>',ky=[{id:"t_ac",x:-20,y:-40,orientation:"n"},{id:"t_dc",x:-20,y:0,orientation:"s"}],Sy={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_03.elmt",qetEnglishName:"Rectifier"},KA={id:fy,name:gy,category:by,viewBox:yy,width:xy,height:wy,svg:vy,terminals:ky,source:Sy},XA=Object.freeze(Object.defineProperty({__proto__:null,category:by,default:KA,height:wy,id:fy,name:gy,source:Sy,svg:vy,terminals:ky,viewBox:yy,width:xy},Symbol.toStringTag,{value:"Module"})),_y="relay-coil",Cy="继电器线圈 (KA)",jy="control",Ay="继电器 / 接触器操作线圈 (方框)。",$y="-22 -22 44 44",Ey=44,Ny=44,Ty='<rect x="-20" y="-10" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/>',Iy=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Py={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_15/en_60617_07_15_01.elmt",qetEnglishName:"Operating device, general symbol; Relay coil, general symbol"},UA={id:_y,name:Cy,category:jy,description:Ay,viewBox:$y,width:Ey,height:Ny,svg:Ty,terminals:Iy,source:Py},YA=Object.freeze(Object.defineProperty({__proto__:null,category:jy,default:UA,description:Ay,height:Ny,id:_y,name:Cy,source:Py,svg:Ty,terminals:Iy,viewBox:$y,width:Ey},Symbol.toStringTag,{value:"Module"})),zy="resistor",My="电阻 (R)",Dy="passive",Ry="通用电阻 / 限流 / 制动电阻。",Oy="-6 -23 12 35",Ly=12,By=35,Hy='<line x1="0" y1="-10" x2="0" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="10" x2="4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="10" x2="4" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-10" x2="-4" y2="10" fill="none" stroke="black" stroke-width="1"/>',Fy=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t2",x:0,y:10,orientation:"s"}],Wy=[{name:"R",label:"阻值",type:"number",unit:"Ω",showOnCanvas:!0},{name:"P",label:"额定功率",type:"number",unit:"W"}],qy={x:6,y:0,anchor:"start"},Gy={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/10_resistors/resistance.elmt",qetEnglishName:"Resistor"},ZA={id:zy,name:My,category:Dy,description:Ry,viewBox:Oy,width:Ly,height:By,svg:Hy,terminals:Fy,params:Wy,label:qy,source:Gy},QA=Object.freeze(Object.defineProperty({__proto__:null,category:Dy,default:ZA,description:Ry,height:By,id:zy,label:qy,name:My,params:Wy,source:Gy,svg:Hy,terminals:Fy,viewBox:Oy,width:Ly},Symbol.toStringTag,{value:"Module"})),Vy="reverse-power-relay",Ky="逆功率继电器 (32)",Xy="protection",Uy="逆功率 / 逆流保护继电器 (ANSI 32)。",Yy="-62 -42 64 44",Zy=64,Qy=44,Jy='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">I</text><polygon points="-15,-20 -30,-20 -24,-22 -24,-18 -30,-20 -24,-20" fill="black" stroke="black" stroke-width="1"/>',e1=[{id:"t_top",x:-30,y:-40,orientation:"n"}],t1={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_02.elmt",qetEnglishName:"Reverse current relay"},JA={id:Vy,name:Ky,category:Xy,description:Uy,viewBox:Yy,width:Zy,height:Qy,svg:Jy,terminals:e1,source:t1},e$=Object.freeze(Object.defineProperty({__proto__:null,category:Xy,default:JA,description:Uy,height:Qy,id:Vy,name:Ky,source:t1,svg:Jy,terminals:e1,viewBox:Yy,width:Zy},Symbol.toStringTag,{value:"Module"})),n1="selector-switch",o1="选择开关 (SA)",r1="switching",i1="转换 / 选择开关 (旋转操作, 保位)。",s1="-34 -42 36 64",a1=36,l1=64,c1='<line x1="-32" y1="-10" x2="-2" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-32" y1="-15" x2="-32" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>',d1=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],u1=[{name:"open",type:"boolean",default:!1,label:"断开"}],m1={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_04.elmt",qetEnglishName:"Switch, manually operated, turning, stay-put"},t$={id:n1,name:o1,category:r1,description:i1,viewBox:s1,width:a1,height:l1,svg:c1,terminals:d1,state:u1,source:m1},n$=Object.freeze(Object.defineProperty({__proto__:null,category:r1,default:t$,description:i1,height:l1,id:n1,name:o1,source:m1,state:u1,svg:c1,terminals:d1,viewBox:s1,width:a1},Symbol.toStringTag,{value:"Module"})),p1="series-reactor",h1="串联电抗器",f1="compensation",g1="与并联电抗器同符号;通过用法区分。",b1="-62 -82 64 104",y1=64,x1=104,w1='<line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M -30 0 A 30 30 0 1 0 -60 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-60" y1="-30" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/>',v1=[{id:"t1",x:-30,y:-80,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],k1={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_08.elmt",qetEnglishName:"Choke; Reactor, general symbol"},o$={id:p1,name:h1,category:f1,description:g1,viewBox:b1,width:y1,height:x1,svg:w1,terminals:v1,source:k1},r$=Object.freeze(Object.defineProperty({__proto__:null,category:f1,default:o$,description:g1,height:x1,id:p1,name:h1,source:k1,svg:w1,terminals:v1,viewBox:b1,width:y1},Symbol.toStringTag,{value:"Module"})),S1="shunt-capacitor",_1="并联电容器",C1="compensation",j1="-7 -23 14 27",A1=14,$1=27,E1='<line x1="-5" y1="2" x2="5" y2="2" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-2" x2="5" y2="-2" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-2" fill="none" stroke="black" stroke-width="1"/>',N1=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t_bottom",x:0,y:2,orientation:"s"}],T1=[{name:"Q",label:"无功容量",type:"number",unit:"Mvar"},{name:"stages",label:"分组数",type:"number"}],I1={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/20_capacitors/capacite.elmt",qetEnglishName:"Capacitor"},i$={id:S1,name:_1,category:C1,viewBox:j1,width:A1,height:$1,svg:E1,terminals:N1,params:T1,source:I1},s$=Object.freeze(Object.defineProperty({__proto__:null,category:C1,default:i$,height:$1,id:S1,name:_1,params:T1,source:I1,svg:E1,terminals:N1,viewBox:j1,width:A1},Symbol.toStringTag,{value:"Module"})),P1="shunt-reactor",z1="并联电抗器",M1="compensation",D1="-62 -82 64 104",R1=64,O1=104,L1='<line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M -30 0 A 30 30 0 1 0 -60 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-60" y1="-30" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/>',B1=[{id:"t1",x:-30,y:-80,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],H1={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_08.elmt",qetEnglishName:"Choke; Reactor, general symbol"},a$={id:P1,name:z1,category:M1,viewBox:D1,width:R1,height:O1,svg:L1,terminals:B1,source:H1},l$=Object.freeze(Object.defineProperty({__proto__:null,category:M1,default:a$,height:O1,id:P1,name:z1,source:H1,svg:L1,terminals:B1,viewBox:D1,width:R1},Symbol.toStringTag,{value:"Module"})),F1="siren",W1="警笛 (HA)",q1="control",G1="声响警笛 / 报警器。",V1="-32 -42 44 54",K1=44,X1=54,U1='<line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="10,-10 -30,-10 -10,-40" fill="none" stroke="black" stroke-width="1"/>',Y1=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],Z1={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_09.elmt",qetEnglishName:"Siren"},c$={id:F1,name:W1,category:q1,description:G1,viewBox:V1,width:K1,height:X1,svg:U1,terminals:Y1,source:Z1},d$=Object.freeze(Object.defineProperty({__proto__:null,category:q1,default:c$,description:G1,height:X1,id:F1,name:W1,source:Z1,svg:U1,terminals:Y1,viewBox:V1,width:K1},Symbol.toStringTag,{value:"Module"})),Q1="socket-outlet",J1="插座 / 连接器",ex="load",tx="电源插座 / 多极连接器。",nx="-7 -2 13 34",ox=13,rx=34,ix='<line x1="-5" y1="13" x2="4" y2="20" fill="none" stroke="black" stroke-width="0.4"/><line x1="-1" y1="12" x2="-1" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="9" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="12" x2="1" y2="19" fill="none" stroke="black" stroke-width="1"/><path d="M 3 13 A 3 3 0 0 0 -3 13" fill="none" stroke="black" stroke-width="1"/>',sx=[{id:"t1",x:0,y:0,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],ax={kind:"elmt",path:"11_singlepole/140_connectors_plugs/prise_multipolaire_2.elmt",qetEnglishName:`Plug and multipolar representation
222
- unifilar`},u$={id:Q1,name:J1,category:ex,description:tx,viewBox:nx,width:ox,height:rx,svg:ix,terminals:sx,source:ax},m$=Object.freeze(Object.defineProperty({__proto__:null,category:ex,default:u$,description:tx,height:rx,id:Q1,name:J1,source:ax,svg:ix,terminals:sx,viewBox:nx,width:ox},Symbol.toStringTag,{value:"Module"})),lx="soft-starter",cx="软启动器",dx="motor-control",ux="电机软启动器 (晶闸管降压启动)。",mx="-22 -42 44 84",px=44,hx=84,fx='<rect x="-20" y="-20" width="40" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-12" y1="-12" x2="12" y2="12" stroke="black" stroke-width="1" fill="none"/><polygon points="4,8 12,12 8,4" fill="none" stroke="black" stroke-width="1"/><text x="-12" y="-2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">SS</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',gx=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],bx={kind:"inline"},p$={id:lx,name:cx,category:dx,description:ux,viewBox:mx,width:px,height:hx,svg:fx,terminals:gx,source:bx},h$=Object.freeze(Object.defineProperty({__proto__:null,category:dx,default:p$,description:ux,height:hx,id:lx,name:cx,source:bx,svg:fx,terminals:gx,viewBox:mx,width:px},Symbol.toStringTag,{value:"Module"})),yx="sync-motor",xx="同步电动机",wx="load",vx="-62 -82 64 114",kx=64,Sx=114,_x='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-53" x2="-10" y2="-80" fill="none" stroke="black" stroke-width="1"/><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">1</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -40 10 A 5 5 0 0 0 -50 10" fill="none" stroke="black" stroke-width="1"/><path d="M -30 10 A 5 5 0 0 0 -40 10" fill="none" stroke="black" stroke-width="1"/><path d="M -20 10 A 5 5 0 0 0 -30 10" fill="none" stroke="black" stroke-width="1"/><path d="M -10 10 A 5 5 0 0 0 -20 10" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="10" x2="-50" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="10" x2="-10" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="15" x2="-20" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="20" x2="-32" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-27" y1="20" x2="-20" y2="20" fill="none" stroke="black" stroke-width="1"/>',Cx=[{id:"t1",x:-10,y:-80,orientation:"n"},{id:"t2",x:-50,y:-80,orientation:"n"}],jx={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_07/en_60617_06_07_02.elmt",qetEnglishName:"Synchronous motor, single-phase"},f$={id:yx,name:xx,category:wx,viewBox:vx,width:kx,height:Sx,svg:_x,terminals:Cx,source:jx},g$=Object.freeze(Object.defineProperty({__proto__:null,category:wx,default:f$,height:Sx,id:yx,name:xx,source:jx,svg:_x,terminals:Cx,viewBox:vx,width:kx},Symbol.toStringTag,{value:"Module"})),Ax="synchronoscope",$x="同步表",Ex="measurement",Nx="同步指示器 / 同步表。",Tx="-22 -42 44 44",Ix=44,Px=44,zx='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-5" x2="0" y2="-35" fill="none" stroke="black" stroke-width="1"/><path d="M 12.374 -30.374 A 17.5 17.5 0 0 0 -12.374 -30.374" fill="none" stroke="black" stroke-width="1"/><polygon points="-13,-30 -11,-33 -10,-31" fill="none" stroke="black" stroke-width="1"/><polygon points="11,-33 13,-30 10,-31" fill="none" stroke="black" stroke-width="1"/>',Mx=[{id:"t_top",x:0,y:-40,orientation:"n"}],Dx={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_08.elmt",qetEnglishName:"Synchronoscope"},b$={id:Ax,name:$x,category:Ex,description:Nx,viewBox:Tx,width:Ix,height:Px,svg:zx,terminals:Mx,source:Dx},y$=Object.freeze(Object.defineProperty({__proto__:null,category:Ex,default:b$,description:Nx,height:Px,id:Ax,name:$x,source:Dx,svg:zx,terminals:Mx,viewBox:Tx,width:Ix},Symbol.toStringTag,{value:"Module"})),Rx="terminal",Ox="接线端子 / 节点 (X)",Lx="busbar",Bx="接线端子 / 接线盒 / 汇接节点。",Hx="-5 -5 10 10",Fx=10,Wx=10,qx='<ellipse cx="0" cy="0" rx="2.5" ry="2.5" fill="black" stroke="black" stroke-width="1"/>',Gx=[{id:"t_top",x:0,y:-2.5,orientation:"n"},{id:"t_bottom",x:0,y:2.5,orientation:"s"},{id:"t_left",x:-2.5,y:0,orientation:"w"},{id:"t_right",x:2.5,y:0,orientation:"e"}],Vx={kind:"elmt",path:"91_en_60617/en_60617_03/en_60617_03_02/en_60617_03_02_02.elmt",qetEnglishName:"Terminal"},x$={id:Rx,name:Ox,category:Lx,description:Bx,viewBox:Hx,width:Fx,height:Wx,svg:qx,terminals:Gx,source:Vx},w$=Object.freeze(Object.defineProperty({__proto__:null,category:Lx,default:x$,description:Bx,height:Wx,id:Rx,name:Ox,source:Vx,svg:qx,terminals:Gx,viewBox:Hx,width:Fx},Symbol.toStringTag,{value:"Module"})),Kx="thermal-overload",Xx="热过载继电器",Ux="motor-control",Yx="电机热过载保护继电器, 通常串接在接触器和电机之间。",Zx="-9 -32 19 64",Qx=19,Jx=64,ew='<line x1="0" y1="-30" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-7" y="-15" width="14" height="30" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,-10 -1,-5 -4,0 -1,5 -4,10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>',tw=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],nw=[{name:"tripped",type:"boolean",default:!1,label:"动作"}],ow={kind:"inline"},v$={id:Kx,name:Xx,category:Ux,description:Yx,viewBox:Zx,width:Qx,height:Jx,svg:ew,terminals:tw,state:nw,source:ow},k$=Object.freeze(Object.defineProperty({__proto__:null,category:Ux,default:v$,description:Yx,height:Jx,id:Kx,name:Xx,source:ow,state:nw,svg:ew,terminals:tw,viewBox:Zx,width:Qx},Symbol.toStringTag,{value:"Module"})),rw="thermocouple",iw="热电偶 (BT)",sw="measurement",aw="热电偶温度传感器。",lw="-26 -42 52 46",cw=52,dw=46,uw='<ellipse cx="0" cy="0" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/><polyline points="-10,-40 -10,-15 0,0 10,-15 10,-40" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-16" x2="-16" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="16" y1="-16" x2="24" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-20" x2="20" y2="-12" fill="none" stroke="black" stroke-width="1"/>',mw=[{id:"t1",x:10,y:-40,orientation:"n"},{id:"t2",x:-10,y:-40,orientation:"n"}],pw={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_06/en_60617_08_06_01.elmt",qetEnglishName:"Thermocouple"},S$={id:rw,name:iw,category:sw,description:aw,viewBox:lw,width:cw,height:dw,svg:uw,terminals:mw,source:pw},_$=Object.freeze(Object.defineProperty({__proto__:null,category:sw,default:S$,description:aw,height:dw,id:rw,name:iw,source:pw,svg:uw,terminals:mw,viewBox:lw,width:cw},Symbol.toStringTag,{value:"Module"})),hw="thyristor",fw="晶闸管 (V)",gw="passive",bw="反向阻断三极晶闸管 / SCR。t1=阳极(上), t2=阴极(下)。",yw="-22 -42 34 44",xw=34,ww=44,vw='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="10" y1="-20" x2="-10" y2="-20" fill="none" stroke="black" stroke-width="1"/><polyline points="-20,0 -7,0 -4,-10" fill="none" stroke="black" stroke-width="1"/>',kw=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],Sw={x:6,y:-20,anchor:"start"},_w={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_04/en_60617_05_04_06.elmt",qetEnglishName:"Reverse blocking triode thyristor, P-gate (cathode-side controlled)"},C$={id:hw,name:fw,category:gw,description:bw,viewBox:yw,width:xw,height:ww,svg:vw,terminals:kw,label:Sw,source:_w},j$=Object.freeze(Object.defineProperty({__proto__:null,category:gw,default:C$,description:bw,height:ww,id:hw,label:Sw,name:fw,source:_w,svg:vw,terminals:kw,viewBox:yw,width:xw},Symbol.toStringTag,{value:"Module"})),Cw="time-relay",jw="时间继电器 (KT)",Aw="control",$w="延时 (缓动) 继电器线圈。",Ew="-32 -22 54 44",Nw=54,Tw=44,Iw='<rect x="-20" y="-10" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><rect x="-30" y="-10" width="10" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="10" x2="-20" y2="-10" fill="none" stroke="black" stroke-width="1"/>',Pw=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],zw={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_15/en_60617_07_15_08.elmt",qetEnglishName:"Relay coil of a slow-operating relay"},A$={id:Cw,name:jw,category:Aw,description:$w,viewBox:Ew,width:Nw,height:Tw,svg:Iw,terminals:Pw,source:zw},$$=Object.freeze(Object.defineProperty({__proto__:null,category:Aw,default:A$,description:$w,height:Tw,id:Cw,name:jw,source:zw,svg:Iw,terminals:Pw,viewBox:Ew,width:Nw},Symbol.toStringTag,{value:"Module"})),Mw="transfer-switch",Dw="切换开关 (ATS)",Rw="switching",Ow="双源切换开关 (Automatic / Manual Transfer Switch)。两个电源输入 + 一个负荷输出, 互锁不并联。",Lw="-27 -32 51 64",Bw=51,Hw=64,Fw='<line x1="-15" y1="-30" x2="-15" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="15" y1="-30" x2="15" y2="-12" stroke="black" stroke-width="1" fill="none"/><text x="-25" y="-20" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">N</text><text x="19" y="-20" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">E</text><circle cx="-15" cy="-10" r="1.5" fill="black"/><circle cx="15" cy="-10" r="1.5" fill="black"/><circle cx="0" cy="6" r="1.5" fill="black"/><line x1="-15" y1="-10" x2="0" y2="6" stroke="black" stroke-width="1" fill="none"/><line x1="15" y1="-10" x2="0" y2="6" stroke="black" stroke-width="0.6" fill="none" stroke-dasharray="2 1.5"/><line x1="0" y1="6" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>',Ww=[{id:"t_normal",x:-15,y:-30,orientation:"n"},{id:"t_emergency",x:15,y:-30,orientation:"n"},{id:"t_load",x:0,y:30,orientation:"s"}],qw=[{name:"position",type:"string",default:"normal",label:"位置 (normal/emergency/off)"}],Gw={kind:"inline"},E$={id:Mw,name:Dw,category:Rw,description:Ow,viewBox:Lw,width:Bw,height:Hw,svg:Fw,terminals:Ww,state:qw,source:Gw},N$=Object.freeze(Object.defineProperty({__proto__:null,category:Rw,default:E$,description:Ow,height:Hw,id:Mw,name:Dw,source:Gw,state:qw,svg:Fw,terminals:Ww,viewBox:Lw,width:Bw},Symbol.toStringTag,{value:"Module"})),Vw="transformer-2w",Kw="双绕组变压器",Xw="transformer",Uw="-62 -142 64 144",Yw=64,Zw=144,Qw='<ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-140" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/>',Jw=[{id:"t1",x:-30,y:-140,orientation:"n"},{id:"t2",x:-30,y:0,orientation:"s"}],ev=[{name:"S",label:"容量",type:"number",unit:"MVA",showOnCanvas:!0},{name:"ratio",label:"变比",type:"string",showOnCanvas:!0}],tv={x:4,y:-68,anchor:"start"},nv={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_01.elmt",qetEnglishName:"Transformer with two windings, general symbol"},T$={id:Vw,name:Kw,category:Xw,viewBox:Uw,width:Yw,height:Zw,svg:Qw,terminals:Jw,params:ev,label:tv,source:nv},I$=Object.freeze(Object.defineProperty({__proto__:null,category:Xw,default:T$,height:Zw,id:Vw,label:tv,name:Kw,params:ev,source:nv,svg:Qw,terminals:Jw,viewBox:Uw,width:Yw},Symbol.toStringTag,{value:"Module"})),ov="transformer-3w",rv="三绕组变压器",iv="transformer",sv="-82 -131 114 133",av=114,lv=133,cv='<ellipse cx="-30" cy="-80" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-31" y1="-129" x2="-31" y2="-109" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-50" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-20" x2="-50" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>',dv=[{id:"t1",x:-31,y:-129,orientation:"n"},{id:"t_low_left",x:-50,y:0,orientation:"s"},{id:"t_low_right",x:0,y:0,orientation:"s"}],uv={x:4,y:-64,anchor:"start"},mv={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_04.elmt",qetEnglishName:"Transformer with three windings, general symbol"},P$={id:ov,name:rv,category:iv,viewBox:sv,width:av,height:lv,svg:cv,terminals:dv,label:uv,source:mv},z$=Object.freeze(Object.defineProperty({__proto__:null,category:iv,default:P$,height:lv,id:ov,label:uv,name:rv,source:mv,svg:cv,terminals:dv,viewBox:sv,width:av},Symbol.toStringTag,{value:"Module"})),pv="triac",hv="双向晶闸管 (V)",fv="passive",gv="双向三极晶闸管 (TRIAC)。",bv="-22 -42 44 44",yv=44,xv=44,wv='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-20,-30 0,-30 -10,-10" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-30" x2="-10" y2="-30" fill="none" stroke="black" stroke-width="1"/><polygon points="0,-10 10,-30 20,-10" fill="none" stroke="black" stroke-width="1"/><polyline points="20,0 18,0 14,-10" fill="none" stroke="black" stroke-width="1"/>',vv=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],kv={x:6,y:-20,anchor:"start"},Sv={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_04/en_60617_05_04_11.elmt",qetEnglishName:"Bidirectional triode thyristor; Triac"},M$={id:pv,name:hv,category:fv,description:gv,viewBox:bv,width:yv,height:xv,svg:wv,terminals:vv,label:kv,source:Sv},D$=Object.freeze(Object.defineProperty({__proto__:null,category:fv,default:M$,description:gv,height:xv,id:pv,label:kv,name:hv,source:Sv,svg:wv,terminals:vv,viewBox:bv,width:yv},Symbol.toStringTag,{value:"Module"})),_v="undervoltage-relay",Cv="欠压继电器 (27)",jv="protection",Av="欠电压保护继电器 (ANSI 27)。",$v="-62 -82 64 84",Ev=64,Nv=84,Tv='<rect x="-60" y="-80" width="60" height="80" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-49" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">130 %</text><text x="-55" y="-32.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">50...80 V</text><text x="-41" y="-53.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">U &lt;</text>',Iv=[{id:"t_top",x:-30,y:-80,orientation:"n"}],Pv={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_07.elmt",qetEnglishName:"Undervoltage relay"},R$={id:_v,name:Cv,category:jv,description:Av,viewBox:$v,width:Ev,height:Nv,svg:Tv,terminals:Iv,source:Pv},O$=Object.freeze(Object.defineProperty({__proto__:null,category:jv,default:R$,description:Av,height:Nv,id:_v,name:Cv,source:Pv,svg:Tv,terminals:Iv,viewBox:$v,width:Ev},Symbol.toStringTag,{value:"Module"})),zv="ups",Mv="不间断电源 (UPS)",Dv="source",Rv="在线 / 后备式不间断电源。",Ov="-26 -42 52 84",Lv=52,Bv=84,Hv='<rect x="-24" y="-20" width="48" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">UPS</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Fv=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],Wv=[{name:"S",label:"容量",type:"number",unit:"kVA"}],qv={kind:"inline"},L$={id:zv,name:Mv,category:Dv,description:Rv,viewBox:Ov,width:Lv,height:Bv,svg:Hv,terminals:Fv,params:Wv,source:qv},B$=Object.freeze(Object.defineProperty({__proto__:null,category:Dv,default:L$,description:Rv,height:Bv,id:zv,name:Mv,params:Wv,source:qv,svg:Hv,terminals:Fv,viewBox:Ov,width:Lv},Symbol.toStringTag,{value:"Module"})),Gv="varmeter",Vv="无功功率表 (var)",Kv="measurement",Xv="无功功率表 (var)。",Uv="-22 -42 44 44",Yv=44,Zv=44,Qv='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">var</text>',Jv=[{id:"t_top",x:0,y:-40,orientation:"n"}],ek={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_04.elmt",qetEnglishName:"Varmeter"},H$={id:Gv,name:Vv,category:Kv,description:Xv,viewBox:Uv,width:Yv,height:Zv,svg:Qv,terminals:Jv,source:ek},F$=Object.freeze(Object.defineProperty({__proto__:null,category:Kv,default:H$,description:Xv,height:Zv,id:Gv,name:Vv,source:ek,svg:Qv,terminals:Jv,viewBox:Uv,width:Yv},Symbol.toStringTag,{value:"Module"})),tk="vfd",nk="变频器 (VFD)",ok="motor-control",rk="Variable Frequency Drive — 异步电动机调速。",ik="-24 -42 48 84",sk=48,ak=84,lk='<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="6" y="14" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~f</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',ck=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],dk={kind:"inline"},W$={id:tk,name:nk,category:ok,description:rk,viewBox:ik,width:sk,height:ak,svg:lk,terminals:ck,source:dk},q$=Object.freeze(Object.defineProperty({__proto__:null,category:ok,default:W$,description:rk,height:ak,id:tk,name:nk,source:dk,svg:lk,terminals:ck,viewBox:ik,width:sk},Symbol.toStringTag,{value:"Module"})),uk="voltage-regulator",mk="调压器 (T)",pk="transformer",hk="可调感应调压器 / 自耦调压器。",fk="-17 -32 38 64",gk=38,bk=64,yk='<line x1="-5" y1="21" x2="5" y2="17" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-16.05" x2="4.95" y2="-20.05" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-5" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="0" rx="15" ry="15" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-20.05" x2="4.95" y2="-24.05" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="23" x2="5" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-18.05" x2="4.95" y2="-22.05" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="25" x2="5" y2="21" fill="none" stroke="black" stroke-width="1"/><line x1="-15" y1="15" x2="15" y2="-15" fill="none" stroke="black" stroke-width="1"/><polygon points="13,-16 16,-13 19,-19" fill="black" stroke="black" stroke-width="0.4"/>',xk=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],wk=[{name:"ratio",label:"调压范围",type:"string",showOnCanvas:!0}],vk={kind:"elmt",path:"11_singlepole/340_converters_inverters/10_converters/regulator_ind_3f_1.elmt",qetEnglishName:"Voltage regulator"},G$={id:uk,name:mk,category:pk,description:hk,viewBox:fk,width:gk,height:bk,svg:yk,terminals:xk,params:wk,source:vk},V$=Object.freeze(Object.defineProperty({__proto__:null,category:pk,default:G$,description:hk,height:bk,id:uk,name:mk,params:wk,source:vk,svg:yk,terminals:xk,viewBox:fk,width:gk},Symbol.toStringTag,{value:"Module"})),kk="voltmeter",Sk="电压表 (V)",_k="measurement",Ck="-22 -42 44 44",jk=44,Ak=44,$k='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-4" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">V</text>',Ek=[{id:"t_top",x:0,y:-40,orientation:"n"}],Nk={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_01.elmt",qetEnglishName:"Voltmeter"},K$={id:kk,name:Sk,category:_k,viewBox:Ck,width:jk,height:Ak,svg:$k,terminals:Ek,source:Nk},X$=Object.freeze(Object.defineProperty({__proto__:null,category:_k,default:K$,height:Ak,id:kk,name:Sk,source:Nk,svg:$k,terminals:Ek,viewBox:Ck,width:jk},Symbol.toStringTag,{value:"Module"})),Tk="wattmeter",Ik="功率表 (W)",Pk="measurement",zk="-22 -42 44 44",Mk=44,Dk=44,Rk='<rect x="-20" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-6" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">W</text>',Ok=[{id:"t_top",x:0,y:-40,orientation:"n"}],Lk={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_03/en_60617_08_03_01.elmt",qetEnglishName:"Recording wattmeter"},U$={id:Tk,name:Ik,category:Pk,viewBox:zk,width:Mk,height:Dk,svg:Rk,terminals:Ok,source:Lk},Y$=Object.freeze(Object.defineProperty({__proto__:null,category:Pk,default:U$,height:Dk,id:Tk,name:Ik,source:Lk,svg:Rk,terminals:Ok,viewBox:zk,width:Mk},Symbol.toStringTag,{value:"Module"})),Bk="wind-turbine",Hk="风力发电机",Fk="renewable",Wk="风机:发电机 + 三叶轮标记",qk="-22 -46 44 68",Gk=44,Vk=68,Kk='<circle cx="0" cy="0" r="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="16">G</text><line x1="0" y1="-20" x2="0" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-32" x2="-10" y2="-39" fill="none" stroke="black" stroke-width="1.5"/><line x1="0" y1="-32" x2="10" y2="-39" fill="none" stroke="black" stroke-width="1.5"/><line x1="0" y1="-32" x2="0" y2="-44" fill="none" stroke="black" stroke-width="1.5"/>',Xk=[{id:"t_bottom",x:0,y:20,orientation:"s"}],Uk={kind:"inline"},Z$={id:Bk,name:Hk,category:Fk,description:Wk,viewBox:qk,width:Gk,height:Vk,svg:Kk,terminals:Xk,source:Uk},Q$=Object.freeze(Object.defineProperty({__proto__:null,category:Fk,default:Z$,description:Wk,height:Vk,id:Bk,name:Hk,source:Uk,svg:Kk,terminals:Xk,viewBox:qk,width:Gk},Symbol.toStringTag,{value:"Module"})),Yk="zener-diode",Zk="稳压二极管 (D)",Qk="passive",Jk="齐纳 / 稳压二极管。t1=阳极(上), t2=阴极(下)。",e2="-12 -42 24 44",t2=24,n2=44,o2='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-15" x2="-10" y2="-10" fill="none" stroke="black" stroke-width="1"/>',r2=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],i2={x:6,y:-20,anchor:"start"},s2={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_06.elmt",qetEnglishName:"Breakdown diode, unidirectional; Zener diode"},J$={id:Yk,name:Zk,category:Qk,description:Jk,viewBox:e2,width:t2,height:n2,svg:o2,terminals:r2,label:i2,source:s2},eE=Object.freeze(Object.defineProperty({__proto__:null,category:Qk,default:J$,description:Jk,height:n2,id:Yk,label:i2,name:Zk,source:s2,svg:o2,terminals:r2,viewBox:e2,width:t2},Symbol.toStringTag,{value:"Module"})),tE=Object.assign({"./ammeter.json":NC,"./arc-suppression-coil.json":IC,"./arrester.json":zC,"./async-motor.json":DC,"./autotransformer.json":OC,"./battery.json":BC,"./bell.json":FC,"./break-contact.json":qC,"./breaker.json":VC,"./buchholz-relay.json":XC,"./busbar.json":YC,"./busduct-tap.json":QC,"./busduct.json":ej,"./buzzer.json":nj,"./capacitor.json":rj,"./contactor.json":sj,"./converter-bidir.json":lj,"./ct.json":dj,"./dc-combiner.json":mj,"./dc-dc-converter.json":hj,"./dc-disconnector.json":gj,"./dc-motor.json":yj,"./diode.json":wj,"./disconnector.json":kj,"./distance-relay.json":_j,"./earth.json":jj,"./earthing-switch.json":$j,"./energy-meter.json":Nj,"./ev-charger.json":Ij,"./frequency-meter.json":zj,"./fuse-switch-disconnector.json":Dj,"./fuse.json":Oj,"./generator.json":Bj,"./genset.json":Fj,"./gfci-breaker.json":qj,"./grid-source.json":Vj,"./grounding-transformer.json":Xj,"./heater.json":Yj,"./igbt.json":Qj,"./indicator-light.json":eA,"./inductor.json":nA,"./inverter.json":rA,"./limit-switch.json":sA,"./load-switch.json":lA,"./load.json":dA,"./luminaire.json":mA,"./make-contact.json":hA,"./motor-starter.json":gA,"./mppt.json":yA,"./ngr.json":wA,"./overcurrent-relay.json":kA,"./panelboard.json":_A,"./phase-failure-relay.json":jA,"./plc.json":$A,"./power-factor-meter.json":NA,"./power-supply.json":IA,"./protective-relay.json":zA,"./proximity-switch.json":DA,"./pt.json":OA,"./push-button.json":BA,"./pv.json":FA,"./rcd.json":qA,"./recloser.json":VA,"./rectifier.json":XA,"./relay-coil.json":YA,"./resistor.json":QA,"./reverse-power-relay.json":e$,"./selector-switch.json":n$,"./series-reactor.json":r$,"./shunt-capacitor.json":s$,"./shunt-reactor.json":l$,"./siren.json":d$,"./socket-outlet.json":m$,"./soft-starter.json":h$,"./sync-motor.json":g$,"./synchronoscope.json":y$,"./terminal.json":w$,"./thermal-overload.json":k$,"./thermocouple.json":_$,"./thyristor.json":j$,"./time-relay.json":$$,"./transfer-switch.json":N$,"./transformer-2w.json":I$,"./transformer-3w.json":z$,"./triac.json":D$,"./undervoltage-relay.json":O$,"./ups.json":B$,"./varmeter.json":F$,"./vfd.json":q$,"./voltage-regulator.json":V$,"./voltmeter.json":X$,"./wattmeter.json":Y$,"./wind-turbine.json":Q$,"./zener-diode.json":eE}),a2=Object.values(tE).map(e=>e.default),vt=Object.fromEntries(a2.map(e=>[e.id,e])),ei=["busbar","switching","protection","motor-control","control","transformer","instrument-transformer","measurement","source","load","storage","compensation","passive","grounding","renewable"];(()=>{var t;const e={};for(const n of a2)(e[t=n.category]??(e[t]=[])).push(n);return e})();const Wn=new Map(Object.entries(vt));function nE(e){return vt[e]}const l2="custom:";function eo(e){return e.startsWith(l2)}function c2(e){if(!(e!=null&&e.length))return Wn;const t=new Map(Wn);for(const n of e)!(n!=null&&n.id)||!eo(n.id)||t.set(n.id,n);return t}function oE(e,t){var o;if(!t||t==="iec")return e;let n=null;for(const[r,i]of e){const s=(o=i.variants)==null?void 0:o[t];s&&(n??(n=new Map(e)),n.set(r,{...i,viewBox:s.viewBox,width:s.width,height:s.height,svg:s.svg,terminalLabelsSvg:s.terminalLabelsSvg??i.terminalLabelsSvg,label:s.label??i.label}))}return n??e}function d2(){return{elements:new Map,buses:new Map,junctions:new Map,terminals:new Map,nodes:new Map,layout:new Map,wireRenders:new Map,terminalToNode:new Map,elementToTerminals:new Map,diagnostics:[],library:Wn}}function u2(e){return{at:(e==null?void 0:e.at)??[0,0],rot:(e==null?void 0:e.rot)??0,mirror:(e==null?void 0:e.mirror)??!1,...(e==null?void 0:e.scale)!==void 0&&Ho(e.scale)!==1?{scale:Ho(e.scale)}:{}}}function Fo(e){return e===90||e===270?"y":"x"}function Le(e,t){const n=t.scale??1;let o=e[0]*n,r=e[1]*n;switch(t.mirror&&(o=-o),t.rot){case 0:break;case 90:[o,r]=[-r,o];break;case 180:[o,r]=[-o,-r];break;case 270:[o,r]=[r,-o];break}return[o+t.at[0],r+t.at[1]]}const rE={n:"e",e:"s",s:"w",w:"n"},iE={n:"n",s:"s",e:"w",w:"e"};function Jt(e,t){let n=t.mirror?iE[e]:e;const o=t.rot/90|0;for(let r=0;r<o;r++)n=rE[n];return n}function Wo(e){switch(e){case"n":return[0,-1];case"s":return[0,1];case"e":return[1,0];case"w":return[-1,0]}}class m2{constructor(){qe(this,"parent",new Map);qe(this,"rank",new Map)}add(t){this.parent.has(t)||(this.parent.set(t,t),this.rank.set(t,0))}find(t){this.add(t);let n=t;for(;this.parent.get(n)!==n;){const o=this.parent.get(n),r=this.parent.get(o);this.parent.set(n,r),n=r}return n}union(t,n){const o=this.find(t),r=this.find(n);if(o===r)return;const i=this.rank.get(o),s=this.rank.get(r);i<s?this.parent.set(o,r):i>s?this.parent.set(r,o):(this.parent.set(r,o),this.rank.set(o,i+1))}groups(){const t=new Map;for(const n of this.parent.keys()){const o=this.find(n),r=t.get(o);r?r.push(n):t.set(o,[n])}return t}}const ti=["n","e","s","w"],ni={n:"s",s:"n",e:"w",w:"e"};function Sn(e,t){const n=ti.indexOf(e),r=((ti.indexOf(t)-n)%4+4)%4;return[0,90,180,270][r]}const vo=320,_n=220,Vt=260,ko=720,Kt=30,oi=30,lt=80,ri=10,sE=60,aE=520,lE=80,cE=80,ii=8,si=new Set(["source","renewable"]);function dE(e){var Or,Lr,Br,Hr,Fr,Wr;const{elements:t,buses:n,junctions:o,wires:r,library:i,userLayout:s,userBusLayout:l}=e,a=new Map(s),d=new Map(l),u=new Map,m=new Set(s.keys()),p=new Set(l.keys()),h=new Map;for(const w of t)h.set(w.id,w);const g=new Map;for(const w of n)g.set(w.id,w);const f=w=>{const k=h.get(w);if(k)return i.get(k.kind)},b=new Set(n.map(w=>w.id)),y=w=>b.has(w),v=new Set(o.map(w=>w.id)),j=new Set(o.filter(w=>{var k;return(k=w.layout)==null?void 0:k.at}).map(w=>w.id)),S=new m2;for(const w of r)S.add(w.ends[0]),S.add(w.ends[1]),S.union(w.ends[0],w.ends[1]);for(const w of t){const k=i.get(w.kind);if(k)for(const A of k.terminals)S.add(`${w.id}.${A.id}`)}for(const w of n)S.add(w.id);const N=[];for(const[,w]of S.groups())w.length>=2&&N.push(w);const W=new Map;for(const w of N)for(const k of w)W.set(k,[w]);const ne=new Map;for(const w of N){const k=w.filter(y);if(k.length!==0)for(const A of k){const T=w.filter(_=>_!==A),E=ne.get(A)??[];E.push(...T),ne.set(A,E)}}{const A=z=>h.has(z)&&!!f(z),T=z=>{if(y(z))return null;if(v.has(z))return z;const I=z.indexOf(".");return I>0?z.slice(0,I):null},E=new Map,_=new Set,P=(z,I)=>{E.has(z)||E.set(z,new Set),E.has(I)||E.set(I,new Set),z!==I&&(E.get(z).add(I),E.get(I).add(z))};for(const z of N){const I=[];let O=!1;for(const G of z){if(y(G)){O=!0;continue}const J=T(G);J&&I.push(J)}const L=[...new Set(I)];for(const G of L)E.has(G)||E.set(G,new Set),O&&_.add(G);const q=L.filter(G=>v.has(G)),X=L.filter(G=>!v.has(G));if(q.length>0){for(const G of q)for(const J of X)P(G,J);for(let G=0;G<q.length;G++)for(let J=G+1;J<q.length;J++)P(q[G],q[J])}else for(let G=0;G<X.length;G++)for(let J=G+1;J<X.length;J++)P(X[G],X[J])}const B=(z,I)=>{const O=f(z);if(!O)return null;for(const L of O.terminals){const q=`${z}.${L.id}`;for(const X of W.get(q)??[])for(const G of X)if(T(G)===I)return L}return null},M=z=>{const I=Z=>{var te;return((te=E.get(Z))==null?void 0:te.size)??0},O=Z=>{var te;return((te=f(Z))==null?void 0:te.category)??""},L=Z=>{const te=O(Z);return te==="source"?0:te==="renewable"?1:2+Math.min(I(Z),9)/10},q=z.filter(A).sort((Z,te)=>L(Z)-L(te)||Z.localeCompare(te))[0];if(!q)return;const X=new Map([[q,null]]),G=new Map([[q,0]]),J=new Map,ee=[],U=[q],Y=new Set([q]);for(;U.length;){const Z=U.shift();ee.push(Z);for(const te of[...E.get(Z)??[]].sort((Te,Ie)=>Te.localeCompare(Ie)))Y.has(te)||(Y.add(te),X.set(te,Z),G.set(te,(G.get(Z)??0)+1),J.has(Z)||J.set(Z,[]),J.get(Z).push(te),U.push(te))}let Q=0;const ge=new Map,_e=Z=>{const te=J.get(Z)??[];if(te.length===0){ge.set(Z,Q++);return}for(const Ie of te)_e(Ie);const Te=te.map(Ie=>ge.get(Ie));ge.set(Z,Te.reduce((Ie,vn)=>Ie+vn,0)/Te.length)};_e(q);for(const Z of ee){const te=ve(vo+(ge.get(Z)??0)*160),Te=ve(_n+(G.get(Z)??0)*140);if(v.has(Z)){u.set(Z,[te,Te]);continue}let Ie=0;const vn=X.get(Z)??null;if(vn){const Wt=B(Z,vn);Wt&&(Ie=Sn(Wt.orientation,"n"))}else{const Wt=(J.get(Z)??[])[0],qr=Wt?B(Z,Wt):null;qr&&(Ie=Sn(qr.orientation,"s"))}a.set(Z,{at:[te,Te],rot:Ie,mirror:!1}),m.add(Z)}},D=new Set;for(const z of E.keys()){if(D.has(z))continue;const I=[],O=[z];for(D.add(z);O.length;){const L=O.pop();I.push(L);for(const q of E.get(L)??[])D.has(q)||(D.add(q),O.push(q))}I.length<2||I.some(L=>_.has(L))||I.some(L=>a.has(L)||j.has(L))||I.some(A)&&M(I)}}const pe=new Map;for(const w of N){const k=w.filter(y);if(k.length!==0)for(const A of w){if(y(A))continue;const T=A.indexOf(".");if(T<0)continue;const E=A.slice(0,T),_=A.slice(T+1),P=pe.get(E)??[];for(const B of k)P.some(M=>M.busId===B&&M.pin===_)||P.push({busId:B,pin:_});pe.set(E,P)}}const $=[],R=new Set;for(const[w,k]of pe)if(new Set(k.map(T=>T.busId)).size>=2){const T=((Lr=i.get(((Or=h.get(w))==null?void 0:Or.kind)??""))==null?void 0:Lr.category)==="transformer"?"vertical":"horizontal";$.push({elementId:w,attachments:k,orientation:T}),T==="vertical"&&R.add(w)}const H=new Map,V=(w,k)=>{w!==k&&(H.has(w)||H.set(w,new Set),H.has(k)||H.set(k,new Set),H.get(w).add(k),H.get(k).add(w))};for(const w of r)V(w.ends[0],w.ends[1]);for(const w of t){const k=i.get(w.kind);if(!k||k.terminals.length<2)continue;const A=k.terminals.map(T=>`${w.id}.${T.id}`);for(let T=0;T<A.length;T++)for(let E=T+1;E<A.length;E++)V(A[T],A[E])}for(const w of t){if(R.has(w.id))continue;const k=i.get(w.kind);if(!k||k.category!=="transformer"||k.terminals.length<2)continue;const A=k.terminals.map(_=>`${w.id}.${_.id}`),T=new Map;for(const _ of A){const P=_.slice(w.id.length+1);T.set(P,new Set);const B=new Set(A.filter(z=>z!==_)),M=new Set([_]),D=[_];for(;D.length>0;){const z=D.shift();if(y(z)){T.get(P).add(z);continue}const I=H.get(z);if(I)for(const O of I)M.has(O)||B.has(O)||(M.add(O),D.push(O))}}const E=new Set;for(const _ of T.values())for(const P of _)E.add(P);if(E.size>=2){const _=[];for(const[P,B]of T)for(const M of B)_.push({busId:M,pin:P});$.push({elementId:w.id,attachments:_,orientation:"vertical"}),R.add(w.id)}}const F=(w,k)=>{var B;const A=f(k),T=A?A.terminals.map(M=>`${k}.${M.id}`):[],E=w,_=new Set([E,...T]),P=[E];for(;P.length>0;){const M=P.shift(),D=M.indexOf(".");if(D>0){const I=M.slice(0,D),O=h.get(I);if(O){const L=(B=i.get(O.kind))==null?void 0:B.category;if(L&&si.has(L))return!0}}const z=H.get(M);if(z)for(const I of z)_.has(I)||(_.add(I),P.push(I))}return!1};for(const w of $){if(w.orientation!=="horizontal")continue;const k=new Set(w.attachments.map(T=>T.busId));let A=0;for(const T of k)F(T,w.elementId)&&A++;A===1&&(w.orientation="vertical",R.add(w.elementId))}for(const w of t){if(R.has(w.id)||w.kind!=="breaker")continue;const k=i.get(w.kind);if(!k||k.terminals.length!==2)continue;const A=k.terminals.map(_=>`${w.id}.${_.id}`),T=new Map;for(const _ of A){const P=_.slice(w.id.length+1),B=new Set(A.filter(z=>z!==_)),M=new Set([_]),D=[_];for(;D.length>0;){const z=D.shift();if(y(z)){T.set(P,z);break}const I=H.get(z);if(I)for(const O of I){if(M.has(O)||B.has(O))continue;const L=O.indexOf(".");if(L>0){const q=O.slice(0,L);if(q!==w.id){const X=h.get(q),G=X?i.get(X.kind):void 0;if((G==null?void 0:G.category)==="transformer")continue}}M.add(O),D.push(O)}}}if(new Set(T.values()).size>=2){const _=[];for(const[P,B]of T)_.push({busId:B,pin:P});$.push({elementId:w.id,attachments:_,orientation:"horizontal"})}}const K=new Map;for(const w of n)K.set(w.id,new Map);for(const w of $){const k=Array.from(new Set(w.attachments.map(A=>A.busId)));for(const A of k)for(const T of k)A!==T&&((Br=K.get(A))==null||Br.set(T,w))}const ie=w=>{var A;const k=(A=i.get(w))==null?void 0:A.category;return k?si.has(k):!1},he=[];for(const w of n){const k=ne.get(w.id);if(k)for(const A of k){if(y(A))continue;const T=A.indexOf(".");if(T<0)continue;const E=A.slice(0,T),_=h.get(E);if(_&&ie(_.kind)){he.push(w.id);break}}}he.length===0&&n.length>0&&he.push(n[0].id);const ae=new Map;for(const w of he)ae.set(w,0);{const w=[...he];for(;w.length>0;){const k=w.shift(),A=ae.get(k),T=K.get(k);if(T)for(const[E,_]of T){if(ae.has(E))continue;const P=_.orientation==="horizontal"?A:A+1;ae.set(E,P),w.push(E)}}}for(const w of n){if(ae.has(w.id))continue;const k=ae.size===0?-1:Math.max(...Array.from(ae.values()));ae.set(w.id,k+1)}const fe=new Map;for(const w of n){const k=ae.get(w.id),A=fe.get(k)??[];A.push(w.id),fe.set(k,A)}const ce=[...fe.keys()].sort((w,k)=>w-k),be=(w,k,A)=>{const T=`${w.elementId}.${A}`,E=k,_=f(w.elementId),P=new Set;if(_)for(const I of _.terminals)I.id!==A&&P.add(`${w.elementId}.${I.id}`);const B=new Set([T]),M=[{ref:T,dist:0}],D=new Map,z=(I,O,L,q)=>{B.add(I),D.set(I,O),M.push({ref:I,dist:q+L})};for(;M.length>0;){const{ref:I,dist:O}=M.shift();if(I===E){const G=D.get(E);let J;if(G){const ee=G.indexOf(".");if(ee>0){const U=G.slice(0,ee);U!==w.elementId&&(J=U)}}return{extent:O,head:J}}const L=I.indexOf(".");if(L<0)continue;const q=I.slice(0,L),X=I.slice(L+1);if(!y(q)&&!R.has(q)){const G=f(q),J=G==null?void 0:G.terminals.find(ee=>ee.id===X);if(G&&J)for(const ee of G.terminals){if(ee.id===X)continue;const U=`${q}.${ee.id}`;B.has(U)||P.has(U)||z(U,I,Math.abs(J.y-ee.y),O)}}for(const G of W.get(I)??[])for(const J of G){if(J===I||B.has(J)||P.has(J))continue;const ee=y(I)||y(J);z(J,I,ee?oi:Kt,O)}}return{extent:0}},Ce=(w,k)=>{var I,O,L;const A=(I=K.get(w))==null?void 0:I.get(k);if(!A||A.orientation==="horizontal")return Vt;const T=f(A.elementId);if(!T)return Vt;const E=(O=A.attachments.find(q=>q.busId===w))==null?void 0:O.pin,_=(L=A.attachments.find(q=>q.busId===k))==null?void 0:L.pin;if(!E||!_)return Vt;const P=T.terminals.find(q=>q.id===E),B=T.terminals.find(q=>q.id===_);if(!P||!B)return Vt;const M=Math.abs(B.y-P.y),D=be(A,w,E).extent,z=be(A,k,_).extent;return D+M+z},Be=new Map;for(const w of $){if(w.orientation!=="vertical")continue;const k=w.attachments.slice().sort((B,M)=>(ae.get(B.busId)??0)-(ae.get(M.busId)??0));if(k.length<2)continue;const A=k[0].busId,T=k[1].busId,E=k[0].pin,P=be(w,A,E).head??w.elementId;Be.set(P,{lowerBusId:T})}const Lt=30,jr=w=>{const k=f(w);return Math.max((k==null?void 0:k.width)??lt,lt)},MS=2,Ar=(w,k,A,T=0)=>{const E=f(k);let _=jr(k);if(E&&!A.has(k)&&T<MS){A.add(k);let P=0;for(const B of E.terminals){const M=`${k}.${B.id}`;if(M!==w)for(const D of W.get(M)??[]){const z=new Set;let I=!1;for(const L of D){if(L===M)continue;if(y(L)){I=!0;continue}const q=L.indexOf(".");if(q<0)continue;const X=L.slice(0,q);X===k||A.has(X)||R.has(X)||z.add(X)}if(I||z.size===0)continue;let O=0;for(const L of z){const q=[...D].find(X=>X.indexOf(".")>0&&X.slice(0,X.indexOf("."))===L);O+=(q?Ar(q,L,A,T+1):jr(L))+Lt}P=Math.max(P,O-Lt)}}A.delete(k),_=Math.max(_,P)}return _},Bt=320,kt=new Map,$r=(w,k)=>{if(!R.has(w))return!1;const A=$.find(P=>P.elementId===w),T=A==null?void 0:A.attachments.find(P=>P.busId!==k);if(!T)return!1;const E=ae.get(k)??0;return(ae.get(T.busId)??0)<E},Ht=(w,k,A)=>{const T=Be.get(w);if(T){const _=kt.get(T.lowerBusId);if(_!==void 0)return Math.max(k,_+lt)}let E=0;return A&&(E=Ar(A,w,new Set)),Math.max(k,lt,E)},Er=(w,k)=>{if(kt.has(w))return kt.get(w);if(k.has(w))return Bt;k.add(w);const A=ne.get(w)??[];let T=0,E=0;for(const P of A){if(y(P))continue;const B=P.indexOf(".");if(B<0)continue;const M=P.slice(0,B),D=P.slice(B+1);if($r(M,w))continue;const z=f(M);if(!z)continue;const I=z.terminals.find(q=>q.id===D);if(!I)continue;const O=Be.get(M);O&&Er(O.lowerBusId,k);const L=Ht(M,z.width,`${M}.${D}`);I.y>0?T+=L:E+=L}const _=Math.max(Bt,Math.max(T,E)+lt);return kt.set(w,_),k.delete(w),_};for(const w of n)Er(w.id,new Set);const it=new Map,DS=(w,k,A)=>{const T=f(k);if(!T)return;const E=`${k}.${A}`,_=T.terminals.filter(M=>M.id!==A).map(M=>`${k}.${M.id}`);if(_.length===0)return;const P=new Set([E,..._]),B=_.slice();for(;B.length>0;){const M=B.shift();if(y(M)&&M!==w){const z=d.get(M);return z?z.at[0]:void 0}for(const z of W.get(M)??[])for(const I of z)I===M||P.has(I)||(P.add(I),B.push(I));const D=M.indexOf(".");if(D>0){const z=M.slice(0,D);if(!y(z)){const I=f(z);if(I)for(const O of I.terminals){const L=`${z}.${O.id}`;P.has(L)||(P.add(L),B.push(L))}}}}},RS=w=>{const k=ne.get(w);if(!k||k.length===0)return;const A=d.get(w);if(!A)return;const T=k.flatMap(I=>{if(y(I))return[];const O=I.indexOf(".");if(O<0)return[];const L=I.slice(0,O),q=I.slice(O+1);if(a.has(L))return[];if($r(L,w))return[];const X=f(L);if(!X)return[];const G=X.terminals.find(J=>J.id===q);return G?[{elId:L,lib:X,localTerm:G,isLinker:R.has(L),busFacingRef:`${L}.${q}`}]:[]});if(T.length===0)return;const E=[],_=[];for(const I of T)I.localTerm.y>0?E.push(I):_.push(I);const P=I=>I.reduce((O,L)=>O+Ht(L.elId,L.lib.width,L.busFacingRef),0),B=Math.max(P(E),P(_))+lt,M=Math.max(A.span,B);M!==A.span&&!p.has(w)&&d.set(w,{...A,span:M});const D=d.get(w),z=(I,O)=>{if(I.length===0)return;const L=new Map;for(const Y of I){const Q=DS(w,Y.elId,Y.localTerm.id);Q!==void 0&&L.set(Y.elId,Q)}I.sort((Y,Q)=>{const ge=L.get(Y.elId)??D.at[0],_e=L.get(Q.elId)??D.at[0];if(ge!==_e)return ge-_e;const Z=Ht(Y.elId,Y.lib.width,Y.busFacingRef);return Ht(Q.elId,Q.lib.width,Q.busFacingRef)-Z});const q=I.map(Y=>Ht(Y.elId,Y.lib.width,Y.busFacingRef)),X=q.reduce((Y,Q)=>Y+Q,0),G=Math.max(M,X),J=(G-X)/(I.length+1);let ee=D.at[0]-G/2+J;const U=D.at[1]+O*oi;for(let Y=0;Y<I.length;Y++){const Q=I[Y],ge=q[Y],_e=ee+ge/2;Q.isLinker?it.has(Q.elId)||it.set(Q.elId,_e):a.set(Q.elId,{at:[ve(_e-Q.localTerm.x),ve(U-Q.localTerm.y)],rot:0,mirror:!1}),ee+=ge+J}};z(E,-1),z(_,1)},OS=w=>{if(a.has(w.elementId)||w.orientation==="horizontal")return;const k=f(w.elementId);if(!k)return;const A=w.attachments.filter(ee=>d.has(ee.busId));if(A.length<2)return;const T=A.slice().sort((ee,U)=>(ae.get(ee.busId)??0)-(ae.get(U.busId)??0)),E=T[0].busId,_=d.get(E),P=T[0].pin,B=T[T.length-1].pin,M=k.terminals.find(ee=>ee.id===P),D=k.terminals.find(ee=>ee.id===B);if(!M||!D)return;const z=M.y<=D.y?0:180,I=ae.get(E)??0,O=A.filter(ee=>(ae.get(ee.busId)??0)===I),L=[];let q=0;for(const ee of O){const U=be(w,ee.busId,ee.pin);q=Math.max(q,U.extent);const Y=U.head?a.get(U.head):void 0;Y?L.push(Y.at[0]):it.has(w.elementId)?L.push(it.get(w.elementId)):L.push(d.get(ee.busId).at[0])}let X;L.length>0?X=L.reduce((ee,U)=>ee+U,0)/L.length:it.has(w.elementId)?X=it.get(w.elementId):X=_.at[0];const G=_.at[1]+q,J=z===0?[ve(X-M.x),ve(G-M.y)]:[ve(X+M.x),ve(G+M.y)];if(a.set(w.elementId,{at:J,rot:z,mirror:!1}),O.length>1){const ee=a.get(w.elementId),U=Le([M.x,M.y],ee),Y=Jt(M.orientation,ee);LS(`${w.elementId}.${P}`,U,Y,X)}},LS=(w,k,A,T)=>{const E=new Set([w]);let _=w,P=k,B=A;for(;;){const M=W.get(_)??[];let D,z=!1;for(const te of M){if(te.length>=3){z=!0;break}const Te=te.find(Ie=>Ie!==_);if(!(!Te||E.has(Te))){if(y(Te)){z=!0;break}D=Te;break}}if(z||!D)break;const I=D.indexOf(".");if(I<0)break;const O=D.slice(0,I),L=D.slice(I+1);if(y(O)||R.has(O)||a.has(O))break;const q=f(O);if(!q)break;const X=q.terminals.find(te=>te.id===L);if(!X)break;const G=Wo(B),J=[P[0]+G[0]*Kt,P[1]+G[1]*Kt],ee=ni[B],U=Sn(X.orientation,ee),Y=Le([X.x,X.y],{at:[0,0],rot:U,mirror:!1}),Q=[ve(T-Y[0]),ve(J[1]-Y[1])];a.set(O,{at:Q,rot:U,mirror:!1}),E.add(D);const ge=q.terminals.find(te=>te.id!==L);if(!ge)break;const _e=`${O}.${ge.id}`;E.add(_e);const Z={at:Q,rot:U,mirror:!1};P=Le([ge.x,ge.y],Z),B=Jt(ge.orientation,Z),_=_e}},BS=w=>{if(a.has(w.elementId)||w.orientation!=="horizontal")return;const k=f(w.elementId);if(!k)return;const A=w.attachments.filter(O=>d.has(O.busId));if(A.length<2)return;const T=A.map(O=>{const L=be(w,O.busId,O.pin),q=L.head?a.get(L.head):void 0,X=q?q.at[0]:d.get(O.busId).at[0];return{att:O,x:X,extent:L.extent}});T.sort((O,L)=>O.x-L.x);const E=T[0],_=T[T.length-1],P=k.terminals.find(O=>O.id===E.att.pin),B=k.terminals.find(O=>O.id===_.att.pin);if(!P||!B)return;const M=P.y<=B.y?270:90,D=(E.x+_.x)/2,I=d.get(E.att.busId).at[1]+Math.max(E.extent,_.extent);a.set(w.elementId,{at:[ve(D),ve(I)],rot:M,mirror:!1})},Nr=100;let wn=_n;for(let w=0;w<ce.length;w++){const k=ce[w],A=fe.get(k);let T;if(w===0)T=_n;else{const _=fe.get(ce[w-1]);let P=0;for(const B of _)for(const M of A)(Hr=K.get(B))!=null&&Hr.get(M)&&(P=Math.max(P,Ce(B,M)));P===0&&(P=Vt),T=wn+P}wn=T;let E=vo;for(const _ of A){if(d.has(_)){wn=Math.max(wn,d.get(_).at[1]);continue}let P;if(w>0){const M=fe.get(ce[w-1]),D=[];for(const z of M){const I=(Fr=K.get(z))==null?void 0:Fr.get(_);if(!I||I.orientation!=="vertical")continue;const O=(Wr=I.attachments.find(q=>q.busId===z))==null?void 0:Wr.pin;if(!O)continue;const L=be(I,z,O);L.head&&a.has(L.head)?D.push(a.get(L.head).at[0]):it.has(I.elementId)?D.push(it.get(I.elementId)):D.push(d.get(z).at[0])}D.length>0&&(P=D.reduce((z,I)=>z+I,0)/D.length)}if(P===void 0){const M=kt.get(_)??ko;P=E+M/2,E+=M+Nr}const B=kt.get(_)??ko;d.set(_,{at:[ve(P),ve(T)],rot:0,span:B,axis:Fo(0)})}for(const _ of A)RS(_);if(w>0)for(const _ of $)a.has(_.elementId)||!_.attachments.some(B=>A.includes(B.busId))||OS(_);for(const _ of $)_.orientation!=="horizontal"||a.has(_.elementId)||!_.attachments.every(B=>A.includes(B.busId))||BS(_)}if(n.length===0&&a.size<t.length){const w=E=>{const _=new Set,P=f(E);if(!P)return _;for(const B of P.terminals){const M=`${E}.${B.id}`;for(const D of W.get(M)??[])for(const z of D){if(z===M||y(z))continue;const I=z.indexOf(".");if(I<0)continue;const O=z.slice(0,I);O!==E&&_.add(O)}}return _},k=new Set,A=[];for(const E of t){if(k.has(E.id)||!f(E.id))continue;const _=[],P=[E.id];for(k.add(E.id);P.length>0;){const B=P.pop();_.push(B);for(const M of w(B))k.has(M)||(k.add(M),P.push(M))}_.length>=2&&A.push(_)}let T=vo;for(const E of A){if(E.some(D=>a.has(D)))continue;E.sort((D,z)=>{var X,G;const I=ie(((X=h.get(D))==null?void 0:X.kind)??"")?0:1,O=ie(((G=h.get(z))==null?void 0:G.kind)??"")?0:1;if(I!==O)return I-O;const L=w(D).size,q=w(z).size;return L!==q?L-q:D.localeCompare(z)});const _=E[0],P=f(_);if(!P)continue;const B=P.terminals.slice().sort((D,z)=>z.y-D.y)[0],M=B?Le([B.x,B.y],{at:[0,0],rot:0,mirror:!1}):[0,0];a.set(_,{at:[ve(T-M[0]),ve(_n-M[1])],rot:0,mirror:!1}),T+=Math.max(ko,E.length*lt)+Nr}}const HS=w=>{if(y(w))return d.has(w);const k=w.indexOf(".");return k<0?!1:a.has(w.slice(0,k))};let fo=!0,FS=t.length+4;for(;fo&&FS-- >0;){fo=!1;for(const w of N){if(w.length<2)continue;const k=[],A=new Map;for(const U of w){if(y(U))continue;const Y=U.indexOf(".");if(Y<0)continue;const Q=U.slice(0,Y),ge=U.slice(Y+1);if(a.has(Q)){k.push(U);continue}if(R.has(Q)||A.has(Q))continue;const _e=f(Q);if(!_e)continue;const Z=_e.terminals.find(te=>te.id===ge);Z&&A.set(Q,{ref:U,elId:Q,lib:_e,localTerm:Z})}if(A.size===0||k.length===0)continue;const T=[...A.values()],E=new Map;for(const U of T)for(const Y of W.get(U.ref)??[])for(const Q of Y){if(Q===U.ref||y(Q)||!HS(Q))continue;const ge=Q;E.set(ge,(E.get(ge)??0)+1)}let _;if(E.size>0){let U=-1;for(const[Y,Q]of E)(Q>U||Q===U&&(_===void 0||Y<_))&&(U=Q,_=Y)}if(_||(_=[...k].sort()[0]),!_)continue;const P=_.indexOf("."),B=_.slice(0,P),M=_.slice(P+1),D=f(B),z=a.get(B);if(!D||!z)continue;const I=D.terminals.find(U=>U.id===M);if(!I)continue;const O=Le([I.x,I.y],z),L=Jt(I.orientation,z),q=Wo(L),X=[-q[1],q[0]];T.sort((U,Y)=>U.elId.localeCompare(Y.elId));const G=T.map(U=>Math.max(U.lib.width,lt));let ee=-G.reduce((U,Y)=>U+Y,0)/2;for(let U=0;U<T.length;U++){const Y=T[U],Q=G[U],ge=ee+Q/2;ee+=Q;const _e=ni[L],Z=Sn(Y.localTerm.orientation,_e),te=Le([Y.localTerm.x,Y.localTerm.y],{at:[0,0],rot:Z,mirror:!1}),Te=[O[0]+q[0]*Kt+X[0]*ge,O[1]+q[1]*Kt+X[1]*ge],Ie=[ve(Te[0]-te[0]),ve(Te[1]-te[1])];a.set(Y.elId,{at:Ie,rot:Z,mirror:!1}),fo=!0}}}const Ft=w=>{const k=a.get(w),A=f(w);if(!k||!A)return null;const T=A.viewBox.split(/\s+/).map(Number);if(T.length<4||T.some(I=>Number.isNaN(I))){const I=A.width/2;return{min:k.at[0]-I,max:k.at[0]+I}}const[E,_,P,B]=T,M=[[E,_],[E+P,_],[E,_+B],[E+P,_+B]];let D=1/0,z=-1/0;for(const I of M){const O=Le(I,k);D=Math.min(D,O[0]),z=Math.max(z,O[0])}return{min:D,max:z}},go=w=>{const k=new Set,A=f(w);if(!A)return k;for(const T of A.terminals){const E=`${w}.${T.id}`;for(const _ of W.get(E)??[])for(const P of _){if(P===E||y(P))continue;const B=P.indexOf(".");if(B<0)continue;const M=P.slice(0,B);M!==w&&k.add(M)}}return k},Tr=40,bo=w=>{const k=a.get(w),A=f(w);if(!k||!A)return null;const T=A.viewBox.split(/\s+/).map(Number);if(T.length<4||T.some(I=>Number.isNaN(I))){const I=A.height/2;return{min:k.at[1]-I,max:k.at[1]+I}}const[E,_,P,B]=T,M=[[E,_],[E+P,_],[E,_+B],[E+P,_+B]];let D=1/0,z=-1/0;for(const I of M){const O=Le(I,k);D=Math.min(D,O[1]),z=Math.max(z,O[1])}return{min:D,max:z}},WS=(w,k)=>{const A=new Set,T=[];for(const E of ne.get(w)??[]){if(y(E))continue;const _=E.indexOf(".");if(_<0)continue;const P=E.slice(0,_),B=a.get(P);!B||B.at[1]>=k-1||A.has(P)||(A.add(P),T.push(P))}for(;T.length>0;){const E=T.pop();for(const _ of go(E)){if(A.has(_))continue;const P=a.get(_);!P||P.at[1]>=k-1||(A.add(_),T.push(_))}}return A},Ir=(w,k,A)=>{const T=new Set([w]),E=[w];for(;E.length>0;){const _=E.pop();for(const P of go(_))P===k||T.has(P)||!A.has(P)||(T.add(P),E.push(P))}return T},Pr=(w,k)=>{let A=w.length*w.length+8,T=!1,E=!0;for(;E&&A-- >0;){E=!1;for(let _=0;_<w.length&&!E;_++)for(let P=_+1;P<w.length;P++){const B=w[_],M=w[P],D=Ft(B),z=Ft(M),I=bo(B),O=bo(M);if(!D||!z||!I||!O)continue;const L=Math.min(D.max,z.max)-Math.max(D.min,z.min),q=Math.min(I.max,O.max)-Math.max(I.min,O.min);if(L<=0||q<=0)continue;const X=Ir(B,M,k),G=Ir(M,B,k);if(X.has(M)||G.has(B))continue;const J=![...X].some(Z=>m.has(Z)),ee=![...G].some(Z=>m.has(Z));if(!J&&!ee)continue;const U=(D.min+D.max)/2,Y=(z.min+z.max)/2;let Q,ge;J&&(!ee||X.size<=G.size)?(Q=X,ge=U<=Y?-1:1):(Q=G,ge=Y<=U?-1:1);const _e=ve(ge*(L+Tr));if(_e!==0){for(const Z of Q){const te=a.get(Z);te&&a.set(Z,{...te,at:[te.at[0]+_e,te.at[1]]})}T=!0,E=!0;break}}}return T};for(const w of n){const k=d.get(w.id);if(!k)continue;const A=WS(w.id,k.at[1]);if(A.size<2)continue;const T=[...A];if(Pr(T,A)){let _=1/0,P=-1/0;for(const B of T){const M=Ft(B);M&&(_=Math.min(_,M.min),P=Math.max(P,M.max))}if(Number.isFinite(_)){const M=T.some(z=>m.has(z))?0:ve(k.at[0]-(_+P)/2);if(M!==0)for(const z of T){const I=a.get(z);I&&a.set(z,{...I,at:[I.at[0]+M,I.at[1]]})}const D=P-_+Tr;if(D>k.span&&!p.has(w.id)){const z=d.get(w.id);d.set(w.id,{...z,span:D})}}}}const zr=()=>{const k=t.map(T=>T.id).filter(T=>a.has(T)).map(T=>({x:Ft(T),y:bo(T)})).filter(T=>T.x&&T.y);let A=0;for(let T=0;T<k.length;T++)for(let E=T+1;E<k.length;E++){const _=Math.min(k[T].x.max,k[E].x.max)-Math.max(k[T].x.min,k[E].x.min),P=Math.min(k[T].y.max,k[E].y.max)-Math.max(k[T].y.min,k[E].y.min);_>1&&P>1&&A++}return A},qS=zr(),Mr=new Map;for(const[w,k]of a)Mr.set(w,{...k,at:[...k.at]});const Dr=new Map;for(const[w,k]of d)Dr.set(w,{...k,at:[...k.at]});const yo=120,Rr=new Map;{const w=new Map,k=new Map,A=[];for(const E of n)for(const _ of ne.get(E.id)??[]){if(y(_))continue;const P=_.indexOf(".");if(P<0)continue;const B=_.slice(0,P);a.has(B)&&A.push({el:B,bus:E.id,d:1})}A.sort((E,_)=>E.d-_.d);let T=0;for(;T<A.length;){const{el:E,bus:_,d:P}=A[T++],B=w.get(E);if(B===void 0)w.set(E,P),k.set(E,_);else if(P===B&&k.get(E)!==_){k.set(E,null);continue}else continue;for(const M of go(E))a.has(M)&&(w.has(M)||A.push({el:M,bus:_,d:P+1}))}for(const[E,_]of k)_&&Rr.set(E,_)}for(const w of ce){const k=(fe.get(w)??[]).filter(D=>d.has(D));if(k.length<2||k.some(D=>p.has(D)))continue;const A=[];let T=0;for(const D of k){const z=d.get(D),I=[];let O=1/0,L=-1/0;for(const[q,X]of Rr){if(X!==D)continue;const G=Ft(q);G&&(I.push(q),O=Math.min(O,G.min),L=Math.max(L,G.max))}Number.isFinite(O)||(O=z.at[0]-Bt/2,L=z.at[0]+Bt/2),A.push({busId:D,min:O,max:L,members:I}),T+=L-O}if(A.some(D=>D.members.some(z=>m.has(z))))continue;let E=1/0,_=-1/0;for(const D of A)E=Math.min(E,D.min),_=Math.max(_,D.max);const P=_-E,B=T+yo*(A.length-1);if(!(P>B+yo))continue;A.sort((D,z)=>(D.min+D.max)/2-(z.min+z.max)/2);let M=E;for(const D of A){const z=ve(M-D.min);if(z!==0){const I=d.get(D.busId);d.set(D.busId,{...I,at:[I.at[0]+z,I.at[1]]});for(const O of D.members){const L=a.get(O);L&&a.set(O,{...L,at:[L.at[0]+z,L.at[1]]})}D.min+=z,D.max+=z}M=D.max+yo}for(const D of A){const z=d.get(D.busId),I=Math.max(Bt,D.max-D.min);I<z.span&&d.set(D.busId,{...z,span:I})}}{const w=t.map(A=>A.id).filter(A=>a.has(A)),k=new Set(w);Pr(w,k)}if(zr()>qS){a.clear();for(const[w,k]of Mr)a.set(w,k);d.clear();for(const[w,k]of Dr)d.set(w,k)}let xo=0;for(const w of t){if(a.has(w.id))continue;const k=xo%ii,A=Math.floor(xo/ii);a.set(w.id,{at:[ve(sE+k*lE),ve(aE+A*cE)],rot:0,mirror:!1}),xo++}return{devices:a,buses:d,junctions:u}}function ve(e){return Math.round(e/ri)*ri}function uE(e,t){const n=e.ends[0],o=e.ends[1],r=ai(n,t),i=ai(o,t);if(r||i){const a=r?n:o,u=So(r?o:n,t);if(!u)return null;const m=t.buses.get(a);if(!m)return null;const{axis:p,at:h,span:g}=m.geometry,f=g/2;let b;if(p==="x")b=[qn(u[0],h[0]-f,h[0]+f),h[1]];else{const y=qn(u[1],h[1]-f,h[1]+f);b=[h[0],y]}return{wireId:e.id,path:ci(u,b)}}const s=So(n,t),l=So(o,t);return!s||!l?null:{wireId:e.id,path:ci(s,l)}}function ai(e,t){return!e.includes(".")&&t.buses.has(e)}function So(e,t){if(!e.includes(".")){const o=t.buses.get(e);if(o)return o.geometry.at;const r=t.junctions.get(e);return r?r.world:null}const n=t.terminals.get(e);return n?n.world:null}function li(e,t,n){if(!e.includes(".")){const r=n.buses.get(e);if(!r){const u=n.junctions.get(e);return u?[u.world[0],u.world[1]]:null}const{axis:i,at:s,span:l}=r.geometry;if(!t)return[s[0],s[1]];const a=l/2;if(i==="x")return[qn(t[0],s[0]-a,s[0]+a),s[1]];const d=qn(t[1],s[1]-a,s[1]+a);return[s[0],d]}const o=n.terminals.get(e);return o?[o.world[0],o.world[1]]:null}function ci(e,t){return e[0]===t[0]||e[1]===t[1]?[e,t]:[e,[e[0],t[1]],t]}function qn(e,t,n){return e<t?t:e>n?n:e}function mE(e){const n=[...e].sort().join("|");let o=2166136261;for(let r=0;r<n.length;r++)o^=n.charCodeAt(r),o=Math.imul(o,16777619);return`n_${(o>>>0).toString(36)}`}const pE=320;function Ye(e){var j,S,N,W,ne,pe;const t=d2(),n=oE(c2(e.customKinds),(j=e.meta)==null?void 0:j.symbolStandard);t.library=n;const o=new Map;e.elements.forEach(($,R)=>{if(o.has($.id)){t.diagnostics.push({code:"E001",severity:"error",message:Ae("compile.duplicateId",{id:$.id}),pointer:`/elements/${R}`});return}o.set($.id,$);const H=n.get($.kind);H||t.diagnostics.push({code:"E003",severity:"error",message:`${Ae("compile.unknownKind",{kind:$.kind})} (id=${$.id})`,pointer:`/elements/${R}`}),t.elements.set($.id,{element:$,libraryDef:H})});const r=new Map,i=new Map;(e.buses??[]).forEach(($,R)=>{if(o.has($.id)||r.has($.id)){t.diagnostics.push({code:"E001",severity:"error",message:Ae("compile.duplicateId",{id:$.id}),pointer:`/buses/${R}`});return}if(r.set($.id,$),$.layout){const H=$.layout.rot??0;i.set($.id,{at:$.layout.at,span:$.layout.span,rot:H,axis:Fo(H)})}});const s=new Map;(e.junctions??[]).forEach(($,R)=>{if(o.has($.id)||r.has($.id)||s.has($.id)){t.diagnostics.push({code:"E001",severity:"error",message:Ae("compile.duplicateId",{id:$.id}),pointer:`/junctions/${R}`});return}s.set($.id,$)});const l=$=>!$.includes(".")&&r.has($),a=$=>!$.includes(".")&&s.has($),d=($,R)=>{if(l($)||a($))return!0;const H=$.indexOf(".");if(H<=0)return t.diagnostics.push({code:"E003",severity:"error",message:Ae("compile.invalidTermRef",{ref:$}),pointer:R}),!1;const V=$.slice(0,H),F=$.slice(H+1),K=t.elements.get(V);if(!K)return t.diagnostics.push({code:"E002",severity:"error",message:Ae("compile.elementMissing",{id:V}),pointer:R}),!1;if(!K.libraryDef)return!1;if(!K.libraryDef.terminals.find(ie=>ie.id===F)){const ie=K.libraryDef.terminals.map(he=>he.id).join(", ");return t.diagnostics.push({code:"E003",severity:"error",message:Ae("compile.missingPin",{id:V,kind:K.element.kind,pin:F,available:ie}),pointer:R}),!1}return!0},u=[];(e.wires??[]).forEach(($,R)=>{const H=`/wires/${R}`,V=d($.ends[0],H),F=d($.ends[1],H);V&&F&&u.push($)});const m=new Map;if(e.layout)for(const[$,R]of Object.entries(e.layout))t.elements.has($)?m.set($,u2(R)):t.diagnostics.push({code:"E004",severity:"error",message:Ae("compile.layoutMissingElement",{id:$}),pointer:`/layout/${$}`});const p=dE({elements:e.elements,buses:e.buses??[],junctions:e.junctions??[],wires:u,library:n,userLayout:m,userBusLayout:i});t.layout=p.devices;for(const[$,R]of p.buses){const H=r.get($);H&&t.buses.set($,{bus:H,geometry:R})}for(const[$,R]of r)t.buses.has($)||t.buses.set($,{bus:R,geometry:{at:((S=R.layout)==null?void 0:S.at)??[0,0],span:((N=R.layout)==null?void 0:N.span)??pE,rot:((W=R.layout)==null?void 0:W.rot)??0,axis:Fo(((ne=R.layout)==null?void 0:ne.rot)??0)}});for(const $ of t.elements.values()){if(!$.libraryDef)continue;const R=t.layout.get($.element.id);if(!R)continue;const H=[];for(const V of $.libraryDef.terminals){const F=`${$.element.id}.${V.id}`,K=Le([V.x,V.y],R),ie=Jt(V.orientation,R);t.terminals.set(F,{ref:F,elementId:$.element.id,pin:V.id,world:K,orientation:ie}),H.push(F)}t.elementToTerminals.set($.element.id,H)}const h=new Map,g=new Set;for(const[$,R]of s)(pe=R.layout)!=null&&pe.at?(h.set($,[R.layout.at[0],R.layout.at[1]]),g.add($)):p.junctions.has($)&&(h.set($,p.junctions.get($)),g.add($));const f=$=>{if(!$.includes(".")){const H=t.buses.get($);return H?H.geometry.at:h.get($)??null}const R=t.terminals.get($);return R?R.world:null},b=new Map;for(const[$]of s)g.has($)||b.set($,[]);for(const $ of u){const[R,H]=$.ends;b.has(R)&&b.get(R).push(H),b.has(H)&&b.get(H).push(R)}for(let $=0;$<12;$++){let R=!1;for(const[H,V]of b){let F=0,K=0,ie=0;for(const ce of V){const be=f(ce);be&&(F+=be[0],K+=be[1],ie++)}if(!ie)continue;const he=F/ie,ae=K/ie,fe=h.get(H);(!fe||Math.abs(fe[0]-he)>.01||Math.abs(fe[1]-ae)>.01)&&(h.set(H,[he,ae]),R=!0)}if(!R)break}const y=new Map;for(const[$]of s)y.set($,0);for(const $ of u)for(const R of $.ends){const H=y.get(R);H!==void 0&&y.set(R,H+1)}for(const[$,R]of s)t.junctions.set($,{junction:R,world:h.get($)??[0,0],degree:y.get($)??0});const v=new m2;for(const $ of u)v.add($.ends[0]),v.add($.ends[1]),v.union($.ends[0],$.ends[1]);for(const[,$]of v.groups()){const R=mE($);t.nodes.set(R,{id:R,terminals:$});for(const H of $)t.terminalToNode.set(H,R)}for(const $ of t.elements.values()){const R=t.elementToTerminals.get($.element.id)??[];if(R.length===0)continue;R.some(V=>t.terminalToNode.has(V))||t.diagnostics.push({code:"W001",severity:"warning",message:Ae("compile.elementUnconnected",{id:$.element.id})})}for(const $ of t.buses.keys())t.terminalToNode.has($)||t.diagnostics.push({code:"W001",severity:"warning",message:Ae("compile.elementUnconnected",{id:$})});for(const $ of t.junctions.keys())t.terminalToNode.has($)||t.diagnostics.push({code:"W001",severity:"warning",message:Ae("compile.elementUnconnected",{id:$})});for(const $ of u){if($.path&&$.path.length>=2){const H=$.path,V=H.length>=2?H[1]:null,F=H.length>=2?H[H.length-2]:null,K=li($.ends[0],V,t),ie=li($.ends[1],F,t);if(K&&ie){const he=[[K[0],K[1]],...H.slice(1,-1).map(fe=>[fe[0],fe[1]]),[ie[0],ie[1]]],ae=Qs(he);if(ae.length>=2){t.wireRenders.set($.id,{wireId:$.id,path:ae,userEdited:!0,...$.label?{label:$.label}:{},...$.color?{color:$.color}:{}});continue}}}const R=uE($,t);R&&t.wireRenders.set($.id,{...R,...$.label?{label:$.label}:{},...$.color?{color:$.color}:{}})}return t}const hE={earth:"GND",breaker:"QF",disconnector:"QS","earthing-switch":"QE","load-switch":"QL",fuse:"FU","transformer-2w":"T","transformer-3w":"T",autotransformer:"AT",ct:"CT",pt:"PT",generator:"G","sync-motor":"M","async-motor":"M","grid-source":"L",load:"L",battery:"BAT","shunt-reactor":"LR","series-reactor":"LR","shunt-capacitor":"C",arrester:"FBL","grounding-transformer":"TG",ngr:"NGR","arc-suppression-coil":"ASC",pv:"PV","wind-turbine":"WT",rectifier:"RT",inverter:"INV","converter-bidir":"PCS"},di="B",ui="J";function pr(e){return new Set([...e.elements.map(t=>t.id),...(e.buses??[]).map(t=>t.id),...(e.junctions??[]).map(t=>t.id)])}function rn(e,t){const n=hE[t]??t,o=pr(e);let r=1;for(;o.has(`${n}${r}`);)r++;return`${n}${r}`}function qo(e){const t=pr(e);let n=1;for(;t.has(`${di}${n}`);)n++;return`${di}${n}`}function Go(e){const t=pr(e);let n=1;for(;t.has(`${ui}${n}`);)n++;return`${ui}${n}`}function Yt(e){const t=new Set((e.annotations??[]).map(o=>o.id));let n=1;for(;t.has(`a${n}`);)n++;return`a${n}`}function bt(e,t){const n=[e,t].sort(),o=`${n[0]}|${n[1]}`;let r=2166136261;for(let i=0;i<o.length;i++)r^=o.charCodeAt(i),r=Math.imul(r,16777619);return`w_${(r>>>0).toString(36)}`}function xt(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}function fE(e,t){if(!e||e.length===0||t.size===0)return e;let n=!1;const o=e.map(r=>{if(!r.path||r.path.length<=2)return r;const i=t.get(xt(r.ends[0])),s=t.get(xt(r.ends[1]));return!i||!s||i[0]!==s[0]||i[1]!==s[1]||i[0]===0&&i[1]===0?r:(n=!0,{...r,path:r.path.map(([l,a])=>[l+i[0],a+i[1]])})});return n?o:e}function _o(e,t,n){if(n.length===0)return n;const o=new Set(n.map(l=>l.id)),r=new Set(t.map(l=>l.id)),i=new Set;for(const l of e)if(!r.has(l.id))for(const a of l.ends)o.has(a)&&i.add(a);if(i.size===0)return n;const s=new Set;for(const l of t)for(const a of l.ends)i.has(a)&&s.add(a);return n.filter(l=>!i.has(l.id)||s.has(l.id))}const gE=["none","warn","alarm","fault"],mi={good:0,stale:1,bad:2},pi=new Set;function bE(e,t,n){const o=(e==null?void 0:e.type)??"pass";switch(o){case"pass":return{ok:!0,out:t};case"discrete":{const r=e;for(const i of r.cases??[])if(i.when===t)return{ok:!0,out:i.out};return"default"in r?{ok:!0,out:r.default}:{ok:!1}}default:{const r=`${n.target}\0${n.prop}\0${o}`;return pi.has(r)||(pi.add(r),console.warn(`[sldeditor] binding ${n.target}.${n.prop}: unknown mapping type "${o}" — skipped`)),{ok:!1}}}}function yE(e,t,n){switch(t){case"visible":e.visible=!!n;return;case"label.text":n!=null&&(e.labelText=String(n));return;case"alarm":typeof n=="string"&&gE.includes(n)&&(e.alarm=n);return;case"value":e.value=n;return;case"badge":n!=null&&n!==""&&(e.badge=String(n));return;default:t.startsWith("state.")&&((e.state??(e.state={}))[t.slice(6)]=n)}}function p2(e,t){var o;const n={};for(const r of e.bindings??[]){const i=n[o=r.target]??(n[o]={quality:"unbound"}),s=t.get(r.tag);if(s===void 0)continue;const l=s.q??"good";if((i.quality==="unbound"||mi[l]>mi[i.quality])&&(i.quality=l),l==="bad")continue;const a=bE(r.mapping,s.v,r);a.ok&&yE(i,r.prop,a.out)}return n}function xE(e,t){return(e.bindings??[]).filter(n=>n.target===t)}function wE(e,t){const n=e.bindings??[],o=n.findIndex(i=>i.target===t.target&&i.prop===t.prop),r=o<0?[...n,t]:n.map((i,s)=>s===o?t:i);return{...e,bindings:r}}function vE(e,t,n){const o=e.bindings;if(!o||o.length===0)return e;const r=o.filter(i=>!(i.target===t&&(n===void 0||i.prop===n)));return r.length===o.length?e:h2(e,r)}function kE(e,t){const n=e.bindings;if(!n||n.length===0)return e;const o=n.filter(r=>!t.has(r.target));return o.length===n.length?e:h2(e,o)}function h2(e,t){if(t.length>0)return{...e,bindings:t};const n={...e};return delete n.bindings,n}const hi={version:"1",elements:[]},fi=100,Co=20;function SE(){if(typeof window>"u")return"select";try{return window.matchMedia("(pointer: coarse)").matches?"pan":"select"}catch{return"select"}}const f2=(e,t)=>({diagram:hi,internal:Ye(hi),fileSession:null,activeTool:SE(),placeKind:null,lastPlaceKind:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,busbarDrawStart:null,cursorSvg:null,selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,editingElement:null,readOnly:!1,gestureBase:null,past:[],future:[],clipboard:null,clipboardPasteIndex:0,setDiagram:n=>e({diagram:n,internal:Ye(n),past:[],future:[],selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,gestureBase:null,editingElement:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null}),setFileSession:n=>e({fileSession:n}),setReadOnly:n=>e({readOnly:n}),loadDiagramFromFile:(n,o)=>e({diagram:n,internal:Ye(n),fileSession:o,past:[],future:[],selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,gestureBase:null,editingElement:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null}),dispatch:n=>{const{diagram:o,past:r}=t(),i=n(o);if(i===o)return;const s=r.length>=fi?r.slice(1):r;e({diagram:i,internal:Ye(i),past:[...s,o],future:[],annotationPreview:null})},undo:()=>{const{past:n,future:o,diagram:r}=t();if(n.length===0)return;const i=n[n.length-1];e({diagram:i,internal:Ye(i),past:n.slice(0,-1),future:[...o,r],wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,annotationPreview:null})},redo:()=>{const{past:n,future:o,diagram:r}=t();if(o.length===0)return;const i=o[o.length-1];e({diagram:i,internal:Ye(i),past:[...n,r],future:o.slice(0,-1),wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,annotationPreview:null})},setActiveTool:(n,o)=>{const r=t();let i;(o==null?void 0:o.placeKind)!==void 0?i=o.placeKind:n==="place"?i=r.placeKind??r.lastPlaceKind:i=null,e({activeTool:n,placeKind:i,lastPlaceKind:i??r.lastPlaceKind,wireFromTerminal:n==="wire"?r.wireFromTerminal:null,wireDragFrom:n==="wire"?r.wireDragFrom:null,placeFromTerminal:n==="place"?r.placeFromTerminal:null,annotationDraft:null})},setPlaceKind:n=>e(o=>({placeKind:n,lastPlaceKind:n??o.lastPlaceKind})),setWireFromTerminal:n=>e({wireFromTerminal:n}),setWireDragFrom:n=>e({wireDragFrom:n}),setPlaceFromTerminal:n=>e({placeFromTerminal:n}),setBusbarDrawStart:n=>e({busbarDrawStart:n}),setCursorSvg:n=>e({cursorSvg:n}),setSelection:(n,o)=>e({selection:gi(n),selectedWire:null,selectedNode:null,selectedAnnotations:o?gi(o):n.length?[]:t().selectedAnnotations}),toggleInSelection:n=>{const o=t().selection;e({selection:o.includes(n)?o.filter(r=>r!==n):[...o,n],selectedWire:null,selectedNode:null})},clearSelection:()=>e({selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,editingElement:null}),setSelectedWire:n=>e({selectedWire:n,selection:n?[]:t().selection,selectedNode:null,selectedAnnotations:n?[]:t().selectedAnnotations}),setSelectedNode:n=>e({selectedNode:n,selection:n?[]:t().selection,selectedWire:null,selectedAnnotations:n?[]:t().selectedAnnotations}),setSelectedAnnotation:n=>e({selectedAnnotations:n?[n]:[],selection:n?[]:t().selection,selectedWire:n?null:t().selectedWire,selectedNode:n?null:t().selectedNode,editingAnnotation:n?t().editingAnnotation:null,editingCell:n?t().editingCell:null}),toggleAnnotationInSelection:n=>{const o=t().selectedAnnotations;e({selectedAnnotations:o.includes(n)?o.filter(r=>r!==n):[...o,n],selectedWire:null,selectedNode:null,editingAnnotation:null,editingCell:null})},setEditingAnnotation:n=>e({editingAnnotation:n,selectedAnnotations:n?[n]:t().selectedAnnotations,editingElement:n?null:t().editingElement,editingCell:null}),setEditingCell:n=>e({editingCell:n}),setAnnotationDraft:n=>e({annotationDraft:n}),setAnnotationPreview:n=>e({annotationPreview:n}),setEditingElement:n=>e({editingElement:n,selection:n?[n]:t().selection,editingAnnotation:n?null:t().editingAnnotation,selectedAnnotations:n?[]:t().selectedAnnotations,selectedWire:n?null:t().selectedWire,selectedNode:n?null:t().selectedNode}),copySelection:()=>{var f;const{selection:n,selectedAnnotations:o,diagram:r,internal:i}=t();if(n.length===0&&o.length===0)return;const s=new Set(o),l=(r.annotations??[]).filter(b=>s.has(b.id)).map(b=>structuredClone(b));if(n.length===0){if(l.length===0)return;e({clipboard:{elements:[],buses:[],junctions:[],placements:{},busLayouts:{},wires:[],annotations:l},clipboardPasteIndex:0});return}const a=new Set(n),d=r.elements.filter(b=>a.has(b.id)).map(b=>structuredClone(b)),u=(r.buses??[]).filter(b=>a.has(b.id)).map(b=>structuredClone(b)),m=(r.junctions??[]).filter(b=>a.has(b.id)).map(b=>{var v;const y=structuredClone(b);if(!y.layout){const j=(v=i.junctions.get(b.id))==null?void 0:v.world;j&&(y.layout={at:[j[0],j[1]]})}return y}),p={};for(const b of n)if(a.has(b)&&!i.buses.has(b)){const y=(f=r.layout)==null?void 0:f[b];if(y){p[b]=structuredClone(y);continue}const v=i.layout.get(b);v&&(p[b]=St(v))}const h={};for(const b of n){const y=i.buses.get(b);y&&(h[b]=_t(y.geometry))}const g=(r.wires??[]).filter(b=>b.ends.every(y=>a.has(xt(y)))).map(b=>structuredClone(b));e({clipboard:{elements:d,buses:u,junctions:m,placements:p,busLayouts:h,wires:g,annotations:l},clipboardPasteIndex:0})},cutSelection:()=>{const{selection:n,selectedAnnotations:o}=t();n.length===0&&o.length===0||(t().copySelection(),t().deleteSelection())},pasteClipboard:()=>{const{clipboard:n,clipboardPasteIndex:o,diagram:r}=t();if(!n)return;if(n.elements.length===0&&n.buses.length===0&&n.junctions.length===0){const p=n.annotations??[];if(p.length===0)return;const h=o+1,g=Co*h,f=[];t().dispatch(b=>{let y=b;for(const v of p){const j=Yt(y);f.push(j);const S={...structuredClone(v),id:j,at:[v.at[0]+g,v.at[1]+g]};y={...y,annotations:[...y.annotations??[],S]}}return y}),f.length&&e({selectedAnnotations:f,selection:[],selectedWire:null,selectedNode:null,clipboardPasteIndex:h});return}const i=o+1,s=Co*i,l=Co*i,a=new Map;let d=r;for(const p of n.elements){const h=rn(d,p.kind);a.set(p.id,h),d={...d,elements:[...d.elements,{id:h,kind:p.kind}]}}for(const p of n.buses){const h=qo(d);a.set(p.id,h),d={...d,buses:[...d.buses??[],{id:h}]}}for(const p of n.junctions){const h=Go(d);a.set(p.id,h),d={...d,junctions:[...d.junctions??[],{id:h}]}}const u=[];for(const p of n.annotations??[]){const h=Yt(d),g={...structuredClone(p),id:h,at:[p.at[0]+s,p.at[1]+l]};u.push(g),d={...d,annotations:[...d.annotations??[],g]}}const m=p=>{const h=p.indexOf("."),g=h<0?p:p.slice(0,h),f=a.get(g);return f?h<0?f:`${f}${p.slice(h)}`:p};t().dispatch(p=>{const h=n.elements.map(j=>{const S=structuredClone(j);return S.id=a.get(j.id),S}),g=n.buses.map(j=>{const S=structuredClone(j);S.id=a.get(j.id);const N=n.busLayouts[j.id];return N&&(S.layout={...N,at:[N.at[0]+s,N.at[1]+l]}),S}),f=n.junctions.map(j=>{const S=structuredClone(j);return S.id=a.get(j.id),S.layout&&(S.layout={at:[S.layout.at[0]+s,S.layout.at[1]+l]}),S}),b={...p.layout??{}};for(const[j,S]of a){const N=n.placements[j];N&&(b[S]={...N,at:[N.at[0]+s,N.at[1]+l]})}const y=n.wires.map(j=>{const S=[m(j.ends[0]),m(j.ends[1])];return{id:bt(S[0],S[1]),ends:S,...j.label?{label:j.label}:{}}}),v=bi(p.wires??[],y);return{...p,elements:[...p.elements,...h],buses:g.length?[...p.buses??[],...g]:p.buses,junctions:f.length?[...p.junctions??[],...f]:p.junctions,wires:v.length?v:void 0,layout:Object.keys(b).length?b:void 0,annotations:u.length?[...p.annotations??[],...u]:p.annotations}}),e({selection:Array.from(a.values()),selectedAnnotations:u.map(p=>p.id),clipboardPasteIndex:i})},autoArrangeAll:()=>{t().dispatch(n=>{var a;const o=n.layout&&Object.keys(n.layout).length>0,r=(n.buses??[]).some(d=>d.layout);if(!o&&!r)return n;const{layout:i,...s}=n,l=(a=n.buses)==null?void 0:a.map(d=>{const{layout:u,...m}=d;return m});return{...s,buses:l}})},autoArrangeSelection:()=>{const{selection:n}=t();if(n.length===0)return;const o=new Set(n);t().dispatch(r=>{let i=!1,s=r.layout;if(s){const a={};for(const[d,u]of Object.entries(s)){if(o.has(d)){i=!0;continue}a[d]=u}i&&(s=Object.keys(a).length?a:void 0)}let l=r.buses;if(l){const a=l.map(d=>{if(o.has(d.id)&&d.layout){i=!0;const{layout:u,...m}=d;return m}return d});i&&(l=a)}return i?{...r,layout:s,buses:l}:r})},fillUnplacedAll:()=>{const n=t().internal;t().dispatch(o=>{const r=o.layout??{},i={};for(const a of o.elements){if(r[a.id])continue;const d=n.layout.get(a.id);d&&(i[a.id]=St(d))}const s=[];if((o.buses??[]).forEach((a,d)=>{a.layout||n.buses.has(a.id)&&s.push({idx:d,bus:a})}),Object.keys(i).length===0&&s.length===0)return o;let l=o.buses;return s.length>0&&l&&(l=l.map(a=>{const d=n.buses.get(a.id);return!a.layout&&d?{...a,layout:_t(d.geometry)}:a})),{...o,layout:{...r,...i},buses:l}})},fillUnplacedSelection:()=>{const{selection:n,internal:o}=t();n.length!==0&&t().dispatch(r=>{var d;const i=r.layout??{},s={},l=new Map;for(const u of n)if(o.buses.has(u)){const m=o.buses.get(u);(d=r.buses)!=null&&d.find(p=>p.id===u&&p.layout)||l.set(u,_t(m.geometry))}else{if(i[u])continue;const m=o.layout.get(u);m&&(s[u]=St(m))}if(Object.keys(s).length===0&&l.size===0)return r;let a=r.buses;return l.size>0&&a&&(a=a.map(u=>l.has(u.id)?{...u,layout:l.get(u.id)}:u)),{...r,layout:{...i,...s},buses:a}})},moveElements:(n,o)=>{if(n.size===0&&!(o!=null&&o.size))return;const r=t().internal;t().dispatch(i=>{const s={...i.layout??{}},l=new Map,a=new Map;for(const[h,g]of n){if(r.buses.has(h)){l.set(h,g);continue}if(r.junctions.has(h)){a.set(h,g);continue}const f=r.layout.get(h),b=s[h]??(f?St(f):{at:[0,0]});s[h]={...b,at:[b.at[0]+g[0],b.at[1]+g[1]]}}let d=i.buses;l.size>0&&(d=(i.buses??[]).map(h=>{const g=l.get(h.id);if(!g)return h;const f=h.layout??_t(r.buses.get(h.id).geometry);return{...h,layout:{...f,at:[f.at[0]+g[0],f.at[1]+g[1]]}}}));let u=i.junctions;a.size>0&&(u=(i.junctions??[]).map(h=>{var b,y;const g=a.get(h.id);if(!g)return h;const f=((b=h.layout)==null?void 0:b.at)??((y=r.junctions.get(h.id))==null?void 0:y.world)??[0,0];return{...h,layout:{at:[f[0]+g[0],f[1]+g[1]]}}}));let m=i.annotations;o!=null&&o.size&&m&&(m=m.map(h=>{const g=o.get(h.id);return g?{...h,at:[h.at[0]+g[0],h.at[1]+g[1]]}:h}));const p=fE(i.wires,n);return{...i,layout:s,buses:d,junctions:u,wires:p,annotations:m}})},deleteSelection:()=>{const{selection:n,selectedAnnotations:o}=t();if(n.length===0&&o.length===0)return;const r=new Set(n),i=new Set(o);t().dispatch(s=>{const l=s.elements.filter(g=>!r.has(g.id)),a=(s.buses??[]).filter(g=>!r.has(g.id)),d=(s.junctions??[]).filter(g=>!r.has(g.id)),u=(s.wires??[]).filter(g=>!r.has(xt(g.ends[0]))&&!r.has(xt(g.ends[1]))),m=i.size?(s.annotations??[]).filter(g=>!i.has(g.id)):s.annotations,p=_o(s.wires??[],u,d),h=s.layout?Object.fromEntries(Object.entries(s.layout).filter(([g])=>!r.has(g))):void 0;return kE({...s,elements:l,buses:a.length?a:void 0,junctions:p.length?p:void 0,wires:u.length?u:void 0,layout:h&&Object.keys(h).length?h:void 0,annotations:m!=null&&m.length?m:void 0},r)}),e({selection:[],selectedAnnotations:[],editingAnnotation:null,editingCell:null})},deleteSelectedWire:()=>{const{selectedWire:n,internal:o}=t();if(!n)return;const r=(t().diagram.wires??[]).find(s=>s.id===n),i=new Set;if(r)for(const s of r.ends){const l=s.indexOf(".");l>0&&i.add(s.slice(0,l))}t().dispatch(s=>{const l=s.wires??[],a=l.filter(m=>m.id!==n);if(a.length===l.length)return s;const d={...s.layout??{}};for(const m of i){if(d[m])continue;const p=o.layout.get(m);p&&(d[m]=St(p))}const u=_o(l,a,s.junctions??[]);return{...s,wires:a.length?a:void 0,junctions:u.length?u:void 0,layout:Object.keys(d).length?d:void 0}}),e({selectedWire:null})},deleteSelectedNode:()=>{const{selectedNode:n,internal:o}=t();if(!n)return;const r=o.nodes.get(n);if(!r)return;const i=new Set(r.terminals),s=new Set;for(const l of r.terminals){const a=l.indexOf(".");a>0&&s.add(l.slice(0,a))}t().dispatch(l=>{const a={...l.layout??{}};for(const p of s){if(a[p])continue;const h=o.layout.get(p);h&&(a[p]=St(h))}const d=l.wires??[],u=d.filter(p=>!i.has(p.ends[0])&&!i.has(p.ends[1])),m=_o(d,u,l.junctions??[]);return{...l,wires:u.length?u:void 0,junctions:m.length?m:void 0,layout:Object.keys(a).length?a:void 0}}),e({selectedNode:null})},rotateSelection:n=>{const{selection:o,internal:r}=t();o.length!==0&&t().dispatch(i=>{var d,u,m,p;const s={...i.layout??{}},l=new Map;for(const h of o){if(r.junctions.has(h))continue;if(r.buses.has(h)){const b=r.buses.get(h),v=(((((m=(u=(d=i.buses)==null?void 0:d.find(j=>j.id===h))==null?void 0:u.layout)==null?void 0:m.rot)??b.geometry.rot??0)+n)%360+360)%360;l.set(h,v);continue}const g=s[h]??{at:((p=r.layout.get(h))==null?void 0:p.at)??[0,0]},f=(((g.rot??0)+n)%360+360)%360;s[h]={...g,rot:f}}let a=i.buses;return l.size>0&&(a=(i.buses??[]).map(h=>{if(!l.has(h.id))return h;const g=h.layout??_t(r.buses.get(h.id).geometry);return{...h,layout:{...g,rot:l.get(h.id)}}})),{...i,layout:s,buses:a}})},mirrorSelection:()=>{const{selection:n,internal:o}=t();n.length!==0&&t().dispatch(r=>{var s;const i={...r.layout??{}};for(const l of n){if(o.buses.has(l)||o.junctions.has(l))continue;const a=i[l]??{at:((s=o.layout.get(l))==null?void 0:s.at)??[0,0]};i[l]={...a,mirror:!(a.mirror??!1)}}return{...r,layout:i}})},setSelectionColor:n=>{var f,b,y;const{selection:o,selectedAnnotations:r,selectedWire:i}=t();if(o.length===0&&r.length===0&&i==null)return;const s=new Set(o),l=new Set(r),a=v=>{if(n==="default"){if(v.color===void 0)return v;const{color:j,...S}=v;return S}return v.color===n?v:{...v,color:n}},d=t().diagram,u=s.size?d.elements.map(v=>s.has(v.id)?a(v):v):d.elements,m=s.size?(f=d.buses)==null?void 0:f.map(v=>s.has(v.id)?a(v):v):d.buses,p=i?(b=d.wires)==null?void 0:b.map(v=>v.id===i?a(v):v):d.wires,h=l.size?(y=d.annotations)==null?void 0:y.map(v=>l.has(v.id)?a(v):v):d.annotations,g=(v,j)=>v===j||(v==null?void 0:v.length)===(j==null?void 0:j.length)&&(v??[]).every((S,N)=>S===(j==null?void 0:j[N]));g(u,d.elements)&&g(m,d.buses)&&g(p,d.wires)&&g(h,d.annotations)||t().dispatch(v=>({...v,elements:u,buses:m,wires:p,annotations:h}))},resetSelectionLabelOffset:()=>{const n=new Set(t().selection);n.size===0||!t().diagram.elements.some(r=>n.has(r.id)&&r.labelOffset!==void 0)||t().dispatch(r=>({...r,elements:r.elements.map(i=>{if(!n.has(i.id)||i.labelOffset===void 0)return i;const{labelOffset:s,...l}=i;return l})}))},addElement:(n,o,r)=>{if(n==="busbar")return t().addBus(o,320);const i=rn(t().diagram,n);return t().dispatch(s=>{const l={id:i,kind:n,...r??{}};return{...s,elements:[...s.elements,l],layout:{...s.layout??{},[i]:{at:o}}}}),e({selection:[i]}),i},addBus:(n,o,r)=>{const i=qo(t().diagram);return t().dispatch(s=>{const l={id:i,layout:r!==void 0?{at:n,span:o,rot:r}:{at:n,span:o}};return{...s,buses:[...s.buses??[],l]}}),e({selection:[i]}),i},addJunction:n=>{const o=Go(t().diagram);return t().dispatch(r=>{const i={id:o,layout:{at:n}};return{...r,junctions:[...r.junctions??[],i]}}),e({selection:[o]}),o},updateJunction:(n,o)=>{t().dispatch(r=>({...r,junctions:(r.junctions??[]).map(i=>i.id===n?{...i,...o}:i)}))},addWire:(n,o)=>{if(n===o)return;const r=bt(n,o);t().dispatch(i=>{const s=i.wires??[];return s.some(l=>l.id===r)?i:{...i,wires:[...s,{id:r,ends:[n,o]}]}})},connectWire:(n,o)=>{t().dispatch(r=>{let i=r;const s=new Set([...i.elements.map(g=>g.id),...(i.buses??[]).map(g=>g.id),...(i.junctions??[]).map(g=>g.id)]),l=()=>{let g=1;for(;s.has(`J${g}`);)g++;const f=`J${g}`;return s.add(f),f},a=g=>{const f=l();return i={...i,junctions:[...i.junctions??[],{id:f,layout:{at:g}}]},f},d=g=>{if("end"in g)return g.end;if("junctionAt"in g)return a(g.junctionAt);const f=(i.wires??[]).find(j=>j.id===g.onWire),b=a(g.at);if(!f)return b;const y=(i.wires??[]).filter(j=>j.id!==g.onWire),v=(j,S)=>({id:bt(j,S),ends:[j,S],...f.label?{label:f.label}:{}});return i={...i,wires:bi(y,[v(f.ends[0],b),v(b,f.ends[1])])},b},u=d(n),m=d(o);if(u===null||m===null||u===m)return i;const p=bt(u,m),h=i.wires??[];return h.some(g=>g.id===p)?i:{...i,wires:[...h,{id:p,ends:[u,m]}]}})},updateWirePath:(n,o)=>{t().dispatch(r=>{const i=r.wires??[];if(!i.some(d=>d.id===n))return r;const s=o&&o.length>=2?Qs(o):null,l=s&&s.length>=2?s:null,a=i.map(d=>{if(d.id!==n)return d;if(l)return{...d,path:l};const{path:u,...m}=d;return m});return{...r,wires:a}})},resetWirePath:n=>{t().updateWirePath(n,null)},updateWire:(n,o)=>{t().dispatch(r=>{const i=r.wires??[];return i.some(s=>s.id===n)?{...r,wires:i.map(s=>s.id===n?{...s,...o}:s)}:r})},updateElement:(n,o)=>{t().dispatch(r=>({...r,elements:r.elements.map(i=>i.id===n?{...i,...o}:i)}))},updatePlacement:(n,o)=>{t().dispatch(yi(n,o,()=>t().internal))},previewPlacement:(n,o)=>{const{diagram:r,gestureBase:i}=t(),s=yi(n,o,()=>t().internal)(r);s!==r&&e({diagram:s,internal:Ye(s),gestureBase:i??r})},endGesture:n=>{const{diagram:o,gestureBase:r,past:i}=t();if(!r)return;if(!n||o===r){e({diagram:r,internal:Ye(r),gestureBase:null});return}const s=i.length>=fi?i.slice(1):i;e({past:[...s,r],future:[],gestureBase:null})},updateBus:(n,o)=>{t().dispatch(r=>{const i=(r.buses??[]).map(s=>{if(s.id!==n)return s;const l=t().internal,a=s.layout??(l.buses.has(n)?_t(l.buses.get(n).geometry):{at:[0,0],span:320}),d={at:o.at??a.at,span:o.span??a.span,...o.rot!==void 0?{rot:o.rot}:a.rot?{rot:a.rot}:{}};return{...s,layout:d}});return{...r,buses:i}})},addAnnotation:(n,o="")=>{const r=Yt(t().diagram);return t().dispatch(i=>{const s={id:r,at:n,text:o};return{...i,annotations:[...i.annotations??[],s]}}),r},insertAnnotation:n=>{const o=Yt(t().diagram);return t().dispatch(r=>({...r,annotations:[...r.annotations??[],{...n,id:o}]})),o},updateAnnotation:(n,o)=>{t().dispatch(r=>{const i=r.annotations??[];let s=!1;const l=i.map(a=>a.id!==n?a:(s=!0,{...a,...o,id:a.id}));return s?{...r,annotations:l}:r})},removeCustomKind:n=>{const o=t().diagram,r=o.elements.filter(i=>i.kind===n).length;return r>0?r:((o.customKinds??[]).some(i=>i.id===n)&&t().dispatch(i=>{const s=(i.customKinds??[]).filter(l=>l.id!==n);return{...i,customKinds:s.length?s:void 0}},"remove custom kind"),0)},deleteAnnotation:n=>{var o;t().dispatch(r=>{const i=r.annotations??[],s=i.filter(l=>l.id!==n);return s.length===i.length?r:{...r,annotations:s.length?s:void 0}}),t().selectedAnnotations.includes(n)&&e({selectedAnnotations:t().selectedAnnotations.filter(r=>r!==n),editingAnnotation:null,editingCell:null}),((o=t().annotationPreview)==null?void 0:o.id)===n&&e({annotationPreview:null})}}),x=mn()(AC(f2,{name:"ole-editor",version:2,storage:Zs(()=>({getItem:e=>localStorage.getItem(e),setItem:(e,t)=>{x.getState().readOnly||localStorage.setItem(e,t)},removeItem:e=>localStorage.removeItem(e)})),partialize:e=>({diagram:e.diagram,activeTool:e.activeTool,placeKind:e.placeKind,lastPlaceKind:e.lastPlaceKind}),onRehydrateStorage:()=>e=>{e!=null&&e.diagram&&(e.internal=Ye(e.diagram))}}));function g2(){return Vs()(f2)}function Pt(e){return e.selectedAnnotations.length===1&&e.selection.length===0?e.selectedAnnotations[0]:null}function gi(e){return Array.from(new Set(e))}function bi(e,t){const n=new Set(e.map(r=>r.id)),o=e.slice();for(const r of t)n.has(r.id)||(n.add(r.id),o.push(r));return o}function St(e){return{at:[e.at[0],e.at[1]],...e.rot?{rot:e.rot}:{},...e.mirror?{mirror:e.mirror}:{},...b2(e.scale)}}function yi(e,t,n){return o=>{var s;const r=((s=o.layout)==null?void 0:s[e])??n().layout.get(e),i={at:t.at??(r==null?void 0:r.at)??[0,0],...t.rot!==void 0?{rot:t.rot}:r!=null&&r.rot?{rot:r.rot}:{},...t.mirror!==void 0?{mirror:t.mirror}:r!=null&&r.mirror?{mirror:r.mirror}:{},...b2(t.scale!==void 0?t.scale:r==null?void 0:r.scale)};return{...o,layout:{...o.layout??{},[e]:i}}}}function b2(e){if(e===void 0)return{};const t=Ho(e);return t===1?{}:{scale:t}}function _t(e){return{at:[e.at[0],e.at[1]],span:e.span,...e.rot?{rot:e.rot}:{}}}const y2=C.createContext(null);function x2(){return C.useContext(y2)??x}function le(e){return Ks(x2(),e)}let w2=null;function xi(e){w2=e}function Ke(){return w2}const Gn=10;function v2(){if(typeof document>"u")return!0;const e=document.querySelector(".ole-canvas-root");return!!e&&!e.classList.contains("hide-grid")}function de(e){return v2()?Math.round(e/Gn)*Gn:e}function Fe(e){return[de(e[0]),de(e[1])]}const _E=30,CE=144;function k2(e,t){const n=vt[e],o=x.getState(),r=o.diagram;if(!n||e==="busbar")return{newElementId:o.addElement(e,t),attachedToBus:!1};const i=jE(r,t);if(!i){const f=S2(n),b=f?[de(t[0])-f.x,de(t[1])-f.y]:[de(t[0]),de(t[1])];return{newElementId:o.addElement(e,b),attachedToBus:!1}}const{busId:s,busAt:l,axis:a}=i,d=AE(n,a),u=rn(r,e),m=n.terminals.find(f=>f.id===d),p=a==="x"?t[0]:l[0],h=a==="y"?t[1]:l[1],g=m?[de(p)-m.x,de(h)-m.y]:[de(t[0]),de(t[1])];return o.dispatch(f=>{const b={id:u,kind:e},y={at:g},v=`${u}.${d}`,j={id:bt(s,v),ends:[s,v]};return{...f,elements:[...f.elements,b],wires:[...f.wires??[],j],layout:{...f.layout??{},[u]:y}}}),o.setSelection([u]),{newElementId:u,attachedToBus:!0}}function jE(e,t){const n=x.getState().internal;let o=null;for(const r of e.buses??[]){const i=n.buses.get(r.id);if(!i)continue;const{axis:s,at:l,span:a}=i.geometry;let d;if(s==="x"){const u=l[0]-a/2,m=l[0]+a/2,p=t[0]<u?u-t[0]:t[0]>m?t[0]-m:0,h=Math.abs(t[1]-l[1]);d=Math.sqrt(p*p+h*h)}else{const u=l[1]-a/2,m=l[1]+a/2,p=t[1]<u?u-t[1]:t[1]>m?t[1]-m:0,h=Math.abs(t[0]-l[0]);d=Math.sqrt(h*h+p*p)}d<=_E&&(!o||d<o.dist)&&(o={busId:r.id,busAt:[l[0],l[1]],axis:s,dist:d})}return o?{busId:o.busId,busAt:o.busAt,axis:o.axis}:null}function AE(e,t){return e.terminals.length===0?"t":[...e.terminals].sort((o,r)=>t==="x"?o.y-r.y:o.x-r.x)[0].id}function S2(e){return!e||e.stretchable||e.terminals.length===0?null:[...e.terminals].sort((n,o)=>n.y-o.y)[0]}function _2(e,t){const n=x.getState().internal;if(!e.includes(".")&&n.buses.has(e)){const r=n.buses.get(e),{axis:i,at:s,span:l}=r.geometry;if(i==="x"){const h=s[0]-l/2,g=s[0]+l/2,f=Math.max(h,Math.min(g,t[0])),b=s[1],y=t[1]>=b?"s":"n";return{ref:e,world:[f,b],orientation:y,isBus:!0,busId:e}}const a=s[1]-l/2,d=s[1]+l/2,u=Math.max(a,Math.min(d,t[1])),m=s[0],p=t[0]>=m?"e":"w";return{ref:e,world:[m,u],orientation:p,isBus:!0,busId:e}}if(!e.includes(".")&&n.junctions.has(e)){const r=n.junctions.get(e),[i,s]=r.world,l=t[0]-i,a=t[1]-s,d=Math.abs(l)>=Math.abs(a)?l>=0?"e":"w":a>=0?"s":"n";return{ref:e,world:[i,s],orientation:d,isBus:!1}}const o=n.terminals.get(e);return o?{ref:e,world:o.world,orientation:o.orientation,isBus:!1}:null}const $E={n:"s",s:"n",e:"w",w:"e"};function C2(e,t,n){if(e.terminals.length===0)return{id:"t",x:0,y:0,orientation:"n"};const o=$E[t.orientation],r=e.terminals.filter(a=>a.orientation===o),i=r.length>0?r:e.terminals;let s=i[0],l=wi(s,n,t.world);for(let a=1;a<i.length;a++){const d=i[a],u=wi(d,n,t.world);u<l&&(l=u,s=d)}return s}function wi(e,t,n){const o=t[0]+e.x-n[0],r=t[1]+e.y-n[1];return o*o+r*r}function EE(e,t,n){const o=vt[e],r=x.getState(),i=r.diagram;if(!o)return null;const s=_2(t,n);if(!s)return null;const l=n[0]-s.world[0],a=n[1]-s.world[1],d=l*l+a*a<=CE,u=[de(n[0]),de(n[1])],m=C2(o,s,u),p=d?s.world:u,h=[de(p[0]-m.x),de(p[1]-m.y)],g=rn(i,e);return r.dispatch(f=>{const b={id:g,kind:e},y={at:h},v=`${g}.${m.id}`,j=s.isBus&&s.busId?s.busId:t,S={id:bt(j,v),ends:[j,v]};return{...f,elements:[...f.elements,b],wires:[...f.wires??[],S],layout:{...f.layout??{},[g]:y}}}),r.setSelection([g]),{newElementId:g,attachedToBus:s.isBus}}const NE=9,Ze=7,to=5,no=32;function zt(e){return typeof e!="number"||!Number.isFinite(e)?Ze:Math.min(no,Math.max(to,e))}function hn(e=Ze){return e*NE/Ze}function oo(e,t){const n=(e??"").split(/\r\n|\r|\n/).map(o=>o.trim()).filter(o=>o!=="");return n.length>0?n:t?[t]:[]}function ro(e,t){var r;if(e.element.labelHidden)return[];const n=oo(e.element.name,e.element.id);if(t!=="all"||!((r=e.libraryDef)!=null&&r.params))return n;const o=e.element.params??{};for(const i of e.libraryDef.params){if(!i.showOnCanvas)continue;const s=o[i.name];s==null||s===""||n.push(`${s}${i.unit??""}`)}return n}function io(e,t=Ze){const n=j2(e.viewBox);return n?{x:n.x+n.w+2,y:n.y+n.h/2+t/3,anchor:"start"}:{x:0,y:0,anchor:"start"}}function TE(e,t){const n=t.scale??1;let o=e.x*n,r=e.y*n;switch(t.mirror&&(o=-o),t.rot){case 90:[o,r]=[-r,o];break;case 180:[o,r]=[-o,-r];break;case 270:[o,r]=[r,-o];break}return[o+t.at[0],r+t.at[1]]}function so(e,t,n,o,r=Ze,i){const s=TE(e,n);i&&(s[0]+=i[0],s[1]+=i[1]);const l=e.anchor??"start",a=j2(t.viewBox);let d=e.x-(a?a.x+a.w/2:0),u=e.y-(a?a.y+a.h/2:0);switch(n.mirror&&(d=-d),n.rot){case 90:[d,u]=[-u,d];break;case 180:[d,u]=[-d,-u];break;case 270:[d,u]=[u,-d];break}return Math.abs(d)<1e-6&&Math.abs(u)<1e-6?{world:s,textAnchor:l,dy:0}:Math.abs(d)>=Math.abs(u)?{world:s,textAnchor:d>=0?"start":"end",dy:0}:u>0?{world:s,textAnchor:"middle",dy:r}:{world:s,textAnchor:"middle",dy:-(o-1)*hn(r)}}function Vo(e,t){let n=0;for(const o of e){const r=o.length*t*.55;r>n&&(n=r)}return Math.max(20,n)}function j2(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}const IE=8;function ao(e,t=Ze){if(e.length<2)return null;let n=-1,o=0;for(let m=0;m<e.length-1;m++){const p=Math.hypot(e[m+1][0]-e[m][0],e[m+1][1]-e[m][1]);p>o&&(o=p,n=m)}if(n<0||o<=0)return null;const[r,i]=e[n],[s,l]=e[n+1],a=(r+s)/2,d=(i+l)/2,u=IE*t/Ze;return Math.abs(s-r)>=Math.abs(l-i)?{world:[a,d-u],textAnchor:"middle"}:{world:[a+u,d+t/3],textAnchor:"start"}}const lo={default:{light:"black",dark:"#E5E7EB",aci:7},red:{light:"#C0392B",dark:"#FF6B6B",aci:1},blue:{light:"#1F6FEB",dark:"#58A6FF",aci:5},green:{light:"#197D3F",dark:"#4ADE80",aci:3},amber:{light:"#B45309",dark:"#FBBF24",aci:30},gray:{light:"#6B7280",dark:"#9CA3AF",aci:8}},hr=["default","red","amber","green","blue","gray"];function fr(e){return e!==void 0&&e in lo}function Re(e){return fr(e)&&e!=="default"?`ole-ink-${e}`:void 0}function Ve(e){return fr(e)?lo[e].light:"black"}function $t(e){return fr(e)&&e!=="default"?lo[e].aci:void 0}const Ko={props:{},units:{}},A2=C.createContext(Ko);function Mt(){return C.useContext(A2)}const vi={none:0,warn:1,alarm:2,fault:3};function PE(e,t){const n=e??"none",o=t??"none";return vi[n]>=vi[o]?n:o}function gr(e){return e!=null&&e.alarm&&e.alarm!=="none"?e.alarm:void 0}function $2(e){return(e==null?void 0:e.quality)==="bad"||(e==null?void 0:e.quality)==="stale"?e.quality:void 0}function E2(){const e=le(a=>a.internal.elements),t=le(a=>a.internal.layout),n=le(a=>a.internal.wireRenders),o=le(a=>{var d;return((d=a.diagram.meta)==null?void 0:d.labelMode)??"all"}),r=le(a=>{var d;return zt((d=a.diagram.meta)==null?void 0:d.labelFontSize)}),i=le(a=>a.editingElement),s=Mt().props,l=hn(r);return c.jsxs("g",{className:"ole-annotation-layer",pointerEvents:"none",style:{"--ole-label-font-size":`${r}px`},children:[Array.from(e.values()).map(a=>{var v;const d=t.get(a.element.id);if(!d||!a.libraryDef)return null;const u=s[a.element.id];if((u==null?void 0:u.visible)===!1)return null;const m=a.libraryDef.label??io(a.libraryDef,r),p=(u==null?void 0:u.labelText)!==void 0?oo(u.labelText,""):ro(a,o),{world:h,textAnchor:g,dy:f}=so(m,a.libraryDef,d,Math.max(1,p.length),r,a.element.labelOffset);if(i===a.element.id)return c.jsx(ME,{elementId:a.element.id,currentName:((v=a.element.name)==null?void 0:v.trim())||a.element.id,world:h,anchor:g,fontSize:r},a.element.id);if(o==="off"||p.length===0)return null;const b=Vo(p,r),y=g==="middle"?-b/2:g==="end"?-b:0;return c.jsx("g",{className:"ole-annotation ole-element-label","data-element-label":a.element.id,transform:`translate(${h[0]} ${h[1]})`,children:c.jsxs("g",{"data-element-label-body":"",children:[c.jsx("rect",{className:"ole-element-label-hit",x:y-2,y:f-r,width:b+4,height:p.length*l+r*.4}),p.map((j,S)=>c.jsx("text",{x:0,y:f+S*l,textAnchor:g,className:"ole-annotation-text",children:j},S))]})},a.element.id)}),o!=="off"&&Array.from(n.values()).map(a=>{var m;const d=(m=a.label)==null?void 0:m.trim();if(!d)return null;const u=ao(a.path,r);return u?c.jsx("text",{"data-wire-label":a.wireId,x:u.world[0],y:u.world[1],textAnchor:u.textAnchor,className:[Re(a.color),"ole-annotation-text"].filter(Boolean).join(" "),children:d},`wire-${a.wireId}`):null})]})}const jo=200,zE=9;function ME({elementId:e,currentName:t,world:n,anchor:o,fontSize:r}){const i=Math.max(zE,r),s=C.useRef(null),[l,a]=C.useState(()=>Math.max(1,t.split(`
223
- `).length));C.useEffect(()=>{const p=s.current;if(!p)return;p.focus();const h=document.createRange();h.selectNodeContents(p);const g=window.getSelection();g==null||g.removeAllRanges(),g==null||g.addRange(h)},[e]);function d(){var y;const p=x.getState(),h=p.diagram.elements.find(v=>v.id===e);if(!h){p.setEditingElement(null);return}const g=(((y=s.current)==null?void 0:y.innerText)??"").replace(/\u00a0/g," "),f=oo(g,"").join(`
224
- `),b=f===""||f===e?void 0:f;b!==h.name&&p.updateElement(e,{name:b}),p.setEditingElement(null)}function u(p){if(p.key==="Escape"||p.key==="Enter"&&(p.metaKey||p.ctrlKey)){p.preventDefault(),d();return}p.stopPropagation()}let m=n[0];return o==="middle"?m-=jo/2:o==="end"&&(m-=jo),c.jsx("foreignObject",{x:m,y:n[1]-i,width:jo,height:i*1.3*l+i,className:"ole-element-name-editor",children:c.jsx("div",{ref:s,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:d,onKeyDown:u,onInput:()=>{var p;return a(Math.max(1,(((p=s.current)==null?void 0:p.innerText)??"").split(`
225
- `).length))},onPointerDown:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),style:{fontSize:`${i}px`,fontFamily:"ui-sans-serif, system-ui, sans-serif",color:"var(--foreground)",background:"var(--canvas-bg)",outline:"1px dashed var(--selection)",padding:"0 2px",display:"inline-block",minWidth:"20px",lineHeight:1.1,textAlign:o==="middle"?"center":o==="end"?"right":"left",whiteSpace:"pre-wrap",cursor:"text"},children:t})})}const Ge=8,DE=1.25,N2="6 4",RE="1 3";function co(e){if(e==="dashed")return N2;if(e==="dotted")return RE}function Dt(e){return e??1}const T2=.05,ki=8,Cn=3,ct=4,sn=3,an=60,ln=20,Xo=16,Uo=12,Nt=10,OE=10;function LE(e,t){const n=e===""?[""]:e.split(`
226
- `);return[Math.max(20,...n.map(r=>r.length*t*.55)),n.length*t*DE]}function fn(e){return e.points.map(([t,n])=>[e.at[0]+t,e.at[1]+n])}function br(e,t){if(!t||t==="none"||e.length<2)return[];const n=[];return(t==="end"||t==="both")&&n.push(Si(e[e.length-2],e[e.length-1])),t==="both"&&n.push(Si(e[1],e[0])),n}function Si(e,t){const n=t[0]-e[0],o=t[1]-e[1],r=Math.hypot(n,o)||1,i=n/r,s=o/r,l=t[0]-i*ki,a=t[1]-s*ki,d=-s,u=i;return[t,[l+d*Cn,a+u*Cn],[l-d*Cn,a-u*Cn]]}function yr(e){const[t,n]=e.at,[o,r]=e.size;return{cx:t+o/2,cy:n+r/2,rx:o/2,ry:r/2}}function BE(e,t=48){const{cx:n,cy:o,rx:r,ry:i}=yr(e),s=[];for(let l=0;l<t;l++){const a=l/t*Math.PI*2;s.push([n+r*Math.cos(a),o+i*Math.sin(a)])}return s}function nt(e){return[Ci(e.colWidths),Ci(e.rowHeights)]}function Rt(e){return I2(e.colWidths)}function Ot(e){return I2(e.rowHeights)}function HE(e,t){const n=t[0]-e.at[0],o=t[1]-e.at[1],[r,i]=nt(e);if(n<0||o<0||n>r||o>i)return null;const s=_i(Rt(e),n),l=_i(Ot(e),o);return s===null||l===null?null:[l,s]}function _i(e,t){for(let n=0;n<e.length-1;n++)if(t>=e[n]&&t<=e[n+1])return n;return null}function I2(e){const t=[0];let n=0;for(const o of e)n+=o,t.push(n);return t}function Ci(e){return e.reduce((t,n)=>t+n,0)}function Vn(e){let t=e.current[0]-e.start[0],n=e.current[1]-e.start[1];if(e.constrain){const r=Math.max(Math.abs(t),Math.abs(n));t=Math.sign(t||1)*r,n=Math.sign(n||1)*r}return{at:[Math.min(e.start[0],e.start[0]+t),Math.min(e.start[1],e.start[1]+n)],size:[Math.abs(t),Math.abs(n)]}}function P2(e){return e.constrain?z2(e.start,e.current):e.current}function z2(e,t){const n=t[0]-e[0],o=t[1]-e[1],r=Math.hypot(n,o);if(r===0)return t;const i=Math.PI/4,s=Math.round(Math.atan2(o,n)/i)*i;return[e[0]+Math.cos(s)*r,e[1]+Math.sin(s)*r]}function M2(e){const t=Math.abs(e.current[0]-e.start[0]),n=Math.abs(e.current[1]-e.start[1]),o=Math.min(30,Math.max(1,Math.round(t/an))),r=Math.min(60,Math.max(1,Math.round(n/ln)));return{at:[Math.min(e.start[0],e.current[0]),Math.min(e.start[1],e.current[1])],cols:o,rows:r}}function D2(e,t){return{colWidths:Array.from({length:e},()=>an),rowHeights:Array.from({length:t},()=>ln),cells:Array.from({length:t},()=>Array.from({length:e},()=>""))}}function R2(e){switch(e.type){case"rect":case"ellipse":{const t=e;return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+t.size[0],maxY:t.at[1]+t.size[1]}}case"line":{const t=fn(e),n=t.map(r=>r[0]),o=t.map(r=>r[1]);return{minX:Math.min(...n),minY:Math.min(...o),maxX:Math.max(...n),maxY:Math.max(...o)}}case"table":{const t=e,[n,o]=nt(t);return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+n,maxY:t.at[1]+o}}default:{const t=e,n=t.fontSize??Ge,[o,r]=LE(t.text,n);return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+o,maxY:t.at[1]+r}}}}const Tt=Ge,Kn=1.25;function O2(){const e=le(s=>s.diagram.annotations),t=le(s=>s.selectedAnnotations),n=le(s=>s.editingAnnotation),o=le(s=>s.editingCell),r=le(s=>s.annotationPreview);if(!e||e.length===0)return null;const i=new Set(t);return c.jsx("g",{className:"ole-free-annotation-layer",children:e.map(s=>{const l=(r==null?void 0:r.id)===s.id?r:s,a=i.has(s.id);switch(Xe(l)){case"rect":return c.jsx(FE,{ann:l,isSelected:a},s.id);case"ellipse":return c.jsx(WE,{ann:l,isSelected:a},s.id);case"line":return c.jsx(qE,{ann:l,isSelected:a},s.id);case"table":return c.jsx(GE,{ann:l,isSelected:a,editingCell:n===s.id?o:null},s.id);default:return n===s.id?c.jsx(XE,{ann:l},s.id):c.jsx(KE,{ann:l,isSelected:a},s.id)}})})}function FE({ann:e,isSelected:t}){const[n,o]=e.at,[r,i]=e.size;return c.jsxs("g",{"data-annotation-id":e.id,className:gn("ole-ann ole-ann-rect",Re(e.color)),"data-selected":t?"true":void 0,children:[e.fill==="tint"&&c.jsx("rect",{className:"ole-ann-fill",x:n,y:o,width:r,height:i}),c.jsx("rect",{className:"ole-ann-shape-hit",x:n,y:o,width:r,height:i}),c.jsx("rect",{className:"ole-ann-rect-border",x:n,y:o,width:r,height:i,strokeDasharray:co(e.stroke??"dashed"),strokeWidth:Dt(e.strokeWidth)}),c.jsx(L2,{ann:e})]})}function WE({ann:e,isSelected:t}){const{cx:n,cy:o,rx:r,ry:i}=yr(e);return c.jsxs("g",{"data-annotation-id":e.id,className:gn("ole-ann ole-ann-ellipse",Re(e.color)),"data-selected":t?"true":void 0,children:[e.fill==="tint"&&c.jsx("ellipse",{className:"ole-ann-fill",cx:n,cy:o,rx:r,ry:i}),c.jsx("ellipse",{className:"ole-ann-shape-hit",cx:n,cy:o,rx:r,ry:i}),c.jsx("ellipse",{className:"ole-ann-rect-border",cx:n,cy:o,rx:r,ry:i,strokeDasharray:co(e.stroke),strokeWidth:Dt(e.strokeWidth)}),c.jsx(L2,{ann:e})]})}function L2({ann:e}){return e.label?c.jsx("text",{className:"ole-ann-label",x:e.at[0]+ct,y:e.at[1]+ct+Tt*.85,fontSize:Tt,children:e.label}):null}function gn(...e){return e.filter(Boolean).join(" ")}function qE({ann:e,isSelected:t}){const n=fn(e),o=n.map(r=>`${r[0]},${r[1]}`).join(" ");return c.jsxs("g",{"data-annotation-id":e.id,className:gn("ole-ann ole-ann-line-group",Re(e.color)),"data-selected":t?"true":void 0,children:[c.jsx("polyline",{className:"ole-ann-shape-hit",points:o}),c.jsx("polyline",{className:"ole-ann-line",points:o,strokeDasharray:co(e.stroke),strokeWidth:Dt(e.strokeWidth)}),br(n,e.arrow).map((r,i)=>c.jsx("polygon",{className:"ole-ann-arrow",points:r.map(s=>`${s[0]},${s[1]}`).join(" ")},i))]})}function GE({ann:e,isSelected:t,editingCell:n}){var h;const[o,r]=e.at,[i,s]=nt(e),l=Rt(e),a=Ot(e),d=e.fontSize??Tt;let u="";for(let g=1;g<e.colWidths.length;g++)u+=`M${o+l[g]} ${r}V${r+s}`;for(let g=1;g<e.rowHeights.length;g++)u+=`M${o} ${r+a[g]}H${o+i}`;const m=[],p=[];for(let g=0;g<e.rowHeights.length;g++)for(let f=0;f<e.colWidths.length;f++){const b=((h=e.cells[g])==null?void 0:h[f])??"";if(b==="")continue;const y=e.colWidths[f],v=o+l[f]+sn,j=r+a[g]+e.rowHeights[g]/2+d*.35,S=b.length*d*.55>y-2*sn,N=`ole-ann-clip-${e.id}-${g}-${f}`;S&&p.push(c.jsx("clipPath",{id:N,children:c.jsx("rect",{x:o+l[f],y:r+a[g],width:y,height:e.rowHeights[g]})},N)),m.push(c.jsx("text",{className:"ole-ann-table-text",x:v,y:j,fontSize:d,clipPath:S?`url(#${N})`:void 0,children:b},`${g}-${f}`))}return c.jsxs("g",{"data-annotation-id":e.id,className:gn("ole-ann ole-ann-table",Re(e.color)),"data-selected":t?"true":void 0,children:[p.length>0&&c.jsx("defs",{children:p}),c.jsx("rect",{className:"ole-ann-table-bg",x:o,y:r,width:i,height:s}),u&&c.jsx("path",{className:"ole-ann-table-grid",d:u}),c.jsx("rect",{className:"ole-ann-table-border",x:o,y:r,width:i,height:s}),m,n&&c.jsx(VE,{ann:e,cell:n})]})}function VE({ann:e,cell:t}){var h;const[n,o]=t,r=C.useRef(null),i=Rt(e),s=Ot(e),l=e.fontSize??Tt,a=((h=e.cells[n])==null?void 0:h[o])??"";C.useEffect(()=>{const g=r.current;g&&(g.focus(),g.select())},[n,o]);function d(){var b;const g=x.getState(),f=((b=r.current)==null?void 0:b.value)??"";if(f!==a){const y=e.cells.map(v=>[...v]);for(;y.length<=n;)y.push([]);y[n][o]=f,g.updateAnnotation(e.id,{cells:y})}}function u(){x.getState().setEditingAnnotation(null)}function m(g,f){const b=e.rowHeights.length,y=e.colWidths.length;if(f>=y?(f=0,g+=1):f<0&&(f=y-1,g-=1),g<0||g>=b){u();return}x.getState().setEditingCell([g,f])}function p(g){if(g.key==="Enter"){g.preventDefault(),d(),m(n+1,o);return}if(g.key==="Tab"){g.preventDefault(),d(),m(n,g.shiftKey?o-1:o+1);return}if(g.key==="Escape"){g.preventDefault(),r.current&&(r.current.value=a),d(),u();return}g.stopPropagation()}return c.jsx("foreignObject",{x:e.at[0]+i[o],y:e.at[1]+s[n],width:e.colWidths[o],height:e.rowHeights[n],className:"ole-ann-cell-edit-fo",children:c.jsx("input",{ref:r,defaultValue:a,onBlur:()=>{d(),u()},onKeyDown:p,onPointerDown:g=>g.stopPropagation(),onMouseDown:g=>g.stopPropagation(),style:{width:"100%",height:"100%",boxSizing:"border-box",border:"1px solid var(--selection)",outline:"none",background:"var(--canvas-bg)",color:"var(--foreground)",font:`${l}px ui-sans-serif, system-ui, sans-serif`,padding:`0 ${sn}px`}},`${n}-${o}`)})}function KE({ann:e,isSelected:t}){const n=e.fontSize??Tt,o=e.text===""?[""]:e.text.split(`
227
- `),r=Math.max(20,...o.map(s=>s.length*n*.55)),i=o.length*n*Kn;return c.jsxs("g",{"data-annotation-id":e.id,className:gn("ole-free-annotation",Re(e.color)),"data-selected":t?"true":void 0,children:[c.jsx("rect",{x:e.at[0]-1,y:e.at[1]-1,width:r+2,height:i+2,fill:"transparent",className:"ole-free-annotation-hit"}),t&&c.jsx("rect",{x:e.at[0]-1,y:e.at[1]-1,width:r+2,height:i+2,className:"ole-free-annotation-halo"}),o.map((s,l)=>c.jsx("text",{x:e.at[0],y:e.at[1]+n*.85+l*n*Kn,fontSize:n,className:"ole-free-annotation-text",children:s},l))]})}function XE({ann:e}){const t=C.useRef(null),n=e.fontSize??Tt;C.useEffect(()=>{const l=t.current;if(!l)return;l.focus();const a=document.createRange();a.selectNodeContents(l);const d=window.getSelection();d==null||d.removeAllRanges(),d==null||d.addRange(a)},[e.id]);function o(){var d;const l=x.getState(),a=(((d=t.current)==null?void 0:d.innerText)??"").replace(/\u00a0/g," ").trimEnd();a===""?l.deleteAnnotation(e.id):a!==e.text&&l.updateAnnotation(e.id,{text:a}),l.setEditingAnnotation(null),a!==""&&l.setSelectedAnnotation(e.id),l.activeTool==="text"&&l.setActiveTool("select")}function r(l){if(l.key==="Escape"){l.preventDefault(),t.current&&(t.current.innerText=e.text),o();return}if(l.key==="Enter"&&!l.shiftKey){l.preventDefault(),o();return}l.stopPropagation()}return c.jsx("foreignObject",{x:e.at[0],y:e.at[1],width:320,height:200,"data-annotation-id":e.id,className:"ole-free-annotation-edit-fo",children:c.jsx("div",{ref:t,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:o,onKeyDown:r,onPointerDown:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),style:{fontSize:`${n}px`,lineHeight:Kn,fontFamily:"ui-sans-serif, system-ui, sans-serif",color:"var(--foreground)",background:"var(--canvas-bg)",outline:"1px dashed var(--selection)",padding:"0 2px",minWidth:`${n}px`,minHeight:`${n*Kn}px`,whiteSpace:"pre-wrap",wordBreak:"break-word",cursor:"text"},children:e.text})})}function UE(){const e=x(l=>l.annotationDraft);if(!e)return null;if(e.kind==="rect"){const{at:l,size:a}=Vn(e);return c.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:c.jsx("rect",{x:l[0],y:l[1],width:a[0],height:a[1],strokeDasharray:N2})})}if(e.kind==="ellipse"){const{at:l,size:a}=Vn(e);return c.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:c.jsx("ellipse",{cx:l[0]+a[0]/2,cy:l[1]+a[1]/2,rx:a[0]/2,ry:a[1]/2})})}if(e.kind==="line"){const l=P2(e);return c.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:c.jsx("line",{x1:e.start[0],y1:e.start[1],x2:l[0],y2:l[1]})})}const{at:t,cols:n,rows:o}=M2(e),r=n*an,i=o*ln,s=[];for(let l=1;l<n;l++){const a=t[0]+l*an;s.push(c.jsx("line",{x1:a,y1:t[1],x2:a,y2:t[1]+i},`c${l}`))}for(let l=1;l<o;l++){const a=t[1]+l*ln;s.push(c.jsx("line",{x1:t[0],y1:a,x2:t[0]+r,y2:a},`r${l}`))}return c.jsxs("g",{className:"ole-ann-draft",pointerEvents:"none",children:[c.jsx("rect",{x:t[0],y:t[1],width:r,height:i}),s,c.jsxs("text",{className:"ole-ann-draft-badge",x:e.current[0]+12,y:e.current[1]-8,children:[n," × ",o]})]})}const jn=7,Xn=3;function YE(){const e=x(Pt),t=x(s=>s.diagram.annotations),n=x(s=>s.annotationPreview);if(x(s=>s.readOnly)||!e)return null;const r=(t??[]).find(s=>s.id===e);if(!r)return null;const i=(n==null?void 0:n.id)===e?n:r;switch(Xe(i)){case"rect":case"ellipse":return c.jsx(ZE,{ann:i,model:r});case"table":return c.jsx(JE,{ann:i,model:r});case"line":return c.jsx(oN,{ann:i,model:r});default:return null}}function bn(e,t,n){const o=C.useRef(null);return{onPointerDown:a=>{if(a.button!==0)return;a.stopPropagation(),a.preventDefault();const d=Ke();d&&(o.current={pointerId:a.pointerId,startSvg:d.screenToSvg(a.clientX,a.clientY),orig:structuredClone(e)},a.target.setPointerCapture(a.pointerId))},onPointerMove:a=>{const d=o.current,u=Ke();if(!d||a.pointerId!==d.pointerId||!u)return;const m=u.screenToSvg(a.clientX,a.clientY),p=de(m[0]-d.startSvg[0]),h=de(m[1]-d.startSvg[1]);x.getState().setAnnotationPreview(t(d.orig,p,h,a.nativeEvent))},onPointerUp:a=>{const d=o.current;if(!d||a.pointerId!==d.pointerId)return;o.current=null;const u=a.target;u.hasPointerCapture(a.pointerId)&&u.releasePointerCapture(a.pointerId);const m=x.getState(),p=m.annotationPreview;m.setAnnotationPreview(null),p&&p.id===e.id&&m.updateAnnotation(e.id,n(p))},onPointerCancel:a=>{const d=o.current;!d||a.pointerId!==d.pointerId||(o.current=null,x.getState().setAnnotationPreview(null))}}}function B2(e,t,n,o,r,i,s,l){let[a,d]=e,[u,m]=t;return n===1&&(u=Math.max(s,t[0]+r)),n===-1&&(u=Math.max(s,t[0]-r),a=e[0]+t[0]-u),o===1&&(m=Math.max(l,t[1]+i)),o===-1&&(m=Math.max(l,t[1]-i),d=e[1]+t[1]-m),{at:[a,d],size:[u,m]}}const H2=[{dirX:-1,dirY:-1,cursor:"nwse-resize"},{dirX:0,dirY:-1,cursor:"ns-resize"},{dirX:1,dirY:-1,cursor:"nesw-resize"},{dirX:1,dirY:0,cursor:"ew-resize"},{dirX:1,dirY:1,cursor:"nwse-resize"},{dirX:0,dirY:1,cursor:"ns-resize"},{dirX:-1,dirY:1,cursor:"nesw-resize"},{dirX:-1,dirY:0,cursor:"ew-resize"}];function F2(e,t,n,o){const r=n===-1?e[0]:n===1?e[0]+t[0]:e[0]+t[0]/2,i=o===-1?e[1]:o===1?e[1]+t[1]:e[1]+t[1]/2;return[r,i]}function W2({pos:e,cursor:t,handlers:n}){return c.jsx("rect",{className:"ole-annotation-handle",x:e[0]-jn/2,y:e[1]-jn/2,width:jn,height:jn,style:{cursor:t},onPointerDown:n.onPointerDown,onPointerMove:n.onPointerMove,onPointerUp:n.onPointerUp,onPointerCancel:n.onPointerCancel})}function ZE({ann:e,model:t}){return c.jsx("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:H2.map((n,o)=>c.jsx(QE,{grip:n,ann:e,model:t},o))})}function QE({grip:e,ann:t,model:n}){const o=bn(n,(r,i,s)=>{const l=B2(r.at,r.size,e.dirX,e.dirY,i,s,Nt,Nt);return{...r,at:l.at,size:l.size}},r=>({at:r.at,size:r.size}));return c.jsx(W2,{pos:F2(t.at,t.size,e.dirX,e.dirY),cursor:e.cursor,handlers:o})}function JE({ann:e,model:t}){const n=nt(e),o=Rt(e),r=Ot(e);return c.jsxs("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:[o.slice(1,-1).map((i,s)=>c.jsx(tN,{index:s,x:e.at[0]+i,ann:e,model:t},`c${s}`)),r.slice(1,-1).map((i,s)=>c.jsx(nN,{index:s,y:e.at[1]+i,ann:e,model:t},`r${s}`)),H2.map((i,s)=>c.jsx(eN,{grip:i,ann:e,model:t,size:n},s))]})}function eN({grip:e,ann:t,model:n,size:o}){const r=bn(n,(i,s,l)=>{const a=nt(i),d=B2(i.at,a,e.dirX,e.dirY,s,l,Xo*i.colWidths.length,Uo*i.rowHeights.length),u=ji(i.colWidths,d.size[0]/a[0],Xo),m=ji(i.rowHeights,d.size[1]/a[1],Uo),p=u.reduce((f,b)=>f+b,0),h=m.reduce((f,b)=>f+b,0),g=[e.dirX===-1?i.at[0]+a[0]-p:i.at[0],e.dirY===-1?i.at[1]+a[1]-h:i.at[1]];return{...i,at:g,colWidths:u,rowHeights:m}},i=>({at:i.at,colWidths:i.colWidths,rowHeights:i.rowHeights}));return c.jsx(W2,{pos:F2(t.at,o,e.dirX,e.dirY),cursor:e.cursor,handlers:r})}function ji(e,t,n){return e.map(o=>Math.max(n,Math.round(o*t)))}function tN({index:e,x:t,ann:n,model:o}){const[,r]=nt(n),i=bn(o,(s,l)=>{const a=[...s.colWidths];return a[e]=Math.max(Xo,s.colWidths[e]+l),{...s,colWidths:a}},s=>({colWidths:s.colWidths}));return c.jsx("rect",{className:"ole-annotation-handle ole-annotation-handle-strip",x:t-Xn,y:n.at[1],width:Xn*2,height:r,style:{cursor:"col-resize"},onPointerDown:i.onPointerDown,onPointerMove:i.onPointerMove,onPointerUp:i.onPointerUp,onPointerCancel:i.onPointerCancel})}function nN({index:e,y:t,ann:n,model:o}){const[r]=nt(n),i=bn(o,(s,l,a)=>{const d=[...s.rowHeights];return d[e]=Math.max(Uo,s.rowHeights[e]+a),{...s,rowHeights:d}},s=>({rowHeights:s.rowHeights}));return c.jsx("rect",{className:"ole-annotation-handle ole-annotation-handle-strip",x:n.at[0],y:t-Xn,width:r,height:Xn*2,style:{cursor:"row-resize"},onPointerDown:i.onPointerDown,onPointerMove:i.onPointerMove,onPointerUp:i.onPointerUp,onPointerCancel:i.onPointerCancel})}function oN({ann:e,model:t}){const n=fn(e);return c.jsx("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:n.map((o,r)=>c.jsx(rN,{index:r,pos:o,model:t},r))})}function rN({index:e,pos:t,model:n}){const o=bn(n,(r,i,s,l)=>{const a=r.points.map(u=>[...u]);let d=[r.points[e][0]+i,r.points[e][1]+s];if(l.shiftKey){const u=r.points[e-1]??r.points[e+1]??[0,0];d=z2(u,d)}return a[e]=d,{...r,points:a}},r=>({points:r.points}));return c.jsx("circle",{className:"ole-annotation-handle",cx:t[0],cy:t[1],r:4.5,style:{cursor:"move"},onPointerDown:o.onPointerDown,onPointerMove:o.onPointerMove,onPointerUp:o.onPointerUp,onPointerCancel:o.onPointerCancel})}const iN=20;function sN(){const e=x(u=>u.selection),t=x(u=>u.internal);if(e.length!==1)return null;const n=e[0],o=t.buses.get(n);if(!o)return null;const{axis:r,at:i,span:s}=o.geometry,l=s/2,a=r==="x"?[i[0]-l,i[1]]:[i[0],i[1]-l],d=r==="x"?[i[0]+l,i[1]]:[i[0],i[1]+l];return c.jsxs("g",{className:"ole-bus-handles",pointerEvents:"auto",children:[c.jsx(Ai,{x:a[0],y:a[1],busId:n,side:"start",axis:r}),c.jsx(Ai,{x:d[0],y:d[1],busId:n,side:"end",axis:r})]})}function Ai({x:e,y:t,busId:n,side:o,axis:r}){const i=Ke(),s=C.useRef(null),l=u=>{if(u.button!==0||(u.stopPropagation(),u.preventDefault(),!i))return;const m=x.getState().internal.buses.get(n);m&&(s.current={pointerId:u.pointerId,startSpan:m.geometry.span,startAt:[...m.geometry.at],startSvg:i.screenToSvg(u.clientX,u.clientY)},u.target.setPointerCapture(u.pointerId))},a=u=>{const m=s.current;if(!m||u.pointerId!==m.pointerId||!i)return;const p=i.screenToSvg(u.clientX,u.clientY),h=r==="x"?p[0]-m.startSvg[0]:p[1]-m.startSvg[1],g=v2()?Math.round(h/Gn)*Gn:h,f=m.startSpan+(o==="end"?g:-g);if(f<iN)return;const b=r==="x"?[m.startAt[0]+g/2,m.startAt[1]]:[m.startAt[0],m.startAt[1]+g/2];x.getState().updateBus(n,{span:f,at:b})},d=u=>{const m=s.current;!m||u.pointerId!==m.pointerId||(u.target.hasPointerCapture(u.pointerId)&&u.target.releasePointerCapture(u.pointerId),s.current=null)};return c.jsx("circle",{className:"ole-bus-handle",cx:e,cy:t,r:5,"data-handle":o,onPointerDown:l,onPointerMove:a,onPointerUp:d,onPointerCancel:d})}const Yo=.5;function en(e,t){return Math.abs(e[1]-t[1])<Yo?"h":"v"}function aN(){const e=x(l=>l.selectedWire),t=x(l=>l.internal.wireRenders);if(!e)return null;const n=t.get(e);if(!n||n.path.length<2)return null;const o=n.path,r=o.length,i=[];for(let l=1;l<r-1;l++){const a=en(o[l-1],o[l]),d=en(o[l],o[l+1]),u=l-1===0,m=l+1===r-1,p=u&&a==="v"||m&&d==="v",h=u&&a==="h"||m&&d==="h";p&&h||i.push(c.jsx(lN,{wireId:e,index:l,xLocked:p,yLocked:h},`v-${l}`))}const s=[];for(let l=0;l<r-1;l++){const a=o[l],d=o[l+1];Math.abs(a[0]-d[0])<Yo&&Math.abs(a[1]-d[1])<Yo||s.push(c.jsx(cN,{wireId:e,segIndex:l,axis:en(a,d)},`m-${l}`))}return c.jsxs("g",{className:"ole-wire-handles",pointerEvents:"auto",children:[s,i]})}function lN({wireId:e,index:t,xLocked:n,yLocked:o}){const r=Ke(),i=C.useRef(null),s=x(g=>{var f;return(f=g.internal.wireRenders.get(e))==null?void 0:f.path});if(!s||t<=0||t>=s.length-1)return null;const[l,a]=s[t],d=n&&!o?"ns-resize":!n&&o?"ew-resize":"move",u=g=>{if(g.button!==0||(g.stopPropagation(),g.preventDefault(),!r))return;const f=x.getState().internal.wireRenders.get(e);f&&(i.current={pointerId:g.pointerId,startPath:f.path.map(b=>[b[0],b[1]]),startSvg:r.screenToSvg(g.clientX,g.clientY),index:t,xLocked:n,yLocked:o},document.body.style.cursor=d,g.target.setPointerCapture(g.pointerId))},m=g=>{const f=i.current;if(!f||g.pointerId!==f.pointerId||!r)return;const b=r.screenToSvg(g.clientX,g.clientY),y=f.startPath,v=f.index;if(v<=0||v>=y.length-1)return;const j=y[v],S=[f.xLocked?j[0]:de(j[0]+(b[0]-f.startSvg[0])),f.yLocked?j[1]:de(j[1]+(b[1]-f.startSvg[1]))];if(S[0]===j[0]&&S[1]===j[1])return;const N=y.map(pe=>[pe[0],pe[1]]);N[v]=S;const W=en(y[v-1],y[v]);v-1>0&&(W==="h"?N[v-1]=[y[v-1][0],S[1]]:N[v-1]=[S[0],y[v-1][1]]);const ne=en(y[v],y[v+1]);v+1<y.length-1&&(ne==="h"?N[v+1]=[y[v+1][0],S[1]]:N[v+1]=[S[0],y[v+1][1]]),x.getState().updateWirePath(e,N)},p=g=>{const f=i.current;!f||g.pointerId!==f.pointerId||(g.target.hasPointerCapture(g.pointerId)&&g.target.releasePointerCapture(g.pointerId),i.current=null,document.body.style.cursor="")},h=g=>{g.stopPropagation(),g.preventDefault();const f=x.getState().internal.wireRenders.get(e);if(!f||f.path.length<=2||t<=0||t>=f.path.length-1)return;const b=f.path.filter((y,v)=>v!==t);x.getState().updateWirePath(e,b)};return c.jsx("circle",{className:"ole-wire-handle ole-wire-vertex",cx:l,cy:a,r:5,style:{cursor:d},onPointerDown:u,onPointerMove:m,onPointerUp:p,onPointerCancel:p,onDoubleClick:h})}function cN({wireId:e,segIndex:t,axis:n}){const o=Ke(),r=C.useRef(null),i=x(g=>{var f;return(f=g.internal.wireRenders.get(e))==null?void 0:f.path});if(!i||t<0||t>=i.length-1)return null;const s=i[t],l=i[t+1],a=(s[0]+l[0])/2,d=(s[1]+l[1])/2,u=n==="h"?"ns-resize":"ew-resize",m=g=>{if(g.button!==0||(g.stopPropagation(),g.preventDefault(),!o))return;const f=x.getState().internal.wireRenders.get(e);f&&(r.current={pointerId:g.pointerId,startPath:f.path.map(b=>[b[0],b[1]]),startSvg:o.screenToSvg(g.clientX,g.clientY),axis:n,segIndex:t},document.body.style.cursor=u,g.currentTarget.setPointerCapture(g.pointerId))},p=g=>{const f=r.current;if(!f||g.pointerId!==f.pointerId||!o)return;const b=o.screenToSvg(g.clientX,g.clientY),y=f.startPath,v=f.segIndex;if(v>=y.length-1)return;const j=y[v],S=y[v+1],N=[];for(let W=0;W<=v;W++)N.push(y[W]);if(f.axis==="h"){const W=de(j[1]+(b[1]-f.startSvg[1]));N.push([j[0],W]),N.push([S[0],W])}else{const W=de(j[0]+(b[0]-f.startSvg[0]));N.push([W,j[1]]),N.push([W,S[1]])}for(let W=v+1;W<y.length;W++)N.push(y[W]);x.getState().updateWirePath(e,N)},h=g=>{const f=r.current;if(!f||g.pointerId!==f.pointerId)return;const b=g.currentTarget;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),r.current=null,document.body.style.cursor=""};return c.jsxs("g",{className:"ole-wire-handle ole-wire-midpoint-group",style:{cursor:u},onPointerDown:m,onPointerMove:p,onPointerUp:h,onPointerCancel:h,children:[c.jsx("circle",{className:"ole-wire-midpoint-hit",cx:a,cy:d,r:8}),c.jsx("circle",{className:"ole-wire-handle ole-wire-midpoint",cx:a,cy:d,r:3.5})]})}const dN=3,Ao=12;function q2(){const e=le(a=>a.internal.buses),t=le(a=>a.selection),n=le(a=>a.selectedNode),o=le(a=>a.internal.nodes),r=le(a=>a.internal.terminalToNode),i=Mt().props,s=new Set(t),l=new Set;if(n){const a=o.get(n);if(a)for(const d of a.terminals)!d.includes(".")&&e.has(d)&&l.add(d)}return c.jsx("g",{className:"ole-bus-layer",children:Array.from(e.values()).map(({bus:a,geometry:d})=>{const{axis:u,at:m,span:p}=d,h=p/2,g=u==="x"?m[0]-h:m[0],f=u==="x"?m[1]:m[1]-h,b=u==="x"?m[0]+h:m[0],y=u==="x"?m[1]:m[1]+h,v=s.has(a.id),j=l.has(a.id),S=i[a.id];if((S==null?void 0:S.visible)===!1)return null;const N=r.get(a.id)??void 0,W=Ao/2,ne=u==="x"?m[0]-h:m[0]-W,pe=u==="x"?m[1]-W:m[1]-h,$=u==="x"?p:Ao,R=u==="x"?Ao:p;return c.jsxs("g",{"data-bus-id":a.id,"data-element-id":a.id,"data-node-id":N,"data-selected":v?"true":void 0,"data-node-related":j?"true":void 0,"data-alarm":gr(S),"data-quality":$2(S),className:Re(a.color)?`ole-bus ${Re(a.color)}`:"ole-bus",children:[c.jsx("rect",{x:ne,y:pe,width:$,height:R,fill:"transparent",className:"ole-bus-hit"}),c.jsx("line",{x1:g,y1:f,x2:b,y2:y,stroke:"currentColor",strokeWidth:dN,strokeLinecap:"round",fill:"none"})]},a.id)})})}function uN(){const e=x(l=>l.busbarDrawStart),t=x(l=>l.cursorSvg);if(!e||!t)return null;const n=t[0]-e[0],o=t[1]-e[1],r=Math.abs(n)>=Math.abs(o),i=r?t[0]:e[0],s=r?e[1]:t[1];return c.jsxs("g",{className:"ole-busbar-preview",pointerEvents:"none",children:[c.jsx("line",{x1:e[0],y1:e[1],x2:i,y2:s,className:"ole-busbar-preview-line"}),c.jsx("circle",{cx:e[0],cy:e[1],r:3.5,className:"ole-busbar-preview-anchor"}),c.jsx("circle",{cx:i,cy:s,r:3.5,className:"ole-busbar-preview-anchor"})]})}const mN=2.5,pN=9,hN=13,fN=-13,gN=4.5,bN=8;function G2(){const e=le(l=>l.internal.junctions),t=le(l=>l.selection),n=le(l=>l.selectedNode),o=le(l=>l.internal.nodes),r=le(l=>l.internal.terminalToNode),i=new Set(t),s=new Set;if(n){const l=o.get(n);if(l)for(const a of l.terminals)s.add(a)}return c.jsx("g",{className:"ole-junction-layer",children:Array.from(e.values()).map(({junction:l,world:a,degree:d})=>{const u=r.get(l.id)??void 0,m=t.length===1&&t[0]===l.id,p=a[0]+hN,h=a[1]+fN;return c.jsxs("g",{"data-junction-id":l.id,"data-element-id":l.id,"data-node-id":u,"data-solder":d>=3?"true":void 0,"data-selected":i.has(l.id)?"true":void 0,"data-node-related":s.has(l.id)?"true":void 0,className:"ole-junction",children:[c.jsx("circle",{cx:a[0],cy:a[1],r:pN,fill:"transparent",className:"ole-junction-hit"}),c.jsx("circle",{cx:a[0],cy:a[1],r:mN,className:"ole-junction-dot"}),m&&c.jsxs("g",{className:"ole-junction-wire-handle-group",children:[c.jsx("line",{x1:a[0],y1:a[1],x2:p,y2:h,className:"ole-junction-wire-handle-stem"}),c.jsx("circle",{cx:p,cy:h,r:bN,fill:"transparent",className:"ole-junction-wire-handle"}),c.jsx("circle",{cx:p,cy:h,r:gN,className:"ole-junction-wire-handle-dot"})]})]},l.id)})})}function ut(e){const t=[`translate(${e.at[0]} ${e.at[1]})`];e.rot&&t.push(`rotate(${e.rot})`);const n=e.scale??1;return(e.mirror||n!==1)&&t.push(`scale(${e.mirror?-n:n} ${n})`),t.join(" ")}const An=new Map;function V2(e,t){const n=t??1;if(n===1||!e)return e;const o=`${n}\0${e}`,r=An.get(o);if(r!==void 0)return r;const i=e.replace(/stroke-width="([0-9.]+)"/g,(s,l)=>`stroke-width="${yN(Number(l)/n)}"`);return An.size>500&&An.clear(),An.set(o,i),i}function yN(e){return Math.round(e*1e4)/1e4}function xN(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function wN({lib:e}){const t=xN(e.viewBox);return t?c.jsx("rect",{className:"ole-element-hit",x:t.x,y:t.y,width:t.w,height:t.h}):null}function K2(){const e=le(a=>a.internal.elements),t=le(a=>a.internal.layout),n=le(a=>a.selection),o=le(a=>a.selectedNode),r=le(a=>a.internal.nodes),i=Mt().props,s=new Set(n),l=new Set;if(o){const a=r.get(o);if(a)for(const d of a.terminals){const u=d.indexOf(".");u>0&&l.add(d.slice(0,u))}}return c.jsx("g",{className:"ole-element-layer",children:Array.from(e.values()).map(a=>{const d=t.get(a.element.id);if(!d)return null;const u=s.has(a.element.id),m=l.has(a.element.id),p=i[a.element.id];return(p==null?void 0:p.visible)===!1?null:a.libraryDef?c.jsxs("g",{"data-element-id":a.element.id,"data-selected":u?"true":void 0,"data-node-related":m?"true":void 0,"data-alarm":gr(p),"data-quality":$2(p),transform:ut(d),className:Re(a.element.color)?`ole-element ${Re(a.element.color)}`:"ole-element",children:[c.jsx(wN,{lib:a.libraryDef}),c.jsx("g",{dangerouslySetInnerHTML:{__html:V2(a.libraryDef.svg,d.scale)}}),a.libraryDef.terminalLabelsSvg&&c.jsx("g",{className:"ole-terminal-labels",dangerouslySetInnerHTML:{__html:a.libraryDef.terminalLabelsSvg}})]},a.element.id):c.jsxs("g",{"data-element-id":a.element.id,"data-selected":u?"true":void 0,"data-node-related":m?"true":void 0,transform:ut(d),className:"ole-element ole-element--unknown",children:[c.jsx("rect",{x:-10,y:-10,width:20,height:20,fill:"none",stroke:"#EF4444",strokeWidth:1,strokeDasharray:"2 2"}),c.jsx("text",{x:0,y:4,fontSize:8,fill:"#EF4444",textAnchor:"middle",fontFamily:"system-ui, sans-serif",children:"?"})]},a.element.id)})})}let X2=null;const Zo=new Set;function $n(e){X2=e;for(const t of Zo)t(e)}function vN(){return X2}function kN(e){return Zo.add(e),()=>{Zo.delete(e)}}function SN(){const[e,t]=C.useState(vN());return C.useEffect(()=>kN(t),[]),!e||e.w===0&&e.h===0?null:c.jsx("rect",{className:"ole-marquee",x:e.x,y:e.y,width:e.w,height:e.h,pointerEvents:"none"})}function _N(){const e=x(u=>u.activeTool),t=x(u=>u.placeKind),n=x(u=>u.cursorSvg),o=x(u=>u.placeFromTerminal),r=x(u=>u.internal.library);if(e!=="place"||!t||!n)return null;const i=r.get(t);if(!i)return null;let s=null,l=null;if(o){const u=_2(o,n);u&&(s=C2(i,u,n),l={source:u.world,pin:n})}else s=S2(i);const a=n[0]-((s==null?void 0:s.x)??0),d=n[1]-((s==null?void 0:s.y)??0);return c.jsxs("g",{className:"ole-place-ghost-group",pointerEvents:"none",children:[l&&c.jsxs(c.Fragment,{children:[c.jsx("line",{x1:l.source[0],y1:l.source[1],x2:l.pin[0],y2:l.pin[1],className:"ole-wire-preview-line"}),c.jsx("circle",{cx:l.source[0],cy:l.source[1],r:4,className:"ole-wire-preview-anchor"})]}),c.jsx("g",{className:"ole-place-ghost",transform:`translate(${a} ${d})`,opacity:.5,children:c.jsx("g",{dangerouslySetInnerHTML:{__html:i.svg}})})]})}function U2(){const e=le(i=>i.selection),t=le(i=>i.internal.elements),n=le(i=>i.internal.layout),o=le(i=>i.internal.buses),r=Mt().props;return e.length===0?null:c.jsx("g",{className:"ole-selection-overlay",pointerEvents:"none",children:e.map(i=>{var u;if(((u=r[i])==null?void 0:u.visible)===!1)return null;const s=o.get(i);if(s){const{axis:m,at:p,span:h}=s.geometry,g=h/2,f=m==="x"?p[0]-g:p[0]-4,b=m==="x"?p[1]-4:p[1]-g,y=m==="x"?h:8,v=m==="x"?8:h;return c.jsx("rect",{x:f,y:b,width:y,height:v,fill:"none",className:"ole-selection-rect"},i)}const l=t.get(i),a=n.get(i);if(!(l!=null&&l.libraryDef)||!a)return null;const d=CN(l.libraryDef.viewBox);return d?c.jsx("rect",{x:d.x,y:d.y,width:d.w,height:d.h,fill:"none",className:"ole-selection-rect",transform:ut(a)},i):null})})}function CN(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}const En=7,jN=.05;function AN(){const e=x(S=>S.selection),t=x(S=>S.internal),n=x(S=>S.readOnly),[o,r]=C.useState(null);if(n||e.length!==1)return null;const i=e[0],s=t.elements.get(i),l=t.layout.get(i);if(!(s!=null&&s.libraryDef)||!l)return null;const a=s.libraryDef.viewBox.trim().split(/\s+/).map(Number);if(a.length!==4||a.some(S=>Number.isNaN(S)))return null;const[d,u,m,p]=a,h=[[d,u],[d+m,u],[d+m,u+p],[d,u+p]].map(S=>Le(S,l)),g=Math.min(...h.map(S=>S[0])),f=Math.max(...h.map(S=>S[0])),b=Math.min(...h.map(S=>S[1])),y=Math.max(...h.map(S=>S[1])),v=[[g,b],[f,b],[f,y],[g,y]],j=["nwse-resize","nesw-resize","nwse-resize","nesw-resize"];return c.jsxs("g",{className:"ole-element-scale-handles",pointerEvents:"auto",children:[v.map((S,N)=>c.jsx($N,{id:i,pos:S,cursor:j[N],opposite:v[(N+2)%4],scale:l.scale??1,onLive:r},N)),o&&c.jsxs("text",{className:"ole-element-scale-readout",x:o.at[0],y:o.at[1],textAnchor:"middle",children:[Math.round(o.scale*100),"%"]})]})}function $N({id:e,pos:t,cursor:n,opposite:o,scale:r,onLive:i}){const s=C.useRef(null),l=u=>{if(u.button!==0)return;u.stopPropagation(),u.preventDefault();const m=Ke();if(!m)return;const p=m.screenToSvg(u.clientX,u.clientY),h=Math.hypot(p[0]-o[0],p[1]-o[1]);h<1||(s.current={pointerId:u.pointerId,startScale:r,startDist:h,opposite:o},u.target.setPointerCapture(u.pointerId))},a=u=>{const m=s.current,p=Ke();if(!m||u.pointerId!==m.pointerId||!p)return;const h=p.screenToSvg(u.clientX,u.clientY),g=Math.hypot(h[0]-m.opposite[0],h[1]-m.opposite[1]);let f=m.startScale*g/m.startDist;f=Math.min(mr,Math.max(ur,f)),f=Math.round(f*100)/100,Math.abs(f-1)<jN&&(f=1),x.getState().previewPlacement(e,{scale:f}),i({scale:f,at:[h[0],h[1]-10]})},d=(u,m)=>{const p=s.current;if(!p||u.pointerId!==p.pointerId)return;s.current=null;const h=u.target;h.hasPointerCapture(u.pointerId)&&h.releasePointerCapture(u.pointerId),i(null),x.getState().endGesture(m)};return c.jsx("rect",{className:"ole-annotation-handle ole-element-scale-handle",x:t[0]-En/2,y:t[1]-En/2,width:En,height:En,style:{cursor:n},onPointerDown:l,onPointerMove:a,onPointerUp:u=>d(u,!0),onPointerCancel:u=>d(u,!1)})}function EN(){const e=x(i=>i.internal.terminals),t=x(i=>i.internal.terminalToNode),n=x(i=>i.wireFromTerminal),o=x(i=>i.selection),r=new Set(o);return c.jsx("g",{className:"ole-terminal-layer",children:Array.from(e.values()).map(i=>{const s=t.get(i.ref),l=s!==void 0,a=n===i.ref,d=r.has(i.elementId);return c.jsx("circle",{cx:i.world[0],cy:i.world[1],r:3,"data-element-id":i.elementId,"data-terminal-id":i.ref,"data-node-id":s,"data-connected":l?"true":"false","data-active":a?"true":void 0,"data-on-selected":d?"true":void 0,className:"ole-terminal"},i.ref)})})}const $i=4;function NN(e,t,n,o){const r=t[0]-e[0],i=t[1]-e[1],s=o[0]-n[0],l=o[1]-n[1],a=r*l-i*s;if(Math.abs(a)<1e-9)return null;const d=((n[0]-e[0])*l-(n[1]-e[1])*s)/a,u=((n[0]-e[0])*i-(n[1]-e[1])*r)/a,m=1e-6;return d<=m||d>=1-m||u<=m||u>=1-m?null:[e[0]+d*r,e[1]+d*i]}function TN(e,t){const n=[];let o=[e[0]];for(let r=0;r<e.length-1;r++){const i=e[r],s=e[r+1],l=t.get(r);if(!l||l.length===0){o.push(s);continue}const a=s[0]-i[0],d=s[1]-i[1],u=Math.hypot(a,d)||1,m=a/u,p=d/u,h=f=>(f[0]-i[0])*m+(f[1]-i[1])*p,g=l.slice().sort((f,b)=>h(f)-h(b));for(const f of g){const b=h(f),y=Math.max(0,b-$i),v=Math.min(u,b+$i);o.push([i[0]+m*y,i[1]+p*y]),n.push(o),o=[[i[0]+m*v,i[1]+p*v]]}o.push(s)}return n.push(o),n.filter(r=>r.length>=2)}function Y2(){var m,p;const e=le(h=>h.internal.wireRenders),t=le(h=>h.internal.terminalToNode),n=le(h=>h.diagram.wires),o=le(h=>h.selectedWire),r=le(h=>h.selectedNode),i=Mt().props,s=new Map,l=new Map;for(const h of n??[]){const g=t.get(h.ends[0]);g&&s.set(h.id,g);const f=PE((m=i[xt(h.ends[0])])==null?void 0:m.alarm,(p=i[xt(h.ends[1])])==null?void 0:p.alarm);f!=="none"&&l.set(h.id,f)}const a=Array.from(e.values()).filter(h=>h.path.length>=2),d=[];for(const h of a){const g=s.get(h.wireId);for(let f=0;f<h.path.length-1;f++)d.push({wireId:h.wireId,node:g,i:f,a:h.path[f],b:h.path[f+1]})}const u=new Map;for(let h=0;h<d.length;h++)for(let g=h+1;g<d.length;g++){const f=d[h],b=d[g];if(f.wireId===b.wireId||!(f.node&&b.node&&f.node!==b.node))continue;const y=NN(f.a,f.b,b.a,b.b);if(!y)continue;const v=f.wireId<b.wireId?f:b;let j=u.get(v.wireId);j||(j=new Map,u.set(v.wireId,j));const S=j.get(v.i)??[];S.push(y),j.set(v.i,S)}return c.jsx("g",{className:"ole-wire-layer",fill:"none",stroke:"currentColor",strokeWidth:1,children:a.flatMap(h=>{const g=h.path,f=g.map(W=>`${W[0]},${W[1]}`).join(" "),b=s.get(h.wireId),y=o===h.wireId,v=r!=null&&r===b,j=y||v?"true":void 0,S=u.get(h.wireId),N=S?TN(g,S):[g];return[c.jsx("polyline",{"data-wire-id":h.wireId,"data-node-id":b,className:"ole-wire-hit",points:f},`hit-${h.wireId}`),...N.map((W,ne)=>c.jsx("polyline",{"data-wire-id":h.wireId,"data-node-id":b,"data-manual":h.userEdited?"true":void 0,"data-selected":j,"data-alarm":l.get(h.wireId),className:Re(h.color)?`ole-wire ${Re(h.color)}`:"ole-wire",points:W.map(pe=>`${pe[0]},${pe[1]}`).join(" ")},`${h.wireId}-${ne}`))]})})}let gt=null;const Qo=new Set;function dt(e){if(!(e===null&&gt===null||e&&gt&&e.ref===gt.ref&&e.world[0]===gt.world[0]&&e.world[1]===gt.world[1])){gt=e;for(const t of Qo)t(e)}}function IN(){return gt}function PN(e){return Qo.add(e),()=>{Qo.delete(e)}}function zN(){const e=x(a=>a.wireDragFrom),t=x(a=>a.cursorSvg),[n,o]=C.useState(IN());if(C.useEffect(()=>PN(o),[]),!e||!t)return null;const r=e.world,i=(n==null?void 0:n.world[0])??t[0],s=(n==null?void 0:n.world[1])??t[1],l=(n==null?void 0:n.create)==="junction";return c.jsxs("g",{className:"ole-wire-preview",pointerEvents:"none",children:[c.jsx("line",{x1:r[0],y1:r[1],x2:i,y2:s,className:"ole-wire-preview-line"}),c.jsx("circle",{cx:r[0],cy:r[1],r:4,className:"ole-wire-preview-anchor"}),n&&c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:n.world[0],cy:n.world[1],r:n.isBus?7:8,className:"ole-wire-preview-target-ring","data-create":l?"true":void 0}),!l&&c.jsx("circle",{cx:n.world[0],cy:n.world[1],r:n.isBus?3:4,className:"ole-wire-preview-target-dot"})]})]})}function pt(e,t){return e instanceof Element?e.closest(`[${t}]`):null}function mt(e){var t;return((t=pt(e,"data-element-id"))==null?void 0:t.getAttribute("data-element-id"))??null}function MN(e){var t;return((t=pt(e,"data-bus-id"))==null?void 0:t.getAttribute("data-bus-id"))??null}function DN(e){var t;return((t=pt(e,"data-junction-id"))==null?void 0:t.getAttribute("data-junction-id"))??null}function uo(e){var r;const t=(r=pt(e,"data-terminal-id"))==null?void 0:r.getAttribute("data-terminal-id");if(t)return t;const n=DN(e);if(n)return n;const o=MN(e);return o||null}function mo(e){var t;return((t=pt(e,"data-node-id"))==null?void 0:t.getAttribute("data-node-id"))??null}function Jo(e){var t;return((t=pt(e,"data-wire-id"))==null?void 0:t.getAttribute("data-wire-id"))??null}function cn(e){var t;return((t=pt(e,"data-element-label"))==null?void 0:t.getAttribute("data-element-label"))??null}function dn(e){var t;return((t=pt(e,"data-annotation-id"))==null?void 0:t.getAttribute("data-annotation-id"))??null}function Z2(e,t){try{e.dispatchEvent(new PointerEvent("pointercancel",{pointerId:t,bubbles:!0,cancelable:!0,pointerType:"touch"}))}catch{}}function RN(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}function Q2(){const e=x.getState(),t=e.activeTool;if(e.editingAnnotation||e.editingElement){if(typeof document<"u"){const n=document.querySelector(".ole-free-annotation-edit-fo div[contenteditable], .ole-element-name-editor div[contenteditable], .ole-ann-cell-edit-fo input");n==null||n.blur()}e.setEditingAnnotation(null),e.setEditingElement(null);return}if(t==="wire"||t==="busbar"||t==="junction"||t==="text"||t==="rect"||t==="ellipse"||t==="line"||t==="table"){e.setActiveTool("select");return}if(t==="place"){e.placeFromTerminal?e.setPlaceFromTerminal(null):e.placeKind?e.setPlaceKind(null):e.setActiveTool("select");return}(e.selectedNode||e.selectedWire||e.selection.length>0||e.selectedAnnotations.length>0)&&e.clearSelection()}function ON(){C.useEffect(()=>{const e=t=>{if(RN(t.target)||x.getState().readOnly)return;const n=t.metaKey||t.ctrlKey,o=x.getState();if(n&&t.key.toLowerCase()==="z"){t.preventDefault(),t.shiftKey?o.redo():o.undo();return}if(n&&!t.shiftKey&&t.key.toLowerCase()==="y"){t.preventDefault(),o.redo();return}if(n&&t.key.toLowerCase()==="a"){t.preventDefault();const r=x.getState().diagram.elements.map(i=>i.id);o.setSelection(r);return}if(n&&!t.shiftKey&&!t.altKey){const r=t.key.toLowerCase(),i=o.selection.length>0||o.selectedAnnotations.length>0;if(r==="c"){if(!i)return;t.preventDefault(),o.copySelection();return}if(r==="x"){if(!i)return;t.preventDefault(),o.cutSelection();return}if(r==="v"){if(!o.clipboard)return;t.preventDefault(),o.pasteClipboard();return}}if(!n)switch(t.key){case"v":case"V":o.setActiveTool("select");return;case"h":case"H":o.setActiveTool("pan");return;case"w":case"W":o.setActiveTool("wire");return;case"b":case"B":o.setActiveTool("busbar");return;case"j":case"J":o.setActiveTool("junction");return;case"p":case"P":o.setActiveTool("place");return;case"t":case"T":o.setActiveTool("text");return;case"f":case"F":o.setActiveTool("rect");return;case"o":case"O":o.setActiveTool("ellipse");return;case"l":case"L":o.setActiveTool("line");return;case"d":case"D":o.setActiveTool("table");return;case"r":case"R":o.selection.length>0&&(t.preventDefault(),o.rotateSelection(90));return;case"m":case"M":o.selection.length>0&&(t.preventDefault(),o.mirrorSelection());return;case"Delete":case"Backspace":o.selection.length>0||o.selectedAnnotations.length>0?(t.preventDefault(),o.deleteSelection()):o.selectedWire?(t.preventDefault(),o.deleteSelectedWire()):o.selectedNode&&(t.preventDefault(),o.deleteSelectedNode());return;case"Escape":Q2();return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[])}let er=null;const tr=new Set;function LN(e){if(e!==er){er=e;for(const t of tr)t(e)}}function BN(){return er}function HN(e){return tr.add(e),()=>{tr.delete(e)}}const Ei="ole-hover-element-host",FN="ole-hover-terminal-on",WN="ole-hover-node-on";function qN(e){const t=x2();C.useEffect(()=>{const n=e.current;if(!n)return;let o=null,r=null;const i=new Set,s=new Set,l=(p,h,g)=>{for(const f of p)f.classList.remove(g);p.clear();for(const f of h)f.classList.add(g),p.add(f)},a=p=>{var g,f;if(p===o)return;o&&((g=n.querySelector(`[data-element-id="${Nn(o)}"]`))==null||g.classList.remove(Ei)),p&&((f=n.querySelector(`[data-element-id="${Nn(p)}"]`))==null||f.classList.add(Ei));const h=p?Array.from(n.querySelectorAll(`.ole-terminal[data-element-id="${Nn(p)}"]`)):[];l(i,h,FN),o=p,p?n.setAttribute("data-hover-element",""):n.removeAttribute("data-hover-element"),LN(p)},d=p=>{if(p===r)return;const h=p?Array.from(n.querySelectorAll(`[data-node-id="${Nn(p)}"]`)):[];l(s,h,WN),r=p,p?n.setAttribute("data-hover-node",""):n.removeAttribute("data-hover-node")},u=p=>{a(mt(p.target));const h=uo(p.target);let g=null;h?g=t.getState().internal.terminalToNode.get(h)??null:g=mo(p.target),d(g)},m=()=>{a(null),d(null)};return n.addEventListener("pointermove",u),n.addEventListener("pointerleave",m),()=>{n.removeEventListener("pointermove",u),n.removeEventListener("pointerleave",m),a(null),d(null)}},[e,t])}function Nn(e){return e.replace(/(["\\])/g,"\\$1")}function GN(e,t,n){const o=[];for(const i of e.elements.values()){if(!i.libraryDef)continue;const s=e.layout.get(i.element.id);if(!s)continue;const l=KN(i.libraryDef.viewBox);if(!l)continue;const a=[[l.x,l.y],[l.x+l.w,l.y],[l.x,l.y+l.h],[l.x+l.w,l.y+l.h]].map(([h,g])=>VN([h,g],s));let d=1/0,u=-1/0,m=1/0,p=-1/0;for(const[h,g]of a)h<d&&(d=h),h>u&&(u=h),g<m&&(m=g),g>p&&(p=g);Tn(n,d,m,u,p)&&o.push(i.element.id)}for(const{bus:i,geometry:s}of e.buses.values()){const{axis:l,at:a,span:d}=s,u=d/2,m=l==="x"?a[0]-u:a[0],p=l==="x"?a[0]+u:a[0],h=l==="x"?a[1]:a[1]-u,g=l==="x"?a[1]:a[1]+u;Tn(n,m,h,p,g)&&o.push(i.id)}for(const{junction:i,world:s}of e.junctions.values())Tn(n,s[0],s[1],s[0],s[1])&&o.push(i.id);const r=[];for(const i of t??[]){const s=R2(i);Tn(n,s.minX,s.minY,s.maxX,s.maxY)&&r.push(i.id)}return{elements:o,annotations:r}}function Tn(e,t,n,o,r){return o>=e.x&&t<=e.x+e.w&&r>=e.y&&n<=e.y+e.h}function VN(e,t){const n=t.scale??1;let o=e[0]*n,r=e[1]*n;switch(t.mirror&&(o=-o),t.rot){case 0:break;case 90:[o,r]=[-r,o];break;case 180:[o,r]=[-o,-r];break;case 270:[o,r]=[r,-o];break}return[o+t.at[0],r+t.at[1]]}function KN(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function XN(e,t){const n=x.getState().internal;if(!e.includes(".")){const r=n.buses.get(e);if(r){const{axis:s,at:l,span:a}=r.geometry;if(s==="x"){const p=l[0]-a/2,h=l[0]+a/2,g=Math.max(p,Math.min(h,t[0]));return{ref:e,world:[g,l[1]],isBus:!0}}const d=l[1]-a/2,u=l[1]+a/2,m=Math.max(d,Math.min(u,t[1]));return{ref:e,world:[l[0],m],isBus:!0}}const i=n.junctions.get(e);return i?{ref:e,world:[i.world[0],i.world[1]],isBus:!1}:null}const o=n.terminals.get(e);return o?{ref:e,world:o.world,isBus:!1}:null}const Ni=10,In=e=>Math.round(e/Ni)*Ni,UN=16;function J2(e,t){let n=e[0],o=1/0;for(let r=0;r<e.length-1;r++){const[i,s]=e[r],[l,a]=e[r+1],d=l-i,u=a-s,m=d*d+u*u,p=m===0?0:Math.max(0,Math.min(1,((t[0]-i)*d+(t[1]-s)*u)/m)),h=i+p*d,g=s+p*u,f=(h-t[0])**2+(g-t[1])**2;f<o&&(o=f,n=[h,g])}return n}function Un(e,t){return typeof document<"u"?document.elementFromPoint(e,t):null}function YN(e,t){const n=x.getState().internal.wireRenders;let o=null,r=t;for(const i of n.values()){if(i.path.length<2)continue;const s=J2(i.path,e),l=Math.hypot(s[0]-e[0],s[1]-e[1]);l<=r&&(r=l,o={wireId:i.wireId,at:s})}return o}function tn(e,t,n){const o=e?uo(e):null;if(o){const l=XN(o,t);if(l)return{spec:{end:o},world:l.world,ref:o,isBus:l.isBus,create:!1}}let r=e?Jo(e):null,i=null;if(r){const l=x.getState().internal.wireRenders.get(r);i=l?J2(l.path,t):t}else{const l=YN(t,n);l&&(r=l.wireId,i=l.at)}if(r&&i){const l=[In(i[0]),In(i[1])];return{spec:{onWire:r,at:l},world:l,ref:null,isBus:!1,create:!0}}const s=[In(t[0]),In(t[1])];return{spec:{junctionAt:s},world:s,ref:null,isBus:!1,create:!0}}function nn(e,t,n){const o=e.viewport.screenToSvg(t,n),r=e.viewport.screenToSvg(t+UN,n);return Math.hypot(r[0]-o[0],r[1]-o[1])}function eS(e){return{ref:e.ref,world:e.world,isBus:e.isBus,...e.create?{create:"junction"}:{}}}function Yn(e,t){return e.ref&&t.ref?e.ref===t.ref:!e.ref&&!t.ref?e.world[0]===t.world[0]&&e.world[1]===t.world[1]:!1}const Ti=3;function $o(e,t){return e.hostEl.querySelector(`[data-element-label="${Me(t)}"] [data-element-label-body]`)}let me=null,Pe=null,ze=null,ye=null,ke=null;const ZN={id:"select",cursor:"default",onPointerDown(e,t){var p,h,g,f,b,y,v,j,S,N,W,ne,pe,$;if(e.button!==0||e.target instanceof Element&&e.target.closest(".ole-bus-handle, .ole-wire-handle, .ole-annotation-handle"))return;const n=x.getState(),o=cn(e.target);if(o){e.preventDefault(),e.stopPropagation();const R=n.diagram.elements.find(H=>H.id===o);if(!R)return;n.selection.includes(o)||n.setSelection([o]),ke={pointerId:e.pointerId,id:o,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),origin:[((p=R.labelOffset)==null?void 0:p[0])??0,((h=R.labelOffset)==null?void 0:h[1])??0],moved:!1};return}const r=dn(e.target);if(r){e.preventDefault(),e.stopPropagation();const R=(g=n.diagram.annotations)==null?void 0:g.find(V=>V.id===r);if(!R)return;if(e.shiftKey){n.toggleAnnotationInSelection(r);return}if(n.selectedAnnotations.includes(r)&&n.selection.length+n.selectedAnnotations.length>1){Ii(e,t,n.selection,n.selectedAnnotations);return}const H=Pt(n)===r;n.setSelectedAnnotation(r),ye={pointerId:e.pointerId,id:r,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),origin:[R.at[0],R.at[1]],moved:!1,wasSelected:H};return}const i=e.target instanceof Element?e.target.closest(".ole-junction-wire-handle"):null;if(i){const R=(f=i.closest("[data-junction-id]"))==null?void 0:f.getAttribute("data-junction-id");if(R){e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((y=(b=e.target).hasPointerCapture)!=null&&y.call(b,e.pointerId))&&e.target.releasePointerCapture(e.pointerId),t.hostEl.classList.add("tool-wire"),n.setWireFromTerminal(R);const H=(v=n.internal.junctions.get(R))==null?void 0:v.world;H&&n.setWireDragFrom({spec:{end:R},world:H,ref:R}),n.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY)),ze={pointerId:e.pointerId,fromRef:R};return}}const l=(e.target instanceof Element?(j=e.target.closest("[data-terminal-id]"))==null?void 0:j.getAttribute("data-terminal-id"):null)?uo(e.target):null;if(l){const R=l.indexOf("."),H=R>0?l.slice(0,R):"";if(H&&n.selection.includes(H)){e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((N=(S=e.target).hasPointerCapture)!=null&&N.call(S,e.pointerId))&&e.target.releasePointerCapture(e.pointerId),t.hostEl.classList.add("tool-wire"),n.setWireFromTerminal(l);const V=(W=n.internal.terminals.get(l))==null?void 0:W.world;V&&n.setWireDragFrom({spec:{end:l},world:V,ref:l}),n.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY)),ze={pointerId:e.pointerId,fromRef:l};return}}let a=mt(e.target);if(!a){const R=Jo(e.target);if(R&&typeof document<"u"){const H=document.elementsFromPoint(e.clientX,e.clientY);for(const V of H){const F=(pe=(ne=V.closest)==null?void 0:ne.call(V,"[data-bus-id]"))==null?void 0:pe.getAttribute("data-bus-id");if(!F)continue;const K=($=n.diagram.wires)==null?void 0:$.find(ie=>ie.id===R);K&&(K.ends[0]===F||K.ends[1]===F)&&(a=F);break}}}if(!a){const R=Jo(e.target);if(R){if(e.preventDefault(),e.altKey){const H=mo(e.target);if(H){n.setSelectedNode(H);return}}n.setSelectedWire(R);return}e.shiftKey||n.clearSelection(),Pe={pointerId:e.pointerId,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),shiftKey:e.shiftKey,baseSelection:e.shiftKey?n.selection.slice():[],baseAnnotations:e.shiftKey?n.selectedAnnotations.slice():[]},t.hostEl.setPointerCapture(e.pointerId),e.preventDefault();return}const d=n.selection;e.shiftKey?n.toggleInSelection(a):d.includes(a)||n.setSelection([a]);const u=x.getState(),m=e.shiftKey?u.selection:d.includes(a)?d:[a];Ii(e,t,m,u.selectedAnnotations)&&e.preventDefault()},onPointerMove(e,t){if(ke&&e.pointerId===ke.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=de(n[0]-ke.startSvg[0]),r=de(n[1]-ke.startSvg[1]);!ke.moved&&(o!==0||r!==0)&&(ke.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));const i=$o(t,ke.id);i&&i.setAttribute("transform",`translate(${o} ${r})`);return}if(ye&&e.pointerId===ye.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=de(n[0]-ye.startSvg[0]),r=de(n[1]-ye.startSvg[1]);!ye.moved&&(o!==0||r!==0)&&(ye.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));const i=t.hostEl.querySelector(`[data-annotation-id="${Me(ye.id)}"]`);i&&i.setAttribute("transform",`translate(${o} ${r})`);return}if(ze&&e.pointerId===ze.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY);x.getState().setCursorSvg(n);const o=Un(e.clientX,e.clientY),r=tn(o,n,nn(t,e.clientX,e.clientY)),i={spec:{end:ze.fromRef},world:[0,0],ref:ze.fromRef};dt(Yn(i,r)?null:eS(r));return}if(me&&e.pointerId===me.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=de(n[0]-me.startSvg[0]),r=de(n[1]-me.startSvg[1]);!me.moved&&(o!==0||r!==0)&&(me.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));for(const[i,s]of me.originals){const l=t.hostEl.querySelector(`[data-element-id="${Me(i)}"]`);if(!l)continue;const a={...s,at:[s.at[0]+o,s.at[1]+r]};l.setAttribute("transform",ut(a))}for(const i of me.busOriginals.keys()){const s=t.hostEl.querySelector(`[data-element-id="${Me(i)}"]`);s&&s.setAttribute("transform",`translate(${o} ${r})`)}for(const i of me.junctionOriginals.keys()){const s=t.hostEl.querySelector(`[data-element-id="${Me(i)}"]`);s&&s.setAttribute("transform",`translate(${o} ${r})`)}for(const i of me.annotationOriginals.keys()){const s=t.hostEl.querySelector(`[data-annotation-id="${Me(i)}"]`);s&&s.setAttribute("transform",`translate(${o} ${r})`)}return}if(Pe&&e.pointerId===Pe.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY);$n(zi(Pe.startSvg,n));return}},onPointerUp(e,t){var n;if(ke&&e.pointerId===ke.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=de(o[0]-ke.startSvg[0]),i=de(o[1]-ke.startSvg[1]),s=$o(t,ke.id);if(s&&s.removeAttribute("transform"),ke.moved&&(r!==0||i!==0)){const l=[ke.origin[0]+r,ke.origin[1]+i];x.getState().updateElement(ke.id,{labelOffset:l[0]===0&&l[1]===0?void 0:l})}ke=null;return}if(ye&&e.pointerId===ye.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=de(o[0]-ye.startSvg[0]),i=de(o[1]-ye.startSvg[1]),s=t.hostEl.querySelector(`[data-annotation-id="${Me(ye.id)}"]`);if(s&&s.removeAttribute("transform"),ye.moved&&(r!==0||i!==0))x.getState().updateAnnotation(ye.id,{at:[ye.origin[0]+r,ye.origin[1]+i]});else if(!ye.moved&&ye.wasSelected){const l=x.getState(),a=(n=l.diagram.annotations)==null?void 0:n.find(d=>d.id===ye.id);a&&Pi(l,a,o)}ye=null;return}if(ze&&e.pointerId===ze.pointerId){const o=x.getState(),r=ze.fromRef;ze=null,t.hostEl.classList.remove("tool-wire"),o.setWireFromTerminal(null),o.setWireDragFrom(null),o.setCursorSvg(null),dt(null);const i=t.viewport.screenToSvg(e.clientX,e.clientY),s=Un(e.clientX,e.clientY)??(e.target instanceof Element?e.target:null),l=tn(s,i,nn(t,e.clientX,e.clientY));if(Yn({world:[0,0],ref:r},l))return;o.connectWire({end:r},l.spec);return}if(me&&e.pointerId===me.pointerId){if(t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId),me.moved){const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=de(o[0]-me.startSvg[0]),i=de(o[1]-me.startSvg[1]);if(r!==0||i!==0){const s=new Map;for(const a of me.originals.keys())s.set(a,[r,i]);for(const a of me.busOriginals.keys())s.set(a,[r,i]);for(const a of me.junctionOriginals.keys())s.set(a,[r,i]);const l=new Map;for(const a of me.annotationOriginals.keys())l.set(a,[r,i]);x.getState().moveElements(s,l)}for(const s of me.busOriginals.keys()){const l=t.hostEl.querySelector(`[data-element-id="${Me(s)}"]`);l&&l.removeAttribute("transform")}for(const s of me.junctionOriginals.keys()){const l=t.hostEl.querySelector(`[data-element-id="${Me(s)}"]`);l&&l.removeAttribute("transform")}for(const s of me.annotationOriginals.keys()){const l=t.hostEl.querySelector(`[data-annotation-id="${Me(s)}"]`);l&&l.removeAttribute("transform")}}me=null;return}if(Pe&&e.pointerId===Pe.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=zi(Pe.startSvg,o);if(r.w>=Ti||r.h>=Ti){const i=x.getState(),s=GN(i.internal,i.diagram.annotations,r);Pe.shiftKey?i.setSelection(Mi(Pe.baseSelection,s.elements),Mi(Pe.baseAnnotations,s.annotations)):i.setSelection(s.elements,s.annotations)}$n(null),Pe=null}},onPointerCancel(e,t){var n,o,r,i,s,l,a,d;if(ke&&e.pointerId===ke.pointerId){const u=$o(t,ke.id);if(u&&u.removeAttribute("transform"),(o=(n=t.hostEl).hasPointerCapture)!=null&&o.call(n,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}ke=null}if(ye&&e.pointerId===ye.pointerId){const u=t.hostEl.querySelector(`[data-annotation-id="${Me(ye.id)}"]`);if(u&&u.removeAttribute("transform"),(i=(r=t.hostEl).hasPointerCapture)!=null&&i.call(r,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}ye=null}if(me&&e.pointerId===me.pointerId){for(const[u,m]of me.originals){const p=t.hostEl.querySelector(`[data-element-id="${Me(u)}"]`);p&&p.setAttribute("transform",ut(m))}for(const u of me.busOriginals.keys()){const m=t.hostEl.querySelector(`[data-element-id="${Me(u)}"]`);m&&m.removeAttribute("transform")}for(const u of me.junctionOriginals.keys()){const m=t.hostEl.querySelector(`[data-element-id="${Me(u)}"]`);m&&m.removeAttribute("transform")}for(const u of me.annotationOriginals.keys()){const m=t.hostEl.querySelector(`[data-annotation-id="${Me(u)}"]`);m&&m.removeAttribute("transform")}if((l=(s=t.hostEl).hasPointerCapture)!=null&&l.call(s,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}me=null}if(ze&&e.pointerId===ze.pointerId){t.hostEl.classList.remove("tool-wire");const u=x.getState();u.setWireFromTerminal(null),u.setWireDragFrom(null),u.setCursorSvg(null),dt(null),ze=null}if(Pe&&e.pointerId===Pe.pointerId){if((d=(a=t.hostEl).hasPointerCapture)!=null&&d.call(a,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}$n(null),Pe=null}},onDoubleClick(e,t){var i;const n=x.getState(),o=dn(e.target);if(o){e.preventDefault(),e.stopPropagation();const s=(i=n.diagram.annotations)==null?void 0:i.find(l=>l.id===o);if(!s)return;n.setSelectedAnnotation(o),Pi(n,s,t.viewport.screenToSvg(e.clientX,e.clientY));return}const r=cn(e.target)??mt(e.target);r&&(e.preventDefault(),e.stopPropagation(),n.setEditingElement(r))},onDeactivate(e){if(me=null,Pe=null,ye=null,ke=null,ze){e.hostEl.classList.remove("tool-wire");const t=x.getState();t.setWireFromTerminal(null),t.setWireDragFrom(null),t.setCursorSvg(null),dt(null),ze=null}$n(null)}};function Ii(e,t,n,o){const r=x.getState(),i=r.internal,s=new Map,l=new Map,a=new Map,d=new Map;for(const m of n){const p=i.buses.get(m);if(p){l.set(m,[p.geometry.at[0],p.geometry.at[1]]);continue}const h=i.junctions.get(m);if(h){a.set(m,[h.world[0],h.world[1]]);continue}const g=i.layout.get(m);g&&s.set(m,{...g})}const u=r.diagram.annotations??[];for(const m of o){const p=u.find(h=>h.id===m);p&&d.set(m,[p.at[0],p.at[1]])}return s.size===0&&l.size===0&&a.size===0&&d.size===0?!1:(me={pointerId:e.pointerId,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),originals:s,busOriginals:l,junctionOriginals:a,annotationOriginals:d,moved:!1},!0)}function Pi(e,t,n){const o=Xe(t);if(o==="table"){const r=HE(t,n);r&&(e.setEditingAnnotation(t.id),e.setEditingCell(r))}else o==="text"&&e.setEditingAnnotation(t.id)}function zi(e,t){const n=Math.min(e[0],t[0]),o=Math.min(e[1],t[1]),r=Math.abs(t[0]-e[0]),i=Math.abs(t[1]-e[1]);return{x:n,y:o,w:r,h:i}}function Mi(e,t){const n=new Set(e);for(const o of t)n.has(o)?n.delete(o):n.add(o);return[...n]}function Me(e){return e.replace(/(["\\])/g,"\\$1")}const QN=4;let ue=null;const JN={id:"pan",cursor:"grab",onPointerDown(e,t){if(e.button!==0)return;const n=t.viewport.getViewport(),o=x.getState().readOnly?null:mt(e.target);let r=null;if(o){const i=x.getState();i.selection.includes(o)||i.setSelection([o]);const s=x.getState().selection,l=x.getState().internal,a=new Map,d=new Map;for(const u of s){const m=l.buses.get(u);if(m){d.set(u,[m.geometry.at[0],m.geometry.at[1]]);continue}const p=l.layout.get(u);p&&a.set(u,{...p})}(a.size>0||d.size>0)&&(r={startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),originals:a,busOriginals:d})}ue={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startTx:n.tx,startTy:n.ty,startTarget:e.target,moved:!1,elementDrag:r},t.hostEl.style.cursor="grabbing",e.preventDefault()},onPointerMove(e,t){if(!ue||e.pointerId!==ue.pointerId)return;const n=e.clientX-ue.startX,o=e.clientY-ue.startY;if(!ue.moved&&Math.hypot(n,o)>QN){ue.moved=!0;try{t.hostEl.setPointerCapture(e.pointerId)}catch{}}if(ue.moved){if(ue.elementDrag){const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=de(r[0]-ue.elementDrag.startSvg[0]),s=de(r[1]-ue.elementDrag.startSvg[1]);for(const[l,a]of ue.elementDrag.originals){const d=t.hostEl.querySelector(`[data-element-id="${Xt(l)}"]`);if(!d)continue;const u={...a,at:[a.at[0]+i,a.at[1]+s]};d.setAttribute("transform",ut(u))}for(const l of ue.elementDrag.busOriginals.keys()){const a=t.hostEl.querySelector(`[data-element-id="${Xt(l)}"]`);a&&a.setAttribute("transform",`translate(${i} ${s})`)}return}t.viewport.setViewport({tx:ue.startTx+n,ty:ue.startTy+o})}},onPointerUp(e,t){if(!(!ue||e.pointerId!==ue.pointerId)){if(t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId),t.hostEl.style.cursor="grab",ue.elementDrag&&ue.moved){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=de(n[0]-ue.elementDrag.startSvg[0]),r=de(n[1]-ue.elementDrag.startSvg[1]);if(o!==0||r!==0){const i=new Map;for(const s of ue.elementDrag.originals.keys())i.set(s,[o,r]);for(const s of ue.elementDrag.busOriginals.keys())i.set(s,[o,r]);x.getState().moveElements(i)}for(const i of ue.elementDrag.busOriginals.keys()){const s=t.hostEl.querySelector(`[data-element-id="${Xt(i)}"]`);s&&s.removeAttribute("transform")}}else!ue.moved&&!x.getState().readOnly&&eT(ue.startTarget);ue=null}},onPointerCancel(e,t){if(ue!=null&&ue.elementDrag){for(const[n,o]of ue.elementDrag.originals){const r=t.hostEl.querySelector(`[data-element-id="${Xt(n)}"]`);r&&r.setAttribute("transform",ut(o))}for(const n of ue.elementDrag.busOriginals.keys()){const o=t.hostEl.querySelector(`[data-element-id="${Xt(n)}"]`);o&&o.removeAttribute("transform")}}ue=null},onDeactivate(){ue=null}};function eT(e){if(!e)return;const t=x.getState(),n=dn(e);if(n){t.setSelectedAnnotation(n);return}const o=mt(e);if(o){t.setSelection([o]);return}const r=mo(e);if(r){t.setSelectedNode(r);return}t.clearSelection()}function Xt(e){return e.replace(/(["\\])/g,"\\$1")}const Zt={tight:1024,compact:720,dense:520,mini:380},Di={full:0,tight:1,compact:2,dense:3,mini:4};function We(e,t){return Di[e]>=Di[t]}function tT(e){return e>=Zt.tight?"full":e>=Zt.compact?"tight":e>=Zt.dense?"compact":e>=Zt.mini?"dense":"mini"}const tS=C.createContext("full");function ht(){return C.useContext(tS)}function nT(e){const[t,n]=C.useState(null);return C.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const s=o.clientWidth;n(l=>l===s?l:s)};if(r(),typeof ResizeObserver>"u")return;const i=new ResizeObserver(r);return i.observe(o),()=>i.disconnect()},[e]),t}function nS(){if(typeof window>"u")return!1;try{if(!window.matchMedia("(pointer: coarse)").matches)return!1}catch{return!1}return window.innerWidth<Zt.dense}function ft(){nS()&&x.getState().setActiveTool("pan")}function oT(){nS()&&x.getState().setPlaceKind(null)}const rT={id:"wire",cursor:"crosshair",onActivate(e){e.hostEl.classList.add("tool-wire")},onDeactivate(e){e.hostEl.classList.remove("tool-wire");const t=x.getState();t.setWireFromTerminal(null),t.setWireDragFrom(null),t.setCursorSvg(null),dt(null)},onPointerDown(e,t){var s,l;if(e.button!==0)return;e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((l=(s=e.target).hasPointerCapture)!=null&&l.call(s,e.pointerId))&&e.target.releasePointerCapture(e.pointerId);const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=nn(t,e.clientX,e.clientY),r=tn(e.target instanceof Element?e.target:null,n,o),i=x.getState();i.setWireDragFrom({spec:r.spec,world:r.world,ref:r.ref}),i.setWireFromTerminal(r.ref),i.setCursorSvg(n)},onPointerMove(e,t){const n=x.getState(),o=n.wireDragFrom;if(!o)return;const r=t.viewport.screenToSvg(e.clientX,e.clientY);n.setCursorSvg(r);const i=Un(e.clientX,e.clientY),s=tn(i,r,nn(t,e.clientX,e.clientY)),l={spec:o.spec,world:o.world,ref:o.ref,create:!o.ref};dt(Yn(l,s)?null:eS(s))},onPointerUp(e,t){const n=x.getState(),o=n.wireDragFrom;if(n.setWireFromTerminal(null),n.setWireDragFrom(null),n.setCursorSvg(null),dt(null),!o)return;const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=Un(e.clientX,e.clientY)??(e.target instanceof Element?e.target:null),s=tn(i,r,nn(t,e.clientX,e.clientY)),l={spec:o.spec,world:o.world,ref:o.ref,create:!o.ref};Yn(l,s)||(n.connectWire(o.spec,s.spec),ft())},onPointerLeave(){const e=x.getState();e.setWireFromTerminal(null),e.setWireDragFrom(null),e.setCursorSvg(null),dt(null)}},Ri=10;let Ut=!1;function Oi(){setTimeout(()=>oT(),0)}const iT={id:"place",cursor:"copy",onActivate(e){e.hostEl.classList.add("tool-place")},onDeactivate(e){e.hostEl.classList.remove("tool-place");const t=x.getState();t.setPlaceFromTerminal(null),t.setCursorSvg(null),Ut=!1},onPointerDown(e,t){var i,s;if(e.button!==0)return;const{placeKind:n}=x.getState();if(!n)return;e.preventDefault();const o=uo(e.target);if(o){e.stopPropagation(),e.target instanceof Element&&((s=(i=e.target).hasPointerCapture)!=null&&s.call(i,e.pointerId))&&e.target.releasePointerCapture(e.pointerId);const l=x.getState();l.setPlaceFromTerminal(o),l.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY));return}const r=t.viewport.screenToSvg(e.clientX,e.clientY);k2(n,r),Ut=!0},onPointerMove(e,t){const n=t.viewport.screenToSvg(e.clientX,e.clientY);x.getState().setCursorSvg([Li(n[0]),Li(n[1])])},onPointerUp(e,t){const n=x.getState(),o=n.placeFromTerminal;if(o){n.setPlaceFromTerminal(null);const{placeKind:r}=n;if(!r)return;const i=t.viewport.screenToSvg(e.clientX,e.clientY);EE(r,o,i),Oi();return}Ut&&(Ut=!1,Oi())},onPointerLeave(){const e=x.getState();e.setPlaceFromTerminal(null),e.setCursorSvg(null)},onPointerCancel(){const e=x.getState();e.setPlaceFromTerminal(null),e.setCursorSvg(null),Ut=!1}};function Li(e){return Math.round(e/Ri)*Ri}const Bi=10,Hi=20;function Ct(e){return Math.round(e/Bi)*Bi}const sT={id:"busbar",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=[Ct(n[0]),Ct(n[1])];x.getState().setBusbarDrawStart(o),x.getState().setCursorSvg(o)},onPointerMove(e,t){const n=t.viewport.screenToSvg(e.clientX,e.clientY);x.getState().setCursorSvg([Ct(n[0]),Ct(n[1])])},onPointerUp(e,t){const n=x.getState().busbarDrawStart;if(x.getState().setBusbarDrawStart(null),!n)return;const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=Ct(o[0]),i=Ct(o[1]),s=r-n[0],l=i-n[1],a=Math.abs(s)>=Math.abs(l);let d,u,m;if(a){if(u=Math.abs(s),u<Hi)return;d=0,m=[(n[0]+r)/2,n[1]]}else{if(u=Math.abs(l),u<Hi)return;d=90,m=[n[0],(n[1]+i)/2]}x.getState().addBus(m,u,d),ft()},onPointerLeave(){const e=x.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)},onPointerCancel(){const e=x.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)},onDeactivate(){const e=x.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)}},Fi=10,Wi=e=>Math.round(e/Fi)*Fi,aT={id:"junction",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault(),e.stopPropagation();const n=t.viewport.screenToSvg(e.clientX,e.clientY);x.getState().addJunction([Wi(n[0]),Wi(n[1])]),ft()}},lT={id:"text",cursor:"text",onPointerDown(e,t){if(e.button!==0)return;const n=x.getState(),o=dn(e.target);if(o){e.preventDefault(),e.stopPropagation(),n.setActiveTool("select"),n.setSelectedAnnotation(o);return}e.preventDefault();const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=n.addAnnotation([r[0],r[1]],"");n.setEditingAnnotation(i),ft()}},cT={id:"rect",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=Fe(t.viewport.screenToSvg(e.clientX,e.clientY));x.getState().setAnnotationDraft({kind:"rect",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=x.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:Fe(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=x.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=Fe(t.viewport.screenToSvg(e.clientX,e.clientY)),{at:i,size:s}=Vn({...o,current:r,constrain:e.shiftKey});if(s[0]<Nt||s[1]<Nt)return;const l=n.insertAnnotation({type:"rect",at:i,size:s,stroke:"dashed"});n.setSelectedAnnotation(l),n.setActiveTool("select"),ft()},onPointerLeave(){x.getState().setAnnotationDraft(null)},onPointerCancel(){x.getState().setAnnotationDraft(null)},onDeactivate(){x.getState().setAnnotationDraft(null)}},dT={id:"ellipse",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=Fe(t.viewport.screenToSvg(e.clientX,e.clientY));x.getState().setAnnotationDraft({kind:"ellipse",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=x.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:Fe(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=x.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=Fe(t.viewport.screenToSvg(e.clientX,e.clientY)),{at:i,size:s}=Vn({...o,current:r,constrain:e.shiftKey});if(s[0]<Nt||s[1]<Nt)return;const l=n.insertAnnotation({type:"ellipse",at:i,size:s});n.setSelectedAnnotation(l),n.setActiveTool("select"),ft()},onPointerLeave(){x.getState().setAnnotationDraft(null)},onPointerCancel(){x.getState().setAnnotationDraft(null)},onDeactivate(){x.getState().setAnnotationDraft(null)}},uT={id:"line",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=Fe(t.viewport.screenToSvg(e.clientX,e.clientY));x.getState().setAnnotationDraft({kind:"line",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=x.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:Fe(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=x.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=Fe(t.viewport.screenToSvg(e.clientX,e.clientY)),i=P2({...o,current:r,constrain:e.shiftKey}),s=i[0]-o.start[0],l=i[1]-o.start[1];if(Math.hypot(s,l)<OE)return;const a=n.insertAnnotation({type:"line",at:o.start,points:[[0,0],[s,l]]});n.setSelectedAnnotation(a),n.setActiveTool("select"),ft()},onPointerLeave(){x.getState().setAnnotationDraft(null)},onPointerCancel(){x.getState().setAnnotationDraft(null)},onDeactivate(){x.getState().setAnnotationDraft(null)}},qi=15,mT=3,pT=3,hT={id:"table",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=Fe(t.viewport.screenToSvg(e.clientX,e.clientY));x.getState().setAnnotationDraft({kind:"table",start:n,current:n,constrain:!1})},onPointerMove(e,t){const n=x.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:Fe(t.viewport.screenToSvg(e.clientX,e.clientY))})},onPointerUp(e,t){const n=x.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=Fe(t.viewport.screenToSvg(e.clientX,e.clientY)),i=Math.abs(r[0]-o.start[0]),s=Math.abs(r[1]-o.start[1]),l=i<qi&&s<qi,{at:a,cols:d,rows:u}=l?{at:o.start,cols:mT,rows:pT}:M2({...o,current:r}),m=n.insertAnnotation({type:"table",at:a,...D2(d,u)});n.setSelectedAnnotation(m),n.setActiveTool("select"),ft()},onPointerLeave(){x.getState().setAnnotationDraft(null)},onPointerCancel(){x.getState().setAnnotationDraft(null)},onDeactivate(){x.getState().setAnnotationDraft(null)}},Gi={select:ZN,pan:JN,wire:rT,place:iT,busbar:sT,junction:aT,text:lT,rect:cT,ellipse:dT,line:uT,table:hT};function fT(e,t){const n=x(r=>r.activeTool),o=x(r=>r.readOnly);C.useEffect(()=>{var g;const r=e.current;if(!r)return;const i=o?"pan":n,s=o?Gi.pan:Gi[n],l={viewport:t,hostEl:r};r.dataset.tool=i,(g=s.onActivate)==null||g.call(s,l),s.cursor&&(r.style.cursor=s.cursor);const a=f=>{var b;return(b=s.onPointerDown)==null?void 0:b.call(s,f,l)},d=f=>{var b;return(b=s.onPointerMove)==null?void 0:b.call(s,f,l)},u=f=>{var b;return(b=s.onPointerUp)==null?void 0:b.call(s,f,l)},m=f=>{var b;return s.onPointerCancel?s.onPointerCancel(f,l):(b=s.onPointerUp)==null?void 0:b.call(s,f,l)},p=f=>{var b;return(b=s.onPointerLeave)==null?void 0:b.call(s,f,l)},h=f=>{var b;return(b=s.onDoubleClick)==null?void 0:b.call(s,f,l)};return r.addEventListener("pointerdown",a),r.addEventListener("pointermove",d),r.addEventListener("pointerup",u),r.addEventListener("pointercancel",m),r.addEventListener("pointerleave",p),r.addEventListener("dblclick",h),()=>{var f;r.removeEventListener("pointerdown",a),r.removeEventListener("pointermove",d),r.removeEventListener("pointerup",u),r.removeEventListener("pointercancel",m),r.removeEventListener("pointerleave",p),r.removeEventListener("dblclick",h),(f=s.onDeactivate)==null||f.call(s,l),r.style.cursor="",delete r.dataset.tool}},[n,o,e,t])}let nr=1;const or=new Set;function gT(e){if(e!==nr){nr=e;for(const t of or)t(e)}}function bT(){return nr}function yT(e){return or.add(e),()=>{or.delete(e)}}const Eo=.1,No=8,xT=1.0015,wT=1.02;function oS(e,t,n={tx:0,ty:0,scale:1},o={}){const r=o.shared??!0,i=C.useRef({...n}),s=C.useRef(new Set),l=()=>{const a=t.current,d=e.current;if(a&&a.setAttribute("transform",`translate(${i.current.tx} ${i.current.ty}) scale(${i.current.scale})`),d&&d.style.setProperty("--canvas-scale",String(i.current.scale)),r&&gT(i.current.scale),s.current.size>0){const u={...i.current};for(const m of s.current)m(u)}};return C.useEffect(()=>{const a=e.current;if(!a)return;let d=!1,u=-1,m=0,p=0,h=0,g=0,f=!1;const b=new Map;let y=null,v=!1;const j=()=>{if(b.size<2){y=null;return}const F=[...b.values()],K=F[1].x-F[0].x,ie=F[1].y-F[0].y,he=Math.hypot(K,ie)||1,ae=a.getBoundingClientRect();y={startDist:he,startScale:i.current.scale,startTx:i.current.tx,startTy:i.current.ty,startMidX:(F[0].x+F[1].x)/2-ae.left,startMidY:(F[0].y+F[1].y)/2-ae.top}},S=F=>{if(F.pointerType==="touch"){if(b.set(F.pointerId,{x:F.clientX,y:F.clientY}),b.size>=2&&!v){v=!0;for(const K of b.keys())K!==F.pointerId&&Z2(a,K);j()}if(v){F.stopPropagation(),F.preventDefault();try{a.setPointerCapture(F.pointerId)}catch{}}}},N=F=>{if(F.pointerType!=="touch"||!b.has(F.pointerId)||(b.set(F.pointerId,{x:F.clientX,y:F.clientY}),!v||!y))return;F.stopPropagation();const K=[...b.values()];if(K.length<2)return;const ie=K[1].x-K[0].x,he=K[1].y-K[0].y,ae=Math.hypot(ie,he)||1,fe=a.getBoundingClientRect(),ce=(K[0].x+K[1].x)/2-fe.left,be=(K[0].y+K[1].y)/2-fe.top,Ce=ae/y.startDist,Be=To(y.startScale*Ce,Eo,No),Lt=Be/y.startScale;i.current.tx=y.startMidX-(y.startMidX-y.startTx)*Lt+(ce-y.startMidX),i.current.ty=y.startMidY-(y.startMidY-y.startTy)*Lt+(be-y.startMidY),i.current.scale=Be,l()},W=F=>{var K;if(F.pointerType==="touch"&&b.has(F.pointerId)&&(b.delete(F.pointerId),v)){if(F.stopPropagation(),(K=a.hasPointerCapture)!=null&&K.call(a,F.pointerId))try{a.releasePointerCapture(F.pointerId)}catch{}b.size>=2?j():y=null,b.size===0&&(v=!1)}},ne=F=>{F.preventDefault();const K=a.getBoundingClientRect(),ie=F.clientX-K.left,he=F.clientY-K.top,ae=F.ctrlKey||F.metaKey;if(F.deltaX===0||ae){const be=Math.pow(ae?wT:xT,-F.deltaY),Ce=To(i.current.scale*be,Eo,No),Be=Ce/i.current.scale;i.current.tx=ie-(ie-i.current.tx)*Be,i.current.ty=he-(he-i.current.ty)*Be,i.current.scale=Ce}else i.current.tx-=F.deltaX,i.current.ty-=F.deltaY;l()},pe=F=>{const K=F.button===1,ie=f&&F.button===0;!K&&!ie||(F.preventDefault(),d=!0,u=F.pointerId,m=F.clientX,p=F.clientY,h=i.current.tx,g=i.current.ty,a.setPointerCapture(F.pointerId),a.style.cursor="grabbing")},$=F=>{!d||F.pointerId!==u||(i.current.tx=h+(F.clientX-m),i.current.ty=g+(F.clientY-p),l())},R=F=>{d&&F.pointerId===u&&(d=!1,a.releasePointerCapture(F.pointerId),a.style.cursor=f?"grab":"")},H=F=>{if(F.code==="Space"&&!f){const K=F.target;if(K&&(K.tagName==="INPUT"||K.tagName==="TEXTAREA"||K.isContentEditable))return;f=!0,a.style.cursor="grab",F.preventDefault()}},V=F=>{F.code==="Space"&&(f=!1,d||(a.style.cursor=""))};return a.addEventListener("wheel",ne,{passive:!1}),a.addEventListener("pointerdown",pe),a.addEventListener("pointermove",$),a.addEventListener("pointerup",R),a.addEventListener("pointercancel",R),a.addEventListener("pointerdown",S,{capture:!0}),a.addEventListener("pointermove",N,{capture:!0}),a.addEventListener("pointerup",W,{capture:!0}),a.addEventListener("pointercancel",W,{capture:!0}),window.addEventListener("keydown",H),window.addEventListener("keyup",V),l(),()=>{a.removeEventListener("wheel",ne),a.removeEventListener("pointerdown",pe),a.removeEventListener("pointermove",$),a.removeEventListener("pointerup",R),a.removeEventListener("pointercancel",R),a.removeEventListener("pointerdown",S,{capture:!0}),a.removeEventListener("pointermove",N,{capture:!0}),a.removeEventListener("pointerup",W,{capture:!0}),a.removeEventListener("pointercancel",W,{capture:!0}),window.removeEventListener("keydown",H),window.removeEventListener("keyup",V)}},[]),C.useMemo(()=>({screenToSvg(a,d){const u=e.current;if(!u)return[a,d];const m=u.getBoundingClientRect(),p=(a-m.left-i.current.tx)/i.current.scale,h=(d-m.top-i.current.ty)/i.current.scale;return[p,h]},getViewport(){return{...i.current}},setViewport(a){a.tx!==void 0&&(i.current.tx=a.tx),a.ty!==void 0&&(i.current.ty=a.ty),a.scale!==void 0&&(i.current.scale=To(a.scale,Eo,No)),l()},subscribe(a){return s.current.add(a),()=>{s.current.delete(a)}}}),[])}function To(e,t,n){return e<t?t:e>n?n:e}const rS=typeof navigator<"u"&&/Mac|iP(ad|hone|od)/.test(navigator.platform),jt=rS?"⌘":"Ctrl+",vT=rS?"⇧":"Shift+",Io=[10,20,50,100,200,500,1e3,2e3,5e3,1e4],kT=18;function ST(e){for(const t of Io)if(t*e>=kT)return t;return Io[Io.length-1]}function _T(){const e=re(),t=C.useRef(null),n=C.useRef(null),o=C.useRef(null),r=oS(t,n);fT(t,r),qN(t),C.useEffect(()=>(xi(r),()=>xi(null)),[r]),C.useEffect(()=>{const u=m=>{const p=o.current;if(!p)return;const g=ST(m.scale)*m.scale;p.setAttribute("width",String(g)),p.setAttribute("height",String(g)),p.setAttribute("patternTransform",`translate(${m.tx} ${m.ty})`)};return u(r.getViewport()),r.subscribe(u)},[r]);const i=X_(),s=C.useCallback((u,m,p)=>{const h=x.getState();if(h.readOnly)return;const g=h.activeTool;if(g==="wire"||g==="busbar"||g==="junction"||g==="place"){Q2();return}const f=dn(p),b=f?null:cn(p)??mt(p);if(f)h.selectedAnnotations.includes(f)||h.setSelectedAnnotation(f);else if(b)h.selection.includes(b)||h.setSelection([b]);else{const H=mo(p);H&&h.selectedNode!==H&&h.setSelectedNode(H)}const y=x.getState(),v=y.selection.length>0,j=y.selectedAnnotations.length>0,S=v||j,N=y.selectedNode!=null,W=!!y.clipboard,ne=y.diagram.elements.length>0,pe=new Set(y.selection),$=y.diagram.elements.some(H=>pe.has(H.id)&&H.labelOffset!==void 0),R=[{label:e("menu.undo"),shortcut:`${jt}Z`,icon:Fn,onSelect:()=>x.getState().undo(),disabled:y.past.length===0},{label:e("menu.redo"),shortcut:`${jt}${vT}Z`,icon:cr,onSelect:()=>x.getState().redo(),disabled:y.future.length===0},{type:"separator"},{label:e("menu.cut"),shortcut:`${jt}X`,icon:zs,onSelect:()=>x.getState().cutSelection(),disabled:!S},{label:e("menu.copy"),shortcut:`${jt}C`,icon:Es,onSelect:()=>x.getState().copySelection(),disabled:!S},{label:e("menu.paste"),shortcut:`${jt}V`,icon:$s,onSelect:()=>x.getState().pasteClipboard(),disabled:!W},{type:"separator"},{label:e("menu.rotate"),shortcut:"R",icon:Ps,onSelect:()=>x.getState().rotateSelection(90),disabled:!v},{label:e("menu.mirror"),shortcut:"M",icon:Ns,onSelect:()=>x.getState().mirrorSelection(),disabled:!v},{label:e("menu.resetLabel"),icon:Fn,onSelect:()=>x.getState().resetSelectionLabelOffset(),disabled:!$},{type:"separator"},{label:e("menu.selectAll"),shortcut:`${jt}A`,icon:p_,onSelect:()=>{const H=x.getState();H.setSelection(H.diagram.elements.map(V=>V.id))},disabled:!ne},{type:"separator"},{label:e(N&&!S?"menu.disconnect":"menu.delete"),shortcut:"Del",icon:Ds,destructive:!0,onSelect:()=>{const H=x.getState();N&&!S?H.deleteSelectedNode():H.deleteSelection()},disabled:!S&&!N}];i.open(u,m,R)},[i,e]);C.useEffect(()=>{const u=t.current;if(!u)return;const m=700,p=4;let h,g=null;const f=()=>{h!==void 0&&window.clearTimeout(h),h=void 0,g=null},b=j=>{j.pointerType==="touch"&&(f(),g={pointerId:j.pointerId,x:j.clientX,y:j.clientY,target:j.target},h=window.setTimeout(()=>{const S=g;g=null,h=void 0,S&&(Z2(u,S.pointerId),s(S.x,S.y,S.target))},m))},y=j=>{if(!g||j.pointerId!==g.pointerId)return;const S=j.clientX-g.x,N=j.clientY-g.y;Math.hypot(S,N)>p&&f()},v=j=>{!g||j.pointerId!==g.pointerId||f()};return u.addEventListener("pointerdown",b),u.addEventListener("pointermove",y),u.addEventListener("pointerup",v),u.addEventListener("pointercancel",v),()=>{f(),u.removeEventListener("pointerdown",b),u.removeEventListener("pointermove",y),u.removeEventListener("pointerup",v),u.removeEventListener("pointercancel",v)}},[s]);const l=u=>{u.dataTransfer.types.includes("application/x-oneline-kind")&&(u.preventDefault(),u.dataTransfer.dropEffect="copy")},a=u=>{if(x.getState().readOnly)return;const m=u.dataTransfer.getData("application/x-oneline-kind");if(!m)return;u.preventDefault();const p=r.screenToSvg(u.clientX,u.clientY);k2(m,p)},d=u=>{u.preventDefault(),s(u.clientX,u.clientY,u.target)};return c.jsx("div",{ref:t,className:"ole-canvas-root absolute inset-0 overflow-hidden",onDragOver:l,onDrop:a,onContextMenu:d,children:c.jsxs("svg",{className:"ole-canvas-svg block h-full w-full",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("defs",{children:c.jsx("pattern",{ref:o,id:"ole-grid-dots",width:20,height:20,patternUnits:"userSpaceOnUse",children:c.jsx("circle",{cx:0,cy:0,r:2,fill:"var(--canvas-grid-strong)"})})}),c.jsx("rect",{width:"100%",height:"100%",fill:"url(#ole-grid-dots)"}),c.jsxs("g",{ref:n,className:"ole-viewport",children:[c.jsx(q2,{}),c.jsx(Y2,{}),c.jsx(G2,{}),c.jsx(K2,{}),c.jsx(E2,{}),c.jsx(O2,{}),c.jsx(U2,{}),c.jsx(sN,{}),c.jsx(aN,{}),c.jsx(YE,{}),c.jsx(AN,{}),c.jsx(EN,{}),c.jsx(zN,{}),c.jsx(uN,{}),c.jsx(UE,{}),c.jsx(_N,{}),c.jsx(SN,{})]})]})})}const Vi=60,CT=.1,jT=8,AT=8,$T=["[data-element-id]","[data-wire-id]","[data-element-label]","[data-wire-label]","[data-annotation-id]"].join(", ");function ET(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(const i of e)i.width===0&&i.height===0||(i.left<t&&(t=i.left),i.top<n&&(n=i.top),i.right>o&&(o=i.right),i.bottom>r&&(r=i.bottom));return t===1/0?null:{left:t,top:n,right:o,bottom:r}}function NT(e,t,n){return e<t?t:e>n?n:e}function TT(){return document.querySelector(".ole-canvas-root")}function xr(){const e=Ke(),t=TT();return!e||!t?!1:Rn(e,t)}function Rn(e,t){const n=t.getBoundingClientRect();if(n.width===0||n.height===0)return!1;const o=t.querySelectorAll($T);if(o.length===0)return e.setViewport({tx:n.width/2,ty:n.height/2,scale:1}),!0;const r=ET(Array.from(o,v=>v.getBoundingClientRect()));if(!r)return!1;const{left:i,top:s,right:l,bottom:a}=r,[d,u]=e.screenToSvg(i,s),[m,p]=e.screenToSvg(l,a),h=Math.max(m-d,1),g=Math.max(p-u,1),f=NT(Math.min((n.width-Vi*2)/h,(n.height-Vi*2)/g),CT,jT),b=(d+m)/2,y=(u+p)/2;return e.setViewport({tx:n.width/2-f*b,ty:n.height/2-f*y,scale:f}),!0}function wr(){let e=AT;const t=()=>{xr()||--e>0&&requestAnimationFrame(t)};requestAnimationFrame(t)}const Ki=10,IT=100;function PT(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(hover: none), (pointer: coarse)").matches}function Xi(){const[e,t]=C.useState(BN()),[n,o]=C.useState(!1),[r,i]=C.useState(null),s=C.useRef(null),l=C.useRef(void 0),[a]=C.useState(PT);C.useEffect(()=>HN(g=>t(g)),[]),C.useEffect(()=>{if(window.clearTimeout(l.current),o(!1),i(null),!!e)return l.current=window.setTimeout(()=>o(!0),IT),()=>window.clearTimeout(l.current)},[e]);const d=x(g=>e?g.diagram.elements.find(f=>f.id===e)??null:null);if(C.useLayoutEffect(()=>{if(!n||!e)return;let g=0,f=-1,b=-1;const y=()=>{const v=document.querySelector(`[data-element-id="${zT(e)}"]`),j=s.current;if(v&&j){const S=v.getBoundingClientRect();let N=S.bottom+Ki;N+j.offsetHeight>window.innerHeight-4&&(N=S.top-j.offsetHeight-Ki);let W=S.left+S.width/2-j.offsetWidth/2;W=Math.max(4,Math.min(W,window.innerWidth-j.offsetWidth-4)),(N!==f||W!==b)&&(i({top:N,left:W}),f=N,b=W)}g=requestAnimationFrame(y)};return g=requestAnimationFrame(y),()=>cancelAnimationFrame(g)},[n,e]),a||!n||!e||!d)return null;const u=vt[d.kind],m=d.name??d.id,p=(u==null?void 0:u.name)??d.kind,h=d.name&&d.name!==d.id;return typeof document>"u"?null:_s.createPortal(c.jsxs("div",{ref:s,role:"tooltip",className:"ole-root ole-glass pointer-events-none fixed z-[100] flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] leading-snug shadow-md",style:{top:(r==null?void 0:r.top)??-9999,left:(r==null?void 0:r.left)??-9999,opacity:r?1:0,transition:"opacity 80ms ease-out"},children:[c.jsx("span",{className:"font-medium text-foreground",children:m}),h&&c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:d.id}),c.jsx("span",{className:"text-muted-foreground/80",children:"·"}),c.jsx("span",{className:"text-muted-foreground",children:p})]}),document.body)}function zT(e){return e.replace(/(["\\])/g,"\\$1")}function MT({width:e,children:t}){const n=e==null?"full":tT(e);return c.jsx(tS.Provider,{value:n,children:t})}function Ui(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function DT(...e){return t=>{let n=!1;const o=e.map(r=>{const i=Ui(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():Ui(e[r],null)}}}}var RT=Symbol.for("react.lazy"),Zn=Ee[" use ".trim().toString()];function OT(e){return typeof e=="object"&&e!==null&&"then"in e}function iS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===RT&&"_payload"in e&&OT(e._payload)}function LT(e){const t=HT(e),n=Ee.forwardRef((o,r)=>{let{children:i,...s}=o;iS(i)&&typeof Zn=="function"&&(i=Zn(i._payload));const l=Ee.Children.toArray(i),a=l.find(WT);if(a){const d=a.props.children,u=l.map(m=>m===a?Ee.Children.count(d)>1?Ee.Children.only(null):Ee.isValidElement(d)?d.props.children:null:m);return c.jsx(t,{...s,ref:r,children:Ee.isValidElement(d)?Ee.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var BT=LT("Slot");function HT(e){const t=Ee.forwardRef((n,o)=>{let{children:r,...i}=n;if(iS(r)&&typeof Zn=="function"&&(r=Zn(r._payload)),Ee.isValidElement(r)){const s=GT(r),l=qT(i,r.props);return r.type!==Ee.Fragment&&(l.ref=o?DT(o,s):s),Ee.cloneElement(r,l)}return Ee.Children.count(r)>1?Ee.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var FT=Symbol("radix.slottable");function WT(e){return Ee.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FT}function qT(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...l)=>{const a=i(...l);return r(...l),a}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function GT(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Yi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zi=Ls,VT=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return Zi(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(d=>{const u=n==null?void 0:n[d],m=i==null?void 0:i[d];if(u===null)return null;const p=Yi(u)||Yi(m);return r[d][p]}),l=n&&Object.entries(n).reduce((d,u)=>{let[m,p]=u;return p===void 0||(d[m]=p),d},{}),a=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,u)=>{let{class:m,className:p,...h}=u;return Object.entries(h).every(g=>{let[f,b]=g;return Array.isArray(b)?b.includes({...i,...l}[f]):{...i,...l}[f]===b})?[...d,m,p]:d},[]);return Zi(e,s,a,n==null?void 0:n.class,n==null?void 0:n.className)},KT=VT("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),De=Ee.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,...r},i)=>{const s=o?BT:"button";return c.jsx(s,{className:Se(KT({variant:t,size:n,className:e})),ref:i,...r})});De.displayName="Button";const XT=350;function Ne({content:e,children:t,disabled:n,delayMs:o=XT}){const r=C.useRef(null),i=C.useRef(null),[s,l]=C.useState(!1),[a,d]=C.useState(null),u=C.useId(),m=C.useRef(void 0),p=()=>{n||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>l(!0),o))},h=()=>{window.clearTimeout(m.current),l(!1)};C.useLayoutEffect(()=>{if(!s||!r.current||!i.current)return;const y=r.current.getBoundingClientRect(),v=i.current.getBoundingClientRect(),j=8;let S="top",N=y.top-v.height-j;N<4&&(S="bottom",N=y.bottom+j);let W=y.left+y.width/2-v.width/2;W=Math.max(4,Math.min(W,window.innerWidth-v.width-4)),d({top:N,left:W,side:S})},[s,e]),C.useEffect(()=>()=>window.clearTimeout(m.current),[]),C.useEffect(()=>{if(!s)return;const y=j=>{j.key==="Escape"&&l(!1)},v=()=>l(!1);return window.addEventListener("keydown",y),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("keydown",y),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[s]);const g=t,f=g.props,b=C.cloneElement(g,{ref:y=>{r.current=y;const v=g.ref;typeof v=="function"?v(y):v&&typeof v=="object"&&(v.current=y)},onPointerEnter:y=>{var v;(v=f.onPointerEnter)==null||v.call(f,y),p()},onPointerLeave:y=>{var v;(v=f.onPointerLeave)==null||v.call(f,y),h()},onFocus:y=>{var v;(v=f.onFocus)==null||v.call(f,y),p()},onBlur:y=>{var v;(v=f.onBlur)==null||v.call(f,y),h()},"aria-describedby":s?u:f["aria-describedby"]});return c.jsxs(c.Fragment,{children:[b,s&&typeof document<"u"&&_s.createPortal(c.jsx("div",{ref:i,id:u,role:"tooltip","data-side":(a==null?void 0:a.side)??"top",className:"ole-root ole-glass pointer-events-none fixed z-[100] max-w-[280px] rounded-md border border-border px-2 py-1 text-[11px] leading-snug text-foreground shadow-md",style:{top:(a==null?void 0:a.top)??-9999,left:(a==null?void 0:a.left)??-9999,opacity:a?1:0,transition:"opacity 80ms ease-out"},children:e}),document.body)]})}const Qi={default:"ctx.colorDefault",red:"ctx.colorRed",amber:"ctx.colorAmber",green:"ctx.colorGreen",blue:"ctx.colorBlue",gray:"ctx.colorGray"},Ji=12,UT=56;function YT(){var S;const e=re(),t=x(N=>N.selection),n=x(N=>N.selectedNode),o=x(N=>N.selectedWire),r=x(N=>N.activeTool),i=x(N=>N.rotateSelection),s=x(N=>N.mirrorSelection),l=x(N=>N.deleteSelection),a=x(N=>N.setSelectionColor),d=x(N=>N.selectedAnnotations),u=x(N=>N.deleteSelectedNode),m=x(N=>N.deleteSelectedWire),p=x(N=>N.resetWirePath),h=x(N=>N.internal.wireRenders),g=o!=null&&((S=h.get(o))==null?void 0:S.userEdited)===!0,f=C.useRef(null);C.useEffect(()=>{const N=f.current;if(!N)return;const W=t.length>0,ne=!W&&o!=null,pe=!W&&!ne&&n!=null;if(!((W||ne||pe)&&(r==="select"||r==="pan"))){N.style.display="none";return}N.style.display="flex";let R=0,H="";const V=()=>{let F=1/0,K=-1/0,ie=1/0,he=-1/0,ae=!1;const fe=ce=>{ce.width===0&&ce.height===0||(ce.left<F&&(F=ce.left),ce.right>K&&(K=ce.right),ce.top<ie&&(ie=ce.top),ce.bottom>he&&(he=ce.bottom),ae=!0)};if(W)for(const ce of t){const be=document.querySelector(`[data-element-id="${CSS.escape(ce)}"]`);be&&fe(be.getBoundingClientRect())}else if(ne&&o){const ce=document.querySelector(`polyline.ole-wire[data-wire-id="${CSS.escape(o)}"]`);ce&&fe(ce.getBoundingClientRect())}else if(pe&&n){const ce=document.querySelectorAll(`polyline.ole-wire[data-node-id="${CSS.escape(n)}"]`);for(const be of ce)fe(be.getBoundingClientRect())}if(ae){const ce=(F+K)/2;let be=ie-Ji,Ce="-100%";be<UT&&(be=he+Ji,Ce="0%");const Be=`translate3d(${ce}px, ${be}px, 0) translate(-50%, ${Ce})`;Be!==H&&(N.style.transform=Be,H=Be)}R=requestAnimationFrame(V)};return R=requestAnimationFrame(V),()=>cancelAnimationFrame(R)},[t,n,o,r]);const b=t.length===0&&o!=null,y=t.length===0&&!b&&n!=null,v=y||b,j=!y&&(t.length>0||o!=null||d.length>0);return c.jsxs("div",{ref:f,role:"toolbar","aria-label":e(b?"ctx.ariaWire":y?"ctx.ariaNode":"ctx.ariaElement"),className:"ole-glass pointer-events-auto fixed left-0 top-0 z-30 hidden items-center gap-0.5 rounded-2xl border border-border p-1 shadow-md",children:[b&&g&&o&&c.jsxs(c.Fragment,{children:[c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{children:c.jsx("span",{className:"font-medium",children:e("ctx.resetWirePath")})}),c.jsx("div",{className:"text-muted-foreground",children:e("ctx.resetWirePathHint")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>p(o),"aria-label":e("ctx.resetWirePath"),children:c.jsx(m_,{})})}),c.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),!v&&c.jsxs(c.Fragment,{children:[c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:e("ctx.rotate")}),c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"R"})]}),c.jsx("div",{className:"text-muted-foreground",children:e("ctx.rotateHint")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>i(90),"aria-label":e("ctx.rotate"),children:c.jsx(Ps,{})})}),c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:e("ctx.mirror")}),c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"M"})]}),c.jsx("div",{className:"text-muted-foreground",children:e("ctx.mirrorHint")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>s(),"aria-label":e("ctx.mirrorTitle"),children:c.jsx(Ns,{})})}),c.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),j&&c.jsxs(c.Fragment,{children:[c.jsx("div",{role:"group","aria-label":e("ctx.color"),className:"flex items-center gap-0.5",children:hr.map(N=>c.jsx(Ne,{content:e(Qi[N]),children:c.jsx("button",{type:"button",onClick:()=>a(N),"aria-label":e(Qi[N]),className:"ole-swatch flex size-7 items-center justify-center rounded-md transition-colors hover:bg-accent",children:c.jsx("span",{"aria-hidden":!0,className:`size-3.5 rounded-full border border-border bg-current ${Re(N)??""}`})})},N))}),c.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:e("ctx.delete")}),c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"Del"})]}),c.jsx("div",{className:"text-muted-foreground",children:e(b?"ctx.deleteHintWire":y?"ctx.deleteHintNode":"ctx.deleteHintElement")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",className:"size-7 text-destructive hover:text-destructive",onClick:()=>b?m():y?u():l(),"aria-label":e("ctx.delete"),children:c.jsx(Ds,{})})})]})}const es=8,ZT=56,rr=".ole-ann-cell-edit-fo",ir=".ole-free-annotation-edit-fo";function ts(){return document.querySelector(`${rr} input`)??document.querySelector(`${ir} [contenteditable]`)}function QT(){const e=re(),t=x(s=>s.editingAnnotation),n=x(s=>s.editingCell),o=C.useRef(null);C.useEffect(()=>{const s=o.current;if(!s)return;if(!t){s.style.display="none";return}s.style.display="flex";let l=0,a="";const d=()=>{const u=ts()??document.querySelector(rr)??document.querySelector(ir)??document.querySelector(`[data-annotation-id="${CSS.escape(t)}"]`);if(u){const m=u.getBoundingClientRect();let p=m.top-es,h="-100%";p<ZT&&(p=m.bottom+es,h="0%");const g=`translate3d(${m.left}px, ${p}px, 0) translate(0, ${h})`;g!==a&&(s.style.transform=g,a=g)}l=requestAnimationFrame(d)};return l=requestAnimationFrame(d),()=>cancelAnimationFrame(l)},[t,n]);const r=()=>{var s;(s=ts())==null||s.blur()},i=()=>{var d,u;const s=x.getState(),l=s.editingAnnotation,a=(d=s.diagram.annotations)==null?void 0:d.find(m=>m.id===l);if(!a){s.setEditingAnnotation(null);return}if(Xe(a)==="table"&&s.editingCell){const m=document.querySelector(`${rr} input`),[p,h]=s.editingCell;if(m){m.value=((u=a.cells[p])==null?void 0:u[h])??"",m.blur();return}}else{const m=document.querySelector(`${ir} [contenteditable]`);if(m){m.innerText=a.text??"",m.blur();return}}s.setEditingAnnotation(null)};return c.jsxs("div",{ref:o,role:"toolbar","aria-label":e("ctx.ariaEdit"),className:"ole-glass pointer-events-auto fixed left-0 top-0 z-40 hidden items-center gap-0.5 rounded-2xl border border-border p-1 shadow-md",children:[c.jsx(Ne,{content:c.jsxs("span",{className:"font-medium",children:[e("ctx.done")," · Enter"]}),children:c.jsx(De,{variant:"ghost",size:"icon",className:"size-7 text-emerald-600 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-400",onMouseDown:s=>s.preventDefault(),onClick:r,"aria-label":e("ctx.done"),children:c.jsx(ZS,{})})}),c.jsx(Ne,{content:c.jsxs("span",{className:"font-medium",children:[e("ctx.cancel")," · Esc"]}),children:c.jsx(De,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",onMouseDown:s=>s.preventDefault(),onClick:i,"aria-label":e("ctx.cancel"),children:c.jsx(Jn,{})})})]})}function yn({open:e,onOpenChange:t,trigger:n,children:o}){const r=C.useRef(null);return C.useEffect(()=>{if(!e)return;const i=l=>{r.current&&!r.current.contains(l.target)&&t(!1)},s=l=>{l.key==="Escape"&&t(!1)};return window.addEventListener("mousedown",i),window.addEventListener("keydown",s),()=>{window.removeEventListener("mousedown",i),window.removeEventListener("keydown",s)}},[e,t]),c.jsxs("div",{ref:r,className:"relative",children:[n,e&&c.jsx("div",{role:"menu",className:"ole-glass absolute bottom-full right-0 mb-1.5 min-w-52 rounded-md border border-border p-1 shadow-md",children:o})]})}const sS="ole-panel-open";function JT(){if(typeof window>"u")return{outlineOpen:!1};try{const e=window.localStorage.getItem(sS);if(!e)return{outlineOpen:!1};const t=JSON.parse(e);return typeof t!="object"||t===null?{outlineOpen:!1}:{outlineOpen:t.outline===!0}}catch{return{outlineOpen:!1}}}function ns(e){try{const t={outline:e.outlineOpen};window.localStorage.setItem(sS,JSON.stringify(t))}catch{}}const un=mn((e,t)=>({...JT(),setOutlineOpen:n=>{e({outlineOpen:n}),ns(t())},toggleOutline:()=>{e(n=>({outlineOpen:!n.outlineOpen})),ns(t())}})),On=[.1,.25,.5,.75,1,1.25,1.5,2,3,4,6,8],aS=.1,lS=8,cS="ole-grid";function e6(){try{const e=window.localStorage.getItem(cS);return e==null?!0:e==="1"}catch{return!0}}function t6(e){try{window.localStorage.setItem(cS,e?"1":"0")}catch{}}function n6(e,t,n){return e<t?t:e>n?n:e}function dS(){return document.querySelector(".ole-canvas-root")}function vr(e){const t=Ke(),n=dS();if(!t||!n)return;const o=n.getBoundingClientRect(),r=o.width/2,i=o.height/2,s=t.getViewport(),l=n6(e,aS,lS),a=l/s.scale;t.setViewport({tx:r-(r-s.tx)*a,ty:i-(i-s.ty)*a,scale:l})}function o6(){const e=Ke();if(!e)return;const t=e.getViewport().scale,n=On.find(o=>o>t+1e-6)??lS;vr(n)}function r6(){const e=Ke();if(!e)return;const t=e.getViewport().scale;let n=aS;for(let o=On.length-1;o>=0;o--)if(On[o]<t-1e-6){n=On[o];break}vr(n)}const Pn=[to,6,Ze,8,9,10,12,14,16,20,24,28,no];function i6(e){x.getState().dispatch(t=>{const n={...t.meta??{},labelMode:e};return{...t,meta:n}})}function sr(e){x.getState().dispatch(t=>{const n={...t.meta??{}};return e===Ze?delete n.labelFontSize:n.labelFontSize=e,{...t,meta:n}})}function os(e){var o;const t=zt((o=x.getState().diagram.meta)==null?void 0:o.labelFontSize);if(e>0){sr(Pn.find(r=>r>t)??no);return}let n=to;for(let r=Pn.length-1;r>=0;r--)if(Pn[r]<t){n=Pn[r];break}sr(n)}function uS(){const[e,t]=C.useState(()=>e6());return C.useEffect(()=>{const n=dS();n==null||n.classList.toggle("hide-grid",!e),t6(e)},[e]),C.useEffect(()=>{const n=o=>{if(o.metaKey||o.ctrlKey||o.altKey||o.key!=="g"&&o.key!=="G")return;const r=o.target;r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||(o.preventDefault(),t(i=>!i))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),[e,t]}function mS(){const e=re();return c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.zoomOut")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.zoomOutHint")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",onClick:r6,"aria-label":e("view.zoomOut"),children:c.jsx(lr,{})})})}function pS(){const e=re();return c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.zoomIn")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.zoomInHint")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",onClick:o6,"aria-label":e("view.zoomIn"),children:c.jsx(Is,{})})})}function hS(){const e=re(),[t,n]=C.useState(bT);return C.useEffect(()=>yT(n),[]),c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.reset")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.current",{z:Math.round(t*100)})})]}),children:c.jsxs("button",{type:"button",onClick:()=>vr(1),className:"min-w-12 rounded-md px-2 py-1 text-center text-xs tabular-nums text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":e("view.reset"),children:[Math.round(t*100),"%"]})})}function fS(){const e=re();return c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.fit")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.fitHint")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",onClick:xr,"aria-label":e("view.fit"),children:c.jsx(a_,{})})})}function gS({grid:e,setGrid:t}){const n=re();return c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:n(e?"view.gridHide":"view.gridShow")}),c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:n("view.gridHotkey")})]}),c.jsx("div",{className:"text-muted-foreground",children:n(e?"view.gridHideHint":"view.gridShowHint")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",onClick:()=>t(o=>!o),"aria-label":n(e?"view.gridHideAria":"view.gridShowAria"),"aria-pressed":e,className:Se(!e&&"text-muted-foreground/60"),children:c.jsx(i_,{})})})}function bS(){const e=re(),t=x(r=>{var i;return((i=r.diagram.meta)==null?void 0:i.labelMode)??"all"}),n=x(r=>{var i;return zt((i=r.diagram.meta)==null?void 0:i.labelFontSize)}),o=[{value:"off",label:e("view.labelOff")},{value:"id",label:e("view.labelId")},{value:"all",label:e("view.labelAll")}];return c.jsxs("div",{className:"flex flex-col gap-1.5 px-1.5 py-1",children:[c.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:e("view.label")}),c.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:o.map(r=>c.jsx("button",{type:"button","aria-pressed":t===r.value,onClick:()=>i6(r.value),className:Se("h-7 flex-1 whitespace-nowrap px-1.5 text-[11px] transition-colors",t===r.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.label},r.value))}),c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-[11px] text-muted-foreground",children:e("view.labelSize")}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{type:"button","aria-label":e("view.labelSizeSmaller"),disabled:n<=to,onClick:()=>os(-1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"−"}),c.jsx("button",{type:"button","aria-label":e("view.labelSizeReset"),onClick:()=>sr(Ze),className:"w-9 rounded-md py-1 text-center font-mono text-[11px] tabular-nums hover:bg-accent hover:text-accent-foreground",children:n}),c.jsx("button",{type:"button","aria-label":e("view.labelSizeLarger"),disabled:n>=no,onClick:()=>os(1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"+"})]})]})]})}function s6(e){x.getState().dispatch(t=>{const n={...t.meta??{}};return e==="iec"?delete n.symbolStandard:n.symbolStandard=e,{...t,meta:n}})}function yS(){const e=re(),t=x(o=>{var r;return((r=o.diagram.meta)==null?void 0:r.symbolStandard)??"iec"}),n=[{value:"iec",label:e("view.standardIec")},{value:"ansi",label:e("view.standardAnsi")}];return c.jsxs("div",{className:"flex flex-col gap-1.5 px-1.5 py-1",children:[c.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:e("view.standard")}),c.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:n.map(o=>c.jsx("button",{type:"button","aria-pressed":t===o.value,onClick:()=>s6(o.value),className:Se("h-7 flex-1 whitespace-nowrap px-1.5 text-[11px] transition-colors",t===o.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:o.label},o.value))}),c.jsx("div",{className:"max-w-[210px] text-[10px] leading-snug text-muted-foreground",children:e("view.standardHint")})]})}function a6(){const e=re(),[t,n]=C.useState(!1),o=x(r=>{var i;return((i=r.diagram.meta)==null?void 0:i.labelMode)??"all"});return c.jsxs(yn,{open:t,onOpenChange:n,trigger:c.jsx(Ne,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.label")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.labelHint")})]}),children:c.jsx(De,{variant:"ghost",size:"icon",onClick:()=>n(r=>!r),"aria-label":e("view.label"),"aria-expanded":t,className:Se(o==="off"&&"text-muted-foreground/60"),children:c.jsx(Rs,{})})}),children:[c.jsx(bS,{}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(yS,{})]})}function l6({stacked:e}={}){const t=re(),[n,o]=C.useState(!1),[r,i]=uS(),s=c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:t("view.menu")}),c.jsx("div",{className:"text-muted-foreground",children:t("view.menuHint")})]}),l=e?c.jsx(Ne,{content:s,children:c.jsxs("button",{type:"button",onClick:()=>o(a=>!a),"aria-label":t("view.menu"),"aria-pressed":n,className:Se("flex h-12 w-12 flex-col items-center justify-center gap-0.5 rounded-md text-[10px] font-medium leading-tight transition-colors",n?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[c.jsx(Ro,{className:"size-4"}),c.jsx("span",{className:"max-w-full truncate",children:t("view.menu")})]})}):c.jsx(Ne,{content:s,children:c.jsx(De,{variant:"ghost",size:"icon",onClick:()=>o(a=>!a),"aria-label":t("view.menu"),"aria-pressed":n,children:c.jsx(Ro,{})})});return c.jsx(yn,{open:n,onOpenChange:o,trigger:l,children:c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx(hS,{}),c.jsxs("div",{className:"flex items-center gap-0.5",children:[c.jsx(mS,{}),c.jsx(pS,{})]}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsxs("div",{className:"flex items-center gap-0.5",children:[c.jsx(fS,{}),c.jsx(gS,{grid:r,setGrid:i})]}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(bS,{}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(yS,{})]})})}function rs(){const e=ht();return!x(n=>n.readOnly)&&We(e,"dense")?null:c.jsx(c6,{tier:e})}function c6({tier:e}){const t=We(e,"tight"),n=x(i=>i.readOnly),[o,r]=uS();return c.jsx("div",{className:"absolute z-50",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))",right:"calc(0.75rem + env(safe-area-inset-right, 0px))"},children:c.jsxs("div",{className:"ole-glass flex items-center gap-0.5 rounded-2xl border border-border p-1.5 shadow-sm",children:[c.jsx(mS,{}),!t&&c.jsx(hS,{}),c.jsx(pS,{}),c.jsx("div",{"aria-hidden":!0,className:"mx-1 h-4 w-px bg-border"}),c.jsx(fS,{}),c.jsx(gS,{grid:o,setGrid:r}),!n&&c.jsx(a6,{})]})})}const xS=[{id:"select",labelKey:"tool.select",hotkey:"V",descriptionKey:"tool.selectHint",icon:l_,switchTo:"select",iconOnly:!0},{id:"pan",labelKey:"tool.pan",hotkey:"H",descriptionKey:"tool.panHint",icon:s_,switchTo:"pan",groupBreakAfter:!0,iconOnly:!0},{id:"busbar",labelKey:"tool.bus",hotkey:"B",descriptionKey:"tool.busHint",icon:lr,switchTo:"busbar"},{id:"junction",labelKey:"tool.junction",hotkey:"J",descriptionKey:"tool.junctionHint",icon:QS,switchTo:"junction",iconOnly:!0},{id:"place",labelKey:"tool.place",hotkey:"P",descriptionKey:"tool.placeHint",icon:Ms,switchTo:"place"},{id:"wire",labelKey:"tool.wire",hotkey:"W",descriptionKey:"tool.wireHint",icon:js,switchTo:"wire",groupBreakAfter:!0},{id:"text",labelKey:"tool.text",hotkey:"T",descriptionKey:"tool.textHint",icon:Rs,switchTo:"text",iconOnly:!0,drawing:!0},{id:"rect",labelKey:"tool.rect",hotkey:"F",descriptionKey:"tool.rectHint",icon:h_,switchTo:"rect",iconOnly:!0,drawing:!0},{id:"ellipse",labelKey:"tool.ellipse",hotkey:"O",descriptionKey:"tool.ellipseHint",icon:JS,switchTo:"ellipse",iconOnly:!0,drawing:!0},{id:"line",labelKey:"tool.line",hotkey:"L",descriptionKey:"tool.lineHint",icon:u_,switchTo:"line",iconOnly:!0,drawing:!0},{id:"table",labelKey:"tool.table",hotkey:"D",descriptionKey:"tool.tableHint",icon:f_,switchTo:"table",iconOnly:!0,drawing:!0}],is=xS.filter(e=>e.drawing),ss=xS.filter(e=>!e.drawing);function d6(){const e=re(),t=x(p=>p.activeTool),n=x(p=>p.placeKind),o=x(p=>p.placeFromTerminal),r=x(p=>p.wireDragFrom),i=x(p=>p.busbarDrawStart),s=x(p=>p.selection.length>0||p.selectedNode!=null),l=x(p=>p.editingAnnotation),a=x(p=>{var f;const h=Pt(p);if(!h)return null;const g=(f=p.diagram.annotations)==null?void 0:f.find(b=>b.id===h);return g?Xe(g):null});if(l)return c.jsx("div",{className:"ole-glass pointer-events-none flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground shadow-sm",children:c.jsx("span",{children:e("mode.annEditing")})});let d=null,u=!1;switch(t){case"select":if(a){d=e(a==="table"?"mode.annTableSel":a==="text"?"mode.annTextSel":"mode.annShapeSel"),u=!0;break}d=e(s?"mode.selectWithSel":"mode.selectEmpty"),s&&(u=!0);break;case"pan":d=e("mode.pan");break;case"wire":d=e(r?"mode.wireDragging":"mode.wireInit"),u=!0;break;case"busbar":d=e(i?"mode.busDragging":"mode.busInit"),u=!0;break;case"junction":d=e("mode.junction"),u=!0;break;case"place":n?o?d=e("mode.placeFromTerm"):d=e("mode.placeNormal"):d=e("mode.placeNoKind"),u=!0;break;case"text":d=e("mode.text"),u=!0;break;case"rect":d=e("mode.rect"),u=!0;break;case"ellipse":d=e("mode.ellipse"),u=!0;break;case"line":d=e("mode.line"),u=!0;break;case"table":d=e("mode.table"),u=!0;break}if(!d)return null;const m=e(t==="select"?"mode.escSelect":"mode.escOther");return c.jsxs("div",{className:"ole-glass pointer-events-none flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground shadow-sm",children:[c.jsx("span",{children:d}),u&&c.jsxs("span",{className:"text-muted-foreground/70",children:["· ",m]})]})}function u6(){const e=re(),t=x(y=>y.activeTool),n=x(y=>y.placeKind),o=x(y=>y.setActiveTool),r=x(y=>y.past.length),i=x(y=>y.future.length),s=x(y=>y.undo),l=x(y=>y.redo),a=ht(),d=We(a,"tight"),u=!We(a,"dense"),m=We(a,"dense"),p=new Set(["select"]),h=m?ss.filter(y=>!p.has(y.id)):ss,g=y=>t===y.switchTo,[f,b]=C.useState(!1);return c.jsxs("div",{className:"absolute left-1/2 z-20 flex -translate-x-1/2 flex-col items-center gap-1.5",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))"},children:[u&&c.jsx("div",{className:Se("transition-opacity duration-150",f&&"pointer-events-none opacity-0"),children:c.jsx(d6,{})}),c.jsxs("div",{onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),className:Se("ole-glass flex flex-row items-center rounded-2xl border border-border shadow-sm",m?"gap-0.5 p-1":"gap-0.5 p-1.5"),children:[m&&c.jsx(m6,{stacked:!0}),h.map(y=>{const v=y.icon,j=g(y),S=y.id==="place"&&j&&n==null?e("tool.placeNoKindTooltip"):e(y.descriptionKey);return c.jsxs(C.Fragment,{children:[c.jsx(wt,{icon:v,label:e(y.labelKey),hotkey:y.hotkey,active:j,iconOnly:!m&&(y.iconOnly||d),stacked:m,description:S,onClick:()=>{o(y.switchTo,{placeKind:y.presetPlaceKind!==void 0?y.presetPlaceKind:void 0})}}),y.groupBreakAfter&&!m&&c.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"})]},y.id)}),c.jsx(f6,{stacked:m}),!m&&c.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"}),m?c.jsx(g6,{stacked:!0}):c.jsxs(c.Fragment,{children:[c.jsx(wt,{icon:Fn,label:e("tool.undo"),hotkey:"⌘Z",description:e("tool.undoHint"),iconOnly:!0,disabled:r===0,onClick:s}),c.jsx(wt,{icon:cr,label:e("tool.redo"),hotkey:"⌘⇧Z",description:e("tool.redoHint"),iconOnly:!0,disabled:i===0,onClick:l}),c.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"}),c.jsx(p6,{iconOnly:d})]}),m&&c.jsx(l6,{stacked:!0})]})]})}function m6({stacked:e}){const t=re(),n=un(r=>r.outlineOpen),o=un(r=>r.toggleOutline);return c.jsx(wt,{icon:Ts,label:t("outline.title"),active:n,iconOnly:!0,stacked:e,onClick:o})}function wt({icon:e,label:t,hotkey:n,active:o,disabled:r,iconOnly:i,stacked:s,onClick:l,description:a,hasMenu:d,suppressTooltip:u}){const m=c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:t}),n&&c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:n})]}),a&&c.jsx("div",{className:"text-muted-foreground",children:a})]});return c.jsx(Ne,{content:m,disabled:r||u,children:c.jsxs("button",{type:"button",onClick:l,disabled:r,"aria-label":t,"aria-pressed":o,className:Se("rounded-md font-medium transition-colors",s?"flex h-12 w-12 flex-col items-center justify-center gap-0.5 text-[10px] leading-tight":"flex h-9 items-center gap-1.5 text-xs",!s&&(i?"w-9 justify-center":"px-2.5"),o?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground",r&&"pointer-events-none opacity-40"),children:[c.jsxs("span",{className:"relative inline-flex shrink-0",children:[c.jsx(e,{className:"size-4"}),d&&(i||s)&&c.jsx("span",{"aria-hidden":!0,className:Se("pointer-events-none absolute -bottom-[3px] -right-[3px] border-b-[3px] border-l-[3px] border-b-current border-l-transparent",o?"text-primary-foreground/70":"text-muted-foreground/60")}),n&&!s&&c.jsx("span",{"aria-hidden":!0,className:Se("pointer-events-none absolute -right-1.5 -top-1.5 rounded-sm px-1 font-mono text-[8px] leading-[1.1]",o?"bg-primary-foreground/20 text-primary-foreground/85":"bg-foreground/10 text-muted-foreground"),children:n})]}),s?c.jsx("span",{className:"max-w-full truncate",children:t}):!i&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:t}),d&&c.jsx(As,{"aria-hidden":!0,className:Se("-ml-0.5 size-3 shrink-0",o?"opacity-70":"opacity-50")})]})]})})}function wS(){const e=x(r=>r.diagram.elements),t=x(r=>r.diagram.layout),n=x(r=>r.selection),o=t??{};return{hasAnyElement:e.length>0,hasArrangedAny:Object.keys(o).length>0,hasGapsAll:e.some(r=>!o[r.id]),hasSelection:n.length>0,selectionHasArranged:n.some(r=>!!o[r]),selectionHasGaps:n.some(r=>!o[r])}}function p6({iconOnly:e}){const t=re(),[n,o]=C.useState(!1),r=wS(),i=s=>()=>{o(!1),s()};return c.jsxs(yn,{open:n,onOpenChange:o,trigger:c.jsx(wt,{icon:Qt,label:t("layout.label"),description:t("layout.hint"),active:n,iconOnly:e,onClick:()=>o(s=>!s)}),children:[c.jsx(Oe,{onClick:i(()=>x.getState().autoArrangeAll()),icon:c.jsx(Qt,{}),disabled:!r.hasAnyElement||!r.hasArrangedAny,children:t("layout.allAuto")}),c.jsx(Oe,{onClick:i(()=>x.getState().autoArrangeSelection()),icon:c.jsx(Qt,{}),disabled:!r.hasSelection||!r.selectionHasArranged,children:t("layout.selAuto")}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(Oe,{onClick:i(()=>x.getState().fillUnplacedAll()),icon:c.jsx(Hn,{}),disabled:!r.hasGapsAll,children:t("layout.allFill")}),c.jsx(Oe,{onClick:i(()=>x.getState().fillUnplacedSelection()),icon:c.jsx(Hn,{}),disabled:!r.hasSelection||!r.selectionHasGaps,children:t("layout.selFill")})]})}function h6({className:e}){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",className:e,"aria-hidden":!0,children:[c.jsx("rect",{x:"1.25",y:"1.25",width:"8.5",height:"8.5",rx:"1"}),c.jsx("circle",{cx:"10.5",cy:"10.5",r:"4.25"})]})}function f6({stacked:e}){const t=re(),[n,o]=C.useState(!1),r=x(a=>a.activeTool),i=x(a=>a.setActiveTool),s=is.find(a=>a.switchTo===r),l=(s==null?void 0:s.icon)??h6;return c.jsx(yn,{open:n,onOpenChange:o,trigger:c.jsx(wt,{icon:l,label:t("tool.draw"),description:t("tool.drawHint"),active:!!s||n,iconOnly:!1,hasMenu:!0,suppressTooltip:n,stacked:e,onClick:()=>o(a=>!a)}),children:is.map(a=>{const d=a.icon;return c.jsx(Oe,{onClick:()=>{o(!1),i(a.switchTo)},icon:c.jsx(d,{}),active:r===a.switchTo,hotkey:a.hotkey,children:t(a.labelKey)},a.id)})})}function g6({stacked:e}){const t=re(),[n,o]=C.useState(!1),r=x(p=>p.past.length),i=x(p=>p.future.length),s=x(p=>p.undo),l=x(p=>p.redo),a=x(p=>p.selection.length>0),d=x(p=>p.clipboard!=null),u=wS(),m=p=>()=>{o(!1),p()};return c.jsxs(yn,{open:n,onOpenChange:o,trigger:c.jsx(wt,{icon:Ro,label:t("tool.more"),description:t("tool.moreHint"),active:n,iconOnly:!0,stacked:e,onClick:()=>o(p=>!p)}),children:[c.jsx(Oe,{onClick:m(s),icon:c.jsx(Fn,{}),disabled:r===0,children:t("tool.undo")}),c.jsx(Oe,{onClick:m(l),icon:c.jsx(cr,{}),disabled:i===0,children:t("tool.redo")}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(Oe,{onClick:m(()=>x.getState().cutSelection()),icon:c.jsx(zs,{}),disabled:!a,children:t("menu.cut")}),c.jsx(Oe,{onClick:m(()=>x.getState().copySelection()),icon:c.jsx(Es,{}),disabled:!a,children:t("menu.copy")}),c.jsx(Oe,{onClick:m(()=>x.getState().pasteClipboard()),icon:c.jsx($s,{}),disabled:!d,children:t("menu.paste")}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(Oe,{onClick:m(()=>x.getState().autoArrangeAll()),icon:c.jsx(Qt,{}),disabled:!u.hasAnyElement||!u.hasArrangedAny,children:t("layout.allAuto")}),c.jsx(Oe,{onClick:m(()=>x.getState().autoArrangeSelection()),icon:c.jsx(Qt,{}),disabled:!u.hasSelection||!u.selectionHasArranged,children:t("layout.selAuto")}),c.jsx(Oe,{onClick:m(()=>x.getState().fillUnplacedAll()),icon:c.jsx(Hn,{}),disabled:!u.hasGapsAll,children:t("layout.allFill")}),c.jsx(Oe,{onClick:m(()=>x.getState().fillUnplacedSelection()),icon:c.jsx(Hn,{}),disabled:!u.hasSelection||!u.selectionHasGaps,children:t("layout.selFill")})]})}function Oe({children:e,icon:t,onClick:n,disabled:o,active:r,hotkey:i}){return c.jsxs("button",{type:"button",role:"menuitem","aria-current":r?"true":void 0,disabled:o,onClick:n,className:Se("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",r&&"bg-accent/60 font-medium text-accent-foreground",o&&"pointer-events-none text-muted-foreground opacity-60 hover:bg-transparent"),children:[t,c.jsx("span",{className:"flex-1",children:e}),i&&c.jsx("kbd",{className:"ml-2 shrink-0 font-mono text-[10px] text-muted-foreground",children:i})]})}function b6(){const e=un(r=>r.outlineOpen),t=un(r=>r.setOutlineOpen),n=ht();return We(n,"dense")?e?c.jsx("div",{className:"absolute z-10",style:{left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",bottom:"calc(4rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px) + 0.75rem)"},children:c.jsx(as,{onClose:()=>t(!1),sheet:!0})}):null:c.jsx("div",{className:"absolute z-10 flex flex-col items-start",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))",left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",maxHeight:"calc(100% - 1.5rem)"},children:e?c.jsx(as,{onClose:()=>t(!1)}):c.jsx(y6,{onClick:()=>t(!0)})})}function y6({onClick:e}){const t=re(),n=ht(),o=We(n,"compact");return c.jsxs("button",{type:"button",onClick:e,"aria-label":t("outline.title"),title:t("outline.title"),className:Se("ole-glass flex h-12 items-center rounded-2xl border border-border text-muted-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",o?"w-12 justify-center":"gap-2 px-3"),children:[c.jsx(Ts,{className:"size-4 shrink-0"}),!o&&c.jsx("span",{className:"text-xs font-medium",children:t("outline.title")})]})}function as({onClose:e,sheet:t}){const n=re(),o=x(d=>d.diagram.elements),r=x(d=>d.activeTool==="place"),i=ht(),s=We(i,"compact"),l=We(i,"dense"),a=t?"min(50vh, calc(100vh - 9rem))":r?"min(40vh, calc(100vh - 200px))":"min(70vh, calc(100vh - 100px))";return c.jsxs("aside",{className:Se("ole-glass flex flex-col overflow-hidden rounded-2xl border border-border shadow-sm",t?"w-full":s?"w-52":"w-64"),style:{height:a},children:[c.jsxs("button",{type:"button",onClick:e,"aria-label":n("outline.collapseAria"),title:n("outline.collapse"),className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2 text-left transition-colors hover:bg-muted/40",children:[c.jsx("span",{className:"flex-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:n("outline.title")}),!l&&c.jsx(w6,{children:o.length}),c.jsx(c_,{className:"size-3.5 text-muted-foreground"})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:o.length===0?c.jsx("p",{className:"px-2 py-2 text-xs italic text-muted-foreground",children:n("outline.empty")}):c.jsx("ul",{className:"space-y-px",children:o.map(d=>c.jsx(x6,{element:d},d.id))})})]})}function x6({element:e}){const t=x(a=>a.internal.library.get(e.kind)),n=x(a=>a.selection.includes(e.id)),o=x(a=>a.setSelection),r=x(a=>a.toggleInSelection),i=ht(),s=!We(i,"compact"),l=a=>{a.shiftKey||a.metaKey||a.ctrlKey?r(e.id):o([e.id])};return c.jsxs("li",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1 hover:bg-accent data-[selected=true]:bg-[color-mix(in_oklch,var(--selection)_18%,transparent)]",title:e.note??`${e.name??e.id} (${e.kind})`,"data-element-id":e.id,"data-selected":n?"true":void 0,onClick:l,children:[c.jsx("div",{className:"flex h-4 w-6 shrink-0 items-center justify-center",children:t&&c.jsx("svg",{viewBox:t.viewBox,className:"ole-symbol size-full",preserveAspectRatio:"xMidYMid meet",dangerouslySetInnerHTML:{__html:t.svg}})}),c.jsx("span",{className:"flex-1 truncate text-xs text-foreground/90 group-hover:text-accent-foreground",children:e.name??e.id}),s&&c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:e.id})]})}function w6({children:e}){return c.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e})}const v6={"arc-suppression-coil.name":"消弧线圈","arrester.name":"避雷器 (FBL)","async-motor.name":"异步电动机","autotransformer.name":"自耦变压器","battery.name":"电池储能","breaker.name":"断路器 (QF)","busbar.name":"母线段","busduct.name":"母线槽","busduct-tap.name":"母线槽插接段","converter-bidir.name":"双向变流器 (PCS)","dc-dc-converter.name":"DC/DC 变换器","mppt.name":"MPPT 控制器","ct.name":"电流互感器 (CT)","disconnector.name":"隔离开关 (QS)","earth.name":"接地","earthing-switch.name":"接地刀闸 (QE)","fuse.name":"熔断器 (FU)","generator.name":"发电机 (G)","grid-source.name":"系统电源","grounding-transformer.name":"接地变 (Z形)","inverter.name":"逆变器 (DC→AC)","load-switch.name":"负荷开关","load.name":"负荷","luminaire.name":"灯具 / 照明负荷","panelboard.name":"配电箱","ngr.name":"中性点电阻 (NGR)","pt.name":"电压互感器 (PT)","pv.name":"光伏组件","rectifier.name":"整流器 (AC→DC)","series-reactor.name":"串联电抗器","shunt-capacitor.name":"并联电容器","shunt-reactor.name":"并联电抗器","sync-motor.name":"同步电动机","transformer-2w.name":"双绕组变压器","transformer-3w.name":"三绕组变压器","wind-turbine.name":"风力发电机","gfci-breaker.name":"GFCI 断路器 (RCBO)","rcd.name":"剩余电流装置 (RCD)","recloser.name":"重合闸 (Recloser)","energy-meter.name":"电能表 (Wh)","voltmeter.name":"电压表 (V)","ammeter.name":"电流表 (A)","wattmeter.name":"功率表 (W)","frequency-meter.name":"频率表 (Hz)","contactor.name":"接触器 (KM)","motor-starter.name":"电机启动器","thermal-overload.name":"热过载继电器","vfd.name":"变频器 (VFD)","soft-starter.name":"软启动器","transfer-switch.name":"切换开关 (ATS)","dc-disconnector.name":"直流隔离开关","dc-combiner.name":"直流汇流箱","ev-charger.name":"EV 充电桩","arc-suppression-coil.desc":"中性点谐振接地:电感线圈连接到地","busbar.desc":"可拉伸单母线段,多设备挂接","busduct.desc":"封闭式母线槽直线段(IEC 60617-11-17)","busduct-tap.desc":"带固定插接口的母线槽段,插接口向下引出","converter-bidir.desc":"储能变流器:双向 AC ↔ DC","dc-dc-converter.desc":"DC/DC 变换器 / 直流充电器(IEC 60617)","mppt.desc":"MPPT 太阳能充电控制器(DC/DC,最大功率点跟踪)","earthing-switch.desc":"隔离开关 + 接地连接,单端口","grid-source.desc":"无穷大母线 / 外部电网","grounding-transformer.desc":"星-曲折接线变压器,中性点接地用","load.desc":"抽象负荷(电流流出箭头)","luminaire.desc":"照明负荷(IEC 60617 荧光灯具通用符号)","panelboard.desc":"配电箱 / 负荷中心(IEC 分配中心符号):底部进线,箱顶分路示意","ngr.desc":"小电阻接地:连接变压器中性点到地","series-reactor.desc":"与并联电抗器同符号;通过用法区分","wind-turbine.desc":"风机:发电机 + 三叶轮标记","gfci-breaker.desc":"剩余电流断路器带过流保护 (UL943 / IEC 61009)。北美 GFCI / 欧洲 RCBO。","rcd.desc":"不带过流保护的剩余电流断路器 (IEC 61008)。","recloser.desc":"中压自动重合闸开关。","energy-meter.desc":"有功电能表 (kWh) — 服务入口 / 子表。","contactor.desc":"主回路接触器, 通常配热继电器和电机使用。","motor-starter.desc":"电机启动器 (IEC 60617 通用符号)。","thermal-overload.desc":"电机热过载保护继电器, 通常串接在接触器和电机之间。","vfd.desc":"Variable Frequency Drive — 异步电动机调速。","soft-starter.desc":"电机软启动器 (晶闸管降压启动)。","transfer-switch.desc":"双源切换开关 (Automatic / Manual Transfer Switch)。两个电源输入 + 一个负荷输出, 互锁不并联。","dc-disconnector.desc":"DC 隔离开关 — 光伏组串 / 储能 直流侧隔离。","dc-combiner.desc":"光伏组串汇流箱 (4 路输入示例)。","ev-charger.desc":"电动汽车充电站 / 充电桩。","breaker.state.open":"断开","disconnector.state.open":"断开","earthing-switch.state.open":"断开","fuse.state.blown":"熔断","load-switch.state.open":"断开","gfci-breaker.state.open":"断开","rcd.state.open":"断开","recloser.state.open":"断开","contactor.state.open":"断开","thermal-overload.state.tripped":"动作","transfer-switch.state.position":"位置 (normal/emergency/off)","dc-disconnector.state.open":"断开","battery.param.E":"容量","busbar.param.Un":"额定电压","busduct.param.In":"额定电流","busduct.param.Un":"额定电压","busduct-tap.param.In":"额定电流","busduct-tap.param.Itap":"插接口电流","converter-bidir.param.S":"容量","dc-dc-converter.param.P":"功率","mppt.param.I":"额定电流","load.param.P":"有功功率","load.param.cosphi":"功率因数","ngr.param.R":"电阻","shunt-capacitor.param.Q":"无功容量","shunt-capacitor.param.stages":"分组数","transformer-2w.param.S":"容量","transformer-2w.param.ratio":"变比","gfci-breaker.param.In":"额定电流","panelboard.param.In":"额定电流","gfci-breaker.param.IDn":"剩余动作电流","rcd.param.IDn":"剩余动作电流","breaker.param.In":"额定电流","breaker.param.poles":"极数","breaker.param.Icu":"分断能力","disconnector.param.In":"额定电流","fuse.param.In":"额定电流"},k6={"arc-suppression-coil.name":"Arc-suppression coil","arrester.name":"Surge arrester (FBL)","async-motor.name":"Asynchronous motor","autotransformer.name":"Autotransformer","battery.name":"Battery storage","breaker.name":"Circuit breaker (QF)","busbar.name":"Busbar segment","busduct.name":"Busduct (busway)","busduct-tap.name":"Busduct with tap-off","converter-bidir.name":"Bidirectional converter (PCS)","dc-dc-converter.name":"DC/DC converter","mppt.name":"MPPT controller","ct.name":"Current transformer (CT)","disconnector.name":"Disconnector (QS)","earth.name":"Earth","earthing-switch.name":"Earthing switch (QE)","fuse.name":"Fuse (FU)","generator.name":"Generator (G)","grid-source.name":"Grid source","grounding-transformer.name":"Grounding transformer (zig-zag)","inverter.name":"Inverter (DC→AC)","load-switch.name":"Load break switch","load.name":"Load","luminaire.name":"Luminaire (lighting load)","panelboard.name":"Panelboard / load center","ngr.name":"Neutral grounding resistor (NGR)","pt.name":"Voltage transformer (PT)","pv.name":"PV module","rectifier.name":"Rectifier (AC→DC)","series-reactor.name":"Series reactor","shunt-capacitor.name":"Shunt capacitor","shunt-reactor.name":"Shunt reactor","sync-motor.name":"Synchronous motor","transformer-2w.name":"Two-winding transformer","transformer-3w.name":"Three-winding transformer","wind-turbine.name":"Wind turbine","gfci-breaker.name":"GFCI breaker (RCBO)","rcd.name":"Residual current device (RCD)","recloser.name":"Recloser","energy-meter.name":"Energy meter (Wh)","voltmeter.name":"Voltmeter (V)","ammeter.name":"Ammeter (A)","wattmeter.name":"Wattmeter (W)","frequency-meter.name":"Frequency meter (Hz)","contactor.name":"Contactor (KM)","motor-starter.name":"Motor starter","thermal-overload.name":"Thermal overload relay","vfd.name":"Variable frequency drive (VFD)","soft-starter.name":"Soft starter","transfer-switch.name":"Transfer switch (ATS)","dc-disconnector.name":"DC disconnector","dc-combiner.name":"DC combiner box","ev-charger.name":"EV charger","arc-suppression-coil.desc":"Resonant neutral grounding: inductor to earth","busbar.desc":"Stretchable single-bus segment with multiple taps","busduct.desc":"Straight busbar trunking section (IEC 60617-11-17)","busduct-tap.desc":"Busduct section with a fixed tap-off dropping below the run","converter-bidir.desc":"Storage converter: bidirectional AC ↔ DC","dc-dc-converter.desc":"DC/DC converter / DC charger (IEC 60617)","mppt.desc":"MPPT solar charge controller (DC/DC, maximum power point tracking)","earthing-switch.desc":"Disconnector + earth connection, single port","grid-source.desc":"Infinite bus / external grid","grounding-transformer.desc":"Wye-zigzag transformer for neutral grounding","load.desc":"Abstract load (current-out arrow)","luminaire.desc":"Lighting load (IEC 60617 general luminaire symbol)","ngr.desc":"Low-resistance grounding: transformer neutral to earth","series-reactor.desc":"Same symbol as shunt reactor; distinguished by usage","wind-turbine.desc":"Wind turbine: generator + three-blade rotor mark","gfci-breaker.desc":"Residual-current breaker with overcurrent (UL943 / IEC 61009). NA GFCI / EU RCBO.","rcd.desc":"Residual-current breaker without overcurrent (IEC 61008).","recloser.desc":"Medium-voltage automatic recloser.","energy-meter.desc":"Active energy meter (kWh) — service entrance / submeter.","contactor.desc":"Main-circuit contactor; typically used with a thermal overload and a motor.","motor-starter.desc":"Motor starter (IEC 60617 general symbol).","thermal-overload.desc":"Motor thermal-overload relay; sits between the contactor and the motor.","vfd.desc":"Variable Frequency Drive for induction motor speed control.","soft-starter.desc":"Motor soft-starter (thyristor-based reduced-voltage starting).","transfer-switch.desc":"Two-source transfer switch (ATS / manual). Two source inputs + one load output, mechanically interlocked.","dc-disconnector.desc":"DC isolating switch — PV string / battery DC-side isolation.","dc-combiner.desc":"PV string combiner box (4-input example).","ev-charger.desc":"Electric vehicle charging station.","breaker.state.open":"Open","disconnector.state.open":"Open","earthing-switch.state.open":"Open","fuse.state.blown":"Blown","load-switch.state.open":"Open","gfci-breaker.state.open":"Open","rcd.state.open":"Open","recloser.state.open":"Open","contactor.state.open":"Open","thermal-overload.state.tripped":"Tripped","transfer-switch.state.position":"Position (normal/emergency/off)","dc-disconnector.state.open":"Open","battery.param.E":"Capacity","busbar.param.Un":"Rated voltage","converter-bidir.param.S":"Capacity","dc-dc-converter.param.P":"Power","mppt.param.I":"Rated current","load.param.P":"Active power","load.param.cosphi":"Power factor","ngr.param.R":"Resistance","shunt-capacitor.param.Q":"Reactive capacity","shunt-capacitor.param.stages":"Stages","transformer-2w.param.S":"Capacity","transformer-2w.param.ratio":"Ratio","gfci-breaker.param.In":"Rated current","panelboard.param.In":"Rated current","gfci-breaker.param.IDn":"Residual operating current","rcd.param.IDn":"Residual operating current","breaker.param.In":"Rated current","breaker.param.poles":"Poles","breaker.param.Icu":"Breaking capacity","disconnector.param.In":"Rated current","fuse.param.In":"Rated current","resistor.name":"Resistor (R)","capacitor.name":"Capacitor (C)","diode.name":"Diode (D)","indicator-light.name":"Indicator light (HL)","push-button.name":"Push-button (SB)","relay-coil.name":"Relay coil (KA)","make-contact.name":"NO contact (NO)","break-contact.name":"NC contact (NC)","bell.name":"Bell (HA)","terminal.name":"Terminal / junction (X)","fuse-switch-disconnector.name":"Fuse switch-disconnector","socket-outlet.name":"Socket outlet / connector","inductor.name":"Inductor (L)","voltage-regulator.name":"Voltage regulator (T)","dc-motor.name":"DC motor (M)","heater.name":"Heating element (EH)","selector-switch.name":"Selector switch (SA)","limit-switch.name":"Limit switch (SQ)","proximity-switch.name":"Proximity switch (SQ)","time-relay.name":"Time relay (KT)","buzzer.name":"Buzzer (HA)","siren.name":"Siren (HA)","thermocouple.name":"Thermocouple (BT)","thyristor.name":"Thyristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Zener diode (D)","igbt.name":"IGBT","plc.name":"PLC / controller","ups.name":"UPS","power-supply.name":"Power supply (PS)","genset.name":"Generator set (G)","protective-relay.name":"Protective relay","overcurrent-relay.name":"Overcurrent relay (50/51)","undervoltage-relay.name":"Undervoltage relay (27)","reverse-power-relay.name":"Reverse-power relay (32)","distance-relay.name":"Distance relay (21)","phase-failure-relay.name":"Phase-failure relay","buchholz-relay.name":"Buchholz relay (63)","power-factor-meter.name":"Power-factor meter (cosφ)","synchronoscope.name":"Synchronoscope","varmeter.name":"Varmeter (var)","resistor.desc":"General resistor / current-limiting / braking resistor.","capacitor.desc":"General / filter / DC-bus capacitor. Use shunt capacitor for PF correction.","diode.desc":"Rectifier / freewheeling / protection diode. t1 = anode (top), t2 = cathode (bottom).","indicator-light.desc":"Signal / status indicator light.","push-button.desc":"Manual push-button, automatic return (NO make).","relay-coil.desc":"Relay / contactor operating coil (box).","make-contact.desc":"Normally-open auxiliary contact (make).","break-contact.desc":"Normally-closed auxiliary contact (break).","bell.desc":"Signal bell / alarm bell.","terminal.desc":"Terminal / junction box / connection node.","fuse-switch-disconnector.desc":"On-load fuse switch-disconnector.","socket-outlet.desc":"Power socket outlet / multipole connector.","inductor.desc":"General inductor / coil / choke.","voltage-regulator.desc":"Adjustable induction / autotransformer voltage regulator.","dc-motor.desc":"DC motor (series-field general symbol).","heater.desc":"Resistive heating element / heating load.","selector-switch.desc":"Selector / changeover switch (rotary, stay-put).","limit-switch.desc":"Travel / position switch (NO, mechanically operated).","proximity-switch.desc":"Proximity sensor / contactless proximity switch.","time-relay.desc":"Time-delay (slow-operating) relay coil.","buzzer.desc":"Signal buzzer.","siren.desc":"Audible siren / alarm.","thermocouple.desc":"Thermocouple temperature sensor.","thyristor.desc":"Reverse-blocking triode thyristor / SCR. t1 = anode (top), t2 = cathode (bottom).","triac.desc":"Bidirectional triode thyristor (TRIAC).","zener-diode.desc":"Zener / voltage-regulator diode. t1 = anode (top), t2 = cathode (bottom).","igbt.desc":"N-channel enhancement IGBT. t1 = collector (top), t2 = emitter (bottom), t_g = gate.","plc.desc":"Programmable logic controller (PLC).","ups.desc":"Online / standby uninterruptible power supply.","power-supply.desc":"AC→DC switched-mode / DC power supply. t_ac top (~), t_dc bottom (=).","genset.desc":"Diesel / gas generator set.","protective-relay.desc":"Measuring / protective relay, general symbol (IEC 60617).","overcurrent-relay.desc":"Overcurrent protection relay (ANSI 50/51).","undervoltage-relay.desc":"Undervoltage protection relay (ANSI 27).","reverse-power-relay.desc":"Reverse-power / reverse-current protection relay (ANSI 32).","distance-relay.desc":"Distance / under-impedance protection relay (ANSI 21).","phase-failure-relay.desc":"Phase-failure / phase-loss protection relay.","buchholz-relay.desc":"Buchholz / gas relay (ANSI 63).","power-factor-meter.desc":"Power-factor meter (cosφ).","synchronoscope.desc":"Synchronizing indicator / synchronoscope.","varmeter.desc":"Reactive-power meter (var).","make-contact.state.closed":"Closed","break-contact.state.open":"Open","fuse-switch-disconnector.state.open":"Open","selector-switch.state.open":"Open","limit-switch.state.closed":"Closed","resistor.param.R":"Resistance","resistor.param.P":"Rated power","capacitor.param.C":"Capacitance","capacitor.param.Un":"Rated voltage","indicator-light.param.color":"Color","inductor.param.L":"Inductance","inductor.param.In":"Rated current","voltage-regulator.param.ratio":"Regulation range","heater.param.P":"Power","ups.param.S":"Capacity","power-supply.param.Vdc":"Output voltage","genset.param.P":"Power","busduct.param.In":"Rated current","busduct.param.Un":"Rated voltage","busduct-tap.param.In":"Rated current","busduct-tap.param.Itap":"Tap-off current"},ls={zh:v6,en:k6,es:je.es.library,fr:je.fr.library,de:je.de.library,pt:je.pt.library,ja:je.ja.library,ru:je.ru.library,fa:je.fa.library,ar:je.ar.library,he:je.he.library};function S6(e,t){return ls[e][t]??ls.en[t]}function xn(){const e=pn(t=>t.locale);return(t,n)=>S6(e,t)??n??t}const kr=mn(e=>({onCreateComponent:null,setHostActions:t=>e(t)})),vS="ole-palette-collapsed",_6=new Set(["busbar"]),on="__custom__";function C6(e){const t={};for(const n of e.values()){if(_6.has(n.id))continue;const o=eo(n.id)?on:n.category;(t[o]??(t[o]=[])).push(n)}return t}function j6(e){var o;const t=new Set([...ei,on]),n=Object.keys(e).filter(r=>!t.has(r));return[...(o=e[on])!=null&&o.length?[on]:[],...ei.filter(r=>{var i;return(i=e[r])==null?void 0:i.length}),...n]}function A6(){try{const e=window.localStorage.getItem(vS);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(n=>typeof n=="string")):new Set}catch{return new Set}}function $6(e){try{window.localStorage.setItem(vS,JSON.stringify([...e]))}catch{}}function E6(){const e=re(),t=x(m=>m.activeTool==="place"),n=x(m=>m.placeKind),o=x(m=>m.setActiveTool),r=un(m=>m.outlineOpen),i=ht(),s=We(i,"dense"),l=68,d=s?void 0:`calc(100vh - ${l}px - ${r?"calc(40vh + 20px)":"68px"})`;if(!t||s&&n!=null)return null;const u=s?{top:`calc(${l}px + var(--ole-top-inset, 0px) + var(--ole-safe-top, 0px))`,left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",bottom:"calc(4rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px) + 0.75rem)"}:{top:l};return c.jsx("div",{className:s?"absolute z-20":"absolute left-3 z-20",style:u,role:"dialog","aria-label":e("library.title"),children:c.jsxs("aside",{className:s?"ole-glass flex h-full w-full flex-col overflow-hidden rounded-2xl border border-border shadow-md":"ole-glass flex w-72 flex-col overflow-hidden rounded-2xl border border-border shadow-md",style:d?{maxHeight:d}:void 0,children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2",children:[c.jsx("span",{className:"flex-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e("library.title")}),c.jsx("button",{type:"button",onClick:()=>o(s?"pan":"select"),className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":e("common.close"),title:e("common.close"),children:c.jsx(Jn,{className:"size-3.5"})})]}),c.jsx(N6,{sheet:s})]})})}function N6({sheet:e}){const t=re(),n=xn(),[o,r]=C.useState(""),[i,s]=C.useState(()=>A6()),l=x(f=>f.internal.library),a=kr(f=>f.onCreateComponent),d=C.useMemo(()=>C6(l),[l]),u=C.useMemo(()=>j6(d),[d]),m=C.useMemo(()=>{const f=o.trim().toLowerCase();if(!f)return d;const b={};for(const[y,v]of Object.entries(d)){const j=v.filter(S=>{const N=n(`${S.id}.name`,S.name).toLowerCase(),W=n(`${S.id}.desc`,S.description??"").toLowerCase();return N.includes(f)||S.id.toLowerCase().includes(f)||W.includes(f)});j.length&&(b[y]=j)}return b},[o,n,d]),p=o.trim().length>0,h=p&&Object.values(m).every(f=>!(f!=null&&f.length)),g=C.useCallback((f,b)=>{s(y=>{const v=new Set(y);return b?v.delete(f):v.add(f),$6(v),v})},[]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-1.5 px-2 pb-1.5 pt-2",children:[c.jsx(T6,{value:o,onChange:r}),a&&c.jsxs("button",{type:"button",onClick:a,className:"flex w-full cursor-pointer items-center gap-1.5 rounded-md border border-dashed border-border px-2 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:border-solid hover:bg-accent hover:text-accent-foreground",children:[c.jsx(Is,{className:"size-3.5 shrink-0"}),c.jsx("span",{className:"truncate",children:t("library.createComponent")})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:h?c.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:t("library.empty")}):u.map(f=>{var S;const b=m[f];if(!(b!=null&&b.length))return null;const y=((S=d[f])==null?void 0:S.length)??b.length,v=t(f===on?"cat.custom":`cat.${f}`),j=p||!i.has(f);return c.jsxs("details",{open:j,className:"group mb-2 last:mb-0",onToggle:N=>{p||g(f,N.currentTarget.open)},children:[c.jsxs("summary",{className:"flex cursor-pointer select-none items-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:[c.jsx(As,{className:"size-3 transition-transform [details:not([open])>summary>&]:-rotate-90"}),c.jsx("span",{className:"flex-1",children:v}),c.jsx(P6,{children:p&&b.length!==y?`${b.length}/${y}`:y})]}),c.jsx("ul",{className:"mt-0.5 space-y-px",children:b.map(N=>c.jsx(I6,{entry:N,sheet:e},N.id))})]},f)})})]})}function T6({value:e,onChange:t}){const n=re();return c.jsxs("div",{className:"relative",children:[c.jsx(d_,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),c.jsx("input",{type:"text",value:e,onChange:o=>t(o.target.value),placeholder:n("library.searchPlaceholder"),className:"h-7 w-full rounded-md border border-border/60 bg-background/50 pl-7 pr-7 text-xs placeholder:text-muted-foreground focus:border-border focus:outline-none focus:ring-1 focus:ring-ring","aria-label":n("library.searchAria")}),e&&c.jsx("button",{type:"button","aria-label":n("library.clearSearch"),onClick:()=>t(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:c.jsx(Jn,{className:"size-3"})})]})}function I6({entry:e,sheet:t}){const n=re(),o=xn(),r=o(`${e.id}.name`,e.name),i=eo(e.id),s=o(`${e.id}.desc`,e.description??""),l=x(p=>p.setActiveTool),a=x(p=>p.activeTool==="place"&&p.placeKind===e.id),d=x(p=>t&&p.activeTool==="place"&&p.placeKind==null&&p.lastPlaceKind===e.id),u=C.useRef(null);C.useEffect(()=>{var p;d&&((p=u.current)==null||p.scrollIntoView({block:"nearest"}))},[d]);const m=p=>{p.dataTransfer.effectAllowed="copy",p.dataTransfer.setData("application/x-oneline-kind",e.id),p.dataTransfer.setData("text/plain",e.id);const h=document.createElement("div");h.className="ole-glass",h.style.cssText=["position:absolute","top:-9999px","left:-9999px","width:64px","height:64px","display:flex","align-items:center","justify-content:center","border-radius:12px","border:1px solid var(--border)","box-shadow:0 4px 12px rgba(0,0,0,0.12)","color:var(--foreground)","padding:8px"].join(";"),h.innerHTML=`<svg class="ole-symbol" viewBox="${e.viewBox}" width="48" height="48" preserveAspectRatio="xMidYMid meet">${e.svg}</svg>`,document.body.appendChild(h),p.dataTransfer.setDragImage(h,32,32),setTimeout(()=>h.remove(),0)};return c.jsxs("li",{ref:u,className:`group flex cursor-grab items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-accent active:cursor-grabbing ${a?"bg-accent ring-1 ring-[var(--selection)]/60":d?"ring-1 ring-[var(--selection)]/30":""}`,draggable:!0,onDragStart:m,onClick:()=>l("place",{placeKind:e.id}),"data-kind":e.id,title:s?`${r} — ${s}`:`${r} — ${n("library.itemHint")}`,children:[c.jsx("div",{className:"flex h-7 w-12 shrink-0 items-center justify-center",children:c.jsx("svg",{viewBox:e.viewBox,className:"ole-symbol size-full",preserveAspectRatio:"xMidYMid meet",dangerouslySetInnerHTML:{__html:e.svg}})}),c.jsx("span",{className:"truncate text-xs text-foreground/80 group-hover:text-accent-foreground",children:r}),i&&c.jsx("span",{className:"ml-auto shrink-0 rounded-sm border border-border/70 px-1 py-px font-mono text-[9px] leading-none text-muted-foreground/70",title:n("library.customHint"),children:n("library.customTag")})]})}function P6({children:e}){return c.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e})}const ar="ole-onboarding-dismissed";function z6(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(ar)==="1"}catch{return!1}}function cs(e){try{e?window.localStorage.setItem(ar,"1"):window.localStorage.removeItem(ar)}catch{}}const ds=mn(e=>({dismissed:z6(),dismiss:()=>{cs(!0),e({dismissed:!0})},reset:()=>{cs(!1),e({dismissed:!1})}}));function M6(){const e=re(),t=ds(o=>o.dismissed),n=ds(o=>o.dismiss);return t?null:c.jsxs("div",{role:"dialog","aria-label":e("onboard.title"),className:"ole-glass pointer-events-none absolute left-1/2 top-1/2 z-10 w-[min(420px,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-border p-5 shadow-md",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold",children:e("onboard.title")}),c.jsx("button",{type:"button",onClick:n,"aria-label":e("onboard.dismiss"),className:"pointer-events-auto rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:c.jsx(Jn,{className:"size-3.5"})})]}),c.jsxs("ol",{className:"mt-3 space-y-2.5",children:[c.jsx(Po,{n:1,icon:c.jsx(Ms,{}),title:e("onboard.step1.title"),body:e("onboard.step1.body")}),c.jsx(Po,{n:2,icon:c.jsx(js,{}),title:e("onboard.step2.title"),body:e("onboard.step2.body")}),c.jsx(Po,{n:3,icon:c.jsx(lr,{}),title:e("onboard.step3.title"),body:e("onboard.step3.body")})]}),c.jsx("button",{type:"button",onClick:n,className:"pointer-events-auto mt-4 w-full rounded-md bg-primary py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90",children:e("onboard.dismiss")})]})}function Po({n:e,icon:t,title:n,body:o}){return c.jsxs("li",{className:"flex items-start gap-2.5",children:[c.jsx("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_oklch,var(--selection)_18%,transparent)] font-mono text-[10px] font-semibold tabular-nums text-[var(--selection)]","aria-hidden":!0,children:e}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[c.jsx("span",{className:"text-muted-foreground [&>svg]:size-3.5",children:t}),c.jsx("span",{children:n})]}),c.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-muted-foreground",children:o})]})]})}function D6(){const e=re(),t=x(f=>f.selection),n=x(f=>f.diagram.elements),o=x(f=>f.diagram.buses),r=x(f=>f.diagram.junctions),i=x(f=>f.selectedNode),s=x(f=>f.selectedWire),l=x(f=>f.selectedAnnotations),a=x(Pt);if(s)return c.jsx(U6,{wireId:s});if(i)return c.jsx(Z6,{nodeId:i});if(a)return c.jsx(F6,{annId:a});const d=t.length+l.length;if(d===0)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:e("props.empty")});if(d>1)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:e("props.multi",{n:d})});const u=t[0],m=(o??[]).find(f=>f.id===u);if(m)return c.jsx(B6,{bus:m});const p=(r??[]).find(f=>f.id===u);if(p)return c.jsx(Y6,{junction:p});const h=n.find(f=>f.id===u);if(!h)return null;const g=vt[h.kind];return c.jsxs("div",{className:"flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs",children:[c.jsx(ot,{label:e("props.name"),value:h.name??"",placeholder:h.id,multiline:!0,onCommit:f=>{const b=oo(f,"").join(`
228
- `);x.getState().updateElement(u,{name:b===""?void 0:b})}}),c.jsx(Ue,{label:e("props.label"),children:c.jsx(ho,{active:!h.labelHidden,onClick:()=>x.getState().updateElement(u,{labelHidden:h.labelHidden?void 0:!0}),children:h.labelHidden?e("props.labelHidden"):e("props.labelShown")})}),c.jsx(Sr,{label:e("props.note"),value:h.note??"",onCommit:f=>x.getState().updateElement(u,{note:f.trim()===""?void 0:f.trim()})},u),c.jsx(yt,{label:e("props.color"),value:h.color,onChange:f=>x.getState().updateElement(u,{color:f==="default"?void 0:f})}),g&&c.jsx(G6,{id:u}),(g==null?void 0:g.state)&&g.state.length>0&&c.jsx("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:g.state.map(f=>c.jsx(e4,{id:u,element:h,field:f},f.name))}),c.jsx(R6,{id:u,element:h,schema:(g==null?void 0:g.params)??[]})]})}function R6({id:e,element:t,schema:n}){const o=new Set(n.map(i=>i.name)),r=t.params?Object.entries(t.params).filter(([i])=>!o.has(i)):[];return n.length===0&&r.length===0?null:c.jsxs("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:[n.map(i=>c.jsx(O6,{id:e,element:t,field:i},i.name)),r.map(([i,s])=>c.jsx(L6,{id:e,element:t,fieldKey:i,value:s},i))]})}function O6({id:e,element:t,field:n}){var a;const o=re(),r=xn(),i=((a=t.params)==null?void 0:a[n.name])??n.default,s=r(`${t.kind}.param.${n.name}`,n.label??n.name),l=d=>{const u={...t.params??{}};d===void 0||d===""?delete u[n.name]:u[n.name]=d,x.getState().updateElement(e,{params:Object.keys(u).length>0?u:void 0})};return n.type==="boolean"?c.jsx(Ue,{label:s,children:c.jsx(ho,{active:!!i,onClick:()=>l(!i),children:o(i?"common.yes":"common.no")})}):n.type==="number"?c.jsx(po,{label:s,value:typeof i=="number"?i:0,unit:n.unit,onCommit:l}):c.jsx(ot,{label:s,value:typeof i=="string"?i:"",unit:n.unit,onCommit:d=>l(d.trim()===""?void 0:d)})}function L6({id:e,element:t,fieldKey:n,value:o}){const r=re(),i=s=>{const l={...t.params??{}};s===void 0?delete l[n]:l[n]=s,x.getState().updateElement(e,{params:Object.keys(l).length>0?l:void 0})};return typeof o=="boolean"?c.jsx(Ue,{label:n,children:c.jsx(ho,{active:o,onClick:()=>i(!o),children:r(o?"common.yes":"common.no")})}):typeof o=="number"?c.jsx(po,{label:n,value:o,onCommit:i}):c.jsx(ot,{label:n,value:o,onCommit:s=>i(s.trim()===""?void 0:s)})}function B6({bus:e}){const t=re(),n=e.id,o=r=>{const i=r.trim();Ln(n,{name:i===""?void 0:i})};return c.jsxs("div",{className:"flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs",children:[c.jsx(ot,{label:t("props.name"),value:e.name??"",placeholder:e.id,onCommit:o}),c.jsx(Sr,{label:t("props.note"),value:e.note??"",onCommit:r=>Ln(n,{note:r.trim()===""?void 0:r.trim()})},n),c.jsx(yt,{label:t("props.color"),value:e.color,onChange:r=>Ln(n,{color:r==="default"?void 0:r})}),c.jsx(H6,{bus:e})]})}function H6({bus:e}){const t=(o,r)=>{const i={...e.params??{}};r===void 0||r===""?delete i[o]:i[o]=r,Ln(e.id,{params:Object.keys(i).length>0?i:void 0})},n=e.params??{};return c.jsx("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:c.jsx(po,{label:"Un",value:typeof n.Un=="number"?n.Un:0,unit:"kV",onCommit:o=>t("Un",o)})})}function Ln(e,t){x.getState().dispatch(n=>{const o=(n.buses??[]).map(r=>r.id===e?{...r,...t}:r);return{...n,buses:o}})}function F6({annId:e}){const t=re(),n=x(i=>(i.diagram.annotations??[]).find(s=>s.id===e));if(!n)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.annNotFound",{id:e})});const o=i=>x.getState().updateAnnotation(e,i),r=Xe(n);switch(r){case"rect":case"ellipse":{const i=n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsx(ot,{label:t("props.annLabel"),value:i.label??"",placeholder:t("props.annLabelPlaceholder"),onCommit:s=>o({label:s.trim()===""?void 0:s.trim()})}),c.jsx(yt,{label:t("props.color"),value:i.color,onChange:s=>o({color:s==="default"?void 0:s})}),c.jsx(us,{stroke:i.stroke,strokeWidth:i.strokeWidth,defaultStroke:r==="rect"?"dashed":"solid",patch:o}),c.jsx(Qn,{label:t("props.annFill"),value:i.fill??"none",options:[{value:"none",label:t("props.annFillNone")},{value:"tint",label:t("props.annFillTint")}],onChange:s=>o({fill:s==="none"?void 0:s})})]})}case"line":{const i=n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsx(yt,{label:t("props.color"),value:i.color,onChange:s=>o({color:s==="default"?void 0:s})}),c.jsx(us,{stroke:i.stroke,strokeWidth:i.strokeWidth,defaultStroke:"solid",patch:o}),c.jsx(Qn,{label:t("props.annArrow"),value:i.arrow??"none",options:[{value:"none",label:t("props.annArrowNone")},{value:"end",label:t("props.annArrowEnd")},{value:"both",label:t("props.annArrowBoth")}],onChange:s=>o({arrow:s==="none"?void 0:s})})]})}case"table":{const i=n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsx(ms,{label:t("props.annRows"),value:i.rowHeights.length,min:1,onChange:s=>o(W6(i,s))}),c.jsx(ms,{label:t("props.annCols"),value:i.colWidths.length,min:1,onChange:s=>o(q6(i,s))}),c.jsx(yt,{label:t("props.color"),value:i.color,onChange:s=>o({color:s==="default"?void 0:s})}),c.jsx(ps,{label:t("props.annFontSize"),value:i.fontSize,onCommit:s=>o({fontSize:s})})]})}default:{const i=n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsx(yt,{label:t("props.color"),value:i.color,onChange:s=>o({color:s==="default"?void 0:s})}),c.jsx(ps,{label:t("props.annFontSize"),value:i.fontSize,onCommit:s=>o({fontSize:s})})]})}}}function W6(e,t){const n=e.colWidths.length,o=e.rowHeights[e.rowHeights.length-1]??ln,r=e.rowHeights.slice(0,t);for(;r.length<t;)r.push(o);const i=e.cells.slice(0,t).map(s=>[...s]);for(;i.length<t;)i.push(D2(n,1).cells[0]);return{rowHeights:r,cells:i}}function q6(e,t){const n=e.colWidths[e.colWidths.length-1]??an,o=e.colWidths.slice(0,t);for(;o.length<t;)o.push(n);const r=e.cells.map(i=>{const s=i.slice(0,t);for(;s.length<t;)s.push("");return s});return{colWidths:o,cells:r}}function yt({label:e,value:t,onChange:n}){const o=re(),r=t??"default";return c.jsx(Ue,{label:e,children:c.jsx("div",{className:"flex gap-1",children:hr.map(i=>c.jsx("button",{type:"button","aria-pressed":r===i,"aria-label":o(`props.color.${i}`),title:o(`props.color.${i}`),onClick:()=>n(i),className:Se("size-6 rounded-md border transition-shadow",r===i?"border-primary ring-1 ring-primary":"border-border/60 hover:border-border"),children:c.jsx("span",{className:Se("block size-full rounded-[3px]",Re(i)),style:{backgroundColor:i==="default"?"var(--foreground)":"currentColor"}})},i))})})}function us({stroke:e,strokeWidth:t,defaultStroke:n,patch:o}){const r=re();return c.jsxs(c.Fragment,{children:[c.jsx(Qn,{label:r("props.annStroke"),value:e??n,options:[{value:"solid",label:r("props.annStrokeSolid"),glyph:c.jsx(At,{width:1.5})},{value:"dashed",label:r("props.annStrokeDashed"),glyph:c.jsx(At,{width:1.5,dash:"5 3"})},{value:"dotted",label:r("props.annStrokeDotted"),glyph:c.jsx(At,{width:1.5,dash:"0.1 3"})}],onChange:i=>o({stroke:i})}),c.jsx(Qn,{label:r("props.annStrokeWidth"),value:String(t??1),options:[{value:"1",label:r("props.annWidthThin"),glyph:c.jsx(At,{width:1})},{value:"2",label:r("props.annWidthMedium"),glyph:c.jsx(At,{width:2.5})},{value:"3",label:r("props.annWidthThick"),glyph:c.jsx(At,{width:4})}],onChange:i=>o({strokeWidth:Number(i)})})]})}function Qn({label:e,value:t,options:n,onChange:o}){return c.jsx(Ue,{label:e,children:c.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:n.map(r=>c.jsx("button",{type:"button","aria-pressed":t===r.value,"aria-label":r.label,title:r.label,onClick:()=>o(r.value),className:Se("h-7 flex-1 truncate px-1.5 text-[11px] transition-colors",r.glyph&&"flex items-center justify-center",t===r.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.glyph??r.label},r.value))})})}function At({width:e,dash:t}){return c.jsx("svg",{viewBox:"0 0 28 12",className:"h-3 w-7","aria-hidden":!0,children:c.jsx("line",{x1:"2",y1:"6",x2:"26",y2:"6",stroke:"currentColor",strokeWidth:e,strokeDasharray:t,strokeLinecap:"round"})})}function G6({id:e}){const t=re(),n=x(d=>{var u;return((u=d.internal.layout.get(e))==null?void 0:u.scale)??1}),o=Math.round(n*100),[r,i]=C.useState(null),s=d=>{const u=Math.min(mr,Math.max(ur,d/100));x.getState().updatePlacement(e,{scale:Math.round(u*100)/100})},l=()=>{if(r===null)return;const d=parseFloat(r.replace(",","."));i(null),Number.isFinite(d)&&d>0&&Math.round(d)!==o&&s(d)},a=t("props.size");return c.jsx(Ue,{label:a,children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("div",{className:"relative min-w-0 flex-1",children:[c.jsx("input",{"aria-label":a,inputMode:"decimal",value:r??String(o),onChange:d=>i(d.target.value),onBlur:l,onKeyDown:d=>{d.key==="Enter"&&d.target.blur(),d.key==="Escape"&&i(null)},className:"h-7 w-full rounded-md border border-border/60 bg-transparent pr-5 pl-2 font-mono text-[11px] tabular-nums outline-none focus:border-primary"}),c.jsx("span",{className:"pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-[11px] text-muted-foreground",children:"%"})]}),o!==100&&c.jsx("button",{type:"button",title:t("props.sizeReset"),"aria-label":t("props.sizeReset"),onClick:()=>s(100),className:"h-7 w-7 shrink-0 rounded-md text-[13px] leading-none text-muted-foreground hover:bg-accent",children:"↺"})]})})}function ms({label:e,value:t,min:n,onChange:o}){return c.jsx(Ue,{label:e,children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{type:"button","aria-label":`${e} −`,disabled:t<=n,onClick:()=>o(t-1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"−"}),c.jsx("span",{className:"w-8 text-center font-mono text-[11px] tabular-nums",children:t}),c.jsx("button",{type:"button","aria-label":`${e} +`,onClick:()=>o(t+1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent",children:"+"})]})})}const V6=5,K6=32,X6=8;function ps({label:e,value:t,onCommit:n}){return c.jsx(ot,{label:e,value:t!=null?String(t):"",placeholder:String(X6),unit:"px",onCommit:o=>{const r=o.trim();if(r===""){n(void 0);return}const i=Number(r);Number.isFinite(i)&&n(Math.min(K6,Math.max(V6,Math.round(i))))}})}function U6({wireId:e}){const t=re(),n=x(b=>b.diagram.wires),o=x(b=>b.diagram.elements),r=x(b=>b.diagram.buses),i=x(b=>b.diagram.junctions),s=x(b=>b.internal.terminalToNode),l=x(b=>b.setSelectedNode),a=(n??[]).find(b=>b.id===e);if(!a)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.wireNotFound",{id:e})});const d=s.get(a.ends[0]),u=new Map(o.map(b=>[b.id,b])),m=new Map((r??[]).map(b=>[b.id,b])),p=new Map((i??[]).map(b=>[b.id,b])),h=b=>{if(!b.includes(".")){const N=m.get(b);if(N)return{id:b,label:N.name??b};const W=p.get(b);return{id:b,label:(W==null?void 0:W.name)??b}}const y=b.indexOf("."),v=b.slice(0,y),j=b.slice(y+1),S=u.get(v);return{id:v,label:(S==null?void 0:S.name)??v,pin:j}},g=h(a.ends[0]),f=h(a.ends[1]);return c.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 text-xs",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.wire")}),c.jsx("div",{className:"font-mono text-[12px]",children:a.id})]}),c.jsx(ot,{label:t("props.label"),value:a.label??"",placeholder:t("props.labelPlaceholder"),onCommit:b=>x.getState().updateWire(e,{label:b.trim()===""?void 0:b.trim()})}),c.jsx(yt,{label:t("props.color"),value:a.color,onChange:b=>x.getState().updateWire(e,{color:b==="default"?void 0:b})}),c.jsx("ul",{className:"space-y-0.5 border-t border-border/40 pt-2",children:[g,f].map((b,y)=>c.jsxs("li",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 hover:bg-accent",onClick:()=>x.getState().setSelection([b.id]),children:[c.jsx("span",{className:"flex-1 truncate font-mono text-[11px]",children:b.id}),c.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:b.label}),b.pin&&c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:b.pin})]},y))}),d&&c.jsx("button",{type:"button",className:"self-start rounded-md border border-border/60 px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent",onClick:()=>l(d),children:t("props.selectWholeNode")})]})}function Y6({junction:e}){var r;const t=re(),n=x(i=>{var s;return(s=i.internal.junctions.get(e.id))==null?void 0:s.world}),o=((r=e.layout)==null?void 0:r.at)??n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.junction")}),c.jsx("div",{className:"font-mono text-[12px]",children:e.id})]}),c.jsx(ot,{label:t("props.name"),value:e.name??"",placeholder:e.id,onCommit:i=>x.getState().updateJunction(e.id,{name:i.trim()===""?void 0:i.trim()})}),c.jsx(Sr,{label:t("props.note"),value:e.note??"",onCommit:i=>x.getState().updateJunction(e.id,{note:i.trim()===""?void 0:i.trim()})},e.id),o&&c.jsxs("div",{className:"flex items-center justify-between border-t border-border/40 pt-2",children:[c.jsx("span",{className:"text-muted-foreground",children:t("props.junctionPos")}),c.jsxs("span",{className:"font-mono text-[11px]",children:[Math.round(o[0]),", ",Math.round(o[1])]})]})]})}function Z6({nodeId:e}){const t=re(),n=x(l=>l.internal.nodes.get(e)),o=x(l=>l.diagram.elements),r=x(l=>l.setSelection);if(!n)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.nodeNotFound",{id:e})});const i=new Map;for(const l of n.terminals){const a=l.indexOf(".");if(a<0)continue;const d=l.slice(0,a),u=l.slice(a+1),m=i.get(d)??[];m.push(u),i.set(d,m)}const s=new Map(o.map(l=>[l.id,l]));return c.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 text-xs",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.node")}),c.jsx("div",{className:"font-mono text-[12px]",children:n.id}),c.jsx("div",{className:"text-[11px] text-muted-foreground",children:t("props.nodeStats",{terminals:n.terminals.length,elements:i.size})})]}),c.jsx("ul",{className:"space-y-0.5 border-t border-border/40 pt-2",children:[...i.entries()].map(([l,a])=>{const d=s.get(l);return c.jsxs("li",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 hover:bg-accent",onClick:()=>r([l]),title:t("props.selectElement",{label:l}),children:[c.jsx("span",{className:"flex-1 truncate font-mono text-[11px]",children:l}),c.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:(d==null?void 0:d.name)??""}),c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:a.join(", ")})]},l)})})]})}function Ue({label:e,children:t}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("label",{className:"w-16 shrink-0 truncate text-[11px] text-muted-foreground",children:e}),c.jsx("div",{className:"min-w-0 flex-1",children:t})]})}const Q6=6;function ot({label:e,value:t,placeholder:n,unit:o,multiline:r,onCommit:i}){const[s,l]=C.useState(t),a=C.useRef(null);C.useEffect(()=>l(t),[t]);const d={value:s,placeholder:n,onChange:u=>l(u.target.value),onBlur:()=>{s!==t&&i(s)},className:Se("w-full rounded-md border border-border/60 bg-background/50 px-2 text-[11px] focus:border-border focus:outline-none focus:ring-1 focus:ring-ring",o&&"pr-8",r?"resize-none py-1.5 leading-snug":"h-7")};return c.jsx(Ue,{label:e,children:c.jsxs("div",{className:"relative",children:[r?c.jsx("textarea",{ref:a,rows:Math.min(Q6,Math.max(1,s.split(`
229
- `).length)),onKeyDown:u=>{var m,p;u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),(m=a.current)==null||m.blur()),u.key==="Escape"&&(l(t),(p=a.current)==null||p.blur()),u.stopPropagation()},...d}):c.jsx("input",{ref:a,type:"text",onKeyDown:u=>{var m,p;u.key==="Enter"&&((m=a.current)==null||m.blur()),u.key==="Escape"&&(l(t),(p=a.current)==null||p.blur())},...d}),o&&c.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:o})]})})}const J6=350;function Sr({label:e,value:t,onCommit:n}){const[o,r]=C.useState(t),i=C.useRef(!1),s=C.useRef(null),l=C.useRef({local:o,value:t,onCommit:n});l.current={local:o,value:t,onCommit:n};const a=C.useRef(null);C.useEffect(()=>{i.current||(r(t),a.current=null)},[t]);const d=()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null);const m=l.current;m.local===m.value||m.local===a.current||(a.current=m.local,m.onCommit(m.local))},u=C.useRef(d);return u.current=d,C.useEffect(()=>()=>u.current(),[]),c.jsx(Ue,{label:e,children:c.jsx("textarea",{rows:2,value:o,onFocus:()=>{i.current=!0},onChange:m=>{r(m.target.value),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{s.current=null,u.current()},J6)},onBlur:()=>{i.current=!1,d()},className:"w-full resize-none rounded-md border border-border/60 bg-background/50 px-2 py-1 text-[11px] focus:border-border focus:outline-none focus:ring-1 focus:ring-ring"})})}function po({label:e,value:t,min:n,unit:o,onCommit:r}){const[i,s]=C.useState(String(t)),l=C.useRef(null);return C.useEffect(()=>s(String(t)),[t]),c.jsx(Ue,{label:e,children:c.jsxs("div",{className:"relative",children:[c.jsx("input",{ref:l,type:"number",value:i,onChange:a=>s(a.target.value),onBlur:()=>{const a=Number(i);Number.isFinite(a)&&a!==t?r(a):s(String(t))},onKeyDown:a=>{var d,u;a.key==="Enter"&&((d=l.current)==null||d.blur()),a.key==="Escape"&&(s(String(t)),(u=l.current)==null||u.blur())},min:n,className:Se("h-7 w-full rounded-md border border-border/60 bg-background/50 px-2 font-mono text-[11px] tabular-nums focus:border-border focus:outline-none focus:ring-1 focus:ring-ring",o&&"pr-8")}),o&&c.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:o})]})})}function ho({active:e,onClick:t,children:n}){return c.jsx("button",{type:"button",onClick:t,className:Se("flex h-6 w-full items-center justify-center gap-1.5 rounded border text-[10px] transition-colors",e?"border-[var(--selection)] bg-[var(--selection)]/15 text-foreground":"border-border/60 text-muted-foreground hover:bg-accent"),"aria-pressed":e,children:n})}function e4({id:e,element:t,field:n}){var a;const o=re(),i=xn()(`${t.kind}.state.${n.name}`,n.label??n.name),s=((a=t.state)==null?void 0:a[n.name])??n.default,l=d=>{const u={...t.state??{}};d===void 0||d===n.default?delete u[n.name]:u[n.name]=d,x.getState().updateElement(e,{state:Object.keys(u).length>0?u:void 0})};return n.type==="boolean"?c.jsx(Ue,{label:i,children:c.jsx(ho,{active:!!s,onClick:()=>l(!s),children:o(s?"common.yes":"common.no")})}):n.type==="number"?c.jsx(po,{label:i,value:typeof s=="number"?s:0,onCommit:l}):c.jsx(ot,{label:i,value:typeof s=="string"?s:"",onCommit:d=>l(d.trim()===""?void 0:d)})}function t4(){const e=re(),t=xn(),n=x(g=>g.selection),o=x(g=>g.selectedNode),r=x(g=>g.selectedWire),i=x(g=>g.selectedAnnotations),s=x(Pt),l=x(g=>g.diagram.annotations),a=x(g=>g.diagram.elements),d=x(g=>g.diagram.buses),u=ht(),m=We(u,"dense");if(n.length===0&&i.length===0&&!o&&!r)return null;let p=e("props.title"),h=null;if(r)p=e("props.wire");else if(o)p=e("props.node");else if(s){const g=(l??[]).find(y=>y.id===s),f=g?Xe(g):"text";p=e({rect:"props.annRect",ellipse:"props.annEllipse",line:"props.annLine",table:"props.annTable",text:"props.annText"}[f])}else if(n.length===1&&i.length===0){const g=n[0],f=(d??[]).find(b=>b.id===g);if(f)p=f.name??e("props.bus");else{const b=a.find(y=>y.id===g);if(b){const y=vt[b.kind];p=y?t(`${y.id}.name`,y.name):b.kind}}}else h=n.length+i.length;return c.jsxs("aside",{className:Se("ole-glass absolute z-10 flex flex-col overflow-hidden rounded-2xl border border-border shadow-sm",m?"w-48":"w-56"),style:{top:`calc(${m?"4.5rem":"0.75rem"} + var(--ole-top-inset, 0px) + var(--ole-safe-top, 0px))`,right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",maxHeight:`calc(100% - ${m?"5.25rem":"1.5rem"} - var(--ole-top-inset, 0px) - var(--ole-safe-top, 0px) - var(--ole-bottom-inset, 0px) - var(--ole-safe-bottom, 0px) - 4.5rem)`},children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2",children:[c.jsx("span",{className:"flex-1 truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:p}),h!=null&&c.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e("props.nSelected",{n:h})})]}),c.jsx(D6,{})]})}function n4(){C.useEffect(()=>{const e=n=>{const o=n.target;if(!o||o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable)return;const r=o.closest("button");r&&r.closest(".ole-glass")&&n.preventDefault()},t=n=>{const o=n.target;if(!o||!o.closest(".ole-canvas-root"))return;const r=document.activeElement;!r||r===document.body||r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable||r.blur()};return window.addEventListener("mousedown",e),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("pointerdown",t,!0)}},[])}function o4(){n4();const e=x(o=>o.readOnly),t=C.useRef(null),n=nT(t);return c.jsx(U_,{children:c.jsx("div",{ref:t,className:"relative h-full w-full overflow-hidden bg-background text-foreground",children:c.jsxs(MT,{width:n,children:[c.jsx(_T,{}),e?c.jsxs(c.Fragment,{children:[c.jsx(rs,{}),c.jsx(Xi,{})]}):c.jsxs(c.Fragment,{children:[c.jsx(b6,{}),c.jsx(t4,{}),c.jsx(u6,{}),c.jsx(rs,{}),c.jsx(YT,{}),c.jsx(QT,{}),c.jsx(E6,{}),c.jsx(M6,{}),c.jsx(Xi,{})]})]})})})}const r4="ole-theme";function i4(){try{const e=window.localStorage.getItem(r4);return e==="light"||e==="dark"?e:null}catch{return null}}function s4(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches}function a4(){return typeof window>"u"?"light":i4()??(s4()?"dark":"light")}function kS(e){typeof document>"u"||document.documentElement.classList.toggle("dark",e==="dark")}function l4({className:e,diagram:t,readOnly:n,locale:o,theme:r,onCreateComponent:i}){return C.useEffect(()=>{kr.getState().setHostActions({onCreateComponent:n?null:i??null})},[i,n]),C.useEffect(()=>{x.getState().setReadOnly(!!n)},[n]),C.useEffect(()=>{if(!t)return;if(n){x.getState().setDiagram(t),x.getState().setActiveTool("pan");return}x.getState().diagram.elements.length===0&&x.getState().setDiagram(t)},[t,n]),C.useEffect(()=>{o&&pn.getState().setLocale(o)},[o]),C.useEffect(()=>{r&&kS(r)},[r]),C.useEffect(()=>{wr()},[]),ON(),c.jsx("div",{className:`ole-root ${e??"h-full w-full"}`,children:c.jsx(o4,{})})}const SS=6,c4=3,zo=SS+3,d4=3,hs=4,fs=2;function u4(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:[t[0],t[1],t[2],t[3]]}function m4(e,t){const n=u4(e);if(!n)return null;const[o,r,i,s]=n,l=[[o,r],[o+i,r],[o,r+s],[o+i,r+s]],a={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const d of l){const[u,m]=Le(d,t);u<a.minX&&(a.minX=u),m<a.minY&&(a.minY=m),u>a.maxX&&(a.maxX=u),m>a.maxY&&(a.maxY=m)}return a}function p4(e){return e==null?"":typeof e=="number"?Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,""):typeof e=="boolean"?e?"ON":"OFF":String(e)}function h4({id:e,box:t,rt:n,unit:o}){const r=n.quality==="bad"||n.quality==="stale",i=n.value!==void 0&&n.value!==null?`${p4(n.value)}${o?` ${o}`:""}`:"",s=n.badge??"";if(!r&&!i&&!s)return null;const l=s.length*SS*.6+c4*2;return c.jsxs("g",{className:"ole-rt","data-rt-for":e,"data-alarm":gr(n),children:[i&&c.jsx("text",{className:"ole-rt-value",x:t.maxX+d4,y:t.maxY,textAnchor:"start",children:i}),s&&c.jsxs("g",{className:"ole-rt-badge",transform:`translate(${t.maxX+l/2-fs} ${t.minY})`,children:[c.jsx("rect",{x:-l/2,y:-zo/2,width:l,height:zo,rx:zo/2,className:"ole-rt-badge-bg"}),c.jsx("text",{x:0,y:0,textAnchor:"middle",className:"ole-rt-badge-text",children:s})]}),r&&c.jsxs("g",{className:"ole-rt-quality","data-quality":n.quality,transform:`translate(${t.minX-hs+fs} ${t.minY})`,children:[c.jsx("circle",{r:hs,className:"ole-rt-quality-bg"}),c.jsx("text",{x:0,y:0,textAnchor:"middle",className:"ole-rt-quality-text",children:"?"})]})]})}function f4(){const{props:e,units:t}=Mt(),n=le(s=>s.internal.elements),o=le(s=>s.internal.layout),r=le(s=>s.internal.buses),i=Object.keys(e);return i.length===0?null:c.jsx("g",{className:"ole-rt-layer",pointerEvents:"none",children:i.map(s=>{const l=e[s];if(l.visible===!1)return null;let a=null;const d=n.get(s),u=o.get(s);if(d!=null&&d.libraryDef&&u)a=m4(d.libraryDef.viewBox,u);else{const m=r.get(s);if(m){const{axis:p,at:h,span:g}=m.geometry,f=g/2;a=p==="x"?{minX:h[0]-f,maxX:h[0]+f,minY:h[1]-4,maxY:h[1]+4}:{minX:h[0]-4,maxX:h[0]+4,minY:h[1]-f,maxY:h[1]+f}}}return a?c.jsx(h4,{id:s,box:a,rt:l,unit:t[s]},s):null})})}const g4=100,b4=8,y4=4,x4=1.5;function w4(e){const t={},n=e.bindings,o=e.tags;if(!n||!o)return t;const r=new Map;for(const i of o)i.unit&&r.set(i.path,i.unit);for(const i of n){if(i.prop!=="value")continue;const s=r.get(i.tag);s&&(t[i.target]=s)}return t}function v4(e,t){const[n,o]=C.useState(Ko);return C.useEffect(()=>{const r=e.bindings??[];if(!t||r.length===0){o(Ko);return}const i=w4(e),s=()=>o({props:p2(e,t),units:i});s();let l=null;const a=Array.from(new Set(r.map(u=>u.tag))),d=t.subscribe(a,()=>{l===null&&(l=window.setTimeout(()=>{l=null,s()},g4))});return()=>{d(),l!==null&&window.clearTimeout(l)}},[e,t]),n}function k4({diagram:e,tags:t,selectedIds:n,hoveredId:o,onElementClick:r,onElementHover:i,onBackgroundClick:s,theme:l,className:a,style:d,fit:u=!0,onReady:m}){const[p]=C.useState(()=>{const f=g2();return f.getState().setReadOnly(!0),f.getState().setActiveTool("pan"),f.getState().setDiagram(e),f});C.useLayoutEffect(()=>{p.getState().diagram!==e&&p.getState().setDiagram(e)},[e,p]),C.useLayoutEffect(()=>{n!==void 0&&p.getState().setSelection(n)},[n,e,p]);const h=v4(e,t),g=["ole-root","ole-viewer",l==="dark"?"dark":"",a??"h-full w-full"].filter(Boolean).join(" ");return c.jsx("div",{className:g,style:d,children:c.jsx(y2.Provider,{value:p,children:c.jsx(A2.Provider,{value:h,children:c.jsx("div",{className:"relative h-full w-full overflow-hidden",children:c.jsx(S4,{store:p,diagram:e,hoveredId:o,selectionControlled:n!==void 0,onElementClick:r,onElementHover:i,onBackgroundClick:s,fit:u,onReady:m})})})})})}function S4({store:e,diagram:t,hoveredId:n,selectionControlled:o,onElementClick:r,onElementHover:i,onBackgroundClick:s,fit:l,onReady:a}){const d=C.useRef(null),u=C.useRef(null),m=oS(d,u,void 0,{shared:!1});C4(d,n,i);const p=j4(d,m),h=C.useRef(o);h.current=o;const g=C.useMemo(()=>({fit(){const y=d.current;y&&Rn(m,y)},focus(y){const v=d.current;if(!v)return;const j=_4(e.getState(),y);if(!j)return;const S=v.getBoundingClientRect(),N=Math.max(m.getViewport().scale,x4);m.setViewport({scale:N,tx:S.width/2-N*j[0],ty:S.height/2-N*j[1]})},select(y){h.current||e.getState().setSelection(y)}}),[m,e]);C.useEffect(()=>{if(!l)return;let y=b4,v=0;const j=()=>{const S=d.current;S&&Rn(m,S)||--y>0&&(v=requestAnimationFrame(j))};return v=requestAnimationFrame(j),()=>cancelAnimationFrame(v)},[l,t,m]),C.useEffect(()=>{const y=d.current;if(!l||!y||typeof ResizeObserver>"u")return;const v=new ResizeObserver(()=>{Rn(m,y)});return v.observe(y),()=>v.disconnect()},[l,m]);const f=C.useRef(a);f.current=a,C.useEffect(()=>{var y;(y=f.current)==null||y.call(f,g)},[g]);const b=C.useCallback(y=>{if(p.current){p.current=!1;return}const v=mt(y.target)??cn(y.target);v?r==null||r(v,y):s==null||s()},[r,s,p]);return c.jsx("div",{ref:d,className:"ole-canvas-root absolute inset-0 overflow-hidden","data-tool":"pan",onClick:b,children:c.jsx("svg",{className:"ole-canvas-svg block h-full w-full",xmlns:"http://www.w3.org/2000/svg",children:c.jsxs("g",{ref:u,className:"ole-viewport",children:[c.jsx(q2,{}),c.jsx(Y2,{}),c.jsx(G2,{}),c.jsx(K2,{}),c.jsx(E2,{}),c.jsx(O2,{}),c.jsx(U2,{}),c.jsx(f4,{})]})})})}function _4(e,t){const n=e.internal.layout.get(t);if(n)return n.at;const o=e.internal.buses.get(t);if(o)return o.geometry.at;const r=e.internal.junctions.get(t);return r?r.world:null}const gs="ole-hover-element-host";function bs(e){return e.replace(/(["\\])/g,"\\$1")}function C4(e,t,n){const o=C.useRef(null),r=C.useRef(null),i=C.useRef(t);i.current=t;const s=C.useRef(n);s.current=n;const l=C.useCallback(a=>{var u,m;const d=e.current;!d||a===o.current||(o.current&&((u=d.querySelector(`[data-element-id="${bs(o.current)}"]`))==null||u.classList.remove(gs)),a&&((m=d.querySelector(`[data-element-id="${bs(a)}"]`))==null||m.classList.add(gs)),o.current=a)},[e]);C.useEffect(()=>{l(t===void 0?r.current:t)},[t,l]),C.useEffect(()=>{const a=e.current;if(!a)return;const d=p=>{var h;p!==r.current&&(r.current=p,(h=s.current)==null||h.call(s,p),i.current===void 0&&l(p))},u=p=>d(mt(p.target)??cn(p.target)),m=()=>d(null);return a.addEventListener("pointermove",u),a.addEventListener("pointerleave",m),()=>{a.removeEventListener("pointermove",u),a.removeEventListener("pointerleave",m),l(null)}},[e,l])}function j4(e,t){const n=C.useRef(!1);return C.useEffect(()=>{const o=e.current;if(!o)return;let r=null;const i=a=>{if(a.button!==0)return;const d=t.getViewport();r={pointerId:a.pointerId,startX:a.clientX,startY:a.clientY,startTx:d.tx,startTy:d.ty,moved:!1},n.current=!1},s=a=>{if(!r||a.pointerId!==r.pointerId)return;const d=a.clientX-r.startX,u=a.clientY-r.startY;if(!r.moved){if(Math.hypot(d,u)<=y4)return;r.moved=!0,n.current=!0,o.classList.add("ole-viewer-panning");try{o.setPointerCapture(a.pointerId)}catch{}}t.setViewport({tx:r.startTx+d,ty:r.startTy+u})},l=a=>{var d;if(!(!r||a.pointerId!==r.pointerId)){if((d=o.hasPointerCapture)!=null&&d.call(o,a.pointerId))try{o.releasePointerCapture(a.pointerId)}catch{}o.classList.remove("ole-viewer-panning"),r=null}};return o.addEventListener("pointerdown",i),o.addEventListener("pointermove",s),o.addEventListener("pointerup",l),o.addEventListener("pointercancel",l),()=>{o.removeEventListener("pointerdown",i),o.removeEventListener("pointermove",s),o.removeEventListener("pointerup",l),o.removeEventListener("pointercancel",l),o.classList.remove("ole-viewer-panning")}},[e,t]),n}function Bn(e){return e!==null&&typeof e=="object"&&"v"in e?e:{v:e}}function A4(e={}){const t=new Map;for(const[r,i]of Object.entries(e))t.set(r,Bn(i));const n=new Set,o=r=>{for(const i of n){let s=null;for(const l in r)i.paths.has(l)&&((s??(s={}))[l]=r[l]);s&&i.onChange(s)}};return{get:r=>t.get(r),subscribe(r,i){const s={paths:new Set(r),onChange:i};return n.add(s),()=>{n.delete(s)}},set(r,i){const s=Bn(i);t.set(r,s),o({[r]:s})},setMany(r){const i={};for(const[s,l]of Object.entries(r)){const a=Bn(l);t.set(s,a),i[s]=a}o(i)}}}const _S=new Set(["g","line","rect","circle","ellipse","polyline","polygon","path","text","tspan"]),CS=new Set(["fill","stroke","stroke-width","stroke-dasharray","stroke-linecap","stroke-linejoin","fill-opacity","stroke-opacity","opacity","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","points","d","transform","font-family","font-size","font-weight","text-anchor","dominant-baseline"]);function $4(e){const t=new Set,n=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,"image/svg+xml"),o=n.documentElement;if(!o||n.querySelector("parsererror"))return{svg:"",removed:["parse-error"]};const r=i=>{for(const s of[...i.children]){const l=s.tagName.toLowerCase();if(!_S.has(l)){t.add(`element:${l}`),s.remove();continue}for(const a of[...s.attributes]){const d=(a.localName??a.name).toLowerCase();CS.has(d)||(t.add(`attr:${a.name.toLowerCase()}`),s.removeAttribute(a.name))}r(s)}};return r(o),{svg:o.innerHTML.trim(),removed:[...t].sort()}}const zn=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function E4(e){var l,a,d,u,m;const t=[],n=(p,h)=>t.push({field:p,message:h});(l=e.id)!=null&&l.startsWith("custom:")||n("id","a document-defined kind must have a `custom:` id so it can never shadow a built-in"),(a=e.name)!=null&&a.trim()||n("name","name is required — it is what the user sees in the palette"),(d=e.category)!=null&&d.trim()||n("category","category is required for palette grouping");const o=(e.viewBox??"").trim().split(/[\s,]+/).map(Number),r=o.length===4&&o.every(p=>Number.isFinite(p))&&o[2]>0&&o[3]>0;r||n("viewBox",'viewBox must be four finite numbers "minX minY width height" with positive extent'),(u=e.svg)!=null&&u.trim()||n("svg","svg is empty — a symbol with no geometry is invisible on the canvas");const i=e.terminals??[];i.length||n("terminals","declare at least one terminal, or nothing can ever be wired to this symbol");const s=new Set;for(const p of i){if(!((m=p==null?void 0:p.id)!=null&&m.trim())){n("terminals","every terminal needs an id");continue}if(s.has(p.id)&&n("terminals",`duplicate terminal id '${p.id}'`),s.add(p.id),zn(p.x)===null||zn(p.y)===null){n("terminals",`terminal '${p.id}' needs finite x and y`);continue}if(r){const[h,g,f,b]=o;p.x>=h&&p.x<=h+f&&p.y>=g&&p.y<=g+b||n("terminals",`terminal '${p.id}' at (${p.x}, ${p.y}) is outside the viewBox — a pin floating off the symbol body leaves a visible gap at every connection`)}}if(i.length===2){const[p,h]=i;zn(p.x)!==null&&zn(h.x)!==null&&p.x!==h.x&&p.y!==h.y&&n("terminals",`the two terminals share neither an x (${p.x} vs ${h.x}) nor a y (${p.y} vs ${h.y}). A series device whose pins are offset on both axes renders every wire into it with a right-angle jog, in every drawing, permanently — put both pins on the run axis.`)}return t}const jS={"application/json":[".json"]},AS=()=>typeof window<"u"&&typeof window.showOpenFilePicker=="function",$S=e=>e instanceof DOMException&&e.name==="AbortError";function ys(e){let t;try{t=JSON.parse(e)}catch(o){throw new Error(Ae("io.parseFailed",{err:o.message}))}if(!t||typeof t!="object"||Array.isArray(t))throw new Error(Ae("io.notObject"));const n=t;if(n.version!=="1")throw new Error(Ae("io.versionMismatch",{actual:JSON.stringify(n.version)}));if(!Array.isArray(n.elements))throw new Error(Ae("io.elementsMissing"));return n}function N4(e){return JSON.stringify(e,null,2)+`
230
- `}async function T4(){if(AS()){let e;try{[e]=await window.showOpenFilePicker({multiple:!1,types:[{description:Ae("topbar.file.fileDescription"),accept:jS}]})}catch(n){if($S(n))return null;throw n}const t=await e.getFile();return{diagram:ys(await t.text()),session:{handle:e,name:t.name}}}return new Promise((e,t)=>{const n=document.createElement("input");n.type="file",n.accept=".json,application/json",n.addEventListener("change",async()=>{var r;const o=(r=n.files)==null?void 0:r[0];if(!o)return e(null);try{e({diagram:ys(await o.text()),session:{name:o.name}})}catch(i){t(i)}}),n.addEventListener("cancel",()=>e(null)),n.click()})}async function xs(e,t,n={}){const o=N4(e);if(!n.saveAs&&(t!=null&&t.handle)){const s=await t.handle.createWritable();return await s.write(o),await s.close(),t}if(AS()){let s;try{s=await window.showSaveFilePicker({suggestedName:(t==null?void 0:t.name)??"diagram.json",types:[{description:Ae("topbar.file.fileDescription"),accept:jS}]})}catch(a){if($S(a))return null;throw a}const l=await s.createWritable();return await l.write(o),await l.close(),{handle:s,name:s.name}}const r=URL.createObjectURL(new Blob([o],{type:"application/json"})),i=document.createElement("a");return i.href=r,i.download=(t==null?void 0:t.name)??"diagram.json",i.click(),URL.revokeObjectURL(r),t??{name:"diagram.json"}}function I4(){const e=re(),t=x(m=>m.fileSession),n=(t==null?void 0:t.name)??e("common.unnamed"),{onNew:o,onOpen:r,onSave:i,onSaveAs:s}=P4(),[l,a]=C.useState(!1),d=C.useRef(null);C.useEffect(()=>{const m=p=>{if(!(p.metaKey||p.ctrlKey))return;const h=p.key.toLowerCase();h==="o"?(p.preventDefault(),r()):h==="s"&&(p.preventDefault(),p.shiftKey?s():i())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[r,i,s]),C.useEffect(()=>{if(!l)return;const m=h=>{d.current&&!d.current.contains(h.target)&&a(!1)},p=h=>{h.key==="Escape"&&a(!1)};return window.addEventListener("mousedown",m),window.addEventListener("keydown",p),()=>{window.removeEventListener("mousedown",m),window.removeEventListener("keydown",p)}},[l]);const u=m=>()=>{a(!1),m()};return c.jsxs("div",{ref:d,className:"relative",children:[c.jsxs(De,{variant:"ghost",size:"sm",className:"gap-1.5","aria-haspopup":"menu","aria-expanded":l,onClick:()=>a(m=>!m),children:[c.jsx(Gr,{}),e("topbar.file.label")]}),l&&c.jsxs("div",{role:"menu",className:"ole-glass absolute left-0 top-full mt-1.5 min-w-44 rounded-md border border-border p-1 shadow-md",children:[c.jsx("div",{className:"border-b border-border px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:n}),c.jsx(Mn,{onClick:u(o),icon:c.jsx(o_,{}),children:e("topbar.file.new")}),c.jsx(Mn,{onClick:u(r),icon:c.jsx(Gr,{}),hint:"⌘O",children:e("topbar.file.open")}),c.jsx(Mn,{onClick:u(i),icon:c.jsx(Vr,{}),hint:"⌘S",children:e("topbar.file.save")}),c.jsx(Mn,{onClick:u(s),icon:c.jsx(Vr,{}),hint:"⌘⇧S",children:e("topbar.file.saveAs")})]})]})}function Mn({children:e,icon:t,hint:n,onClick:o}){return c.jsxs("button",{type:"button",role:"menuitem",onClick:o,className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[t,c.jsx("span",{className:"flex-1",children:e}),n&&c.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:n})]})}function P4(){const e=re(),t=x(a=>a.loadDiagramFromFile),n=x(a=>a.setFileSession),o=x(a=>a.setDiagram);return{onNew:()=>{const{diagram:a}=x.getState();a.elements.length>0&&!confirm(e("topbar.file.newConfirm"))||(o({version:"1",elements:[]}),n(null))},onOpen:async()=>{try{const a=await T4();a&&(t(a.diagram,a.session),wr())}catch(a){alert(e("topbar.file.openFailed",{err:a.message}))}},onSave:async()=>{try{const{diagram:a,fileSession:d}=x.getState(),u=await xs(a,d);u&&n(u)}catch(a){alert(e("topbar.file.saveFailed",{err:a.message}))}},onSaveAs:async()=>{try{const{diagram:a,fileSession:d}=x.getState(),u=await xs(a,d,{saveAs:!0});u&&n(u)}catch(a){alert(e("topbar.file.saveFailed",{err:a.message}))}}}}const Mo="WIRES",rt="ELEMENTS",Do="LABELS",He="ANNOTATIONS",ws=32,vs=64,z4=8,M4=1.25,D4=6;function ES(e,t={}){var s,l;const n=new U4(t.precision??6);n.header(t.title),n.tables([{name:Mo,color:7},{name:rt,color:7},{name:Do,color:8},{name:He,color:3}]),n.beginEntities();for(const a of e.wireRenders.values())a.path.length<2||(n.setColor($t(a.color)),n.polyline(Mo,a.path.map(xe),!1));n.setColor(void 0);for(const{bus:a,geometry:d}of e.buses.values()){const{axis:u,at:m,span:p}=d,h=p/2,g=u==="x"?[m[0]-h,m[1]]:[m[0],m[1]-h],f=u==="x"?[m[0]+h,m[1]]:[m[0],m[1]+h];n.setColor($t(a.color)),n.polyline(Mo,[g,f].map(xe),!1)}n.setColor(void 0);for(const a of e.elements.values()){const d=e.layout.get(a.element.id),u=a.libraryDef;!d||!u||(n.setColor($t(a.element.color)),R4(n,u.svg,d))}n.setColor(void 0);const o=t.labelMode??"all",r=zt(t.labelFontSize),i=hn(r);if(o!=="off"){for(const a of e.elements.values()){const d=e.layout.get(a.element.id);if(!d||!a.libraryDef)continue;const u=ro(a,o);if(u.length===0)continue;const m=a.libraryDef.label??io(a.libraryDef,r),{world:[p,h],textAnchor:g,dy:f}=so(m,a.libraryDef,d,u.length,r,a.element.labelOffset);for(let b=0;b<u.length;b++){const[y,v]=xe([p,h+f+b*i]);n.text(Do,[y,v],u[b],r,0,!1,g)}}for(const a of e.wireRenders.values()){const d=(s=a.label)==null?void 0:s.trim();if(!d)continue;const u=ao(a.path,r);if(!u)continue;const m=xe(u.world);n.setColor($t(a.color)),n.text(Do,m,d,r,0,!1,u.textAnchor)}n.setColor(void 0)}for(const a of t.annotations??[])switch(n.setColor($t(a.color)),Xe(a)){case"ellipse":{const d=a;if(n.polyline(He,BE(d).map(xe),!0),d.label){const u=xe([d.at[0]+ct,d.at[1]+ct+Ge]);n.text(He,u,d.label,Ge,0,!1)}break}case"rect":{const d=a,[u,m]=d.at,[p,h]=d.size;if(n.polyline(He,[[u,m],[u+p,m],[u+p,m+h],[u,m+h]].map(xe),!0),d.label){const g=xe([u+ct,m+ct+Ge]);n.text(He,g,d.label,Ge,0,!1)}break}case"line":{const d=a,u=fn(d);if(u.length<2)break;n.polyline(He,u.map(xe),!1);for(const m of br(u,d.arrow))n.polyline(He,m.map(xe),!0);break}case"table":{const d=a,[u,m]=d.at,[p,h]=nt(d),g=Rt(d),f=Ot(d),b=d.fontSize??Ge;n.polyline(He,[[u,m],[u+p,m],[u+p,m+h],[u,m+h]].map(xe),!0);for(let y=1;y<d.colWidths.length;y++)n.line(He,xe([u+g[y],m]),xe([u+g[y],m+h]));for(let y=1;y<d.rowHeights.length;y++)n.line(He,xe([u,m+f[y]]),xe([u+p,m+f[y]]));for(let y=0;y<d.rowHeights.length;y++)for(let v=0;v<d.colWidths.length;v++){const j=((l=d.cells[y])==null?void 0:l[v])??"";if(j==="")continue;const S=xe([u+g[v]+sn,m+f[y]+d.rowHeights[y]/2+b*.35]);n.text(He,S,j,b,0,!1)}break}default:{const d=a;if(!d.text)break;const u=d.fontSize??z4,m=d.text.split(`
231
- `);for(let p=0;p<m.length;p++){const[h,g]=xe([d.at[0],d.at[1]+(p+1)*u*M4]);n.text(He,[h,g],m[p],u,0,!1)}break}}return n.endEntities(),n.toString()}async function NS(e,t="diagram.dxf",n){const o=ES(e,n),r=URL.createObjectURL(new Blob([o],{type:"application/dxf;charset=utf-8"})),i=document.createElement("a");i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}function R4(e,t,n){const o=`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,i=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;if(!(!i||i.querySelector("parsererror")))for(const s of Array.from(i.children))switch(s.tagName.toLowerCase()){case"line":O4(e,s,n);break;case"polyline":ks(e,s,n,!1);break;case"polygon":ks(e,s,n,!0);break;case"rect":L4(e,s,n);break;case"circle":B4(e,s,n);break;case"ellipse":H4(e,s,n);break;case"path":G4(e,s,n);break;case"text":q4(e,s,n);break}}function O4(e,t,n){const o=$e(t,"x1"),r=$e(t,"y1"),i=$e(t,"x2"),s=$e(t,"y2"),l=xe(tt([o,r],n)),a=xe(tt([i,s],n));e.line(rt,l,a)}function ks(e,t,n,o){const r=X4(t.getAttribute("points")??"");if(r.length<2)return;const i=r.map(s=>xe(tt(s,n)));e.polyline(rt,i,o)}function L4(e,t,n){const o=$e(t,"x"),r=$e(t,"y"),i=$e(t,"width"),s=$e(t,"height"),a=[[o,r],[o+i,r],[o+i,r+s],[o,r+s]].map(d=>xe(tt(d,n)));e.polyline(rt,a,!0)}function B4(e,t,n){const o=$e(t,"cx"),r=$e(t,"cy"),i=$e(t,"r"),s=xe(tt([o,r],n));e.circle(rt,s,i*(n.scale??1))}function H4(e,t,n){const o=$e(t,"cx"),r=$e(t,"cy"),i=$e(t,"rx"),s=$e(t,"ry");if(Math.abs(i-s)<1e-6){F4(e,o,r,i,n);return}W4(e,o,r,i,s,n)}function F4(e,t,n,o,r){const i=xe(tt([t,n],r));e.circle(rt,i,o*(r.scale??1))}function W4(e,t,n,o,r,i){const s=[];for(let l=0;l<vs;l++){const a=l/vs*Math.PI*2;s.push(xe(tt([t+o*Math.cos(a),n+r*Math.sin(a)],i)))}e.polyline(rt,s,!0)}function q4(e,t,n){const o=$e(t,"x"),r=$e(t,"y"),i=parseFloat(t.getAttribute("font-size")??"")||D4,s=(t.textContent??"").trim();if(!s)return;const l=xe(tt([o,r],n));e.text(rt,l,s,i*(n.scale??1),n.rot,n.mirror)}function G4(e,t,n){const o=t.getAttribute("d")??"",r=V4(o);if(r.length===0)return;let i=null,s=[];const l=()=>{s.length>=2&&e.polyline(rt,s.map(a=>xe(tt(a,n))),!1),s=[]};for(const a of r)if(a.cmd==="M")l(),i=[a.args[0],a.args[1]],s.push(i);else if(a.cmd==="A"&&i){const[d,u,,m,p,h,g]=a.args,f=K4(i,[h,g],d,u,m!==0,p!==0);if(f)for(let b=1;b<=ws;b++){const y=f.theta1+f.delta*b/ws;s.push([f.cx+d*Math.cos(y),f.cy+u*Math.sin(y)])}else s.push([h,g]);i=[h,g]}l()}function V4(e){const t=[],n=/([MmAa])([^MmAa]*)/g;let o;for(;(o=n.exec(e))!==null;){const r=o[1].toUpperCase(),i=o[2].trim().split(/[\s,]+/).filter(s=>s.length>0).map(Number);t.push({cmd:r,args:i})}return t}function K4(e,t,n,o,r,i){if(n<=0||o<=0)return null;const[s,l]=e,[a,d]=t;if(s===a&&l===d)return null;const u=(s-a)/2,m=(l-d)/2;let p=Math.abs(n),h=Math.abs(o);const g=p*p,f=h*h,b=u*u/g+m*m/f;if(b>1){const V=Math.sqrt(b);p*=V,h*=V}const y=r===i?-1:1,v=p*p*h*h-p*p*m*m-h*h*u*u,j=p*p*m*m+h*h*u*u,S=y*Math.sqrt(Math.max(0,v/j)),N=S*(p*m)/h,W=S*-(h*u)/p,ne=N+(s+a)/2,pe=W+(l+d)/2,$=(V,F,K,ie)=>{const he=V*K+F*ie,ae=Math.hypot(V,F)*Math.hypot(K,ie);let fe=Math.acos(Math.max(-1,Math.min(1,he/ae)));return V*ie-F*K<0&&(fe=-fe),fe},R=$(1,0,(u-N)/p,(m-W)/h);let H=$((u-N)/p,(m-W)/h,(-u-N)/p,(-m-W)/h);return!i&&H>0?H-=2*Math.PI:i&&H<0&&(H+=2*Math.PI),{cx:ne,cy:pe,theta1:R,delta:H}}function tt(e,t){return Le(e,t)}function xe(e){return[e[0],-e[1]]}function $e(e,t){const n=parseFloat(e.getAttribute(t)??"");return Number.isFinite(n)?n:0}function X4(e){const t=e.trim().split(/[\s,]+/).map(Number).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o+1<t.length;o+=2)n.push([t[o],t[o+1]]);return n}class U4{constructor(t){qe(this,"out",[]);qe(this,"precision");qe(this,"minX",1/0);qe(this,"minY",1/0);qe(this,"maxX",-1/0);qe(this,"maxY",-1/0);qe(this,"extentsSlot",-1);qe(this,"currentColor");this.precision=t}track(t,n){!Number.isFinite(t)||!Number.isFinite(n)||(t<this.minX&&(this.minX=t),t>this.maxX&&(this.maxX=t),n<this.minY&&(this.minY=n),n>this.maxY&&(this.maxY=n))}toString(){return this.extentsSlot>=0&&Number.isFinite(this.minX)&&(this.out[this.extentsSlot]=`9
221
+ */const bn=ge("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
222
+ * @license lucide-react v0.469.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const bo=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ts(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=ts(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function ns(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=ts(e))&&(o&&(o+=" "),o+=t);return o}const Er="-",cj=e=>{const t=uj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{const l=i.split(Er);return l[0]===""&&l.length!==1&&l.shift(),os(l,t)||dj(i)},getConflictingClassGroupIds:(i,l)=>{const s=n[i]||[];return l&&o[i]?[...s,...o[i]]:s}}},os=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?os(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const a=e.join(Er);return(i=t.validators.find(({validator:l})=>l(a)))==null?void 0:i.classGroupId},da=/^\[(.+)\]$/,dj=e=>{if(da.test(e)){const t=da.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},uj=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return pj(Object.entries(e.classGroups),n).forEach(([a,i])=>{nr(i,o,a,t)}),o},nr=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const a=r===""?t:ua(t,r);a.classGroupId=n;return}if(typeof r=="function"){if(mj(r)){nr(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([a,i])=>{nr(i,ua(t,a),n,o)})})},ua=(e,t)=>{let n=e;return t.split(Er).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},mj=e=>e.isThemeGetter,pj=(e,t)=>t?e.map(([n,o])=>{const r=o.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,l])=>[t+i,l])):a);return[n,r]}):e,hj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(a,i)=>{n.set(a,i),t++,t>e&&(t=0,o=n,n=new Map)};return{get(a){let i=n.get(a);if(i!==void 0)return i;if((i=o.get(a))!==void 0)return r(a,i),i},set(a,i){n.has(a)?n.set(a,i):r(a,i)}}},rs="!",fj=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],a=t.length,i=l=>{const s=[];let d=0,u=0,m;for(let b=0;b<l.length;b++){let y=l[b];if(d===0){if(y===r&&(o||l.slice(b,b+a)===t)){s.push(l.slice(u,b)),u=b+a;continue}if(y==="/"){m=b;continue}}y==="["?d++:y==="]"&&d--}const p=s.length===0?l:l.substring(u),g=p.startsWith(rs),h=g?p.substring(1):p,f=m&&m>u?m-u:void 0;return{modifiers:s,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:f}};return n?l=>n({className:l,parseClassName:i}):i},gj=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},bj=e=>({cache:hj(e.cacheSize),parseClassName:fj(e),...cj(e)}),yj=/\s+/,xj=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,a=[],i=e.trim().split(yj);let l="";for(let s=i.length-1;s>=0;s-=1){const d=i[s],{modifiers:u,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:g}=n(d);let h=!!g,f=o(h?p.substring(0,g):p);if(!f){if(!h){l=d+(l.length>0?" "+l:l);continue}if(f=o(p),!f){l=d+(l.length>0?" "+l:l);continue}h=!1}const b=gj(u).join(":"),y=m?b+rs:b,w=y+f;if(a.includes(w))continue;a.push(w);const j=r(f,h);for(let _=0;_<j.length;++_){const E=j[_];a.push(y+E)}l=d+(l.length>0?" "+l:l)}return l};function wj(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=as(t))&&(o&&(o+=" "),o+=n);return o}const as=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=as(e[o]))&&(n&&(n+=" "),n+=t);return n};function vj(e,...t){let n,o,r,a=i;function i(s){const d=t.reduce((u,m)=>m(u),e());return n=bj(d),o=n.cache.get,r=n.cache.set,a=l,l(s)}function l(s){const d=o(s);if(d)return d;const u=xj(s,n);return r(s,u),u}return function(){return a(wj.apply(null,arguments))}}const Pe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},is=/^\[(?:([a-z-]+):)?(.+)\]$/i,kj=/^\d+\/\d+$/,Sj=new Set(["px","full","screen"]),_j=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$j=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Aj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ft=e=>Kt(e)||Sj.has(e)||kj.test(e),_t=e=>Zt(e,"length",Dj),Kt=e=>!!e&&!Number.isNaN(Number(e)),Oo=e=>Zt(e,"number",Kt),ln=e=>!!e&&Number.isInteger(Number(e)),Ej=e=>e.endsWith("%")&&Kt(e.slice(0,-1)),fe=e=>is.test(e),Ct=e=>_j.test(e),Nj=new Set(["length","size","percentage"]),Tj=e=>Zt(e,Nj,ss),Pj=e=>Zt(e,"position",ss),Ij=new Set(["image","url"]),zj=e=>Zt(e,Ij,Rj),Mj=e=>Zt(e,"",Oj),cn=()=>!0,Zt=(e,t,n)=>{const o=is.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},Dj=e=>Cj.test(e)&&!jj.test(e),ss=()=>!1,Oj=e=>$j.test(e),Rj=e=>Aj.test(e),Lj=()=>{const e=Pe("colors"),t=Pe("spacing"),n=Pe("blur"),o=Pe("brightness"),r=Pe("borderColor"),a=Pe("borderRadius"),i=Pe("borderSpacing"),l=Pe("borderWidth"),s=Pe("contrast"),d=Pe("grayscale"),u=Pe("hueRotate"),m=Pe("invert"),p=Pe("gap"),g=Pe("gradientColorStops"),h=Pe("gradientColorStopPositions"),f=Pe("inset"),b=Pe("margin"),y=Pe("opacity"),w=Pe("padding"),j=Pe("saturate"),_=Pe("scale"),E=Pe("sepia"),W=Pe("skew"),Q=Pe("space"),ke=Pe("translate"),we=()=>["auto","contain","none"],Y=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto",fe,t],D=()=>[fe,t],M=()=>["",ft,_t],G=()=>["auto",Kt,fe],me=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],pe=()=>["solid","dashed","dotted","double","none"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",fe],_e=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ie=()=>[Kt,fe];return{cacheSize:500,separator:":",theme:{colors:[cn],spacing:[ft,_t],blur:["none","",Ct,fe],brightness:Ie(),borderColor:[e],borderRadius:["none","","full",Ct,fe],borderSpacing:D(),borderWidth:M(),contrast:Ie(),grayscale:ie(),hueRotate:Ie(),invert:ie(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Ej,_t],inset:k(),margin:k(),opacity:Ie(),padding:D(),saturate:Ie(),scale:Ie(),sepia:ie(),skew:Ie(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",fe]}],container:["container"],columns:[{columns:[Ct]}],"break-after":[{"break-after":_e()}],"break-before":[{"break-before":_e()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...me(),fe]}],overflow:[{overflow:Y()}],"overflow-x":[{"overflow-x":Y()}],"overflow-y":[{"overflow-y":Y()}],overscroll:[{overscroll:we()}],"overscroll-x":[{"overscroll-x":we()}],"overscroll-y":[{"overscroll-y":we()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ln,fe]}],basis:[{basis:k()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",fe]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",ln,fe]}],"grid-cols":[{"grid-cols":[cn]}],"col-start-end":[{col:["auto",{span:["full",ln,fe]},fe]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[cn]}],"row-start-end":[{row:["auto",{span:[ln,fe]},fe]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",fe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Se()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Se(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Se(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",fe,t]}],"min-w":[{"min-w":[fe,t,"min","max","fit"]}],"max-w":[{"max-w":[fe,t,"none","full","min","max","fit","prose",{screen:[Ct]},Ct]}],h:[{h:[fe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[fe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ct,_t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oo]}],"font-family":[{font:[cn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",fe]}],"line-clamp":[{"line-clamp":["none",Kt,Oo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ft,fe]}],"list-image":[{"list-image":["none",fe]}],"list-style-type":[{list:["none","disc","decimal",fe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ft,_t]}],"underline-offset":[{"underline-offset":["auto",ft,fe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...me(),Pj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Tj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...pe(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:pe()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...pe()]}],"outline-offset":[{"outline-offset":[ft,fe]}],"outline-w":[{outline:[ft,_t]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ft,_t]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ct,Mj]}],"shadow-color":[{shadow:[cn]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":te()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",Ct,fe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[m]}],saturate:[{saturate:[j]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",fe]}],duration:[{duration:Ie()}],ease:[{ease:["linear","in","out","in-out",fe]}],delay:[{delay:Ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[ln,fe]}],"translate-x":[{"translate-x":[ke]}],"translate-y":[{"translate-y":[ke]}],"skew-x":[{"skew-x":[W]}],"skew-y":[{"skew-y":[W]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",fe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ft,_t,Oo]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Bj=vj(Lj);function Ee(...e){return Bj(ns(e))}const ls=$.createContext(null);function Hj(){const e=$.useContext(ls);if(!e)throw new Error("useContextMenu must be used inside <ContextMenuHost>");return e}const Rn=8;function Fj({children:e}){const[t,n]=$.useState({open:!1,x:0,y:0,items:[]}),[o,r]=$.useState(null),a=$.useRef(null),i=$.useCallback(()=>{n(d=>d.open?{...d,open:!1}:d)},[]),l=$.useCallback((d,u,m)=>{r(null),n({open:!0,x:d,y:u,items:m})},[]),s=$.useMemo(()=>({open:l,close:i}),[l,i]);return $.useLayoutEffect(()=>{if(!t.open||!a.current)return;const d=a.current.getBoundingClientRect();let u=t.x,m=t.y;u+d.width>window.innerWidth-Rn&&(u=Math.max(Rn,t.x-d.width)),m+d.height>window.innerHeight-Rn&&(m=Math.max(Rn,t.y-d.height)),r({left:u,top:m})},[t]),$.useEffect(()=>{if(!t.open)return;const d=g=>{a.current&&!a.current.contains(g.target)&&i()},u=g=>{g.key==="Escape"&&(g.preventDefault(),i())},m=()=>i(),p=()=>i();return document.addEventListener("pointerdown",d,!0),document.addEventListener("keydown",u,!0),window.addEventListener("wheel",m,{passive:!0}),window.addEventListener("blur",p),()=>{document.removeEventListener("pointerdown",d,!0),document.removeEventListener("keydown",u,!0),window.removeEventListener("wheel",m),window.removeEventListener("blur",p)}},[t.open,i]),c.jsxs(ls.Provider,{value:s,children:[e,t.open&&c.jsx("div",{ref:a,role:"menu","aria-orientation":"vertical",className:"ole-glass fixed z-50 min-w-[200px] rounded-md border border-border p-1 text-sm shadow-md",style:{left:(o==null?void 0:o.left)??t.x,top:(o==null?void 0:o.top)??t.y,visibility:o?"visible":"hidden"},onContextMenu:d=>d.preventDefault(),children:t.items.map((d,u)=>{if(d.type==="separator")return c.jsx("div",{role:"separator",className:"my-1 h-px bg-border"},`sep-${u}`);const m=d.icon;return c.jsxs("button",{type:"button",role:"menuitem",disabled:d.disabled,className:Ee("flex w-full items-center justify-between gap-3 rounded-sm px-2 py-1.5 text-left","hover:bg-accent hover:text-accent-foreground","focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:outline-none",d.destructive&&"text-destructive hover:bg-destructive/10 hover:text-destructive",d.disabled&&"pointer-events-none text-muted-foreground opacity-60"),onClick:()=>{i(),d.onSelect()},children:[c.jsxs("span",{className:"flex items-center gap-2",children:[m?c.jsx(m,{className:"size-4"}):null,c.jsx("span",{children:d.label})]}),d.shortcut?c.jsx("span",{className:"text-xs text-muted-foreground",children:d.shortcut}):null]},`${d.label}-${u}`)})})]})}const ma=e=>{let t;const n=new Set,o=(d,u)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const p=t;t=u??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(g=>g(t,p))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>s,subscribe:d=>(n.add(d),()=>n.delete(d))},s=t=e(o,r,l);return l},cs=(e=>e?ma(e):ma),Wj=e=>e;function ds(e,t=Wj){const n=$.useSyncExternalStore(e.subscribe,$.useCallback(()=>t(e.getState()),[e,t]),$.useCallback(()=>t(e.getInitialState()),[e,t]));return $.useDebugValue(n),n}const pa=e=>{const t=cs(e),n=o=>ds(t,o);return Object.assign(n,t),n},Nn=(e=>e?pa(e):pa),qj={"common.unnamed":"Sin título","common.close":"Cerrar","common.yes":"Sí","common.no":"No","topbar.theme.toLight":"Cambiar a claro","topbar.theme.toDark":"Cambiar a oscuro","topbar.theme.currentDark":"Actual: tema oscuro","topbar.theme.currentLight":"Actual: tema claro","topbar.lang.toEnglish":"Cambiar a inglés","topbar.lang.toChinese":"Cambiar a chino","topbar.lang.currentEnglish":"Actual: inglés","topbar.lang.currentChinese":"Actual: chino","topbar.export.label":"Exportar","topbar.export.tooltip":"SVG vectorial (editable), mapa de bits PNG (2× HiDPI) o DXF (CAD)","topbar.export.pngFailed":"Error al exportar PNG: {err}","topbar.export.dxfFailed":"Error al exportar DXF: {err}","topbar.file.label":"Archivo","topbar.file.tooltip":"Abrir un diagrama .json local, guardar o guardar como","topbar.file.current":"Actual: {name}","topbar.file.new":"Nuevo","topbar.file.open":"Abrir…","topbar.file.save":"Guardar","topbar.file.saveAs":"Guardar como…","topbar.file.newConfirm":"Crear uno nuevo descartará los cambios sin guardar. ¿Continuar?","topbar.file.openFailed":"Error al abrir: {err}","topbar.file.saveFailed":"Error al guardar: {err}","topbar.file.fileDescription":"Diagrama de OneLineEditor","outline.title":"Esquema","outline.collapse":"Contraer","outline.collapseAria":"Contraer esquema","outline.empty":"(Sin elementos — arrastra desde la biblioteca para empezar)","props.title":"Propiedades","props.node":"Nodo eléctrico","props.wire":"Cable","props.bus":"Barra","props.junction":"Empalme","props.junctionPos":"Posición","props.nSelected":"{n} seleccionados","props.empty":"Nada seleccionado","props.multi":"{n} objetos seleccionados","props.name":"Nombre","props.note":"Nota","props.label":"Etiqueta","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nodo eléctrico {id} no encontrado","props.wireNotFound":"Cable {id} no encontrado","props.nodeStats":"{terminals} terminales · {elements} elementos","props.selectElement":"Seleccionar {label}","props.selectWholeNode":"Seleccionar todo el nodo eléctrico","props.annText":"Texto","props.annRect":"Rectángulo","props.annEllipse":"Elipse","props.annLine":"Línea","props.annTable":"Tabla","props.annNotFound":"Anotación {id} no encontrada","props.annLabel":"Etiqueta","props.annLabelPlaceholder":"ej.: Tablero n.º 1","props.color":"Color","props.size":"Tamaño","props.sizeReset":"Restablecer al 100 %","props.labelShown":"Visible","props.labelHidden":"Oculta","props.contactType":"Contacto","props.direction":"Sentido","props.directionOut":"Salida","props.directionIn":"Llegada","props.partner":"Pareja","props.partnerUnnamed":"Póngale nombre para emparejarla con la continuación del mismo nombre","props.partnerNone":"No hay pareja en este esquema","props.partnerJump":"Ir a {id}","health.title":"Revisión","health.hint":"Revisión de conexiones y alimentación: indicaciones y estimaciones, no una verificación normativa","health.markers":"Mostrar en el esquema","health.none":"No se encontraron problemas","health.sectionProblems":"Problemas","health.sectionNotes":"Notas","health.sectionDismissed":"Marcado como intencional","health.sectionLoads":"Totales de carga","health.dismiss":"Es intencional","health.restore":"Restaurar","health.loadKnown":"{kw} kW conocidos ({k}/{t} cargas)","health.loadAll":"{kw} kW ({t} cargas)","health.label.unwired":"Sin conectar","health.label.looks-joined":"Parece conectado, pero no","health.label.dangling-wire":"Extremo de cable libre","health.label.supply-disconnected":"Fuente sin conectar","health.label.unsupplied":"Sin camino a una fuente","health.label.no-origin":"Sin símbolo de fuente","health.label.voltage-mix":"Tensiones unidas","health.label.ratio-mismatch":"Relación no coincide","health.label.label-mismatch":"Nombre vs. parámetro","health.label.overload":"Supera la potencia nominal","health.label.feeder-end":"El alimentador termina aquí","health.label.open-side":"Lado de alimentación libre","health.introTitle":"Revisión del esquema","health.intro":"Se encontraron {n} posibles problemas en las conexiones de este esquema. Los puntos muestran dónde. Son indicaciones a partir del cableado, no una revisión normativa.","health.introShow":"Ver","health.introOk":"Entendido","health.loading":"{pct} % de {rating} kVA","health.disclaimer":"Indicaciones y estimaciones a partir de las conexiones del esquema, no una verificación normativa.","health.overloadUnits":"Más de 10 veces la potencia nominal: revise las unidades de las cargas (la P de una carga genérica está en MW).","health.code.unwired":"{name} no está conectado. Tocar una línea no es una conexión: dibuje un cable hasta su borne.","health.code.looks-joined":"Aquí un cable termina sobre otro punto de conexión sin unirse a él: parece conectado, pero no lo está.","health.code.dangling-wire":"Aquí un cable termina sin conectarse a nada.","health.code.supply-disconnected":"{name} no está conectado al resto del esquema: {count} de {total} equipos no tienen camino hasta una fuente.","health.code.unsupplied":"{count} equipo(s) aquí no tienen camino hasta ninguna fuente.","health.code.no-origin":"Este esquema no tiene símbolo de fuente. Agregue una red o un generador para revisar la alimentación y ver los totales de carga.","health.code.voltage-mix":"Aquí se conectan {a} kV y {b} kV sin transformador.","health.code.ratio-mismatch":"{name}: la relación {ratio} no coincide con las barras de sus dos lados ({a} kV / {b} kV).","health.code.label-mismatch":"{name}: el nombre y el parámetro {param} ({value}) no coinciden.","health.code.overload":"{name}: la carga conocida de {load} kVA supera la potencia nominal de {rating} kVA (todas las cargas a plena potencia, sin simultaneidad).","health.code.feeder-end":"{name}: el alimentador termina aquí.","health.code.open-side":"{name}: el lado de alimentación no está conectado (suele ser el extremo de entrada del esquema).","props.color.default":"Predeterminado","props.color.red":"Rojo","props.color.amber":"Ámbar","props.color.green":"Verde","props.color.blue":"Azul","props.color.gray":"Gris","props.annStroke":"Trazo","props.annStrokeSolid":"Sólido","props.annStrokeDashed":"Discontinuo","props.annStrokeDotted":"Punteado","props.annStrokeWidth":"Grosor","props.annWidthThin":"Fino","props.annWidthMedium":"Medio","props.annWidthThick":"Grueso","props.annFill":"Relleno","props.annFillNone":"Ninguno","props.annFillTint":"Tinte","props.annArrow":"Flechas","props.annArrowNone":"Ninguna","props.annArrowEnd":"Un extremo","props.annArrowBoth":"Ambos extremos","props.annFontSize":"Tamaño de fuente","props.annRows":"Filas","props.annCols":"Columnas","view.zoomOut":"Alejar","view.zoomOutHint":"Aleja un nivel; también rueda ↓ o ⌘−","view.reset":"Restablecer a 100%","view.current":"Actual {z}%","view.zoomIn":"Acercar","view.zoomInHint":"Acerca un nivel; también rueda ↑ o ⌘+","view.fit":"Ajustar vista","view.fitHint":"Ajusta el zoom y centra todo el dibujo automáticamente","view.gridHide":"Ocultar cuadrícula","view.gridShow":"Mostrar cuadrícula","view.gridHotkey":"G","view.gridHideHint":"También desactiva el ajuste a cuadrícula (colocación libre)","view.gridShowHint":"También activa el ajuste a cuadrícula (ajusta a 10px al arrastrar)","view.gridHideAria":"Ocultar cuadrícula y desactivar ajuste","view.gridShowAria":"Mostrar cuadrícula y activar ajuste","view.label":"Etiquetas","view.labelOff":"Ninguna","view.labelId":"ID","view.labelAll":"ID + parámetros","view.labelHint":"Visibilidad y tamaño de las etiquetas (también en la exportación)","view.labelSize":"Tamaño","view.labelSizeSmaller":"Reducir el tamaño de las etiquetas","view.labelSizeLarger":"Aumentar el tamaño de las etiquetas","view.standard":"Norma de símbolos","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Solo cambia el dibujo de los símbolos: el cableado, las posiciones y los valores no se tocan. El interruptor y el fusible se dibujan distinto.","view.labelSizeReset":"Restablecer el tamaño de las etiquetas","library.title":"Biblioteca","tool.draw":"Dibujar","tool.drawHint":"Texto, cajas, círculos, líneas y tablas — anotación libre sobre el dibujo","library.empty":"No hay elementos coincidentes","cat.custom":"En este dibujo","library.customTag":"propio","library.customHint":"Definido por este dibujo — no está en la biblioteca de nadie más","library.createComponent":"Nuevo componente…","library.searchPlaceholder":"Buscar elementos…","library.searchAria":"Buscar elementos","library.clearSearch":"Borrar búsqueda","library.itemHint":"Haz clic para entrar en modo de colocación, o arrastra al lienzo","tool.select":"Seleccionar","tool.selectHint":"Clic para elegir, arrastra un marco para varios, clic derecho para el menú","tool.pan":"Desplazar","tool.panHint":"Arrastra el lienzo; la barra espaciadora lo activa temporalmente","tool.wire":"Cable","tool.wireHint":"Arrastra desde un pin/barra/empalme; soltar en espacio vacío crea un empalme, soltar sobre un cable lo conecta","tool.bus":"Barra","tool.busHint":"Arrastra en el lienzo: pulsa para fijar el inicio, suelta para fijar el final","tool.junction":"Empalme","tool.junctionHint":"Haz clic en el lienzo para colocar un empalme (nodo); los cables se conectan a él libremente","tool.place":"Colocar","tool.placeHint":"Haz clic para colocar; o arrastra desde un terminal/barra para colocar y conectar","tool.text":"Texto","tool.textHint":"Haz clic en el lienzo para colocar una nota de texto; haz doble clic en una existente para editarla","tool.rect":"Rectángulo","tool.rectHint":"Arrastra para dibujar un rectángulo / marco de grupo (discontinuo por defecto); Mayús para un cuadrado","tool.ellipse":"Elipse","tool.ellipseHint":"Arrastra para dibujar una elipse; mantén Mayús para un círculo","tool.line":"Línea","tool.lineHint":"Arrastra para dibujar una línea de anotación; Mayús ajusta a 45°; las flechas se configuran en el panel","tool.table":"Tabla","tool.tableHint":"Arrastra para definir columnas × filas (conteo en vivo), o haz clic para una tabla predeterminada; haz doble clic en las celdas para escribir","mode.selectWithSel":"Arrastra elementos · arrastra terminales para conectar · clic derecho para el menú","mode.selectEmpty":"Clic para elegir · arrastra para mover · marco para varios · clic derecho para el menú","mode.pan":"Arrastra el lienzo · desplaza la rueda para hacer zoom · mantén Espacio para desplazar en cualquier herramienta","mode.wireDragging":"Suelta sobre un pin/barra/empalme; soltar en espacio vacío crea un empalme","mode.wireInit":"Pulsa sobre cualquier punto de conexión o espacio vacío, arrastra hasta el destino y suelta","mode.busDragging":"Arrastrar fija la dirección de la barra; soltar fija el final","mode.busInit":"Pulsa en el lienzo para fijar el inicio, arrastra y suelta para fijar el final","mode.junction":"Haz clic en el lienzo para colocar un empalme","mode.placeNoKind":"Elige un tipo de elemento de la biblioteca a la izquierda","mode.placeFromTerm":"Suelta en el destino — el nuevo elemento se conectará al terminal de origen","mode.placeNormal":"Haz clic en un espacio vacío para colocar; o arrastra desde un terminal / barra para colocar y conectar","mode.text":"Clic para colocar texto · doble clic para editar · arrastra la selección para mover · Supr para eliminar","mode.rect":"Arrastra para dibujar un rectángulo · Mayús para cuadrado · redimensiona y etiqueta al soltar","mode.ellipse":"Arrastra para dibujar una elipse · Mayús para círculo · redimensiona, recolorea y etiqueta al soltar","mode.line":"Arrastra para dibujar una línea · Mayús ajusta a 45° · añade flechas en el panel al soltar","mode.table":"Arrastra para definir la cuadrícula, o haz clic para una tabla de 3×3 · doble clic en las celdas para escribir","mode.annTextSel":"Haz clic en el texto para editar · arrastra para mover · Supr para eliminar","mode.annTableSel":"Haz clic en una celda para completarla · arrastra para mover · Supr para eliminar","mode.annShapeSel":"Arrastra para mover · arrastra los controladores para redimensionar · cambia el estilo en el panel · Supr para eliminar","mode.annEditing":"Escribe · Intro para confirmar · Esc para cancelar · o los botones ✓ / ✕","mode.escSelect":"Esc borra la selección","mode.escOther":"Clic derecho / Esc para cancelar","tool.placeNoKindTooltip":"Elige un tipo en la biblioteca a la izquierda y luego haz clic en el lienzo","tool.undo":"Deshacer","tool.undoHint":"Deshace la última edición (mover / rotar / eliminar, etc.)","tool.redo":"Rehacer","tool.redoHint":"Rehace la última edición deshecha","layout.label":"Diseño","layout.hint":"Organiza automáticamente todo el diagrama o solo la selección, y rellena los huecos","layout.allAuto":"Organizar todo automáticamente","layout.selAuto":"Organizar la selección automáticamente","layout.allFill":"Rellenar sin colocar","layout.selFill":"Rellenar los no colocados en la selección","tool.more":"Más","tool.moreHint":"Deshacer / rehacer / diseño","view.menu":"Vista","view.menuHint":"Zoom, ajuste, cuadrícula","ctx.ariaNode":"Acciones del nodo","ctx.ariaWire":"Acciones del cable","ctx.ariaElement":"Acciones del elemento","ctx.ariaEdit":"Acciones de edición","ctx.done":"Listo","ctx.cancel":"Cancelar","ctx.rotate":"Rotar 90°","ctx.rotateHint":"Rota la selección en sentido horario; los cables se re-enrutan a los nuevos terminales","ctx.mirror":"Reflejar horizontalmente","ctx.mirrorTitle":"Reflejar","ctx.mirrorHint":"Invierte la selección de izquierda a derecha","ctx.delete":"Eliminar","ctx.color":"Color","ctx.colorDefault":"Predeterminado","ctx.colorRed":"Rojo","ctx.colorAmber":"Ámbar","ctx.colorGreen":"Verde","ctx.colorBlue":"Azul","ctx.colorGray":"Gris","ctx.deleteHintNode":"Desconecta todos los cables de este nodo (los elementos permanecen)","ctx.deleteHintWire":"Elimina solo este cable (los demás del mismo nodo permanecen)","ctx.deleteHintElement":"Elimina la selección y sus cables","ctx.resetWirePath":"Restablecer al enrutado automático","ctx.resetWirePathHint":"Descarta los ángulos manuales y deja que el enrutador vuelva a trazar este cable","menu.undo":"Deshacer","menu.redo":"Rehacer","menu.cut":"Cortar","menu.copy":"Copiar","menu.paste":"Pegar","menu.rotate":"Rotar 90°","menu.mirror":"Reflejar","menu.resetLabel":"Restablecer posición de la etiqueta","menu.selectAll":"Seleccionar todo","menu.disconnect":"Desconectar este cable","menu.delete":"Eliminar","io.parseFailed":"Error al analizar JSON: {err}","io.notObject":"El archivo no es un objeto JSON","io.versionMismatch":'Versión incompatible: se esperaba "1", se obtuvo {actual}',"io.elementsMissing":"`elements` falta o no es un array","compile.duplicateId":'ID de elemento duplicado: "{id}"',"compile.unknownKind":'Tipo de elemento desconocido kind="{kind}"',"compile.invalidTermRef":'Referencia de terminal no válida "{ref}"',"compile.elementMissing":'Referencia a un elemento desconocido "{id}"',"compile.missingPin":'El elemento "{id}" (kind={kind}) no tiene el pin "{pin}"; disponibles: {available}',"compile.singleTerminal":"El nodo solo tiene un terminal — ignorado","compile.layoutMissingElement":'La clave de layout "{id}" hace referencia a un elemento desconocido',"compile.elementUnconnected":'El elemento "{id}" no tiene conexiones',"cat.busbar":"Barras / cableado","cat.switching":"Conmutación","cat.protection":"Protección","cat.motor-control":"Control de motores","cat.transformer":"Transformadores","cat.instrument-transformer":"Transformadores de medida","cat.measurement":"Medición","cat.source":"Fuentes","cat.load":"Cargas","cat.storage":"Almacenamiento","cat.compensation":"Compensación","cat.grounding":"Puesta a tierra","cat.renewable":"Renovables / electrónica de potencia","onboard.title":"Inicio rápido","onboard.step1.title":"Coloca un componente","onboard.step1.body":"Elige la herramienta Colocar (P) y arrastra un tipo de la biblioteca al lienzo","onboard.step2.title":"Conéctalo","onboard.step2.body":"Usa la herramienta Cable (W): arrastra de un pin a otro — arrastra a un espacio vacío para crear un empalme","onboard.step3.title":"Una barra es un riel compartido, no un cable","onboard.step3.body":"Usa la herramienta Barra (B) solo cuando varios circuitos comparten un mismo riel. No uses una barra para unir dos dispositivos — simplemente conecta los pines con un cable (W).","onboard.dismiss":"Entendido"},Vj={"arc-suppression-coil.name":"Bobina de extinción de arco","arrester.name":"Descargador de sobretensiones (FBL)","async-motor.name":"Motor asíncrono","autotransformer.name":"Autotransformador","battery.name":"Almacenamiento en batería","breaker.name":"Interruptor automático (QF)","busbar.name":"Tramo de barra","converter-bidir.name":"Convertidor bidireccional (PCS)","dc-dc-converter.name":"Convertidor CC/CC","mppt.name":"Controlador MPPT","ct.name":"Transformador de corriente (CT)","disconnector.name":"Seccionador (QS)","earth.name":"Tierra","earthing-switch.name":"Seccionador de puesta a tierra (QE)","fuse.name":"Fusible (FU)","generator.name":"Generador (G)","grid-source.name":"Fuente de red","grounding-transformer.name":"Transformador de puesta a tierra (zig-zag)","inverter.name":"Inversor (CC→CA)","load-switch.name":"Interruptor de carga","load.name":"Carga","luminaire.name":"Luminaria (carga de alumbrado)","panelboard.name":"Tablero de distribución","ngr.name":"Resistencia de puesta a tierra del neutro (NGR)","pt.name":"Transformador de tensión (PT)","pv.name":"Módulo fotovoltaico","rectifier.name":"Rectificador (CA→CC)","series-reactor.name":"Reactor serie","shunt-capacitor.name":"Condensador en derivación","shunt-reactor.name":"Reactor en derivación","sync-motor.name":"Motor síncrono","transformer-2w.name":"Transformador de dos devanados","transformer-3w.name":"Transformador de tres devanados","wind-turbine.name":"Aerogenerador","gfci-breaker.name":"Interruptor GFCI (RCBO)","rcd.name":"Dispositivo de corriente residual (RCD)","recloser.name":"Reconectador","energy-meter.name":"Medidor de energía (Wh)","voltmeter.name":"Voltímetro (V)","ammeter.name":"Amperímetro (A)","wattmeter.name":"Vatímetro (W)","frequency-meter.name":"Frecuencímetro (Hz)","contactor.name":"Contactor (KM)","motor-starter.name":"Arrancador de motor","thermal-overload.name":"Relé de sobrecarga térmica","vfd.name":"Variador de frecuencia (VFD)","soft-starter.name":"Arrancador suave","transfer-switch.name":"Conmutador de transferencia (ATS)","dc-disconnector.name":"Seccionador de CC","dc-combiner.name":"Caja combinadora de CC","ev-charger.name":"Cargador de VE","arc-suppression-coil.desc":"Puesta a tierra resonante del neutro: inductor a tierra","busbar.desc":"Tramo de barra única extensible con múltiples derivaciones","converter-bidir.desc":"Convertidor de almacenamiento: CA ↔ CC bidireccional","dc-dc-converter.desc":"Convertidor CC/CC / cargador CC (IEC 60617)","mppt.desc":"Controlador de carga solar MPPT (CC/CC, seguimiento del punto de máxima potencia)","earthing-switch.desc":"Seccionador + conexión a tierra, un solo puerto","grid-source.desc":"Barra infinita / red externa","grounding-transformer.desc":"Transformador estrella-zigzag para puesta a tierra del neutro","load.desc":"Carga abstracta (flecha de salida de corriente)","luminaire.desc":"Carga de alumbrado (símbolo general de luminaria IEC 60617)","ngr.desc":"Puesta a tierra de baja resistencia: neutro del transformador a tierra","series-reactor.desc":"Mismo símbolo que el reactor en derivación; se distingue por el uso","wind-turbine.desc":"Turbina eólica: generador + marca de rotor de tres palas","gfci-breaker.desc":"Interruptor de corriente residual con protección de sobrecorriente (UL943 / IEC 61009). GFCI en Norteamérica / RCBO en Europa.","rcd.desc":"Interruptor de corriente residual sin protección de sobrecorriente (IEC 61008).","recloser.desc":"Reconectador automático de media tensión.","energy-meter.desc":"Medidor de energía activa (kWh) — acometida / submedición.","contactor.desc":"Contactor de circuito principal; se usa normalmente con un relé de sobrecarga térmica y un motor.","motor-starter.desc":"Arrancador de motor (símbolo general IEC 60617).","thermal-overload.desc":"Relé de sobrecarga térmica del motor; se ubica entre el contactor y el motor.","vfd.desc":"Variador de frecuencia para el control de velocidad de motores de inducción.","soft-starter.desc":"Arrancador suave de motor (arranque a tensión reducida basado en tiristores).","transfer-switch.desc":"Conmutador de transferencia de dos fuentes (ATS / manual). Dos entradas de fuente + una salida de carga, con enclavamiento mecánico.","dc-disconnector.desc":"Seccionador de CC — aislamiento del lado de CC de cadenas fotovoltaicas / baterías.","dc-combiner.desc":"Caja combinadora de cadenas fotovoltaicas (ejemplo de 4 entradas).","ev-charger.desc":"Estación de carga para vehículos eléctricos.","breaker.state.open":"Abierto","disconnector.state.open":"Abierto","earthing-switch.state.open":"Abierto","fuse.state.blown":"Fundido","load-switch.state.open":"Abierto","gfci-breaker.state.open":"Abierto","rcd.state.open":"Abierto","recloser.state.open":"Abierto","contactor.state.open":"Abierto","thermal-overload.state.tripped":"Disparado","transfer-switch.state.position":"Posición (normal/emergencia/apagado)","dc-disconnector.state.open":"Abierto","battery.param.E":"Capacidad","busbar.param.Un":"Tensión nominal","converter-bidir.param.S":"Capacidad","dc-dc-converter.param.P":"Potencia","mppt.param.I":"Corriente nominal","load.param.P":"Potencia activa","load.param.cosphi":"Factor de potencia","ngr.param.R":"Resistencia","shunt-capacitor.param.Q":"Potencia reactiva","shunt-capacitor.param.stages":"Etapas","transformer-2w.param.S":"Capacidad","transformer-2w.param.ratio":"Relación de transformación","gfci-breaker.param.In":"Corriente nominal","panelboard.param.In":"Corriente nominal","gfci-breaker.param.IDn":"Corriente diferencial de actuación","rcd.param.IDn":"Corriente diferencial de actuación","breaker.param.In":"Corriente nominal","breaker.param.poles":"Polos","breaker.param.Icu":"Poder de corte","disconnector.param.In":"Corriente nominal","fuse.param.In":"Corriente nominal","resistor.name":"Resistor (R)","capacitor.name":"Condensador (C)","diode.name":"Diodo (D)","indicator-light.name":"Luz indicadora (HL)","push-button.name":"Pulsador (SB)","relay-coil.name":"Bobina de relé (KA)","make-contact.name":"Contacto normalmente abierto (NO)","break-contact.name":"Contacto normalmente cerrado (NC)","bell.name":"Timbre (HA)","terminal.name":"Terminal / empalme (X)","fuse-switch-disconnector.name":"Seccionador-fusible","socket-outlet.name":"Toma de corriente / conector","inductor.name":"Inductor (L)","voltage-regulator.name":"Regulador de tensión (T)","dc-motor.name":"Motor de CC (M)","heater.name":"Elemento calefactor (EH)","selector-switch.name":"Conmutador selector (SA)","limit-switch.name":"Interruptor de límite (SQ)","proximity-switch.name":"Interruptor de proximidad (SQ)","time-relay.name":"Relé de tiempo (KT)","buzzer.name":"Zumbador (HA)","siren.name":"Sirena (HA)","thermocouple.name":"Termopar (BT)","thyristor.name":"Tiristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diodo Zener (D)","igbt.name":"IGBT","plc.name":"PLC / controlador","ups.name":"SAI (UPS)","power-supply.name":"Fuente de alimentación (PS)","genset.name":"Grupo electrógeno (G)","protective-relay.name":"Relé de protección","overcurrent-relay.name":"Relé de sobrecorriente (50/51)","undervoltage-relay.name":"Relé de baja tensión (27)","reverse-power-relay.name":"Relé de potencia inversa (32)","distance-relay.name":"Relé de distancia (21)","phase-failure-relay.name":"Relé de falla de fase","buchholz-relay.name":"Relé Buchholz (63)","power-factor-meter.name":"Medidor de factor de potencia (cosφ)","synchronoscope.name":"Sincronoscopio","varmeter.name":"Varímetro (var)","resistor.desc":"Resistor general / limitador de corriente / resistor de frenado.","capacitor.desc":"Condensador general / de filtro / del bus de CC. Usa el condensador en derivación para corrección del factor de potencia.","diode.desc":"Diodo rectificador / de rueda libre / de protección. t1 = ánodo (arriba), t2 = cátodo (abajo).","indicator-light.desc":"Luz indicadora de señal / estado.","push-button.desc":"Pulsador manual con retorno automático (contacto NA).","relay-coil.desc":"Bobina de accionamiento de relé / contactor (caja).","make-contact.desc":"Contacto auxiliar normalmente abierto (NA).","break-contact.desc":"Contacto auxiliar normalmente cerrado (NC).","bell.desc":"Timbre de señal / alarma.","terminal.desc":"Terminal / caja de empalme / nodo de conexión.","fuse-switch-disconnector.desc":"Seccionador-fusible bajo carga.","socket-outlet.desc":"Toma de corriente / conector multipolar.","inductor.desc":"Inductor general / bobina / choque.","voltage-regulator.desc":"Regulador de tensión de inducción / autotransformador ajustable.","dc-motor.desc":"Motor de CC (símbolo general de excitación serie).","heater.desc":"Elemento calefactor resistivo / carga de calefacción.","selector-switch.desc":"Conmutador selector / de cambio (rotativo, de posición fija).","limit-switch.desc":"Interruptor de carrera / posición (NA, accionamiento mecánico).","proximity-switch.desc":"Sensor de proximidad / interruptor de proximidad sin contacto.","time-relay.desc":"Bobina de relé de temporización (acción retardada).","buzzer.desc":"Zumbador de señal.","siren.desc":"Sirena / alarma sonora.","thermocouple.desc":"Sensor de temperatura de termopar.","thyristor.desc":"Tiristor triodo de bloqueo inverso / SCR. t1 = ánodo (arriba), t2 = cátodo (abajo).","triac.desc":"Tiristor triodo bidireccional (TRIAC).","zener-diode.desc":"Diodo Zener / regulador de tensión. t1 = ánodo (arriba), t2 = cátodo (abajo).","igbt.desc":"IGBT de canal N en modo de enriquecimiento. t1 = colector (arriba), t2 = emisor (abajo), t_g = puerta.","plc.desc":"Controlador lógico programable (PLC).","ups.desc":"Sistema de alimentación ininterrumpida en línea / en espera (UPS).","power-supply.desc":"Fuente de alimentación conmutada CA→CC / fuente de CC. t_ac arriba (~), t_dc abajo (=).","genset.desc":"Grupo electrógeno diésel / a gas.","protective-relay.desc":"Relé de medida / protección, símbolo general (IEC 60617).","overcurrent-relay.desc":"Relé de protección de sobrecorriente (ANSI 50/51).","undervoltage-relay.desc":"Relé de protección de baja tensión (ANSI 27).","reverse-power-relay.desc":"Relé de protección de potencia inversa / corriente inversa (ANSI 32).","distance-relay.desc":"Relé de protección de distancia / baja impedancia (ANSI 21).","phase-failure-relay.desc":"Relé de protección de falla de fase / pérdida de fase.","buchholz-relay.desc":"Relé Buchholz / de gas (ANSI 63).","power-factor-meter.desc":"Medidor de factor de potencia (cosφ).","synchronoscope.desc":"Indicador de sincronización / sincronoscopio.","varmeter.desc":"Medidor de potencia reactiva (var).","make-contact.state.closed":"Cerrado","break-contact.state.open":"Abierto","on-delay-make-contact.name":"Contacto NO temporizado a la conexión (KT)","off-delay-make-contact.name":"Contacto NO temporizado a la desconexión (KT)","on-delay-break-contact.name":"Contacto NC temporizado a la conexión (KT)","off-delay-break-contact.name":"Contacto NC temporizado a la desconexión (KT)","continuation-out.name":"Continuación (salida)","continuation-in.name":"Continuación (llegada)","on-delay-make-contact.desc":"Contacto de temporizador normalmente abierto: se cierra con retardo al energizar la bobina (IEC 60617-07-05-01).","off-delay-make-contact.desc":"Contacto de temporizador normalmente abierto: se abre con retardo al desenergizar la bobina (IEC 60617-07-05-02).","on-delay-break-contact.desc":"Contacto de temporizador normalmente cerrado: se abre con retardo al energizar la bobina (IEC 60617-07-05-03).","off-delay-break-contact.desc":"Contacto de temporizador normalmente cerrado: se cierra con retardo al desenergizar la bobina (IEC 60617-07-05-04).","continuation-out.desc":"Referencia a otra hoja: el cable se interrumpe aquí y continúa en otro lugar. Las continuaciones con el mismo nombre son el mismo cable.","continuation-in.desc":"Referencia a otra hoja: un cable que viene de otro lugar continúa aquí. Las continuaciones con el mismo nombre son el mismo cable.","on-delay-make-contact.state.closed":"Cerrado","on-delay-make-contact.param.delay":"Retardo","off-delay-make-contact.state.closed":"Cerrado","off-delay-make-contact.param.delay":"Retardo","on-delay-break-contact.state.open":"Abierto","on-delay-break-contact.param.delay":"Retardo","off-delay-break-contact.state.open":"Abierto","off-delay-break-contact.param.delay":"Retardo","continuation-out.param.target":"Continúa en","continuation-in.param.target":"Viene de","async-motor.param.P":"Potencia","sync-motor.param.P":"Potencia","dc-motor.param.P":"Potencia","ev-charger.param.P":"Potencia","socket-outlet.param.P":"Potencia","luminaire.param.P":"Potencia","fuse-switch-disconnector.state.open":"Abierto","selector-switch.state.open":"Abierto","limit-switch.state.closed":"Cerrado","resistor.param.R":"Resistencia","resistor.param.P":"Potencia nominal","capacitor.param.C":"Capacitancia","capacitor.param.Un":"Tensión nominal","indicator-light.param.color":"Color","inductor.param.L":"Inductancia","inductor.param.In":"Corriente nominal","voltage-regulator.param.ratio":"Rango de regulación","heater.param.P":"Potencia","ups.param.S":"Capacidad","power-supply.param.Vdc":"Tensión de salida","genset.param.P":"Potencia"},Gj={ui:qj,library:Vj},Kj={"common.unnamed":"Sans titre","common.close":"Fermer","common.yes":"Oui","common.no":"Non","topbar.theme.toLight":"Passer au thème clair","topbar.theme.toDark":"Passer au thème sombre","topbar.theme.currentDark":"Actuel : thème sombre","topbar.theme.currentLight":"Actuel : thème clair","topbar.lang.toEnglish":"Passer à l'anglais","topbar.lang.toChinese":"Passer au chinois","topbar.lang.currentEnglish":"Actuel : anglais","topbar.lang.currentChinese":"Actuel : chinois","topbar.export.label":"Exporter","topbar.export.tooltip":"SVG vectoriel (modifiable), PNG bitmap (2× HiDPI) ou DXF (CAO)","topbar.export.pngFailed":"Échec de l'export PNG : {err}","topbar.export.dxfFailed":"Échec de l'export DXF : {err}","topbar.file.label":"Fichier","topbar.file.tooltip":"Ouvrir un schéma .json local, enregistrer, ou enregistrer sous","topbar.file.current":"Actuel : {name}","topbar.file.new":"Nouveau","topbar.file.open":"Ouvrir…","topbar.file.save":"Enregistrer","topbar.file.saveAs":"Enregistrer sous…","topbar.file.newConfirm":"Créer un nouveau schéma effacera les modifications non enregistrées. Continuer ?","topbar.file.openFailed":"Échec de l'ouverture : {err}","topbar.file.saveFailed":"Échec de l'enregistrement : {err}","topbar.file.fileDescription":"Schéma OneLineEditor","outline.title":"Plan","outline.collapse":"Réduire","outline.collapseAria":"Réduire le plan","outline.empty":"(Aucun élément — glissez depuis la bibliothèque pour commencer)","props.title":"Propriétés","props.node":"Nœud électrique","props.wire":"Fil","props.bus":"Jeu de barres","props.junction":"Jonction","props.junctionPos":"Position","props.nSelected":"{n} sélectionné(s)","props.empty":"Aucune sélection","props.multi":"{n} objets sélectionnés","props.name":"Nom","props.note":"Note","props.label":"Repère","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nœud électrique {id} introuvable","props.wireNotFound":"Fil {id} introuvable","props.nodeStats":"{terminals} bornes · {elements} éléments","props.selectElement":"Sélectionner {label}","props.selectWholeNode":"Sélectionner tout le nœud électrique","props.annText":"Texte","props.annRect":"Rectangle","props.annEllipse":"Ellipse","props.annLine":"Ligne","props.annTable":"Tableau","props.annNotFound":"Annotation {id} introuvable","props.annLabel":"Étiquette","props.annLabelPlaceholder":"ex. : Tableau n°1","props.color":"Couleur","props.size":"Taille","props.sizeReset":"Revenir à 100 %","props.labelShown":"Visible","props.labelHidden":"Masqué","props.contactType":"Contact","props.direction":"Sens","props.directionOut":"Départ","props.directionIn":"Arrivée","props.partner":"Correspondant","props.partnerUnnamed":"Nommez-le pour l’associer au renvoi du même nom","props.partnerNone":"Aucun correspondant sur ce schéma","props.partnerJump":"Aller à {id}","health.title":"Contrôle","health.hint":"Contrôle des raccordements et de l'alimentation : indications et estimations, pas une vérification de conformité","health.markers":"Afficher sur le schéma","health.none":"Aucun problème trouvé","health.sectionProblems":"Problèmes","health.sectionNotes":"Remarques","health.sectionDismissed":"Marqué comme voulu","health.sectionLoads":"Totaux de charge","health.dismiss":"C'est voulu","health.restore":"Rétablir","health.loadKnown":"{kw} kW connus ({k}/{t} charges)","health.loadAll":"{kw} kW ({t} charges)","health.label.unwired":"Non raccordé","health.label.looks-joined":"Paraît raccordé, ne l'est pas","health.label.dangling-wire":"Extrémité de fil libre","health.label.supply-disconnected":"Source non raccordée","health.label.unsupplied":"Aucun chemin vers une source","health.label.no-origin":"Aucun symbole de source","health.label.voltage-mix":"Tensions reliées","health.label.ratio-mismatch":"Rapport incohérent","health.label.label-mismatch":"Nom et paramètre","health.label.overload":"Au-delà de la puissance assignée","health.label.feeder-end":"Le départ s'arrête ici","health.label.open-side":"Côté alimentation libre","health.introTitle":"Contrôle du schéma","health.intro":"{n} problème(s) possible(s) trouvé(s) dans les raccordements de ce schéma. Les points montrent où. Ce sont des indications tirées du câblage, pas un contrôle de conformité.","health.introShow":"Voir","health.introOk":"Compris","health.loading":"{pct} % de {rating} kVA","health.disclaimer":"Indications et estimations tirées des raccordements du schéma, pas une vérification de conformité aux normes.","health.overloadUnits":"Plus de 10 fois la puissance nominale : vérifiez les unités des charges (le P d'une charge générique est en MW).","health.code.unwired":"{name} n'est pas raccordé. Toucher une ligne n'est pas un raccordement : tracez un fil jusqu'à sa borne.","health.code.looks-joined":"Un fil s'arrête ici sur un autre point de raccordement sans y être relié : il paraît raccordé, mais ne l'est pas.","health.code.dangling-wire":"Un fil s'arrête ici sans être raccordé à rien.","health.code.supply-disconnected":"{name} n'est pas relié au reste du schéma : {count} appareils sur {total} n'ont aucun chemin vers une source.","health.code.unsupplied":"{count} appareil(s) ici n'ont aucun chemin vers une source.","health.code.no-origin":"Ce schéma n'a pas de symbole de source. Ajoutez un réseau ou un générateur pour contrôler l'alimentation et voir les totaux de charge.","health.code.voltage-mix":"Ici, {a} kV et {b} kV sont reliés sans transformateur.","health.code.ratio-mismatch":"{name} : le rapport {ratio} ne correspond pas aux jeux de barres de part et d'autre ({a} kV / {b} kV).","health.code.label-mismatch":"{name} : le nom et le paramètre {param} ({value}) ne concordent pas.","health.code.overload":"{name} : la charge connue de {load} kVA dépasse la puissance nominale de {rating} kVA (toutes les charges à pleine puissance, sans foisonnement).","health.code.feeder-end":"{name} : le départ s'arrête ici.","health.code.open-side":"{name} : le côté alimentation n'est pas raccordé (souvent l'arrivée du schéma).","props.color.default":"Par défaut","props.color.red":"Rouge","props.color.amber":"Ambre","props.color.green":"Vert","props.color.blue":"Bleu","props.color.gray":"Gris","props.annStroke":"Trait","props.annStrokeSolid":"Continu","props.annStrokeDashed":"Pointillé","props.annStrokeDotted":"Pointillé fin","props.annStrokeWidth":"Épaisseur","props.annWidthThin":"Fin","props.annWidthMedium":"Moyen","props.annWidthThick":"Épais","props.annFill":"Remplissage","props.annFillNone":"Aucun","props.annFillTint":"Teinte","props.annArrow":"Flèches","props.annArrowNone":"Aucune","props.annArrowEnd":"Extrémité","props.annArrowBoth":"Les deux","props.annFontSize":"Taille de police","props.annRows":"Lignes","props.annCols":"Colonnes","view.zoomOut":"Zoom arrière","view.zoomOutHint":"Zoom arrière par palier ; aussi molette ↓ ou ⌘−","view.reset":"Réinitialiser à 100 %","view.current":"Actuel {z} %","view.zoomIn":"Zoom avant","view.zoomInHint":"Zoom avant par palier ; aussi molette ↑ ou ⌘+","view.fit":"Ajuster la vue","view.fitHint":"Zoom automatique et centrage sur tout le schéma","view.gridHide":"Masquer la grille","view.gridShow":"Afficher la grille","view.gridHotkey":"G","view.gridHideHint":"Désactive aussi l'aimantation à la grille (placement libre)","view.gridShowHint":"Active aussi l'aimantation à la grille (alignement sur 10 px au glisser)","view.gridHideAria":"Masquer la grille et désactiver l'aimantation","view.gridShowAria":"Afficher la grille et activer l'aimantation","view.label":"Étiquettes","view.labelOff":"Aucune","view.labelId":"ID","view.labelAll":"ID + paramètres","view.labelHint":"Visibilité et taille des étiquettes (export compris)","view.labelSize":"Taille","view.labelSizeSmaller":"Réduire la taille des étiquettes","view.labelSizeLarger":"Agrandir la taille des étiquettes","view.standard":"Norme des symboles","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Ne change que le tracé des symboles — câblage, positions et calibres restent intacts. Le disjoncteur et le fusible diffèrent entre les deux.","view.labelSizeReset":"Réinitialiser la taille des étiquettes","library.title":"Bibliothèque","tool.draw":"Dessiner","tool.drawHint":"Texte, cadres, cercles, lignes et tableaux — annotation libre sur le schéma","library.empty":"Aucun élément correspondant","cat.custom":"Dans ce schéma","library.customTag":"perso","library.customHint":"Défini par ce schéma — absent de toute autre bibliothèque","library.createComponent":"Nouveau composant…","library.searchPlaceholder":"Rechercher des éléments…","library.searchAria":"Rechercher des éléments","library.clearSearch":"Effacer la recherche","library.itemHint":"Cliquez pour passer en mode placement, ou glissez sur le plan de travail","tool.select":"Sélection","tool.selectHint":"Cliquez pour choisir, tracez un cadre pour une sélection multiple, clic droit pour le menu","tool.pan":"Déplacement","tool.panHint":"Faites glisser le plan de travail ; Espace bascule temporairement","tool.wire":"Fil","tool.wireHint":"Glissez depuis une borne/un jeu de barres/une jonction ; vers un espace vide crée une jonction, sur un fil crée un piquage","tool.bus":"Jeu de barres","tool.busHint":"Glissez sur le plan de travail — appuyez pour définir le début, relâchez pour définir la fin","tool.junction":"Jonction","tool.junctionHint":"Cliquez sur le plan de travail pour placer une jonction (nœud) ; les fils s'y raccordent librement","tool.place":"Placer","tool.placeHint":"Cliquez pour placer ; ou glissez depuis une borne/un jeu de barres pour placer et connecter","tool.text":"Texte","tool.textHint":"Cliquez sur le plan de travail pour placer une note texte ; double-cliquez sur une note existante pour la modifier","tool.rect":"Rectangle","tool.rectHint":"Glissez pour dessiner un rectangle / cadre de groupe (pointillé par défaut) ; Maj pour un carré","tool.ellipse":"Ellipse","tool.ellipseHint":"Glissez pour dessiner une ellipse ; Maj pour un cercle","tool.line":"Ligne","tool.lineHint":"Glissez pour dessiner une ligne d'annotation ; Maj aligne à 45° ; les flèches se règlent dans le panneau","tool.table":"Tableau","tool.tableHint":"Glissez pour définir colonnes × lignes (comptage en direct), ou cliquez pour un tableau par défaut ; double-cliquez sur les cellules pour saisir du texte","mode.selectWithSel":"Glissez les éléments · glissez les bornes pour câbler · clic droit pour le menu","mode.selectEmpty":"Cliquez pour choisir · glissez pour déplacer · tracez un cadre pour une sélection multiple · clic droit pour le menu","mode.pan":"Glissez le plan de travail · molette pour zoomer · maintenez Espace pour déplacer avec n'importe quel outil","mode.wireDragging":"Relâchez sur une borne/un jeu de barres/une jonction ; relâcher dans un espace vide crée une jonction","mode.wireInit":"Appuyez sur un point de connexion ou un espace vide, glissez vers une cible et relâchez","mode.busDragging":"Le glissement définit la direction du jeu de barres ; le relâchement définit la fin","mode.busInit":"Appuyez sur le plan de travail pour définir le début, glissez, relâchez pour définir la fin","mode.junction":"Cliquez sur le plan de travail pour placer une jonction","mode.placeNoKind":"Choisissez un type d'élément dans la bibliothèque à gauche","mode.placeFromTerm":"Relâchez sur la cible — le nouvel élément se connectera à la borne source","mode.placeNormal":"Cliquez sur un espace vide pour placer ; ou glissez depuis une borne / un jeu de barres pour placer et connecter","mode.text":"Cliquez pour placer du texte · double-cliquez pour modifier · glissez la sélection pour déplacer · Suppr pour retirer","mode.rect":"Glissez pour dessiner un rectangle · Maj pour un carré · redimensionnez et nommez-le après relâchement","mode.ellipse":"Glissez pour dessiner une ellipse · Maj pour un cercle · redimensionnez, recolorez et nommez après relâchement","mode.line":"Glissez pour dessiner une ligne · Maj aligne à 45° · ajoutez des flèches dans le panneau après relâchement","mode.table":"Glissez pour définir la grille, ou cliquez pour un tableau 3×3 · double-cliquez sur les cellules pour saisir du texte","mode.annTextSel":"Cliquez sur le texte pour modifier · glissez pour déplacer · Suppr pour retirer","mode.annTableSel":"Cliquez sur une cellule pour la remplir · glissez pour déplacer · Suppr pour retirer","mode.annShapeSel":"Glissez pour déplacer · glissez les poignées pour redimensionner · modifiez le style dans le panneau · Suppr pour retirer","mode.annEditing":"Saisissez · Entrée pour valider · Échap pour annuler · ou les boutons ✓ / ✕","mode.escSelect":"Échap efface la sélection","mode.escOther":"Clic droit / Échap pour annuler","tool.placeNoKindTooltip":"Choisissez un type dans la bibliothèque à gauche, puis cliquez sur le plan de travail","tool.undo":"Annuler","tool.undoHint":"Annule la dernière modification (déplacement / rotation / suppression, etc.)","tool.redo":"Rétablir","tool.redoHint":"Rétablit la dernière modification annulée","layout.label":"Disposition","layout.hint":"Disposition automatique de tout le schéma ou de la sélection, comble les espaces vides","layout.allAuto":"Tout disposer automatiquement","layout.selAuto":"Disposer la sélection automatiquement","layout.allFill":"Combler les éléments non placés","layout.selFill":"Combler les éléments non placés de la sélection","tool.more":"Plus","tool.moreHint":"Annuler / rétablir / disposition","view.menu":"Affichage","view.menuHint":"Zoom, ajustement, grille","ctx.ariaNode":"Actions sur le nœud","ctx.ariaWire":"Actions sur le fil","ctx.ariaElement":"Actions sur l'élément","ctx.ariaEdit":"Actions d'édition","ctx.done":"Terminé","ctx.cancel":"Annuler","ctx.rotate":"Pivoter de 90°","ctx.rotateHint":"Fait pivoter la sélection dans le sens horaire ; les fils se réacheminent vers les nouvelles bornes","ctx.mirror":"Miroir horizontal","ctx.mirrorTitle":"Miroir","ctx.mirrorHint":"Retourne la sélection horizontalement","ctx.delete":"Supprimer","ctx.color":"Couleur","ctx.colorDefault":"Par défaut","ctx.colorRed":"Rouge","ctx.colorAmber":"Ambre","ctx.colorGreen":"Vert","ctx.colorBlue":"Bleu","ctx.colorGray":"Gris","ctx.deleteHintNode":"Déconnecte tous les fils de ce nœud (les éléments restent)","ctx.deleteHintWire":"Retire uniquement ce fil (les autres fils du même nœud restent)","ctx.deleteHintElement":"Retire la sélection et ses fils","ctx.resetWirePath":"Revenir au routage automatique","ctx.resetWirePathHint":"Supprime les coudes manuels et laisse le routeur retracer ce fil","menu.undo":"Annuler","menu.redo":"Rétablir","menu.cut":"Couper","menu.copy":"Copier","menu.paste":"Coller","menu.rotate":"Pivoter de 90°","menu.mirror":"Miroir","menu.resetLabel":"Réinitialiser la position du libellé","menu.selectAll":"Tout sélectionner","menu.disconnect":"Déconnecter ce fil","menu.delete":"Supprimer","io.parseFailed":"Échec de l'analyse JSON : {err}","io.notObject":"Le fichier n'est pas un objet JSON","io.versionMismatch":"Version incompatible : attendu « 1 », obtenu {actual}","io.elementsMissing":"`elements` est manquant ou n'est pas un tableau","compile.duplicateId":"Identifiant d'élément dupliqué : « {id} »","compile.unknownKind":"Type d'élément inconnu kind=« {kind} »","compile.invalidTermRef":"Référence de borne invalide « {ref} »","compile.elementMissing":"Référence à un élément inconnu « {id} »","compile.missingPin":"L'élément « {id} » (kind={kind}) n'a pas de broche « {pin} » ; disponibles : {available}","compile.singleTerminal":"Le nœud n'a qu'une seule borne — ignoré","compile.layoutMissingElement":"la clé de disposition « {id} » référence un élément inconnu","compile.elementUnconnected":"L'élément « {id} » n'a aucune connexion","cat.busbar":"Jeux de barres / câblage","cat.switching":"Appareillage de coupure","cat.protection":"Protection","cat.motor-control":"Commande de moteur","cat.transformer":"Transformateur","cat.instrument-transformer":"Transformateur de mesure","cat.measurement":"Mesure","cat.source":"Source","cat.load":"Charge","cat.storage":"Stockage","cat.compensation":"Compensation","cat.grounding":"Mise à la terre","cat.renewable":"Énergies renouvelables / électronique de puissance","onboard.title":"Démarrage rapide","onboard.step1.title":"Placer un composant","onboard.step1.body":"Choisissez l'outil Placer (P) et glissez un type depuis la bibliothèque sur le plan de travail","onboard.step2.title":"Câblez-le","onboard.step2.body":"Utilisez l'outil Fil (W) : glissez d'une broche à une autre — glissez vers un espace vide pour créer une jonction","onboard.step3.title":"Un jeu de barres est un rail commun, pas un fil","onboard.step3.body":"Utilisez l'outil Jeu de barres (B) uniquement lorsque plusieurs circuits partagent un même rail. N'utilisez pas un jeu de barres pour relier deux appareils — câblez simplement les broches (W).","onboard.dismiss":"Compris"},Uj={"arc-suppression-coil.name":"Bobine d'extinction d'arc","arrester.name":"Parafoudre (FBL)","async-motor.name":"Moteur asynchrone","autotransformer.name":"Autotransformateur","battery.name":"Stockage par batterie","breaker.name":"Disjoncteur (QF)","busbar.name":"Segment de jeu de barres","converter-bidir.name":"Convertisseur bidirectionnel (PCS)","dc-dc-converter.name":"Convertisseur DC/DC","mppt.name":"Régulateur MPPT","ct.name":"Transformateur de courant (CT)","disconnector.name":"Sectionneur (QS)","earth.name":"Terre","earthing-switch.name":"Sectionneur de terre (QE)","fuse.name":"Fusible (FU)","generator.name":"Générateur (G)","grid-source.name":"Source réseau","grounding-transformer.name":"Transformateur de mise à la terre (zigzag)","inverter.name":"Onduleur (DC→AC)","load-switch.name":"Interrupteur de charge","load.name":"Charge","luminaire.name":"Luminaire (charge d'éclairage)","panelboard.name":"Tableau de répartition","ngr.name":"Résistance de mise à la terre du neutre (NGR)","pt.name":"Transformateur de tension (PT)","pv.name":"Module photovoltaïque","rectifier.name":"Redresseur (AC→DC)","series-reactor.name":"Réactance série","shunt-capacitor.name":"Condensateur shunt","shunt-reactor.name":"Réactance shunt","sync-motor.name":"Moteur synchrone","transformer-2w.name":"Transformateur à deux enroulements","transformer-3w.name":"Transformateur à trois enroulements","wind-turbine.name":"Éolienne","gfci-breaker.name":"Disjoncteur différentiel (RCBO)","rcd.name":"Dispositif différentiel résiduel (RCD)","recloser.name":"Réenclencheur","energy-meter.name":"Compteur d'énergie (Wh)","voltmeter.name":"Voltmètre (V)","ammeter.name":"Ampèremètre (A)","wattmeter.name":"Wattmètre (W)","frequency-meter.name":"Fréquencemètre (Hz)","contactor.name":"Contacteur (KM)","motor-starter.name":"Démarreur de moteur","thermal-overload.name":"Relais thermique de surcharge","vfd.name":"Variateur de fréquence (VFD)","soft-starter.name":"Démarreur progressif","transfer-switch.name":"Commutateur de transfert (ATS)","dc-disconnector.name":"Sectionneur DC","dc-combiner.name":"Boîtier de raccordement DC","ev-charger.name":"Borne de recharge VE","arc-suppression-coil.desc":"Mise à la terre résonante du neutre : bobine reliée à la terre","busbar.desc":"Segment de jeu de barres simple extensible avec piquages multiples","converter-bidir.desc":"Convertisseur de stockage : bidirectionnel AC ↔ DC","dc-dc-converter.desc":"Convertisseur DC/DC / chargeur DC (IEC 60617)","mppt.desc":"Régulateur de charge solaire MPPT (DC/DC, recherche du point de puissance maximale)","earthing-switch.desc":"Sectionneur + liaison à la terre, à un seul accès","grid-source.desc":"Jeu de barres infini / réseau externe","grounding-transformer.desc":"Transformateur étoile-zigzag pour mise à la terre du neutre","load.desc":"Charge abstraite (flèche de sortie de courant)","luminaire.desc":"Charge d'éclairage (symbole général de luminaire CEI 60617)","ngr.desc":"Mise à la terre à faible résistance : neutre du transformateur relié à la terre","series-reactor.desc":"Même symbole que la réactance shunt ; distingué par l'usage","wind-turbine.desc":"Éolienne : génératrice + repère de rotor tripale","gfci-breaker.desc":"Disjoncteur différentiel avec protection contre les surintensités (UL943 / IEC 61009). GFCI en Amérique du Nord / RCBO en Europe.","rcd.desc":"Disjoncteur différentiel sans protection contre les surintensités (IEC 61008).","recloser.desc":"Réenclencheur automatique moyenne tension.","energy-meter.desc":"Compteur d'énergie active (kWh) — entrée de service / sous-comptage.","contactor.desc":"Contacteur de circuit principal ; généralement utilisé avec un relais thermique et un moteur.","motor-starter.desc":"Démarreur de moteur (symbole général IEC 60617).","thermal-overload.desc":"Relais thermique de surcharge moteur ; placé entre le contacteur et le moteur.","vfd.desc":"Variateur de fréquence pour le contrôle de vitesse des moteurs asynchrones.","soft-starter.desc":"Démarreur progressif de moteur (démarrage à tension réduite à base de thyristors).","transfer-switch.desc":"Commutateur de transfert à deux sources (ATS / manuel). Deux entrées source + une sortie charge, verrouillées mécaniquement.","dc-disconnector.desc":"Sectionneur DC — isolement côté DC d'une chaîne photovoltaïque / batterie.","dc-combiner.desc":"Boîtier de raccordement de chaînes photovoltaïques (exemple à 4 entrées).","ev-charger.desc":"Borne de recharge pour véhicule électrique.","breaker.state.open":"Ouvert","disconnector.state.open":"Ouvert","earthing-switch.state.open":"Ouvert","fuse.state.blown":"Fondu","load-switch.state.open":"Ouvert","gfci-breaker.state.open":"Ouvert","rcd.state.open":"Ouvert","recloser.state.open":"Ouvert","contactor.state.open":"Ouvert","thermal-overload.state.tripped":"Déclenché","transfer-switch.state.position":"Position (normal/secours/arrêt)","dc-disconnector.state.open":"Ouvert","battery.param.E":"Capacité","busbar.param.Un":"Tension nominale","converter-bidir.param.S":"Puissance apparente","dc-dc-converter.param.P":"Puissance","mppt.param.I":"Courant nominal","load.param.P":"Puissance active","load.param.cosphi":"Facteur de puissance","ngr.param.R":"Résistance","shunt-capacitor.param.Q":"Puissance réactive","shunt-capacitor.param.stages":"Gradins","transformer-2w.param.S":"Puissance apparente","transformer-2w.param.ratio":"Rapport de transformation","gfci-breaker.param.In":"Courant nominal","panelboard.param.In":"Courant nominal","gfci-breaker.param.IDn":"Courant différentiel résiduel nominal","rcd.param.IDn":"Courant différentiel résiduel nominal","breaker.param.In":"Courant nominal","breaker.param.poles":"Pôles","breaker.param.Icu":"Pouvoir de coupure","disconnector.param.In":"Courant nominal","fuse.param.In":"Courant nominal","resistor.name":"Résistance (R)","capacitor.name":"Condensateur (C)","diode.name":"Diode (D)","indicator-light.name":"Voyant lumineux (HL)","push-button.name":"Bouton-poussoir (SB)","relay-coil.name":"Bobine de relais (KA)","make-contact.name":"Contact à fermeture (NO)","break-contact.name":"Contact à ouverture (NC)","bell.name":"Sonnerie (HA)","terminal.name":"Borne / jonction (X)","fuse-switch-disconnector.name":"Interrupteur-sectionneur à fusibles","socket-outlet.name":"Prise de courant / connecteur","inductor.name":"Bobine d'inductance (L)","voltage-regulator.name":"Régulateur de tension (T)","dc-motor.name":"Moteur à courant continu (M)","heater.name":"Élément chauffant (EH)","selector-switch.name":"Commutateur sélecteur (SA)","limit-switch.name":"Interrupteur de fin de course (SQ)","proximity-switch.name":"Détecteur de proximité (SQ)","time-relay.name":"Relais temporisé (KT)","buzzer.name":"Avertisseur sonore (HA)","siren.name":"Sirène (HA)","thermocouple.name":"Thermocouple (BT)","thyristor.name":"Thyristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diode Zener (D)","igbt.name":"IGBT","plc.name":"Automate programmable (API) / contrôleur","ups.name":"ASI","power-supply.name":"Alimentation (PS)","genset.name":"Groupe électrogène (G)","protective-relay.name":"Relais de protection","overcurrent-relay.name":"Relais de surintensité (50/51)","undervoltage-relay.name":"Relais de sous-tension (27)","reverse-power-relay.name":"Relais de retour de puissance (32)","distance-relay.name":"Relais de distance (21)","phase-failure-relay.name":"Relais de manque de phase","buchholz-relay.name":"Relais Buchholz (63)","power-factor-meter.name":"Cosphimètre (cosφ)","synchronoscope.name":"Synchronoscope","varmeter.name":"Varmètre (var)","resistor.desc":"Résistance générale / de limitation de courant / de freinage.","capacitor.desc":"Condensateur général / de filtrage / de bus DC. Utilisez le condensateur shunt pour la compensation du facteur de puissance.","diode.desc":"Diode de redressement / roue libre / protection. t1 = anode (haut), t2 = cathode (bas).","indicator-light.desc":"Voyant lumineux de signalisation / d'état.","push-button.desc":"Bouton-poussoir manuel à rappel automatique (contact à fermeture NO).","relay-coil.desc":"Bobine de commande de relais / contacteur (rectangle).","make-contact.desc":"Contact auxiliaire normalement ouvert (à fermeture).","break-contact.desc":"Contact auxiliaire normalement fermé (à ouverture).","bell.desc":"Sonnerie de signalisation / d'alarme.","terminal.desc":"Borne / boîte de jonction / nœud de connexion.","fuse-switch-disconnector.desc":"Interrupteur-sectionneur à fusibles, manœuvrable en charge.","socket-outlet.desc":"Prise de courant / connecteur multipolaire.","inductor.desc":"Bobine d'inductance générale / self / self de choc.","voltage-regulator.desc":"Régulateur de tension à induction réglable / autotransformateur.","dc-motor.desc":"Moteur à courant continu (symbole général à excitation série).","heater.desc":"Élément chauffant résistif / charge de chauffage.","selector-switch.desc":"Commutateur sélecteur / à came rotatif (à position maintenue).","limit-switch.desc":"Interrupteur de fin de course / de position (NO, à commande mécanique).","proximity-switch.desc":"Capteur de proximité / détecteur de proximité sans contact.","time-relay.desc":"Bobine de relais temporisé (à fonctionnement retardé).","buzzer.desc":"Avertisseur sonore de signalisation.","siren.desc":"Sirène sonore / d'alarme.","thermocouple.desc":"Capteur de température à thermocouple.","thyristor.desc":"Thyristor triode à blocage inverse / SCR. t1 = anode (haut), t2 = cathode (bas).","triac.desc":"Thyristor triode bidirectionnel (TRIAC).","zener-diode.desc":"Diode Zener / de régulation de tension. t1 = anode (haut), t2 = cathode (bas).","igbt.desc":"IGBT à enrichissement canal N. t1 = collecteur (haut), t2 = émetteur (bas), t_g = grille.","plc.desc":"Automate programmable industriel (API).","ups.desc":"Alimentation sans interruption (ASI) online / standby.","power-supply.desc":"Alimentation à découpage AC→DC / alimentation DC. t_ac en haut (~), t_dc en bas (=).","genset.desc":"Groupe électrogène diesel / gaz.","protective-relay.desc":"Relais de mesure / protection, symbole général (IEC 60617).","overcurrent-relay.desc":"Relais de protection contre les surintensités (ANSI 50/51).","undervoltage-relay.desc":"Relais de protection contre les sous-tensions (ANSI 27).","reverse-power-relay.desc":"Relais de protection contre le retour de puissance / de courant (ANSI 32).","distance-relay.desc":"Relais de protection de distance / à minimum d'impédance (ANSI 21).","phase-failure-relay.desc":"Relais de protection contre le manque / la perte de phase.","buchholz-relay.desc":"Relais Buchholz / à gaz (ANSI 63).","power-factor-meter.desc":"Cosphimètre (cosφ).","synchronoscope.desc":"Indicateur de synchronisation / synchronoscope.","varmeter.desc":"Varmètre (mesure de puissance réactive, var).","make-contact.state.closed":"Fermé","break-contact.state.open":"Ouvert","on-delay-make-contact.name":"Contact à fermeture temporisé au travail (KT)","off-delay-make-contact.name":"Contact à fermeture temporisé au repos (KT)","on-delay-break-contact.name":"Contact à ouverture temporisé au travail (KT)","off-delay-break-contact.name":"Contact à ouverture temporisé au repos (KT)","continuation-out.name":"Renvoi (départ)","continuation-in.name":"Renvoi (arrivée)","on-delay-make-contact.desc":"Contact temporisé à fermeture : se ferme avec retard après la mise sous tension de la bobine (IEC 60617-07-05-01).","off-delay-make-contact.desc":"Contact temporisé à fermeture : s'ouvre avec retard après la mise hors tension de la bobine (IEC 60617-07-05-02).","on-delay-break-contact.desc":"Contact temporisé à ouverture : s'ouvre avec retard après la mise sous tension de la bobine (IEC 60617-07-05-03).","off-delay-break-contact.desc":"Contact temporisé à ouverture : se ferme avec retard après la mise hors tension de la bobine (IEC 60617-07-05-04).","continuation-out.desc":"Renvoi de folio : le conducteur s'interrompt ici et continue ailleurs. Les renvois portant le même nom sont le même conducteur.","continuation-in.desc":"Renvoi de folio : un conducteur venant d'ailleurs continue ici. Les renvois portant le même nom sont le même conducteur.","on-delay-make-contact.state.closed":"Fermé","on-delay-make-contact.param.delay":"Temporisation","off-delay-make-contact.state.closed":"Fermé","off-delay-make-contact.param.delay":"Temporisation","on-delay-break-contact.state.open":"Ouvert","on-delay-break-contact.param.delay":"Temporisation","off-delay-break-contact.state.open":"Ouvert","off-delay-break-contact.param.delay":"Temporisation","continuation-out.param.target":"Suite à","continuation-in.param.target":"Provient de","async-motor.param.P":"Puissance","sync-motor.param.P":"Puissance","dc-motor.param.P":"Puissance","ev-charger.param.P":"Puissance","socket-outlet.param.P":"Puissance","luminaire.param.P":"Puissance","fuse-switch-disconnector.state.open":"Ouvert","selector-switch.state.open":"Ouvert","limit-switch.state.closed":"Fermé","resistor.param.R":"Résistance","resistor.param.P":"Puissance nominale","capacitor.param.C":"Capacité","capacitor.param.Un":"Tension nominale","indicator-light.param.color":"Couleur","inductor.param.L":"Inductance","inductor.param.In":"Courant nominal","voltage-regulator.param.ratio":"Plage de régulation","heater.param.P":"Puissance","ups.param.S":"Puissance apparente","power-supply.param.Vdc":"Tension de sortie","genset.param.P":"Puissance"},Xj={ui:Kj,library:Uj},Yj={"common.unnamed":"Unbenannt","common.close":"Schließen","common.yes":"Ja","common.no":"Nein","topbar.theme.toLight":"Zu Hell wechseln","topbar.theme.toDark":"Zu Dunkel wechseln","topbar.theme.currentDark":"Aktuell: Dunkles Thema","topbar.theme.currentLight":"Aktuell: Helles Thema","topbar.lang.toEnglish":"Zu Englisch wechseln","topbar.lang.toChinese":"Zu Chinesisch wechseln","topbar.lang.currentEnglish":"Aktuell: Englisch","topbar.lang.currentChinese":"Aktuell: Chinesisch","topbar.export.label":"Exportieren","topbar.export.tooltip":"SVG-Vektor (editierbar), PNG-Bitmap (2× HiDPI) oder DXF (CAD)","topbar.export.pngFailed":"PNG-Export fehlgeschlagen: {err}","topbar.export.dxfFailed":"DXF-Export fehlgeschlagen: {err}","topbar.file.label":"Datei","topbar.file.tooltip":"Lokales .json-Diagramm öffnen, speichern oder speichern unter","topbar.file.current":"Aktuell: {name}","topbar.file.new":"Neu","topbar.file.open":"Öffnen…","topbar.file.save":"Speichern","topbar.file.saveAs":"Speichern unter…","topbar.file.newConfirm":"Bei „Neu“ gehen nicht gespeicherte Änderungen verloren. Fortfahren?","topbar.file.openFailed":"Öffnen fehlgeschlagen: {err}","topbar.file.saveFailed":"Speichern fehlgeschlagen: {err}","topbar.file.fileDescription":"OneLineEditor-Diagramm","outline.title":"Gliederung","outline.collapse":"Einklappen","outline.collapseAria":"Gliederung einklappen","outline.empty":"(Keine Elemente — aus der Bibliothek hierher ziehen, um zu starten)","props.title":"Eigenschaften","props.node":"Elektrischer Knoten","props.wire":"Leitung","props.bus":"Sammelschiene","props.junction":"Verbindungspunkt","props.junctionPos":"Position","props.nSelected":"{n} ausgewählt","props.empty":"Nichts ausgewählt","props.multi":"{n} Objekte ausgewählt","props.name":"Name","props.note":"Notiz","props.label":"Beschriftung","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Elektrischer Knoten {id} nicht gefunden","props.wireNotFound":"Leitung {id} nicht gefunden","props.nodeStats":"{terminals} Anschlüsse · {elements} Elemente","props.selectElement":"{label} auswählen","props.selectWholeNode":"Gesamten elektrischen Knoten auswählen","props.annText":"Text","props.annRect":"Rechteck","props.annEllipse":"Ellipse","props.annLine":"Linie","props.annTable":"Tabelle","props.annNotFound":"Beschriftung {id} nicht gefunden","props.annLabel":"Bezeichnung","props.annLabelPlaceholder":"z. B. Verteiler 1","props.color":"Farbe","props.size":"Größe","props.sizeReset":"Auf 100 % zurücksetzen","props.labelShown":"Sichtbar","props.labelHidden":"Ausgeblendet","props.contactType":"Kontakt","props.direction":"Richtung","props.directionOut":"Abgehend","props.directionIn":"Ankommend","props.partner":"Gegenstück","props.partnerUnnamed":"Benennen, um mit dem gleichnamigen Unterbrechungspunkt zu verbinden","props.partnerNone":"Kein Gegenstück in dieser Zeichnung","props.partnerJump":"Zu {id}","health.title":"Prüfung","health.hint":"Verbindungs- und Versorgungsprüfung: Hinweise und Schätzungen, keine Normprüfung","health.markers":"In der Zeichnung anzeigen","health.none":"Keine Probleme gefunden","health.sectionProblems":"Probleme","health.sectionNotes":"Hinweise","health.sectionDismissed":"Als beabsichtigt markiert","health.sectionLoads":"Lastsummen","health.dismiss":"Beabsichtigt","health.restore":"Wiederherstellen","health.loadKnown":"{kw} kW bekannt ({k}/{t} Verbraucher)","health.loadAll":"{kw} kW ({t} Verbraucher)","health.label.unwired":"Nicht angeschlossen","health.label.looks-joined":"Sieht verbunden aus, ist es nicht","health.label.dangling-wire":"Offenes Leitungsende","health.label.supply-disconnected":"Einspeisung nicht verbunden","health.label.unsupplied":"Kein Weg zur Einspeisung","health.label.no-origin":"Kein Einspeisesymbol","health.label.voltage-mix":"Spannungsebenen verbunden","health.label.ratio-mismatch":"Übersetzung passt nicht","health.label.label-mismatch":"Name vs. Parameter","health.label.overload":"Über der Nennleistung","health.label.feeder-end":"Abgang endet hier","health.label.open-side":"Einspeiseseite offen","health.introTitle":"Zeichnungsprüfung","health.intro":"{n} mögliche Probleme in den Verbindungen dieser Zeichnung gefunden. Die Punkte zeigen, wo. Das sind Hinweise aus der Verdrahtung, keine Normprüfung.","health.introShow":"Anzeigen","health.introOk":"Verstanden","health.loading":"{pct} % von {rating} kVA","health.disclaimer":"Hinweise und Schätzungen aus den Verbindungen der Zeichnung, keine Prüfung auf Normkonformität.","health.overloadUnits":"Mehr als das 10-Fache der Nennleistung: Einheiten der Verbraucher prüfen (P eines allgemeinen Verbrauchers ist in MW).","health.code.unwired":"{name} ist nicht angeschlossen. Eine Berührung ist keine Verbindung: Ziehen Sie eine Leitung zu seiner Klemme.","health.code.looks-joined":"Hier endet eine Leitung auf einem anderen Verbindungspunkt, ohne mit ihm verbunden zu sein: Sie sieht angeschlossen aus, ist es aber nicht.","health.code.dangling-wire":"Hier endet eine Leitung, ohne an etwas angeschlossen zu sein.","health.code.supply-disconnected":"{name} ist nicht mit dem Rest der Zeichnung verbunden: {count} von {total} Betriebsmitteln haben keinen Weg zu einer Einspeisung.","health.code.unsupplied":"{count} Betriebsmittel hier haben keinen Weg zu einer Einspeisung.","health.code.no-origin":"Diese Zeichnung hat kein Einspeisesymbol. Fügen Sie ein Netz oder einen Generator hinzu, um Versorgungswege zu prüfen und Lastsummen zu sehen.","health.code.voltage-mix":"Hier sind {a} kV und {b} kV ohne Transformator verbunden.","health.code.ratio-mismatch":"{name}: Übersetzung {ratio} passt nicht zu den Sammelschienen auf beiden Seiten ({a} kV / {b} kV).","health.code.label-mismatch":"{name}: Name und Parameter {param} ({value}) stimmen nicht überein.","health.code.overload":"{name}: Bekannte Last {load} kVA liegt über der Nennleistung {rating} kVA (alle Verbraucher bei Volllast, ohne Gleichzeitigkeit).","health.code.feeder-end":"{name}: Der Abgang endet hier.","health.code.open-side":"{name}: Die Einspeiseseite ist nicht angeschlossen (oft das Einspeiseende der Zeichnung).","props.color.default":"Standard","props.color.red":"Rot","props.color.amber":"Bernstein","props.color.green":"Grün","props.color.blue":"Blau","props.color.gray":"Grau","props.annStroke":"Linienart","props.annStrokeSolid":"Durchgezogen","props.annStrokeDashed":"Gestrichelt","props.annStrokeDotted":"Gepunktet","props.annStrokeWidth":"Stärke","props.annWidthThin":"Dünn","props.annWidthMedium":"Mittel","props.annWidthThick":"Dick","props.annFill":"Füllung","props.annFillNone":"Keine","props.annFillTint":"Farbton","props.annArrow":"Pfeile","props.annArrowNone":"Keine","props.annArrowEnd":"Einseitig","props.annArrowBoth":"Beidseitig","props.annFontSize":"Schriftgröße","props.annRows":"Zeilen","props.annCols":"Spalten","view.zoomOut":"Verkleinern","view.zoomOutHint":"Stufenweise verkleinern; auch Mausrad ↓ oder ⌘−","view.reset":"Auf 100 % zurücksetzen","view.current":"Aktuell {z} %","view.zoomIn":"Vergrößern","view.zoomInHint":"Stufenweise vergrößern; auch Mausrad ↑ oder ⌘+","view.fit":"Ansicht einpassen","view.fitHint":"Die ganze Zeichnung automatisch zoomen und zentrieren","view.gridHide":"Raster ausblenden","view.gridShow":"Raster einblenden","view.gridHotkey":"G","view.gridHideHint":"Deaktiviert auch das Einrasten am Raster (freie Platzierung)","view.gridShowHint":"Aktiviert auch das Einrasten am Raster (rastet beim Ziehen auf 10 px ein)","view.gridHideAria":"Raster ausblenden und Einrasten deaktivieren","view.gridShowAria":"Raster einblenden und Einrasten aktivieren","view.label":"Beschriftungen","view.labelOff":"Aus","view.labelId":"ID","view.labelAll":"ID + Parameter","view.labelHint":"Sichtbarkeit und Schriftgröße der Beschriftungen (auch beim Export)","view.labelSize":"Größe","view.labelSizeSmaller":"Beschriftungen verkleinern","view.labelSizeLarger":"Beschriftungen vergrößern","view.standard":"Symbolnorm","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Ändert nur die Darstellung der Symbole — Verdrahtung, Positionen und Kennwerte bleiben unberührt. Leistungsschalter und Sicherung werden unterschiedlich gezeichnet.","view.labelSizeReset":"Schriftgröße zurücksetzen","library.title":"Bibliothek","tool.draw":"Zeichnen","tool.drawHint":"Text, Rahmen, Kreise, Linien und Tabellen — freie Anmerkungen über der Zeichnung","library.empty":"Keine passenden Elemente","cat.custom":"In dieser Zeichnung","library.customTag":"eigen","library.customHint":"Von dieser Zeichnung definiert — in keiner anderen Bibliothek vorhanden","library.createComponent":"Neue Komponente…","library.searchPlaceholder":"Elemente suchen…","library.searchAria":"Elemente suchen","library.clearSearch":"Suche löschen","library.itemHint":"Klicken für Platzierungsmodus oder auf die Zeichenfläche ziehen","tool.select":"Auswählen","tool.selectHint":"Klicken zum Auswählen, Rahmen für Mehrfachauswahl, Rechtsklick für Menü","tool.pan":"Verschieben","tool.panHint":"Zeichenfläche ziehen; Leertaste schaltet vorübergehend um","tool.wire":"Leitung","tool.wireHint":"Von einem Anschluss/einer Sammelschiene/einem Verbindungspunkt ziehen; auf freie Fläche setzt einen Verbindungspunkt, auf eine Leitung setzt einen Abzweig","tool.bus":"Sammelschiene","tool.busHint":"Auf der Zeichenfläche ziehen — drücken für Anfang, loslassen für Ende","tool.junction":"Verbindungspunkt","tool.junctionHint":"Auf die Zeichenfläche klicken, um einen Verbindungspunkt (Knoten) zu setzen; Leitungen können frei daran angeschlossen werden","tool.place":"Platzieren","tool.placeHint":"Klicken zum Platzieren; oder von einem Anschluss/einer Sammelschiene ziehen, um zu platzieren und zu verbinden","tool.text":"Text","tool.textHint":"Auf die Zeichenfläche klicken, um eine Textnotiz zu setzen; Doppelklick auf vorhandenen Text zum Bearbeiten","tool.rect":"Rechteck","tool.rectHint":"Ziehen, um ein Rechteck / einen Gruppenrahmen zu zeichnen (standardmäßig gestrichelt); Shift für ein Quadrat","tool.ellipse":"Ellipse","tool.ellipseHint":"Ziehen, um eine Ellipse zu zeichnen; Shift für einen Kreis","tool.line":"Linie","tool.lineHint":"Ziehen, um eine Beschriftungslinie zu zeichnen; Shift rastet auf 45°; Pfeile im Panel einstellen","tool.table":"Tabelle","tool.tableHint":"Ziehen, um Spalten × Zeilen aufzuziehen (Live-Anzeige), oder klicken für eine Standardtabelle; Doppelklick auf Zellen zum Eintippen","mode.selectWithSel":"Elemente ziehen · Anschlüsse ziehen zum Verbinden · Rechtsklick für Menü","mode.selectEmpty":"Klicken zum Auswählen · Ziehen zum Verschieben · Rahmen für Mehrfachauswahl · Rechtsklick für Menü","mode.pan":"Zeichenfläche ziehen · Mausrad zum Zoomen · Leertaste gedrückt halten, um in jedem Werkzeug zu verschieben","mode.wireDragging":"Auf einem Anschluss/einer Sammelschiene/einem Verbindungspunkt loslassen; Loslassen auf freier Fläche setzt einen Verbindungspunkt","mode.wireInit":"Auf einem beliebigen Verbindungspunkt oder freier Fläche drücken, zum Ziel ziehen und loslassen","mode.busDragging":"Ziehen legt die Richtung der Sammelschiene fest; Loslassen legt das Ende fest","mode.busInit":"Auf der Zeichenfläche drücken für den Anfang, ziehen, loslassen für das Ende","mode.junction":"Auf die Zeichenfläche klicken, um einen Verbindungspunkt zu setzen","mode.placeNoKind":"Einen Elementtyp aus der Bibliothek links auswählen","mode.placeFromTerm":"Am Ziel loslassen — das neue Element wird mit dem Quellanschluss verbunden","mode.placeNormal":"Auf freie Fläche klicken zum Platzieren; oder von einem Anschluss / einer Sammelschiene ziehen, um zu platzieren und zu verbinden","mode.text":"Klicken, um Text zu setzen · Doppelklick zum Bearbeiten · Ziehen zum Verschieben der Auswahl · Entf zum Entfernen","mode.rect":"Ziehen, um ein Rechteck zu zeichnen · Shift für Quadrat · nach dem Loslassen skalieren und beschriften","mode.ellipse":"Ziehen, um eine Ellipse zu zeichnen · Shift für Kreis · nach dem Loslassen skalieren, umfärben und beschriften","mode.line":"Ziehen, um eine Linie zu zeichnen · Shift rastet auf 45° · Pfeile nach dem Loslassen im Panel hinzufügen","mode.table":"Ziehen, um das Raster aufzuziehen, oder klicken für eine 3×3-Tabelle · Doppelklick auf Zellen zum Eintippen","mode.annTextSel":"Text anklicken zum Bearbeiten · Ziehen zum Verschieben · Entf zum Entfernen","mode.annTableSel":"Zelle anklicken zum Ausfüllen · Ziehen zum Verschieben · Entf zum Entfernen","mode.annShapeSel":"Ziehen zum Verschieben · Anfasser ziehen zum Skalieren · Stil im Panel ändern · Entf zum Entfernen","mode.annEditing":"Eingeben · Enter zum Bestätigen · Esc zum Abbrechen · oder die ✓ / ✕ Schaltflächen","mode.escSelect":"Esc hebt die Auswahl auf","mode.escOther":"Rechtsklick / Esc zum Abbrechen","tool.placeNoKindTooltip":"Einen Typ in der Bibliothek links auswählen, dann auf die Zeichenfläche klicken","tool.undo":"Rückgängig","tool.undoHint":"Letzte Änderung rückgängig machen (Verschieben / Drehen / Löschen usw.)","tool.redo":"Wiederholen","tool.redoHint":"Letzte rückgängig gemachte Änderung wiederherstellen","layout.label":"Layout","layout.hint":"Gesamtes Diagramm oder nur die Auswahl automatisch anordnen, Lücken auffüllen","layout.allAuto":"Alles automatisch anordnen","layout.selAuto":"Auswahl automatisch anordnen","layout.allFill":"Nicht platzierte auffüllen","layout.selFill":"Nicht platzierte in Auswahl auffüllen","tool.more":"Mehr","tool.moreHint":"Rückgängig / Wiederholen / Layout","view.menu":"Ansicht","view.menuHint":"Zoom, Einpassen, Raster","ctx.ariaNode":"Knotenaktionen","ctx.ariaWire":"Leitungsaktionen","ctx.ariaElement":"Elementaktionen","ctx.ariaEdit":"Bearbeitungsaktionen","ctx.done":"Fertig","ctx.cancel":"Abbrechen","ctx.rotate":"Um 90° drehen","ctx.rotateHint":"Auswahl im Uhrzeigersinn drehen; Leitungen werden über neue Anschlüsse neu geführt","ctx.mirror":"Horizontal spiegeln","ctx.mirrorTitle":"Spiegeln","ctx.mirrorHint":"Auswahl links-rechts spiegeln","ctx.delete":"Löschen","ctx.color":"Farbe","ctx.colorDefault":"Standard","ctx.colorRed":"Rot","ctx.colorAmber":"Bernstein","ctx.colorGreen":"Grün","ctx.colorBlue":"Blau","ctx.colorGray":"Grau","ctx.deleteHintNode":"Alle Leitungen an diesem Knoten trennen (Elemente bleiben erhalten)","ctx.deleteHintWire":"Nur diese Leitung entfernen (andere Leitungen am selben Knoten bleiben erhalten)","ctx.deleteHintElement":"Auswahl und ihre Leitungen entfernen","ctx.resetWirePath":"Auf automatische Führung zurücksetzen","ctx.resetWirePathHint":"Manuelle Eckpunkte verwerfen und die Leitung automatisch neu zeichnen lassen","menu.undo":"Rückgängig","menu.redo":"Wiederholen","menu.cut":"Ausschneiden","menu.copy":"Kopieren","menu.paste":"Einfügen","menu.rotate":"Um 90° drehen","menu.mirror":"Spiegeln","menu.resetLabel":"Beschriftung zurücksetzen","menu.selectAll":"Alles auswählen","menu.disconnect":"Diese Leitung trennen","menu.delete":"Löschen","io.parseFailed":"JSON-Parsing fehlgeschlagen: {err}","io.notObject":"Datei ist kein JSON-Objekt","io.versionMismatch":"Versionskonflikt: erwartet „1“, erhalten {actual}","io.elementsMissing":"`elements` fehlt oder ist kein Array","compile.duplicateId":"Doppelte Element-ID: „{id}“","compile.unknownKind":'Unbekannter Elementtyp kind="{kind}"',"compile.invalidTermRef":"Ungültige Anschlussreferenz „{ref}“","compile.elementMissing":"Verweis auf unbekanntes Element „{id}“","compile.missingPin":"Element „{id}“ (kind={kind}) hat keinen Pin „{pin}“; verfügbar: {available}","compile.singleTerminal":"Knoten hat nur einen Anschluss — ignoriert","compile.layoutMissingElement":"layout-Schlüssel „{id}“ verweist auf ein unbekanntes Element","compile.elementUnconnected":"Element „{id}“ hat keine Verbindungen","cat.busbar":"Sammelschiene / Verdrahtung","cat.switching":"Schalten","cat.protection":"Schutz","cat.motor-control":"Motorsteuerung","cat.transformer":"Transformator","cat.instrument-transformer":"Messwandler","cat.measurement":"Messung","cat.source":"Quelle","cat.load":"Last","cat.storage":"Speicher","cat.compensation":"Kompensation","cat.grounding":"Erdung","cat.renewable":"Erneuerbare Energien / Leistungselektronik","onboard.title":"Schnellstart","onboard.step1.title":"Ein Bauteil platzieren","onboard.step1.body":"Werkzeug Platzieren (P) wählen und einen Typ aus der Bibliothek auf die Zeichenfläche ziehen","onboard.step2.title":"Verdrahten","onboard.step2.body":"Werkzeug Leitung (W) verwenden: von einem Anschluss zum anderen ziehen — auf freie Fläche ziehen setzt einen Verbindungspunkt","onboard.step3.title":"Eine Sammelschiene ist eine gemeinsame Schiene, keine Leitung","onboard.step3.body":"Das Werkzeug Sammelschiene (B) nur verwenden, wenn sich mehrere Stromkreise eine Schiene teilen. Keine Sammelschiene benutzen, um zwei Geräte zu verbinden — einfach die Anschlüsse direkt verdrahten (W).","onboard.dismiss":"Verstanden"},Zj={"arc-suppression-coil.name":"Erdschlusslöschspule","arrester.name":"Überspannungsableiter (FBL)","async-motor.name":"Asynchronmotor","autotransformer.name":"Spartransformator","battery.name":"Batteriespeicher","breaker.name":"Leistungsschalter (QF)","busbar.name":"Sammelschienenabschnitt","converter-bidir.name":"Bidirektionaler Umrichter (PCS)","dc-dc-converter.name":"DC/DC-Wandler","mppt.name":"MPPT-Regler","ct.name":"Stromwandler (CT)","disconnector.name":"Trennschalter (QS)","earth.name":"Erde","earthing-switch.name":"Erdungsschalter (QE)","fuse.name":"Sicherung (FU)","generator.name":"Generator (G)","grid-source.name":"Netzeinspeisung","grounding-transformer.name":"Erdungstransformator (Zickzack)","inverter.name":"Wechselrichter (DC→AC)","load-switch.name":"Lastschalter","load.name":"Last","luminaire.name":"Leuchte (Beleuchtungslast)","panelboard.name":"Verteilerschrank / Lastzentrum","ngr.name":"Sternpunkt-Erdungswiderstand (NGR)","pt.name":"Spannungswandler (PT)","pv.name":"PV-Modul","rectifier.name":"Gleichrichter (AC→DC)","series-reactor.name":"Längsdrosselspule","shunt-capacitor.name":"Kompensationskondensator","shunt-reactor.name":"Querdrosselspule","sync-motor.name":"Synchronmotor","transformer-2w.name":"Zweiwicklungstransformator","transformer-3w.name":"Dreiwicklungstransformator","wind-turbine.name":"Windenergieanlage","gfci-breaker.name":"GFCI-Leistungsschalter (RCBO)","rcd.name":"Fehlerstrom-Schutzeinrichtung (RCD)","recloser.name":"Recloser","energy-meter.name":"Energiezähler (Wh)","voltmeter.name":"Spannungsmesser (V)","ammeter.name":"Amperemeter (A)","wattmeter.name":"Wattmeter (W)","frequency-meter.name":"Frequenzmesser (Hz)","contactor.name":"Schütz (KM)","motor-starter.name":"Motorstarter","thermal-overload.name":"Thermisches Überlastrelais","vfd.name":"Frequenzumrichter (VFD)","soft-starter.name":"Sanftstarter","transfer-switch.name":"Netzumschalter (ATS)","dc-disconnector.name":"Gleichstrom-Trennschalter","dc-combiner.name":"Generatoranschlusskasten","ev-charger.name":"EV-Ladestation","arc-suppression-coil.desc":"Resonante Sternpunkterdung: Induktivität gegen Erde","busbar.desc":"Dehnbarer Einzelsammelschienenabschnitt mit mehreren Abzweigen","converter-bidir.desc":"Speicherumrichter: bidirektional AC ↔ DC","dc-dc-converter.desc":"DC/DC-Wandler / Gleichstromladegerät (IEC 60617)","mppt.desc":"MPPT-Solarladeregler (DC/DC, Maximum-Power-Point-Tracking)","earthing-switch.desc":"Trennschalter + Erdverbindung, ein Anschluss","grid-source.desc":"Starres Netz / externes Versorgungsnetz","grounding-transformer.desc":"Stern-Zickzack-Transformator zur Sternpunkterdung","load.desc":"Abstrakte Last (Pfeil für Stromabgang)","luminaire.desc":"Beleuchtungslast (allgemeines Leuchtensymbol IEC 60617)","ngr.desc":"Niederohmige Erdung: Transformator-Sternpunkt gegen Erde","series-reactor.desc":"Gleiches Symbol wie die Querdrosselspule; Unterscheidung nach Verwendungszweck","wind-turbine.desc":"Windenergieanlage: Generator + Drei-Blatt-Rotor-Kennzeichnung","gfci-breaker.desc":"Fehlerstromschutzschalter mit Überstromschutz (UL943 / IEC 61009). In Nordamerika GFCI, in Europa RCBO.","rcd.desc":"Fehlerstromschutzschalter ohne Überstromschutz (IEC 61008).","recloser.desc":"Automatischer Mittelspannungs-Recloser.","energy-meter.desc":"Wirkarbeitszähler (kWh) — Hausanschluss / Unterzähler.","contactor.desc":"Hauptstromkreis-Schütz, meist zusammen mit einem Thermorelais und einem Motor verwendet.","motor-starter.desc":"Motorstarter (allgemeines Symbol nach IEC 60617).","thermal-overload.desc":"Thermisches Überlastschutzrelais für Motoren; sitzt zwischen Schütz und Motor.","vfd.desc":"Frequenzumrichter zur Drehzahlregelung von Asynchronmotoren.","soft-starter.desc":"Sanftstarter für Motoren (thyristorbasiertes Anlaufen mit reduzierter Spannung).","transfer-switch.desc":"Umschalter für zwei Quellen (automatisch/manuell). Zwei Quelleneingänge + ein Lastausgang, mechanisch verriegelt.","dc-disconnector.desc":"Gleichstrom-Trennschalter — Trennung auf der Gleichstromseite von PV-Strings / Batteriespeichern.","dc-combiner.desc":"PV-String-Generatoranschlusskasten (Beispiel mit 4 Eingängen).","ev-charger.desc":"Ladestation für Elektrofahrzeuge.","breaker.state.open":"Offen","disconnector.state.open":"Offen","earthing-switch.state.open":"Offen","fuse.state.blown":"Durchgebrannt","load-switch.state.open":"Offen","gfci-breaker.state.open":"Offen","rcd.state.open":"Offen","recloser.state.open":"Offen","contactor.state.open":"Offen","thermal-overload.state.tripped":"Ausgelöst","transfer-switch.state.position":"Position (normal/Notbetrieb/aus)","dc-disconnector.state.open":"Offen","battery.param.E":"Kapazität","busbar.param.Un":"Bemessungsspannung","converter-bidir.param.S":"Nennleistung","dc-dc-converter.param.P":"Leistung","mppt.param.I":"Bemessungsstrom","load.param.P":"Wirkleistung","load.param.cosphi":"Leistungsfaktor","ngr.param.R":"Widerstand","shunt-capacitor.param.Q":"Blindleistung","shunt-capacitor.param.stages":"Stufen","transformer-2w.param.S":"Nennleistung","transformer-2w.param.ratio":"Übersetzungsverhältnis","gfci-breaker.param.In":"Bemessungsstrom","panelboard.param.In":"Bemessungsstrom","gfci-breaker.param.IDn":"Bemessungsdifferenzstrom","rcd.param.IDn":"Bemessungsdifferenzstrom","breaker.param.In":"Bemessungsstrom","breaker.param.poles":"Polzahl","breaker.param.Icu":"Ausschaltvermögen","disconnector.param.In":"Bemessungsstrom","fuse.param.In":"Bemessungsstrom","resistor.name":"Widerstand (R)","capacitor.name":"Kondensator (C)","diode.name":"Diode (D)","indicator-light.name":"Meldeleuchte (HL)","push-button.name":"Taster (SB)","relay-coil.name":"Relaisspule (KA)","make-contact.name":"Schließer (NO)","break-contact.name":"Öffner (NC)","bell.name":"Klingel (HA)","terminal.name":"Klemme / Verbindungspunkt (X)","fuse-switch-disconnector.name":"Sicherungslasttrennschalter","socket-outlet.name":"Steckdose / Steckverbinder","inductor.name":"Spule (L)","voltage-regulator.name":"Spannungsregler (T)","dc-motor.name":"Gleichstrommotor (M)","heater.name":"Heizelement (EH)","selector-switch.name":"Wahlschalter (SA)","limit-switch.name":"Endschalter (SQ)","proximity-switch.name":"Näherungsschalter (SQ)","time-relay.name":"Zeitrelais (KT)","buzzer.name":"Summer (HA)","siren.name":"Sirene (HA)","thermocouple.name":"Thermoelement (BT)","thyristor.name":"Thyristor (V)","triac.name":"Triac (V)","zener-diode.name":"Z-Diode (D)","igbt.name":"IGBT","plc.name":"SPS / Steuerung","ups.name":"USV","power-supply.name":"Netzteil (PS)","genset.name":"Generatoraggregat (G)","protective-relay.name":"Schutzrelais","overcurrent-relay.name":"Überstromrelais (50/51)","undervoltage-relay.name":"Unterspannungsrelais (27)","reverse-power-relay.name":"Rückleistungsrelais (32)","distance-relay.name":"Distanzrelais (21)","phase-failure-relay.name":"Phasenausfallrelais","buchholz-relay.name":"Buchholzrelais (63)","power-factor-meter.name":"Leistungsfaktormesser (cosφ)","synchronoscope.name":"Synchronoskop","varmeter.name":"Blindleistungsmesser (var)","resistor.desc":"Allgemeiner Widerstand / Vorwiderstand / Bremswiderstand.","capacitor.desc":"Allgemeiner / Filter- / Zwischenkreiskondensator. Für Blindleistungskompensation den Kompensationskondensator verwenden.","diode.desc":"Gleichrichter- / Freilauf- / Schutzdiode. t1 = Anode (oben), t2 = Kathode (unten).","indicator-light.desc":"Signal- / Zustandsmeldeleuchte.","push-button.desc":"Handbetätigter Taster mit selbsttätiger Rückstellung (Schließer).","relay-coil.desc":"Betätigungsspule eines Relais / Schützes (Rechtecksymbol).","make-contact.desc":"Normalerweise geöffneter Hilfskontakt (Schließer).","break-contact.desc":"Normalerweise geschlossener Hilfskontakt (Öffner).","bell.desc":"Signalglocke / Alarmglocke.","terminal.desc":"Klemme / Abzweigdose / Verbindungsknoten.","fuse-switch-disconnector.desc":"Lastschaltbarer Sicherungslasttrennschalter.","socket-outlet.desc":"Steckdose / mehrpoliger Steckverbinder.","inductor.desc":"Allgemeine Spule / Induktivität / Drossel.","voltage-regulator.desc":"Regelbarer Induktions- / Spartransformator-Spannungsregler.","dc-motor.desc":"Gleichstrommotor (allgemeines Symbol, Reihenschluss).","heater.desc":"Ohmsches Heizelement / Heizlast.","selector-switch.desc":"Wahl-/Umschalter (Drehschalter, rastend).","limit-switch.desc":"Positions-/Endschalter (Schließer, mechanisch betätigt).","proximity-switch.desc":"Näherungssensor / berührungsloser Näherungsschalter.","time-relay.desc":"Zeitverzögerungsrelais (ansprechverzögert).","buzzer.desc":"Signalsummer.","siren.desc":"Akustische Sirene / Alarmsignal.","thermocouple.desc":"Thermoelement-Temperaturfühler.","thyristor.desc":"Rückwärtssperrender Thyristor. t1 = Anode (oben), t2 = Kathode (unten).","triac.desc":"Bidirektionaler Thyristor (Triac).","zener-diode.desc":"Z-Diode / Spannungsreferenzdiode. t1 = Anode (oben), t2 = Kathode (unten).","igbt.desc":"N-Kanal-Anreicherungs-IGBT. t1 = Kollektor (oben), t2 = Emitter (unten), t_g = Gate.","plc.desc":"Speicherprogrammierbare Steuerung (SPS).","ups.desc":"Online- / Standby-unterbrechungsfreie Stromversorgung.","power-supply.desc":"AC→DC-Schaltnetzteil / Gleichstromnetzteil. t_ac oben (~), t_dc unten (=).","genset.desc":"Diesel-/Gas-Generatoraggregat.","protective-relay.desc":"Mess- / Schutzrelais, allgemeines Symbol (IEC 60617).","overcurrent-relay.desc":"Überstromschutzrelais (ANSI 50/51).","undervoltage-relay.desc":"Unterspannungsschutzrelais (ANSI 27).","reverse-power-relay.desc":"Rückleistungs-/Rückstromschutzrelais (ANSI 32).","distance-relay.desc":"Distanz-/Unterimpedanzschutzrelais (ANSI 21).","phase-failure-relay.desc":"Phasenausfall-/Phasenverlustschutzrelais.","buchholz-relay.desc":"Buchholzrelais / Gasrelais (ANSI 63).","power-factor-meter.desc":"Leistungsfaktormesser (cosφ).","synchronoscope.desc":"Synchronisieranzeige / Synchronoskop.","varmeter.desc":"Blindleistungsmesser (var).","make-contact.state.closed":"Geschlossen","break-contact.state.open":"Offen","on-delay-make-contact.name":"Schließer, anzugsverzögert (KT)","off-delay-make-contact.name":"Schließer, abfallverzögert (KT)","on-delay-break-contact.name":"Öffner, anzugsverzögert (KT)","off-delay-break-contact.name":"Öffner, abfallverzögert (KT)","continuation-out.name":"Unterbrechungspunkt (abgehend)","continuation-in.name":"Unterbrechungspunkt (ankommend)","on-delay-make-contact.desc":"Zeitrelaiskontakt: schließt verzögert, nachdem die Spule erregt wurde (IEC 60617-07-05-01).","off-delay-make-contact.desc":"Zeitrelaiskontakt: öffnet verzögert, nachdem die Spule abgeschaltet wurde (IEC 60617-07-05-02).","on-delay-break-contact.desc":"Zeitrelaiskontakt: öffnet verzögert, nachdem die Spule erregt wurde (IEC 60617-07-05-03).","off-delay-break-contact.desc":"Zeitrelaiskontakt: schließt verzögert, nachdem die Spule abgeschaltet wurde (IEC 60617-07-05-04).","continuation-out.desc":"Die Leitung wird hier unterbrochen und an anderer Stelle fortgesetzt. Unterbrechungspunkte mit gleichem Namen sind dieselbe Leitung.","continuation-in.desc":"Eine Leitung von anderer Stelle wird hier fortgesetzt. Unterbrechungspunkte mit gleichem Namen sind dieselbe Leitung.","on-delay-make-contact.state.closed":"Geschlossen","on-delay-make-contact.param.delay":"Verzögerung","off-delay-make-contact.state.closed":"Geschlossen","off-delay-make-contact.param.delay":"Verzögerung","on-delay-break-contact.state.open":"Offen","on-delay-break-contact.param.delay":"Verzögerung","off-delay-break-contact.state.open":"Offen","off-delay-break-contact.param.delay":"Verzögerung","continuation-out.param.target":"Weiter bei","continuation-in.param.target":"Kommt von","async-motor.param.P":"Leistung","sync-motor.param.P":"Leistung","dc-motor.param.P":"Leistung","ev-charger.param.P":"Leistung","socket-outlet.param.P":"Leistung","luminaire.param.P":"Leistung","fuse-switch-disconnector.state.open":"Offen","selector-switch.state.open":"Offen","limit-switch.state.closed":"Geschlossen","resistor.param.R":"Widerstand","resistor.param.P":"Bemessungsleistung","capacitor.param.C":"Kapazität","capacitor.param.Un":"Bemessungsspannung","indicator-light.param.color":"Farbe","inductor.param.L":"Induktivität","inductor.param.In":"Bemessungsstrom","voltage-regulator.param.ratio":"Regelbereich","heater.param.P":"Leistung","ups.param.S":"Nennleistung","power-supply.param.Vdc":"Ausgangsspannung","genset.param.P":"Leistung"},Qj={ui:Yj,library:Zj},Jj={"common.unnamed":"Sem título","common.close":"Fechar","common.yes":"Sim","common.no":"Não","topbar.theme.toLight":"Mudar para claro","topbar.theme.toDark":"Mudar para escuro","topbar.theme.currentDark":"Atual: tema escuro","topbar.theme.currentLight":"Atual: tema claro","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Atual: inglês","topbar.lang.currentChinese":"Atual: chinês","topbar.export.label":"Exportar","topbar.export.tooltip":"SVG vetorial (editável), PNG bitmap (2× HiDPI) ou DXF (CAD)","topbar.export.pngFailed":"Falha ao exportar PNG: {err}","topbar.export.dxfFailed":"Falha ao exportar DXF: {err}","topbar.file.label":"Arquivo","topbar.file.tooltip":"Abrir um diagrama .json local, salvar ou salvar como","topbar.file.current":"Atual: {name}","topbar.file.new":"Novo","topbar.file.open":"Abrir…","topbar.file.save":"Salvar","topbar.file.saveAs":"Salvar como…","topbar.file.newConfirm":"Criar um novo diagrama descartará as alterações não salvas. Continuar?","topbar.file.openFailed":"Falha ao abrir: {err}","topbar.file.saveFailed":"Falha ao salvar: {err}","topbar.file.fileDescription":"Diagrama OneLineEditor","outline.title":"Estrutura","outline.collapse":"Recolher","outline.collapseAria":"Recolher estrutura","outline.empty":"(Nenhum elemento — arraste da biblioteca para começar)","props.title":"Propriedades","props.node":"Nó elétrico","props.wire":"Fio","props.bus":"Barramento","props.junction":"Junção","props.junctionPos":"Posição","props.nSelected":"{n} selecionado(s)","props.empty":"Nada selecionado","props.multi":"{n} objetos selecionados","props.name":"Nome","props.note":"Nota","props.label":"Rótulo","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nó elétrico {id} não encontrado","props.wireNotFound":"Fio {id} não encontrado","props.nodeStats":"{terminals} terminais · {elements} elementos","props.selectElement":"Selecionar {label}","props.selectWholeNode":"Selecionar todo o nó elétrico","props.annText":"Texto","props.annRect":"Retângulo","props.annEllipse":"Elipse","props.annLine":"Linha","props.annTable":"Tabela","props.annNotFound":"Anotação {id} não encontrada","props.annLabel":"Rótulo","props.annLabelPlaceholder":"ex.: Quadro nº 1","props.color":"Cor","props.size":"Tamanho","props.sizeReset":"Voltar para 100%","props.labelShown":"Visível","props.labelHidden":"Oculto","props.contactType":"Contato","props.direction":"Sentido","props.directionOut":"Saída","props.directionIn":"Chegada","props.partner":"Par","props.partnerUnnamed":"Dê um nome para parear com a continuação de mesmo nome","props.partnerNone":"Sem par neste diagrama","props.partnerJump":"Ir para {id}","health.title":"Verificação","health.hint":"Verificação de conexões e alimentação: indicações e estimativas, não uma verificação normativa","health.markers":"Mostrar no diagrama","health.none":"Nenhum problema encontrado","health.sectionProblems":"Problemas","health.sectionNotes":"Observações","health.sectionDismissed":"Marcado como intencional","health.sectionLoads":"Totais de carga","health.dismiss":"É intencional","health.restore":"Restaurar","health.loadKnown":"{kw} kW conhecidos ({k}/{t} cargas)","health.loadAll":"{kw} kW ({t} cargas)","health.label.unwired":"Não conectado","health.label.looks-joined":"Parece ligado, mas não está","health.label.dangling-wire":"Ponta de fio solta","health.label.supply-disconnected":"Fonte não ligada","health.label.unsupplied":"Sem caminho até uma fonte","health.label.no-origin":"Sem símbolo de fonte","health.label.voltage-mix":"Tensões ligadas","health.label.ratio-mismatch":"Relação não confere","health.label.label-mismatch":"Nome vs. parâmetro","health.label.overload":"Acima da potência nominal","health.label.feeder-end":"O circuito termina aqui","health.label.open-side":"Lado de alimentação solto","health.introTitle":"Verificação do diagrama","health.intro":"Encontramos {n} possível(is) problema(s) nas ligações deste diagrama. Os pontos mostram onde. São indicações a partir da fiação, não uma verificação normativa.","health.introShow":"Ver","health.introOk":"Entendi","health.loading":"{pct}% de {rating} kVA","health.disclaimer":"Indicações e estimativas a partir das conexões do diagrama, não uma verificação normativa.","health.overloadUnits":"Mais de 10 vezes a potência nominal: confira as unidades das cargas (o P de uma carga genérica é em MW).","health.code.unwired":"{name} não está conectado. Encostar numa linha não é conexão: desenhe um fio até o terminal dele.","health.code.looks-joined":"Aqui um fio termina sobre outro ponto de conexão sem se ligar a ele: parece conectado, mas não está.","health.code.dangling-wire":"Aqui um fio termina sem se ligar a nada.","health.code.supply-disconnected":"{name} não está ligado ao resto do diagrama: {count} de {total} equipamentos não têm caminho até uma fonte.","health.code.unsupplied":"{count} equipamento(s) aqui não têm caminho até nenhuma fonte.","health.code.no-origin":"Este diagrama não tem símbolo de fonte. Adicione uma rede ou um gerador para verificar a alimentação e ver os totais de carga.","health.code.voltage-mix":"Aqui {a} kV e {b} kV estão ligados sem transformador.","health.code.ratio-mismatch":"{name}: a relação {ratio} não confere com os barramentos dos dois lados ({a} kV / {b} kV).","health.code.label-mismatch":"{name}: o nome e o parâmetro {param} ({value}) não conferem.","health.code.overload":"{name}: a carga conhecida de {load} kVA passa da potência nominal de {rating} kVA (todas as cargas a plena potência, sem simultaneidade).","health.code.feeder-end":"{name}: o circuito termina aqui.","health.code.open-side":"{name}: o lado de alimentação não está ligado (muitas vezes é a entrada do diagrama).","props.color.default":"Padrão","props.color.red":"Vermelho","props.color.amber":"Âmbar","props.color.green":"Verde","props.color.blue":"Azul","props.color.gray":"Cinza","props.annStroke":"Traço","props.annStrokeSolid":"Sólido","props.annStrokeDashed":"Tracejado","props.annStrokeDotted":"Pontilhado","props.annStrokeWidth":"Espessura","props.annWidthThin":"Fina","props.annWidthMedium":"Média","props.annWidthThick":"Grossa","props.annFill":"Preenchimento","props.annFillNone":"Nenhum","props.annFillTint":"Tonalidade","props.annArrow":"Setas","props.annArrowNone":"Nenhuma","props.annArrowEnd":"Simples","props.annArrowBoth":"Dupla","props.annFontSize":"Tamanho da fonte","props.annRows":"Linhas","props.annCols":"Colunas","view.zoomOut":"Reduzir zoom","view.zoomOutHint":"Reduz o zoom por etapas; também roda ↓ ou ⌘−","view.reset":"Redefinir para 100%","view.current":"Atual {z}%","view.zoomIn":"Aumentar zoom","view.zoomInHint":"Aumenta o zoom por etapas; também roda ↑ ou ⌘+","view.fit":"Ajustar à tela","view.fitHint":"Aplica zoom automático e centraliza o desenho inteiro","view.gridHide":"Ocultar grade","view.gridShow":"Mostrar grade","view.gridHotkey":"G","view.gridHideHint":"Também desativa o encaixe à grade (posicionamento livre)","view.gridShowHint":"Também ativa o encaixe à grade (encaixa em 10px ao arrastar)","view.gridHideAria":"Ocultar grade e desativar encaixe","view.gridShowAria":"Mostrar grade e ativar encaixe","view.label":"Rótulos","view.labelOff":"Nenhum","view.labelId":"ID","view.labelAll":"ID + parâmetros","view.labelHint":"Visibilidade e tamanho dos rótulos (também na exportação)","view.labelSize":"Tamanho","view.labelSizeSmaller":"Diminuir o tamanho dos rótulos","view.labelSizeLarger":"Aumentar o tamanho dos rótulos","view.standard":"Norma dos símbolos","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Muda apenas o desenho dos símbolos — fiação, posições e valores não são alterados. Disjuntor e fusível diferem entre as duas.","view.labelSizeReset":"Redefinir o tamanho dos rótulos","library.title":"Biblioteca","tool.draw":"Desenhar","tool.drawHint":"Texto, caixas, círculos, linhas e tabelas — anotação livre sobre o desenho","library.empty":"Nenhum elemento encontrado","cat.custom":"Neste desenho","library.customTag":"próprio","library.customHint":"Definido por este desenho — não está na biblioteca de mais ninguém","library.createComponent":"Novo componente…","library.searchPlaceholder":"Buscar elementos…","library.searchAria":"Buscar elementos","library.clearSearch":"Limpar busca","library.itemHint":"Clique para entrar no modo de posicionamento ou arraste até a tela","tool.select":"Selecionar","tool.selectHint":"Clique para selecionar, arraste para selecionar vários, botão direito para o menu","tool.pan":"Panorâmica","tool.panHint":"Arraste a tela; a barra de espaço alterna temporariamente","tool.wire":"Fio","tool.wireHint":"Arraste de um pino/barramento/junção; soltar em espaço vazio cria uma junção, sobre um fio existente cria uma derivação","tool.bus":"Barramento","tool.busHint":"Arraste na tela — pressione para definir o início, solte para definir o fim","tool.junction":"Junção","tool.junctionHint":"Clique na tela para posicionar uma junção (nó); os fios se conectam livremente a ela","tool.place":"Posicionar","tool.placeHint":"Clique para posicionar; ou arraste de um terminal/barramento para posicionar e conectar","tool.text":"Texto","tool.textHint":"Clique na tela para inserir uma anotação de texto; clique duas vezes em uma existente para editar","tool.rect":"Retângulo","tool.rectHint":"Arraste para desenhar um retângulo / moldura de grupo (tracejado por padrão); Shift para um quadrado","tool.ellipse":"Elipse","tool.ellipseHint":"Arraste para desenhar uma elipse; Shift para um círculo","tool.line":"Linha","tool.lineHint":"Arraste para desenhar uma linha de anotação; Shift trava em 45°; as setas ficam no painel","tool.table":"Tabela","tool.tableHint":"Arraste para definir colunas × linhas (contagem em tempo real), ou clique para uma tabela padrão; clique duas vezes nas células para digitar","mode.selectWithSel":"Arraste elementos para mover · arraste terminais para conectar · botão direito para o menu","mode.selectEmpty":"Clique para selecionar · arraste para mover · seleção múltipla por área · botão direito para o menu","mode.pan":"Arraste a tela · role para o zoom · segure Espaço para deslocar em qualquer ferramenta","mode.wireDragging":"Solte em um pino/barramento/junção; soltar em espaço vazio cria uma junção","mode.wireInit":"Pressione em qualquer ponto de conexão ou espaço vazio, arraste até o destino e solte","mode.busDragging":"O arraste define a direção do barramento; soltar define o fim","mode.busInit":"Pressione na tela para definir o início, arraste, solte para definir o fim","mode.junction":"Clique na tela para posicionar uma junção","mode.placeNoKind":"Escolha um tipo de elemento na biblioteca à esquerda","mode.placeFromTerm":"Solte no destino — o novo elemento se conectará de volta ao terminal de origem","mode.placeNormal":"Clique em um espaço vazio para posicionar; ou arraste de um terminal/barramento para posicionar e conectar","mode.text":"Clique para inserir texto · clique duas vezes para editar · arraste o selecionado para mover · Del para remover","mode.rect":"Arraste para desenhar um retângulo · Shift para quadrado · redimensione e rotule após soltar","mode.ellipse":"Arraste para desenhar uma elipse · Shift para círculo · redimensione, recolora e rotule após soltar","mode.line":"Arraste para desenhar uma linha · Shift trava em 45° · adicione setas no painel após soltar","mode.table":"Arraste para definir a grade, ou clique para uma tabela 3×3 · clique duas vezes nas células para digitar","mode.annTextSel":"Clique no texto para editar · arraste para mover · Del para remover","mode.annTableSel":"Clique em uma célula para preencher · arraste para mover · Del para remover","mode.annShapeSel":"Arraste para mover · arraste as alças para redimensionar · reestilize no painel · Del para remover","mode.annEditing":"Digite · Enter para confirmar · Esc para cancelar · ou os botões ✓ / ✕","mode.escSelect":"Esc limpa a seleção","mode.escOther":"Botão direito / Esc para cancelar","tool.placeNoKindTooltip":"Escolha um tipo na biblioteca à esquerda e clique na tela","tool.undo":"Desfazer","tool.undoHint":"Desfaz a última edição (mover / girar / excluir etc.)","tool.redo":"Refazer","tool.redoHint":"Refaz a última edição desfeita","layout.label":"Layout","layout.hint":"Aplica o layout automático a todo o diagrama ou apenas à seleção, preenchendo lacunas","layout.allAuto":"Reaplicar layout automático","layout.selAuto":"Reaplicar layout automático na seleção","layout.allFill":"Preencher não posicionados","layout.selFill":"Preencher não posicionados na seleção","tool.more":"Mais","tool.moreHint":"Desfazer / refazer / layout","view.menu":"Visualização","view.menuHint":"Zoom, ajuste, grade","ctx.ariaNode":"Ações do nó","ctx.ariaWire":"Ações do fio","ctx.ariaElement":"Ações do elemento","ctx.ariaEdit":"Ações de edição","ctx.done":"Concluído","ctx.cancel":"Cancelar","ctx.rotate":"Girar 90°","ctx.rotateHint":"Gira a seleção no sentido horário; os fios se reconectam pelos novos terminais","ctx.mirror":"Espelhar horizontalmente","ctx.mirrorTitle":"Espelhar","ctx.mirrorHint":"Inverte a seleção da esquerda para a direita","ctx.delete":"Excluir","ctx.color":"Cor","ctx.colorDefault":"Padrão","ctx.colorRed":"Vermelho","ctx.colorAmber":"Âmbar","ctx.colorGreen":"Verde","ctx.colorBlue":"Azul","ctx.colorGray":"Cinza","ctx.deleteHintNode":"Desconecta todos os fios deste nó (os elementos permanecem)","ctx.deleteHintWire":"Remove apenas este fio (os demais no mesmo nó permanecem)","ctx.deleteHintElement":"Remove a seleção e seus fios","ctx.resetWirePath":"Redefinir para roteamento automático","ctx.resetWirePathHint":"Remove os vértices manuais e deixa o roteador redesenhar este fio","menu.undo":"Desfazer","menu.redo":"Refazer","menu.cut":"Recortar","menu.copy":"Copiar","menu.paste":"Colar","menu.rotate":"Girar 90°","menu.mirror":"Espelhar","menu.resetLabel":"Redefinir posição do rótulo","menu.selectAll":"Selecionar tudo","menu.disconnect":"Desconectar este fio","menu.delete":"Excluir","io.parseFailed":"Falha ao interpretar o JSON: {err}","io.notObject":"O arquivo não é um objeto JSON","io.versionMismatch":'Versão incompatível: esperado "1", recebido {actual}',"io.elementsMissing":"`elements` está ausente ou não é um array","compile.duplicateId":'ID de elemento duplicado: "{id}"',"compile.unknownKind":'Tipo de elemento desconhecido kind="{kind}"',"compile.invalidTermRef":'Referência de terminal inválida "{ref}"',"compile.elementMissing":'Referência a um elemento desconhecido "{id}"',"compile.missingPin":'O elemento "{id}" (kind={kind}) não possui o pino "{pin}"; disponíveis: {available}',"compile.singleTerminal":"O nó possui apenas um terminal — ignorado","compile.layoutMissingElement":'A chave de layout "{id}" referencia um elemento desconhecido',"compile.elementUnconnected":'O elemento "{id}" não possui nenhuma conexão',"cat.busbar":"Barramento / fiação","cat.switching":"Manobra","cat.protection":"Proteção","cat.motor-control":"Controle de motores","cat.transformer":"Transformador","cat.instrument-transformer":"Transformador de instrumento","cat.measurement":"Medição","cat.source":"Fonte","cat.load":"Carga","cat.storage":"Armazenamento","cat.compensation":"Compensação","cat.grounding":"Aterramento","cat.renewable":"Renováveis / eletrônica de potência","onboard.title":"Início rápido","onboard.step1.title":"Posicione um componente","onboard.step1.body":"Escolha a ferramenta Posicionar (P) e arraste um tipo da biblioteca até a tela","onboard.step2.title":"Conecte os fios","onboard.step2.body":"Use a ferramenta Fio (W): arraste de um pino a outro — arraste até um espaço vazio para criar uma junção","onboard.step3.title":"Um barramento é um trilho compartilhado, não um fio","onboard.step3.body":"Use a ferramenta Barramento (B) somente quando vários circuitos compartilham o mesmo trilho. Não use um barramento para ligar dois dispositivos — apenas conecte os pinos (W).","onboard.dismiss":"Entendi"},e$={"arc-suppression-coil.name":"Bobina de supressão de arco","arrester.name":"Para-raios (FBL)","async-motor.name":"Motor de indução","autotransformer.name":"Autotransformador","battery.name":"Armazenamento em bateria","breaker.name":"Disjuntor (QF)","busbar.name":"Segmento de barramento","converter-bidir.name":"Conversor bidirecional (PCS)","dc-dc-converter.name":"Conversor CC/CC","mppt.name":"Controlador MPPT","ct.name":"Transformador de corrente (CT)","disconnector.name":"Seccionador (QS)","earth.name":"Terra","earthing-switch.name":"Chave de aterramento (QE)","fuse.name":"Fusível (FU)","generator.name":"Gerador (G)","grid-source.name":"Fonte da rede","grounding-transformer.name":"Transformador de aterramento (zig-zag)","inverter.name":"Inversor (CC→CA)","load-switch.name":"Chave de carga","load.name":"Carga","luminaire.name":"Luminária (carga de iluminação)","panelboard.name":"Quadro de distribuição","ngr.name":"Resistor de aterramento de neutro (NGR)","pt.name":"Transformador de tensão (PT)","pv.name":"Módulo fotovoltaico","rectifier.name":"Retificador (CA→CC)","series-reactor.name":"Reator série","shunt-capacitor.name":"Capacitor em derivação","shunt-reactor.name":"Reator em derivação","sync-motor.name":"Motor síncrono","transformer-2w.name":"Transformador de dois enrolamentos","transformer-3w.name":"Transformador de três enrolamentos","wind-turbine.name":"Aerogerador","gfci-breaker.name":"Disjuntor GFCI (RCBO)","rcd.name":"Dispositivo de corrente residual (RCD)","recloser.name":"Religador","energy-meter.name":"Medidor de energia (Wh)","voltmeter.name":"Voltímetro (V)","ammeter.name":"Amperímetro (A)","wattmeter.name":"Wattímetro (W)","frequency-meter.name":"Frequencímetro (Hz)","contactor.name":"Contator (KM)","motor-starter.name":"Chave de partida de motor","thermal-overload.name":"Relé de sobrecarga térmica","vfd.name":"Inversor de frequência (VFD)","soft-starter.name":"Chave de partida suave","transfer-switch.name":"Chave de transferência (ATS)","dc-disconnector.name":"Seccionador CC","dc-combiner.name":"Caixa combinadora CC","ev-charger.name":"Carregador de veículo elétrico (VE)","arc-suppression-coil.desc":"Aterramento ressonante de neutro: indutor ligado à terra","busbar.desc":"Segmento de barramento único e extensível, com múltiplas derivações","converter-bidir.desc":"Conversor de armazenamento: CA ↔ CC bidirecional","dc-dc-converter.desc":"Conversor CC/CC / carregador CC (IEC 60617)","mppt.desc":"Controlador de carga solar MPPT (CC/CC, rastreamento do ponto de máxima potência)","earthing-switch.desc":"Seccionador + conexão à terra, porta única","grid-source.desc":"Barramento infinito / rede externa","grounding-transformer.desc":"Transformador estrela-zigue-zague para aterramento de neutro","load.desc":"Carga abstrata (seta de saída de corrente)","luminaire.desc":"Carga de iluminação (símbolo geral de luminária IEC 60617)","ngr.desc":"Aterramento de baixa resistência: neutro do transformador à terra","series-reactor.desc":"Mesmo símbolo do reator em derivação; diferenciado pelo uso","wind-turbine.desc":"Aerogerador: gerador + marca de rotor de três pás","gfci-breaker.desc":"Disjuntor de corrente residual com proteção contra sobrecorrente (UL943 / IEC 61009). GFCI na América do Norte / RCBO na Europa.","rcd.desc":"Disjuntor de corrente residual sem proteção contra sobrecorrente (IEC 61008).","recloser.desc":"Religador automático de média tensão.","energy-meter.desc":"Medidor de energia ativa (kWh) — entrada de serviço / submedição.","contactor.desc":"Contator de circuito principal; normalmente usado com um relé de sobrecarga térmica e um motor.","motor-starter.desc":"Chave de partida de motor (símbolo geral IEC 60617).","thermal-overload.desc":"Relé de sobrecarga térmica do motor; posicionado entre o contator e o motor.","vfd.desc":"Inversor de frequência (Variable Frequency Drive) para controle de velocidade de motores de indução.","soft-starter.desc":"Chave de partida suave do motor (partida a tensão reduzida com tiristores).","transfer-switch.desc":"Chave de transferência de duas fontes (ATS / manual). Duas entradas de fonte + uma saída de carga, com intertravamento mecânico.","dc-disconnector.desc":"Seccionador CC — isolamento do lado CC de string fotovoltaica / bateria.","dc-combiner.desc":"Caixa combinadora de strings fotovoltaicos (exemplo com 4 entradas).","ev-charger.desc":"Estação de recarga de veículos elétricos.","breaker.state.open":"Aberto","disconnector.state.open":"Aberto","earthing-switch.state.open":"Aberto","fuse.state.blown":"Queimado","load-switch.state.open":"Aberto","gfci-breaker.state.open":"Aberto","rcd.state.open":"Aberto","recloser.state.open":"Aberto","contactor.state.open":"Aberto","thermal-overload.state.tripped":"Atuado","transfer-switch.state.position":"Posição (normal/emergência/desligado)","dc-disconnector.state.open":"Aberto","battery.param.E":"Capacidade","busbar.param.Un":"Tensão nominal","converter-bidir.param.S":"Capacidade","dc-dc-converter.param.P":"Potência","mppt.param.I":"Corrente nominal","load.param.P":"Potência ativa","load.param.cosphi":"Fator de potência","ngr.param.R":"Resistência","shunt-capacitor.param.Q":"Potência reativa","shunt-capacitor.param.stages":"Estágios","transformer-2w.param.S":"Capacidade","transformer-2w.param.ratio":"Relação de transformação","gfci-breaker.param.In":"Corrente nominal","panelboard.param.In":"Corrente nominal","gfci-breaker.param.IDn":"Corrente residual de atuação","rcd.param.IDn":"Corrente residual de atuação","breaker.param.In":"Corrente nominal","breaker.param.poles":"Polos","breaker.param.Icu":"Capacidade de interrupção","disconnector.param.In":"Corrente nominal","fuse.param.In":"Corrente nominal","resistor.name":"Resistor (R)","capacitor.name":"Capacitor (C)","diode.name":"Diodo (D)","indicator-light.name":"Lâmpada de sinalização (HL)","push-button.name":"Botoeira (SB)","relay-coil.name":"Bobina de relé (KA)","make-contact.name":"Contato normalmente aberto (NO)","break-contact.name":"Contato normalmente fechado (NC)","bell.name":"Campainha (HA)","terminal.name":"Terminal / junção (X)","fuse-switch-disconnector.name":"Chave seccionadora-fusível","socket-outlet.name":"Tomada / conector","inductor.name":"Indutor (L)","voltage-regulator.name":"Regulador de tensão (T)","dc-motor.name":"Motor CC (M)","heater.name":"Elemento de aquecimento (EH)","selector-switch.name":"Chave seletora (SA)","limit-switch.name":"Chave fim de curso (SQ)","proximity-switch.name":"Chave de proximidade (SQ)","time-relay.name":"Relé temporizador (KT)","buzzer.name":"Zumbidor (HA)","siren.name":"Sirene (HA)","thermocouple.name":"Termopar (BT)","thyristor.name":"Tiristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diodo zener (D)","igbt.name":"IGBT","plc.name":"CLP / controlador","ups.name":"No-break (UPS)","power-supply.name":"Fonte de alimentação (PS)","genset.name":"Grupo gerador (G)","protective-relay.name":"Relé de proteção","overcurrent-relay.name":"Relé de sobrecorrente (50/51)","undervoltage-relay.name":"Relé de subtensão (27)","reverse-power-relay.name":"Relé de potência reversa (32)","distance-relay.name":"Relé de distância (21)","phase-failure-relay.name":"Relé de falta de fase","buchholz-relay.name":"Relé Buchholz (63)","power-factor-meter.name":"Medidor de fator de potência (cosφ)","synchronoscope.name":"Sincronoscópio","varmeter.name":"Varímetro (var)","resistor.desc":"Resistor geral / limitador de corrente / resistor de frenagem.","capacitor.desc":"Capacitor geral / de filtro / do barramento CC. Use o capacitor em derivação para correção do fator de potência.","diode.desc":"Diodo retificador / de roda livre / de proteção. t1 = ânodo (topo), t2 = cátodo (base).","indicator-light.desc":"Lâmpada de sinalização / indicação de status.","push-button.desc":"Botoeira manual, retorno automático (contato NA).","relay-coil.desc":"Bobina de acionamento de relé / contator (caixa).","make-contact.desc":"Contato auxiliar normalmente aberto (NA).","break-contact.desc":"Contato auxiliar normalmente fechado (NF).","bell.desc":"Campainha de sinalização / alarme.","terminal.desc":"Terminal / caixa de junção / nó de conexão.","fuse-switch-disconnector.desc":"Chave seccionadora-fusível sob carga.","socket-outlet.desc":"Tomada de energia / conector multipolar.","inductor.desc":"Indutor geral / bobina / reator.","voltage-regulator.desc":"Regulador de tensão ajustável do tipo indução / autotransformador.","dc-motor.desc":"Motor CC (símbolo geral de campo série).","heater.desc":"Elemento resistivo de aquecimento / carga térmica.","selector-switch.desc":"Chave seletora / comutadora (rotativa, com retenção de posição).","limit-switch.desc":"Chave fim de curso / de posição (NA, acionamento mecânico).","proximity-switch.desc":"Sensor de proximidade / chave de proximidade sem contato.","time-relay.desc":"Bobina de relé temporizado (de operação retardada).","buzzer.desc":"Zumbidor de sinalização.","siren.desc":"Sirene sonora / de alarme.","thermocouple.desc":"Sensor de temperatura por termopar.","thyristor.desc":"Tiristor triodo de bloqueio reverso / SCR. t1 = ânodo (topo), t2 = cátodo (base).","triac.desc":"Tiristor triodo bidirecional (TRIAC).","zener-diode.desc":"Diodo zener / regulador de tensão. t1 = ânodo (topo), t2 = cátodo (base).","igbt.desc":"IGBT de canal N, modo intensificação. t1 = coletor (topo), t2 = emissor (base), t_g = gate.","plc.desc":"Controlador lógico programável (CLP).","ups.desc":"No-break online / standby (fonte de alimentação ininterrupta).","power-supply.desc":"Fonte chaveada CA→CC / fonte CC. t_ac no topo (~), t_dc na base (=).","genset.desc":"Grupo gerador a diesel / gás.","protective-relay.desc":"Relé de medição / proteção, símbolo geral (IEC 60617).","overcurrent-relay.desc":"Relé de proteção de sobrecorrente (ANSI 50/51).","undervoltage-relay.desc":"Relé de proteção de subtensão (ANSI 27).","reverse-power-relay.desc":"Relé de proteção de potência reversa / corrente reversa (ANSI 32).","distance-relay.desc":"Relé de proteção de distância / subimpedância (ANSI 21).","phase-failure-relay.desc":"Relé de proteção de falta de fase / perda de fase.","buchholz-relay.desc":"Relé Buchholz / relé de gás (ANSI 63).","power-factor-meter.desc":"Medidor de fator de potência (cosφ).","synchronoscope.desc":"Indicador de sincronismo / sincronoscópio.","varmeter.desc":"Medidor de potência reativa (var).","make-contact.state.closed":"Fechado","break-contact.state.open":"Aberto","on-delay-make-contact.name":"Contato NO temporizado na energização (KT)","off-delay-make-contact.name":"Contato NO temporizado na desenergização (KT)","on-delay-break-contact.name":"Contato NC temporizado na energização (KT)","off-delay-break-contact.name":"Contato NC temporizado na desenergização (KT)","continuation-out.name":"Continuação (saída)","continuation-in.name":"Continuação (chegada)","on-delay-make-contact.desc":"Contato de temporizador normalmente aberto: fecha com atraso ao energizar a bobina (IEC 60617-07-05-01).","off-delay-make-contact.desc":"Contato de temporizador normalmente aberto: abre com atraso ao desenergizar a bobina (IEC 60617-07-05-02).","on-delay-break-contact.desc":"Contato de temporizador normalmente fechado: abre com atraso ao energizar a bobina (IEC 60617-07-05-03).","off-delay-break-contact.desc":"Contato de temporizador normalmente fechado: fecha com atraso ao desenergizar a bobina (IEC 60617-07-05-04).","continuation-out.desc":"Referência a outra folha: o fio é interrompido aqui e continua em outro lugar. Continuações com o mesmo nome são o mesmo fio.","continuation-in.desc":"Referência a outra folha: um fio que vem de outro lugar continua aqui. Continuações com o mesmo nome são o mesmo fio.","on-delay-make-contact.state.closed":"Fechado","on-delay-make-contact.param.delay":"Atraso","off-delay-make-contact.state.closed":"Fechado","off-delay-make-contact.param.delay":"Atraso","on-delay-break-contact.state.open":"Aberto","on-delay-break-contact.param.delay":"Atraso","off-delay-break-contact.state.open":"Aberto","off-delay-break-contact.param.delay":"Atraso","continuation-out.param.target":"Continua em","continuation-in.param.target":"Vem de","async-motor.param.P":"Potência","sync-motor.param.P":"Potência","dc-motor.param.P":"Potência","ev-charger.param.P":"Potência","socket-outlet.param.P":"Potência","luminaire.param.P":"Potência","fuse-switch-disconnector.state.open":"Aberto","selector-switch.state.open":"Aberto","limit-switch.state.closed":"Fechado","resistor.param.R":"Resistência","resistor.param.P":"Potência nominal","capacitor.param.C":"Capacitância","capacitor.param.Un":"Tensão nominal","indicator-light.param.color":"Cor","inductor.param.L":"Indutância","inductor.param.In":"Corrente nominal","voltage-regulator.param.ratio":"Faixa de regulação","heater.param.P":"Potência","ups.param.S":"Capacidade","power-supply.param.Vdc":"Tensão de saída","genset.param.P":"Potência"},t$={ui:Jj,library:e$},n$={"common.unnamed":"無題","common.close":"閉じる","common.yes":"はい","common.no":"いいえ","topbar.theme.toLight":"ライトモードに切り替え","topbar.theme.toDark":"ダークモードに切り替え","topbar.theme.currentDark":"現在:ダークテーマ","topbar.theme.currentLight":"現在:ライトテーマ","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"現在:中国語","topbar.export.label":"エクスポート","topbar.export.tooltip":"SVGベクター(編集可能)、PNGビットマップ(2倍高精細)、またはDXF(CAD用)","topbar.export.pngFailed":"PNGのエクスポートに失敗しました:{err}","topbar.export.dxfFailed":"DXFのエクスポートに失敗しました:{err}","topbar.file.label":"ファイル","topbar.file.tooltip":"ローカルの .json 図面を開く、保存、または名前を付けて保存","topbar.file.current":"現在:{name}","topbar.file.new":"新規","topbar.file.open":"開く…","topbar.file.save":"保存","topbar.file.saveAs":"名前を付けて保存…","topbar.file.newConfirm":"新規作成すると保存されていない変更は破棄されます。続行しますか?","topbar.file.openFailed":"開けませんでした:{err}","topbar.file.saveFailed":"保存に失敗しました:{err}","topbar.file.fileDescription":"OneLineEditor 図面","outline.title":"アウトライン","outline.collapse":"折りたたむ","outline.collapseAria":"アウトラインを折りたたむ","outline.empty":"(要素がありません — ライブラリからドラッグして開始)","props.title":"プロパティ","props.node":"電気ノード","props.wire":"配線","props.bus":"母線","props.junction":"接続点","props.junctionPos":"位置","props.nSelected":"{n} 個選択中","props.empty":"選択なし","props.multi":"{n} 個のオブジェクトを選択中","props.name":"名前","props.note":"メモ","props.label":"ラベル","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"電気ノード {id} が見つかりません","props.wireNotFound":"配線 {id} が見つかりません","props.nodeStats":"端子 {terminals} 個 · 要素 {elements} 個","props.selectElement":"{label} を選択","props.selectWholeNode":"電気ノード全体を選択","props.annText":"テキスト","props.annRect":"矩形","props.annEllipse":"楕円","props.annLine":"線","props.annTable":"表","props.annNotFound":"注釈 {id} が見つかりません","props.annLabel":"ラベル","props.annLabelPlaceholder":"例:配電盤 1","props.color":"色","props.size":"サイズ","props.sizeReset":"100% に戻す","props.labelShown":"表示","props.labelHidden":"非表示","props.contactType":"接点","props.direction":"方向","props.directionOut":"出","props.directionIn":"入","props.partner":"相手","props.partnerUnnamed":"名前を付けると同じ名前のシート間接続と対になります","props.partnerNone":"この図面には相手がありません","props.partnerJump":"{id} へ移動","health.title":"チェック","health.hint":"接続と給電のチェック:ヒントと概算で、規格適合の審査ではありません","health.markers":"図面に表示","health.none":"問題は見つかりませんでした","health.sectionProblems":"問題","health.sectionNotes":"メモ","health.sectionDismissed":"意図的としてマーク済み","health.sectionLoads":"負荷集計","health.dismiss":"意図的","health.restore":"元に戻す","health.loadKnown":"既知 {kw} kW({k}/{t} 負荷)","health.loadAll":"{kw} kW({t} 負荷)","health.label.unwired":"未接続","health.label.looks-joined":"接続に見えるが未接続","health.label.dangling-wire":"配線の端が未接続","health.label.supply-disconnected":"電源が未接続","health.label.unsupplied":"電源までの経路なし","health.label.no-origin":"電源記号なし","health.label.voltage-mix":"異なる電圧が直結","health.label.ratio-mismatch":"変圧比が不一致","health.label.label-mismatch":"名前とパラメータ","health.label.overload":"定格超過","health.label.feeder-end":"フィーダの終端","health.label.open-side":"電源側が未接続","health.introTitle":"図面チェック","health.intro":"この図面の接続に {n} 件の問題の可能性が見つかりました。点が場所を示しています。配線からのヒントで、規格審査ではありません。","health.introShow":"見る","health.introOk":"OK","health.loading":"負荷率 {pct}%(定格 {rating} kVA)","health.disclaimer":"図面の接続関係から出したヒントと概算で、規格適合のチェックではありません。","health.overloadUnits":"定格の10倍を超えています。負荷の単位を確認してください(汎用負荷の P は MW 単位)。","health.code.unwired":"{name} が接続されていません。線に触れているだけでは接続になりません。端子まで配線してください。","health.code.looks-joined":"ここで配線が別の接続点の上で止まっていますが、つながっていません。接続されているように見えますが、実際は未接続です。","health.code.dangling-wire":"ここで配線の端がどこにも接続されていません。","health.code.supply-disconnected":"{name} が図面のほかの部分とつながっていません。{total} 台中 {count} 台の機器に電源までの経路がありません。","health.code.unsupplied":"ここにある {count} 台の機器には、どの電源までの経路もありません。","health.code.no-origin":"この図面には電源記号がありません。系統や発電機を追加すると、給電経路のチェックと負荷集計ができます。","health.code.voltage-mix":"ここで {a} kV と {b} kV が変圧器を介さずにつながっています。","health.code.ratio-mismatch":"{name}:変圧比 {ratio} が両側の母線電圧({a} kV / {b} kV)と合いません。","health.code.label-mismatch":"{name}:名前とパラメータ {param}({value})が一致しません。","health.code.overload":"{name}:既知の負荷 {load} kVA が定格 {rating} kVA を超えています(全負荷が同時に定格運転する前提)。","health.code.feeder-end":"{name}:フィーダはここで終わっています。","health.code.open-side":"{name}:電源側が接続されていません(多くは図面の引込端です)。","props.color.default":"既定","props.color.red":"赤","props.color.amber":"橙","props.color.green":"緑","props.color.blue":"青","props.color.gray":"グレー","props.annStroke":"線種","props.annStrokeSolid":"実線","props.annStrokeDashed":"破線","props.annStrokeDotted":"点線","props.annStrokeWidth":"線の太さ","props.annWidthThin":"細","props.annWidthMedium":"中","props.annWidthThick":"太","props.annFill":"塗りつぶし","props.annFillNone":"なし","props.annFillTint":"淡色","props.annArrow":"矢印","props.annArrowNone":"なし","props.annArrowEnd":"片側","props.annArrowBoth":"両側","props.annFontSize":"フォントサイズ","props.annRows":"行数","props.annCols":"列数","view.zoomOut":"ズームアウト","view.zoomOutHint":"段階的にズームアウト。ホイール ↓ や ⌘− でも可","view.reset":"100% にリセット","view.current":"現在 {z}%","view.zoomIn":"ズームイン","view.zoomInHint":"段階的にズームイン。ホイール ↑ や ⌘+ でも可","view.fit":"全体表示","view.fitHint":"図面全体を自動でズームして中央に配置","view.gridHide":"グリッドを非表示","view.gridShow":"グリッドを表示","view.gridHotkey":"G","view.gridHideHint":"グリッドへのスナップも無効化(自由配置)","view.gridShowHint":"グリッドへのスナップも有効化(ドラッグ時に10pxにスナップ)","view.gridHideAria":"グリッドを非表示にしてスナップを無効化","view.gridShowAria":"グリッドを表示してスナップを有効化","view.label":"ラベル","view.labelOff":"オフ","view.labelId":"ID","view.labelAll":"ID + パラメータ","view.labelHint":"ラベルの表示と文字サイズ(書き出しにも反映)","view.labelSize":"サイズ","view.labelSizeSmaller":"ラベルを小さく","view.labelSizeLarger":"ラベルを大きく","view.standard":"シンボル規格","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"シンボルの描き方だけが変わります。結線・位置・定格はそのままです。遮断器とヒューズが規格間で異なります。","view.labelSizeReset":"既定のサイズに戻す","library.title":"ライブラリ","tool.draw":"作図","tool.drawHint":"テキスト・枠・円・線・表 — 図面上の自由な注記","library.empty":"該当する要素がありません","cat.custom":"この図面で定義","library.customTag":"独自","library.customHint":"この図面が持つ部品 — 他の人のライブラリにはありません","library.createComponent":"新しい部品…","library.searchPlaceholder":"要素を検索…","library.searchAria":"要素を検索","library.clearSearch":"検索をクリア","library.itemHint":"クリックで配置モードに入る、またはキャンバスへドラッグ","tool.select":"選択","tool.selectHint":"クリックで選択、範囲選択で複数選択、右クリックでメニュー","tool.pan":"パン","tool.panHint":"キャンバスをドラッグ。スペースキーで一時的に切替","tool.wire":"配線","tool.wireHint":"ピン/母線/接続点からドラッグ。空白部分へドロップすると接続点を新設、配線上へドロップすると分岐点を作成","tool.bus":"母線","tool.busHint":"キャンバス上でドラッグ — 押下で始点、離すと終点を設定","tool.junction":"接続点","tool.junctionHint":"キャンバスをクリックして接続点(ノード)を配置。配線を自由に接続可能","tool.place":"配置","tool.placeHint":"クリックで配置。端子/母線からドラッグすると配置と同時に接続","tool.text":"テキスト","tool.textHint":"キャンバスをクリックしてテキスト注釈を配置。既存の注釈はダブルクリックで編集","tool.rect":"矩形","tool.rectHint":"ドラッグで矩形/グループ枠を描画(既定は破線)。Shiftで正方形","tool.ellipse":"楕円","tool.ellipseHint":"ドラッグで楕円を描画。Shift で正円になります","tool.line":"線","tool.lineHint":"ドラッグで注釈線を描画。Shiftで45°に固定。矢印はパネルで設定","tool.table":"表","tool.tableHint":"ドラッグで列×行を指定(リアルタイム表示)、またはクリックで既定サイズの表を配置。セルはダブルクリックで入力","mode.selectWithSel":"要素をドラッグして移動 · 端子をドラッグして配線 · 右クリックでメニュー","mode.selectEmpty":"クリックで選択 · ドラッグで移動 · 範囲選択で複数選択 · 右クリックでメニュー","mode.pan":"キャンバスをドラッグ · スクロールでズーム · どのツールでもスペース長押しでパン","mode.wireDragging":"ピン/母線/接続点上で離す。空白部分で離すと接続点を新設","mode.wireInit":"任意の接続点または空白部分を押下し、目標にドラッグして離す","mode.busDragging":"ドラッグで母線の方向を決定。離すと終点を設定","mode.busInit":"キャンバスを押下して始点を設定し、ドラッグして終点で離す","mode.junction":"キャンバスをクリックして接続点を配置","mode.placeNoKind":"左側のライブラリから要素の種類を選択してください","mode.placeFromTerm":"目標位置で離すと、新しい要素が元の端子に接続されます","mode.placeNormal":"空白部分をクリックして配置。端子/母線からドラッグすると配置と同時に接続","mode.text":"クリックでテキストを配置 · ダブルクリックで編集 · 選択してドラッグで移動 · Delで削除","mode.rect":"ドラッグで矩形を描画 · Shiftで正方形 · 離した後にサイズ変更やラベル設定が可能","mode.ellipse":"ドラッグで楕円を描画 · Shift で正円 · 離した後にサイズ変更・色変更・ラベル設定が可能","mode.line":"ドラッグで線を描画 · Shiftで45°に固定 · 離した後にパネルで矢印を追加","mode.table":"ドラッグでマス目を指定、またはクリックで3×3の表を配置 · セルはダブルクリックで入力","mode.annTextSel":"テキストをクリックして編集 · ドラッグで移動 · Delで削除","mode.annTableSel":"セルをクリックして入力 · ドラッグで移動 · Delで削除","mode.annShapeSel":"ドラッグで移動 · ハンドルをドラッグしてサイズ変更 · パネルでスタイルを変更 · Delで削除","mode.annEditing":"入力 · Enterで確定 · Escでキャンセル · または ✓ / ✕ ボタン","mode.escSelect":"Escで選択を解除","mode.escOther":"右クリック/Escでキャンセル","tool.placeNoKindTooltip":"左側のライブラリで種類を選択してから、キャンバスをクリック","tool.undo":"元に戻す","tool.undoHint":"直前の編集を元に戻す(移動/回転/削除など)","tool.redo":"やり直す","tool.redoHint":"元に戻した操作をやり直す","layout.label":"レイアウト","layout.hint":"図面全体または選択部分を自動レイアウトし、空きを埋める","layout.allAuto":"すべて自動レイアウト","layout.selAuto":"選択部分を自動レイアウト","layout.allFill":"未配置を埋める","layout.selFill":"選択部分の未配置を埋める","tool.more":"その他","tool.moreHint":"元に戻す/やり直す/レイアウト","view.menu":"表示","view.menuHint":"ズーム・全体表示・グリッド","ctx.ariaNode":"ノード操作","ctx.ariaWire":"配線操作","ctx.ariaElement":"要素操作","ctx.ariaEdit":"編集操作","ctx.done":"完了","ctx.cancel":"キャンセル","ctx.rotate":"90°回転","ctx.rotateHint":"選択部分を時計回りに回転。配線は新しい端子位置に合わせて再配線","ctx.mirror":"左右反転","ctx.mirrorTitle":"反転","ctx.mirrorHint":"選択部分を左右反転","ctx.delete":"削除","ctx.color":"色","ctx.colorDefault":"既定","ctx.colorRed":"赤","ctx.colorAmber":"琥珀","ctx.colorGreen":"緑","ctx.colorBlue":"青","ctx.colorGray":"グレー","ctx.deleteHintNode":"このノードのすべての配線を切断(要素は残る)","ctx.deleteHintWire":"この配線のみを削除(同じノードの他の配線は残る)","ctx.deleteHintElement":"選択部分とその配線を削除","ctx.resetWirePath":"自動配線に戻す","ctx.resetWirePathHint":"手動で調整した折れ点を破棄し、自動ルーティングで再描画","menu.undo":"元に戻す","menu.redo":"やり直す","menu.cut":"切り取り","menu.copy":"コピー","menu.paste":"貼り付け","menu.rotate":"90°回転","menu.mirror":"反転","menu.resetLabel":"ラベル位置をリセット","menu.selectAll":"すべて選択","menu.disconnect":"この配線を切断","menu.delete":"削除","io.parseFailed":"JSONの解析に失敗しました:{err}","io.notObject":"ファイルがJSONオブジェクトではありません","io.versionMismatch":'バージョン不一致:"1" が必要ですが、{actual} でした',"io.elementsMissing":"`elements` が存在しないか、配列ではありません","compile.duplicateId":'要素IDが重複しています:"{id}"',"compile.unknownKind":'不明な要素種別 kind="{kind}"',"compile.invalidTermRef":'無効な端子参照 "{ref}"',"compile.elementMissing":'存在しない要素への参照 "{id}"',"compile.missingPin":'要素 "{id}"(kind={kind})にピン "{pin}" がありません。使用可能:{available}',"compile.singleTerminal":"ノードに端子が1つしかないため無視されました","compile.layoutMissingElement":'layoutキー "{id}" が存在しない要素を参照しています',"compile.elementUnconnected":'要素 "{id}" に接続がありません',"cat.busbar":"母線/配線","cat.switching":"開閉器","cat.protection":"保護","cat.motor-control":"電動機制御","cat.transformer":"変圧器","cat.instrument-transformer":"計器用変成器","cat.measurement":"計測","cat.source":"電源","cat.load":"負荷","cat.storage":"蓄電","cat.compensation":"無効電力補償","cat.grounding":"接地","cat.renewable":"再生可能エネルギー/パワーエレクトロニクス","onboard.title":"クイックスタート","onboard.step1.title":"部品を配置","onboard.step1.body":"配置ツール(P)を選び、ライブラリから種類をキャンバスへドラッグ","onboard.step2.title":"配線する","onboard.step2.body":"配線ツール(W)を使用:ピンから別のピンへドラッグ。空白部分へドラッグすると接続点を新設","onboard.step3.title":"母線は共用レールであり、配線ではありません","onboard.step3.body":"複数の回路が1本のレールを共有する場合のみ母線ツール(B)を使用してください。2つの機器をつなぐために母線を使わないでください — 配線ツール(W)でピン同士を直接つないでください。","onboard.dismiss":"了解"},o$={"arc-suppression-coil.name":"消弧コイル","arrester.name":"避雷器 (FBL)","async-motor.name":"誘導電動機","autotransformer.name":"単巻変圧器","battery.name":"蓄電池","breaker.name":"遮断器 (QF)","busbar.name":"母線区間","converter-bidir.name":"双方向コンバータ (PCS)","dc-dc-converter.name":"DC/DCコンバータ","mppt.name":"MPPTコントローラ","ct.name":"変流器 (CT)","disconnector.name":"断路器 (QS)","earth.name":"接地","earthing-switch.name":"接地開閉器 (QE)","fuse.name":"ヒューズ (FU)","generator.name":"発電機 (G)","grid-source.name":"系統電源","grounding-transformer.name":"接地変圧器(ジグザグ結線)","inverter.name":"インバータ (DC→AC)","load-switch.name":"負荷開閉器","load.name":"負荷","luminaire.name":"照明器具(照明負荷)","panelboard.name":"分電盤","ngr.name":"中性点接地抵抗器 (NGR)","pt.name":"計器用変圧器 (PT)","pv.name":"太陽電池モジュール","rectifier.name":"整流器 (AC→DC)","series-reactor.name":"直列リアクトル","shunt-capacitor.name":"並列コンデンサ","shunt-reactor.name":"並列リアクトル","sync-motor.name":"同期電動機","transformer-2w.name":"二巻線変圧器","transformer-3w.name":"三巻線変圧器","wind-turbine.name":"風力発電機","gfci-breaker.name":"漏電遮断器 (RCBO)","rcd.name":"漏電遮断器 (RCD)","recloser.name":"リクローザ","energy-meter.name":"電力量計 (Wh)","voltmeter.name":"電圧計 (V)","ammeter.name":"電流計 (A)","wattmeter.name":"電力計 (W)","frequency-meter.name":"周波数計 (Hz)","contactor.name":"電磁接触器 (KM)","motor-starter.name":"電動機始動器","thermal-overload.name":"熱動過負荷継電器","vfd.name":"可変周波数ドライブ (VFD)","soft-starter.name":"ソフトスターター","transfer-switch.name":"自動切替開閉器 (ATS)","dc-disconnector.name":"直流断路器","dc-combiner.name":"直流接続箱","ev-charger.name":"EV充電器","arc-suppression-coil.desc":"共振接地方式:中性点と大地間にリアクトルを接続","busbar.desc":"複数の分岐に対応する伸縮可能な単一母線区間","converter-bidir.desc":"蓄電用コンバータ:双方向 AC ↔ DC 変換","dc-dc-converter.desc":"DC/DCコンバータ/直流充電器(IEC 60617)","mppt.desc":"MPPT太陽光充電コントローラ(DC/DC、最大電力点追従)","earthing-switch.desc":"断路器と接地接続を兼ねる単一ポート機器","grid-source.desc":"無限大母線/外部系統","grounding-transformer.desc":"中性点接地用のスター・ジグザグ結線変圧器","load.desc":"抽象負荷(電流流出方向の矢印)","luminaire.desc":"照明負荷(IEC 60617 照明器具一般図記号)","ngr.desc":"低抵抗接地:変圧器中性点と大地間に接続","series-reactor.desc":"並列リアクトルと同一記号。用途によって区別","wind-turbine.desc":"風力発電機:発電機と三枚羽根ローターの記号","gfci-breaker.desc":"過電流保護付き漏電遮断器(UL943 / IEC 61009)。北米ではGFCI、欧州ではRCBOと呼ばれる。","rcd.desc":"過電流保護なしの漏電遮断器(IEC 61008)。","recloser.desc":"中電圧用自動再閉路装置。","energy-meter.desc":"有効電力量計(kWh)— 引込口/子メーター用。","contactor.desc":"主回路用電磁接触器。通常、熱動過負荷継電器や電動機と組み合わせて使用。","motor-starter.desc":"電動機始動器(IEC 60617 一般記号)。","thermal-overload.desc":"電動機用熱動過負荷継電器。接触器と電動機の間に設置。","vfd.desc":"誘導電動機の速度制御用可変周波数ドライブ。","soft-starter.desc":"電動機用ソフトスターター(サイリスタによる低電圧始動方式)。","transfer-switch.desc":"二電源切替開閉器(自動/手動)。2つの電源入力と1つの負荷出力を持ち、機械的にインターロックされる。","dc-disconnector.desc":"直流断路器 — 太陽光ストリングや蓄電池の直流側を切り離す。","dc-combiner.desc":"太陽光ストリング用接続箱(4入力の例)。","ev-charger.desc":"電気自動車用充電ステーション。","breaker.state.open":"開","disconnector.state.open":"開","earthing-switch.state.open":"開","fuse.state.blown":"溶断","load-switch.state.open":"開","gfci-breaker.state.open":"開","rcd.state.open":"開","recloser.state.open":"開","contactor.state.open":"開","thermal-overload.state.tripped":"動作","transfer-switch.state.position":"位置(通常/非常用/オフ)","dc-disconnector.state.open":"開","battery.param.E":"容量","busbar.param.Un":"定格電圧","converter-bidir.param.S":"容量","dc-dc-converter.param.P":"電力","mppt.param.I":"定格電流","load.param.P":"有効電力","load.param.cosphi":"力率","ngr.param.R":"抵抗","shunt-capacitor.param.Q":"無効電力容量","shunt-capacitor.param.stages":"段数","transformer-2w.param.S":"容量","transformer-2w.param.ratio":"巻数比","gfci-breaker.param.In":"定格電流","panelboard.param.In":"定格電流","gfci-breaker.param.IDn":"定格感度電流","rcd.param.IDn":"定格感度電流","breaker.param.In":"定格電流","breaker.param.poles":"極数","breaker.param.Icu":"定格遮断容量","disconnector.param.In":"定格電流","fuse.param.In":"定格電流","resistor.name":"抵抗器 (R)","capacitor.name":"コンデンサ (C)","diode.name":"ダイオード (D)","indicator-light.name":"表示灯 (HL)","push-button.name":"押しボタンスイッチ (SB)","relay-coil.name":"リレーコイル (KA)","make-contact.name":"a接点 (NO)","break-contact.name":"b接点 (NC)","bell.name":"ベル (HA)","terminal.name":"端子台/接続点 (X)","fuse-switch-disconnector.name":"ヒューズ付断路器","socket-outlet.name":"コンセント/コネクタ","inductor.name":"インダクタ (L)","voltage-regulator.name":"電圧調整器 (T)","dc-motor.name":"直流電動機 (M)","heater.name":"発熱体 (EH)","selector-switch.name":"切替スイッチ (SA)","limit-switch.name":"リミットスイッチ (SQ)","proximity-switch.name":"近接スイッチ (SQ)","time-relay.name":"タイムリレー (KT)","buzzer.name":"ブザー (HA)","siren.name":"サイレン (HA)","thermocouple.name":"熱電対 (BT)","thyristor.name":"サイリスタ/SCR (V)","triac.name":"トライアック (V)","zener-diode.name":"ツェナーダイオード (D)","igbt.name":"IGBT","plc.name":"PLC/コントローラ","ups.name":"UPS","power-supply.name":"電源装置 (PS)","genset.name":"発電機セット (G)","protective-relay.name":"保護継電器","overcurrent-relay.name":"過電流継電器 (50/51)","undervoltage-relay.name":"不足電圧継電器 (27)","reverse-power-relay.name":"逆電力継電器 (32)","distance-relay.name":"距離継電器 (21)","phase-failure-relay.name":"欠相継電器","buchholz-relay.name":"ブッフホルツ継電器 (63)","power-factor-meter.name":"力率計 (cosφ)","synchronoscope.name":"同期検定器","varmeter.name":"無効電力計 (var)","resistor.desc":"汎用抵抗器/限流抵抗/制動抵抗。","capacitor.desc":"汎用/フィルタ/直流母線用コンデンサ。力率改善には並列コンデンサを使用。","diode.desc":"整流/還流/保護用ダイオード。t1 = アノード(上)、t2 = カソード(下)。","indicator-light.desc":"信号/状態表示灯。","push-button.desc":"手動押しボタン、自動復帰式(a接点)。","relay-coil.desc":"リレー/接触器の操作コイル(箱形記号)。","make-contact.desc":"常開補助接点(a接点)。","break-contact.desc":"常閉補助接点(b接点)。","bell.desc":"信号ベル/警報ベル。","terminal.desc":"端子台/接続箱/接続ノード。","fuse-switch-disconnector.desc":"負荷時開閉可能なヒューズ付断路器。","socket-outlet.desc":"電源コンセント/多極コネクタ。","inductor.desc":"汎用インダクタ/コイル/チョーク。","voltage-regulator.desc":"誘導形/単巻変圧器形の可変電圧調整器。","dc-motor.desc":"直流電動機(直巻界磁の一般記号)。","heater.desc":"抵抗発熱体/加熱負荷。","selector-switch.desc":"切替スイッチ(回転式、保持形)。","limit-switch.desc":"行程/位置スイッチ(a接点、機械操作式)。","proximity-switch.desc":"近接センサー/非接触式近接スイッチ。","time-relay.desc":"限時(動作遅延)リレーコイル。","buzzer.desc":"信号ブザー。","siren.desc":"音響サイレン/警報器。","thermocouple.desc":"熱電対温度センサー。","thyristor.desc":"逆阻止三端子サイリスタ/SCR。t1 = アノード(上)、t2 = カソード(下)。","triac.desc":"双方向三端子サイリスタ(トライアック)。","zener-diode.desc":"ツェナー/定電圧ダイオード。t1 = アノード(上)、t2 = カソード(下)。","igbt.desc":"Nチャネルエンハンスメント形IGBT。t1 = コレクタ(上)、t2 = エミッタ(下)、t_g = ゲート。","plc.desc":"プログラマブルロジックコントローラ(PLC)。","ups.desc":"オンライン/常時商用給電式無停電電源装置。","power-supply.desc":"AC→DCスイッチング/直流電源装置。t_ac は上(~)、t_dc は下(=)。","genset.desc":"ディーゼル/ガス発電機セット。","protective-relay.desc":"計測/保護継電器の一般記号(IEC 60617)。","overcurrent-relay.desc":"過電流保護継電器(ANSI 50/51)。","undervoltage-relay.desc":"不足電圧保護継電器(ANSI 27)。","reverse-power-relay.desc":"逆電力/逆電流保護継電器(ANSI 32)。","distance-relay.desc":"距離/低インピーダンス保護継電器(ANSI 21)。","phase-failure-relay.desc":"欠相保護継電器。","buchholz-relay.desc":"ブッフホルツ/ガス継電器(ANSI 63)。","power-factor-meter.desc":"力率計(cosφ)。","synchronoscope.desc":"同期検定器/同期指示計。","varmeter.desc":"無効電力計(var)。","make-contact.state.closed":"閉","break-contact.state.open":"開","on-delay-make-contact.name":"オンディレー a接点 (KT)","off-delay-make-contact.name":"オフディレー a接点 (KT)","on-delay-break-contact.name":"オンディレー b接点 (KT)","off-delay-break-contact.name":"オフディレー b接点 (KT)","continuation-out.name":"シート間接続(出)","continuation-in.name":"シート間接続(入)","on-delay-make-contact.desc":"タイマ接点(常開):コイル励磁後、設定時間遅れて閉じる (IEC 60617-07-05-01)。","off-delay-make-contact.desc":"タイマ接点(常開):コイル消磁後、設定時間遅れて開く (IEC 60617-07-05-02)。","on-delay-break-contact.desc":"タイマ接点(常閉):コイル励磁後、設定時間遅れて開く (IEC 60617-07-05-03)。","off-delay-break-contact.desc":"タイマ接点(常閉):コイル消磁後、設定時間遅れて閉じる (IEC 60617-07-05-04)。","continuation-out.desc":"ここで線を切り、別の場所へ続けます。同じ名前のシート間接続は同じ線として扱われます。","continuation-in.desc":"別の場所から来た線がここに続きます。同じ名前のシート間接続は同じ線として扱われます。","on-delay-make-contact.state.closed":"閉","on-delay-make-contact.param.delay":"遅延時間","off-delay-make-contact.state.closed":"閉","off-delay-make-contact.param.delay":"遅延時間","on-delay-break-contact.state.open":"開","on-delay-break-contact.param.delay":"遅延時間","off-delay-break-contact.state.open":"開","off-delay-break-contact.param.delay":"遅延時間","continuation-out.param.target":"接続先","continuation-in.param.target":"接続元","async-motor.param.P":"定格電力","sync-motor.param.P":"定格電力","dc-motor.param.P":"定格電力","ev-charger.param.P":"定格電力","socket-outlet.param.P":"定格電力","luminaire.param.P":"定格電力","fuse-switch-disconnector.state.open":"開","selector-switch.state.open":"開","limit-switch.state.closed":"閉","resistor.param.R":"抵抗","resistor.param.P":"定格電力","capacitor.param.C":"静電容量","capacitor.param.Un":"定格電圧","indicator-light.param.color":"色","inductor.param.L":"インダクタンス","inductor.param.In":"定格電流","voltage-regulator.param.ratio":"調整範囲","heater.param.P":"電力","ups.param.S":"容量","power-supply.param.Vdc":"出力電圧","genset.param.P":"電力"},r$={ui:n$,library:o$},a$={"common.unnamed":"Без имени","common.close":"Закрыть","common.yes":"Да","common.no":"Нет","topbar.theme.toLight":"Переключить на светлую","topbar.theme.toDark":"Переключить на тёмную","topbar.theme.currentDark":"Текущая: тёмная тема","topbar.theme.currentLight":"Текущая: светлая тема","topbar.lang.toEnglish":"Переключить на английский","topbar.lang.toChinese":"Переключить на китайский","topbar.lang.currentEnglish":"Текущий: английский","topbar.lang.currentChinese":"Текущий: китайский","topbar.export.label":"Экспорт","topbar.export.tooltip":"Векторный SVG (редактируемый), растровый PNG (2× HiDPI) или DXF (для CAD)","topbar.export.pngFailed":"Не удалось экспортировать PNG: {err}","topbar.export.dxfFailed":"Не удалось экспортировать DXF: {err}","topbar.file.label":"Файл","topbar.file.tooltip":"Открыть локальную схему .json, сохранить или сохранить как","topbar.file.current":"Текущий: {name}","topbar.file.new":"Новый","topbar.file.open":"Открыть…","topbar.file.save":"Сохранить","topbar.file.saveAs":"Сохранить как…","topbar.file.newConfirm":"Создание нового файла отменит все несохранённые изменения. Продолжить?","topbar.file.openFailed":"Не удалось открыть: {err}","topbar.file.saveFailed":"Не удалось сохранить: {err}","topbar.file.fileDescription":"Схема OneLineEditor","outline.title":"Структура","outline.collapse":"Свернуть","outline.collapseAria":"Свернуть структуру","outline.empty":"(Нет элементов — перетащите из библиотеки, чтобы начать)","props.title":"Свойства","props.node":"Электрический узел","props.wire":"Провод","props.bus":"Шина","props.junction":"Соединение","props.junctionPos":"Положение","props.nSelected":"Выбрано: {n}","props.empty":"Ничего не выбрано","props.multi":"Выбрано объектов: {n}","props.name":"Название","props.note":"Заметка","props.label":"Метка","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Электрический узел {id} не найден","props.wireNotFound":"Провод {id} не найден","props.nodeStats":"{terminals} выводов · {elements} элементов","props.selectElement":"Выбрать {label}","props.selectWholeNode":"Выбрать весь электрический узел","props.annText":"Текст","props.annRect":"Прямоугольник","props.annEllipse":"Эллипс","props.annLine":"Линия","props.annTable":"Таблица","props.annNotFound":"Аннотация {id} не найдена","props.annLabel":"Подпись","props.annLabelPlaceholder":"например, Щит №1","props.color":"Цвет","props.size":"Размер","props.sizeReset":"Сбросить до 100 %","props.labelShown":"Показана","props.labelHidden":"Скрыта","props.contactType":"Контакт","props.direction":"Направление","props.directionOut":"Исходящий","props.directionIn":"Входящий","props.partner":"Пара","props.partnerUnnamed":"Задайте имя, чтобы связать с одноимённым переходом","props.partnerNone":"На этой схеме пары нет","props.partnerJump":"Перейти к {id}","health.title":"Проверка","health.hint":"Проверка соединений и питания: подсказки и оценки, а не проверка на соответствие нормам","health.markers":"Показывать на схеме","health.none":"Проблем не найдено","health.sectionProblems":"Проблемы","health.sectionNotes":"Заметки","health.sectionDismissed":"Отмечено как намеренное","health.sectionLoads":"Сводка нагрузок","health.dismiss":"Так задумано","health.restore":"Вернуть","health.loadKnown":"Известно {kw} кВт ({k}/{t} нагрузок)","health.loadAll":"{kw} кВт ({t} нагрузок)","health.label.unwired":"Не подключено","health.label.looks-joined":"Выглядит подключённым, но нет","health.label.dangling-wire":"Свободный конец провода","health.label.supply-disconnected":"Источник не подключён","health.label.unsupplied":"Нет пути к источнику","health.label.no-origin":"Нет источника питания","health.label.voltage-mix":"Соединены разные напряжения","health.label.ratio-mismatch":"Коэффициент не совпадает","health.label.label-mismatch":"Название и параметр","health.label.overload":"Выше номинала","health.label.feeder-end":"Фидер заканчивается здесь","health.label.open-side":"Сторона питания свободна","health.introTitle":"Проверка схемы","health.intro":"Найдено возможных проблем в соединениях схемы: {n}. Точки показывают, где. Это подсказки по соединениям, а не проверка на соответствие нормам.","health.introShow":"Показать","health.introOk":"Понятно","health.loading":"{pct}% от {rating} кВА","health.disclaimer":"Подсказки и оценки по соединениям на схеме, а не проверка на соответствие нормам.","health.overloadUnits":"Больше номинала в 10 раз: проверьте единицы нагрузок (P у обычной нагрузки задаётся в МВт).","health.code.unwired":"{name} не подключён. Касание линии — это не соединение: проведите провод к его клемме.","health.code.looks-joined":"Здесь провод заканчивается на другой точке соединения, но не соединён с ней: выглядит подключённым, но это не так.","health.code.dangling-wire":"Здесь провод заканчивается, ни к чему не подключаясь.","health.code.supply-disconnected":"{name} не соединён с остальной схемой: у {count} из {total} устройств нет пути к источнику питания.","health.code.unsupplied":"У {count} устройств здесь нет пути ни к одному источнику питания.","health.code.no-origin":"На схеме нет источника питания. Добавьте сеть или генератор, чтобы проверить пути питания и увидеть сводку нагрузок.","health.code.voltage-mix":"Здесь {a} кВ и {b} кВ соединены без трансформатора.","health.code.ratio-mismatch":"{name}: коэффициент {ratio} не соответствует шинам с двух сторон ({a} кВ / {b} кВ).","health.code.label-mismatch":"{name}: название и параметр {param} ({value}) не совпадают.","health.code.overload":"{name}: известная нагрузка {load} кВА превышает номинал {rating} кВА (все нагрузки на полной мощности, без коэффициента одновременности).","health.code.feeder-end":"{name}: здесь фидер заканчивается.","health.code.open-side":"{name}: сторона питания не подключена (часто это вводной конец схемы).","props.color.default":"По умолчанию","props.color.red":"Красный","props.color.amber":"Янтарный","props.color.green":"Зелёный","props.color.blue":"Синий","props.color.gray":"Серый","props.annStroke":"Обводка","props.annStrokeSolid":"Сплошная","props.annStrokeDashed":"Пунктирная","props.annStrokeDotted":"Точечная","props.annStrokeWidth":"Толщина","props.annWidthThin":"Тонкая","props.annWidthMedium":"Средняя","props.annWidthThick":"Толстая","props.annFill":"Заливка","props.annFillNone":"Нет","props.annFillTint":"Оттенок","props.annArrow":"Стрелки","props.annArrowNone":"Нет","props.annArrowEnd":"В конце","props.annArrowBoth":"С двух сторон","props.annFontSize":"Размер шрифта","props.annRows":"Строки","props.annCols":"Столбцы","view.zoomOut":"Уменьшить","view.zoomOutHint":"Уменьшение на шаг; также колесо ↓ или ⌘−","view.reset":"Сбросить на 100%","view.current":"Текущий масштаб {z}%","view.zoomIn":"Увеличить","view.zoomInHint":"Увеличение на шаг; также колесо ↑ или ⌘+","view.fit":"Вписать в экран","view.fitHint":"Автоматически масштабировать и центрировать всю схему","view.gridHide":"Скрыть сетку","view.gridShow":"Показать сетку","view.gridHotkey":"G","view.gridHideHint":"Также отключает привязку к сетке (свободное размещение)","view.gridShowHint":"Также включает привязку к сетке (шаг 10 px при перетаскивании)","view.gridHideAria":"Скрыть сетку и отключить привязку","view.gridShowAria":"Показать сетку и включить привязку","view.label":"Подписи","view.labelOff":"Выкл","view.labelId":"ID","view.labelAll":"ID + параметры","view.labelHint":"Видимость и размер подписей (в том числе при экспорте)","view.labelSize":"Размер","view.labelSizeSmaller":"Уменьшить размер подписей","view.labelSizeLarger":"Увеличить размер подписей","view.standard":"Стандарт обозначений","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Меняется только начертание символов — схема соединений, положения и параметры не затрагиваются. Выключатель и предохранитель рисуются по-разному.","view.labelSizeReset":"Сбросить размер подписей","library.title":"Библиотека","tool.draw":"Рисование","tool.drawHint":"Текст, рамки, круги, линии и таблицы — свободные пометки поверх схемы","library.empty":"Нет подходящих элементов","cat.custom":"В этой схеме","library.customTag":"своё","library.customHint":"Определён этой схемой — его нет в чужой библиотеке","library.createComponent":"Новый компонент…","library.searchPlaceholder":"Поиск элементов…","library.searchAria":"Поиск элементов","library.clearSearch":"Очистить поиск","library.itemHint":"Нажмите, чтобы включить режим размещения, или перетащите на холст","tool.select":"Выбор","tool.selectHint":"Клик — выбрать один, рамка — несколько, правая кнопка — меню","tool.pan":"Рука","tool.panHint":"Перетаскивайте холст; пробел временно переключает инструмент","tool.wire":"Провод","tool.wireHint":"Тяните от вывода / шины / точки соединения; в пустое место — создаст точку соединения, на провод — врежется в него","tool.bus":"Шина","tool.busHint":"Тяните по холсту — нажатие задаёт начало, отпускание — конец","tool.junction":"Соединение","tool.junctionHint":"Нажмите на холст, чтобы поставить точку соединения (узел); провода свободно подключаются к ней","tool.place":"Элемент","tool.placeHint":"Нажмите, чтобы разместить; или перетащите от вывода / шины, чтобы разместить и подключить","tool.text":"Текст","tool.textHint":"Нажмите на холст, чтобы добавить текстовую заметку; дважды щёлкните существующую, чтобы изменить","tool.rect":"Прямоугольник","tool.rectHint":"Перетащите, чтобы нарисовать прямоугольник / рамку группы (по умолчанию пунктирную); Shift — квадрат","tool.ellipse":"Эллипс","tool.ellipseHint":"Перетащите, чтобы нарисовать эллипс; Shift — окружность","tool.line":"Линия","tool.lineHint":"Перетащите, чтобы нарисовать линию-аннотацию; Shift — привязка к 45°; стрелки настраиваются в панели","tool.table":"Таблица","tool.tableHint":"Перетащите, чтобы задать столбцы × строки (счётчик в реальном времени), или нажмите для таблицы по умолчанию; дважды щёлкните ячейку, чтобы ввести текст","mode.selectWithSel":"Перетаскивайте элементы · тяните от вывода, чтобы провести провод · правая кнопка — меню","mode.selectEmpty":"Клик — выбрать · перетаскивание — переместить · рамка — несколько · правая кнопка — меню","mode.pan":"Перетаскивайте холст · колесо — масштаб · удерживайте пробел для панорамирования в любом инструменте","mode.wireDragging":"Отпустите на выводе / шине / точке соединения; отпускание в пустом месте создаст точку соединения","mode.wireInit":"Нажмите на любой точке подключения или в пустом месте, перетащите к цели и отпустите","mode.busDragging":"Перетаскивание задаёт направление шины; отпускание — конец","mode.busInit":"Нажмите на холст, чтобы задать начало, тяните и отпустите, чтобы задать конец","mode.junction":"Нажмите на холст, чтобы поставить точку соединения","mode.placeNoKind":"Выберите тип элемента в библиотеке слева","mode.placeFromTerm":"Отпустите у цели — новый элемент подключится к исходному выводу","mode.placeNormal":"Нажмите в пустом месте, чтобы разместить; или перетащите от вывода / шины, чтобы разместить и подключить","mode.text":"Нажмите, чтобы добавить текст · двойной клик — редактировать · перетаскивание выбранного — переместить · Del — удалить","mode.rect":"Перетащите, чтобы нарисовать прямоугольник · Shift — квадрат · после отпускания измените размер и подпись","mode.ellipse":"Перетащите, чтобы нарисовать эллипс · Shift — окружность · после отпускания измените размер, цвет и подпись","mode.line":"Перетащите, чтобы нарисовать линию · Shift — привязка к 45° · стрелки добавьте в панели после отпускания","mode.table":"Перетащите, чтобы задать сетку, или нажмите для таблицы 3×3 · дважды щёлкните ячейку, чтобы ввести текст","mode.annTextSel":"Нажмите на текст, чтобы редактировать · перетащите, чтобы переместить · Del — удалить","mode.annTableSel":"Нажмите на ячейку, чтобы заполнить её · перетащите, чтобы переместить · Del — удалить","mode.annShapeSel":"Перетащите, чтобы переместить · тяните за маркеры, чтобы изменить размер · стиль — в панели · Del — удалить","mode.annEditing":"Введите текст · Enter — подтвердить · Esc — отмена · или кнопки ✓ / ✕","mode.escSelect":"Esc — снять выделение","mode.escOther":"Правая кнопка / Esc — отмена","tool.placeNoKindTooltip":"Выберите тип в библиотеке слева, затем нажмите на холст","tool.undo":"Отменить","tool.undoHint":"Отменить последнее действие (перемещение / поворот / удаление и т. д.)","tool.redo":"Повторить","tool.redoHint":"Повторить последнее отменённое действие","layout.label":"Компоновка","layout.hint":"Автоматически расставить всю схему или только выделенное, заполнить пропуски","layout.allAuto":"Автокомпоновка всей схемы","layout.selAuto":"Автокомпоновка выделенного","layout.allFill":"Расставить неразмещённые","layout.selFill":"Расставить неразмещённые в выделении","tool.more":"Ещё","tool.moreHint":"Отмена / повтор / компоновка","view.menu":"Вид","view.menuHint":"Масштаб, вписать, сетка","ctx.ariaNode":"Действия с узлом","ctx.ariaWire":"Действия с проводом","ctx.ariaElement":"Действия с элементом","ctx.ariaEdit":"Действия редактирования","ctx.done":"Готово","ctx.cancel":"Отмена","ctx.rotate":"Повернуть на 90°","ctx.rotateHint":"Повернуть выделенное по часовой стрелке; провода перестроятся через новые выводы","ctx.mirror":"Зеркально по горизонтали","ctx.mirrorTitle":"Зеркало","ctx.mirrorHint":"Отразить выделенное слева направо","ctx.delete":"Удалить","ctx.color":"Цвет","ctx.colorDefault":"По умолчанию","ctx.colorRed":"Красный","ctx.colorAmber":"Янтарный","ctx.colorGreen":"Зелёный","ctx.colorBlue":"Синий","ctx.colorGray":"Серый","ctx.deleteHintNode":"Отключить все провода этого узла (элементы останутся)","ctx.deleteHintWire":"Удалить только этот провод (остальные провода узла останутся)","ctx.deleteHintElement":"Удалить выделенное и его провода","ctx.resetWirePath":"Сбросить на автотрассировку","ctx.resetWirePathHint":"Убрать вручную заданные изгибы и позволить перерисовать провод автоматически","menu.undo":"Отменить","menu.redo":"Повторить","menu.cut":"Вырезать","menu.copy":"Копировать","menu.paste":"Вставить","menu.rotate":"Повернуть на 90°","menu.mirror":"Зеркально","menu.resetLabel":"Сбросить положение подписи","menu.selectAll":"Выбрать всё","menu.disconnect":"Отключить этот провод","menu.delete":"Удалить","io.parseFailed":"Ошибка разбора JSON: {err}","io.notObject":"Файл не является объектом JSON","io.versionMismatch":'Несовпадение версии: ожидалась "1", получено {actual}',"io.elementsMissing":"Поле `elements` отсутствует или не является массивом","compile.duplicateId":'Повторяющийся ID элемента: "{id}"',"compile.unknownKind":'Неизвестный тип элемента kind="{kind}"',"compile.invalidTermRef":'Некорректная ссылка на вывод "{ref}"',"compile.elementMissing":'Ссылка на несуществующий элемент "{id}"',"compile.missingPin":'У элемента "{id}" (kind={kind}) нет вывода "{pin}"; доступны: {available}',"compile.singleTerminal":"Узел содержит только один вывод — проигнорирован","compile.layoutMissingElement":'Ключ layout "{id}" ссылается на несуществующий элемент',"compile.elementUnconnected":'Элемент "{id}" не имеет подключений',"cat.busbar":"Шины / проводка","cat.switching":"Коммутация","cat.protection":"Защита","cat.motor-control":"Управление двигателем","cat.transformer":"Трансформаторы","cat.instrument-transformer":"Измерительные трансформаторы","cat.measurement":"Измерения","cat.source":"Источники","cat.load":"Нагрузка","cat.storage":"Накопители","cat.compensation":"Компенсация","cat.grounding":"Заземление","cat.renewable":"Возобновляемая энергетика / силовая электроника","onboard.title":"Быстрый старт","onboard.step1.title":"Разместите элемент","onboard.step1.body":"Выберите инструмент «Элемент» (P) и перетащите элемент из библиотеки на холст","onboard.step2.title":"Соедините проводом","onboard.step2.body":"Используйте инструмент «Провод» (W): тяните от одного вывода к другому — перетаскивание в пустое место создаст точку соединения","onboard.step3.title":"Шина — это общая линия, а не провод","onboard.step3.body":"Используйте инструмент «Шина» (B), только если несколько цепей используют одну общую линию. Не используйте шину для соединения двух устройств — просто соедините выводы проводом (W).","onboard.dismiss":"Понятно"},i$={"arc-suppression-coil.name":"Дугогасящая катушка","arrester.name":"Разрядник (FBL)","async-motor.name":"Асинхронный двигатель","autotransformer.name":"Автотрансформатор","battery.name":"Аккумуляторная батарея (накопитель)","breaker.name":"Автоматический выключатель (QF)","busbar.name":"Секция шины","converter-bidir.name":"Двунаправленный преобразователь (PCS)","dc-dc-converter.name":"Преобразователь DC/DC","mppt.name":"Контроллер MPPT","ct.name":"Трансформатор тока (CT)","disconnector.name":"Разъединитель (QS)","earth.name":"Земля","earthing-switch.name":"Заземляющий разъединитель (QE)","fuse.name":"Предохранитель (FU)","generator.name":"Генератор (G)","grid-source.name":"Источник от энергосистемы","grounding-transformer.name":"Заземляющий трансформатор (зигзаг)","inverter.name":"Инвертор (DC→AC)","load-switch.name":"Выключатель нагрузки","load.name":"Нагрузка","luminaire.name":"Светильник (осветительная нагрузка)","panelboard.name":"Распределительный щит","ngr.name":"Резистор заземления нейтрали (NGR)","pt.name":"Трансформатор напряжения (PT)","pv.name":"Фотоэлектрический модуль","rectifier.name":"Выпрямитель (AC→DC)","series-reactor.name":"Последовательный реактор","shunt-capacitor.name":"Шунтирующий конденсатор","shunt-reactor.name":"Шунтирующий реактор","sync-motor.name":"Синхронный двигатель","transformer-2w.name":"Двухобмоточный трансформатор","transformer-3w.name":"Трёхобмоточный трансформатор","wind-turbine.name":"Ветрогенератор","gfci-breaker.name":"Дифференциальный автомат (RCBO)","rcd.name":"Устройство защитного отключения (RCD)","recloser.name":"Реклоузер","energy-meter.name":"Счётчик электроэнергии (Wh)","voltmeter.name":"Вольтметр (V)","ammeter.name":"Амперметр (A)","wattmeter.name":"Ваттметр (W)","frequency-meter.name":"Частотомер (Hz)","contactor.name":"Контактор (KM)","motor-starter.name":"Магнитный пускатель","thermal-overload.name":"Тепловое реле перегрузки","vfd.name":"Частотный преобразователь (VFD)","soft-starter.name":"Устройство плавного пуска","transfer-switch.name":"Устройство АВР (ATS)","dc-disconnector.name":"Разъединитель постоянного тока","dc-combiner.name":"Объединительная коробка постоянного тока","ev-charger.name":"Зарядная станция для электромобилей","arc-suppression-coil.desc":"Резонансное заземление нейтрали: катушка индуктивности на землю","busbar.desc":"Растягиваемая секция одиночной шины с несколькими отводами","converter-bidir.desc":"Преобразователь для накопителя: двунаправленный AC ↔ DC","dc-dc-converter.desc":"Преобразователь DC/DC / зарядное устройство постоянного тока (IEC 60617)","mppt.desc":"Солнечный контроллер заряда MPPT (DC/DC, отслеживание точки максимальной мощности)","earthing-switch.desc":"Разъединитель + соединение с землёй, один порт","grid-source.desc":"Шина бесконечной мощности / внешняя энергосистема","grounding-transformer.desc":"Трансформатор со схемой звезда-зигзаг для заземления нейтрали","load.desc":"Абстрактная нагрузка (стрелка исходящего тока)","luminaire.desc":"Осветительная нагрузка (общий символ светильника МЭК 60617)","ngr.desc":"Заземление через малое сопротивление: нейтраль трансформатора на землю","series-reactor.desc":"То же обозначение, что и у шунтирующего реактора; различаются по способу применения","wind-turbine.desc":"Ветрогенератор: генератор + значок трёхлопастного ротора","gfci-breaker.desc":"Дифференциальный автомат со встроенной защитой от сверхтока (UL943 / IEC 61009). В США — GFCI, в Европе — RCBO.","rcd.desc":"Устройство защитного отключения без защиты от сверхтока (IEC 61008).","recloser.desc":"Автоматический реклоузер среднего напряжения.","energy-meter.desc":"Счётчик активной энергии (кВт·ч) — на вводе / субсчётчик.","contactor.desc":"Контактор главной цепи; обычно используется совместно с тепловым реле и двигателем.","motor-starter.desc":"Пускатель двигателя (общее обозначение по IEC 60617).","thermal-overload.desc":"Тепловое реле перегрузки двигателя; устанавливается между контактором и двигателем.","vfd.desc":"Частотный преобразователь для регулирования скорости асинхронного двигателя.","soft-starter.desc":"Устройство плавного пуска двигателя (тиристорный пуск при пониженном напряжении).","transfer-switch.desc":"Переключатель между двумя источниками (АВР / ручной). Два входа источников + один выход нагрузки, механически сблокированы.","dc-disconnector.desc":"Разъединитель постоянного тока — изоляция стороны DC солнечной цепочки / батареи.","dc-combiner.desc":"Объединительная коробка солнечных цепочек (пример на 4 входа).","ev-charger.desc":"Зарядная станция для электромобилей.","breaker.state.open":"Разомкнут","disconnector.state.open":"Разомкнут","earthing-switch.state.open":"Разомкнут","fuse.state.blown":"Перегорел","load-switch.state.open":"Разомкнут","gfci-breaker.state.open":"Разомкнут","rcd.state.open":"Разомкнут","recloser.state.open":"Разомкнут","contactor.state.open":"Разомкнут","thermal-overload.state.tripped":"Сработало","transfer-switch.state.position":"Положение (нормальное/аварийное/откл.)","dc-disconnector.state.open":"Разомкнут","battery.param.E":"Ёмкость","busbar.param.Un":"Номинальное напряжение","converter-bidir.param.S":"Мощность","dc-dc-converter.param.P":"Мощность","mppt.param.I":"Номинальный ток","load.param.P":"Активная мощность","load.param.cosphi":"Коэффициент мощности","ngr.param.R":"Сопротивление","shunt-capacitor.param.Q":"Реактивная мощность","shunt-capacitor.param.stages":"Ступени","transformer-2w.param.S":"Мощность","transformer-2w.param.ratio":"Коэффициент трансформации","gfci-breaker.param.In":"Номинальный ток","panelboard.param.In":"Номинальный ток","gfci-breaker.param.IDn":"Номинальный отключающий дифференциальный ток","rcd.param.IDn":"Номинальный отключающий дифференциальный ток","breaker.param.In":"Номинальный ток","breaker.param.poles":"Число полюсов","breaker.param.Icu":"Отключающая способность","disconnector.param.In":"Номинальный ток","fuse.param.In":"Номинальный ток","resistor.name":"Резистор (R)","capacitor.name":"Конденсатор (C)","diode.name":"Диод (D)","indicator-light.name":"Сигнальная лампа (HL)","push-button.name":"Кнопка (SB)","relay-coil.name":"Катушка реле (KA)","make-contact.name":"Замыкающий контакт (NO)","break-contact.name":"Размыкающий контакт (NC)","bell.name":"Звонок (HA)","terminal.name":"Клемма / соединение (X)","fuse-switch-disconnector.name":"Предохранитель-разъединитель","socket-outlet.name":"Розетка / разъём","inductor.name":"Катушка индуктивности (L)","voltage-regulator.name":"Регулятор напряжения (T)","dc-motor.name":"Двигатель постоянного тока (M)","heater.name":"Нагревательный элемент (EH)","selector-switch.name":"Переключатель (SA)","limit-switch.name":"Концевой выключатель (SQ)","proximity-switch.name":"Бесконтактный выключатель (SQ)","time-relay.name":"Реле времени (KT)","buzzer.name":"Зуммер (HA)","siren.name":"Сирена (HA)","thermocouple.name":"Термопара (BT)","thyristor.name":"Тиристор / SCR (V)","triac.name":"Симистор (V)","zener-diode.name":"Стабилитрон (D)","igbt.name":"IGBT","plc.name":"ПЛК / контроллер","ups.name":"ИБП (UPS)","power-supply.name":"Источник питания (PS)","genset.name":"Генераторная установка (G)","protective-relay.name":"Защитное реле","overcurrent-relay.name":"Реле максимального тока (50/51)","undervoltage-relay.name":"Реле минимального напряжения (27)","reverse-power-relay.name":"Реле обратной мощности (32)","distance-relay.name":"Дистанционное реле (21)","phase-failure-relay.name":"Реле обрыва фазы","buchholz-relay.name":"Реле Бухгольца (63)","power-factor-meter.name":"Измеритель коэффициента мощности (cosφ)","synchronoscope.name":"Синхроноскоп","varmeter.name":"Варметр (var)","resistor.desc":"Общий резистор / токоограничивающий / тормозной резистор.","capacitor.desc":"Общий / фильтрующий конденсатор / конденсатор шины DC. Для компенсации коэффициента мощности используйте шунтирующий конденсатор.","diode.desc":"Выпрямительный / обратный / защитный диод. t1 = анод (сверху), t2 = катод (снизу).","indicator-light.desc":"Сигнальная лампа состояния.","push-button.desc":"Кнопка ручного управления с автоматическим возвратом (замыкающий контакт NO).","relay-coil.desc":"Катушка управления реле / контактора (обозначение — прямоугольник).","make-contact.desc":"Нормально разомкнутый вспомогательный контакт (замыкающий).","break-contact.desc":"Нормально замкнутый вспомогательный контакт (размыкающий).","bell.desc":"Сигнальный звонок / звонок тревоги.","terminal.desc":"Клемма / клеммная коробка / узел соединения.","fuse-switch-disconnector.desc":"Предохранитель-разъединитель, коммутируемый под нагрузкой.","socket-outlet.desc":"Силовая розетка / многополюсный разъём.","inductor.desc":"Общая катушка индуктивности / дроссель.","voltage-regulator.desc":"Регулируемый индукционный регулятор напряжения / автотрансформаторный регулятор.","dc-motor.desc":"Двигатель постоянного тока (общее обозначение с последовательным возбуждением).","heater.desc":"Резистивный нагревательный элемент / тепловая нагрузка.","selector-switch.desc":"Избирательный переключатель (поворотный, с фиксацией положений).","limit-switch.desc":"Концевой выключатель положения (NO, механическое воздействие).","proximity-switch.desc":"Датчик приближения / бесконтактный выключатель.","time-relay.desc":"Катушка реле времени (с задержкой срабатывания).","buzzer.desc":"Сигнальный зуммер.","siren.desc":"Звуковая сирена / сигнализация.","thermocouple.desc":"Термопарный датчик температуры.","thyristor.desc":"Тиристор с обратной блокировкой (SCR). t1 = анод (сверху), t2 = катод (снизу).","triac.desc":"Двунаправленный триодный тиристор (симистор).","zener-diode.desc":"Стабилитрон / регулирующий диод. t1 = анод (сверху), t2 = катод (снизу).","igbt.desc":"IGBT-транзистор с N-каналом обогащённого типа. t1 = коллектор (сверху), t2 = эмиттер (снизу), t_g = затвор.","plc.desc":"Программируемый логический контроллер (ПЛК).","ups.desc":"Источник бесперебойного питания (онлайн / резервный).","power-supply.desc":"Импульсный источник питания AC→DC / источник постоянного тока. t_ac сверху (~), t_dc снизу (=).","genset.desc":"Дизельная / газовая генераторная установка.","protective-relay.desc":"Измерительное / защитное реле, общее обозначение (IEC 60617).","overcurrent-relay.desc":"Реле максимальной токовой защиты (ANSI 50/51).","undervoltage-relay.desc":"Реле защиты минимального напряжения (ANSI 27).","reverse-power-relay.desc":"Реле защиты от обратной мощности / обратного тока (ANSI 32).","distance-relay.desc":"Дистанционное реле защиты по сопротивлению (ANSI 21).","phase-failure-relay.desc":"Реле защиты от обрыва / потери фазы.","buchholz-relay.desc":"Газовое реле Бухгольца (ANSI 63).","power-factor-meter.desc":"Измеритель коэффициента мощности (cosφ).","synchronoscope.desc":"Индикатор синхронизации / синхроноскоп.","varmeter.desc":"Измеритель реактивной мощности (var).","make-contact.state.closed":"Замкнут","break-contact.state.open":"Разомкнут","on-delay-make-contact.name":"Замыкающий контакт с выдержкой при срабатывании (KT)","off-delay-make-contact.name":"Замыкающий контакт с выдержкой при возврате (KT)","on-delay-break-contact.name":"Размыкающий контакт с выдержкой при срабатывании (KT)","off-delay-break-contact.name":"Размыкающий контакт с выдержкой при возврате (KT)","continuation-out.name":"Переход на другой лист (исходящий)","continuation-in.name":"Переход с другого листа (входящий)","on-delay-make-contact.desc":"Контакт реле времени: замыкается с выдержкой после подачи напряжения на катушку (IEC 60617-07-05-01).","off-delay-make-contact.desc":"Контакт реле времени: размыкается с выдержкой после снятия напряжения с катушки (IEC 60617-07-05-02).","on-delay-break-contact.desc":"Контакт реле времени: размыкается с выдержкой после подачи напряжения на катушку (IEC 60617-07-05-03).","off-delay-break-contact.desc":"Контакт реле времени: замыкается с выдержкой после снятия напряжения с катушки (IEC 60617-07-05-04).","continuation-out.desc":"Провод здесь прерывается и продолжается в другом месте. Переходы с одинаковым именем — один и тот же провод.","continuation-in.desc":"Провод из другого места продолжается здесь. Переходы с одинаковым именем — один и тот же провод.","on-delay-make-contact.state.closed":"Замкнут","on-delay-make-contact.param.delay":"Выдержка","off-delay-make-contact.state.closed":"Замкнут","off-delay-make-contact.param.delay":"Выдержка","on-delay-break-contact.state.open":"Разомкнут","on-delay-break-contact.param.delay":"Выдержка","off-delay-break-contact.state.open":"Разомкнут","off-delay-break-contact.param.delay":"Выдержка","continuation-out.param.target":"Продолжение","continuation-in.param.target":"Откуда","async-motor.param.P":"Мощность","sync-motor.param.P":"Мощность","dc-motor.param.P":"Мощность","ev-charger.param.P":"Мощность","socket-outlet.param.P":"Мощность","luminaire.param.P":"Мощность","fuse-switch-disconnector.state.open":"Разомкнут","selector-switch.state.open":"Разомкнут","limit-switch.state.closed":"Замкнут","resistor.param.R":"Сопротивление","resistor.param.P":"Номинальная мощность","capacitor.param.C":"Ёмкость","capacitor.param.Un":"Номинальное напряжение","indicator-light.param.color":"Цвет","inductor.param.L":"Индуктивность","inductor.param.In":"Номинальный ток","voltage-regulator.param.ratio":"Диапазон регулирования","heater.param.P":"Мощность","ups.param.S":"Мощность","power-supply.param.Vdc":"Выходное напряжение","genset.param.P":"Мощность"},s$={ui:a$,library:i$},l$={"common.unnamed":"بدون عنوان","common.close":"بستن","common.yes":"بله","common.no":"خیر","topbar.theme.toLight":"تغییر به حالت روشن","topbar.theme.toDark":"تغییر به حالت تیره","topbar.theme.currentDark":"فعلی: پوسته تیره","topbar.theme.currentLight":"فعلی: پوسته روشن","topbar.lang.toEnglish":"تغییر به انگلیسی","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"فعلی: انگلیسی","topbar.lang.currentChinese":"فعلی: چینی","topbar.export.label":"خروجی","topbar.export.tooltip":"وکتور SVG (قابل ویرایش)، تصویر PNG (2× کیفیت بالا) یا DXF (CAD)","topbar.export.pngFailed":"خروجی PNG ناموفق بود: {err}","topbar.export.dxfFailed":"خروجی DXF ناموفق بود: {err}","topbar.file.label":"فایل","topbar.file.tooltip":"باز کردن یک نمودار .json محلی، ذخیره، یا ذخیره با نام دیگر","topbar.file.current":"فعلی: {name}","topbar.file.new":"جدید","topbar.file.open":"باز کردن…","topbar.file.save":"ذخیره","topbar.file.saveAs":"ذخیره با نام دیگر…","topbar.file.newConfirm":"ایجاد فایل جدید تغییرات ذخیره‌نشده را از بین می‌برد. ادامه می‌دهید؟","topbar.file.openFailed":"باز کردن ناموفق بود: {err}","topbar.file.saveFailed":"ذخیره ناموفق بود: {err}","topbar.file.fileDescription":"نمودار OneLineEditor","outline.title":"طرح کلی","outline.collapse":"جمع کردن","outline.collapseAria":"جمع کردن طرح کلی","outline.empty":"(هیچ عنصری نیست — برای شروع از کتابخانه بکشید)","props.title":"ویژگی‌ها","props.node":"گره الکتریکی","props.wire":"سیم","props.bus":"شینه","props.junction":"نقطه اتصال","props.junctionPos":"موقعیت","props.nSelected":"{n} مورد انتخاب‌شده","props.empty":"چیزی انتخاب نشده","props.multi":"{n} مورد انتخاب شده","props.name":"نام","props.note":"یادداشت","props.label":"برچسب","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"گره الکتریکی {id} یافت نشد","props.wireNotFound":"سیم {id} یافت نشد","props.nodeStats":"{terminals} ترمینال · {elements} عنصر","props.selectElement":"انتخاب {label}","props.selectWholeNode":"انتخاب کل گره الکتریکی","props.annText":"متن","props.annRect":"مستطیل","props.annEllipse":"بیضی","props.annLine":"خط","props.annTable":"جدول","props.annNotFound":"حاشیه‌نویسی {id} یافت نشد","props.annLabel":"برچسب","props.annLabelPlaceholder":"مثلاً: تابلو شماره 1","props.color":"رنگ","props.size":"اندازه","props.sizeReset":"بازگشت به ۱۰۰٪","props.labelShown":"نمایان","props.labelHidden":"پنهان","props.contactType":"کنتاکت","props.direction":"جهت","props.directionOut":"خروجی","props.directionIn":"ورودی","props.partner":"جفت","props.partnerUnnamed":"نام بگذارید تا با اتصال هم‌نام جفت شود","props.partnerNone":"جفتی در این نقشه نیست","props.partnerJump":"رفتن به {id}","health.title":"بررسی","health.hint":"بررسی اتصال‌ها و تغذیه: راهنما و برآورد، نه بازبینی انطباق با استاندارد","health.markers":"نمایش روی نقشه","health.none":"مشکلی پیدا نشد","health.sectionProblems":"مشکل‌ها","health.sectionNotes":"یادداشت‌ها","health.sectionDismissed":"علامت‌خورده به‌عنوان عمدی","health.sectionLoads":"جمع بارها","health.dismiss":"عمدی است","health.restore":"بازگرداندن","health.loadKnown":"معلوم {kw} kW ({k}/{t} بار)","health.loadAll":"{kw} kW ({t} بار)","health.label.unwired":"وصل نیست","health.label.looks-joined":"وصل به نظر می‌رسد ولی نیست","health.label.dangling-wire":"سر سیم آزاد","health.label.supply-disconnected":"منبع وصل نیست","health.label.unsupplied":"راهی به منبع نیست","health.label.no-origin":"نماد منبع ندارد","health.label.voltage-mix":"ولتاژها مستقیم وصل‌اند","health.label.ratio-mismatch":"نسبت نمی‌خواند","health.label.label-mismatch":"نام در برابر پارامتر","health.label.overload":"بیش از مقدار نامی","health.label.feeder-end":"فیدر اینجا تمام می‌شود","health.label.open-side":"سمت تغذیه آزاد است","health.introTitle":"بررسی نقشه","health.intro":"در اتصال‌های این نقشه {n} مشکل احتمالی پیدا شد. نقطه‌ها جایشان را نشان می‌دهند. این‌ها راهنمایی بر اساس سیم‌کشی است، نه بازبینی انطباق.","health.introShow":"نمایش","health.introOk":"فهمیدم","health.loading":"{pct}٪ از {rating} kVA","health.disclaimer":"راهنما و برآورد بر اساس اتصال‌های نقشه، نه بررسی انطباق با استاندارد.","health.overloadUnits":"بیش از ۱۰ برابر مقدار نامی: واحد بارها را بررسی کنید (P بار عمومی بر حسب مگاوات است).","health.code.unwired":"{name} وصل نیست. چسبیدن به خط اتصال نیست: یک سیم تا ترمینال آن بکشید.","health.code.looks-joined":"اینجا یک سیم روی نقطهٔ اتصال دیگری تمام می‌شود ولی به آن وصل نیست: وصل به نظر می‌رسد اما نیست.","health.code.dangling-wire":"اینجا سر یک سیم به هیچ چیز وصل نیست.","health.code.supply-disconnected":"{name} به بقیهٔ نقشه وصل نیست: {count} از {total} تجهیز راهی به منبع تغذیه ندارند.","health.code.unsupplied":"{count} تجهیز در اینجا راهی به هیچ منبع تغذیه‌ای ندارند.","health.code.no-origin":"این نقشه نماد منبع تغذیه ندارد. یک شبکه یا ژنراتور اضافه کنید تا مسیرهای تغذیه بررسی و جمع بارها نمایش داده شود.","health.code.voltage-mix":"اینجا {a} kV و {b} kV بدون ترانسفورماتور به هم وصل شده‌اند.","health.code.ratio-mismatch":"{name}: نسبت {ratio} با شینه‌های دو طرف ({a} kV / {b} kV) نمی‌خواند.","health.code.label-mismatch":"{name}: نام و پارامتر {param} ({value}) با هم نمی‌خوانند.","health.code.overload":"{name}: بار معلوم {load} kVA از مقدار نامی {rating} kVA بیشتر است (همهٔ بارها با توان کامل، بدون ضریب همزمانی).","health.code.feeder-end":"{name}: فیدر اینجا تمام می‌شود.","health.code.open-side":"{name}: سمت تغذیه وصل نیست (اغلب سر ورودی نقشه است).","props.color.default":"پیش‌فرض","props.color.red":"قرمز","props.color.amber":"کهربایی","props.color.green":"سبز","props.color.blue":"آبی","props.color.gray":"خاکستری","props.annStroke":"نوع خط","props.annStrokeSolid":"ممتد","props.annStrokeDashed":"خط‌چین","props.annStrokeDotted":"نقطه‌چین","props.annStrokeWidth":"ضخامت","props.annWidthThin":"نازک","props.annWidthMedium":"متوسط","props.annWidthThick":"ضخیم","props.annFill":"پرکردن","props.annFillNone":"هیچ","props.annFillTint":"ته‌رنگ","props.annArrow":"پیکان‌ها","props.annArrowNone":"هیچ‌کدام","props.annArrowEnd":"انتها","props.annArrowBoth":"دوطرفه","props.annFontSize":"اندازه فونت","props.annRows":"ردیف‌ها","props.annCols":"ستون‌ها","view.zoomOut":"کوچک‌نمایی","view.zoomOutHint":"کوچک‌نمایی پله‌ای؛ همچنین چرخ ماوس ↓ یا ⌘−","view.reset":"بازنشانی به 100%","view.current":"فعلی {z}%","view.zoomIn":"بزرگ‌نمایی","view.zoomInHint":"بزرگ‌نمایی پله‌ای؛ همچنین چرخ ماوس ↑ یا ⌘+","view.fit":"تنظیم نما","view.fitHint":"بزرگ‌نمایی خودکار و وسط‌چین کردن کل نقشه","view.gridHide":"پنهان کردن شبکه","view.gridShow":"نمایش شبکه","view.gridHotkey":"G","view.gridHideHint":"چسبیدن به شبکه را نیز غیرفعال می‌کند (جای‌گذاری آزاد)","view.gridShowHint":"چسبیدن به شبکه را نیز فعال می‌کند (چسبیدن به 10 پیکسل هنگام کشیدن)","view.gridHideAria":"پنهان کردن شبکه و غیرفعال کردن چسبیدن","view.gridShowAria":"نمایش شبکه و فعال کردن چسبیدن","view.label":"برچسب‌ها","view.labelOff":"خاموش","view.labelId":"شناسه","view.labelAll":"شناسه + پارامترها","view.labelHint":"نمایش و اندازهٔ برچسب‌ها (در خروجی هم اعمال می‌شود)","view.labelSize":"اندازه","view.labelSizeSmaller":"کوچک‌کردن برچسب‌ها","view.labelSizeLarger":"بزرگ‌کردن برچسب‌ها","view.standard":"استاندارد نمادها","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"فقط شکل نمادها را تغییر می‌دهد؛ سیم‌کشی، موقعیت‌ها و مقادیر دست‌نخورده می‌مانند. کلید مدار و فیوز در دو استاندارد متفاوت‌اند.","view.labelSizeReset":"بازنشانی اندازهٔ برچسب‌ها","library.title":"کتابخانه","tool.draw":"ترسیم","tool.drawHint":"متن، کادر، دایره، خط و جدول — یادداشت آزاد روی نقشه","library.empty":"عنصر منطبقی یافت نشد","cat.custom":"در این نقشه","library.customTag":"سفارشی","library.customHint":"تعریف‌شده در همین نقشه — در کتابخانهٔ دیگران نیست","library.createComponent":"قطعهٔ جدید…","library.searchPlaceholder":"جستجوی عناصر…","library.searchAria":"جستجوی عناصر","library.clearSearch":"پاک کردن جستجو","library.itemHint":"کلیک کنید تا وارد حالت قرارگیری شوید، یا به بوم بکشید","tool.select":"انتخاب","tool.selectHint":"برای انتخاب کلیک کنید، برای چند مورد کادر بکشید، برای منو راست‌کلیک کنید","tool.pan":"جابجایی","tool.panHint":"بوم را بکشید؛ کلید Space به‌طور موقت این حالت را فعال می‌کند","tool.wire":"سیم‌کشی","tool.wireHint":"از یک پایه/شینه/نقطه اتصال بکشید؛ رها کردن در فضای خالی یک نقطه اتصال می‌سازد، رها کردن روی یک سیم به آن متصل می‌شود","tool.bus":"شینه","tool.busHint":"روی بوم بکشید — با فشردن نقطه شروع و با رها کردن نقطه پایان تعیین می‌شود","tool.junction":"نقطه اتصال","tool.junctionHint":"برای قرار دادن یک نقطه اتصال (گره) روی بوم کلیک کنید؛ سیم‌ها آزادانه به آن متصل می‌شوند","tool.place":"قرار دادن","tool.placeHint":"برای قرار دادن کلیک کنید؛ یا از یک ترمینال/شینه بکشید تا هم‌زمان قرار داده و متصل شود","tool.text":"متن","tool.textHint":"برای قرار دادن یادداشت متنی روی بوم کلیک کنید؛ برای ویرایش یک مورد موجود دوبار کلیک کنید","tool.rect":"مستطیل","tool.rectHint":"برای رسم یک مستطیل / قاب گروه بکشید (به‌طور پیش‌فرض خط‌چین)؛ Shift برای مربع","tool.ellipse":"بیضی","tool.ellipseHint":"برای رسم بیضی بکشید؛ Shift را نگه دارید تا دایره شود","tool.line":"خط","tool.lineHint":"برای رسم یک خط حاشیه‌نویسی بکشید؛ Shift به 45° می‌چسبد؛ پیکان‌ها در پنل تنظیم می‌شوند","tool.table":"جدول","tool.tableHint":"برای تعیین ستون × ردیف بکشید (شمارش زنده)، یا برای جدول پیش‌فرض کلیک کنید؛ برای تایپ در سلول‌ها دوبار کلیک کنید","mode.selectWithSel":"عناصر را بکشید · ترمینال‌ها را برای سیم‌کشی بکشید · برای منو راست‌کلیک کنید","mode.selectEmpty":"برای انتخاب کلیک کنید · برای جابجایی بکشید · برای چند مورد کادر بکشید · برای منو راست‌کلیک کنید","mode.pan":"بوم را بکشید · برای بزرگ‌نمایی اسکرول کنید · برای جابجایی در هر ابزاری Space را نگه دارید","mode.wireDragging":"روی یک پایه/شینه/نقطه اتصال رها کنید؛ رها کردن در فضای خالی یک نقطه اتصال می‌سازد","mode.wireInit":"روی هر نقطه اتصال یا فضای خالی فشار دهید، به سمت مقصد بکشید و رها کنید","mode.busDragging":"کشیدن جهت شینه را تعیین می‌کند؛ رها کردن پایان را مشخص می‌کند","mode.busInit":"برای تعیین شروع روی بوم فشار دهید، بکشید، برای پایان رها کنید","mode.junction":"برای قرار دادن یک نقطه اتصال روی بوم کلیک کنید","mode.placeNoKind":"یک نوع عنصر را از کتابخانه سمت چپ انتخاب کنید","mode.placeFromTerm":"در مقصد رها کنید — عنصر جدید به ترمینال مبدأ متصل می‌شود","mode.placeNormal":"برای قرار دادن روی فضای خالی کلیک کنید؛ یا از یک ترمینال/شینه بکشید تا هم‌زمان قرار داده و متصل شود","mode.text":"برای قرار دادن متن کلیک کنید · برای ویرایش دوبار کلیک کنید · برای جابجایی انتخاب‌شده بکشید · Del برای حذف","mode.rect":"برای رسم مستطیل بکشید · Shift برای مربع · پس از رها کردن اندازه و برچسب آن را تغییر دهید","mode.ellipse":"برای رسم بیضی بکشید · Shift برای دایره · پس از رها کردن اندازه، رنگ و برچسب را تغییر دهید","mode.line":"برای رسم خط بکشید · Shift به 45° می‌چسبد · پس از رها کردن پیکان را در پنل اضافه کنید","mode.table":"برای تعیین شبکه بکشید، یا برای جدول 3×3 کلیک کنید · برای تایپ در سلول‌ها دوبار کلیک کنید","mode.annTextSel":"برای ویرایش روی متن کلیک کنید · برای جابجایی بکشید · Del برای حذف","mode.annTableSel":"برای پر کردن روی یک سلول کلیک کنید · برای جابجایی بکشید · Del برای حذف","mode.annShapeSel":"برای جابجایی بکشید · برای تغییر اندازه دستگیره‌ها را بکشید · سبک را در پنل تغییر دهید · Del برای حذف","mode.annEditing":"تایپ کنید · Enter برای تأیید · Esc برای لغو · یا دکمه‌های ✓ / ✕","mode.escSelect":"Esc انتخاب را پاک می‌کند","mode.escOther":"راست‌کلیک / Esc برای لغو","tool.placeNoKindTooltip":"یک نوع را از کتابخانه سمت چپ انتخاب کنید، سپس روی بوم کلیک کنید","tool.undo":"واگرد","tool.undoHint":"واگرد آخرین ویرایش (جابجایی / چرخش / حذف و غیره)","tool.redo":"بازانجام","tool.redoHint":"بازانجام آخرین ویرایش واگردشده","layout.label":"چیدمان","layout.hint":"چیدمان خودکار کل نمودار یا فقط انتخاب‌شده، پر کردن فضاهای خالی","layout.allAuto":"چیدمان خودکار همه","layout.selAuto":"چیدمان خودکار انتخاب‌شده","layout.allFill":"پر کردن قرارنگرفته‌ها","layout.selFill":"پر کردن قرارنگرفته‌ها در انتخاب‌شده","tool.more":"بیشتر","tool.moreHint":"واگرد / بازانجام / چیدمان","view.menu":"نما","view.menuHint":"بزرگ‌نمایی، تنظیم نما، شبکه","ctx.ariaNode":"عملیات گره","ctx.ariaWire":"عملیات سیم","ctx.ariaElement":"عملیات عنصر","ctx.ariaEdit":"عملیات ویرایش","ctx.done":"انجام شد","ctx.cancel":"لغو","ctx.rotate":"چرخش 90°","ctx.rotateHint":"چرخش انتخاب‌شده در جهت عقربه‌های ساعت؛ سیم‌ها از ترمینال‌های جدید مسیریابی می‌شوند","ctx.mirror":"قرینه افقی","ctx.mirrorTitle":"قرینه","ctx.mirrorHint":"برگرداندن انتخاب‌شده از چپ به راست","ctx.delete":"حذف","ctx.color":"رنگ","ctx.colorDefault":"پیش‌فرض","ctx.colorRed":"قرمز","ctx.colorAmber":"کهربایی","ctx.colorGreen":"سبز","ctx.colorBlue":"آبی","ctx.colorGray":"خاکستری","ctx.deleteHintNode":"قطع تمام سیم‌های این گره (عناصر باقی می‌مانند)","ctx.deleteHintWire":"فقط این سیم حذف می‌شود (سیم‌های دیگر همان گره باقی می‌مانند)","ctx.deleteHintElement":"حذف انتخاب‌شده و سیم‌های آن","ctx.resetWirePath":"بازنشانی به مسیریابی خودکار","ctx.resetWirePathHint":"گوشه‌های دستی حذف می‌شود و مسیریاب این سیم را دوباره رسم می‌کند","menu.undo":"واگرد","menu.redo":"بازانجام","menu.cut":"برش","menu.copy":"کپی","menu.paste":"جای‌گذاری","menu.rotate":"چرخش 90°","menu.mirror":"قرینه","menu.resetLabel":"بازنشانی جای برچسب","menu.selectAll":"انتخاب همه","menu.disconnect":"قطع این سیم","menu.delete":"حذف","io.parseFailed":"تجزیه JSON ناموفق بود: {err}","io.notObject":"فایل یک شیء JSON نیست","io.versionMismatch":'عدم تطابق نسخه: مقدار مورد انتظار "1"، مقدار دریافتی {actual}',"io.elementsMissing":"`elements` وجود ندارد یا آرایه نیست","compile.duplicateId":'شناسه عنصر تکراری: "{id}"',"compile.unknownKind":'نوع عنصر ناشناخته kind="{kind}"',"compile.invalidTermRef":'ارجاع ترمینال نامعتبر "{ref}"',"compile.elementMissing":'ارجاع به عنصر ناشناخته "{id}"',"compile.missingPin":'عنصر "{id}" (kind={kind}) پایه "{pin}" را ندارد؛ پایه‌های موجود: {available}',"compile.singleTerminal":"گره فقط یک ترمینال دارد — نادیده گرفته شد","compile.layoutMissingElement":'کلید layout با شناسه "{id}" به عنصری ناشناخته ارجاع می‌دهد',"compile.elementUnconnected":'عنصر "{id}" هیچ اتصالی ندارد',"cat.busbar":"شینه / سیم‌کشی","cat.switching":"کلیدزنی","cat.protection":"حفاظت","cat.motor-control":"کنترل موتور","cat.transformer":"ترانسفورماتور","cat.instrument-transformer":"ترانسفورماتور اندازه‌گیری","cat.measurement":"اندازه‌گیری","cat.source":"منبع","cat.load":"بار","cat.storage":"ذخیره‌سازی","cat.compensation":"جبران‌سازی","cat.grounding":"اتصال زمین","cat.renewable":"انرژی‌های تجدیدپذیر / الکترونیک قدرت","onboard.title":"شروع سریع","onboard.step1.title":"قرار دادن یک قطعه","onboard.step1.body":"ابزار قرار دادن (P) را انتخاب کنید و یک نوع را از کتابخانه به بوم بکشید","onboard.step2.title":"سیم‌کشی کنید","onboard.step2.body":"از ابزار سیم‌کشی (W) استفاده کنید: از یک پایه به پایه دیگر بکشید — برای ساخت یک نقطه اتصال به فضای خالی بکشید","onboard.step3.title":"شینه یک ریل مشترک است، نه یک سیم","onboard.step3.body":"ابزار شینه (B) را فقط زمانی استفاده کنید که چند مدار یک ریل مشترک دارند. از شینه برای اتصال دو دستگاه استفاده نکنید — فقط پایه‌ها را سیم‌کشی کنید (W).","onboard.dismiss":"متوجه شدم"},c$={"arc-suppression-coil.name":"سلف خاموش‌کننده قوس","arrester.name":"برقگیر (FBL)","async-motor.name":"موتور آسنکرون","autotransformer.name":"اتوترانسفورماتور","battery.name":"ذخیره‌سازی باتری","breaker.name":"کلید اتوماتیک (QF)","busbar.name":"قطعه شینه","converter-bidir.name":"مبدل دوطرفه (PCS)","dc-dc-converter.name":"مبدل DC/DC","mppt.name":"کنترلر MPPT","ct.name":"ترانسفورماتور جریان (CT)","disconnector.name":"سکسیونر (QS)","earth.name":"زمین","earthing-switch.name":"کلید ارت (QE)","fuse.name":"فیوز (FU)","generator.name":"ژنراتور (G)","grid-source.name":"منبع شبکه سراسری","grounding-transformer.name":"ترانسفورماتور زمین (زیگزاگ)","inverter.name":"اینورتر (DC→AC)","load-switch.name":"کلید قطع بار","load.name":"بار","luminaire.name":"چراغ (بار روشنایی)","panelboard.name":"تابلو برق / مرکز بار","ngr.name":"مقاومت زمین نوترال (NGR)","pt.name":"ترانسفورماتور ولتاژ (PT)","pv.name":"ماژول فتوولتائیک","rectifier.name":"یکسوکننده (AC→DC)","series-reactor.name":"راکتور سری","shunt-capacitor.name":"خازن موازی","shunt-reactor.name":"راکتور موازی","sync-motor.name":"موتور سنکرون","transformer-2w.name":"ترانسفورماتور دو سیم‌پیچ","transformer-3w.name":"ترانسفورماتور سه سیم‌پیچ","wind-turbine.name":"توربین بادی","gfci-breaker.name":"کلید GFCI (RCBO)","rcd.name":"کلید جریان نشتی (RCD)","recloser.name":"ریکلوزر","energy-meter.name":"کنتور انرژی (Wh)","voltmeter.name":"ولت‌متر (V)","ammeter.name":"آمپرمتر (A)","wattmeter.name":"وات‌متر (W)","frequency-meter.name":"فرکانس‌متر (Hz)","contactor.name":"کنتاکتور (KM)","motor-starter.name":"راه‌انداز موتور","thermal-overload.name":"رله اضافه‌بار حرارتی","vfd.name":"درایو فرکانس متغیر (VFD)","soft-starter.name":"راه‌انداز نرم","transfer-switch.name":"کلید انتقال اتوماتیک (ATS)","dc-disconnector.name":"سکسیونر DC","dc-combiner.name":"جعبه ترکیب‌کننده DC","ev-charger.name":"شارژر خودرو برقی","arc-suppression-coil.desc":"اتصال زمین تشدیدی نقطه نوترال: سلف به زمین","busbar.desc":"قطعه شینه تک با قابلیت کشش و چند انشعاب","converter-bidir.desc":"مبدل ذخیره‌ساز: دوطرفه AC ↔ DC","dc-dc-converter.desc":"مبدل DC/DC / شارژر DC (IEC 60617)","mppt.desc":"کنترلر شارژ خورشیدی MPPT (DC/DC، ردیابی نقطه توان بیشینه)","earthing-switch.desc":"سکسیونر + اتصال زمین، تک‌پورت","grid-source.desc":"شینه بی‌نهایت / شبکه خارجی","grounding-transformer.desc":"ترانسفورماتور ستاره-زیگزاگ برای اتصال زمین نقطه نوترال","load.desc":"بار انتزاعی (پیکان خروجی جریان)","luminaire.desc":"بار روشنایی (نماد عمومی چراغ IEC 60617)","ngr.desc":"اتصال زمین با مقاومت کم: نوترال ترانسفورماتور به زمین","series-reactor.desc":"نماد مشابه راکتور موازی؛ تمایز بر اساس کاربرد","wind-turbine.desc":"توربین بادی: ژنراتور + نشان روتور سه‌پره","gfci-breaker.desc":"کلید جریان نشتی با حفاظت اضافه‌جریان (UL943 / IEC 61009). GFCI در آمریکای شمالی / RCBO در اروپا.","rcd.desc":"کلید جریان نشتی بدون حفاظت اضافه‌جریان (IEC 61008).","recloser.desc":"ریکلوزر خودکار فشار متوسط.","energy-meter.desc":"کنتور انرژی اکتیو (kWh) — ورودی سرویس / زیرکنتور.","contactor.desc":"کنتاکتور مدار اصلی؛ معمولاً همراه با رله اضافه‌بار حرارتی و موتور استفاده می‌شود.","motor-starter.desc":"راه‌انداز موتور (نماد عمومی IEC 60617).","thermal-overload.desc":"رله اضافه‌بار حرارتی موتور؛ بین کنتاکتور و موتور قرار می‌گیرد.","vfd.desc":"درایو فرکانس متغیر برای کنترل سرعت موتور القایی.","soft-starter.desc":"راه‌انداز نرم موتور (راه‌اندازی با ولتاژ کاهش‌یافته بر پایه تریستور).","transfer-switch.desc":"کلید انتقال دو منبعی (ATS / دستی). دو ورودی منبع + یک خروجی بار، با قفل مکانیکی متقابل.","dc-disconnector.desc":"کلید ایزوله DC — ایزوله‌سازی سمت DC رشته فتوولتائیک / باتری.","dc-combiner.desc":"جعبه ترکیب‌کننده رشته‌های فتوولتائیک (نمونه 4 ورودی).","ev-charger.desc":"ایستگاه شارژ خودرو برقی.","breaker.state.open":"باز","disconnector.state.open":"باز","earthing-switch.state.open":"باز","fuse.state.blown":"سوخته","load-switch.state.open":"باز","gfci-breaker.state.open":"باز","rcd.state.open":"باز","recloser.state.open":"باز","contactor.state.open":"باز","thermal-overload.state.tripped":"تریپ‌کرده","transfer-switch.state.position":"موقعیت (عادی/اضطراری/خاموش)","dc-disconnector.state.open":"باز","battery.param.E":"ظرفیت","busbar.param.Un":"ولتاژ نامی","converter-bidir.param.S":"ظرفیت","dc-dc-converter.param.P":"توان","mppt.param.I":"جریان نامی","load.param.P":"توان اکتیو","load.param.cosphi":"ضریب توان","ngr.param.R":"مقاومت","shunt-capacitor.param.Q":"ظرفیت راکتیو","shunt-capacitor.param.stages":"پله‌ها","transformer-2w.param.S":"ظرفیت","transformer-2w.param.ratio":"نسبت تبدیل","gfci-breaker.param.In":"جریان نامی","panelboard.param.In":"جریان نامی","gfci-breaker.param.IDn":"جریان عملکرد نشتی","rcd.param.IDn":"جریان عملکرد نشتی","breaker.param.In":"جریان نامی","breaker.param.poles":"تعداد قطب","breaker.param.Icu":"قدرت قطع","disconnector.param.In":"جریان نامی","fuse.param.In":"جریان نامی","resistor.name":"مقاومت (R)","capacitor.name":"خازن (C)","diode.name":"دیود (D)","indicator-light.name":"چراغ نشانگر (HL)","push-button.name":"کلید فشاری (SB)","relay-coil.name":"بوبین رله (KA)","make-contact.name":"کنتاکت باز (NO)","break-contact.name":"کنتاکت بسته (NC)","bell.name":"زنگ (HA)","terminal.name":"ترمینال / اتصال (X)","fuse-switch-disconnector.name":"سکسیونر-کلید فیوزدار","socket-outlet.name":"پریز / کانکتور","inductor.name":"سلف (L)","voltage-regulator.name":"تنظیم‌کننده ولتاژ (T)","dc-motor.name":"موتور DC (M)","heater.name":"المنت حرارتی (EH)","selector-switch.name":"کلید سلکتور (SA)","limit-switch.name":"کلید حد (SQ)","proximity-switch.name":"کلید مجاورتی (SQ)","time-relay.name":"رله زمانی (KT)","buzzer.name":"بازر (HA)","siren.name":"آژیر (HA)","thermocouple.name":"ترموکوپل (BT)","thyristor.name":"تریستور / SCR (V)","triac.name":"تریاک (V)","zener-diode.name":"دیود زنر (D)","igbt.name":"IGBT","plc.name":"PLC / کنترلر","ups.name":"UPS","power-supply.name":"منبع تغذیه (PS)","genset.name":"مجموعه ژنراتور (G)","protective-relay.name":"رله حفاظتی","overcurrent-relay.name":"رله اضافه‌جریان (50/51)","undervoltage-relay.name":"رله کاهش ولتاژ (27)","reverse-power-relay.name":"رله توان معکوس (32)","distance-relay.name":"رله دیستانس (21)","phase-failure-relay.name":"رله قطع فاز","buchholz-relay.name":"رله بوخهلتس (63)","power-factor-meter.name":"ضریب توان‌متر (cosφ)","synchronoscope.name":"سنکرونوسکوپ","varmeter.name":"وارمتر (var)","resistor.desc":"مقاومت عمومی / محدودکننده جریان / مقاومت ترمزی.","capacitor.desc":"خازن عمومی / فیلتر / باس DC. برای اصلاح ضریب توان از خازن موازی استفاده کنید.","diode.desc":"دیود یکسوساز / آزادگرد / حفاظتی. t1 = آند (بالا)، t2 = کاتد (پایین).","indicator-light.desc":"چراغ نشانگر سیگنال / وضعیت.","push-button.desc":"کلید فشاری دستی، بازگشت خودکار (کنتاکت باز).","relay-coil.desc":"بوبین عملکرد رله / کنتاکتور (جعبه).","make-contact.desc":"کنتاکت کمکی نرمال باز (NO).","break-contact.desc":"کنتاکت کمکی نرمال بسته (NC).","bell.desc":"زنگ سیگنال / زنگ هشدار.","terminal.desc":"ترمینال / جعبه تقسیم / گره اتصال.","fuse-switch-disconnector.desc":"سکسیونر-کلید فیوزدار قابل قطع زیر بار.","socket-outlet.desc":"پریز برق / کانکتور چندقطبی.","inductor.desc":"سلف عمومی / بوبین / خفه‌کن.","voltage-regulator.desc":"تنظیم‌کننده ولتاژ القایی / اتوترانسفورماتوری قابل تنظیم.","dc-motor.desc":"موتور DC (نماد عمومی تحریک سری).","heater.desc":"المنت حرارتی مقاومتی / بار حرارتی.","selector-switch.desc":"کلید سلکتور / تغییر وضعیت (دوار، پایدار).","limit-switch.desc":"کلید حد حرکت / موقعیت (NO، عملکرد مکانیکی).","proximity-switch.desc":"سنسور مجاورتی / کلید مجاورتی بدون تماس.","time-relay.desc":"بوبین رله با تأخیر زمانی (عملکرد کند).","buzzer.desc":"بازر سیگنال.","siren.desc":"آژیر صوتی / هشدار.","thermocouple.desc":"سنسور دمای ترموکوپل.","thyristor.desc":"تریستور سه‌پایه مسدودکننده معکوس / SCR. t1 = آند (بالا)، t2 = کاتد (پایین).","triac.desc":"تریستور سه‌پایه دوطرفه (TRIAC).","zener-diode.desc":"دیود زنر / تنظیم‌کننده ولتاژ. t1 = آند (بالا)، t2 = کاتد (پایین).","igbt.desc":"IGBT کانال N از نوع تقویتی. t1 = کلکتور (بالا)، t2 = امیتر (پایین)، t_g = گیت.","plc.desc":"کنترل‌کننده منطقی قابل برنامه‌ریزی (PLC).","ups.desc":"منبع تغذیه بی‌وقفه آنلاین / استندبای (UPS).","power-supply.desc":"منبع تغذیه سوییچینگ AC→DC / منبع تغذیه DC. t_ac بالا (~)، t_dc پایین (=).","genset.desc":"مجموعه ژنراتور دیزلی / گازی.","protective-relay.desc":"رله اندازه‌گیری / حفاظتی، نماد عمومی (IEC 60617).","overcurrent-relay.desc":"رله حفاظت اضافه‌جریان (ANSI 50/51).","undervoltage-relay.desc":"رله حفاظت کاهش ولتاژ (ANSI 27).","reverse-power-relay.desc":"رله حفاظت توان معکوس / جریان معکوس (ANSI 32).","distance-relay.desc":"رله حفاظت دیستانس / امپدانس کاهشی (ANSI 21).","phase-failure-relay.desc":"رله حفاظت قطع فاز / افت فاز.","buchholz-relay.desc":"رله بوخهلتس / گازی (ANSI 63).","power-factor-meter.desc":"ضریب توان‌متر (cosφ).","synchronoscope.desc":"نشانگر همزمان‌سازی / سنکرونوسکوپ.","varmeter.desc":"توان راکتیومتر (var).","make-contact.state.closed":"بسته","break-contact.state.open":"باز","on-delay-make-contact.name":"کنتاکت باز با تأخیر در وصل (KT)","off-delay-make-contact.name":"کنتاکت باز با تأخیر در قطع (KT)","on-delay-break-contact.name":"کنتاکت بسته با تأخیر در وصل (KT)","off-delay-break-contact.name":"کنتاکت بسته با تأخیر در قطع (KT)","continuation-out.name":"اتصال به صفحهٔ دیگر (خروجی)","continuation-in.name":"اتصال از صفحهٔ دیگر (ورودی)","on-delay-make-contact.desc":"کنتاکت تایمر، نرمال باز: پس از برق‌دار شدن بوبین با تأخیر بسته می‌شود (IEC 60617-07-05-01).","off-delay-make-contact.desc":"کنتاکت تایمر، نرمال باز: پس از بی‌برق شدن بوبین با تأخیر باز می‌شود (IEC 60617-07-05-02).","on-delay-break-contact.desc":"کنتاکت تایمر، نرمال بسته: پس از برق‌دار شدن بوبین با تأخیر باز می‌شود (IEC 60617-07-05-03).","off-delay-break-contact.desc":"کنتاکت تایمر، نرمال بسته: پس از بی‌برق شدن بوبین با تأخیر بسته می‌شود (IEC 60617-07-05-04).","continuation-out.desc":"سیم اینجا قطع می‌شود و در جای دیگری ادامه می‌یابد. اتصال‌های هم‌نام یک سیم واحد هستند.","continuation-in.desc":"سیمی که از جای دیگری می‌آید اینجا ادامه می‌یابد. اتصال‌های هم‌نام یک سیم واحد هستند.","on-delay-make-contact.state.closed":"بسته","on-delay-make-contact.param.delay":"تأخیر","off-delay-make-contact.state.closed":"بسته","off-delay-make-contact.param.delay":"تأخیر","on-delay-break-contact.state.open":"باز","on-delay-break-contact.param.delay":"تأخیر","off-delay-break-contact.state.open":"باز","off-delay-break-contact.param.delay":"تأخیر","continuation-out.param.target":"ادامه در","continuation-in.param.target":"از","async-motor.param.P":"توان","sync-motor.param.P":"توان","dc-motor.param.P":"توان","ev-charger.param.P":"توان","socket-outlet.param.P":"توان","luminaire.param.P":"توان","fuse-switch-disconnector.state.open":"باز","selector-switch.state.open":"باز","limit-switch.state.closed":"بسته","resistor.param.R":"مقاومت","resistor.param.P":"توان نامی","capacitor.param.C":"ظرفیت خازنی","capacitor.param.Un":"ولتاژ نامی","indicator-light.param.color":"رنگ","inductor.param.L":"اندوکتانس","inductor.param.In":"جریان نامی","voltage-regulator.param.ratio":"محدوده تنظیم","heater.param.P":"توان","ups.param.S":"ظرفیت","power-supply.param.Vdc":"ولتاژ خروجی","genset.param.P":"توان"},d$={ui:l$,library:c$},u$={"common.unnamed":"بلا اسم","common.close":"إغلاق","common.yes":"نعم","common.no":"لا","topbar.theme.toLight":"التبديل إلى الوضع الفاتح","topbar.theme.toDark":"التبديل إلى الوضع الداكن","topbar.theme.currentDark":"الحالي: السمة الداكنة","topbar.theme.currentLight":"الحالي: السمة الفاتحة","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"الحالي: الإنجليزية","topbar.lang.currentChinese":"الحالي: الصينية","topbar.export.label":"تصدير","topbar.export.tooltip":"SVG متجهي (قابل للتحرير)، PNG نقطي (بدقة 2×)، أو DXF (لبرامج CAD)","topbar.export.pngFailed":"فشل تصدير PNG: {err}","topbar.export.dxfFailed":"فشل تصدير DXF: {err}","topbar.file.label":"ملف","topbar.file.tooltip":"افتح مخططًا محليًا بصيغة .json، احفظ، أو احفظ باسم","topbar.file.current":"الحالي: {name}","topbar.file.new":"جديد","topbar.file.open":"فتح…","topbar.file.save":"حفظ","topbar.file.saveAs":"حفظ باسم…","topbar.file.newConfirm":"سيؤدي إنشاء ملف جديد إلى فقدان أي تغييرات غير محفوظة. هل تريد المتابعة؟","topbar.file.openFailed":"فشل الفتح: {err}","topbar.file.saveFailed":"فشل الحفظ: {err}","topbar.file.fileDescription":"مخطط OneLineEditor","outline.title":"المخطط التفصيلي","outline.collapse":"طي","outline.collapseAria":"طي المخطط التفصيلي","outline.empty":"(لا توجد عناصر — اسحب من المكتبة للبدء)","props.title":"الخصائص","props.node":"العقدة الكهربائية","props.wire":"السلك","props.bus":"الشريط الناقل","props.junction":"نقطة الوصل","props.junctionPos":"الموضع","props.nSelected":"تم تحديد {n}","props.empty":"لا يوجد تحديد","props.multi":"تم تحديد {n} كائن","props.name":"الاسم","props.note":"ملاحظة","props.label":"التسمية","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"العقدة الكهربائية {id} غير موجودة","props.wireNotFound":"السلك {id} غير موجود","props.nodeStats":"{terminals} طرف · {elements} عنصر","props.selectElement":"تحديد {label}","props.selectWholeNode":"تحديد العقدة الكهربائية بالكامل","props.annText":"نص","props.annRect":"مستطيل","props.annEllipse":"بيضاوي","props.annLine":"خط","props.annTable":"جدول","props.annNotFound":"التعليق التوضيحي {id} غير موجود","props.annLabel":"التسمية","props.annLabelPlaceholder":"مثال: لوحة رقم 1","props.color":"اللون","props.size":"الحجم","props.sizeReset":"إعادة إلى 100%","props.labelShown":"ظاهرة","props.labelHidden":"مخفية","props.contactType":"التماس","props.direction":"الاتجاه","props.directionOut":"خارجة","props.directionIn":"داخلة","props.partner":"النظير","props.partnerUnnamed":"سمِّها لتقترن بالوصلة التي تحمل الاسم نفسه","props.partnerNone":"لا يوجد نظير في هذا المخطط","props.partnerJump":"انتقل إلى {id}","health.title":"الفحص","health.hint":"فحص التوصيلات والتغذية: تلميحات وتقديرات، وليس مراجعة للمطابقة","health.markers":"إظهار على المخطط","health.none":"لم يُعثر على مشكلات","health.sectionProblems":"المشكلات","health.sectionNotes":"ملاحظات","health.sectionDismissed":"معلَّمة كمقصودة","health.sectionLoads":"مجاميع الأحمال","health.dismiss":"مقصود","health.restore":"استعادة","health.loadKnown":"المعروف {kw} kW ({k}/{t} أحمال)","health.loadAll":"{kw} kW ({t} أحمال)","health.label.unwired":"غير موصول","health.label.looks-joined":"يبدو موصولًا وهو ليس كذلك","health.label.dangling-wire":"طرف سلك حر","health.label.supply-disconnected":"المصدر غير موصول","health.label.unsupplied":"لا مسار إلى مصدر","health.label.no-origin":"لا يوجد رمز مصدر","health.label.voltage-mix":"مستويات جهد متصلة","health.label.ratio-mismatch":"النسبة غير مطابقة","health.label.label-mismatch":"الاسم مقابل المعامل","health.label.overload":"فوق القدرة المقنّنة","health.label.feeder-end":"المغذّي ينتهي هنا","health.label.open-side":"جهة التغذية مفتوحة","health.introTitle":"فحص المخطط","health.intro":"وُجدت {n} مشكلة محتملة في توصيلات هذا المخطط. تُظهر النقاط مكانها. هذه تلميحات من التوصيلات، وليست مراجعة للمطابقة.","health.introShow":"عرض","health.introOk":"حسنًا","health.loading":"{pct}% من {rating} kVA","health.disclaimer":"تلميحات وتقديرات مستخلصة من توصيلات المخطط، وليست فحصًا للمطابقة مع المواصفات.","health.overloadUnits":"أكثر من 10 أضعاف القدرة المقنّنة: تحقّق من وحدات الأحمال (قيمة P للحمل العام بالميغاواط).","health.code.unwired":"{name} غير موصول. ملامسة الخط ليست توصيلًا: ارسم سلكًا حتى طرفه.","health.code.looks-joined":"ينتهي سلك هنا فوق نقطة توصيل أخرى دون أن يتصل بها: يبدو موصولًا لكنه ليس كذلك.","health.code.dangling-wire":"ينتهي سلك هنا دون أن يتصل بأي شيء.","health.code.supply-disconnected":"{name} غير متصل ببقية المخطط: {count} من {total} أجهزة ليس لها مسار إلى مصدر تغذية.","health.code.unsupplied":"{count} جهاز/أجهزة هنا ليس لها مسار إلى أي مصدر تغذية.","health.code.no-origin":"لا يحتوي هذا المخطط على رمز مصدر تغذية. أضف شبكة أو مولّدًا لفحص مسارات التغذية ورؤية مجاميع الأحمال.","health.code.voltage-mix":"هنا تتصل {a} kV و{b} kV دون محوّل.","health.code.ratio-mismatch":"{name}: النسبة {ratio} لا تطابق قضبان التوزيع على جانبيه ({a} kV / {b} kV).","health.code.label-mismatch":"{name}: الاسم والمعامل {param} ({value}) غير متطابقين.","health.code.overload":"{name}: الحمل المعروف {load} kVA أعلى من القدرة المقنّنة {rating} kVA (كل الأحمال بكامل قدرتها، دون معامل تزامن).","health.code.feeder-end":"{name}: المغذّي ينتهي هنا.","health.code.open-side":"{name}: جهة التغذية غير موصولة (غالبًا طرف الدخول في المخطط).","props.color.default":"افتراضي","props.color.red":"أحمر","props.color.amber":"كهرماني","props.color.green":"أخضر","props.color.blue":"أزرق","props.color.gray":"رمادي","props.annStroke":"نمط الخط","props.annStrokeSolid":"متصل","props.annStrokeDashed":"متقطع","props.annStrokeDotted":"منقّط","props.annStrokeWidth":"سماكة الخط","props.annWidthThin":"رفيع","props.annWidthMedium":"متوسط","props.annWidthThick":"سميك","props.annFill":"التعبئة","props.annFillNone":"بلا","props.annFillTint":"تظليل","props.annArrow":"الأسهم","props.annArrowNone":"بلا","props.annArrowEnd":"طرف واحد","props.annArrowBoth":"الطرفان","props.annFontSize":"حجم الخط","props.annRows":"الصفوف","props.annCols":"الأعمدة","view.zoomOut":"تصغير","view.zoomOutHint":"تصغير تدريجي؛ أو عجلة الفأرة ↓ أو ⌘−","view.reset":"إعادة الضبط إلى 100%","view.current":"الحالي {z}%","view.zoomIn":"تكبير","view.zoomInHint":"تكبير تدريجي؛ أو عجلة الفأرة ↑ أو ⌘+","view.fit":"احتواء العرض","view.fitHint":"تكبير/تصغير تلقائي وتوسيط المخطط بالكامل","view.gridHide":"إخفاء الشبكة","view.gridShow":"إظهار الشبكة","view.gridHotkey":"G","view.gridHideHint":"يعطّل أيضًا الانجذاب إلى الشبكة (وضع حر)","view.gridShowHint":"يفعّل أيضًا الانجذاب إلى الشبكة (ينجذب إلى 10 بكسل عند السحب)","view.gridHideAria":"إخفاء الشبكة وتعطيل الانجذاب","view.gridShowAria":"إظهار الشبكة وتفعيل الانجذاب","view.label":"التسميات","view.labelOff":"إيقاف","view.labelId":"المعرّف","view.labelAll":"المعرّف + المعاملات","view.labelHint":"إظهار التسميات وحجم خطها (ينطبق على التصدير أيضًا)","view.labelSize":"الحجم","view.labelSizeSmaller":"تصغير خط التسميات","view.labelSizeLarger":"تكبير خط التسميات","view.standard":"معيار الرموز","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"يغيّر رسم الرموز فقط — التوصيلات والمواضع والقيم تبقى كما هي. القاطع والمنصهر يختلفان بين المعيارين.","view.labelSizeReset":"إعادة تعيين حجم التسميات","library.title":"المكتبة","tool.draw":"رسم","tool.drawHint":"نصوص وأطر ودوائر وخطوط وجداول — تعليقات حرة فوق المخطط","library.empty":"لا توجد عناصر مطابقة","cat.custom":"في هذا المخطط","library.customTag":"مخصّص","library.customHint":"معرَّف في هذا المخطط — لا يوجد في مكتبة أحد آخر","library.createComponent":"مكوّن جديد…","library.searchPlaceholder":"البحث في العناصر…","library.searchAria":"البحث في العناصر","library.clearSearch":"مسح البحث","library.itemHint":"انقر للدخول في وضع الإضافة، أو اسحب إلى لوحة الرسم","tool.select":"تحديد","tool.selectHint":"انقر للاختيار، حدد بالسحب لاختيار عدة عناصر، أو انقر بالزر الأيمن لفتح القائمة","tool.pan":"تحريك","tool.panHint":"اسحب لوحة الرسم؛ مفتاح المسافة يبدّل مؤقتًا","tool.wire":"سلك","tool.wireHint":"اسحب من طرف/شريط ناقل/نقطة وصل؛ السحب إلى مساحة فارغة يُنشئ نقطة وصل، وإلى سلك موجود يصل به","tool.bus":"الشريط الناقل","tool.busHint":"اسحب على لوحة الرسم — اضغط لتحديد نقطة البداية، وحرر لتحديد نقطة النهاية","tool.junction":"نقطة الوصل","tool.junctionHint":"انقر على لوحة الرسم لوضع نقطة وصل (عقدة)؛ يمكن للأسلاك الاتصال بها بحرية","tool.place":"إضافة","tool.placeHint":"انقر للوضع؛ أو اسحب من طرف/شريط ناقل للوضع والتوصيل معًا","tool.text":"نص","tool.textHint":"انقر على لوحة الرسم لوضع ملاحظة نصية؛ انقر نقرًا مزدوجًا على ملاحظة موجودة لتحريرها","tool.rect":"مستطيل","tool.rectHint":"اسحب لرسم مستطيل / إطار تجميع (متقطع افتراضيًا)؛ اضغط Shift لرسم مربع","tool.ellipse":"بيضاوي","tool.ellipseHint":"اسحب لرسم شكل بيضاوي؛ اضغط Shift لرسم دائرة","tool.line":"خط","tool.lineHint":"اسحب لرسم خط توضيحي؛ Shift يقيّده بزاوية 45°؛ إعدادات الأسهم في لوحة الخصائص","tool.table":"جدول","tool.tableHint":"اسحب لتحديد عدد الأعمدة × الصفوف (يظهر العدد مباشرة)، أو انقر لوضع جدول افتراضي؛ انقر نقرًا مزدوجًا على الخلايا للكتابة","mode.selectWithSel":"اسحب العناصر · اسحب الأطراف للتوصيل · انقر بالزر الأيمن لفتح القائمة","mode.selectEmpty":"انقر للاختيار · اسحب للتحريك · حدد بالسحب لاختيار عدة عناصر · انقر بالزر الأيمن لفتح القائمة","mode.pan":"اسحب لوحة الرسم · مرّر للتكبير/التصغير · اضغط مطولاً على المسافة للتحريك في أي أداة","mode.wireDragging":"حرر على طرف/شريط ناقل/نقطة وصل؛ التحرير في مساحة فارغة يُنشئ نقطة وصل","mode.wireInit":"اضغط على أي نقطة اتصال أو مساحة فارغة، اسحب إلى الهدف ثم حرر","mode.busDragging":"السحب يحدد اتجاه الشريط الناقل؛ التحرير يحدد نقطة النهاية","mode.busInit":"اضغط على لوحة الرسم لتحديد البداية، اسحب، ثم حرر لتحديد النهاية","mode.junction":"انقر على لوحة الرسم لوضع نقطة وصل","mode.placeNoKind":"اختر نوع عنصر من المكتبة على اليسار","mode.placeFromTerm":"حرر عند الهدف — سيتصل العنصر الجديد بالطرف المصدر","mode.placeNormal":"انقر على مساحة فارغة للوضع؛ أو اسحب من طرف / شريط ناقل للوضع والتوصيل معًا","mode.text":"انقر لوضع نص · انقر نقرًا مزدوجًا للتحرير · اسحب العنصر المحدد للتحريك · Del للحذف","mode.rect":"اسحب لرسم مستطيل · Shift لرسم مربع · غيّر حجمه وأضف تسمية بعد التحرير","mode.ellipse":"اسحب لرسم شكل بيضاوي · Shift لرسم دائرة · غيّر حجمه ولونه وأضف تسمية بعد التحرير","mode.line":"اسحب لرسم خط · Shift يقيّده بزاوية 45° · أضف الأسهم في اللوحة بعد التحرير","mode.table":"اسحب لتحديد شبكة الجدول، أو انقر لوضع جدول 3×3 · انقر نقرًا مزدوجًا على الخلايا للكتابة","mode.annTextSel":"انقر على النص للتحرير · اسحب للتحريك · Del للحذف","mode.annTableSel":"انقر على خلية لملئها · اسحب للتحريك · Del للحذف","mode.annShapeSel":"اسحب للتحريك · اسحب المقابض لتغيير الحجم · غيّر النمط في اللوحة · Del للحذف","mode.annEditing":"اكتب · Enter للتأكيد · Esc للإلغاء · أو زرّي ✓ / ✕","mode.escSelect":"Esc لإلغاء التحديد","mode.escOther":"انقر بالزر الأيمن / Esc للإلغاء","tool.placeNoKindTooltip":"اختر نوعًا من المكتبة على اليسار، ثم انقر على لوحة الرسم","tool.undo":"تراجع","tool.undoHint":"تراجع عن آخر تعديل (تحريك / تدوير / حذف، إلخ)","tool.redo":"إعادة","tool.redoHint":"إعادة آخر تعديل تم التراجع عنه","layout.label":"التخطيط","layout.hint":"تخطيط تلقائي للمخطط بالكامل أو للتحديد فقط، وملء الفراغات","layout.allAuto":"تخطيط تلقائي للكل","layout.selAuto":"تخطيط تلقائي للتحديد","layout.allFill":"ملء العناصر غير الموضوعة","layout.selFill":"ملء العناصر غير الموضوعة في التحديد","tool.more":"المزيد","tool.moreHint":"تراجع / إعادة / تخطيط","view.menu":"العرض","view.menuHint":"تكبير، احتواء، شبكة","ctx.ariaNode":"إجراءات العقدة","ctx.ariaWire":"إجراءات السلك","ctx.ariaElement":"إجراءات العنصر","ctx.ariaEdit":"إجراءات التحرير","ctx.done":"تم","ctx.cancel":"إلغاء","ctx.rotate":"تدوير 90°","ctx.rotateHint":"تدوير التحديد باتجاه عقارب الساعة؛ تُعاد الأسلاك توجيهها عبر الأطراف الجديدة","ctx.mirror":"عكس أفقيًا","ctx.mirrorTitle":"عكس","ctx.mirrorHint":"قلب التحديد أفقيًا","ctx.delete":"حذف","ctx.color":"اللون","ctx.colorDefault":"افتراضي","ctx.colorRed":"أحمر","ctx.colorAmber":"كهرماني","ctx.colorGreen":"أخضر","ctx.colorBlue":"أزرق","ctx.colorGray":"رمادي","ctx.deleteHintNode":"فصل كل الأسلاك المتصلة بهذه العقدة (تبقى العناصر)","ctx.deleteHintWire":"إزالة هذا السلك فقط (تبقى الأسلاك الأخرى على نفس العقدة)","ctx.deleteHintElement":"إزالة التحديد وأسلاكه","ctx.resetWirePath":"إعادة الضبط إلى التوجيه التلقائي","ctx.resetWirePathHint":"تجاهل النقاط اليدوية ودع الموجّه يعيد رسم هذا السلك","menu.undo":"تراجع","menu.redo":"إعادة","menu.cut":"قص","menu.copy":"نسخ","menu.paste":"لصق","menu.rotate":"تدوير 90°","menu.mirror":"عكس","menu.resetLabel":"إعادة ضبط موضع التسمية","menu.selectAll":"تحديد الكل","menu.disconnect":"فصل هذا السلك","menu.delete":"حذف","io.parseFailed":"فشل تحليل JSON: {err}","io.notObject":"الملف ليس كائن JSON","io.versionMismatch":'عدم تطابق الإصدار: المتوقع "1"، والفعلي {actual}',"io.elementsMissing":"الحقل `elements` مفقود أو ليس مصفوفة","compile.duplicateId":'معرّف عنصر مكرر: "{id}"',"compile.unknownKind":'نوع عنصر غير معروف kind="{kind}"',"compile.invalidTermRef":'إشارة طرف غير صالحة "{ref}"',"compile.elementMissing":'إشارة إلى عنصر غير موجود "{id}"',"compile.missingPin":'العنصر "{id}" (kind={kind}) لا يحتوي على طرف "{pin}"؛ المتاح: {available}',"compile.singleTerminal":"العقدة تحتوي على طرف واحد فقط — تم تجاهلها","compile.layoutMissingElement":'مفتاح layout "{id}" يشير إلى عنصر غير موجود',"compile.elementUnconnected":'العنصر "{id}" لا يحتوي على أي اتصالات',"cat.busbar":"الشريط الناقل / التوصيلات","cat.switching":"المفاتيح والقواطع","cat.protection":"الحماية","cat.motor-control":"التحكم بالمحركات","cat.transformer":"المحولات","cat.instrument-transformer":"محولات القياس","cat.measurement":"القياس","cat.source":"المصادر","cat.load":"الأحمال","cat.storage":"التخزين","cat.compensation":"التعويض","cat.grounding":"التأريض","cat.renewable":"الطاقة المتجددة / الإلكترونيات الكهربائية","onboard.title":"البدء السريع","onboard.step1.title":"وضع عنصر","onboard.step1.body":"اختر أداة الإضافة (P) واسحب نوعًا من المكتبة إلى لوحة الرسم","onboard.step2.title":"وصّله","onboard.step2.body":"استخدم أداة السلك (W): اسحب من طرف إلى آخر — السحب إلى مساحة فارغة يضع نقطة وصل","onboard.step3.title":"الشريط الناقل قضيب مشترك، وليس سلكًا","onboard.step3.body":"استخدم أداة الشريط الناقل (B) فقط عندما تشترك عدة دوائر في قضيب واحد. لا تستخدم الشريط الناقل لربط جهازين — فقط وصّل الأطراف بسلك (W).","onboard.dismiss":"فهمت"},m$={"arc-suppression-coil.name":"ملف إخماد القوس","arrester.name":"مانع الصواعق (FBL)","async-motor.name":"محرك غير متزامن","autotransformer.name":"محول ذاتي","battery.name":"بطارية التخزين","breaker.name":"قاطع الدائرة (QF)","busbar.name":"مقطع الشريط الناقل","converter-bidir.name":"محوّل ثنائي الاتجاه (PCS)","dc-dc-converter.name":"محول DC/DC","mppt.name":"وحدة تحكم MPPT","ct.name":"محول التيار (CT)","disconnector.name":"مفتاح العزل (QS)","earth.name":"أرضي","earthing-switch.name":"مفتاح التأريض (QE)","fuse.name":"منصهر (FU)","generator.name":"مولد (G)","grid-source.name":"مصدر الشبكة","grounding-transformer.name":"محول التأريض (توصيل متعرج)","inverter.name":"عاكس (DC→AC)","load-switch.name":"مفتاح قطع الحمل","load.name":"حمل","luminaire.name":"مصباح (حمل إنارة)","panelboard.name":"لوحة توزيع / مركز أحمال","ngr.name":"مقاومة تأريض المحايد (NGR)","pt.name":"محول الجهد (PT)","pv.name":"وحدة كهروضوئية","rectifier.name":"مقوّم (AC→DC)","series-reactor.name":"مفاعل توالي","shunt-capacitor.name":"مكثف توازي","shunt-reactor.name":"مفاعل توازي","sync-motor.name":"محرك متزامن","transformer-2w.name":"محول ثنائي الملفات","transformer-3w.name":"محول ثلاثي الملفات","wind-turbine.name":"توربين رياح","gfci-breaker.name":"قاطع GFCI (RCBO)","rcd.name":"جهاز التيار المتبقي (RCD)","recloser.name":"قاطع إعادة التوصيل (Recloser)","energy-meter.name":"عداد الطاقة (Wh)","voltmeter.name":"فولتميتر (V)","ammeter.name":"أميتر (A)","wattmeter.name":"واتميتر (W)","frequency-meter.name":"مقياس التردد (Hz)","contactor.name":"كونتاكتور (KM)","motor-starter.name":"مشغّل محرك","thermal-overload.name":"مرحل الحمل الزائد الحراري","vfd.name":"مشغّل بتردد متغير (VFD)","soft-starter.name":"مشغّل ناعم","transfer-switch.name":"مفتاح تحويل (ATS)","dc-disconnector.name":"مفتاح عزل التيار المستمر","dc-combiner.name":"صندوق تجميع التيار المستمر","ev-charger.name":"شاحن السيارات الكهربائية","arc-suppression-coil.desc":"تأريض محايد رنيني: ملف حثي متصل بالأرض","busbar.desc":"مقطع شريط ناقل واحد قابل للتمديد بعدة نقاط تفريع","converter-bidir.desc":"محول تخزين: تيار متردد ↔ تيار مستمر ثنائي الاتجاه","dc-dc-converter.desc":"محول DC/DC / شاحن تيار مستمر (IEC 60617)","mppt.desc":"وحدة تحكم شمسية MPPT (DC/DC، تتبع نقطة القدرة القصوى)","earthing-switch.desc":"مفتاح عزل + اتصال أرضي، منفذ واحد","grid-source.desc":"شريط ناقل لانهائي / شبكة خارجية","grounding-transformer.desc":"محول نجمي-متعرج لتأريض المحايد","load.desc":"حمل تجريدي (سهم خروج التيار)","luminaire.desc":"حمل إنارة (رمز عام للمصباح وفق IEC 60617)","ngr.desc":"تأريض بمقاومة منخفضة: محايد المحول إلى الأرض","series-reactor.desc":"نفس رمز مفاعل التوازي؛ يُميَّز حسب الاستخدام","wind-turbine.desc":"توربين رياح: مولد + علامة دوار ثلاثي الريش","gfci-breaker.desc":"قاطع تيار متبقٍ مزود بحماية من التيار الزائد (UL943 / IEC 61009). يُعرف بـ GFCI في أمريكا الشمالية و RCBO في أوروبا.","rcd.desc":"قاطع تيار متبقٍ بدون حماية من التيار الزائد (IEC 61008).","recloser.desc":"قاطع إعادة غلق تلقائي للجهد المتوسط.","energy-meter.desc":"عداد طاقة فعالة (kWh) — عند نقطة الدخول أو كعداد فرعي.","contactor.desc":"كونتاكتور الدائرة الرئيسية؛ يُستخدم عادةً مع مرحل حمل زائد حراري ومحرك.","motor-starter.desc":"مشغّل محرك (الرمز العام IEC 60617).","thermal-overload.desc":"مرحل حمل زائد حراري للمحرك؛ يوضع بين الكونتاكتور والمحرك.","vfd.desc":"مشغّل بتردد متغير للتحكم في سرعة المحرك الحثي.","soft-starter.desc":"مشغّل ناعم للمحرك (تشغيل بجهد مخفّض باستخدام الثايرستور).","transfer-switch.desc":"مفتاح تحويل بمصدرين (ATS / يدوي). مدخلا مصدرين + مخرج حمل واحد، مع تأمين ميكانيكي متبادل.","dc-disconnector.desc":"مفتاح عزل للتيار المستمر — لعزل جانب التيار المستمر لسلسلة الألواح الكهروضوئية / البطارية.","dc-combiner.desc":"صندوق تجميع لسلاسل الألواح الكهروضوئية (مثال بأربعة مداخل).","ev-charger.desc":"محطة شحن السيارات الكهربائية.","breaker.state.open":"مفتوح","disconnector.state.open":"مفتوح","earthing-switch.state.open":"مفتوح","fuse.state.blown":"محترق","load-switch.state.open":"مفتوح","gfci-breaker.state.open":"مفتوح","rcd.state.open":"مفتوح","recloser.state.open":"مفتوح","contactor.state.open":"مفتوح","thermal-overload.state.tripped":"متعثر","transfer-switch.state.position":"الموضع (عادي/طوارئ/إيقاف)","dc-disconnector.state.open":"مفتوح","battery.param.E":"السعة","busbar.param.Un":"الجهد الاسمي","converter-bidir.param.S":"السعة","dc-dc-converter.param.P":"القدرة","mppt.param.I":"التيار الاسمي","load.param.P":"القدرة الفعالة","load.param.cosphi":"معامل القدرة","ngr.param.R":"المقاومة","shunt-capacitor.param.Q":"القدرة التفاعلية","shunt-capacitor.param.stages":"المراحل","transformer-2w.param.S":"السعة","transformer-2w.param.ratio":"نسبة التحويل","gfci-breaker.param.In":"التيار الاسمي","panelboard.param.In":"التيار المقنن","gfci-breaker.param.IDn":"تيار التشغيل المتبقي","rcd.param.IDn":"تيار التشغيل المتبقي","breaker.param.In":"التيار الاسمي","breaker.param.poles":"عدد الأقطاب","breaker.param.Icu":"قدرة القطع","disconnector.param.In":"التيار الاسمي","fuse.param.In":"التيار الاسمي","resistor.name":"مقاومة (R)","capacitor.name":"مكثف (C)","diode.name":"ديود (D)","indicator-light.name":"مصباح إشارة (HL)","push-button.name":"زر ضغط (SB)","relay-coil.name":"ملف مرحل (KA)","make-contact.name":"تماس مفتوح عادةً (NO)","break-contact.name":"تماس مغلق عادةً (NC)","bell.name":"جرس (HA)","terminal.name":"طرف / نقطة وصل (X)","fuse-switch-disconnector.name":"مفتاح فصل مزود بمصهر","socket-outlet.name":"مقبس / موصل","inductor.name":"ملف حثي (L)","voltage-regulator.name":"منظم الجهد (T)","dc-motor.name":"محرك تيار مستمر (M)","heater.name":"عنصر تسخين (EH)","selector-switch.name":"مفتاح اختيار (SA)","limit-switch.name":"مفتاح حدّي (SQ)","proximity-switch.name":"مفتاح تقارب (SQ)","time-relay.name":"مرحل زمني (KT)","buzzer.name":"طنّان (HA)","siren.name":"صفارة إنذار (HA)","thermocouple.name":"مزدوجة حرارية (BT)","thyristor.name":"ثايرستور / SCR (V)","triac.name":"ترياك (V)","zener-diode.name":"ديود زينر (D)","igbt.name":"IGBT","plc.name":"PLC / متحكم","ups.name":"UPS","power-supply.name":"مزود طاقة (PS)","genset.name":"مجموعة مولد (G)","protective-relay.name":"مرحل حماية","overcurrent-relay.name":"مرحل تيار زائد (50/51)","undervoltage-relay.name":"مرحل انخفاض الجهد (27)","reverse-power-relay.name":"مرحل القدرة العكسية (32)","distance-relay.name":"مرحل مسافة (21)","phase-failure-relay.name":"مرحل فقد الطور","buchholz-relay.name":"مرحل بوخهولز (63)","power-factor-meter.name":"مقياس معامل القدرة (cosφ)","synchronoscope.name":"مقياس التزامن","varmeter.name":"مقياس القدرة التفاعلية (var)","resistor.desc":"مقاومة عامة / للحد من التيار / مقاومة كبح.","capacitor.desc":"مكثف عام / للترشيح / لناقل التيار المستمر. استخدم مكثف التوازي لتصحيح معامل القدرة.","diode.desc":"ديود تقويم / تدوير حر / حماية. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","indicator-light.desc":"مصباح إشارة / حالة.","push-button.desc":"زر ضغط يدوي، رجوع تلقائي (تماس مفتوح عادةً).","relay-coil.desc":"ملف تشغيل مرحل / كونتاكتور (صندوق).","make-contact.desc":"تماس مساعد مفتوح عادةً (توصيل عند التشغيل).","break-contact.desc":"تماس مساعد مغلق عادةً (فصل عند التشغيل).","bell.desc":"جرس إشارة / جرس إنذار.","terminal.desc":"طرف / صندوق توصيل / عقدة اتصال.","fuse-switch-disconnector.desc":"مفتاح فصل مزود بمصهر يعمل تحت الحمل.","socket-outlet.desc":"مقبس كهربائي / موصل متعدد الأقطاب.","inductor.desc":"ملف حثي عام / وشيعة / خانق.","voltage-regulator.desc":"منظم جهد حثي قابل للتعديل / محول ذاتي.","dc-motor.desc":"محرك تيار مستمر (الرمز العام لملف المجال التوالي).","heater.desc":"عنصر تسخين مقاوم / حمل تسخين.","selector-switch.desc":"مفتاح اختيار / تحويل (دوّار، يثبت في وضعه).","limit-switch.desc":"مفتاح حركة / موضع (مفتوح عادةً، يعمل ميكانيكيًا).","proximity-switch.desc":"حساس تقارب / مفتاح تقارب بلا تماس.","time-relay.desc":"ملف مرحل زمني (تأخير التشغيل).","buzzer.desc":"طنّان إشارة.","siren.desc":"صفارة إنذار صوتية.","thermocouple.desc":"حساس حرارة من نوع مزدوجة حرارية.","thyristor.desc":"ثايرستور ثلاثي الأطراف حاجب عكسي / SCR. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","triac.desc":"ثايرستور ثلاثي ثنائي الاتجاه (TRIAC).","zener-diode.desc":"ديود زينر / منظم جهد. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","igbt.desc":"IGBT معزز قناة-N. t1 = المجمّع (أعلى)، t2 = الباعث (أسفل)، t_g = البوابة.","plc.desc":"متحكم منطقي قابل للبرمجة (PLC).","ups.desc":"مزود طاقة غير منقطع (UPS) خطي / احتياطي.","power-supply.desc":"مزود طاقة بتحويل مفتاح AC→DC / تيار مستمر. t_ac أعلى (~)، t_dc أسفل (=).","genset.desc":"مجموعة مولد ديزل / غاز.","protective-relay.desc":"مرحل قياس / حماية، رمز عام (IEC 60617).","overcurrent-relay.desc":"مرحل حماية من التيار الزائد (ANSI 50/51).","undervoltage-relay.desc":"مرحل حماية من انخفاض الجهد (ANSI 27).","reverse-power-relay.desc":"مرحل حماية من القدرة العكسية / التيار العكسي (ANSI 32).","distance-relay.desc":"مرحل حماية مسافة / انخفاض الممانعة (ANSI 21).","phase-failure-relay.desc":"مرحل حماية من فقد الطور.","buchholz-relay.desc":"مرحل بوخهولز / الغاز (ANSI 63).","power-factor-meter.desc":"مقياس معامل القدرة (cosφ).","synchronoscope.desc":"مؤشر التزامن / مقياس التزامن.","varmeter.desc":"مقياس القدرة التفاعلية (var).","make-contact.state.closed":"مغلق","break-contact.state.open":"مفتوح","on-delay-make-contact.name":"تماس مفتوح عادةً بتأخير عند التشغيل (KT)","off-delay-make-contact.name":"تماس مفتوح عادةً بتأخير عند الفصل (KT)","on-delay-break-contact.name":"تماس مغلق عادةً بتأخير عند التشغيل (KT)","off-delay-break-contact.name":"تماس مغلق عادةً بتأخير عند الفصل (KT)","continuation-out.name":"وصلة إلى صفحة أخرى (خارجة)","continuation-in.name":"وصلة من صفحة أخرى (داخلة)","on-delay-make-contact.desc":"تماس مؤقِّت مفتوح عادةً: يُغلق بعد التأخير عند تغذية الملف (IEC 60617-07-05-01).","off-delay-make-contact.desc":"تماس مؤقِّت مفتوح عادةً: يُفتح بعد التأخير عند فصل تغذية الملف (IEC 60617-07-05-02).","on-delay-break-contact.desc":"تماس مؤقِّت مغلق عادةً: يُفتح بعد التأخير عند تغذية الملف (IEC 60617-07-05-03).","off-delay-break-contact.desc":"تماس مؤقِّت مغلق عادةً: يُغلق بعد التأخير عند فصل تغذية الملف (IEC 60617-07-05-04).","continuation-out.desc":"ينقطع السلك هنا ويستمر في مكان آخر. الوصلات التي تحمل الاسم نفسه هي السلك نفسه.","continuation-in.desc":"يستمر هنا سلك قادم من مكان آخر. الوصلات التي تحمل الاسم نفسه هي السلك نفسه.","on-delay-make-contact.state.closed":"مغلق","on-delay-make-contact.param.delay":"التأخير","off-delay-make-contact.state.closed":"مغلق","off-delay-make-contact.param.delay":"التأخير","on-delay-break-contact.state.open":"مفتوح","on-delay-break-contact.param.delay":"التأخير","off-delay-break-contact.state.open":"مفتوح","off-delay-break-contact.param.delay":"التأخير","continuation-out.param.target":"يستمر في","continuation-in.param.target":"قادم من","async-motor.param.P":"القدرة","sync-motor.param.P":"القدرة","dc-motor.param.P":"القدرة","ev-charger.param.P":"القدرة","socket-outlet.param.P":"القدرة","luminaire.param.P":"القدرة","fuse-switch-disconnector.state.open":"مفتوح","selector-switch.state.open":"مفتوح","limit-switch.state.closed":"مغلق","resistor.param.R":"المقاومة","resistor.param.P":"القدرة الاسمية","capacitor.param.C":"السعة الكهربائية","capacitor.param.Un":"الجهد الاسمي","indicator-light.param.color":"اللون","inductor.param.L":"المحاثة","inductor.param.In":"التيار الاسمي","voltage-regulator.param.ratio":"نطاق التنظيم","heater.param.P":"القدرة","ups.param.S":"السعة","power-supply.param.Vdc":"جهد الخرج","genset.param.P":"القدرة"},p$={ui:u$,library:m$},h$={"common.unnamed":"ללא שם","common.close":"סגור","common.yes":"כן","common.no":"לא","topbar.theme.toLight":"עבור למצב בהיר","topbar.theme.toDark":"עבור למצב כהה","topbar.theme.currentDark":"נוכחי: ערכת נושא כהה","topbar.theme.currentLight":"נוכחי: ערכת נושא בהירה","topbar.lang.toEnglish":"עבור לאנגלית","topbar.lang.toChinese":"עבור לסינית","topbar.lang.currentEnglish":"נוכחי: אנגלית","topbar.lang.currentChinese":"נוכחי: סינית","topbar.export.label":"ייצוא","topbar.export.tooltip":"SVG וקטורי (ניתן לעריכה), PNG (2×, רזולוציה גבוהה), או DXF (CAD)","topbar.export.pngFailed":"ייצוא PNG נכשל: {err}","topbar.export.dxfFailed":"ייצוא DXF נכשל: {err}","topbar.file.label":"קובץ","topbar.file.tooltip":"פתחו תרשים .json מקומי, שמרו, או שמרו בשם","topbar.file.current":"נוכחי: {name}","topbar.file.new":"חדש","topbar.file.open":"פתח…","topbar.file.save":"שמור","topbar.file.saveAs":"שמור בשם…","topbar.file.newConfirm":"יצירת קובץ חדש תמחק שינויים שלא נשמרו. להמשיך?","topbar.file.openFailed":"פתיחה נכשלה: {err}","topbar.file.saveFailed":"שמירה נכשלה: {err}","topbar.file.fileDescription":"תרשים OneLineEditor","outline.title":"מבנה","outline.collapse":"כווץ","outline.collapseAria":"כווץ את המבנה","outline.empty":"(אין רכיבים — גררו מהספרייה כדי להתחיל)","props.title":"מאפיינים","props.node":"צומת חשמלי","props.wire":"תיל","props.bus":"פס צבירה","props.junction":"מחבר","props.junctionPos":"מיקום","props.nSelected":"{n} נבחרו","props.empty":"לא נבחר דבר","props.multi":"{n} פריטים נבחרו","props.name":"שם","props.note":"הערה","props.label":"תווית","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"צומת חשמלי {id} לא נמצא","props.wireNotFound":"תיל {id} לא נמצא","props.nodeStats":"{terminals} הדקים · {elements} רכיבים","props.selectElement":"בחר {label}","props.selectWholeNode":"בחר את כל הצומת החשמלי","props.annText":"טקסט","props.annRect":"מלבן","props.annEllipse":"אליפסה","props.annLine":"קו","props.annTable":"טבלה","props.annNotFound":"סימון {id} לא נמצא","props.annLabel":"תווית","props.annLabelPlaceholder":"לדוגמה: לוח 1#","props.color":"צבע","props.size":"גודל","props.sizeReset":"איפוס ל-100%","props.labelShown":"מוצגת","props.labelHidden":"מוסתרת","props.contactType":"מגע","props.direction":"כיוון","props.directionOut":"יוצא","props.directionIn":"נכנס","props.partner":"בן זוג","props.partnerUnnamed":"תנו שם כדי להתאים להמשך בעל אותו שם","props.partnerNone":"אין בן זוג בשרטוט הזה","props.partnerJump":"מעבר אל {id}","health.title":"בדיקה","health.hint":"בדיקת חיבורים והזנה: רמזים והערכות, לא בדיקת התאמה לתקן","health.markers":"הצגה בשרטוט","health.none":"לא נמצאו בעיות","health.sectionProblems":"בעיות","health.sectionNotes":"הערות","health.sectionDismissed":"סומנו כמכוונים","health.sectionLoads":"סיכומי עומס","health.dismiss":"זה מכוון","health.restore":"שחזור","health.loadKnown":"ידוע {kw} kW ({k}/{t} עומסים)","health.loadAll":"{kw} kW ({t} עומסים)","health.label.unwired":"לא מחובר","health.label.looks-joined":"נראה מחובר, אבל לא","health.label.dangling-wire":"קצה חוט פתוח","health.label.supply-disconnected":"מקור לא מחובר","health.label.unsupplied":"אין מסלול למקור","health.label.no-origin":"אין סמל מקור","health.label.voltage-mix":"רמות מתח מחוברות","health.label.ratio-mismatch":"יחס לא תואם","health.label.label-mismatch":"שם מול פרמטר","health.label.overload":"מעל ההספק הנקוב","health.label.feeder-end":"המזין מסתיים כאן","health.label.open-side":"צד ההזנה פתוח","health.introTitle":"בדיקת שרטוט","health.intro":"נמצאו {n} בעיות אפשריות בחיבורים של השרטוט. הנקודות מראות איפה. אלה רמזים לפי החיווט, לא בדיקת תקן.","health.introShow":"הצגה","health.introOk":"הבנתי","health.loading":"{pct}% מתוך {rating} kVA","health.disclaimer":"רמזים והערכות לפי החיבורים בשרטוט, לא בדיקת התאמה לתקן.","health.overloadUnits":"יותר מפי 10 מההספק הנקוב: בדקו את יחידות העומסים (ה-P של עומס כללי הוא ב-MW).","health.code.unwired":"{name} אינו מחובר. נגיעה בקו אינה חיבור: שרטטו חוט עד ההדק שלו.","health.code.looks-joined":"כאן חוט מסתיים על נקודת חיבור אחרת בלי להתחבר אליה: הוא נראה מחובר, אבל אינו מחובר.","health.code.dangling-wire":"כאן קצה חוט אינו מחובר לשום דבר.","health.code.supply-disconnected":"{name} אינו מחובר לשאר השרטוט: ל-{count} מתוך {total} רכיבים אין מסלול למקור הזנה.","health.code.unsupplied":"ל-{count} רכיבים כאן אין מסלול לשום מקור הזנה.","health.code.no-origin":"בשרטוט אין סמל של מקור הזנה. הוסיפו רשת או גנרטור כדי לבדוק מסלולי הזנה ולראות סיכומי עומס.","health.code.voltage-mix":"כאן {a} kV ו-{b} kV מחוברים בלי שנאי.","health.code.ratio-mismatch":"{name}: היחס {ratio} אינו תואם את פסי הצבירה משני צדדיו ({a} kV / {b} kV).","health.code.label-mismatch":"{name}: השם והפרמטר {param} ({value}) אינם תואמים.","health.code.overload":"{name}: העומס הידוע {load} kVA גבוה מההספק הנקוב {rating} kVA (כל העומסים בהספק מלא, בלי מקדם בו-זמניות).","health.code.feeder-end":"{name}: המזין מסתיים כאן.","health.code.open-side":"{name}: צד ההזנה אינו מחובר (לרוב זה קצה הכניסה של השרטוט).","props.color.default":"ברירת מחדל","props.color.red":"אדום","props.color.amber":"ענבר","props.color.green":"ירוק","props.color.blue":"כחול","props.color.gray":"אפור","props.annStroke":"סוג קו","props.annStrokeSolid":"רציף","props.annStrokeDashed":"מקווקו","props.annStrokeDotted":"מנוקד","props.annStrokeWidth":"עובי","props.annWidthThin":"דק","props.annWidthMedium":"בינוני","props.annWidthThick":"עבה","props.annFill":"מילוי","props.annFillNone":"ללא","props.annFillTint":"גוון","props.annArrow":"חיצים","props.annArrowNone":"ללא","props.annArrowEnd":"קצה אחד","props.annArrowBoth":"שני קצוות","props.annFontSize":"גודל גופן","props.annRows":"שורות","props.annCols":"עמודות","view.zoomOut":"הקטן תצוגה","view.zoomOutHint":"הקטנה מדורגת; ניתן גם עם גלגלת ↓ או ⌘−","view.reset":"אפס ל-100%","view.current":"נוכחי {z}%","view.zoomIn":"הגדל תצוגה","view.zoomInHint":"הגדלה מדורגת; ניתן גם עם גלגלת ↑ או ⌘+","view.fit":"התאם תצוגה","view.fitHint":"מתאים אוטומטית ומרכז את כל השרטוט","view.gridHide":"הסתר רשת","view.gridShow":"הצג רשת","view.gridHotkey":"G","view.gridHideHint":"גם מבטל הצמדה לרשת (מיקום חופשי)","view.gridShowHint":"גם מפעיל הצמדה לרשת (הצמדה ל-10px בגרירה)","view.gridHideAria":"הסתר רשת ובטל הצמדה","view.gridShowAria":"הצג רשת והפעל הצמדה","view.label":"תוויות","view.labelOff":"כבוי","view.labelId":"מזהה","view.labelAll":"מזהה + פרמטרים","view.labelHint":"תצוגת תוויות וגודל הגופן (חל גם על הייצוא)","view.labelSize":"גודל","view.labelSizeSmaller":"הקטנת גופן התוויות","view.labelSizeLarger":"הגדלת גופן התוויות","view.standard":"תקן הסמלים","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"משנה רק את ציור הסמלים — החיווט, המיקומים והנתונים נשארים כפי שהם. מפסק זרם ונתיך משורטטים אחרת בכל תקן.","view.labelSizeReset":"איפוס גודל התוויות","library.title":"ספריית רכיבים","tool.draw":"ציור","tool.drawHint":"טקסט, מסגרות, עיגולים, קווים וטבלאות — הערות חופשיות על השרטוט","library.empty":"לא נמצאו רכיבים תואמים","cat.custom":"בשרטוט הזה","library.customTag":"מותאם","library.customHint":"מוגדר בשרטוט הזה — לא קיים בספרייה של אף אחד אחר","library.createComponent":"רכיב חדש…","library.searchPlaceholder":"חיפוש רכיבים…","library.searchAria":"חיפוש רכיבים","library.clearSearch":"נקה חיפוש","library.itemHint":"לחצו כדי להיכנס למצב מיקום, או גררו אל הקנבס","tool.select":"בחירה","tool.selectHint":"לחיצה לבחירת רכיב, גרירת מסגרת לבחירה מרובה, קליק ימני לתפריט","tool.pan":"הזזה","tool.panHint":"גררו את הקנבס; מקש הרווח מפעיל זמנית","tool.wire":"תיל","tool.wireHint":"גררו מהדק / פס צבירה / מחבר; גרירה לשטח ריק יוצרת מחבר חדש, וגרירה על תיל קיים מתחברת אליו","tool.bus":"פס צבירה","tool.busHint":"גררו על הקנבס — לחצו לקביעת נקודת ההתחלה, שחררו לקביעת הסיום","tool.junction":"מחבר","tool.junctionHint":"לחצו על הקנבס כדי להציב מחבר (צומת); ניתן לחבר אליו תילים בחופשיות","tool.place":"הצבה","tool.placeHint":"לחצו כדי להציב; או גררו מהדק / פס צבירה כדי להציב ולחבר בו-זמנית","tool.text":"טקסט","tool.textHint":"לחצו על הקנבס כדי להוסיף הערת טקסט; לחיצה כפולה על הערה קיימת לעריכה","tool.rect":"מלבן","tool.rectHint":"גררו כדי לצייר מלבן / מסגרת קיבוץ (מקווקו כברירת מחדל); Shift לריבוע","tool.ellipse":"אליפסה","tool.ellipseHint":"גררו לציור אליפסה; החזיקו Shift לעיגול","tool.line":"קו","tool.lineHint":"גררו כדי לצייר קו סימון; Shift מצמיד ל-45°; חיצים זמינים בפאנל המאפיינים","tool.table":"טבלה","tool.tableHint":"גררו כדי לקבוע עמודות × שורות (ספירה חיה), או לחצו לטבלת ברירת מחדל; לחיצה כפולה על תא להקלדה","mode.selectWithSel":"גררו רכיבים · גררו מהדקים כדי לחווט · קליק ימני לתפריט","mode.selectEmpty":"לחצו לבחירה · גררו להזזה · מסגרת לבחירה מרובה · קליק ימני לתפריט","mode.pan":"גררו את הקנבס · גלגלת לזום · החזיקו Space כדי להזיז בכל כלי","mode.wireDragging":"שחררו על הדק / פס צבירה / מחבר; שחרור בשטח ריק יוצר מחבר חדש","mode.wireInit":"לחצו על כל נקודת חיבור או שטח ריק, גררו ליעד ושחררו","mode.busDragging":"הגרירה קובעת את כיוון הפס; השחרור קובע את הסיום","mode.busInit":"לחצו על הקנבס לקביעת ההתחלה, גררו, ושחררו לקביעת הסיום","mode.junction":"לחצו על הקנבס כדי להציב מחבר","mode.placeNoKind":"בחרו סוג רכיב מהספרייה בצד שמאל","mode.placeFromTerm":"שחררו ביעד — הרכיב החדש יתחבר בחזרה להדק המקור","mode.placeNormal":"לחצו על שטח ריק כדי להציב; או גררו מהדק / פס צבירה כדי להציב ולחבר","mode.text":"לחצו להוספת טקסט · לחיצה כפולה לעריכה · גררו רכיב נבחר להזזה · Del להסרה","mode.rect":"גררו לציור מלבן · Shift לריבוע · שנו גודל והוסיפו תווית לאחר השחרור","mode.ellipse":"גררו לציור אליפסה · Shift לעיגול · שנו גודל, צבע והוסיפו תווית לאחר השחרור","mode.line":"גררו לציור קו · Shift מצמיד ל-45° · הוסיפו חיצים בפאנל לאחר השחרור","mode.table":"גררו לקביעת הרשת, או לחצו לטבלת 3×3 · לחיצה כפולה על תא להקלדה","mode.annTextSel":"לחצו על הטקסט לעריכה · גררו להזזה · Del להסרה","mode.annTableSel":"לחצו על תא למילוי · גררו להזזה · Del להסרה","mode.annShapeSel":"גררו להזזה · גררו את הידיות לשינוי גודל · שנו סגנון בפאנל · Del להסרה","mode.annEditing":"הקלידו · Enter לאישור · Esc לביטול · או כפתורי ✓ / ✕","mode.escSelect":"Esc מנקה את הבחירה","mode.escOther":"קליק ימני / Esc לביטול","tool.placeNoKindTooltip":"בחרו סוג רכיב בספרייה בצד שמאל, ואז לחצו על הקנבס","tool.undo":"בטל","tool.undoHint":"בטל את הפעולה האחרונה (הזזה / סיבוב / מחיקה וכו׳)","tool.redo":"בצע שוב","tool.redoHint":"בצע שוב את הפעולה האחרונה שבוטלה","layout.label":"פריסה","layout.hint":"פריסה אוטומטית של כל התרשים או רק של הבחירה, ומילוי פערים","layout.allAuto":"פריסה אוטומטית לכל התרשים","layout.selAuto":"פריסה אוטומטית לבחירה","layout.allFill":"מלא רכיבים לא ממוקמים","layout.selFill":"מלא רכיבים לא ממוקמים בבחירה","tool.more":"עוד","tool.moreHint":"בטל / בצע שוב / פריסה","view.menu":"תצוגה","view.menuHint":"זום, התאמה, רשת","ctx.ariaNode":"פעולות על צומת","ctx.ariaWire":"פעולות על תיל","ctx.ariaElement":"פעולות על רכיב","ctx.ariaEdit":"פעולות עריכה","ctx.done":"סיום","ctx.cancel":"ביטול","ctx.rotate":"סובב 90°","ctx.rotateHint":"סובב את הבחירה בכיוון השעון; התילים ינותבו מחדש דרך ההדקים החדשים","ctx.mirror":"שקף אופקית","ctx.mirrorTitle":"שיקוף","ctx.mirrorHint":"הפוך את הבחירה מימין לשמאל","ctx.delete":"מחק","ctx.color":"צבע","ctx.colorDefault":"ברירת מחדל","ctx.colorRed":"אדום","ctx.colorAmber":"ענבר","ctx.colorGreen":"ירוק","ctx.colorBlue":"כחול","ctx.colorGray":"אפור","ctx.deleteHintNode":"נתק את כל התילים בצומת זה (הרכיבים נשארים)","ctx.deleteHintWire":"הסר רק את התיל הזה (תילים אחרים באותו צומת נשארים)","ctx.deleteHintElement":"הסר את הבחירה ואת התילים המחוברים אליה","ctx.resetWirePath":"אפס לניתוב אוטומטי","ctx.resetWirePathHint":"הסר פינות ידניות ותן לניתוב האוטומטי לצייר מחדש את התיל","menu.undo":"בטל","menu.redo":"בצע שוב","menu.cut":"גזור","menu.copy":"העתק","menu.paste":"הדבק","menu.rotate":"סובב 90°","menu.mirror":"שיקוף","menu.resetLabel":"איפוס מיקום התווית","menu.selectAll":"בחר הכל","menu.disconnect":"נתק תיל זה","menu.delete":"מחק","io.parseFailed":"ניתוח JSON נכשל: {err}","io.notObject":"הקובץ אינו אובייקט JSON","io.versionMismatch":'אי-התאמת גרסה: צפוי "1", התקבל {actual}',"io.elementsMissing":"השדה `elements` חסר או שאינו מערך","compile.duplicateId":'מזהה רכיב כפול: "{id}"',"compile.unknownKind":'סוג רכיב לא ידוע kind="{kind}"',"compile.invalidTermRef":'הפניית הדק לא תקינה "{ref}"',"compile.elementMissing":'הפניה לרכיב לא ידוע "{id}"',"compile.missingPin":'לרכיב "{id}" (kind={kind}) אין הדק "{pin}"; זמינים: {available}',"compile.singleTerminal":"לצומת יש הדק אחד בלבד — הצומת נדחה","compile.layoutMissingElement":'מפתח ה-layout "{id}" מפנה לרכיב לא ידוע',"compile.elementUnconnected":'לרכיב "{id}" אין חיבורים',"cat.busbar":"פס צבירה / חיווט","cat.switching":"מיתוג","cat.protection":"הגנה","cat.motor-control":"בקרת מנועים","cat.transformer":"שנאים","cat.instrument-transformer":"שנאי מדידה","cat.measurement":"מדידה","cat.source":"מקור","cat.load":"עומס","cat.storage":"אגירת אנרגיה","cat.compensation":"פיצוי הספק מגיב","cat.grounding":"הארקה","cat.renewable":"אנרגיה מתחדשת / אלקטרוניקת הספק","onboard.title":"התחלה מהירה","onboard.step1.title":"הציבו רכיב","onboard.step1.body":"בחרו בכלי הצבה (P) וגררו סוג רכיב מהספרייה אל הקנבס","onboard.step2.title":"חברו בתילים","onboard.step2.body":"השתמשו בכלי תיל (W): גררו מהדק אחד לאחר — גרירה לשטח ריק תיצור מחבר","onboard.step3.title":"פס צבירה הוא פס משותף, לא תיל","onboard.step3.body":"השתמשו בכלי פס צבירה (B) רק כשכמה מעגלים חולקים פס אחד. אל תשתמשו בפס צבירה כדי לחבר שני התקנים — פשוט חברו את ההדקים בתיל (W).","onboard.dismiss":"הבנתי"},f$={"arc-suppression-coil.name":"סליל דעיכת קשת","arrester.name":"מגן ברקים (FBL)","async-motor.name":"מנוע אסינכרוני","autotransformer.name":"שנאי אוטו","battery.name":"אגירת מצברים","breaker.name":"מפסק (QF)","busbar.name":"קטע פס צבירה","converter-bidir.name":"ממיר דו-כיווני (PCS)","dc-dc-converter.name":"ממיר DC/DC","mppt.name":"בקר MPPT","ct.name":"שנאי זרם (CT)","disconnector.name":"מנתק (QS)","earth.name":"הארקה","earthing-switch.name":"מפסק הארקה (QE)","fuse.name":"נתיך (FU)","generator.name":"גנרטור (G)","grid-source.name":"מקור הזנה מהרשת","grounding-transformer.name":"שנאי הארקה (זיגזג)","inverter.name":"ממיר (DC→AC)","load-switch.name":"מפסק עומס","load.name":"עומס","luminaire.name":"גוף תאורה (עומס תאורה)","panelboard.name":"לוח חשמל","ngr.name":"נגד הארקת נייטרלי (NGR)","pt.name":"שנאי מתח (PT)","pv.name":"מודול פוטו-וולטאי","rectifier.name":"מיישר (AC→DC)","series-reactor.name":"משרן טורי","shunt-capacitor.name":"קבל מקבילי","shunt-reactor.name":"משרן מקבילי","sync-motor.name":"מנוע סינכרוני","transformer-2w.name":"שנאי דו-סלילי","transformer-3w.name":"שנאי תלת-סלילי","wind-turbine.name":"טורבינת רוח","gfci-breaker.name":"מפסק GFCI (RCBO)","rcd.name":"התקן פחת (RCD)","recloser.name":"מפסק שחזור אוטומטי (Recloser)","energy-meter.name":"מונה אנרגיה (Wh)","voltmeter.name":"וולטמטר (V)","ammeter.name":"אמפרמטר (A)","wattmeter.name":"ואטמטר (W)","frequency-meter.name":"מד תדר (Hz)","contactor.name":"מגען (KM)","motor-starter.name":"מתנע מנוע","thermal-overload.name":"ממסר עומס יתר תרמי","vfd.name":"ממיר תדר (VFD)","soft-starter.name":"מתנע רך","transfer-switch.name":"מתג העברה (ATS)","dc-disconnector.name":"מנתק DC","dc-combiner.name":"תיבת ריכוז DC","ev-charger.name":"עמדת טעינה לרכב חשמלי","arc-suppression-coil.desc":"הארקת נייטרלי תהודתית: סליל לאדמה","busbar.desc":"קטע פס יחיד נמתח עם מספר הסתעפויות","converter-bidir.desc":"ממיר אגירה: דו-כיווני AC ↔ DC","dc-dc-converter.desc":"ממיר DC/DC / מטען DC (IEC 60617)","mppt.desc":"בקר טעינה סולארי MPPT (DC/DC, מעקב אחר נקודת ההספק המרבי)","earthing-switch.desc":"מנתק + חיבור הארקה, יציאה בודדת","grid-source.desc":"פס אינסופי / רשת חיצונית","grounding-transformer.desc":"שנאי כוכב-זיגזג להארקת נייטרלי","load.desc":"עומס מופשט (חץ יציאת זרם)","luminaire.desc":"עומס תאורה (סמל כללי לגוף תאורה לפי IEC 60617)","ngr.desc":"הארקה בהתנגדות נמוכה: נייטרלי השנאי לאדמה","series-reactor.desc":"אותו סמל כמו משרן מקבילי; ההבחנה לפי אופן השימוש","wind-turbine.desc":"טורבינת רוח: גנרטור + סימון רוטור תלת-להב","gfci-breaker.desc":"מפסק פחת עם הגנת זרם יתר (UL943 / IEC 61009). מכונה גם GFCI (צפון אמריקה) או RCBO (אירופה).","rcd.desc":"מפסק פחת ללא הגנת זרם יתר (IEC 61008).","recloser.desc":"מפסק שחזור אוטומטי במתח בינוני.","energy-meter.desc":"מונה אנרגיה פעילה (kWh) — כניסת שירות / מונה משנה.","contactor.desc":"מגען למעגל ראשי; משמש בדרך כלל עם ממסר תרמי ומנוע.","motor-starter.desc":"מתנע מנוע (סמל כללי לפי IEC 60617).","thermal-overload.desc":"ממסר עומס יתר תרמי למנוע; ממוקם בין המגען למנוע.","vfd.desc":"ממיר תדר לבקרת מהירות מנוע אסינכרוני.","soft-starter.desc":"מתנע רך למנוע (הפעלה במתח מופחת מבוססת תיריסטורים).","transfer-switch.desc":"מתג העברה דו-מקורי (ATS / ידני). שני מקורות כניסה ויציאת עומס אחת, עם נעילה הדדית ללא הזנה מקבילה.","dc-disconnector.desc":"מנתק DC — בידוד צד DC של מחרוזות פוטו-וולטאיות / מצברים.","dc-combiner.desc":"תיבת ריכוז מחרוזות פוטו-וולטאיות (דוגמה עם 4 כניסות).","ev-charger.desc":"עמדת טעינה לרכב חשמלי.","breaker.state.open":"פתוח","disconnector.state.open":"פתוח","earthing-switch.state.open":"פתוח","fuse.state.blown":"שרוף","load-switch.state.open":"פתוח","gfci-breaker.state.open":"פתוח","rcd.state.open":"פתוח","recloser.state.open":"פתוח","contactor.state.open":"פתוח","thermal-overload.state.tripped":"הופעל","transfer-switch.state.position":"מצב (רגיל/חירום/כבוי)","dc-disconnector.state.open":"פתוח","battery.param.E":"קיבולת","busbar.param.Un":"מתח נקוב","converter-bidir.param.S":"הספק נקוב","dc-dc-converter.param.P":"הספק","mppt.param.I":"זרם נקוב","load.param.P":"הספק פעיל","load.param.cosphi":"מקדם הספק","ngr.param.R":"התנגדות","shunt-capacitor.param.Q":"הספק מגיב","shunt-capacitor.param.stages":"מדרגות","transformer-2w.param.S":"הספק נקוב","transformer-2w.param.ratio":"יחס תמורה","gfci-breaker.param.In":"זרם נקוב","panelboard.param.In":"זרם נקוב","gfci-breaker.param.IDn":"זרם ניתוק פחת","rcd.param.IDn":"זרם ניתוק פחת","breaker.param.In":"זרם נקוב","breaker.param.poles":"מספר קטבים","breaker.param.Icu":"כושר ניתוק","disconnector.param.In":"זרם נקוב","fuse.param.In":"זרם נקוב","resistor.name":"נגד (R)","capacitor.name":"קבל (C)","diode.name":"דיודה (D)","indicator-light.name":"נורית חיווי (HL)","push-button.name":"לחצן (SB)","relay-coil.name":"סליל ממסר (KA)","make-contact.name":"מגע נורמלי-פתוח (NO)","break-contact.name":"מגע נורמלי-סגור (NC)","bell.name":"פעמון (HA)","terminal.name":"הדק / צומת (X)","fuse-switch-disconnector.name":"מפסק-מנתק עם נתיכים","socket-outlet.name":"שקע / מחבר","inductor.name":"משרן (L)","voltage-regulator.name":"ווסת מתח (T)","dc-motor.name":"מנוע DC (M)","heater.name":"גוף חימום (EH)","selector-switch.name":"מתג בורר (SA)","limit-switch.name":"מפסק גבול (SQ)","proximity-switch.name":"מתג קרבה (SQ)","time-relay.name":"ממסר זמן (KT)","buzzer.name":"זמזם (HA)","siren.name":"צופר (HA)","thermocouple.name":"תרמוזוג (BT)","thyristor.name":"תיריסטור / SCR (V)","triac.name":"טריאק (V)","zener-diode.name":"דיודת זנר (D)","igbt.name":"IGBT","plc.name":"בקר PLC","ups.name":"אל-פסק (UPS)","power-supply.name":"ספק כוח (PS)","genset.name":"קבוצת גנרטור (G)","protective-relay.name":"ממסר הגנה","overcurrent-relay.name":"ממסר זרם יתר (50/51)","undervoltage-relay.name":"ממסר תת-מתח (27)","reverse-power-relay.name":"ממסר הספק הפוך (32)","distance-relay.name":"ממסר מרחק (21)","phase-failure-relay.name":"ממסר כשל פאזה","buchholz-relay.name":"ממסר בוכהולץ (63)","power-factor-meter.name":"מד מקדם הספק (cosφ)","synchronoscope.name":"סינכרונוסקופ","varmeter.name":"מד הספק מגיב (var)","resistor.desc":"נגד כללי / הגבלת זרם / נגד בלימה.","capacitor.desc":"קבל כללי / סינון / פס DC. לשיפור מקדם הספק השתמשו בקבל מקבילי.","diode.desc":"דיודת יישור / דיודת חופש / דיודת הגנה. t1 = אנודה (למעלה), t2 = קתודה (למטה).","indicator-light.desc":"נורית איתות / חיווי מצב.","push-button.desc":"לחצן ידני עם החזרה אוטומטית (מגע נורמלי-פתוח).","relay-coil.desc":"סליל הפעלה של ממסר / מגען (תיבה).","make-contact.desc":"מגע עזר נורמלי-פתוח (סוגר).","break-contact.desc":"מגע עזר נורמלי-סגור (פותח).","bell.desc":"פעמון איתות / פעמון אזעקה.","terminal.desc":"הדק / תיבת חיבורים / צומת חיבור.","fuse-switch-disconnector.desc":"מפסק-מנתק עם נתיכים לניתוק בעומס.","socket-outlet.desc":"שקע חשמל / מחבר רב-קוטבי.","inductor.desc":"משרן כללי / סליל / דעכן.","voltage-regulator.desc":"ווסת מתח אינדוקטיבי / שנאי-אוטו מתכוונן.","dc-motor.desc":"מנוע DC (סמל כללי, עירור טורי).","heater.desc":"גוף חימום נגדי / עומס חימום.","selector-switch.desc":"מתג בורר / מתג החלפה (סיבובי, נשאר במצב).","limit-switch.desc":"מפסק גבול / מיקום (נורמלי-פתוח, הפעלה מכנית).","proximity-switch.desc":"חיישן קרבה / מתג קרבה ללא מגע.","time-relay.desc":"סליל ממסר השהיית זמן (פעולה מושהית).","buzzer.desc":"זמזם איתות.","siren.desc":"צופר / אזעקה קולית.","thermocouple.desc":"חיישן טמפרטורה מסוג תרמוזוג.","thyristor.desc":"תיריסטור טריודה חוסם-הפוך / SCR. t1 = אנודה (למעלה), t2 = קתודה (למטה).","triac.desc":"תיריסטור טריודה דו-כיווני (TRIAC).","zener-diode.desc":"דיודת זנר / ווסת מתח. t1 = אנודה (למעלה), t2 = קתודה (למטה).","igbt.desc":"IGBT מסוג ערוץ-N. t1 = קולקטור (למעלה), t2 = אמיטר (למטה), t_g = שער.","plc.desc":"בקר לוגי מתוכנת (PLC).","ups.desc":"אל-פסק (UPS) מסוג און-ליין / המתנה.","power-supply.desc":"ספק כוח נדסק (AC→DC) / ספק DC. t_ac למעלה (~), t_dc למטה (=).","genset.desc":"קבוצת גנרטור דיזל / גז.","protective-relay.desc":"ממסר מדידה / הגנה, סמל כללי (IEC 60617).","overcurrent-relay.desc":"ממסר הגנת זרם יתר (ANSI 50/51).","undervoltage-relay.desc":"ממסר הגנת תת-מתח (ANSI 27).","reverse-power-relay.desc":"ממסר הגנה בפני הספק הפוך / זרם הפוך (ANSI 32).","distance-relay.desc":"ממסר הגנת מרחק / תת-עכבה (ANSI 21).","phase-failure-relay.desc":"ממסר הגנה בפני כשל פאזה / אובדן פאזה.","buchholz-relay.desc":"ממסר בוכהולץ / ממסר גז (ANSI 63).","power-factor-meter.desc":"מד מקדם הספק (cosφ).","synchronoscope.desc":"מד סנכרון / סינכרונוסקופ.","varmeter.desc":"מד הספק מגיב (var).","make-contact.state.closed":"סגור","break-contact.state.open":"פתוח","on-delay-make-contact.name":"מגע נורמלי-פתוח בהשהיית הפעלה (KT)","off-delay-make-contact.name":"מגע נורמלי-פתוח בהשהיית הפסקה (KT)","on-delay-break-contact.name":"מגע נורמלי-סגור בהשהיית הפעלה (KT)","off-delay-break-contact.name":"מגע נורמלי-סגור בהשהיית הפסקה (KT)","continuation-out.name":"המשך לדף אחר (יוצא)","continuation-in.name":"המשך מדף אחר (נכנס)","on-delay-make-contact.desc":"מגע טיימר נורמלי-פתוח: נסגר בהשהיה לאחר שהסליל מקבל מתח (IEC 60617-07-05-01).","off-delay-make-contact.desc":"מגע טיימר נורמלי-פתוח: נפתח בהשהיה לאחר ניתוק המתח מהסליל (IEC 60617-07-05-02).","on-delay-break-contact.desc":"מגע טיימר נורמלי-סגור: נפתח בהשהיה לאחר שהסליל מקבל מתח (IEC 60617-07-05-03).","off-delay-break-contact.desc":"מגע טיימר נורמלי-סגור: נסגר בהשהיה לאחר ניתוק המתח מהסליל (IEC 60617-07-05-04).","continuation-out.desc":"החוט נקטע כאן וממשיך במקום אחר. המשכים עם אותו שם הם אותו חוט.","continuation-in.desc":"חוט שמגיע ממקום אחר ממשיך כאן. המשכים עם אותו שם הם אותו חוט.","on-delay-make-contact.state.closed":"סגור","on-delay-make-contact.param.delay":"השהיה","off-delay-make-contact.state.closed":"סגור","off-delay-make-contact.param.delay":"השהיה","on-delay-break-contact.state.open":"פתוח","on-delay-break-contact.param.delay":"השהיה","off-delay-break-contact.state.open":"פתוח","off-delay-break-contact.param.delay":"השהיה","continuation-out.param.target":"ממשיך ב","continuation-in.param.target":"מגיע מ","async-motor.param.P":"הספק","sync-motor.param.P":"הספק","dc-motor.param.P":"הספק","ev-charger.param.P":"הספק","socket-outlet.param.P":"הספק","luminaire.param.P":"הספק","fuse-switch-disconnector.state.open":"פתוח","selector-switch.state.open":"פתוח","limit-switch.state.closed":"סגור","resistor.param.R":"התנגדות","resistor.param.P":"הספק נקוב","capacitor.param.C":"קיבול","capacitor.param.Un":"מתח נקוב","indicator-light.param.color":"צבע","inductor.param.L":"השראות","inductor.param.In":"זרם נקוב","voltage-regulator.param.ratio":"טווח ויסות","heater.param.P":"הספק","ups.param.S":"הספק נקוב","power-supply.param.Vdc":"מתח יציאה","genset.param.P":"הספק"},g$={ui:h$,library:f$},Be={es:Gj,fr:Xj,de:Qj,pt:t$,ja:r$,ru:s$,fa:d$,ar:p$,he:g$},ha={zh:{"common.unnamed":"未命名","common.close":"关闭","common.yes":"是","common.no":"否","topbar.theme.toLight":"切换到亮色","topbar.theme.toDark":"切换到暗色","topbar.theme.currentDark":"当前:暗色主题","topbar.theme.currentLight":"当前:亮色主题","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"当前:中文","topbar.export.label":"导出","topbar.export.tooltip":"SVG 矢量(可编辑)、PNG 位图(2× 高清)或 DXF(CAD)","topbar.export.pngFailed":"导出 PNG 失败:{err}","topbar.export.dxfFailed":"导出 DXF 失败:{err}","topbar.file.label":"文件","topbar.file.tooltip":"打开本地 .json 图、保存、或另存为","topbar.file.current":"当前:{name}","topbar.file.new":"新建","topbar.file.open":"打开…","topbar.file.save":"保存","topbar.file.saveAs":"另存为…","topbar.file.newConfirm":"新建会清空当前未保存的内容,是否继续?","topbar.file.openFailed":"打开失败:{err}","topbar.file.saveFailed":"保存失败:{err}","topbar.file.fileDescription":"OneLineEditor 图纸","outline.title":"大纲","outline.collapse":"折叠","outline.collapseAria":"折叠大纲","outline.empty":"(无设备 — 从元件库拖入开始)","props.title":"属性","props.node":"电气节点","props.wire":"连线","props.bus":"母线","props.junction":"接线柱","props.junctionPos":"位置","props.nSelected":"{n} 选中","props.empty":"未选中","props.multi":"已选中 {n} 项","props.name":"名称","props.note":"备注","props.label":"标注","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"电气节点 {id} 不存在","props.wireNotFound":"连线 {id} 不存在","props.nodeStats":"{terminals} 个端子 · {elements} 个元件","props.selectElement":"选中 {label}","props.selectWholeNode":"选中整个电气节点","props.annText":"文字","props.annRect":"矩形","props.annEllipse":"椭圆","props.annLine":"线条","props.annTable":"表格","props.annNotFound":"标注 {id} 不存在","props.annLabel":"标签","props.annLabelPlaceholder":"如:1#配电柜","props.color":"颜色","props.size":"大小","props.sizeReset":"恢复为 100%","props.labelShown":"显示","props.labelHidden":"隐藏","props.contactType":"触点类型","props.direction":"方向","props.directionOut":"去向","props.directionIn":"来向","props.partner":"对端","props.partnerUnnamed":"填写名称后与同名的跨页连接配对","props.partnerNone":"此图中没有对端","props.partnerJump":"跳转到 {id}","health.title":"体检","health.hint":"连接与供电检查:检查提示和估算,不是合规审查","health.markers":"在图上显示","health.none":"没有发现问题","health.sectionProblems":"问题","health.sectionNotes":"提示","health.sectionDismissed":"已标为有意","health.sectionLoads":"负荷汇总","health.dismiss":"这是有意的","health.restore":"恢复","health.loadKnown":"已知 {kw} kW({k}/{t} 个负荷)","health.loadAll":"{kw} kW({t} 个负荷)","health.label.unwired":"没有接线","health.label.looks-joined":"看起来连着,实际没接","health.label.dangling-wire":"导线端头未接","health.label.supply-disconnected":"电源没接上","health.label.unsupplied":"找不到电源","health.label.no-origin":"没有电源符号","health.label.voltage-mix":"电压等级直连","health.label.ratio-mismatch":"变比不符","health.label.label-mismatch":"名称与参数不符","health.label.overload":"超过额定","health.label.feeder-end":"馈线在此结束","health.label.open-side":"进线侧未接","health.introTitle":"图纸体检","health.intro":"在这张图的连接里发现 {n} 处可能的问题,图上的小圆点标出了位置。这些是根据连线给出的提示,不是规范审查。","health.introShow":"查看","health.introOk":"知道了","health.loading":"负载率 {pct}%(额定 {rating} kVA)","health.disclaimer":"根据图纸的连接关系给出的检查提示和估算,不是规范合规审查。","health.overloadUnits":"超出额定 10 倍以上,请检查负荷单位(通用负荷的 P 以 MW 计)。","health.code.unwired":"{name} 没有接线。挨着导线不等于接上了,请用导线连到它的端子。","health.code.looks-joined":"这里有根导线停在另一个连接点上,但没有接上:看起来连着,实际没连。","health.code.dangling-wire":"这里有根导线的端头没有接任何东西。","health.code.supply-disconnected":"{name} 没有和图的其余部分连上:{total} 个设备里有 {count} 个找不到电源。","health.code.unsupplied":"这里有 {count} 个设备找不到任何电源。","health.code.no-origin":"图里没有电源符号。加一个电网或发电机,就能检查供电路径并看到负荷汇总。","health.code.voltage-mix":"这里 {a} kV 和 {b} kV 没有经过变压器就连在了一起。","health.code.ratio-mismatch":"{name} 的变比 {ratio} 与两侧母线电压({a} kV / {b} kV)不符。","health.code.label-mismatch":"{name} 的名称与参数 {param}({value})不一致。","health.code.overload":"{name} 已知负荷 {load} kVA 超过额定 {rating} kVA(按全部负荷同时满载计算)。","health.code.feeder-end":"{name}:馈线在此结束。","health.code.open-side":"{name} 的进线侧没有接线(通常是图纸的进线端)。","props.color.default":"默认","props.color.red":"红","props.color.amber":"橙","props.color.green":"绿","props.color.blue":"蓝","props.color.gray":"灰","props.annStroke":"线型","props.annStrokeSolid":"实线","props.annStrokeDashed":"虚线","props.annStrokeDotted":"点线","props.annStrokeWidth":"线宽","props.annWidthThin":"细","props.annWidthMedium":"中","props.annWidthThick":"粗","props.annFill":"填充","props.annFillNone":"无","props.annFillTint":"浅色","props.annArrow":"箭头","props.annArrowNone":"无","props.annArrowEnd":"单向","props.annArrowBoth":"双向","props.annFontSize":"字号","props.annRows":"行数","props.annCols":"列数","view.zoomOut":"缩小","view.zoomOutHint":"按预设档位缩小;也可滚轮 ↓ 或 ⌘−","view.reset":"重置到 100%","view.current":"当前 {z}%","view.zoomIn":"放大","view.zoomInHint":"按预设档位放大;也可滚轮 ↑ 或 ⌘+","view.fit":"适配视图","view.fitHint":"自动缩放并居中,显示整张图纸","view.gridHide":"隐藏网格","view.gridShow":"显示网格","view.gridHotkey":"G","view.gridHideHint":"同时关闭对齐吸附(拖动可自由放置)","view.gridShowHint":"同时开启对齐吸附(拖动会贴到 10px 网格)","view.gridHideAria":"隐藏网格并关闭吸附","view.gridShowAria":"显示网格并开启吸附","view.label":"标签","view.labelOff":"关闭","view.labelId":"仅 ID","view.labelAll":"ID + 参数","view.labelHint":"标签显示方式与字号(同样影响导出与打印)","view.labelSize":"字号","view.labelSizeSmaller":"缩小标签字号","view.labelSizeLarger":"放大标签字号","view.standard":"符号标准","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"只改符号画法,接线、位置和参数都不动。目前断路器和熔断器两种画法不同。","view.labelSizeReset":"恢复默认字号","library.title":"元件库","tool.draw":"绘图","tool.drawHint":"文字、方框、圆、线、表格——图纸上的自由标注","library.empty":"没有匹配的元件","library.customTag":"自定义","library.customHint":"本图自带的元件——其他人的元件库里没有它","library.createComponent":"新建元件…","library.searchPlaceholder":"搜索元件…","library.searchAria":"搜索元件","library.clearSearch":"清除搜索","library.itemHint":"单击进入放置模式或拖到画布","tool.select":"选择","tool.selectHint":"点选元件,框选多个,或右键打开菜单","tool.pan":"平移","tool.panHint":"拖动画布;空格键可临时切换","tool.wire":"连线","tool.wireHint":"从端子/母线/接线柱拖出;拖到空白处会自动新建接线柱,拖到已有连线上可打接点","tool.bus":"母线","tool.busHint":"画布上拖动一段母线,按下定起点、释放定终点","tool.junction":"接线柱","tool.junctionHint":"点击画布放置一个接线柱(接点),连线可自由连到它","tool.place":"元件","tool.placeHint":"点击画布放置;或从端子/母线拖出,同时放置并连接","tool.text":"文字","tool.textHint":"点击画布放置一段文字注释;双击文字可重新编辑","tool.rect":"矩形","tool.rectHint":"拖动绘制矩形 / 分组框(默认虚线);按住 Shift 画正方形","tool.ellipse":"椭圆","tool.ellipseHint":"拖动绘制椭圆;按住 Shift 画正圆","tool.line":"线条","tool.lineHint":"拖动绘制标注线;按住 Shift 按 45° 约束;箭头在属性面板设置","tool.table":"表格","tool.tableHint":"拖动扫出行列(实时显示 列×行),或单击放置默认表格;双击单元格填写","mode.selectWithSel":"拖动元件移动 · 拖端子连线 · 右键打开菜单","mode.selectEmpty":"点选元件 · 拖动移动 · 框选多个 · 右键打开菜单","mode.pan":"拖动画布 · 滚轮缩放 · 按住空格可在其他工具下临时平移","mode.wireDragging":"拖到端子/母线/接线柱释放;空白处释放会新建接线柱","mode.wireInit":"从任意连接点或空白处按下,拖到目标释放;空白处会新建接线柱","mode.busDragging":"拖动决定母线方向,释放定终点","mode.busInit":"在画布按下定起点,拖动后释放定终点","mode.junction":"点击画布放置一个接线柱","mode.placeNoKind":"从左侧元件库选择一种元件","mode.placeFromTerm":"拖到目标位置释放,新元件将连接到起点端子","mode.placeNormal":"点击空白放置;或从已有端子 / 母线拖出,同时放置并连接","mode.text":"点击画布放置文字;双击已有文字可编辑;选中后可拖动 / 删除","mode.rect":"拖动绘制矩形;Shift 正方形;释放后可拉伸并在属性面板加标签","mode.ellipse":"拖动绘制椭圆;Shift 正圆;释放后可拉伸、改色并加标签","mode.line":"拖动绘制线条;Shift 按 45° 约束;释放后可在属性面板加箭头","mode.table":"拖动扫出表格行列,或单击放置 3×3 表格;双击单元格填写内容","mode.annTextSel":"单击文字即可编辑 · 拖动移动 · Del 删除","mode.annTableSel":"单击单元格填写内容 · 拖动移动 · Del 删除","mode.annShapeSel":"拖动移动 · 拖动手柄缩放 · 右侧面板改样式 · Del 删除","mode.annEditing":"输入内容 · Enter 确认 · Esc 取消 · 或用 ✓ / ✕ 按钮","mode.escSelect":"Esc 清除选择","mode.escOther":"右键 / Esc 取消","tool.placeNoKindTooltip":"从左侧元件库选择一个元件后点击画布放置","tool.undo":"撤销","tool.undoHint":"撤销上一次编辑(移动 / 旋转 / 删除等)","tool.redo":"重做","tool.redoHint":"重做被撤销的操作","layout.label":"布局","layout.hint":"自动排版整个图或仅选中范围,并填补空缺","layout.allAuto":"重新自动布局","layout.selAuto":"重新自动布局选区","layout.allFill":"填补未排版位置","layout.selFill":"填补未排版选区","tool.more":"更多","tool.moreHint":"撤销 / 重做 / 布局","view.menu":"视图","view.menuHint":"缩放、适配、网格","ctx.ariaNode":"选中节点操作","ctx.ariaWire":"选中连线操作","ctx.ariaElement":"选中元件操作","ctx.ariaEdit":"编辑操作","ctx.done":"完成","ctx.cancel":"取消","ctx.rotate":"旋转 90°","ctx.rotateHint":"顺时针旋转选中元件,连线随端子自动重排","ctx.mirror":"水平镜像","ctx.mirrorTitle":"镜像","ctx.mirrorHint":"左右翻转选中元件","ctx.delete":"删除","ctx.color":"颜色","ctx.colorDefault":"默认","ctx.colorRed":"红色","ctx.colorAmber":"琥珀","ctx.colorGreen":"绿色","ctx.colorBlue":"蓝色","ctx.colorGray":"灰色","ctx.deleteHintNode":"断开此电气节点上的所有连接(保留元件)","ctx.deleteHintWire":"移除这一根连线(其它同节点连线保留)","ctx.deleteHintElement":"移除选中元件及其连接的连线","ctx.resetWirePath":"恢复自动走线","ctx.resetWirePathHint":"清除手动调整的拐点,让连线回到自动路由","menu.undo":"撤销","menu.redo":"重做","menu.cut":"剪切","menu.copy":"复制","menu.paste":"粘贴","menu.rotate":"旋转 90°","menu.mirror":"镜像","menu.resetLabel":"标签位置复位","menu.selectAll":"全选","menu.disconnect":"断开此连线","menu.delete":"删除","io.parseFailed":"JSON 解析失败:{err}","io.notObject":"文件不是 JSON 对象","io.versionMismatch":'版本不兼容:期望 "1",实际 {actual}',"io.elementsMissing":"elements 字段缺失或不是数组","compile.duplicateId":'元件 ID 重复:"{id}"',"compile.unknownKind":'未知元件类型 kind="{kind}"',"compile.invalidTermRef":'非法端子引用 "{ref}"',"compile.elementMissing":'引用了不存在的元件 "{id}"',"compile.missingPin":'元件 "{id}" (kind={kind}) 没有引脚 "{pin}",可用引脚: {available}',"compile.singleTerminal":"节点只包含一个端子,已忽略","compile.layoutMissingElement":'layout 键 "{id}" 引用了不存在的元件',"compile.elementUnconnected":'元件 "{id}" 没有任何连接',"cat.custom":"本图自定义","cat.busbar":"母线 / 接线","cat.switching":"开关","cat.protection":"保护","cat.motor-control":"电机控制","cat.transformer":"变压器","cat.instrument-transformer":"互感器","cat.measurement":"测量仪表","cat.source":"电源","cat.load":"负荷","cat.storage":"储能","cat.compensation":"无功补偿","cat.grounding":"中性点接地","cat.renewable":"新能源 / 电力电子","onboard.title":"上手三步","onboard.step1.title":"放一个器件","onboard.step1.body":"切到 元件 工具(P),从左侧元件库选一种拖到画布","onboard.step2.title":"拉线连接","onboard.step2.body":"用 连线 工具(W)从一个引脚拖到另一个引脚;拖到空白处会自动新建接线柱","onboard.step3.title":"母线是共用排,不是连线","onboard.step3.body":"几条回路共用一排时才用 母线 工具(B)。别拿母线连两个器件——点对点直接拉线(W)就行。","onboard.dismiss":"知道了"},en:{"common.unnamed":"Untitled","common.close":"Close","common.yes":"Yes","common.no":"No","topbar.theme.toLight":"Switch to light","topbar.theme.toDark":"Switch to dark","topbar.theme.currentDark":"Current: dark theme","topbar.theme.currentLight":"Current: light theme","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"Current: Chinese","topbar.export.label":"Export","topbar.export.tooltip":"SVG vector (editable), PNG bitmap (2× HiDPI), or DXF (CAD)","topbar.export.pngFailed":"PNG export failed: {err}","topbar.export.dxfFailed":"DXF export failed: {err}","topbar.file.label":"File","topbar.file.tooltip":"Open a local .json diagram, save, or save as","topbar.file.current":"Current: {name}","topbar.file.new":"New","topbar.file.open":"Open…","topbar.file.save":"Save","topbar.file.saveAs":"Save as…","topbar.file.newConfirm":"New will discard any unsaved changes. Continue?","topbar.file.openFailed":"Open failed: {err}","topbar.file.saveFailed":"Save failed: {err}","topbar.file.fileDescription":"OneLineEditor diagram","outline.title":"Outline","outline.collapse":"Collapse","outline.collapseAria":"Collapse outline","outline.empty":"(No elements — drag from the library to start)","props.title":"Properties","props.node":"Electrical node","props.wire":"Wire","props.bus":"Bus","props.junction":"Junction","props.junctionPos":"Position","props.nSelected":"{n} selected","props.empty":"Nothing selected","props.multi":"{n} objects selected","props.name":"Name","props.note":"Note","props.label":"Label","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Electrical node {id} not found","props.wireNotFound":"Wire {id} not found","props.nodeStats":"{terminals} terminals · {elements} elements","props.selectElement":"Select {label}","props.selectWholeNode":"Select whole electrical node","props.annText":"Text","props.annRect":"Rectangle","props.annEllipse":"Ellipse","props.annLine":"Line","props.annTable":"Table","props.annNotFound":"Annotation {id} not found","props.annLabel":"Label","props.annLabelPlaceholder":"e.g. Panel #1","props.color":"Color","props.size":"Size","props.sizeReset":"Reset to 100%","props.labelShown":"Shown","props.labelHidden":"Hidden","props.contactType":"Contact","props.direction":"Direction","props.directionOut":"Outgoing","props.directionIn":"Incoming","props.partner":"Partner","props.partnerUnnamed":"Name it to pair with the continuation of the same name","props.partnerNone":"No partner on this drawing","props.partnerJump":"Go to {id}","health.title":"Checks","health.hint":"Connection and supply checks: hints and estimates, not a compliance review","health.markers":"Show on drawing","health.none":"No problems found","health.sectionProblems":"Problems","health.sectionNotes":"Notes","health.sectionDismissed":"Marked intentional","health.sectionLoads":"Load totals","health.dismiss":"Intentional","health.restore":"Restore","health.loadKnown":"{kw} kW known ({k}/{t} loads)","health.loadAll":"{kw} kW ({t} loads)","health.label.unwired":"Not connected","health.label.looks-joined":"Looks connected, isn't","health.label.dangling-wire":"Open wire end","health.label.supply-disconnected":"Supply not connected","health.label.unsupplied":"No path to a supply","health.label.no-origin":"No supply symbol","health.label.voltage-mix":"Voltage levels joined","health.label.ratio-mismatch":"Ratio mismatch","health.label.label-mismatch":"Name vs. rating","health.label.overload":"Over the rating","health.label.feeder-end":"Feeder ends here","health.label.open-side":"Supply side open","health.introTitle":"Drawing check","health.intro":"Found {n} possible problem(s) in how this drawing is connected. The dots show where. These are hints from the wiring, not a code review.","health.introShow":"Show","health.introOk":"Got it","health.loading":"{pct}% of {rating} kVA","health.disclaimer":"Hints and estimates from the drawing's connections, not a code-compliance check.","health.overloadUnits":"More than 10× the rating: check the load units (a generic load's P is in MW).","health.code.unwired":"{name} is not connected. Touching a line is not a connection: draw a wire to its terminal.","health.code.looks-joined":"A wire ends here on another connection point without joining it: it looks connected but is not.","health.code.dangling-wire":"A wire ends here without connecting to anything.","health.code.supply-disconnected":"{name} is not connected to the rest of the drawing: {count} of {total} devices have no path to a supply.","health.code.unsupplied":"{count} device(s) here have no path to any supply.","health.code.no-origin":"This drawing has no supply symbol. Add a grid or generator to check supply paths and see load totals.","health.code.voltage-mix":"{a} kV and {b} kV are connected here without a transformer.","health.code.ratio-mismatch":"{name}: ratio {ratio} does not match the buses on its two sides ({a} kV / {b} kV).","health.code.label-mismatch":"{name}: the name and the {param} parameter ({value}) disagree.","health.code.overload":"{name}: known load {load} kVA is above the {rating} kVA rating (all loads at full power, no diversity).","health.code.feeder-end":"{name}: the feeder ends here.","health.code.open-side":"{name}: the supply side is not connected (often the incoming end of the drawing).","props.color.default":"Default","props.color.red":"Red","props.color.amber":"Amber","props.color.green":"Green","props.color.blue":"Blue","props.color.gray":"Gray","props.annStroke":"Stroke","props.annStrokeSolid":"Solid","props.annStrokeDashed":"Dashed","props.annStrokeDotted":"Dotted","props.annStrokeWidth":"Weight","props.annWidthThin":"Thin","props.annWidthMedium":"Medium","props.annWidthThick":"Thick","props.annFill":"Fill","props.annFillNone":"None","props.annFillTint":"Tint","props.annArrow":"Arrows","props.annArrowNone":"None","props.annArrowEnd":"End","props.annArrowBoth":"Both","props.annFontSize":"Font size","props.annRows":"Rows","props.annCols":"Columns","view.zoomOut":"Zoom out","view.zoomOutHint":"Step zoom out; also wheel ↓ or ⌘−","view.reset":"Reset to 100%","view.current":"Current {z}%","view.zoomIn":"Zoom in","view.zoomInHint":"Step zoom in; also wheel ↑ or ⌘+","view.fit":"Fit view","view.fitHint":"Auto-zoom and center the whole drawing","view.gridHide":"Hide grid","view.gridShow":"Show grid","view.gridHotkey":"G","view.gridHideHint":"Also disables snap-to-grid (free placement)","view.gridShowHint":"Also enables snap-to-grid (snaps to 10px on drag)","view.gridHideAria":"Hide grid and disable snap","view.gridShowAria":"Show grid and enable snap","view.label":"Labels","view.labelOff":"Off","view.labelId":"ID","view.labelAll":"ID + params","view.labelHint":"Label visibility and type size (applies to exports too)","view.labelSize":"Size","view.labelSizeSmaller":"Smaller label type","view.labelSizeLarger":"Larger label type","view.standard":"Symbol standard","view.standardIec":"IEC","view.standardAnsi":"ANSI","view.standardHint":"Changes how symbols are drawn only — wiring, positions and ratings are untouched. Circuit breakers and fuses differ between the two.","view.labelSizeReset":"Reset label size","library.title":"Library","tool.draw":"Draw","tool.drawHint":"Text, boxes, circles, lines and tables — free annotation over the drawing","library.empty":"No matching elements","library.customTag":"custom","library.customHint":"Defined by this drawing — it is not in anyone else's library","library.createComponent":"New component…","library.searchPlaceholder":"Search elements…","library.searchAria":"Search elements","library.clearSearch":"Clear search","library.itemHint":"Click to enter place mode, or drag onto the canvas","tool.select":"Select","tool.selectHint":"Click to pick, marquee for multiple, right-click for menu","tool.pan":"Pan","tool.panHint":"Drag the canvas; Space toggles temporarily","tool.wire":"Wire","tool.wireHint":"Drag from a pin/bus/junction; into empty space drops a junction, onto a wire taps it","tool.bus":"Busbar","tool.busHint":"Drag on the canvas — press to set start, release to set end","tool.junction":"Junction","tool.junctionHint":"Click the canvas to drop a junction (node); wires attach to it freely","tool.place":"Place","tool.placeHint":"Click to place; or drag from a terminal/bus to place and connect","tool.text":"Text","tool.textHint":"Click the canvas to drop a text note; double-click an existing one to edit","tool.rect":"Rectangle","tool.rectHint":"Drag to draw a rectangle / group frame (dashed by default); Shift for a square","tool.ellipse":"Ellipse","tool.ellipseHint":"Drag to draw an ellipse; hold Shift for a circle","tool.line":"Line","tool.lineHint":"Drag to draw an annotation line; Shift snaps to 45°; arrows live in the panel","tool.table":"Table","tool.tableHint":"Drag to sweep out cols × rows (live count), or click for a default table; double-click cells to type","mode.selectWithSel":"Drag elements · drag terminals to wire · right-click for menu","mode.selectEmpty":"Click to pick · drag to move · marquee for multiple · right-click for menu","mode.pan":"Drag the canvas · scroll to zoom · hold Space to pan in any tool","mode.wireDragging":"Release on a pin/bus/junction; release in empty space drops a junction","mode.wireInit":"Press on any connection point or empty space, drag to a target and release","mode.busDragging":"Drag sets bus direction; release sets the end","mode.busInit":"Press on the canvas to set start, drag, release to set end","mode.junction":"Click the canvas to drop a junction","mode.placeNoKind":"Pick an element kind from the library on the left","mode.placeFromTerm":"Release at the target — the new element will connect back to the source terminal","mode.placeNormal":"Click empty space to place; or drag from a terminal / bus to place and connect","mode.text":"Click to drop text · double-click to edit · drag selected to move · Del to remove","mode.rect":"Drag to draw a rectangle · Shift for square · resize and label it after release","mode.ellipse":"Drag to draw an ellipse · Shift for a circle · resize, recolor and label it after release","mode.line":"Drag to draw a line · Shift snaps to 45° · add arrows in the panel after release","mode.table":"Drag to sweep out the grid, or click for a 3×3 table · double-click cells to type","mode.annTextSel":"Click the text to edit · drag to move · Del to remove","mode.annTableSel":"Click a cell to fill it in · drag to move · Del to remove","mode.annShapeSel":"Drag to move · drag handles to resize · restyle in the panel · Del to remove","mode.annEditing":"Type · Enter to confirm · Esc to cancel · or the ✓ / ✕ buttons","mode.escSelect":"Esc clears selection","mode.escOther":"Right-click / Esc to cancel","tool.placeNoKindTooltip":"Pick a kind in the library on the left, then click the canvas","tool.undo":"Undo","tool.undoHint":"Undo the last edit (move / rotate / delete, etc.)","tool.redo":"Redo","tool.redoHint":"Redo the last undone edit","layout.label":"Layout","layout.hint":"Auto-layout the whole diagram or just the selection, fill gaps","layout.allAuto":"Auto-layout all","layout.selAuto":"Auto-layout selection","layout.allFill":"Fill unplaced","layout.selFill":"Fill unplaced in selection","tool.more":"More","tool.moreHint":"Undo / redo / layout","view.menu":"View","view.menuHint":"Zoom, fit, grid","ctx.ariaNode":"Node actions","ctx.ariaWire":"Wire actions","ctx.ariaElement":"Element actions","ctx.ariaEdit":"Editing actions","ctx.done":"Done","ctx.cancel":"Cancel","ctx.rotate":"Rotate 90°","ctx.rotateHint":"Rotate selection clockwise; wires re-route through new terminals","ctx.mirror":"Mirror horizontally","ctx.mirrorTitle":"Mirror","ctx.mirrorHint":"Flip selection left-right","ctx.delete":"Delete","ctx.color":"Colour","ctx.colorDefault":"Default","ctx.colorRed":"Red","ctx.colorAmber":"Amber","ctx.colorGreen":"Green","ctx.colorBlue":"Blue","ctx.colorGray":"Gray","ctx.deleteHintNode":"Disconnect every wire on this node (elements stay)","ctx.deleteHintWire":"Remove only this wire (siblings on the same node stay)","ctx.deleteHintElement":"Remove the selection and its wires","ctx.resetWirePath":"Reset to auto-route","ctx.resetWirePathHint":"Drop manual corners and let the router re-draw this wire","menu.undo":"Undo","menu.redo":"Redo","menu.cut":"Cut","menu.copy":"Copy","menu.paste":"Paste","menu.rotate":"Rotate 90°","menu.mirror":"Mirror","menu.resetLabel":"Reset label position","menu.selectAll":"Select all","menu.disconnect":"Disconnect this wire","menu.delete":"Delete","io.parseFailed":"JSON parse failed: {err}","io.notObject":"File is not a JSON object","io.versionMismatch":'Version mismatch: expected "1", got {actual}',"io.elementsMissing":"`elements` is missing or not an array","compile.duplicateId":'Duplicate element id: "{id}"',"compile.unknownKind":'Unknown element kind="{kind}"',"compile.invalidTermRef":'Invalid terminal reference "{ref}"',"compile.elementMissing":'Reference to unknown element "{id}"',"compile.missingPin":'Element "{id}" (kind={kind}) has no pin "{pin}"; available: {available}',"compile.singleTerminal":"Node has only one terminal — ignored","compile.layoutMissingElement":'layout key "{id}" references an unknown element',"compile.elementUnconnected":'Element "{id}" has no connections',"cat.custom":"In this drawing","cat.busbar":"Busbar / wiring","cat.switching":"Switching","cat.protection":"Protection","cat.motor-control":"Motor control","cat.transformer":"Transformer","cat.instrument-transformer":"Instrument transformer","cat.measurement":"Measurement","cat.source":"Source","cat.load":"Load","cat.storage":"Storage","cat.compensation":"Compensation","cat.grounding":"Grounding","cat.renewable":"Renewables / power electronics","onboard.title":"Quick start","onboard.step1.title":"Place a component","onboard.step1.body":"Pick the Place tool (P) and drag a kind from the library onto the canvas","onboard.step2.title":"Wire it up","onboard.step2.body":"Use the Wire tool (W): drag from one pin to another — drag into empty space to drop a junction","onboard.step3.title":"A busbar is a shared rail, not a wire","onboard.step3.body":"Use the Busbar tool (B) only when several circuits share one rail. Don't use a bus to join two devices — just wire the pins (W).","onboard.dismiss":"Got it"}},or={zh:ha.zh,en:ha.en,es:Be.es.ui,fr:Be.fr.ui,de:Be.de.ui,pt:Be.pt.ui,ja:Be.ja.ui,ru:Be.ru.ui,fa:Be.fa.ui,ar:Be.ar.ui,he:Be.he.ui},us="ole-locale",b$=Object.keys(or);function fa(e){return b$.includes(e)}function y$(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(us);if(e&&fa(e))return e}catch{}if(typeof navigator<"u"&&typeof navigator.language=="string"){const e=navigator.language.toLowerCase();if(e.startsWith("zh"))return"zh";const t=e.slice(0,2);if(fa(t))return t}return"en"}function ga(e){try{window.localStorage.setItem(us,e)}catch{}}const Tn=Nn((e,t)=>({locale:y$(),setLocale:n=>{ga(n),e({locale:n})},toggle:()=>{const n=t().locale==="zh"?"en":"zh";ga(n),e({locale:n})}}));function ms(e,t){return t?e.replace(/\{(\w+)\}/g,(n,o)=>t[o]!==void 0?String(t[o]):`{${o}}`):e}function ps(e,t){return or[e][t]??or.en[t]??t}function He(e,t){return ms(ps(Tn.getState().locale,e),t)}function re(){const e=Tn(t=>t.locale);return(t,n)=>ms(ps(e,t),n)}function hs(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var a;const i=s=>s===null?null:JSON.parse(s,void 0),l=(a=n.getItem(r))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(r,a)=>n.setItem(r,JSON.stringify(a,void 0)),removeItem:r=>n.removeItem(r)}}const rr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return rr(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return rr(o)(n)}}}},x$=(e,t)=>(n,o,r)=>{let a={storage:hs(()=>window.localStorage),partialize:b=>b,version:0,merge:(b,y)=>({...y,...b}),...t},i=!1,l=0;const s=new Set,d=new Set;let u=a.storage;if(!u)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...b)},o,r);const m=()=>{const b=a.partialize({...o()});return u.setItem(a.name,{state:b,version:a.version})},p=r.setState;r.setState=(b,y)=>(p(b,y),m());const g=e((...b)=>(n(...b),m()),o,r);r.getInitialState=()=>g;let h;const f=()=>{var b,y;if(!u)return;const w=++l;i=!1,s.forEach(_=>{var E;return _((E=o())!=null?E:g)});const j=((y=a.onRehydrateStorage)==null?void 0:y.call(a,(b=o())!=null?b:g))||void 0;return rr(u.getItem.bind(u))(a.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==a.version){if(a.migrate){const E=a.migrate(_.state,_.version);return E instanceof Promise?E.then(W=>[!0,W]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var E;if(w!==l)return;const[W,Q]=_;if(h=a.merge(Q,(E=o())!=null?E:g),n(h,!0),W)return m()}).then(()=>{w===l&&(j==null||j(o(),void 0),h=o(),i=!0,d.forEach(_=>_(h)))}).catch(_=>{w===l&&(j==null||j(void 0,_))})};return r.persist={setOptions:b=>{a={...a,...b},b.storage&&(u=b.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>f(),hasHydrated:()=>i,onHydrate:b=>(s.add(b),()=>{s.delete(b)}),onFinishHydration:b=>(d.add(b),()=>{d.delete(b)})},a.skipHydration||f(),h||g},w$=x$,gt=.5;function fs(e){if(e.length<2)return e.map(r=>[r[0],r[1]]);const t=[[e[0][0],e[0][1]]];for(let r=1;r<e.length;r++){const a=t[t.length-1];Math.abs(a[0]-e[r][0])<gt&&Math.abs(a[1]-e[r][1])<gt||t.push([e[r][0],e[r][1]])}if(t.length<2)return t;const n=[t[0]];for(let r=1;r<t.length;r++){const a=n[n.length-1],i=t[r],l=Math.abs(a[0]-i[0]),s=Math.abs(a[1]-i[1]);if(l>gt&&s>gt){const u=(n.length>=2?Math.abs(n[n.length-2][1]-a[1])<gt?"h":"v":null)==="h"?[i[0],a[1]]:[a[0],i[1]];n.push(u)}n.push(i)}const o=[n[0]];for(let r=1;r<n.length-1;r++){const a=o[o.length-1],i=n[r],l=n[r+1],s=Math.abs(a[0]-i[0])<gt&&Math.abs(i[0]-l[0])<gt,d=Math.abs(a[1]-i[1])<gt&&Math.abs(i[1]-l[1])<gt;s||d||o.push(i)}return o.push(n[n.length-1]),o}const Nr=.25,Tr=4;function ar(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?1:Math.min(Tr,Math.max(Nr,e))}function ut(e){return e.type??"text"}function v$(e){return e.type===void 0||e.type==="text"}const gs="ammeter",bs="电流表 (A)",ys="measurement",xs="-22 -42 44 44",ws=44,vs=44,ks='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-15" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">A</text>',Ss=[{id:"t_top",x:0,y:-40,orientation:"n"}],_s={kind:"inline"},k$={id:gs,name:bs,category:ys,viewBox:xs,width:ws,height:vs,svg:ks,terminals:Ss,source:_s},S$=Object.freeze(Object.defineProperty({__proto__:null,category:ys,default:k$,height:vs,id:gs,name:bs,source:_s,svg:ks,terminals:Ss,viewBox:xs,width:ws},Symbol.toStringTag,{value:"Module"})),Cs="arc-suppression-coil",js="消弧线圈",$s="grounding",As="中性点谐振接地:电感线圈连接到地",Es="-12 -32 24 67",Ns=24,Ts=67,Ps='<line x1="0" y1="-30" x2="0" y2="-12" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -12 A 4 4 0 0 1 0 -4 A 4 4 0 0 1 0 4 A 4 4 0 0 1 0 12" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="20" x2="10" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="24" x2="7" y2="24" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="28" x2="4" y2="28" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="32" x2="1.5" y2="32" fill="none" stroke="black" stroke-width="1"/>',Is=[{id:"t_top",x:0,y:-30,orientation:"n"}],zs={kind:"inline"},_$={id:Cs,name:js,category:$s,description:As,viewBox:Es,width:Ns,height:Ts,svg:Ps,terminals:Is,source:zs},C$=Object.freeze(Object.defineProperty({__proto__:null,category:$s,default:_$,description:As,height:Ts,id:Cs,name:js,source:zs,svg:Ps,terminals:Is,viewBox:Es,width:Ns},Symbol.toStringTag,{value:"Module"})),Ms="arrester",Ds="避雷器 (FBL)",Os="protection",Rs="-7 -22 14 44",Ls=14,Bs=44,Hs='<line x1="0" y1="-20" x2="0" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><polygon points="-2,-8 2,-8 0,-2" fill="black" stroke="black" stroke-width="1"/><rect x="-5" y="-10" width="10" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Fs=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Ws={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_22/en_60617_07_22_03.elmt",qetEnglishName:"Surge diverter; Lightning arrester"},j$={id:Ms,name:Ds,category:Os,viewBox:Rs,width:Ls,height:Bs,svg:Hs,terminals:Fs,source:Ws},$$=Object.freeze(Object.defineProperty({__proto__:null,category:Os,default:j$,height:Bs,id:Ms,name:Ds,source:Ws,svg:Hs,terminals:Fs,viewBox:Rs,width:Ls},Symbol.toStringTag,{value:"Module"})),qs="async-motor",Vs="异步电动机",Gs="load",Ks="-62 -82 64 84",Us=64,Xs=84,Ys='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">3</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-60" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-80" x2="-10" y2="-53" fill="none" stroke="black" stroke-width="1"/>',Zs=[{id:"t1",x:-50,y:-80,orientation:"n"},{id:"t2",x:-10,y:-80,orientation:"n"},{id:"t3",x:-30,y:-80,orientation:"n"}],Qs=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],Js={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_08/en_60617_06_08_01.elmt",qetEnglishName:"Induction motor, three-phase, squirrel cage"},A$={id:qs,name:Vs,category:Gs,viewBox:Ks,width:Us,height:Xs,svg:Ys,terminals:Zs,params:Qs,source:Js},E$=Object.freeze(Object.defineProperty({__proto__:null,category:Gs,default:A$,height:Xs,id:qs,name:Vs,params:Qs,source:Js,svg:Ys,terminals:Zs,viewBox:Ks,width:Us},Symbol.toStringTag,{value:"Module"})),el="autotransformer",tl="自耦变压器",nl="transformer",ol="-62 -112 64 144",rl=64,al=144,il='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-110" x2="-30" y2="-90" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -30 A 30 60 0 0 0 -30 -90" fill="none" stroke="black" stroke-width="1"/>',sl=[{id:"t1",x:-30,y:-110,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],ll={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_06.elmt",qetEnglishName:"Auto-transformer, general symbol"},N$={id:el,name:tl,category:nl,viewBox:ol,width:rl,height:al,svg:il,terminals:sl,source:ll},T$=Object.freeze(Object.defineProperty({__proto__:null,category:nl,default:N$,height:al,id:el,name:tl,source:ll,svg:il,terminals:sl,viewBox:ol,width:rl},Symbol.toStringTag,{value:"Module"})),cl="battery",dl="电池储能",ul="storage",ml="-12 -12 29 24",pl=29,hl=24,fl='<line x1="-10" y1="0" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-5" x2="0" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-10" x2="5" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="0" x2="15" y2="0" fill="none" stroke="black" stroke-width="1"/>',gl=[{id:"t_left",x:-10,y:0,orientation:"w"},{id:"t_right",x:15,y:0,orientation:"e"}],bl=[{name:"E",label:"容量",type:"number",unit:"kWh"}],yl={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_15/en_60617_06_15_01.elmt",qetEnglishName:"Battery cell"},P$={id:cl,name:dl,category:ul,viewBox:ml,width:pl,height:hl,svg:fl,terminals:gl,params:bl,source:yl},I$=Object.freeze(Object.defineProperty({__proto__:null,category:ul,default:P$,height:hl,id:cl,name:dl,params:bl,source:yl,svg:fl,terminals:gl,viewBox:ml,width:pl},Symbol.toStringTag,{value:"Module"})),xl="bell",wl="电铃 (HA)",vl="control",kl="信号电铃 / 警铃。",Sl="-32 -32 44 44",_l=44,Cl=44,jl='<line x1="-30" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -10 A 20 20 0 0 0 -30 -10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/>',$l=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],Al={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_06.elmt",qetEnglishName:"Bell"},z$={id:xl,name:wl,category:vl,description:kl,viewBox:Sl,width:_l,height:Cl,svg:jl,terminals:$l,source:Al},M$=Object.freeze(Object.defineProperty({__proto__:null,category:vl,default:z$,description:kl,height:Cl,id:xl,name:wl,source:Al,svg:jl,terminals:$l,viewBox:Sl,width:_l},Symbol.toStringTag,{value:"Module"})),El="break-contact",Nl="常闭触点 (NC)",Tl="control",Pl="常闭辅助触点 (break contact)。",Il="-2 -42 14 64",zl=14,Ml=64,Dl='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/>',Ol=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Rl=[{name:"open",type:"boolean",default:!1,label:"断开"}],Ll={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_02/en_60617_07_02_03.elmt",qetEnglishName:"Break contact"},D$={id:El,name:Nl,category:Tl,description:Pl,viewBox:Il,width:zl,height:Ml,svg:Dl,terminals:Ol,state:Rl,source:Ll},O$=Object.freeze(Object.defineProperty({__proto__:null,category:Tl,default:D$,description:Pl,height:Ml,id:El,name:Nl,source:Ll,state:Rl,svg:Dl,terminals:Ol,viewBox:Il,width:zl},Symbol.toStringTag,{value:"Module"})),Bl="breaker",Hl="断路器 (QF)",Fl="switching",Wl="-7 -22 15 46",ql=15,Vl=46,Gl='<polyline points="0,20 0,10 -5,-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-8" x2="-2" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/>',Kl='<text x="2" y="-10.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">1</text><text x="3" y="21.2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">2</text>',Ul=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Xl=[{name:"open",type:"boolean",default:!1,label:"断开"}],Yl=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"poles",label:"极数",type:"number",unit:"P",showOnCanvas:!0},{name:"Icu",label:"分断能力",type:"number",unit:"kA",showOnCanvas:!0}],Zl={x:6,y:-2,anchor:"start"},Ql={ansi:{viewBox:"-11 -22 22 44",width:22,height:44,svg:'<line x1="0" y1="-20" x2="0" y2="-9" fill="none" stroke="black" stroke-width="1"/><rect x="-9" y="-9" width="18" height="18" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="9" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/>',label:{x:12,y:-2,anchor:"start"},source:{standard:"IEEE Std 315-1975 (ANSI Y32.2-1975)",clause:"9.4.4",title:"Circuit breaker, other than covered by symbol 9.4.1"}}},Jl={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/11_circuit_breakers/disjoncteur1.elmt",qetEnglishName:"Circuit-breaker"},R$={id:Bl,name:Hl,category:Fl,viewBox:Wl,width:ql,height:Vl,svg:Gl,terminalLabelsSvg:Kl,terminals:Ul,state:Xl,params:Yl,label:Zl,variants:Ql,source:Jl},L$=Object.freeze(Object.defineProperty({__proto__:null,category:Fl,default:R$,height:Vl,id:Bl,label:Zl,name:Hl,params:Yl,source:Jl,state:Xl,svg:Gl,terminalLabelsSvg:Kl,terminals:Ul,variants:Ql,viewBox:Wl,width:ql},Symbol.toStringTag,{value:"Module"})),ec="buchholz-relay",tc="瓦斯继电器 (63)",nc="protection",oc="瓦斯 / 气体继电器 (Buchholz, ANSI 63)。",rc="-22 -62 44 64",ac=44,ic=64,sc='<rect x="-20" y="-60" width="40" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-5" y="-20" width="10" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-55" x2="0" y2="-50" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -50 A 10 5 0 0 0 0 -40" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -40 A 10 5 0 0 0 0 -50" fill="none" stroke="black" stroke-width="1"/>',lc=[{id:"t_top",x:0,y:-60,orientation:"n"}],cc={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_18/en_60617_07_18_01.elmt",qetEnglishName:"Buchholz protective device; Gas relay"},B$={id:ec,name:tc,category:nc,description:oc,viewBox:rc,width:ac,height:ic,svg:sc,terminals:lc,source:cc},H$=Object.freeze(Object.defineProperty({__proto__:null,category:nc,default:B$,description:oc,height:ic,id:ec,name:tc,source:cc,svg:sc,terminals:lc,viewBox:rc,width:ac},Symbol.toStringTag,{value:"Module"})),dc="busbar",uc="母线段",mc="busbar",pc="可拉伸单母线段,多设备挂接",hc="-42 -4 84 8",fc=84,gc=8,bc='<line x1="-40" y1="0" x2="40" y2="0" stroke="black" stroke-width="3" stroke-linecap="round" fill="none"/>',yc=[{id:"tap",x:0,y:0,orientation:"n"}],xc={axis:"x",minLength:20,naturalSpan:80},wc=[{name:"Un",label:"额定电压",type:"number",unit:"kV",showOnCanvas:!0}],vc={x:0,y:-6,anchor:"middle"},kc={kind:"inline"},F$={id:dc,name:uc,category:mc,description:pc,viewBox:hc,width:fc,height:gc,svg:bc,terminals:yc,stretchable:xc,params:wc,label:vc,source:kc},W$=Object.freeze(Object.defineProperty({__proto__:null,category:mc,default:F$,description:pc,height:gc,id:dc,label:vc,name:uc,params:wc,source:kc,stretchable:xc,svg:bc,terminals:yc,viewBox:hc,width:fc},Symbol.toStringTag,{value:"Module"})),Sc="busduct-tap",_c="母线槽插接段",Cc="busbar",jc="带固定插接口的母线槽段,插接口向下引出",$c="-42 -12 84 34",Ac=84,Ec=34,Nc='<line x1="40" y1="0" x2="-40" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-5" x2="-40" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="40" y1="-5" x2="40" y2="5" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="0" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/>',Tc=[{id:"t_left",x:-40,y:0,orientation:"w"},{id:"t_right",x:40,y:0,orientation:"e"},{id:"t_tap",x:0,y:20,orientation:"s"}],Pc=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"Itap",label:"插接口电流",type:"number",unit:"A",showOnCanvas:!0}],Ic={x:0,y:-8,anchor:"middle"},zc={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_17/en_60617_11_17_24.elmt",qetEnglishName:"Straight section with fixed tap-off"},q$={id:Sc,name:_c,category:Cc,description:jc,viewBox:$c,width:Ac,height:Ec,svg:Nc,terminals:Tc,params:Pc,label:Ic,source:zc},V$=Object.freeze(Object.defineProperty({__proto__:null,category:Cc,default:q$,description:jc,height:Ec,id:Sc,label:Ic,name:_c,params:Pc,source:zc,svg:Nc,terminals:Tc,viewBox:$c,width:Ac},Symbol.toStringTag,{value:"Module"})),Mc="busduct",Dc="母线槽",Oc="busbar",Rc="封闭式母线槽直线段(IEC 60617-11-17)",Lc="-22 -7 44 14",Bc=44,Hc=14,Fc='<line x1="20" y1="0" x2="-20" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-5" x2="-20" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-5" x2="20" y2="5" fill="none" stroke="black" stroke-width="1"/>',Wc=[{id:"t_left",x:-20,y:0,orientation:"w"},{id:"t_right",x:20,y:0,orientation:"e"}],qc=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"Un",label:"额定电压",type:"number",unit:"V",showOnCanvas:!0}],Vc={x:0,y:-8,anchor:"middle"},Gc={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_17/en_60617_11_17_01.elmt",qetEnglishName:"Straight section, general symbol"},G$={id:Mc,name:Dc,category:Oc,description:Rc,viewBox:Lc,width:Bc,height:Hc,svg:Fc,terminals:Wc,params:qc,label:Vc,source:Gc},K$=Object.freeze(Object.defineProperty({__proto__:null,category:Oc,default:G$,description:Rc,height:Hc,id:Mc,label:Vc,name:Dc,params:qc,source:Gc,svg:Fc,terminals:Wc,viewBox:Lc,width:Bc},Symbol.toStringTag,{value:"Module"})),Kc="buzzer",Uc="蜂鸣器 (HA)",Xc="control",Yc="信号蜂鸣器。",Zc="-32 -52 44 64",Qc=44,Jc=64,ed='<line x1="-30" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><path d="M -30 -30 A 20 20 0 0 0 10 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-12" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-12" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/>',td=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],nd={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_10.elmt",qetEnglishName:"Buzzer"},U$={id:Kc,name:Uc,category:Xc,description:Yc,viewBox:Zc,width:Qc,height:Jc,svg:ed,terminals:td,source:nd},X$=Object.freeze(Object.defineProperty({__proto__:null,category:Xc,default:U$,description:Yc,height:Jc,id:Kc,name:Uc,source:nd,svg:ed,terminals:td,viewBox:Zc,width:Qc},Symbol.toStringTag,{value:"Module"})),od="capacitor",rd="电容 (C)",ad="passive",id="通用 / 滤波 / 直流母线电容。无功补偿请用并联电容器。",sd="-7 -23 14 27",ld=14,cd=27,dd='<line x1="-5" y1="2" x2="5" y2="2" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-2" x2="5" y2="-2" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-2" fill="none" stroke="black" stroke-width="1"/>',ud=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t_bottom",x:0,y:2,orientation:"s"}],md=[{name:"C",label:"容值",type:"number",unit:"μF",showOnCanvas:!0},{name:"Un",label:"额定电压",type:"number",unit:"V"}],pd={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/20_capacitors/capacite.elmt",qetEnglishName:"Capacitor"},Y$={id:od,name:rd,category:ad,description:id,viewBox:sd,width:ld,height:cd,svg:dd,terminals:ud,params:md,source:pd},Z$=Object.freeze(Object.defineProperty({__proto__:null,category:ad,default:Y$,description:id,height:cd,id:od,name:rd,params:md,source:pd,svg:dd,terminals:ud,viewBox:sd,width:ld},Symbol.toStringTag,{value:"Module"})),hd="contactor",fd="接触器 (KM)",gd="motor-control",bd="主回路接触器, 通常配热继电器和电机使用。",yd="-10 -42 15 64",xd=15,wd=64,vd='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -24.5 A 2.5 2.5 0 0 0 0 -19.5" fill="none" stroke="black" stroke-width="1"/>',kd=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Sd=[{name:"open",type:"boolean",default:!0,label:"断开"}],_d={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_02.elmt",qetEnglishName:"Contactor; Main make contact of a contactor"},Q$={id:hd,name:fd,category:gd,description:bd,viewBox:yd,width:xd,height:wd,svg:vd,terminals:kd,state:Sd,source:_d},J$=Object.freeze(Object.defineProperty({__proto__:null,category:gd,default:Q$,description:bd,height:wd,id:hd,name:fd,source:_d,state:Sd,svg:vd,terminals:kd,viewBox:yd,width:xd},Symbol.toStringTag,{value:"Module"})),Cd="continuation-in",jd="跨页连接(来向)",$d="busbar",Ad="从别处转来的连线在此接续;同名的跨页连接视为同一根线。",Ed="-3 -6 18 12",Nd=18,Td=12,Pd='<polygon points="-1,-4 -1,4 9,0" fill="none" stroke="black" stroke-width="1"/><line x1="9" y1="0" x2="12" y2="0" fill="none" stroke="black" stroke-width="1"/>',Id=[{id:"t1",x:13,y:0,orientation:"e"}],zd=[{name:"target",label:"来源",type:"string",showOnCanvas:!0}],Md={x:4,y:-7,anchor:"middle"},Dd={kind:"elmt",path:"10_allpole/100_folio_referencing/01coming_arrow.elmt",qetEnglishName:"Coming arrow"},eA={id:Cd,name:jd,category:$d,description:Ad,viewBox:Ed,width:Nd,height:Td,svg:Pd,terminals:Id,params:zd,label:Md,source:Dd},tA=Object.freeze(Object.defineProperty({__proto__:null,category:$d,default:eA,description:Ad,height:Td,id:Cd,label:Md,name:jd,params:zd,source:Dd,svg:Pd,terminals:Id,viewBox:Ed,width:Nd},Symbol.toStringTag,{value:"Module"})),Od="continuation-out",Rd="跨页连接(去向)",Ld="busbar",Bd="连线在此断开,转到别处继续;同名的跨页连接视为同一根线。",Hd="-15 -6 19 12",Fd=19,Wd=12,qd='<polygon points="-9,-4 -9,4 2,0" fill="none" stroke="black" stroke-width="1"/><line x1="-9" y1="0" x2="-12" y2="0" fill="none" stroke="black" stroke-width="1"/>',Vd=[{id:"t1",x:-13,y:0,orientation:"w"}],Gd=[{name:"target",label:"去向",type:"string",showOnCanvas:!0}],Kd={x:-3,y:-7,anchor:"middle"},Ud={kind:"elmt",path:"10_allpole/100_folio_referencing/02going_arrow.elmt",qetEnglishName:"Going arrow"},nA={id:Od,name:Rd,category:Ld,description:Bd,viewBox:Hd,width:Fd,height:Wd,svg:qd,terminals:Vd,params:Gd,label:Kd,source:Ud},oA=Object.freeze(Object.defineProperty({__proto__:null,category:Ld,default:nA,description:Bd,height:Wd,id:Od,label:Kd,name:Rd,params:Gd,source:Ud,svg:qd,terminals:Vd,viewBox:Hd,width:Fd},Symbol.toStringTag,{value:"Module"})),Xd="converter-bidir",Yd="双向变流器 (PCS)",Zd="renewable",Qd="储能变流器:双向 AC ↔ DC",Jd="-42 -42 44 48",eu=44,tu=48,nu='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-6" x2="-14" y2="-6" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-6" x2="-4" y2="-6" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/><polyline points="-28,-4 -32,0 -28,4" fill="none" stroke="black" stroke-width="1"/><polyline points="-16,-4 -12,0 -16,4" fill="none" stroke="black" stroke-width="1"/>',ou=[{id:"t_ac",x:-20,y:-40,orientation:"n"},{id:"t_dc",x:-20,y:0,orientation:"s"}],ru=[{name:"S",label:"容量",type:"number",unit:"MVA"}],au={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_06.elmt",qetEnglishName:"Rectifier/inverter"},rA={id:Xd,name:Yd,category:Zd,description:Qd,viewBox:Jd,width:eu,height:tu,svg:nu,terminals:ou,params:ru,source:au},aA=Object.freeze(Object.defineProperty({__proto__:null,category:Zd,default:rA,description:Qd,height:tu,id:Xd,name:Yd,params:ru,source:au,svg:nu,terminals:ou,viewBox:Jd,width:eu},Symbol.toStringTag,{value:"Module"})),iu="ct",su="电流互感器 (CT)",lu="instrument-transformer",cu="-42 -62 54 64",du=54,uu=64,mu='<line x1="-30" y1="-60" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-30" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-20" x2="5" y2="-40" fill="none" stroke="black" stroke-width="1"/>',pu=[{id:"t1",x:-30,y:-60,orientation:"n"},{id:"t2",x:-30,y:0,orientation:"s"}],hu={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_10.elmt",qetEnglishName:"Current transformer, general symbol"},iA={id:iu,name:su,category:lu,viewBox:cu,width:du,height:uu,svg:mu,terminals:pu,source:hu},sA=Object.freeze(Object.defineProperty({__proto__:null,category:lu,default:iA,height:uu,id:iu,name:su,source:hu,svg:mu,terminals:pu,viewBox:cu,width:du},Symbol.toStringTag,{value:"Module"})),fu="dc-combiner",gu="直流汇流箱",bu="renewable",yu="光伏组串汇流箱 (4 路输入示例)。",xu="-27 -32 54 64",wu=54,vu=64,ku='<rect x="-25" y="-15" width="50" height="30" fill="none" stroke="black" stroke-width="1"/><line x1="-18" y1="-30" x2="-18" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="-6" y1="-30" x2="-6" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-30" x2="6" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="18" y1="-30" x2="18" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><text x="-9" y="5" font-family="Liberation Sans, Arial, sans-serif" font-size="7" fill="#000000">DC</text>',Su=[{id:"t_s1",x:-18,y:-30,orientation:"n"},{id:"t_s2",x:-6,y:-30,orientation:"n"},{id:"t_s3",x:6,y:-30,orientation:"n"},{id:"t_s4",x:18,y:-30,orientation:"n"},{id:"t_dc",x:0,y:30,orientation:"s"}],_u={kind:"inline"},lA={id:fu,name:gu,category:bu,description:yu,viewBox:xu,width:wu,height:vu,svg:ku,terminals:Su,source:_u},cA=Object.freeze(Object.defineProperty({__proto__:null,category:bu,default:lA,description:yu,height:vu,id:fu,name:gu,source:_u,svg:ku,terminals:Su,viewBox:xu,width:wu},Symbol.toStringTag,{value:"Module"})),Cu="dc-dc-converter",ju="DC/DC 变换器",$u="renewable",Au="DC/DC 变换器 / 直流充电器(IEC 60617)",Eu="-42 -42 44 44",Nu=44,Tu=44,Pu='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/>',Iu=[{id:"t_in",x:-20,y:-40,orientation:"n"},{id:"t_out",x:-20,y:0,orientation:"s"}],zu=[{name:"P",label:"功率",type:"number",unit:"kW"}],Mu={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_02.elmt",qetEnglishName:"DC/DC converter"},dA={id:Cu,name:ju,category:$u,description:Au,viewBox:Eu,width:Nu,height:Tu,svg:Pu,terminals:Iu,params:zu,source:Mu},uA=Object.freeze(Object.defineProperty({__proto__:null,category:$u,default:dA,description:Au,height:Tu,id:Cu,name:ju,params:zu,source:Mu,svg:Pu,terminals:Iu,viewBox:Eu,width:Nu},Symbol.toStringTag,{value:"Module"})),Du="dc-disconnector",Ou="直流隔离开关",Ru="switching",Lu="DC isolating switch — 光伏组串 / 储能 直流侧隔离。",Bu="-12 -32 30 64",Hu=30,Fu=64,Wu='<line x1="0" y1="-30" x2="0" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-4" x2="14" y2="-4" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-1" x2="9" y2="-1" stroke="black" stroke-width="0.8" fill="none"/><line x1="11" y1="-1" x2="14" y2="-1" stroke="black" stroke-width="0.8" fill="none"/>',qu=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Vu=[{name:"open",type:"boolean",default:!1,label:"断开"}],Gu={kind:"inline"},mA={id:Du,name:Ou,category:Ru,description:Lu,viewBox:Bu,width:Hu,height:Fu,svg:Wu,terminals:qu,state:Vu,source:Gu},pA=Object.freeze(Object.defineProperty({__proto__:null,category:Ru,default:mA,description:Lu,height:Fu,id:Du,name:Ou,source:Gu,state:Vu,svg:Wu,terminals:qu,viewBox:Bu,width:Hu},Symbol.toStringTag,{value:"Module"})),Ku="dc-motor",Uu="直流电机 (M)",Xu="load",Yu="直流电动机 (串励通用符号)。",Zu="-72 -82 89 84",Qu=89,Ju=84,em='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-40" y1="-20" x2="-20" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-15" x2="-32" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-29" y1="-15" x2="-20" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-70" y1="-80" x2="-70" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-70" y1="-30" x2="-60" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="10" y1="-30" x2="10" y2="-50" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -60 A 5 5 0 0 0 10 -50" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -70 A 5 5 0 0 0 10 -60" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -80 A 5 5 0 0 0 10 -70" fill="none" stroke="black" stroke-width="1"/>',tm=[{id:"t1",x:-70,y:-80,orientation:"n"},{id:"t2",x:10,y:-80,orientation:"n"}],nm=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],om={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_05/en_60617_06_05_01.elmt",qetEnglishName:"Series motor, DC"},hA={id:Ku,name:Uu,category:Xu,description:Yu,viewBox:Zu,width:Qu,height:Ju,svg:em,terminals:tm,params:nm,source:om},fA=Object.freeze(Object.defineProperty({__proto__:null,category:Xu,default:hA,description:Yu,height:Ju,id:Ku,name:Uu,params:nm,source:om,svg:em,terminals:tm,viewBox:Zu,width:Qu},Symbol.toStringTag,{value:"Module"})),rm="diode",am="二极管 (D)",im="passive",sm="整流 / 续流 / 保护二极管。t1=阳极(上), t2=阴极(下)。",lm="-12 -42 24 44",cm=24,dm=44,um='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/>',mm=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],pm={x:6,y:-20,anchor:"start"},hm={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_01.elmt",qetEnglishName:"Semiconductor diode, general symbol"},gA={id:rm,name:am,category:im,description:sm,viewBox:lm,width:cm,height:dm,svg:um,terminals:mm,label:pm,source:hm},bA=Object.freeze(Object.defineProperty({__proto__:null,category:im,default:gA,description:sm,height:dm,id:rm,label:pm,name:am,source:hm,svg:um,terminals:mm,viewBox:lm,width:cm},Symbol.toStringTag,{value:"Module"})),fm="disconnector",gm="隔离开关 (QS)",bm="switching",ym="-10 -42 15 64",xm=15,wm=64,vm='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-3" y1="-20" x2="3" y2="-20" fill="none" stroke="black" stroke-width="1"/>',km=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Sm=[{name:"open",type:"boolean",default:!1,label:"断开"}],_m=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],Cm={x:6,y:-10,anchor:"start"},jm={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_06.elmt",qetEnglishName:"Disconnector; Isolator"},yA={id:fm,name:gm,category:bm,viewBox:ym,width:xm,height:wm,svg:vm,terminals:km,state:Sm,params:_m,label:Cm,source:jm},xA=Object.freeze(Object.defineProperty({__proto__:null,category:bm,default:yA,height:wm,id:fm,label:Cm,name:gm,params:_m,source:jm,state:Sm,svg:vm,terminals:km,viewBox:ym,width:xm},Symbol.toStringTag,{value:"Module"})),$m="distance-relay",Am="距离继电器 (21)",Em="protection",Nm="距离 / 低阻抗保护继电器 (ANSI 21)。",Tm="-62 -42 64 44",Pm=64,Im=44,zm='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-42" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Z &lt;</text>',Mm=[{id:"t_top",x:-30,y:-40,orientation:"n"}],Dm={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_09.elmt",qetEnglishName:"Under-impedance relay"},wA={id:$m,name:Am,category:Em,description:Nm,viewBox:Tm,width:Pm,height:Im,svg:zm,terminals:Mm,source:Dm},vA=Object.freeze(Object.defineProperty({__proto__:null,category:Em,default:wA,description:Nm,height:Im,id:$m,name:Am,source:Dm,svg:zm,terminals:Mm,viewBox:Tm,width:Pm},Symbol.toStringTag,{value:"Module"})),Om="earth",Rm="接地",Lm="busbar",Bm="-12 -17 24 34",Hm=24,Fm=34,Wm='<line x1="-10" y1="0" x2="10" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-15" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="5" x2="7" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="10" x2="4" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0.5" y1="15" x2="-0.5" y2="15" fill="none" stroke="black" stroke-width="1"/>',qm=[{id:"t1",x:0,y:-15,orientation:"n"}],Vm={kind:"elmt",path:"91_en_60617/en_60617_02/en_60617_02_15/en_60617_02_15_01.elmt",qetEnglishName:"Earth or ground, general symbol"},kA={id:Om,name:Rm,category:Lm,viewBox:Bm,width:Hm,height:Fm,svg:Wm,terminals:qm,source:Vm},SA=Object.freeze(Object.defineProperty({__proto__:null,category:Lm,default:kA,height:Fm,id:Om,name:Rm,source:Vm,svg:Wm,terminals:qm,viewBox:Bm,width:Hm},Symbol.toStringTag,{value:"Module"})),Gm="earthing-switch",Km="接地刀闸 (QE)",Um="switching",Xm="隔离开关 + 接地连接,单端口",Ym="-12 -32 24 64",Zm=24,Qm=64,Jm='<line x1="0" y1="-30" x2="0" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="-12" x2="-9" y2="9" stroke="black" stroke-width="1" fill="none"/><line x1="-3" y1="-12" x2="3" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-10" y1="14" x2="10" y2="14" stroke="black" stroke-width="1" fill="none"/><line x1="-7" y1="19" x2="7" y2="19" stroke="black" stroke-width="1" fill="none"/><line x1="-4" y1="24" x2="4" y2="24" stroke="black" stroke-width="1" fill="none"/><line x1="-1.5" y1="29" x2="1.5" y2="29" stroke="black" stroke-width="1" fill="none"/>',ep=[{id:"t_top",x:0,y:-30,orientation:"n"}],tp=[{name:"open",type:"boolean",default:!0,label:"断开"}],np={x:12,y:-8,anchor:"start"},op={kind:"inline"},_A={id:Gm,name:Km,category:Um,description:Xm,viewBox:Ym,width:Zm,height:Qm,svg:Jm,terminals:ep,state:tp,label:np,source:op},CA=Object.freeze(Object.defineProperty({__proto__:null,category:Um,default:_A,description:Xm,height:Qm,id:Gm,label:np,name:Km,source:op,state:tp,svg:Jm,terminals:ep,viewBox:Ym,width:Zm},Symbol.toStringTag,{value:"Module"})),rp="energy-meter",ap="电能表 (Wh)",ip="measurement",sp="有功电能表 (kWh) — 服务入口 / 子表。",lp="-22 -36 44 72",cp=44,dp=72,up='<text x="-10" y="19.2" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Wh</text><rect x="-20" y="-10" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',mp=[{id:"t1",x:0,y:-34,orientation:"n"},{id:"t2",x:0,y:34,orientation:"s"}],pp={kind:"elmt",path:"11_singlepole/500_home_installation/40_meters/wattheuremetre_08-04-03_en60617.elmt",qetEnglishName:"Watt hour meter (en_60617)"},jA={id:rp,name:ap,category:ip,description:sp,viewBox:lp,width:cp,height:dp,svg:up,terminals:mp,source:pp},$A=Object.freeze(Object.defineProperty({__proto__:null,category:ip,default:jA,description:sp,height:dp,id:rp,name:ap,source:pp,svg:up,terminals:mp,viewBox:lp,width:cp},Symbol.toStringTag,{value:"Module"})),hp="ev-charger",fp="EV 充电桩",gp="load",bp="电动汽车充电站 / 充电桩。",yp="-17 -27 34 49",xp=34,wp=49,vp='<line x1="0" y1="-25" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-15" y="-15" width="30" height="35" fill="none" stroke="black" stroke-width="1"/><rect x="-9" y="-8" width="14" height="6" fill="none" stroke="black" stroke-width="0.8"/><rect x="5" y="-7" width="2" height="4" fill="black"/><text x="-9" y="13" font-family="Liberation Sans, Arial, sans-serif" font-size="7" fill="#000000">EV</text>',kp=[{id:"t_top",x:0,y:-25,orientation:"n"}],Sp=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],_p={kind:"inline"},AA={id:hp,name:fp,category:gp,description:bp,viewBox:yp,width:xp,height:wp,svg:vp,terminals:kp,params:Sp,source:_p},EA=Object.freeze(Object.defineProperty({__proto__:null,category:gp,default:AA,description:bp,height:wp,id:hp,name:fp,params:Sp,source:_p,svg:vp,terminals:kp,viewBox:yp,width:xp},Symbol.toStringTag,{value:"Module"})),Cp="frequency-meter",jp="频率表 (Hz)",$p="measurement",Ap="-22 -42 44 44",Ep=44,Np=44,Tp='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Hz</text>',Pp=[{id:"t_top",x:0,y:-40,orientation:"n"}],Ip={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_07.elmt",qetEnglishName:"Frequency meter"},NA={id:Cp,name:jp,category:$p,viewBox:Ap,width:Ep,height:Np,svg:Tp,terminals:Pp,source:Ip},TA=Object.freeze(Object.defineProperty({__proto__:null,category:$p,default:NA,height:Np,id:Cp,name:jp,source:Ip,svg:Tp,terminals:Pp,viewBox:Ap,width:Ep},Symbol.toStringTag,{value:"Module"})),zp="fuse-switch-disconnector",Mp="熔断器式隔离开关",Dp="switching",Op="负荷型熔断器隔离开关 (on-load fuse switch-disconnector)。",Rp="-8 -32 12 64",Lp=12,Bp=64,Hp='<line x1="0" y1="30" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="-5" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-13" x2="0" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-3" y1="6" x2="-6" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-6" x2="1" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="5" x2="-3" y2="6" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-6" x2="-6" y2="-5" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-11" rx="1" ry="1" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-13" x2="2" y2="-13" fill="none" stroke="black" stroke-width="1"/>',Fp=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Wp=[{name:"open",type:"boolean",default:!1,label:"断开"}],qp={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_21/en_60617_07_21_09.elmt",qetEnglishName:"Fuse switch-disconnector; On-load isolating fuse switch"},PA={id:zp,name:Mp,category:Dp,description:Op,viewBox:Rp,width:Lp,height:Bp,svg:Hp,terminals:Fp,state:Wp,source:qp},IA=Object.freeze(Object.defineProperty({__proto__:null,category:Dp,default:PA,description:Op,height:Bp,id:zp,name:Mp,source:qp,state:Wp,svg:Hp,terminals:Fp,viewBox:Rp,width:Lp},Symbol.toStringTag,{value:"Module"})),Vp="fuse",Gp="熔断器 (FU)",Kp="switching",Up="-7 -32 14 64",Xp=14,Yp=64,Zp='<line x1="0" y1="-30" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><rect x="-5" y="-15" width="10" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Qp=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Jp=[{name:"blown",type:"boolean",default:!1,label:"熔断"}],eh=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],th={x:7,y:-2,anchor:"start"},nh={ansi:{viewBox:"-8 -32 16 64",width:16,height:64,svg:'<line x1="0" y1="-30" x2="0" y2="-14" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -14 A 6 7 0 0 1 0 0 A 6 7 0 0 0 0 14" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="14" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/>',label:{x:9,y:-2,anchor:"start"},source:{standard:"IEEE Std 315-1975 (ANSI Y32.2-1975)",clause:"9.1.1",title:"Fuse (one-time thermal current-overload device), general"}}},oh={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_21/en_60617_07_21_01.elmt",qetEnglishName:"Fuse, general symbol"},zA={id:Vp,name:Gp,category:Kp,viewBox:Up,width:Xp,height:Yp,svg:Zp,terminals:Qp,state:Jp,params:eh,label:th,variants:nh,source:oh},MA=Object.freeze(Object.defineProperty({__proto__:null,category:Kp,default:zA,height:Yp,id:Vp,label:th,name:Gp,params:eh,source:oh,state:Jp,svg:Zp,terminals:Qp,variants:nh,viewBox:Up,width:Xp},Symbol.toStringTag,{value:"Module"})),rh="generator",ah="发电机 (G)",ih="source",sh="-42 -42 44 44",lh=44,ch=44,dh='<rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-24" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text>',uh=[{id:"t_bottom",x:-20,y:0,orientation:"s"}],mh={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_16/en_60617_06_16_01.elmt",qetEnglishName:"Generator, general symbol"},DA={id:rh,name:ah,category:ih,viewBox:sh,width:lh,height:ch,svg:dh,terminals:uh,source:mh},OA=Object.freeze(Object.defineProperty({__proto__:null,category:ih,default:DA,height:ch,id:rh,name:ah,source:mh,svg:dh,terminals:uh,viewBox:sh,width:lh},Symbol.toStringTag,{value:"Module"})),ph="genset",hh="发电机组 (G)",fh="source",gh="柴油 / 燃气发电机组。",bh="-28 -22 56 64",yh=56,xh=64,wh='<rect x="-26" y="-20" width="52" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">GEN</text><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',vh=[{id:"t_out",x:0,y:40,orientation:"s"}],kh=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],Sh={kind:"inline"},RA={id:ph,name:hh,category:fh,description:gh,viewBox:bh,width:yh,height:xh,svg:wh,terminals:vh,params:kh,source:Sh},LA=Object.freeze(Object.defineProperty({__proto__:null,category:fh,default:RA,description:gh,height:xh,id:ph,name:hh,params:kh,source:Sh,svg:wh,terminals:vh,viewBox:bh,width:yh},Symbol.toStringTag,{value:"Module"})),_h="gfci-breaker",Ch="GFCI 断路器 (RCBO)",jh="protection",$h="剩余电流断路器带过流保护 (UL943 / IEC 61009)。北美 GFCI / 欧洲 RCBO。",Ah="-18 -22 22 44",Eh=22,Nh=44,Th='<text x="-14" y="13.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">IΔ</text><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="-5,-10 0,10 0,20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-4" x2="-8" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><line x1="-8" y1="-4" x2="-8" y2="-8" fill="none" stroke="black" stroke-width="0.4"/><line x1="-13" y1="-8" x2="-8" y2="-8" fill="none" stroke="black" stroke-width="0.4"/><line x1="-13" y1="-8" x2="-13" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><line x1="-16" y1="-4" x2="-13" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><path d="M -8 1 A 2.5 3.5 0 0 0 -13 1" fill="none" stroke="black" stroke-width="0.4"/><line x1="-8" y1="1" x2="-2" y2="1" fill="none" stroke="black" stroke-width="0.4"/><line x1="-16" y1="1" x2="-13" y2="1" fill="none" stroke="black" stroke-width="0.4"/>',Ph=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Ih=[{name:"open",type:"boolean",default:!1,label:"断开"}],zh=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"IDn",label:"剩余动作电流",type:"number",unit:"mA",default:30,showOnCanvas:!0}],Mh={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/rcbo.elmt",qetEnglishName:"Residual Circuit Breaker with Overload"},BA={id:_h,name:Ch,category:jh,description:$h,viewBox:Ah,width:Eh,height:Nh,svg:Th,terminals:Ph,state:Ih,params:zh,source:Mh},HA=Object.freeze(Object.defineProperty({__proto__:null,category:jh,default:BA,description:$h,height:Nh,id:_h,name:Ch,params:zh,source:Mh,state:Ih,svg:Th,terminals:Ph,viewBox:Ah,width:Eh},Symbol.toStringTag,{value:"Module"})),Dh="grid-source",Oh="系统电源",Rh="source",Lh="无穷大母线 / 外部电网",Bh="-16 -31 32 53",Hh=32,Fh=53,Wh='<circle cx="0" cy="-15" r="14" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-12" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">~</text><line x1="0" y1="-1" x2="0" y2="20" stroke="black" stroke-width="1" fill="none"/>',qh=[{id:"t_bottom",x:0,y:20,orientation:"s"}],Vh={kind:"inline"},FA={id:Dh,name:Oh,category:Rh,description:Lh,viewBox:Bh,width:Hh,height:Fh,svg:Wh,terminals:qh,source:Vh},WA=Object.freeze(Object.defineProperty({__proto__:null,category:Rh,default:FA,description:Lh,height:Fh,id:Dh,name:Oh,source:Vh,svg:Wh,terminals:qh,viewBox:Bh,width:Hh},Symbol.toStringTag,{value:"Module"})),Gh="grounding-transformer",Kh="接地变 (Z形)",Uh="grounding",Xh="星-曲折接线变压器,中性点接地用",Yh="-62 -152 64 164",Zh=64,Qh=164,Jh='<line x1="-30" y1="-40" x2="-35" y2="-35" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-25" y2="-35" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-35" x2="-40" y2="-38" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-150" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-35" x2="-25" y2="-30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-30" y2="-45" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-45" x2="-25" y2="-48" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-130" x2="-20" y2="-140" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-135" x2="-20" y2="-145" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="0" x2="-20" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="5" x2="-20" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-85" x2="-30" y2="-95" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-95" x2="-20" y2="-100" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-95" x2="-40" y2="-100" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-20" y2="-40" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-40" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/>',ef=[{id:"t1",x:-30,y:-150,orientation:"n"},{id:"t2",x:-30,y:10,orientation:"s"}],tf={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_10/en_60617_06_10_15.elmt",qetEnglishName:"Three-phase transformer, connection star-zigzag with the neutral brought out"},qA={id:Gh,name:Kh,category:Uh,description:Xh,viewBox:Yh,width:Zh,height:Qh,svg:Jh,terminals:ef,source:tf},VA=Object.freeze(Object.defineProperty({__proto__:null,category:Uh,default:qA,description:Xh,height:Qh,id:Gh,name:Kh,source:tf,svg:Jh,terminals:ef,viewBox:Yh,width:Zh},Symbol.toStringTag,{value:"Module"})),nf="heater",of="电加热器 (EH)",rf="load",af="电阻加热元件 / 电热负荷。",sf="-22 -7 54 14",lf=54,cf=14,df='<line x1="-20" y1="0" x2="-10" y2="0" fill="none" stroke="black" stroke-width="1"/><rect x="-10" y="-5" width="30" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="0" x2="30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-5" x2="-5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-5" x2="5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="15" y1="-5" x2="15" y2="5" fill="none" stroke="black" stroke-width="1"/>',uf=[{id:"t1",x:-20,y:0,orientation:"w"},{id:"t2",x:30,y:0,orientation:"e"}],mf=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],pf={kind:"elmt",path:"91_en_60617/en_60617_04/en_60617_04_01/en_60617_04_01_12.elmt",qetEnglishName:"Heating element"},GA={id:nf,name:of,category:rf,description:af,viewBox:sf,width:lf,height:cf,svg:df,terminals:uf,params:mf,source:pf},KA=Object.freeze(Object.defineProperty({__proto__:null,category:rf,default:GA,description:af,height:cf,id:nf,name:of,params:mf,source:pf,svg:df,terminals:uf,viewBox:sf,width:lf},Symbol.toStringTag,{value:"Module"})),hf="igbt",ff="绝缘栅双极晶体管 (IGBT)",gf="passive",bf="N 沟道增强型 IGBT。t1=集电极(上), t2=发射极(下), t_g=门极。",yf="-32 -32 54 74",xf=54,wf=74,vf='<line x1="0" y1="25" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polyline points="-30,20 -5,20 -5,-20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-15" x2="20" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="20" y2="40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="15" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-25" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-8" x2="0" y2="8" fill="none" stroke="black" stroke-width="1"/><polyline points="10,-24 8,-21 12,-22" fill="none" stroke="black" stroke-width="1"/><polyline points="10,25 11,29 8,27" fill="none" stroke="black" stroke-width="1"/>',kf=[{id:"t1",x:20,y:-30,orientation:"n"},{id:"t2",x:20,y:40,orientation:"s"},{id:"t_g",x:-30,y:20,orientation:"w"}],Sf={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_05/en_60617_05_05_19.elmt",qetEnglishName:"Insulated-gate bipolar transistor (IGBT) enhancement type, N channel"},UA={id:hf,name:ff,category:gf,description:bf,viewBox:yf,width:xf,height:wf,svg:vf,terminals:kf,source:Sf},XA=Object.freeze(Object.defineProperty({__proto__:null,category:gf,default:UA,description:bf,height:wf,id:hf,name:ff,source:Sf,svg:vf,terminals:kf,viewBox:yf,width:xf},Symbol.toStringTag,{value:"Module"})),_f="indicator-light",Cf="指示灯 (HL)",jf="control",$f="信号 / 状态指示灯。",Af="-12 -22 24 24",Ef=24,Nf=24,Tf='<ellipse cx="0" cy="-10" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-3" x2="7" y2="-17" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-17" x2="7" y2="-3" fill="none" stroke="black" stroke-width="1"/>',Pf=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],If=[{name:"color",label:"颜色",type:"string"}],zf={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_01.elmt",qetEnglishName:"Lamp, general symbol"},YA={id:_f,name:Cf,category:jf,description:$f,viewBox:Af,width:Ef,height:Nf,svg:Tf,terminals:Pf,params:If,source:zf},ZA=Object.freeze(Object.defineProperty({__proto__:null,category:jf,default:YA,description:$f,height:Nf,id:_f,name:Cf,params:If,source:zf,svg:Tf,terminals:Pf,viewBox:Af,width:Ef},Symbol.toStringTag,{value:"Module"})),Mf="inductor",Df="电感 (L)",Of="passive",Rf="通用电感 / 线圈 / 扼流圈。",Lf="-17 -32 34 64",Bf=34,Hf=64,Ff='<line x1="0" y1="15" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><path d="M 0 15 A 15 15 0 1 0 -15 0" fill="none" stroke="black" stroke-width="1"/><line x1="-15" y1="0" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>',Wf=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],qf=[{name:"L",label:"电感量",type:"number",unit:"mH",showOnCanvas:!0},{name:"In",label:"额定电流",type:"number",unit:"A"}],Vf={x:6,y:0,anchor:"start"},Gf={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/30_inductors/inductance.elmt",qetEnglishName:"Inductor"},QA={id:Mf,name:Df,category:Of,description:Rf,viewBox:Lf,width:Bf,height:Hf,svg:Ff,terminals:Wf,params:qf,label:Vf,source:Gf},JA=Object.freeze(Object.defineProperty({__proto__:null,category:Of,default:QA,description:Rf,height:Hf,id:Mf,label:Vf,name:Df,params:qf,source:Gf,svg:Ff,terminals:Wf,viewBox:Lf,width:Bf},Symbol.toStringTag,{value:"Module"})),Kf="inverter",Uf="逆变器 (DC→AC)",Xf="renewable",Yf="-42 -42 44 44",Zf=44,Qf=44,Jf='<g transform="matrix(1 0 0 -1 0 -40)"><path d="M -15 -8 A 5 2.5 0 0 0 -25 -8" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><path d="M -15 -8 A 5 2.5 0 0 0 -5 -8" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/></g>',eg=[{id:"t_dc",x:-20,y:0,orientation:"s"},{id:"t_ac",x:-20,y:-40,orientation:"n"}],tg={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_05.elmt",qetEnglishName:"Inverter"},eE={id:Kf,name:Uf,category:Xf,viewBox:Yf,width:Zf,height:Qf,svg:Jf,terminals:eg,source:tg},tE=Object.freeze(Object.defineProperty({__proto__:null,category:Xf,default:eE,height:Qf,id:Kf,name:Uf,source:tg,svg:Jf,terminals:eg,viewBox:Yf,width:Zf},Symbol.toStringTag,{value:"Module"})),ng="limit-switch",og="限位开关 (SQ)",rg="control",ag="行程 / 位置开关 (常开, 机械操作)。",ig="-10 -42 12 64",sg=12,lg=64,cg='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-13" x2="-7" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-12" x2="-3" y2="-8" fill="none" stroke="black" stroke-width="1"/>',dg=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],ug=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],mg={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_08/en_60617_07_08_01.elmt",qetEnglishName:"Position switch, make contact"},nE={id:ng,name:og,category:rg,description:ag,viewBox:ig,width:sg,height:lg,svg:cg,terminals:dg,state:ug,source:mg},oE=Object.freeze(Object.defineProperty({__proto__:null,category:rg,default:nE,description:ag,height:lg,id:ng,name:og,source:mg,state:ug,svg:cg,terminals:dg,viewBox:ig,width:sg},Symbol.toStringTag,{value:"Module"})),pg="load-switch",hg="负荷开关",fg="switching",gg="-10 -42 14 64",bg=14,yg=64,xg='<line x1="0" y1="-24" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-22" rx="2" ry="2" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-24" x2="2" y2="-24" fill="none" stroke="black" stroke-width="1"/>',wg=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],vg=[{name:"open",type:"boolean",default:!1,label:"断开"}],kg={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_08.elmt",qetEnglishName:"Switch-disconnector; On-load isolating switch"},rE={id:pg,name:hg,category:fg,viewBox:gg,width:bg,height:yg,svg:xg,terminals:wg,state:vg,source:kg},aE=Object.freeze(Object.defineProperty({__proto__:null,category:fg,default:rE,height:yg,id:pg,name:hg,source:kg,state:vg,svg:xg,terminals:wg,viewBox:gg,width:bg},Symbol.toStringTag,{value:"Module"})),Sg="load",_g="负荷",Cg="load",jg="抽象负荷(电流流出箭头)",$g="-8 -22 16 46",Ag=16,Eg=46,Ng='<line x1="0" y1="-20" x2="0" y2="10" stroke="black" stroke-width="1" fill="none"/><polygon points="-6,10 6,10 0,22" fill="black" stroke="black" stroke-width="1"/>',Tg=[{id:"t_top",x:0,y:-20,orientation:"n"}],Pg=[{name:"P",label:"有功功率",type:"number",unit:"MW",showOnCanvas:!0},{name:"cosphi",label:"功率因数",type:"number"}],Ig={x:6,y:0,anchor:"start"},zg={kind:"inline"},iE={id:Sg,name:_g,category:Cg,description:jg,viewBox:$g,width:Ag,height:Eg,svg:Ng,terminals:Tg,params:Pg,label:Ig,source:zg},sE=Object.freeze(Object.defineProperty({__proto__:null,category:Cg,default:iE,description:jg,height:Eg,id:Sg,label:Ig,name:_g,params:Pg,source:zg,svg:Ng,terminals:Tg,viewBox:$g,width:Ag},Symbol.toStringTag,{value:"Module"})),Mg="luminaire",Dg="灯具 / 照明负荷",Og="load",Rg="照明负荷(IEC 60617 荧光灯具通用符号)。区别于 indicator-light:那是面板信号灯,这是回路末端的照明负荷。",Lg="-27 -7 54 14",Bg=54,Hg=14,Fg='<line x1="-25" y1="0" x2="25" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-5" x2="-25" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="-5" x2="25" y2="5" fill="none" stroke="black" stroke-width="1"/>',Wg=[{id:"t_top",x:0,y:0,orientation:"n"}],qg=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],Vg={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_15/en_60617_11_15_04.elmt",qetEnglishName:"Luminaire, general symbol; Fluorescent lamp, general symbol"},lE={id:Mg,name:Dg,category:Og,description:Rg,viewBox:Lg,width:Bg,height:Hg,svg:Fg,terminals:Wg,params:qg,source:Vg},cE=Object.freeze(Object.defineProperty({__proto__:null,category:Og,default:lE,description:Rg,height:Hg,id:Mg,name:Dg,params:qg,source:Vg,svg:Fg,terminals:Wg,viewBox:Lg,width:Bg},Symbol.toStringTag,{value:"Module"})),Gg="make-contact",Kg="常开触点 (NO)",Ug="control",Xg="常开辅助触点 (make contact)。",Yg="-10 -42 12 64",Zg=12,Qg=64,Jg='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>',eb=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],tb=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],nb={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_02/en_60617_07_02_01.elmt",qetEnglishName:"Make contact, general symbol; Switch, general symbol"},dE={id:Gg,name:Kg,category:Ug,description:Xg,viewBox:Yg,width:Zg,height:Qg,svg:Jg,terminals:eb,state:tb,source:nb},uE=Object.freeze(Object.defineProperty({__proto__:null,category:Ug,default:dE,description:Xg,height:Qg,id:Gg,name:Kg,source:nb,state:tb,svg:Jg,terminals:eb,viewBox:Yg,width:Zg},Symbol.toStringTag,{value:"Module"})),ob="motor-starter",rb="电机启动器",ab="motor-control",ib="电机启动器 (IEC 60617 通用符号)。",sb="-22 -27 44 54",lb=44,cb=54,db='<rect x="-20" y="-20" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><polyline points="-20,-20 0,-10 20,-20" fill="none" stroke="black" stroke-width="1"/>',ub=[{id:"t_top",x:0,y:-25,orientation:"n"},{id:"t_bottom",x:0,y:25,orientation:"s"}],mb={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_14/en_60617_07_14_01.elmt",qetEnglishName:"Motor starter, general symbol"},mE={id:ob,name:rb,category:ab,description:ib,viewBox:sb,width:lb,height:cb,svg:db,terminals:ub,source:mb},pE=Object.freeze(Object.defineProperty({__proto__:null,category:ab,default:mE,description:ib,height:cb,id:ob,name:rb,source:mb,svg:db,terminals:ub,viewBox:sb,width:lb},Symbol.toStringTag,{value:"Module"})),pb="mppt",hb="MPPT 控制器",fb="renewable",gb="MPPT 太阳能充电控制器(DC/DC,最大功率点跟踪)",bb="-42 -42 44 44",yb=44,xb=44,wb='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/>',vb=[{id:"t_pv",x:-20,y:-40,orientation:"n"},{id:"t_bat",x:-20,y:0,orientation:"s"}],kb=[{name:"I",label:"额定电流",type:"number",unit:"A"}],Sb={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_02.elmt",qetEnglishName:"DC/DC converter"},hE={id:pb,name:hb,category:fb,description:gb,viewBox:bb,width:yb,height:xb,svg:wb,terminals:vb,params:kb,source:Sb},fE=Object.freeze(Object.defineProperty({__proto__:null,category:fb,default:hE,description:gb,height:xb,id:pb,name:hb,params:kb,source:Sb,svg:wb,terminals:vb,viewBox:bb,width:yb},Symbol.toStringTag,{value:"Module"})),_b="ngr",Cb="中性点电阻 (NGR)",jb="grounding",$b="小电阻接地:连接变压器中性点到地",Ab="-12 -32 24 62",Eb=24,Nb=62,Tb='<line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><rect x="-6" y="-15" width="12" height="22" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="7" x2="0" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="15" x2="10" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="19" x2="7" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="23" x2="4" y2="23" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="27" x2="1.5" y2="27" fill="none" stroke="black" stroke-width="1"/>',Pb=[{id:"t_top",x:0,y:-30,orientation:"n"}],Ib=[{name:"R",label:"电阻",type:"number",unit:"Ω"}],zb={kind:"inline"},gE={id:_b,name:Cb,category:jb,description:$b,viewBox:Ab,width:Eb,height:Nb,svg:Tb,terminals:Pb,params:Ib,source:zb},bE=Object.freeze(Object.defineProperty({__proto__:null,category:jb,default:gE,description:$b,height:Nb,id:_b,name:Cb,params:Ib,source:zb,svg:Tb,terminals:Pb,viewBox:Ab,width:Eb},Symbol.toStringTag,{value:"Module"})),Mb="off-delay-break-contact",Db="断电延时闭合常闭触点 (KT)",Ob="control",Rb="常闭触点,线圈断电后延时闭合 (IEC 60617-07-05-04)。",Lb="-47 -42 59 64",Bb=59,Hb=64,Fb='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/><path d="M -35 0 A 10 10 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-11" x2="3" y2="-11" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-9" x2="3" y2="-9" fill="none" stroke="black" stroke-width="1"/>',Wb=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],qb=[{name:"open",type:"boolean",default:!1,label:"断开"}],Vb=[{name:"delay",label:"延时",type:"number",unit:"s",showOnCanvas:!0}],Gb={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_05/en_60617_07_05_04.elmt",qetEnglishName:"Break contact, delayed closing"},yE={id:Mb,name:Db,category:Ob,description:Rb,viewBox:Lb,width:Bb,height:Hb,svg:Fb,terminals:Wb,state:qb,params:Vb,source:Gb},xE=Object.freeze(Object.defineProperty({__proto__:null,category:Ob,default:yE,description:Rb,height:Hb,id:Mb,name:Db,params:Vb,source:Gb,state:qb,svg:Fb,terminals:Wb,viewBox:Lb,width:Bb},Symbol.toStringTag,{value:"Module"})),Kb="off-delay-make-contact",Ub="断电延时断开常开触点 (KT)",Xb="control",Yb="常开触点,线圈断电后延时断开 (IEC 60617-07-05-02)。",Zb="-47 -42 49 64",Qb=49,Jb=64,e0='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><path d="M -35 0 A 10 10 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-11" x2="-4" y2="-11" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-9" x2="-4" y2="-9" fill="none" stroke="black" stroke-width="1"/>',t0=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],n0=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],o0=[{name:"delay",label:"延时",type:"number",unit:"s",showOnCanvas:!0}],r0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_05/en_60617_07_05_02.elmt",qetEnglishName:"Make contact, delayed opening"},wE={id:Kb,name:Ub,category:Xb,description:Yb,viewBox:Zb,width:Qb,height:Jb,svg:e0,terminals:t0,state:n0,params:o0,source:r0},vE=Object.freeze(Object.defineProperty({__proto__:null,category:Xb,default:wE,description:Yb,height:Jb,id:Kb,name:Ub,params:o0,source:r0,state:n0,svg:e0,terminals:t0,viewBox:Zb,width:Qb},Symbol.toStringTag,{value:"Module"})),a0="on-delay-break-contact",i0="通电延时断开常闭触点 (KT)",s0="control",l0="常闭触点,线圈通电后延时断开 (IEC 60617-07-05-03)。",c0="-27 -42 39 64",d0=39,u0=64,m0='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/><path d="M -15 -20 A 10 10 0 0 0 -15 0" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-11" x2="3" y2="-11" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-9" x2="3" y2="-9" fill="none" stroke="black" stroke-width="1"/>',p0=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],h0=[{name:"open",type:"boolean",default:!1,label:"断开"}],f0=[{name:"delay",label:"延时",type:"number",unit:"s",showOnCanvas:!0}],g0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_05/en_60617_07_05_03.elmt",qetEnglishName:"Break contact, delayed opening"},kE={id:a0,name:i0,category:s0,description:l0,viewBox:c0,width:d0,height:u0,svg:m0,terminals:p0,state:h0,params:f0,source:g0},SE=Object.freeze(Object.defineProperty({__proto__:null,category:s0,default:kE,description:l0,height:u0,id:a0,name:i0,params:f0,source:g0,state:h0,svg:m0,terminals:p0,viewBox:c0,width:d0},Symbol.toStringTag,{value:"Module"})),b0="on-delay-make-contact",y0="通电延时闭合常开触点 (KT)",x0="control",w0="常开触点,线圈通电后延时闭合 (IEC 60617-07-05-01)。",v0="-27 -42 29 64",k0=29,S0=64,_0='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><path d="M -15 -20 A 10 10 0 0 0 -15 0" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-11" x2="-4" y2="-11" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-9" x2="-4" y2="-9" fill="none" stroke="black" stroke-width="1"/>',C0=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],j0=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],$0=[{name:"delay",label:"延时",type:"number",unit:"s",showOnCanvas:!0}],A0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_05/en_60617_07_05_01.elmt",qetEnglishName:"Make contact, delayed closing"},_E={id:b0,name:y0,category:x0,description:w0,viewBox:v0,width:k0,height:S0,svg:_0,terminals:C0,state:j0,params:$0,source:A0},CE=Object.freeze(Object.defineProperty({__proto__:null,category:x0,default:_E,description:w0,height:S0,id:b0,name:y0,params:$0,source:A0,state:j0,svg:_0,terminals:C0,viewBox:v0,width:k0},Symbol.toStringTag,{value:"Module"})),E0="overcurrent-relay",N0="过流继电器 (50/51)",T0="protection",P0="过电流保护继电器 (ANSI 50/51)。",I0="-62 -62 64 64",z0=64,M0=64,D0='<rect x="-60" y="-60" width="60" height="60" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-48" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">5...10A</text>',O0=[{id:"t_top",x:-30,y:-60,orientation:"n"}],R0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_05.elmt",qetEnglishName:"Overcurrent relay"},jE={id:E0,name:N0,category:T0,description:P0,viewBox:I0,width:z0,height:M0,svg:D0,terminals:O0,source:R0},$E=Object.freeze(Object.defineProperty({__proto__:null,category:T0,default:jE,description:P0,height:M0,id:E0,name:N0,source:R0,svg:D0,terminals:O0,viewBox:I0,width:z0},Symbol.toStringTag,{value:"Module"})),L0="panelboard",B0="配电箱",H0="load",F0="配电箱 / 负荷中心(IEC 60617 分配中心符号):顶部进线,底部分路示意",W0="-52 -62 54 64",q0=54,V0=64,G0='<g transform="matrix(1 0 0 -1 0 -60)"><rect x="-50" y="-40" width="50" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-60" x2="-40" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-60" x2="-30" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-60" x2="-20" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-60" x2="-10" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-20" x2="-25" y2="0" fill="none" stroke="black" stroke-width="1"/></g>',K0=[{id:"t_in",x:-25,y:-60,orientation:"n"}],U0=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],X0={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_12/en_60617_11_12_07.elmt",qetEnglishName:"Distribution centre"},AE={id:L0,name:B0,category:H0,description:F0,viewBox:W0,width:q0,height:V0,svg:G0,terminals:K0,params:U0,source:X0},EE=Object.freeze(Object.defineProperty({__proto__:null,category:H0,default:AE,description:F0,height:V0,id:L0,name:B0,params:U0,source:X0,svg:G0,terminals:K0,viewBox:W0,width:q0},Symbol.toStringTag,{value:"Module"})),Y0="phase-failure-relay",Z0="断相继电器",Q0="protection",J0="断相 / 缺相保护继电器。",ey="-62 -42 64 44",ty=64,ny=44,oy='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">m &lt; 3</text>',ry=[{id:"t_top",x:-30,y:-40,orientation:"n"}],ay={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_12.elmt",qetEnglishName:"Phase-failure detection relay"},NE={id:Y0,name:Z0,category:Q0,description:J0,viewBox:ey,width:ty,height:ny,svg:oy,terminals:ry,source:ay},TE=Object.freeze(Object.defineProperty({__proto__:null,category:Q0,default:NE,description:J0,height:ny,id:Y0,name:Z0,source:ay,svg:oy,terminals:ry,viewBox:ey,width:ty},Symbol.toStringTag,{value:"Module"})),iy="plc",sy="PLC / 控制器",ly="control",cy="可编程逻辑控制器 (PLC)。",dy="-24 -42 48 84",uy=48,my=84,py='<rect x="-22" y="-22" width="44" height="44" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">PLC</text><line x1="0" y1="-40" x2="0" y2="-22" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="22" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',hy=[{id:"t_top",x:0,y:-40,orientation:"n"},{id:"t_bottom",x:0,y:40,orientation:"s"}],fy={kind:"inline"},PE={id:iy,name:sy,category:ly,description:cy,viewBox:dy,width:uy,height:my,svg:py,terminals:hy,source:fy},IE=Object.freeze(Object.defineProperty({__proto__:null,category:ly,default:PE,description:cy,height:my,id:iy,name:sy,source:fy,svg:py,terminals:hy,viewBox:dy,width:uy},Symbol.toStringTag,{value:"Module"})),gy="power-factor-meter",by="功率因数表 (cosφ)",yy="measurement",xy="功率因数表 (cosφ)。",wy="-22 -42 44 44",vy=44,ky=44,Sy='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-14" y="-6.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">cos φ</text>',_y=[{id:"t_top",x:0,y:-40,orientation:"n"}],Cy={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_05.elmt",qetEnglishName:"Power-factor meter"},zE={id:gy,name:by,category:yy,description:xy,viewBox:wy,width:vy,height:ky,svg:Sy,terminals:_y,source:Cy},ME=Object.freeze(Object.defineProperty({__proto__:null,category:yy,default:zE,description:xy,height:ky,id:gy,name:by,source:Cy,svg:Sy,terminals:_y,viewBox:wy,width:vy},Symbol.toStringTag,{value:"Module"})),jy="power-supply",$y="开关电源 (PS)",Ay="source",Ey="AC→DC 开关电源 / 直流电源模块。t_ac 上(~), t_dc 下(=)。",Ny="-24 -42 48 84",Ty=48,Py=84,Iy='<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="8" y="15" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">=</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',zy=[{id:"t_ac",x:0,y:-40,orientation:"n"},{id:"t_dc",x:0,y:40,orientation:"s"}],My=[{name:"Vdc",label:"输出电压",type:"number",unit:"V",showOnCanvas:!0}],Dy={kind:"inline"},DE={id:jy,name:$y,category:Ay,description:Ey,viewBox:Ny,width:Ty,height:Py,svg:Iy,terminals:zy,params:My,source:Dy},OE=Object.freeze(Object.defineProperty({__proto__:null,category:Ay,default:DE,description:Ey,height:Py,id:jy,name:$y,params:My,source:Dy,svg:Iy,terminals:zy,viewBox:Ny,width:Ty},Symbol.toStringTag,{value:"Module"})),Oy="protective-relay",Ry="保护继电器",Ly="protection",By="测量继电器 / 保护继电器通用符号 (IEC 60617)。",Hy="-32 -42 64 44",Fy=64,Wy=44,qy='<polygon points="-2,-22 2,-22 0,-25" fill="black" stroke="black" stroke-width="1"/><polygon points="-2,-22 -2,-19 -6,-20" fill="black" stroke="black" stroke-width="1"/><polygon points="2,-22 2,-19 6,-20" fill="black" stroke="black" stroke-width="1"/><polygon points="-2,-19 0,-17 -3,-15" fill="black" stroke="black" stroke-width="1"/><polygon points="0,-17 2,-19 4,-15" fill="black" stroke="black" stroke-width="1"/><rect x="-2" y="-22" width="4" height="4" rx="0" ry="0" fill="black" stroke="black" stroke-width="1"/><rect x="-30" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Vy=[{id:"t_top",x:0,y:-40,orientation:"n"}],Gy={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_16/en_60617_07_16_01.elmt",qetEnglishName:"Measuring relay; Device related to a measuring relay"},RE={id:Oy,name:Ry,category:Ly,description:By,viewBox:Hy,width:Fy,height:Wy,svg:qy,terminals:Vy,source:Gy},LE=Object.freeze(Object.defineProperty({__proto__:null,category:Ly,default:RE,description:By,height:Wy,id:Oy,name:Ry,source:Gy,svg:qy,terminals:Vy,viewBox:Hy,width:Fy},Symbol.toStringTag,{value:"Module"})),Ky="proximity-switch",Uy="接近开关 (SQ)",Xy="control",Yy="接近传感器 / 无触点接近开关。",Zy="-12 -32 24 64",Qy=24,Jy=64,e1='<line x1="0" y1="-30" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="30" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="0,-10 -10,0 0,10 10,0" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-6" x2="-4" y2="6" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="-6" x2="4" y2="6" fill="none" stroke="black" stroke-width="1"/>',t1=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],n1={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_19/en_60617_07_19_01.elmt",qetEnglishName:"Proximity sensor"},BE={id:Ky,name:Uy,category:Xy,description:Yy,viewBox:Zy,width:Qy,height:Jy,svg:e1,terminals:t1,source:n1},HE=Object.freeze(Object.defineProperty({__proto__:null,category:Xy,default:BE,description:Yy,height:Jy,id:Ky,name:Uy,source:n1,svg:e1,terminals:t1,viewBox:Zy,width:Qy},Symbol.toStringTag,{value:"Module"})),o1="pt",r1="电压互感器 (PT)",a1="instrument-transformer",i1="-22 -42 44 115",s1=44,l1=115,c1='<ellipse cx="0" cy="1" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-40" x2="0" y2="-20" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="30" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="-0.13" y1="51" x2="-0.13" y2="71" fill="none" stroke="black" stroke-width="1"/>',d1=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:71,orientation:"s"}],u1={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_13/en_60617_06_13_01A.elmt",qetEnglishName:"Voltage transformer"},FE={id:o1,name:r1,category:a1,viewBox:i1,width:s1,height:l1,svg:c1,terminals:d1,source:u1},WE=Object.freeze(Object.defineProperty({__proto__:null,category:a1,default:FE,height:l1,id:o1,name:r1,source:u1,svg:c1,terminals:d1,viewBox:i1,width:s1},Symbol.toStringTag,{value:"Module"})),m1="push-button",p1="按钮 (SB)",h1="control",f1="手动按钮, 自动复位 (常开 make)。",g1="-37 -42 39 64",b1=39,y1=64,x1='<line x1="-35" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-15" x2="-35" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-15" x2="-30" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-5" x2="-35" y2="-5" fill="none" stroke="black" stroke-width="1"/>',w1=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],v1={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_02.elmt",qetEnglishName:"Switch, manually operated, push-button, automatic return"},qE={id:m1,name:p1,category:h1,description:f1,viewBox:g1,width:b1,height:y1,svg:x1,terminals:w1,source:v1},VE=Object.freeze(Object.defineProperty({__proto__:null,category:h1,default:qE,description:f1,height:y1,id:m1,name:p1,source:v1,svg:x1,terminals:w1,viewBox:g1,width:b1},Symbol.toStringTag,{value:"Module"})),k1="pv",S1="光伏组件",_1="renewable",C1="-33 -22 85 64",j1=85,$1=64,A1='<line x1="-16" y1="24" x2="-26" y2="14" fill="none" stroke="black" stroke-width="1"/><line x1="-21" y1="29" x2="-31" y2="19" fill="none" stroke="black" stroke-width="1"/><polygon points="-20,23 -17,20 -15,25" fill="black" stroke="black" stroke-width="1"/><polygon points="-22,25 -25,28 -20,30" fill="black" stroke="black" stroke-width="1"/><rect x="-10" y="-20" width="60" height="60" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="15" y="7.2" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text><line x1="10" y1="20" x2="20" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="15" x2="20" y2="25" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="10" x2="25" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="20" x2="35" y2="20" fill="none" stroke="black" stroke-width="1"/>',E1=[{id:"t_dc",x:0,y:40,orientation:"s"}],N1={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_18/en_60617_06_18_06.elmt",qetEnglishName:"Photovoltaic generator"},GE={id:k1,name:S1,category:_1,viewBox:C1,width:j1,height:$1,svg:A1,terminals:E1,source:N1},KE=Object.freeze(Object.defineProperty({__proto__:null,category:_1,default:GE,height:$1,id:k1,name:S1,source:N1,svg:A1,terminals:E1,viewBox:C1,width:j1},Symbol.toStringTag,{value:"Module"})),T1="rcd",P1="剩余电流装置 (RCD)",I1="protection",z1="不带过流保护的剩余电流断路器 (IEC 61008)。",M1="-12 -22 19 44",D1=19,O1=44,R1='<line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="0,20 0,10 -7,-9" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="13" rx="4.5" ry="2" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,0 -10,0 -10,13 -5,13" fill="none" stroke="black" stroke-width="0.4" stroke-dasharray="4 2"/>',L1=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],B1=[{name:"open",type:"boolean",default:!1,label:"断开"}],H1=[{name:"IDn",label:"剩余动作电流",type:"number",unit:"mA",default:30,showOnCanvas:!0}],F1={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/ddr1.elmt",qetEnglishName:"Residual Circuit Breaker with Overload"},UE={id:T1,name:P1,category:I1,description:z1,viewBox:M1,width:D1,height:O1,svg:R1,terminals:L1,state:B1,params:H1,source:F1},XE=Object.freeze(Object.defineProperty({__proto__:null,category:I1,default:UE,description:z1,height:O1,id:T1,name:P1,params:H1,source:F1,state:B1,svg:R1,terminals:L1,viewBox:M1,width:D1},Symbol.toStringTag,{value:"Module"})),W1="recloser",q1="重合闸 (Recloser)",V1="protection",G1="中压自动重合闸开关。",K1="-12 -32 36 64",U1=36,X1=64,Y1='<line x1="0" y1="-30" x2="0" y2="-10" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-13" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-8" x2="2" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-12" x2="2" y2="-8" stroke="black" stroke-width="1" fill="none"/><path d="M 13 -12 A 7 7 0 1 1 6 -5" fill="none" stroke="black" stroke-width="0.8"/><polygon points="4,-7 6,-5 8,-3" fill="black"/><text x="14" y="6" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">AR</text>',Z1=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Q1=[{name:"open",type:"boolean",default:!1,label:"断开"}],J1={kind:"inline"},YE={id:W1,name:q1,category:V1,description:G1,viewBox:K1,width:U1,height:X1,svg:Y1,terminals:Z1,state:Q1,source:J1},ZE=Object.freeze(Object.defineProperty({__proto__:null,category:V1,default:YE,description:G1,height:X1,id:W1,name:q1,source:J1,state:Q1,svg:Y1,terminals:Z1,viewBox:K1,width:U1},Symbol.toStringTag,{value:"Module"})),ex="rectifier",tx="整流器 (AC→DC)",nx="renewable",ox="-42 -42 44 44",rx=44,ax=44,ix='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/>',sx=[{id:"t_ac",x:-20,y:-40,orientation:"n"},{id:"t_dc",x:-20,y:0,orientation:"s"}],lx={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_03.elmt",qetEnglishName:"Rectifier"},QE={id:ex,name:tx,category:nx,viewBox:ox,width:rx,height:ax,svg:ix,terminals:sx,source:lx},JE=Object.freeze(Object.defineProperty({__proto__:null,category:nx,default:QE,height:ax,id:ex,name:tx,source:lx,svg:ix,terminals:sx,viewBox:ox,width:rx},Symbol.toStringTag,{value:"Module"})),cx="relay-coil",dx="继电器线圈 (KA)",ux="control",mx="继电器 / 接触器操作线圈 (方框)。",px="-22 -22 44 44",hx=44,fx=44,gx='<rect x="-20" y="-10" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/>',bx=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],yx={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_15/en_60617_07_15_01.elmt",qetEnglishName:"Operating device, general symbol; Relay coil, general symbol"},eN={id:cx,name:dx,category:ux,description:mx,viewBox:px,width:hx,height:fx,svg:gx,terminals:bx,source:yx},tN=Object.freeze(Object.defineProperty({__proto__:null,category:ux,default:eN,description:mx,height:fx,id:cx,name:dx,source:yx,svg:gx,terminals:bx,viewBox:px,width:hx},Symbol.toStringTag,{value:"Module"})),xx="resistor",wx="电阻 (R)",vx="passive",kx="通用电阻 / 限流 / 制动电阻。",Sx="-6 -23 12 35",_x=12,Cx=35,jx='<line x1="0" y1="-10" x2="0" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="10" x2="4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="10" x2="4" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-10" x2="-4" y2="10" fill="none" stroke="black" stroke-width="1"/>',$x=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t2",x:0,y:10,orientation:"s"}],Ax=[{name:"R",label:"阻值",type:"number",unit:"Ω",showOnCanvas:!0},{name:"P",label:"额定功率",type:"number",unit:"W"}],Ex={x:6,y:0,anchor:"start"},Nx={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/10_resistors/resistance.elmt",qetEnglishName:"Resistor"},nN={id:xx,name:wx,category:vx,description:kx,viewBox:Sx,width:_x,height:Cx,svg:jx,terminals:$x,params:Ax,label:Ex,source:Nx},oN=Object.freeze(Object.defineProperty({__proto__:null,category:vx,default:nN,description:kx,height:Cx,id:xx,label:Ex,name:wx,params:Ax,source:Nx,svg:jx,terminals:$x,viewBox:Sx,width:_x},Symbol.toStringTag,{value:"Module"})),Tx="reverse-power-relay",Px="逆功率继电器 (32)",Ix="protection",zx="逆功率 / 逆流保护继电器 (ANSI 32)。",Mx="-62 -42 64 44",Dx=64,Ox=44,Rx='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">I</text><polygon points="-15,-20 -30,-20 -24,-22 -24,-18 -30,-20 -24,-20" fill="black" stroke="black" stroke-width="1"/>',Lx=[{id:"t_top",x:-30,y:-40,orientation:"n"}],Bx={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_02.elmt",qetEnglishName:"Reverse current relay"},rN={id:Tx,name:Px,category:Ix,description:zx,viewBox:Mx,width:Dx,height:Ox,svg:Rx,terminals:Lx,source:Bx},aN=Object.freeze(Object.defineProperty({__proto__:null,category:Ix,default:rN,description:zx,height:Ox,id:Tx,name:Px,source:Bx,svg:Rx,terminals:Lx,viewBox:Mx,width:Dx},Symbol.toStringTag,{value:"Module"})),Hx="selector-switch",Fx="选择开关 (SA)",Wx="switching",qx="转换 / 选择开关 (旋转操作, 保位)。",Vx="-34 -42 36 64",Gx=36,Kx=64,Ux='<line x1="-32" y1="-10" x2="-2" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-32" y1="-15" x2="-32" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>',Xx=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Yx=[{name:"open",type:"boolean",default:!1,label:"断开"}],Zx={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_04.elmt",qetEnglishName:"Switch, manually operated, turning, stay-put"},iN={id:Hx,name:Fx,category:Wx,description:qx,viewBox:Vx,width:Gx,height:Kx,svg:Ux,terminals:Xx,state:Yx,source:Zx},sN=Object.freeze(Object.defineProperty({__proto__:null,category:Wx,default:iN,description:qx,height:Kx,id:Hx,name:Fx,source:Zx,state:Yx,svg:Ux,terminals:Xx,viewBox:Vx,width:Gx},Symbol.toStringTag,{value:"Module"})),Qx="series-reactor",Jx="串联电抗器",ew="compensation",tw="与并联电抗器同符号;通过用法区分。",nw="-62 -82 64 104",ow=64,rw=104,aw='<line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M -30 0 A 30 30 0 1 0 -60 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-60" y1="-30" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/>',iw=[{id:"t1",x:-30,y:-80,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],sw={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_08.elmt",qetEnglishName:"Choke; Reactor, general symbol"},lN={id:Qx,name:Jx,category:ew,description:tw,viewBox:nw,width:ow,height:rw,svg:aw,terminals:iw,source:sw},cN=Object.freeze(Object.defineProperty({__proto__:null,category:ew,default:lN,description:tw,height:rw,id:Qx,name:Jx,source:sw,svg:aw,terminals:iw,viewBox:nw,width:ow},Symbol.toStringTag,{value:"Module"})),lw="shunt-capacitor",cw="并联电容器",dw="compensation",uw="-7 -23 14 27",mw=14,pw=27,hw='<line x1="-5" y1="2" x2="5" y2="2" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-2" x2="5" y2="-2" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-2" fill="none" stroke="black" stroke-width="1"/>',fw=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t_bottom",x:0,y:2,orientation:"s"}],gw=[{name:"Q",label:"无功容量",type:"number",unit:"Mvar"},{name:"stages",label:"分组数",type:"number"}],bw={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/20_capacitors/capacite.elmt",qetEnglishName:"Capacitor"},dN={id:lw,name:cw,category:dw,viewBox:uw,width:mw,height:pw,svg:hw,terminals:fw,params:gw,source:bw},uN=Object.freeze(Object.defineProperty({__proto__:null,category:dw,default:dN,height:pw,id:lw,name:cw,params:gw,source:bw,svg:hw,terminals:fw,viewBox:uw,width:mw},Symbol.toStringTag,{value:"Module"})),yw="shunt-reactor",xw="并联电抗器",ww="compensation",vw="-62 -82 64 104",kw=64,Sw=104,_w='<line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M -30 0 A 30 30 0 1 0 -60 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-60" y1="-30" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/>',Cw=[{id:"t1",x:-30,y:-80,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],jw={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_08.elmt",qetEnglishName:"Choke; Reactor, general symbol"},mN={id:yw,name:xw,category:ww,viewBox:vw,width:kw,height:Sw,svg:_w,terminals:Cw,source:jw},pN=Object.freeze(Object.defineProperty({__proto__:null,category:ww,default:mN,height:Sw,id:yw,name:xw,source:jw,svg:_w,terminals:Cw,viewBox:vw,width:kw},Symbol.toStringTag,{value:"Module"})),$w="siren",Aw="警笛 (HA)",Ew="control",Nw="声响警笛 / 报警器。",Tw="-32 -42 44 54",Pw=44,Iw=54,zw='<line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="10,-10 -30,-10 -10,-40" fill="none" stroke="black" stroke-width="1"/>',Mw=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],Dw={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_09.elmt",qetEnglishName:"Siren"},hN={id:$w,name:Aw,category:Ew,description:Nw,viewBox:Tw,width:Pw,height:Iw,svg:zw,terminals:Mw,source:Dw},fN=Object.freeze(Object.defineProperty({__proto__:null,category:Ew,default:hN,description:Nw,height:Iw,id:$w,name:Aw,source:Dw,svg:zw,terminals:Mw,viewBox:Tw,width:Pw},Symbol.toStringTag,{value:"Module"})),Ow="socket-outlet",Rw="插座 / 连接器",Lw="load",Bw="电源插座 / 多极连接器。",Hw="-7 -2 13 34",Fw=13,Ww=34,qw='<line x1="-5" y1="13" x2="4" y2="20" fill="none" stroke="black" stroke-width="0.4"/><line x1="-1" y1="12" x2="-1" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="9" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="12" x2="1" y2="19" fill="none" stroke="black" stroke-width="1"/><path d="M 3 13 A 3 3 0 0 0 -3 13" fill="none" stroke="black" stroke-width="1"/>',Vw=[{id:"t1",x:0,y:0,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Gw=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],Kw={kind:"elmt",path:"11_singlepole/140_connectors_plugs/prise_multipolaire_2.elmt",qetEnglishName:`Plug and multipolar representation
227
+ unifilar`},gN={id:Ow,name:Rw,category:Lw,description:Bw,viewBox:Hw,width:Fw,height:Ww,svg:qw,terminals:Vw,params:Gw,source:Kw},bN=Object.freeze(Object.defineProperty({__proto__:null,category:Lw,default:gN,description:Bw,height:Ww,id:Ow,name:Rw,params:Gw,source:Kw,svg:qw,terminals:Vw,viewBox:Hw,width:Fw},Symbol.toStringTag,{value:"Module"})),Uw="soft-starter",Xw="软启动器",Yw="motor-control",Zw="电机软启动器 (晶闸管降压启动)。",Qw="-22 -42 44 84",Jw=44,ev=84,tv='<rect x="-20" y="-20" width="40" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-12" y1="-12" x2="12" y2="12" stroke="black" stroke-width="1" fill="none"/><polygon points="4,8 12,12 8,4" fill="none" stroke="black" stroke-width="1"/><text x="-12" y="-2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">SS</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',nv=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],ov={kind:"inline"},yN={id:Uw,name:Xw,category:Yw,description:Zw,viewBox:Qw,width:Jw,height:ev,svg:tv,terminals:nv,source:ov},xN=Object.freeze(Object.defineProperty({__proto__:null,category:Yw,default:yN,description:Zw,height:ev,id:Uw,name:Xw,source:ov,svg:tv,terminals:nv,viewBox:Qw,width:Jw},Symbol.toStringTag,{value:"Module"})),rv="sync-motor",av="同步电动机",iv="load",sv="-62 -82 64 114",lv=64,cv=114,dv='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-53" x2="-10" y2="-80" fill="none" stroke="black" stroke-width="1"/><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">1</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -40 10 A 5 5 0 0 0 -50 10" fill="none" stroke="black" stroke-width="1"/><path d="M -30 10 A 5 5 0 0 0 -40 10" fill="none" stroke="black" stroke-width="1"/><path d="M -20 10 A 5 5 0 0 0 -30 10" fill="none" stroke="black" stroke-width="1"/><path d="M -10 10 A 5 5 0 0 0 -20 10" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="10" x2="-50" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="10" x2="-10" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="15" x2="-20" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="20" x2="-32" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-27" y1="20" x2="-20" y2="20" fill="none" stroke="black" stroke-width="1"/>',uv=[{id:"t1",x:-10,y:-80,orientation:"n"},{id:"t2",x:-50,y:-80,orientation:"n"}],mv=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],pv={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_07/en_60617_06_07_02.elmt",qetEnglishName:"Synchronous motor, single-phase"},wN={id:rv,name:av,category:iv,viewBox:sv,width:lv,height:cv,svg:dv,terminals:uv,params:mv,source:pv},vN=Object.freeze(Object.defineProperty({__proto__:null,category:iv,default:wN,height:cv,id:rv,name:av,params:mv,source:pv,svg:dv,terminals:uv,viewBox:sv,width:lv},Symbol.toStringTag,{value:"Module"})),hv="synchronoscope",fv="同步表",gv="measurement",bv="同步指示器 / 同步表。",yv="-22 -42 44 44",xv=44,wv=44,vv='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-5" x2="0" y2="-35" fill="none" stroke="black" stroke-width="1"/><path d="M 12.374 -30.374 A 17.5 17.5 0 0 0 -12.374 -30.374" fill="none" stroke="black" stroke-width="1"/><polygon points="-13,-30 -11,-33 -10,-31" fill="none" stroke="black" stroke-width="1"/><polygon points="11,-33 13,-30 10,-31" fill="none" stroke="black" stroke-width="1"/>',kv=[{id:"t_top",x:0,y:-40,orientation:"n"}],Sv={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_08.elmt",qetEnglishName:"Synchronoscope"},kN={id:hv,name:fv,category:gv,description:bv,viewBox:yv,width:xv,height:wv,svg:vv,terminals:kv,source:Sv},SN=Object.freeze(Object.defineProperty({__proto__:null,category:gv,default:kN,description:bv,height:wv,id:hv,name:fv,source:Sv,svg:vv,terminals:kv,viewBox:yv,width:xv},Symbol.toStringTag,{value:"Module"})),_v="terminal",Cv="接线端子 / 节点 (X)",jv="busbar",$v="接线端子 / 接线盒 / 汇接节点。",Av="-5 -5 10 10",Ev=10,Nv=10,Tv='<ellipse cx="0" cy="0" rx="2.5" ry="2.5" fill="black" stroke="black" stroke-width="1"/>',Pv=[{id:"t_top",x:0,y:-2.5,orientation:"n"},{id:"t_bottom",x:0,y:2.5,orientation:"s"},{id:"t_left",x:-2.5,y:0,orientation:"w"},{id:"t_right",x:2.5,y:0,orientation:"e"}],Iv={kind:"elmt",path:"91_en_60617/en_60617_03/en_60617_03_02/en_60617_03_02_02.elmt",qetEnglishName:"Terminal"},_N={id:_v,name:Cv,category:jv,description:$v,viewBox:Av,width:Ev,height:Nv,svg:Tv,terminals:Pv,source:Iv},CN=Object.freeze(Object.defineProperty({__proto__:null,category:jv,default:_N,description:$v,height:Nv,id:_v,name:Cv,source:Iv,svg:Tv,terminals:Pv,viewBox:Av,width:Ev},Symbol.toStringTag,{value:"Module"})),zv="thermal-overload",Mv="热过载继电器",Dv="motor-control",Ov="电机热过载保护继电器, 通常串接在接触器和电机之间。",Rv="-9 -32 19 64",Lv=19,Bv=64,Hv='<line x1="0" y1="-30" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-7" y="-15" width="14" height="30" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,-10 -1,-5 -4,0 -1,5 -4,10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>',Fv=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Wv=[{name:"tripped",type:"boolean",default:!1,label:"动作"}],qv={kind:"inline"},jN={id:zv,name:Mv,category:Dv,description:Ov,viewBox:Rv,width:Lv,height:Bv,svg:Hv,terminals:Fv,state:Wv,source:qv},$N=Object.freeze(Object.defineProperty({__proto__:null,category:Dv,default:jN,description:Ov,height:Bv,id:zv,name:Mv,source:qv,state:Wv,svg:Hv,terminals:Fv,viewBox:Rv,width:Lv},Symbol.toStringTag,{value:"Module"})),Vv="thermocouple",Gv="热电偶 (BT)",Kv="measurement",Uv="热电偶温度传感器。",Xv="-26 -42 52 46",Yv=52,Zv=46,Qv='<ellipse cx="0" cy="0" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/><polyline points="-10,-40 -10,-15 0,0 10,-15 10,-40" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-16" x2="-16" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="16" y1="-16" x2="24" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-20" x2="20" y2="-12" fill="none" stroke="black" stroke-width="1"/>',Jv=[{id:"t1",x:10,y:-40,orientation:"n"},{id:"t2",x:-10,y:-40,orientation:"n"}],ek={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_06/en_60617_08_06_01.elmt",qetEnglishName:"Thermocouple"},AN={id:Vv,name:Gv,category:Kv,description:Uv,viewBox:Xv,width:Yv,height:Zv,svg:Qv,terminals:Jv,source:ek},EN=Object.freeze(Object.defineProperty({__proto__:null,category:Kv,default:AN,description:Uv,height:Zv,id:Vv,name:Gv,source:ek,svg:Qv,terminals:Jv,viewBox:Xv,width:Yv},Symbol.toStringTag,{value:"Module"})),tk="thyristor",nk="晶闸管 (V)",ok="passive",rk="反向阻断三极晶闸管 / SCR。t1=阳极(上), t2=阴极(下)。",ak="-22 -42 34 44",ik=34,sk=44,lk='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="10" y1="-20" x2="-10" y2="-20" fill="none" stroke="black" stroke-width="1"/><polyline points="-20,0 -7,0 -4,-10" fill="none" stroke="black" stroke-width="1"/>',ck=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],dk={x:6,y:-20,anchor:"start"},uk={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_04/en_60617_05_04_06.elmt",qetEnglishName:"Reverse blocking triode thyristor, P-gate (cathode-side controlled)"},NN={id:tk,name:nk,category:ok,description:rk,viewBox:ak,width:ik,height:sk,svg:lk,terminals:ck,label:dk,source:uk},TN=Object.freeze(Object.defineProperty({__proto__:null,category:ok,default:NN,description:rk,height:sk,id:tk,label:dk,name:nk,source:uk,svg:lk,terminals:ck,viewBox:ak,width:ik},Symbol.toStringTag,{value:"Module"})),mk="time-relay",pk="时间继电器 (KT)",hk="control",fk="延时 (缓动) 继电器线圈。",gk="-32 -22 54 44",bk=54,yk=44,xk='<rect x="-20" y="-10" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><rect x="-30" y="-10" width="10" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="10" x2="-20" y2="-10" fill="none" stroke="black" stroke-width="1"/>',wk=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],vk={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_15/en_60617_07_15_08.elmt",qetEnglishName:"Relay coil of a slow-operating relay"},PN={id:mk,name:pk,category:hk,description:fk,viewBox:gk,width:bk,height:yk,svg:xk,terminals:wk,source:vk},IN=Object.freeze(Object.defineProperty({__proto__:null,category:hk,default:PN,description:fk,height:yk,id:mk,name:pk,source:vk,svg:xk,terminals:wk,viewBox:gk,width:bk},Symbol.toStringTag,{value:"Module"})),kk="transfer-switch",Sk="切换开关 (ATS)",_k="switching",Ck="双源切换开关 (Automatic / Manual Transfer Switch)。两个电源输入 + 一个负荷输出, 互锁不并联。",jk="-27 -32 51 64",$k=51,Ak=64,Ek='<line x1="-15" y1="-30" x2="-15" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="15" y1="-30" x2="15" y2="-12" stroke="black" stroke-width="1" fill="none"/><text x="-25" y="-20" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">N</text><text x="19" y="-20" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">E</text><circle cx="-15" cy="-10" r="1.5" fill="black"/><circle cx="15" cy="-10" r="1.5" fill="black"/><circle cx="0" cy="6" r="1.5" fill="black"/><line x1="-15" y1="-10" x2="0" y2="6" stroke="black" stroke-width="1" fill="none"/><line x1="15" y1="-10" x2="0" y2="6" stroke="black" stroke-width="0.6" fill="none" stroke-dasharray="2 1.5"/><line x1="0" y1="6" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>',Nk=[{id:"t_normal",x:-15,y:-30,orientation:"n"},{id:"t_emergency",x:15,y:-30,orientation:"n"},{id:"t_load",x:0,y:30,orientation:"s"}],Tk=[{name:"position",type:"string",default:"normal",label:"位置 (normal/emergency/off)"}],Pk={kind:"inline"},zN={id:kk,name:Sk,category:_k,description:Ck,viewBox:jk,width:$k,height:Ak,svg:Ek,terminals:Nk,state:Tk,source:Pk},MN=Object.freeze(Object.defineProperty({__proto__:null,category:_k,default:zN,description:Ck,height:Ak,id:kk,name:Sk,source:Pk,state:Tk,svg:Ek,terminals:Nk,viewBox:jk,width:$k},Symbol.toStringTag,{value:"Module"})),Ik="transformer-2w",zk="双绕组变压器",Mk="transformer",Dk="-62 -142 64 144",Ok=64,Rk=144,Lk='<ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-140" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/>',Bk=[{id:"t1",x:-30,y:-140,orientation:"n"},{id:"t2",x:-30,y:0,orientation:"s"}],Hk=[{name:"S",label:"容量",type:"number",unit:"MVA",showOnCanvas:!0},{name:"ratio",label:"变比",type:"string",showOnCanvas:!0}],Fk={x:4,y:-68,anchor:"start"},Wk={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_01.elmt",qetEnglishName:"Transformer with two windings, general symbol"},DN={id:Ik,name:zk,category:Mk,viewBox:Dk,width:Ok,height:Rk,svg:Lk,terminals:Bk,params:Hk,label:Fk,source:Wk},ON=Object.freeze(Object.defineProperty({__proto__:null,category:Mk,default:DN,height:Rk,id:Ik,label:Fk,name:zk,params:Hk,source:Wk,svg:Lk,terminals:Bk,viewBox:Dk,width:Ok},Symbol.toStringTag,{value:"Module"})),qk="transformer-3w",Vk="三绕组变压器",Gk="transformer",Kk="-82 -131 114 133",Uk=114,Xk=133,Yk='<ellipse cx="-30" cy="-80" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-31" y1="-129" x2="-31" y2="-109" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-50" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-20" x2="-50" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>',Zk=[{id:"t1",x:-31,y:-129,orientation:"n"},{id:"t_low_left",x:-50,y:0,orientation:"s"},{id:"t_low_right",x:0,y:0,orientation:"s"}],Qk={x:4,y:-64,anchor:"start"},Jk={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_04.elmt",qetEnglishName:"Transformer with three windings, general symbol"},RN={id:qk,name:Vk,category:Gk,viewBox:Kk,width:Uk,height:Xk,svg:Yk,terminals:Zk,label:Qk,source:Jk},LN=Object.freeze(Object.defineProperty({__proto__:null,category:Gk,default:RN,height:Xk,id:qk,label:Qk,name:Vk,source:Jk,svg:Yk,terminals:Zk,viewBox:Kk,width:Uk},Symbol.toStringTag,{value:"Module"})),e2="triac",t2="双向晶闸管 (V)",n2="passive",o2="双向三极晶闸管 (TRIAC)。",r2="-22 -42 44 44",a2=44,i2=44,s2='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-20,-30 0,-30 -10,-10" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-30" x2="-10" y2="-30" fill="none" stroke="black" stroke-width="1"/><polygon points="0,-10 10,-30 20,-10" fill="none" stroke="black" stroke-width="1"/><polyline points="20,0 18,0 14,-10" fill="none" stroke="black" stroke-width="1"/>',l2=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],c2={x:6,y:-20,anchor:"start"},d2={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_04/en_60617_05_04_11.elmt",qetEnglishName:"Bidirectional triode thyristor; Triac"},BN={id:e2,name:t2,category:n2,description:o2,viewBox:r2,width:a2,height:i2,svg:s2,terminals:l2,label:c2,source:d2},HN=Object.freeze(Object.defineProperty({__proto__:null,category:n2,default:BN,description:o2,height:i2,id:e2,label:c2,name:t2,source:d2,svg:s2,terminals:l2,viewBox:r2,width:a2},Symbol.toStringTag,{value:"Module"})),u2="undervoltage-relay",m2="欠压继电器 (27)",p2="protection",h2="欠电压保护继电器 (ANSI 27)。",f2="-62 -82 64 84",g2=64,b2=84,y2='<rect x="-60" y="-80" width="60" height="80" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-49" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">130 %</text><text x="-55" y="-32.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">50...80 V</text><text x="-41" y="-53.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">U &lt;</text>',x2=[{id:"t_top",x:-30,y:-80,orientation:"n"}],w2={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_07.elmt",qetEnglishName:"Undervoltage relay"},FN={id:u2,name:m2,category:p2,description:h2,viewBox:f2,width:g2,height:b2,svg:y2,terminals:x2,source:w2},WN=Object.freeze(Object.defineProperty({__proto__:null,category:p2,default:FN,description:h2,height:b2,id:u2,name:m2,source:w2,svg:y2,terminals:x2,viewBox:f2,width:g2},Symbol.toStringTag,{value:"Module"})),v2="ups",k2="不间断电源 (UPS)",S2="source",_2="在线 / 后备式不间断电源。",C2="-26 -42 52 84",j2=52,$2=84,A2='<rect x="-24" y="-20" width="48" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">UPS</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',E2=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],N2=[{name:"S",label:"容量",type:"number",unit:"kVA"}],T2={kind:"inline"},qN={id:v2,name:k2,category:S2,description:_2,viewBox:C2,width:j2,height:$2,svg:A2,terminals:E2,params:N2,source:T2},VN=Object.freeze(Object.defineProperty({__proto__:null,category:S2,default:qN,description:_2,height:$2,id:v2,name:k2,params:N2,source:T2,svg:A2,terminals:E2,viewBox:C2,width:j2},Symbol.toStringTag,{value:"Module"})),P2="varmeter",I2="无功功率表 (var)",z2="measurement",M2="无功功率表 (var)。",D2="-22 -42 44 44",O2=44,R2=44,L2='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">var</text>',B2=[{id:"t_top",x:0,y:-40,orientation:"n"}],H2={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_04.elmt",qetEnglishName:"Varmeter"},GN={id:P2,name:I2,category:z2,description:M2,viewBox:D2,width:O2,height:R2,svg:L2,terminals:B2,source:H2},KN=Object.freeze(Object.defineProperty({__proto__:null,category:z2,default:GN,description:M2,height:R2,id:P2,name:I2,source:H2,svg:L2,terminals:B2,viewBox:D2,width:O2},Symbol.toStringTag,{value:"Module"})),F2="vfd",W2="变频器 (VFD)",q2="motor-control",V2="Variable Frequency Drive — 异步电动机调速。",G2="-24 -42 48 84",K2=48,U2=84,X2='<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="6" y="14" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~f</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Y2=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],Z2={kind:"inline"},UN={id:F2,name:W2,category:q2,description:V2,viewBox:G2,width:K2,height:U2,svg:X2,terminals:Y2,source:Z2},XN=Object.freeze(Object.defineProperty({__proto__:null,category:q2,default:UN,description:V2,height:U2,id:F2,name:W2,source:Z2,svg:X2,terminals:Y2,viewBox:G2,width:K2},Symbol.toStringTag,{value:"Module"})),Q2="voltage-regulator",J2="调压器 (T)",eS="transformer",tS="可调感应调压器 / 自耦调压器。",nS="-17 -32 38 64",oS=38,rS=64,aS='<line x1="-5" y1="21" x2="5" y2="17" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-16.05" x2="4.95" y2="-20.05" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-5" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="0" rx="15" ry="15" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-20.05" x2="4.95" y2="-24.05" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="23" x2="5" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-18.05" x2="4.95" y2="-22.05" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="25" x2="5" y2="21" fill="none" stroke="black" stroke-width="1"/><line x1="-15" y1="15" x2="15" y2="-15" fill="none" stroke="black" stroke-width="1"/><polygon points="13,-16 16,-13 19,-19" fill="black" stroke="black" stroke-width="0.4"/>',iS=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],sS=[{name:"ratio",label:"调压范围",type:"string",showOnCanvas:!0}],lS={kind:"elmt",path:"11_singlepole/340_converters_inverters/10_converters/regulator_ind_3f_1.elmt",qetEnglishName:"Voltage regulator"},YN={id:Q2,name:J2,category:eS,description:tS,viewBox:nS,width:oS,height:rS,svg:aS,terminals:iS,params:sS,source:lS},ZN=Object.freeze(Object.defineProperty({__proto__:null,category:eS,default:YN,description:tS,height:rS,id:Q2,name:J2,params:sS,source:lS,svg:aS,terminals:iS,viewBox:nS,width:oS},Symbol.toStringTag,{value:"Module"})),cS="voltmeter",dS="电压表 (V)",uS="measurement",mS="-22 -42 44 44",pS=44,hS=44,fS='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-4" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">V</text>',gS=[{id:"t_top",x:0,y:-40,orientation:"n"}],bS={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_01.elmt",qetEnglishName:"Voltmeter"},QN={id:cS,name:dS,category:uS,viewBox:mS,width:pS,height:hS,svg:fS,terminals:gS,source:bS},JN=Object.freeze(Object.defineProperty({__proto__:null,category:uS,default:QN,height:hS,id:cS,name:dS,source:bS,svg:fS,terminals:gS,viewBox:mS,width:pS},Symbol.toStringTag,{value:"Module"})),yS="wattmeter",xS="功率表 (W)",wS="measurement",vS="-22 -42 44 44",kS=44,SS=44,_S='<rect x="-20" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-6" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">W</text>',CS=[{id:"t_top",x:0,y:-40,orientation:"n"}],jS={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_03/en_60617_08_03_01.elmt",qetEnglishName:"Recording wattmeter"},e6={id:yS,name:xS,category:wS,viewBox:vS,width:kS,height:SS,svg:_S,terminals:CS,source:jS},t6=Object.freeze(Object.defineProperty({__proto__:null,category:wS,default:e6,height:SS,id:yS,name:xS,source:jS,svg:_S,terminals:CS,viewBox:vS,width:kS},Symbol.toStringTag,{value:"Module"})),$S="wind-turbine",AS="风力发电机",ES="renewable",NS="风机:发电机 + 三叶轮标记",TS="-22 -46 44 68",PS=44,IS=68,zS='<circle cx="0" cy="0" r="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="16">G</text><line x1="0" y1="-20" x2="0" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-32" x2="-10" y2="-39" fill="none" stroke="black" stroke-width="1.5"/><line x1="0" y1="-32" x2="10" y2="-39" fill="none" stroke="black" stroke-width="1.5"/><line x1="0" y1="-32" x2="0" y2="-44" fill="none" stroke="black" stroke-width="1.5"/>',MS=[{id:"t_bottom",x:0,y:20,orientation:"s"}],DS={kind:"inline"},n6={id:$S,name:AS,category:ES,description:NS,viewBox:TS,width:PS,height:IS,svg:zS,terminals:MS,source:DS},o6=Object.freeze(Object.defineProperty({__proto__:null,category:ES,default:n6,description:NS,height:IS,id:$S,name:AS,source:DS,svg:zS,terminals:MS,viewBox:TS,width:PS},Symbol.toStringTag,{value:"Module"})),OS="zener-diode",RS="稳压二极管 (D)",LS="passive",BS="齐纳 / 稳压二极管。t1=阳极(上), t2=阴极(下)。",HS="-12 -42 24 44",FS=24,WS=44,qS='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-15" x2="-10" y2="-10" fill="none" stroke="black" stroke-width="1"/>',VS=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],GS={x:6,y:-20,anchor:"start"},KS={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_06.elmt",qetEnglishName:"Breakdown diode, unidirectional; Zener diode"},r6={id:OS,name:RS,category:LS,description:BS,viewBox:HS,width:FS,height:WS,svg:qS,terminals:VS,label:GS,source:KS},a6=Object.freeze(Object.defineProperty({__proto__:null,category:LS,default:r6,description:BS,height:WS,id:OS,label:GS,name:RS,source:KS,svg:qS,terminals:VS,viewBox:HS,width:FS},Symbol.toStringTag,{value:"Module"})),i6=Object.assign({"./ammeter.json":S$,"./arc-suppression-coil.json":C$,"./arrester.json":$$,"./async-motor.json":E$,"./autotransformer.json":T$,"./battery.json":I$,"./bell.json":M$,"./break-contact.json":O$,"./breaker.json":L$,"./buchholz-relay.json":H$,"./busbar.json":W$,"./busduct-tap.json":V$,"./busduct.json":K$,"./buzzer.json":X$,"./capacitor.json":Z$,"./contactor.json":J$,"./continuation-in.json":tA,"./continuation-out.json":oA,"./converter-bidir.json":aA,"./ct.json":sA,"./dc-combiner.json":cA,"./dc-dc-converter.json":uA,"./dc-disconnector.json":pA,"./dc-motor.json":fA,"./diode.json":bA,"./disconnector.json":xA,"./distance-relay.json":vA,"./earth.json":SA,"./earthing-switch.json":CA,"./energy-meter.json":$A,"./ev-charger.json":EA,"./frequency-meter.json":TA,"./fuse-switch-disconnector.json":IA,"./fuse.json":MA,"./generator.json":OA,"./genset.json":LA,"./gfci-breaker.json":HA,"./grid-source.json":WA,"./grounding-transformer.json":VA,"./heater.json":KA,"./igbt.json":XA,"./indicator-light.json":ZA,"./inductor.json":JA,"./inverter.json":tE,"./limit-switch.json":oE,"./load-switch.json":aE,"./load.json":sE,"./luminaire.json":cE,"./make-contact.json":uE,"./motor-starter.json":pE,"./mppt.json":fE,"./ngr.json":bE,"./off-delay-break-contact.json":xE,"./off-delay-make-contact.json":vE,"./on-delay-break-contact.json":SE,"./on-delay-make-contact.json":CE,"./overcurrent-relay.json":$E,"./panelboard.json":EE,"./phase-failure-relay.json":TE,"./plc.json":IE,"./power-factor-meter.json":ME,"./power-supply.json":OE,"./protective-relay.json":LE,"./proximity-switch.json":HE,"./pt.json":WE,"./push-button.json":VE,"./pv.json":KE,"./rcd.json":XE,"./recloser.json":ZE,"./rectifier.json":JE,"./relay-coil.json":tN,"./resistor.json":oN,"./reverse-power-relay.json":aN,"./selector-switch.json":sN,"./series-reactor.json":cN,"./shunt-capacitor.json":uN,"./shunt-reactor.json":pN,"./siren.json":fN,"./socket-outlet.json":bN,"./soft-starter.json":xN,"./sync-motor.json":vN,"./synchronoscope.json":SN,"./terminal.json":CN,"./thermal-overload.json":$N,"./thermocouple.json":EN,"./thyristor.json":TN,"./time-relay.json":IN,"./transfer-switch.json":MN,"./transformer-2w.json":ON,"./transformer-3w.json":LN,"./triac.json":HN,"./undervoltage-relay.json":WN,"./ups.json":VN,"./varmeter.json":KN,"./vfd.json":XN,"./voltage-regulator.json":ZN,"./voltmeter.json":JN,"./wattmeter.json":t6,"./wind-turbine.json":o6,"./zener-diode.json":a6}),US=Object.values(i6).map(e=>e.default),wt=Object.fromEntries(US.map(e=>[e.id,e])),ba=["busbar","switching","protection","motor-control","control","transformer","instrument-transformer","measurement","source","load","storage","compensation","passive","grounding","renewable"];(()=>{var t;const e={};for(const n of US)(e[t=n.category]??(e[t]=[])).push(n);return e})();const so=new Map(Object.entries(wt));function s6(e){return wt[e]}const XS="custom:";function yo(e){return e.startsWith(XS)}function YS(e){if(!(e!=null&&e.length))return so;const t=new Map(so);for(const n of e)!(n!=null&&n.id)||!yo(n.id)||t.set(n.id,n);return t}function l6(e,t){var o;if(!t||t==="iec")return e;let n=null;for(const[r,a]of e){const i=(o=a.variants)==null?void 0:o[t];i&&(n??(n=new Map(e)),n.set(r,{...a,viewBox:i.viewBox,width:i.width,height:i.height,svg:i.svg,terminalLabelsSvg:i.terminalLabelsSvg??a.terminalLabelsSvg,label:i.label??a.label}))}return n??e}function ZS(){return{elements:new Map,buses:new Map,junctions:new Map,terminals:new Map,nodes:new Map,layout:new Map,wireRenders:new Map,terminalToNode:new Map,elementToTerminals:new Map,diagnostics:[],library:so}}function QS(e){return{at:(e==null?void 0:e.at)??[0,0],rot:(e==null?void 0:e.rot)??0,mirror:(e==null?void 0:e.mirror)??!1,...(e==null?void 0:e.scale)!==void 0&&ar(e.scale)!==1?{scale:ar(e.scale)}:{}}}function ir(e){return e===90||e===270?"y":"x"}function Ze(e,t){const n=t.scale??1;let o=e[0]*n,r=e[1]*n;switch(t.mirror&&(o=-o),t.rot){case 0:break;case 90:[o,r]=[-r,o];break;case 180:[o,r]=[-o,-r];break;case 270:[o,r]=[r,-o];break}return[o+t.at[0],r+t.at[1]]}const c6={n:"e",e:"s",s:"w",w:"n"},d6={n:"n",s:"s",e:"w",w:"e"};function yn(e,t){let n=t.mirror?d6[e]:e;const o=t.rot/90|0;for(let r=0;r<o;r++)n=c6[n];return n}function sr(e){switch(e){case"n":return[0,-1];case"s":return[0,1];case"e":return[1,0];case"w":return[-1,0]}}class JS{constructor(){lt(this,"parent",new Map);lt(this,"rank",new Map)}add(t){this.parent.has(t)||(this.parent.set(t,t),this.rank.set(t,0))}find(t){this.add(t);let n=t;for(;this.parent.get(n)!==n;){const o=this.parent.get(n),r=this.parent.get(o);this.parent.set(n,r),n=r}return n}union(t,n){const o=this.find(t),r=this.find(n);if(o===r)return;const a=this.rank.get(o),i=this.rank.get(r);a<i?this.parent.set(o,r):a>i?this.parent.set(r,o):(this.parent.set(r,o),this.rank.set(o,a+1))}groups(){const t=new Map;for(const n of this.parent.keys()){const o=this.find(n),r=t.get(o);r?r.push(n):t.set(o,[n])}return t}}const ya=["n","e","s","w"],xa={n:"s",s:"n",e:"w",w:"e"};function Ln(e,t){const n=ya.indexOf(e),r=((ya.indexOf(t)-n)%4+4)%4;return[0,90,180,270][r]}const Ro=320,Bn=220,dn=260,Lo=720,un=30,wa=30,jt=80,va=10,u6=60,m6=520,p6=80,h6=80,ka=8,Sa=new Set(["source","renewable"]);function f6(e){var ta,na,oa,ra,aa,ia;const{elements:t,buses:n,junctions:o,wires:r,library:a,userLayout:i,userBusLayout:l}=e,s=new Map(i),d=new Map(l),u=new Map,m=new Set(i.keys()),p=new Set(l.keys()),g=new Map;for(const v of t)g.set(v.id,v);const h=new Map;for(const v of n)h.set(v.id,v);const f=v=>{const S=g.get(v);if(S)return a.get(S.kind)},b=new Set(n.map(v=>v.id)),y=v=>b.has(v),w=new Set(o.map(v=>v.id)),j=new Set(o.filter(v=>{var S;return(S=v.layout)==null?void 0:S.at}).map(v=>v.id)),_=new JS;for(const v of r)_.add(v.ends[0]),_.add(v.ends[1]),_.union(v.ends[0],v.ends[1]);for(const v of t){const S=a.get(v.kind);if(S)for(const A of S.terminals)_.add(`${v.id}.${A.id}`)}for(const v of n)_.add(v.id);const E=[];for(const[,v]of _.groups())v.length>=2&&E.push(v);const W=new Map;for(const v of E)for(const S of v)W.set(S,[v]);const Q=new Map;for(const v of E){const S=v.filter(y);if(S.length!==0)for(const A of S){const T=v.filter(C=>C!==A),N=Q.get(A)??[];N.push(...T),Q.set(A,N)}}{const A=z=>g.has(z)&&!!f(z),T=z=>{if(y(z))return null;if(w.has(z))return z;const P=z.indexOf(".");return P>0?z.slice(0,P):null},N=new Map,C=new Set,I=(z,P)=>{N.has(z)||N.set(z,new Set),N.has(P)||N.set(P,new Set),z!==P&&(N.get(z).add(P),N.get(P).add(z))};for(const z of E){const P=[];let B=!1;for(const K of z){if(y(K)){B=!0;continue}const ce=T(K);ce&&P.push(ce)}const H=[...new Set(P)];for(const K of H)N.has(K)||N.set(K,new Set),B&&C.add(K);const V=H.filter(K=>w.has(K)),Z=H.filter(K=>!w.has(K));if(V.length>0){for(const K of V)for(const ce of Z)I(K,ce);for(let K=0;K<V.length;K++)for(let ce=K+1;ce<V.length;ce++)I(V[K],V[ce])}else for(let K=0;K<Z.length;K++)for(let ce=K+1;ce<Z.length;ce++)I(Z[K],Z[ce])}const F=(z,P)=>{const B=f(z);if(!B)return null;for(const H of B.terminals){const V=`${z}.${H.id}`;for(const Z of W.get(V)??[])for(const K of Z)if(T(K)===P)return H}return null},R=z=>{const P=oe=>{var ue;return((ue=N.get(oe))==null?void 0:ue.size)??0},B=oe=>{var ue;return((ue=f(oe))==null?void 0:ue.category)??""},H=oe=>{const ue=B(oe);return ue==="source"?0:ue==="renewable"?1:2+Math.min(P(oe),9)/10},V=z.filter(A).sort((oe,ue)=>H(oe)-H(ue)||oe.localeCompare(ue))[0];if(!V)return;const Z=new Map([[V,null]]),K=new Map([[V,0]]),ce=new Map,de=[],J=[V],ne=new Set([V]);for(;J.length;){const oe=J.shift();de.push(oe);for(const ue of[...N.get(oe)??[]].sort((Ge,Ke)=>Ge.localeCompare(Ke)))ne.has(ue)||(ne.add(ue),Z.set(ue,oe),K.set(ue,(K.get(oe)??0)+1),ce.has(oe)||ce.set(oe,[]),ce.get(oe).push(ue),J.push(ue))}let ae=0;const $e=new Map,Le=oe=>{const ue=ce.get(oe)??[];if(ue.length===0){$e.set(oe,ae++);return}for(const Ke of ue)Le(Ke);const Ge=ue.map(Ke=>$e.get(Ke));$e.set(oe,Ge.reduce((Ke,On)=>Ke+On,0)/Ge.length)};Le(V);for(const oe of de){const ue=Me(Ro+($e.get(oe)??0)*160),Ge=Me(Bn+(K.get(oe)??0)*140);if(w.has(oe)){u.set(oe,[ue,Ge]);continue}let Ke=0;const On=Z.get(oe)??null;if(On){const sn=F(oe,On);sn&&(Ke=Ln(sn.orientation,"n"))}else{const sn=(ce.get(oe)??[])[0],sa=sn?F(oe,sn):null;sa&&(Ke=Ln(sa.orientation,"s"))}s.set(oe,{at:[ue,Ge],rot:Ke,mirror:!1}),m.add(oe)}},L=new Set;for(const z of N.keys()){if(L.has(z))continue;const P=[],B=[z];for(L.add(z);B.length;){const H=B.pop();P.push(H);for(const V of N.get(H)??[])L.has(V)||(L.add(V),B.push(V))}P.length<2||P.some(H=>C.has(H))||P.some(H=>s.has(H)||j.has(H))||P.some(A)&&R(P)}}const ke=new Map;for(const v of E){const S=v.filter(y);if(S.length!==0)for(const A of v){if(y(A))continue;const T=A.indexOf(".");if(T<0)continue;const N=A.slice(0,T),C=A.slice(T+1),I=ke.get(N)??[];for(const F of S)I.some(R=>R.busId===F&&R.pin===C)||I.push({busId:F,pin:C});ke.set(N,I)}}const we=[],Y=new Set;for(const[v,S]of ke)if(new Set(S.map(T=>T.busId)).size>=2){const T=((na=a.get(((ta=g.get(v))==null?void 0:ta.kind)??""))==null?void 0:na.category)==="transformer"?"vertical":"horizontal";we.push({elementId:v,attachments:S,orientation:T}),T==="vertical"&&Y.add(v)}const k=new Map,D=(v,S)=>{v!==S&&(k.has(v)||k.set(v,new Set),k.has(S)||k.set(S,new Set),k.get(v).add(S),k.get(S).add(v))};for(const v of r)D(v.ends[0],v.ends[1]);for(const v of t){const S=a.get(v.kind);if(!S||S.terminals.length<2)continue;const A=S.terminals.map(T=>`${v.id}.${T.id}`);for(let T=0;T<A.length;T++)for(let N=T+1;N<A.length;N++)D(A[T],A[N])}for(const v of t){if(Y.has(v.id))continue;const S=a.get(v.kind);if(!S||S.category!=="transformer"||S.terminals.length<2)continue;const A=S.terminals.map(C=>`${v.id}.${C.id}`),T=new Map;for(const C of A){const I=C.slice(v.id.length+1);T.set(I,new Set);const F=new Set(A.filter(z=>z!==C)),R=new Set([C]),L=[C];for(;L.length>0;){const z=L.shift();if(y(z)){T.get(I).add(z);continue}const P=k.get(z);if(P)for(const B of P)R.has(B)||F.has(B)||(R.add(B),L.push(B))}}const N=new Set;for(const C of T.values())for(const I of C)N.add(I);if(N.size>=2){const C=[];for(const[I,F]of T)for(const R of F)C.push({busId:R,pin:I});we.push({elementId:v.id,attachments:C,orientation:"vertical"}),Y.add(v.id)}}const M=(v,S)=>{var F;const A=f(S),T=A?A.terminals.map(R=>`${S}.${R.id}`):[],N=v,C=new Set([N,...T]),I=[N];for(;I.length>0;){const R=I.shift(),L=R.indexOf(".");if(L>0){const P=R.slice(0,L),B=g.get(P);if(B){const H=(F=a.get(B.kind))==null?void 0:F.category;if(H&&Sa.has(H))return!0}}const z=k.get(R);if(z)for(const P of z)C.has(P)||(C.add(P),I.push(P))}return!1};for(const v of we){if(v.orientation!=="horizontal")continue;const S=new Set(v.attachments.map(T=>T.busId));let A=0;for(const T of S)M(T,v.elementId)&&A++;A===1&&(v.orientation="vertical",Y.add(v.elementId))}for(const v of t){if(Y.has(v.id)||v.kind!=="breaker")continue;const S=a.get(v.kind);if(!S||S.terminals.length!==2)continue;const A=S.terminals.map(C=>`${v.id}.${C.id}`),T=new Map;for(const C of A){const I=C.slice(v.id.length+1),F=new Set(A.filter(z=>z!==C)),R=new Set([C]),L=[C];for(;L.length>0;){const z=L.shift();if(y(z)){T.set(I,z);break}const P=k.get(z);if(P)for(const B of P){if(R.has(B)||F.has(B))continue;const H=B.indexOf(".");if(H>0){const V=B.slice(0,H);if(V!==v.id){const Z=g.get(V),K=Z?a.get(Z.kind):void 0;if((K==null?void 0:K.category)==="transformer")continue}}R.add(B),L.push(B)}}}if(new Set(T.values()).size>=2){const C=[];for(const[I,F]of T)C.push({busId:F,pin:I});we.push({elementId:v.id,attachments:C,orientation:"horizontal"})}}const G=new Map;for(const v of n)G.set(v.id,new Map);for(const v of we){const S=Array.from(new Set(v.attachments.map(A=>A.busId)));for(const A of S)for(const T of S)A!==T&&((oa=G.get(A))==null||oa.set(T,v))}const me=v=>{var A;const S=(A=a.get(v))==null?void 0:A.category;return S?Sa.has(S):!1},pe=[];for(const v of n){const S=Q.get(v.id);if(S)for(const A of S){if(y(A))continue;const T=A.indexOf(".");if(T<0)continue;const N=A.slice(0,T),C=g.get(N);if(C&&me(C.kind)){pe.push(v.id);break}}}pe.length===0&&n.length>0&&pe.push(n[0].id);const te=new Map;for(const v of pe)te.set(v,0);{const v=[...pe];for(;v.length>0;){const S=v.shift(),A=te.get(S),T=G.get(S);if(T)for(const[N,C]of T){if(te.has(N))continue;const I=C.orientation==="horizontal"?A:A+1;te.set(N,I),v.push(N)}}}for(const v of n){if(te.has(v.id))continue;const S=te.size===0?-1:Math.max(...Array.from(te.values()));te.set(v.id,S+1)}const Se=new Map;for(const v of n){const S=te.get(v.id),A=Se.get(S)??[];A.push(v.id),Se.set(S,A)}const ie=[...Se.keys()].sort((v,S)=>v-S),_e=(v,S,A)=>{const T=`${v.elementId}.${A}`,N=S,C=f(v.elementId),I=new Set;if(C)for(const P of C.terminals)P.id!==A&&I.add(`${v.elementId}.${P.id}`);const F=new Set([T]),R=[{ref:T,dist:0}],L=new Map,z=(P,B,H,V)=>{F.add(P),L.set(P,B),R.push({ref:P,dist:V+H})};for(;R.length>0;){const{ref:P,dist:B}=R.shift();if(P===N){const K=L.get(N);let ce;if(K){const de=K.indexOf(".");if(de>0){const J=K.slice(0,de);J!==v.elementId&&(ce=J)}}return{extent:B,head:ce}}const H=P.indexOf(".");if(H<0)continue;const V=P.slice(0,H),Z=P.slice(H+1);if(!y(V)&&!Y.has(V)){const K=f(V),ce=K==null?void 0:K.terminals.find(de=>de.id===Z);if(K&&ce)for(const de of K.terminals){if(de.id===Z)continue;const J=`${V}.${de.id}`;F.has(J)||I.has(J)||z(J,P,Math.abs(ce.y-de.y),B)}}for(const K of W.get(P)??[])for(const ce of K){if(ce===P||F.has(ce)||I.has(ce))continue;const de=y(P)||y(ce);z(ce,P,de?wa:un,B)}}return{extent:0}},Ie=(v,S)=>{var P,B,H;const A=(P=G.get(v))==null?void 0:P.get(S);if(!A||A.orientation==="horizontal")return dn;const T=f(A.elementId);if(!T)return dn;const N=(B=A.attachments.find(V=>V.busId===v))==null?void 0:B.pin,C=(H=A.attachments.find(V=>V.busId===S))==null?void 0:H.pin;if(!N||!C)return dn;const I=T.terminals.find(V=>V.id===N),F=T.terminals.find(V=>V.id===C);if(!I||!F)return dn;const R=Math.abs(F.y-I.y),L=_e(A,v,N).extent,z=_e(A,S,C).extent;return L+R+z},Oe=new Map;for(const v of we){if(v.orientation!=="vertical")continue;const S=v.attachments.slice().sort((F,R)=>(te.get(F.busId)??0)-(te.get(R.busId)??0));if(S.length<2)continue;const A=S[0].busId,T=S[1].busId,N=S[0].pin,I=_e(v,A,N).head??v.elementId;Oe.set(I,{lowerBusId:T})}const O=30,q=v=>{const S=f(v);return Math.max((S==null?void 0:S.width)??jt,jt)},X=2,ee=(v,S,A,T=0)=>{const N=f(S);let C=q(S);if(N&&!A.has(S)&&T<X){A.add(S);let I=0;for(const F of N.terminals){const R=`${S}.${F.id}`;if(R!==v)for(const L of W.get(R)??[]){const z=new Set;let P=!1;for(const H of L){if(H===R)continue;if(y(H)){P=!0;continue}const V=H.indexOf(".");if(V<0)continue;const Z=H.slice(0,V);Z===S||A.has(Z)||Y.has(Z)||z.add(Z)}if(P||z.size===0)continue;let B=0;for(const H of z){const V=[...L].find(Z=>Z.indexOf(".")>0&&Z.slice(0,Z.indexOf("."))===H);B+=(V?ee(V,H,A,T+1):q(H))+O}I=Math.max(I,B-O)}}A.delete(S),C=Math.max(C,I)}return C},be=320,U=new Map,he=(v,S)=>{if(!Y.has(v))return!1;const A=we.find(I=>I.elementId===v),T=A==null?void 0:A.attachments.find(I=>I.busId!==S);if(!T)return!1;const N=te.get(S)??0;return(te.get(T.busId)??0)<N},se=(v,S,A)=>{const T=Oe.get(v);if(T){const C=U.get(T.lowerBusId);if(C!==void 0)return Math.max(S,C+jt)}let N=0;return A&&(N=ee(A,v,new Set)),Math.max(S,jt,N)},le=(v,S)=>{if(U.has(v))return U.get(v);if(S.has(v))return be;S.add(v);const A=Q.get(v)??[];let T=0,N=0;for(const I of A){if(y(I))continue;const F=I.indexOf(".");if(F<0)continue;const R=I.slice(0,F),L=I.slice(F+1);if(he(R,v))continue;const z=f(R);if(!z)continue;const P=z.terminals.find(V=>V.id===L);if(!P)continue;const B=Oe.get(R);B&&le(B.lowerBusId,S);const H=se(R,z.width,`${R}.${L}`);P.y>0?T+=H:N+=H}const C=Math.max(be,Math.max(T,N)+jt);return U.set(v,C),S.delete(v),C};for(const v of n)le(v.id,new Set);const je=new Map,ze=(v,S,A)=>{const T=f(S);if(!T)return;const N=`${S}.${A}`,C=T.terminals.filter(R=>R.id!==A).map(R=>`${S}.${R.id}`);if(C.length===0)return;const I=new Set([N,...C]),F=C.slice();for(;F.length>0;){const R=F.shift();if(y(R)&&R!==v){const z=d.get(R);return z?z.at[0]:void 0}for(const z of W.get(R)??[])for(const P of z)P===R||I.has(P)||(I.add(P),F.push(P));const L=R.indexOf(".");if(L>0){const z=R.slice(0,L);if(!y(z)){const P=f(z);if(P)for(const B of P.terminals){const H=`${z}.${B.id}`;I.has(H)||(I.add(H),F.push(H))}}}}},Ae=v=>{const S=Q.get(v);if(!S||S.length===0)return;const A=d.get(v);if(!A)return;const T=S.flatMap(P=>{if(y(P))return[];const B=P.indexOf(".");if(B<0)return[];const H=P.slice(0,B),V=P.slice(B+1);if(s.has(H))return[];if(he(H,v))return[];const Z=f(H);if(!Z)return[];const K=Z.terminals.find(ce=>ce.id===V);return K?[{elId:H,lib:Z,localTerm:K,isLinker:Y.has(H),busFacingRef:`${H}.${V}`}]:[]});if(T.length===0)return;const N=[],C=[];for(const P of T)P.localTerm.y>0?N.push(P):C.push(P);const I=P=>P.reduce((B,H)=>B+se(H.elId,H.lib.width,H.busFacingRef),0),F=Math.max(I(N),I(C))+jt,R=Math.max(A.span,F);R!==A.span&&!p.has(v)&&d.set(v,{...A,span:R});const L=d.get(v),z=(P,B)=>{if(P.length===0)return;const H=new Map;for(const ne of P){const ae=ze(v,ne.elId,ne.localTerm.id);ae!==void 0&&H.set(ne.elId,ae)}P.sort((ne,ae)=>{const $e=H.get(ne.elId)??L.at[0],Le=H.get(ae.elId)??L.at[0];if($e!==Le)return $e-Le;const oe=se(ne.elId,ne.lib.width,ne.busFacingRef);return se(ae.elId,ae.lib.width,ae.busFacingRef)-oe});const V=P.map(ne=>se(ne.elId,ne.lib.width,ne.busFacingRef)),Z=V.reduce((ne,ae)=>ne+ae,0),K=Math.max(R,Z),ce=(K-Z)/(P.length+1);let de=L.at[0]-K/2+ce;const J=L.at[1]+B*wa;for(let ne=0;ne<P.length;ne++){const ae=P[ne],$e=V[ne],Le=de+$e/2;ae.isLinker?je.has(ae.elId)||je.set(ae.elId,Le):s.set(ae.elId,{at:[Me(Le-ae.localTerm.x),Me(J-ae.localTerm.y)],rot:0,mirror:!1}),de+=$e+ce}};z(N,-1),z(C,1)},Re=v=>{if(s.has(v.elementId)||v.orientation==="horizontal")return;const S=f(v.elementId);if(!S)return;const A=v.attachments.filter(de=>d.has(de.busId));if(A.length<2)return;const T=A.slice().sort((de,J)=>(te.get(de.busId)??0)-(te.get(J.busId)??0)),N=T[0].busId,C=d.get(N),I=T[0].pin,F=T[T.length-1].pin,R=S.terminals.find(de=>de.id===I),L=S.terminals.find(de=>de.id===F);if(!R||!L)return;const z=R.y<=L.y?0:180,P=te.get(N)??0,B=A.filter(de=>(te.get(de.busId)??0)===P),H=[];let V=0;for(const de of B){const J=_e(v,de.busId,de.pin);V=Math.max(V,J.extent);const ne=J.head?s.get(J.head):void 0;ne?H.push(ne.at[0]):je.has(v.elementId)?H.push(je.get(v.elementId)):H.push(d.get(de.busId).at[0])}let Z;H.length>0?Z=H.reduce((de,J)=>de+J,0)/H.length:je.has(v.elementId)?Z=je.get(v.elementId):Z=C.at[0];const K=C.at[1]+V,ce=z===0?[Me(Z-R.x),Me(K-R.y)]:[Me(Z+R.x),Me(K+R.y)];if(s.set(v.elementId,{at:ce,rot:z,mirror:!1}),B.length>1){const de=s.get(v.elementId),J=Ze([R.x,R.y],de),ne=yn(R.orientation,de);Je(`${v.elementId}.${I}`,J,ne,Z)}},Je=(v,S,A,T)=>{const N=new Set([v]);let C=v,I=S,F=A;for(;;){const R=W.get(C)??[];let L,z=!1;for(const ue of R){if(ue.length>=3){z=!0;break}const Ge=ue.find(Ke=>Ke!==C);if(!(!Ge||N.has(Ge))){if(y(Ge)){z=!0;break}L=Ge;break}}if(z||!L)break;const P=L.indexOf(".");if(P<0)break;const B=L.slice(0,P),H=L.slice(P+1);if(y(B)||Y.has(B)||s.has(B))break;const V=f(B);if(!V)break;const Z=V.terminals.find(ue=>ue.id===H);if(!Z)break;const K=sr(F),ce=[I[0]+K[0]*un,I[1]+K[1]*un],de=xa[F],J=Ln(Z.orientation,de),ne=Ze([Z.x,Z.y],{at:[0,0],rot:J,mirror:!1}),ae=[Me(T-ne[0]),Me(ce[1]-ne[1])];s.set(B,{at:ae,rot:J,mirror:!1}),N.add(L);const $e=V.terminals.find(ue=>ue.id!==H);if(!$e)break;const Le=`${B}.${$e.id}`;N.add(Le);const oe={at:ae,rot:J,mirror:!1};I=Ze([$e.x,$e.y],oe),F=yn($e.orientation,oe),C=Le}},nt=v=>{if(s.has(v.elementId)||v.orientation!=="horizontal")return;const S=f(v.elementId);if(!S)return;const A=v.attachments.filter(B=>d.has(B.busId));if(A.length<2)return;const T=A.map(B=>{const H=_e(v,B.busId,B.pin),V=H.head?s.get(H.head):void 0,Z=V?V.at[0]:d.get(B.busId).at[0];return{att:B,x:Z,extent:H.extent}});T.sort((B,H)=>B.x-H.x);const N=T[0],C=T[T.length-1],I=S.terminals.find(B=>B.id===N.att.pin),F=S.terminals.find(B=>B.id===C.att.pin);if(!I||!F)return;const R=I.y<=F.y?270:90,L=(N.x+C.x)/2,P=d.get(N.att.busId).at[1]+Math.max(N.extent,C.extent);s.set(v.elementId,{at:[Me(L),Me(P)],rot:R,mirror:!1})},Dn=100;let mt=Bn;for(let v=0;v<ie.length;v++){const S=ie[v],A=Se.get(S);let T;if(v===0)T=Bn;else{const C=Se.get(ie[v-1]);let I=0;for(const F of C)for(const R of A)(ra=G.get(F))!=null&&ra.get(R)&&(I=Math.max(I,Ie(F,R)));I===0&&(I=dn),T=mt+I}mt=T;let N=Ro;for(const C of A){if(d.has(C)){mt=Math.max(mt,d.get(C).at[1]);continue}let I;if(v>0){const R=Se.get(ie[v-1]),L=[];for(const z of R){const P=(aa=G.get(z))==null?void 0:aa.get(C);if(!P||P.orientation!=="vertical")continue;const B=(ia=P.attachments.find(V=>V.busId===z))==null?void 0:ia.pin;if(!B)continue;const H=_e(P,z,B);H.head&&s.has(H.head)?L.push(s.get(H.head).at[0]):je.has(P.elementId)?L.push(je.get(P.elementId)):L.push(d.get(z).at[0])}L.length>0&&(I=L.reduce((z,P)=>z+P,0)/L.length)}if(I===void 0){const R=U.get(C)??Lo;I=N+R/2,N+=R+Dn}const F=U.get(C)??Lo;d.set(C,{at:[Me(I),Me(T)],rot:0,span:F,axis:ir(0)})}for(const C of A)Ae(C);if(v>0)for(const C of we)s.has(C.elementId)||!C.attachments.some(F=>A.includes(F.busId))||Re(C);for(const C of we)C.orientation!=="horizontal"||s.has(C.elementId)||!C.attachments.every(F=>A.includes(F.busId))||nt(C)}if(n.length===0&&s.size<t.length){const v=N=>{const C=new Set,I=f(N);if(!I)return C;for(const F of I.terminals){const R=`${N}.${F.id}`;for(const L of W.get(R)??[])for(const z of L){if(z===R||y(z))continue;const P=z.indexOf(".");if(P<0)continue;const B=z.slice(0,P);B!==N&&C.add(B)}}return C},S=new Set,A=[];for(const N of t){if(S.has(N.id)||!f(N.id))continue;const C=[],I=[N.id];for(S.add(N.id);I.length>0;){const F=I.pop();C.push(F);for(const R of v(F))S.has(R)||(S.add(R),I.push(R))}C.length>=2&&A.push(C)}let T=Ro;for(const N of A){if(N.some(L=>s.has(L)))continue;N.sort((L,z)=>{var Z,K;const P=me(((Z=g.get(L))==null?void 0:Z.kind)??"")?0:1,B=me(((K=g.get(z))==null?void 0:K.kind)??"")?0:1;if(P!==B)return P-B;const H=v(L).size,V=v(z).size;return H!==V?H-V:L.localeCompare(z)});const C=N[0],I=f(C);if(!I)continue;const F=I.terminals.slice().sort((L,z)=>z.y-L.y)[0],R=F?Ze([F.x,F.y],{at:[0,0],rot:0,mirror:!1}):[0,0];s.set(C,{at:[Me(T-R[0]),Me(Bn-R[1])],rot:0,mirror:!1}),T+=Math.max(Lo,N.length*jt)+Dn}}const IC=v=>{if(y(v))return d.has(v);const S=v.indexOf(".");return S<0?!1:s.has(v.slice(0,S))};let Po=!0,zC=t.length+4;for(;Po&&zC-- >0;){Po=!1;for(const v of E){if(v.length<2)continue;const S=[],A=new Map;for(const J of v){if(y(J))continue;const ne=J.indexOf(".");if(ne<0)continue;const ae=J.slice(0,ne),$e=J.slice(ne+1);if(s.has(ae)){S.push(J);continue}if(Y.has(ae)||A.has(ae))continue;const Le=f(ae);if(!Le)continue;const oe=Le.terminals.find(ue=>ue.id===$e);oe&&A.set(ae,{ref:J,elId:ae,lib:Le,localTerm:oe})}if(A.size===0||S.length===0)continue;const T=[...A.values()],N=new Map;for(const J of T)for(const ne of W.get(J.ref)??[])for(const ae of ne){if(ae===J.ref||y(ae)||!IC(ae))continue;const $e=ae;N.set($e,(N.get($e)??0)+1)}let C;if(N.size>0){let J=-1;for(const[ne,ae]of N)(ae>J||ae===J&&(C===void 0||ne<C))&&(J=ae,C=ne)}if(C||(C=[...S].sort()[0]),!C)continue;const I=C.indexOf("."),F=C.slice(0,I),R=C.slice(I+1),L=f(F),z=s.get(F);if(!L||!z)continue;const P=L.terminals.find(J=>J.id===R);if(!P)continue;const B=Ze([P.x,P.y],z),H=yn(P.orientation,z),V=sr(H),Z=[-V[1],V[0]];T.sort((J,ne)=>J.elId.localeCompare(ne.elId));const K=T.map(J=>Math.max(J.lib.width,jt));let de=-K.reduce((J,ne)=>J+ne,0)/2;for(let J=0;J<T.length;J++){const ne=T[J],ae=K[J],$e=de+ae/2;de+=ae;const Le=xa[H],oe=Ln(ne.localTerm.orientation,Le),ue=Ze([ne.localTerm.x,ne.localTerm.y],{at:[0,0],rot:oe,mirror:!1}),Ge=[B[0]+V[0]*un+Z[0]*$e,B[1]+V[1]*un+Z[1]*$e],Ke=[Me(Ge[0]-ue[0]),Me(Ge[1]-ue[1])];s.set(ne.elId,{at:Ke,rot:oe,mirror:!1}),Po=!0}}}const an=v=>{const S=s.get(v),A=f(v);if(!S||!A)return null;const T=A.viewBox.split(/\s+/).map(Number);if(T.length<4||T.some(P=>Number.isNaN(P))){const P=A.width/2;return{min:S.at[0]-P,max:S.at[0]+P}}const[N,C,I,F]=T,R=[[N,C],[N+I,C],[N,C+F],[N+I,C+F]];let L=1/0,z=-1/0;for(const P of R){const B=Ze(P,S);L=Math.min(L,B[0]),z=Math.max(z,B[0])}return{min:L,max:z}},Io=v=>{const S=new Set,A=f(v);if(!A)return S;for(const T of A.terminals){const N=`${v}.${T.id}`;for(const C of W.get(N)??[])for(const I of C){if(I===N||y(I))continue;const F=I.indexOf(".");if(F<0)continue;const R=I.slice(0,F);R!==v&&S.add(R)}}return S},Ur=40,zo=v=>{const S=s.get(v),A=f(v);if(!S||!A)return null;const T=A.viewBox.split(/\s+/).map(Number);if(T.length<4||T.some(P=>Number.isNaN(P))){const P=A.height/2;return{min:S.at[1]-P,max:S.at[1]+P}}const[N,C,I,F]=T,R=[[N,C],[N+I,C],[N,C+F],[N+I,C+F]];let L=1/0,z=-1/0;for(const P of R){const B=Ze(P,S);L=Math.min(L,B[1]),z=Math.max(z,B[1])}return{min:L,max:z}},MC=(v,S)=>{const A=new Set,T=[];for(const N of Q.get(v)??[]){if(y(N))continue;const C=N.indexOf(".");if(C<0)continue;const I=N.slice(0,C),F=s.get(I);!F||F.at[1]>=S-1||A.has(I)||(A.add(I),T.push(I))}for(;T.length>0;){const N=T.pop();for(const C of Io(N)){if(A.has(C))continue;const I=s.get(C);!I||I.at[1]>=S-1||(A.add(C),T.push(C))}}return A},Xr=(v,S,A)=>{const T=new Set([v]),N=[v];for(;N.length>0;){const C=N.pop();for(const I of Io(C))I===S||T.has(I)||!A.has(I)||(T.add(I),N.push(I))}return T},Yr=(v,S)=>{let A=v.length*v.length+8,T=!1,N=!0;for(;N&&A-- >0;){N=!1;for(let C=0;C<v.length&&!N;C++)for(let I=C+1;I<v.length;I++){const F=v[C],R=v[I],L=an(F),z=an(R),P=zo(F),B=zo(R);if(!L||!z||!P||!B)continue;const H=Math.min(L.max,z.max)-Math.max(L.min,z.min),V=Math.min(P.max,B.max)-Math.max(P.min,B.min);if(H<=0||V<=0)continue;const Z=Xr(F,R,S),K=Xr(R,F,S);if(Z.has(R)||K.has(F))continue;const ce=![...Z].some(oe=>m.has(oe)),de=![...K].some(oe=>m.has(oe));if(!ce&&!de)continue;const J=(L.min+L.max)/2,ne=(z.min+z.max)/2;let ae,$e;ce&&(!de||Z.size<=K.size)?(ae=Z,$e=J<=ne?-1:1):(ae=K,$e=ne<=J?-1:1);const Le=Me($e*(H+Ur));if(Le!==0){for(const oe of ae){const ue=s.get(oe);ue&&s.set(oe,{...ue,at:[ue.at[0]+Le,ue.at[1]]})}T=!0,N=!0;break}}}return T};for(const v of n){const S=d.get(v.id);if(!S)continue;const A=MC(v.id,S.at[1]);if(A.size<2)continue;const T=[...A];if(Yr(T,A)){let C=1/0,I=-1/0;for(const F of T){const R=an(F);R&&(C=Math.min(C,R.min),I=Math.max(I,R.max))}if(Number.isFinite(C)){const R=T.some(z=>m.has(z))?0:Me(S.at[0]-(C+I)/2);if(R!==0)for(const z of T){const P=s.get(z);P&&s.set(z,{...P,at:[P.at[0]+R,P.at[1]]})}const L=I-C+Ur;if(L>S.span&&!p.has(v.id)){const z=d.get(v.id);d.set(v.id,{...z,span:L})}}}}const Zr=()=>{const S=t.map(T=>T.id).filter(T=>s.has(T)).map(T=>({x:an(T),y:zo(T)})).filter(T=>T.x&&T.y);let A=0;for(let T=0;T<S.length;T++)for(let N=T+1;N<S.length;N++){const C=Math.min(S[T].x.max,S[N].x.max)-Math.max(S[T].x.min,S[N].x.min),I=Math.min(S[T].y.max,S[N].y.max)-Math.max(S[T].y.min,S[N].y.min);C>1&&I>1&&A++}return A},DC=Zr(),Qr=new Map;for(const[v,S]of s)Qr.set(v,{...S,at:[...S.at]});const Jr=new Map;for(const[v,S]of d)Jr.set(v,{...S,at:[...S.at]});const Mo=120,ea=new Map;{const v=new Map,S=new Map,A=[];for(const N of n)for(const C of Q.get(N.id)??[]){if(y(C))continue;const I=C.indexOf(".");if(I<0)continue;const F=C.slice(0,I);s.has(F)&&A.push({el:F,bus:N.id,d:1})}A.sort((N,C)=>N.d-C.d);let T=0;for(;T<A.length;){const{el:N,bus:C,d:I}=A[T++],F=v.get(N);if(F===void 0)v.set(N,I),S.set(N,C);else if(I===F&&S.get(N)!==C){S.set(N,null);continue}else continue;for(const R of Io(N))s.has(R)&&(v.has(R)||A.push({el:R,bus:C,d:I+1}))}for(const[N,C]of S)C&&ea.set(N,C)}for(const v of ie){const S=(Se.get(v)??[]).filter(L=>d.has(L));if(S.length<2||S.some(L=>p.has(L)))continue;const A=[];let T=0;for(const L of S){const z=d.get(L),P=[];let B=1/0,H=-1/0;for(const[V,Z]of ea){if(Z!==L)continue;const K=an(V);K&&(P.push(V),B=Math.min(B,K.min),H=Math.max(H,K.max))}Number.isFinite(B)||(B=z.at[0]-be/2,H=z.at[0]+be/2),A.push({busId:L,min:B,max:H,members:P}),T+=H-B}if(A.some(L=>L.members.some(z=>m.has(z))))continue;let N=1/0,C=-1/0;for(const L of A)N=Math.min(N,L.min),C=Math.max(C,L.max);const I=C-N,F=T+Mo*(A.length-1);if(!(I>F+Mo))continue;A.sort((L,z)=>(L.min+L.max)/2-(z.min+z.max)/2);let R=N;for(const L of A){const z=Me(R-L.min);if(z!==0){const P=d.get(L.busId);d.set(L.busId,{...P,at:[P.at[0]+z,P.at[1]]});for(const B of L.members){const H=s.get(B);H&&s.set(B,{...H,at:[H.at[0]+z,H.at[1]]})}L.min+=z,L.max+=z}R=L.max+Mo}for(const L of A){const z=d.get(L.busId),P=Math.max(be,L.max-L.min);P<z.span&&d.set(L.busId,{...z,span:P})}}{const v=t.map(A=>A.id).filter(A=>s.has(A)),S=new Set(v);Yr(v,S)}if(Zr()>DC){s.clear();for(const[v,S]of Qr)s.set(v,S);d.clear();for(const[v,S]of Jr)d.set(v,S)}let Do=0;for(const v of t){if(s.has(v.id))continue;const S=Do%ka,A=Math.floor(Do/ka);s.set(v.id,{at:[Me(u6+S*p6),Me(m6+A*h6)],rot:0,mirror:!1}),Do++}return{devices:s,buses:d,junctions:u}}function Me(e){return Math.round(e/va)*va}function g6(e,t){const n=e.ends[0],o=e.ends[1],r=_a(n,t),a=_a(o,t);if(r||a){const s=r?n:o,u=Bo(r?o:n,t);if(!u)return null;const m=t.buses.get(s);if(!m)return null;const{axis:p,at:g,span:h}=m.geometry,f=h/2;let b;if(p==="x")b=[lo(u[0],g[0]-f,g[0]+f),g[1]];else{const y=lo(u[1],g[1]-f,g[1]+f);b=[g[0],y]}return{wireId:e.id,path:ja(u,b)}}const i=Bo(n,t),l=Bo(o,t);return!i||!l?null:{wireId:e.id,path:ja(i,l)}}function _a(e,t){return!e.includes(".")&&t.buses.has(e)}function Bo(e,t){if(!e.includes(".")){const o=t.buses.get(e);if(o)return o.geometry.at;const r=t.junctions.get(e);return r?r.world:null}const n=t.terminals.get(e);return n?n.world:null}function Ca(e,t,n){if(!e.includes(".")){const r=n.buses.get(e);if(!r){const u=n.junctions.get(e);return u?[u.world[0],u.world[1]]:null}const{axis:a,at:i,span:l}=r.geometry;if(!t)return[i[0],i[1]];const s=l/2;if(a==="x")return[lo(t[0],i[0]-s,i[0]+s),i[1]];const d=lo(t[1],i[1]-s,i[1]+s);return[i[0],d]}const o=n.terminals.get(e);return o?[o.world[0],o.world[1]]:null}function ja(e,t){return e[0]===t[0]||e[1]===t[1]?[e,t]:[e,[e[0],t[1]],t]}function lo(e,t,n){return e<t?t:e>n?n:e}const b6=[{id:"contact",kinds:["make-contact","break-contact","on-delay-make-contact","on-delay-break-contact","off-delay-make-contact","off-delay-break-contact"]},{id:"continuation",kinds:["continuation-out","continuation-in"],mirrorOnSwap:!0}];function Pr(e){return b6.find(t=>t.kinds.includes(e))}function Ir(e){var t;return((t=Pr(e))==null?void 0:t.id)==="continuation"}function lr(e){const t=(e??"").trim().toLowerCase();return t===""?null:t}function y6(e){const n=[...e].sort().join("|");let o=2166136261;for(let r=0;r<n.length;r++)o^=n.charCodeAt(r),o=Math.imul(o,16777619);return`n_${(o>>>0).toString(36)}`}const x6=320;function pt(e){var E,W,Q,ke,we,Y;const t=ZS(),n=l6(YS(e.customKinds),(E=e.meta)==null?void 0:E.symbolStandard);t.library=n;const o=new Map;e.elements.forEach((k,D)=>{if(o.has(k.id)){t.diagnostics.push({code:"E001",severity:"error",message:He("compile.duplicateId",{id:k.id}),pointer:`/elements/${D}`});return}o.set(k.id,k);const M=n.get(k.kind);M||t.diagnostics.push({code:"E003",severity:"error",message:`${He("compile.unknownKind",{kind:k.kind})} (id=${k.id})`,pointer:`/elements/${D}`}),t.elements.set(k.id,{element:k,libraryDef:M})});const r=new Map,a=new Map;(e.buses??[]).forEach((k,D)=>{if(o.has(k.id)||r.has(k.id)){t.diagnostics.push({code:"E001",severity:"error",message:He("compile.duplicateId",{id:k.id}),pointer:`/buses/${D}`});return}if(r.set(k.id,k),k.layout){const M=k.layout.rot??0;a.set(k.id,{at:k.layout.at,span:k.layout.span,rot:M,axis:ir(M)})}});const i=new Map;(e.junctions??[]).forEach((k,D)=>{if(o.has(k.id)||r.has(k.id)||i.has(k.id)){t.diagnostics.push({code:"E001",severity:"error",message:He("compile.duplicateId",{id:k.id}),pointer:`/junctions/${D}`});return}i.set(k.id,k)});const l=k=>!k.includes(".")&&r.has(k),s=k=>!k.includes(".")&&i.has(k),d=(k,D)=>{if(l(k)||s(k))return!0;const M=k.indexOf(".");if(M<=0)return t.diagnostics.push({code:"E003",severity:"error",message:He("compile.invalidTermRef",{ref:k}),pointer:D}),!1;const G=k.slice(0,M),me=k.slice(M+1),pe=t.elements.get(G);if(!pe)return t.diagnostics.push({code:"E002",severity:"error",message:He("compile.elementMissing",{id:G}),pointer:D}),!1;if(!pe.libraryDef)return!1;if(!pe.libraryDef.terminals.find(te=>te.id===me)){const te=pe.libraryDef.terminals.map(Se=>Se.id).join(", ");return t.diagnostics.push({code:"E003",severity:"error",message:He("compile.missingPin",{id:G,kind:pe.element.kind,pin:me,available:te}),pointer:D}),!1}return!0},u=[];(e.wires??[]).forEach((k,D)=>{const M=`/wires/${D}`,G=d(k.ends[0],M),me=d(k.ends[1],M);G&&me&&u.push(k)});const m=new Map;if(e.layout)for(const[k,D]of Object.entries(e.layout))t.elements.has(k)?m.set(k,QS(D)):t.diagnostics.push({code:"E004",severity:"error",message:He("compile.layoutMissingElement",{id:k}),pointer:`/layout/${k}`});const p=f6({elements:e.elements,buses:e.buses??[],junctions:e.junctions??[],wires:u,library:n,userLayout:m,userBusLayout:a});t.layout=p.devices;for(const[k,D]of p.buses){const M=r.get(k);M&&t.buses.set(k,{bus:M,geometry:D})}for(const[k,D]of r)t.buses.has(k)||t.buses.set(k,{bus:D,geometry:{at:((W=D.layout)==null?void 0:W.at)??[0,0],span:((Q=D.layout)==null?void 0:Q.span)??x6,rot:((ke=D.layout)==null?void 0:ke.rot)??0,axis:ir(((we=D.layout)==null?void 0:we.rot)??0)}});for(const k of t.elements.values()){if(!k.libraryDef)continue;const D=t.layout.get(k.element.id);if(!D)continue;const M=[];for(const G of k.libraryDef.terminals){const me=`${k.element.id}.${G.id}`,pe=Ze([G.x,G.y],D),te=yn(G.orientation,D);t.terminals.set(me,{ref:me,elementId:k.element.id,pin:G.id,world:pe,orientation:te}),M.push(me)}t.elementToTerminals.set(k.element.id,M)}const g=new Map,h=new Set;for(const[k,D]of i)(Y=D.layout)!=null&&Y.at?(g.set(k,[D.layout.at[0],D.layout.at[1]]),h.add(k)):p.junctions.has(k)&&(g.set(k,p.junctions.get(k)),h.add(k));const f=k=>{if(!k.includes(".")){const M=t.buses.get(k);return M?M.geometry.at:g.get(k)??null}const D=t.terminals.get(k);return D?D.world:null},b=new Map;for(const[k]of i)h.has(k)||b.set(k,[]);for(const k of u){const[D,M]=k.ends;b.has(D)&&b.get(D).push(M),b.has(M)&&b.get(M).push(D)}for(let k=0;k<12;k++){let D=!1;for(const[M,G]of b){let me=0,pe=0,te=0;for(const Ie of G){const Oe=f(Ie);Oe&&(me+=Oe[0],pe+=Oe[1],te++)}if(!te)continue;const Se=me/te,ie=pe/te,_e=g.get(M);(!_e||Math.abs(_e[0]-Se)>.01||Math.abs(_e[1]-ie)>.01)&&(g.set(M,[Se,ie]),D=!0)}if(!D)break}const y=new Map;for(const[k]of i)y.set(k,0);for(const k of u)for(const D of k.ends){const M=y.get(D);M!==void 0&&y.set(D,M+1)}for(const[k,D]of i)t.junctions.set(k,{junction:D,world:g.get(k)??[0,0],degree:y.get(k)??0});const w=new JS;for(const k of u)w.add(k.ends[0]),w.add(k.ends[1]),w.union(k.ends[0],k.ends[1]);const j=new Set(u.flatMap(k=>k.ends)),_=new Map;for(const k of t.elements.values()){if(!Ir(k.element.kind))continue;const D=lr(k.element.name);if(D)for(const M of t.elementToTerminals.get(k.element.id)??[]){if(!j.has(M))continue;const G=_.get(D)??[];G.push(M),_.set(D,G)}}for(const k of _.values())for(let D=1;D<k.length;D++)w.union(k[0],k[D]);for(const[,k]of w.groups()){const D=y6(k);t.nodes.set(D,{id:D,terminals:k});for(const M of k)t.terminalToNode.set(M,D)}for(const k of t.elements.values()){const D=t.elementToTerminals.get(k.element.id)??[];if(D.length===0)continue;D.some(G=>t.terminalToNode.has(G))||t.diagnostics.push({code:"W001",severity:"warning",message:He("compile.elementUnconnected",{id:k.element.id})})}for(const k of t.buses.keys())t.terminalToNode.has(k)||t.diagnostics.push({code:"W001",severity:"warning",message:He("compile.elementUnconnected",{id:k})});for(const k of t.junctions.keys())t.terminalToNode.has(k)||t.diagnostics.push({code:"W001",severity:"warning",message:He("compile.elementUnconnected",{id:k})});for(const k of u){if(k.path&&k.path.length>=2){const M=k.path,G=M.length>=2?M[1]:null,me=M.length>=2?M[M.length-2]:null,pe=Ca(k.ends[0],G,t),te=Ca(k.ends[1],me,t);if(pe&&te){const Se=[[pe[0],pe[1]],...M.slice(1,-1).map(_e=>[_e[0],_e[1]]),[te[0],te[1]]],ie=fs(Se);if(ie.length>=2){t.wireRenders.set(k.id,{wireId:k.id,path:ie,userEdited:!0,...k.label?{label:k.label}:{},...k.color?{color:k.color}:{}});continue}}}const D=g6(k,t);D&&t.wireRenders.set(k.id,{...D,...k.label?{label:k.label}:{},...k.color?{color:k.color}:{}})}return t}const w6={earth:"GND",breaker:"QF",disconnector:"QS","earthing-switch":"QE","load-switch":"QL",fuse:"FU","transformer-2w":"T","transformer-3w":"T",autotransformer:"AT",ct:"CT",pt:"PT",generator:"G","sync-motor":"M","async-motor":"M","grid-source":"L",load:"L",battery:"BAT","shunt-reactor":"LR","series-reactor":"LR","shunt-capacitor":"C",arrester:"FBL","grounding-transformer":"TG",ngr:"NGR","arc-suppression-coil":"ASC",pv:"PV","wind-turbine":"WT",rectifier:"RT",inverter:"INV","converter-bidir":"PCS"},$a="B",Aa="J";function zr(e){return new Set([...e.elements.map(t=>t.id),...(e.buses??[]).map(t=>t.id),...(e.junctions??[]).map(t=>t.id)])}function Sn(e,t){const n=w6[t]??t,o=zr(e);let r=1;for(;o.has(`${n}${r}`);)r++;return`${n}${r}`}function cr(e){const t=zr(e);let n=1;for(;t.has(`${$a}${n}`);)n++;return`${$a}${n}`}function dr(e){const t=zr(e);let n=1;for(;t.has(`${Aa}${n}`);)n++;return`${Aa}${n}`}function fn(e){const t=new Set((e.annotations??[]).map(o=>o.id));let n=1;for(;t.has(`a${n}`);)n++;return`a${n}`}function Dt(e,t){const n=[e,t].sort(),o=`${n[0]}|${n[1]}`;let r=2166136261;for(let a=0;a<o.length;a++)r^=o.charCodeAt(a),r=Math.imul(r,16777619);return`w_${(r>>>0).toString(36)}`}function Rt(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}function v6(e,t){if(!e||e.length===0||t.size===0)return e;let n=!1;const o=e.map(r=>{if(!r.path||r.path.length<=2)return r;const a=t.get(Rt(r.ends[0])),i=t.get(Rt(r.ends[1]));return!a||!i||a[0]!==i[0]||a[1]!==i[1]||a[0]===0&&a[1]===0?r:(n=!0,{...r,path:r.path.map(([l,s])=>[l+a[0],s+a[1]])})});return n?o:e}function Ho(e,t,n){if(n.length===0)return n;const o=new Set(n.map(l=>l.id)),r=new Set(t.map(l=>l.id)),a=new Set;for(const l of e)if(!r.has(l.id))for(const s of l.ends)o.has(s)&&a.add(s);if(a.size===0)return n;const i=new Set;for(const l of t)for(const s of l.ends)a.has(s)&&i.add(s);return n.filter(l=>!a.has(l.id)||i.has(l.id))}const k6=["none","warn","alarm","fault"],Ea={good:0,stale:1,bad:2},Na=new Set;function S6(e,t,n){const o=(e==null?void 0:e.type)??"pass";switch(o){case"pass":return{ok:!0,out:t};case"discrete":{const r=e;for(const a of r.cases??[])if(a.when===t)return{ok:!0,out:a.out};return"default"in r?{ok:!0,out:r.default}:{ok:!1}}default:{const r=`${n.target}\0${n.prop}\0${o}`;return Na.has(r)||(Na.add(r),console.warn(`[sldeditor] binding ${n.target}.${n.prop}: unknown mapping type "${o}" — skipped`)),{ok:!1}}}}function _6(e,t,n){switch(t){case"visible":e.visible=!!n;return;case"label.text":n!=null&&(e.labelText=String(n));return;case"alarm":typeof n=="string"&&k6.includes(n)&&(e.alarm=n);return;case"value":e.value=n;return;case"badge":n!=null&&n!==""&&(e.badge=String(n));return;default:t.startsWith("state.")&&((e.state??(e.state={}))[t.slice(6)]=n)}}function e_(e,t){var o;const n={};for(const r of e.bindings??[]){const a=n[o=r.target]??(n[o]={quality:"unbound"}),i=t.get(r.tag);if(i===void 0)continue;const l=i.q??"good";if((a.quality==="unbound"||Ea[l]>Ea[a.quality])&&(a.quality=l),l==="bad")continue;const s=S6(r.mapping,i.v,r);s.ok&&_6(a,r.prop,s.out)}return n}function C6(e,t){return(e.bindings??[]).filter(n=>n.target===t)}function j6(e,t){const n=e.bindings??[],o=n.findIndex(a=>a.target===t.target&&a.prop===t.prop),r=o<0?[...n,t]:n.map((a,i)=>i===o?t:a);return{...e,bindings:r}}function $6(e,t,n){const o=e.bindings;if(!o||o.length===0)return e;const r=o.filter(a=>!(a.target===t&&(n===void 0||a.prop===n)));return r.length===o.length?e:t_(e,r)}function A6(e,t){const n=e.bindings;if(!n||n.length===0)return e;const o=n.filter(r=>!t.has(r.target));return o.length===n.length?e:t_(e,o)}function t_(e,t){if(t.length>0)return{...e,bindings:t};const n={...e};return delete n.bindings,n}const Ta={version:"1",elements:[]},Pa=100,Fo=20;function E6(){if(typeof window>"u")return"select";try{return window.matchMedia("(pointer: coarse)").matches?"pan":"select"}catch{return"select"}}const n_=(e,t)=>({diagram:Ta,internal:pt(Ta),fileSession:null,activeTool:E6(),placeKind:null,lastPlaceKind:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,busbarDrawStart:null,cursorSvg:null,selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,editingElement:null,readOnly:!1,gestureBase:null,past:[],future:[],clipboard:null,clipboardPasteIndex:0,setDiagram:n=>e({diagram:n,internal:pt(n),past:[],future:[],selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,gestureBase:null,editingElement:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null}),setFileSession:n=>e({fileSession:n}),setReadOnly:n=>e({readOnly:n}),loadDiagramFromFile:(n,o)=>e({diagram:n,internal:pt(n),fileSession:o,past:[],future:[],selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,gestureBase:null,editingElement:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null}),dispatch:n=>{const{diagram:o,past:r}=t(),a=n(o);if(a===o)return;const i=r.length>=Pa?r.slice(1):r;e({diagram:a,internal:pt(a),past:[...i,o],future:[],annotationPreview:null})},undo:()=>{const{past:n,future:o,diagram:r}=t();if(n.length===0)return;const a=n[n.length-1];e({diagram:a,internal:pt(a),past:n.slice(0,-1),future:[...o,r],wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,annotationPreview:null})},redo:()=>{const{past:n,future:o,diagram:r}=t();if(o.length===0)return;const a=o[o.length-1];e({diagram:a,internal:pt(a),past:[...n,r],future:o.slice(0,-1),wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,annotationPreview:null})},setActiveTool:(n,o)=>{const r=t();let a;(o==null?void 0:o.placeKind)!==void 0?a=o.placeKind:n==="place"?a=r.placeKind??r.lastPlaceKind:a=null,e({activeTool:n,placeKind:a,lastPlaceKind:a??r.lastPlaceKind,wireFromTerminal:n==="wire"?r.wireFromTerminal:null,wireDragFrom:n==="wire"?r.wireDragFrom:null,placeFromTerminal:n==="place"?r.placeFromTerminal:null,annotationDraft:null})},setPlaceKind:n=>e(o=>({placeKind:n,lastPlaceKind:n??o.lastPlaceKind})),setWireFromTerminal:n=>e({wireFromTerminal:n}),setWireDragFrom:n=>e({wireDragFrom:n}),setPlaceFromTerminal:n=>e({placeFromTerminal:n}),setBusbarDrawStart:n=>e({busbarDrawStart:n}),setCursorSvg:n=>e({cursorSvg:n}),setSelection:(n,o)=>e({selection:Ia(n),selectedWire:null,selectedNode:null,selectedAnnotations:o?Ia(o):n.length?[]:t().selectedAnnotations}),toggleInSelection:n=>{const o=t().selection;e({selection:o.includes(n)?o.filter(r=>r!==n):[...o,n],selectedWire:null,selectedNode:null})},clearSelection:()=>e({selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,editingElement:null}),setSelectedWire:n=>e({selectedWire:n,selection:n?[]:t().selection,selectedNode:null,selectedAnnotations:n?[]:t().selectedAnnotations}),setSelectedNode:n=>e({selectedNode:n,selection:n?[]:t().selection,selectedWire:null,selectedAnnotations:n?[]:t().selectedAnnotations}),setSelectedAnnotation:n=>e({selectedAnnotations:n?[n]:[],selection:n?[]:t().selection,selectedWire:n?null:t().selectedWire,selectedNode:n?null:t().selectedNode,editingAnnotation:n?t().editingAnnotation:null,editingCell:n?t().editingCell:null}),toggleAnnotationInSelection:n=>{const o=t().selectedAnnotations;e({selectedAnnotations:o.includes(n)?o.filter(r=>r!==n):[...o,n],selectedWire:null,selectedNode:null,editingAnnotation:null,editingCell:null})},setEditingAnnotation:n=>e({editingAnnotation:n,selectedAnnotations:n?[n]:t().selectedAnnotations,editingElement:n?null:t().editingElement,editingCell:null}),setEditingCell:n=>e({editingCell:n}),setAnnotationDraft:n=>e({annotationDraft:n}),setAnnotationPreview:n=>e({annotationPreview:n}),setEditingElement:n=>e({editingElement:n,selection:n?[n]:t().selection,editingAnnotation:n?null:t().editingAnnotation,selectedAnnotations:n?[]:t().selectedAnnotations,selectedWire:n?null:t().selectedWire,selectedNode:n?null:t().selectedNode}),copySelection:()=>{var f;const{selection:n,selectedAnnotations:o,diagram:r,internal:a}=t();if(n.length===0&&o.length===0)return;const i=new Set(o),l=(r.annotations??[]).filter(b=>i.has(b.id)).map(b=>structuredClone(b));if(n.length===0){if(l.length===0)return;e({clipboard:{elements:[],buses:[],junctions:[],placements:{},busLayouts:{},wires:[],annotations:l},clipboardPasteIndex:0});return}const s=new Set(n),d=r.elements.filter(b=>s.has(b.id)).map(b=>structuredClone(b)),u=(r.buses??[]).filter(b=>s.has(b.id)).map(b=>structuredClone(b)),m=(r.junctions??[]).filter(b=>s.has(b.id)).map(b=>{var w;const y=structuredClone(b);if(!y.layout){const j=(w=a.junctions.get(b.id))==null?void 0:w.world;j&&(y.layout={at:[j[0],j[1]]})}return y}),p={};for(const b of n)if(s.has(b)&&!a.buses.has(b)){const y=(f=r.layout)==null?void 0:f[b];if(y){p[b]=structuredClone(y);continue}const w=a.layout.get(b);w&&(p[b]=Ht(w))}const g={};for(const b of n){const y=a.buses.get(b);y&&(g[b]=Ft(y.geometry))}const h=(r.wires??[]).filter(b=>b.ends.every(y=>s.has(Rt(y)))).map(b=>structuredClone(b));e({clipboard:{elements:d,buses:u,junctions:m,placements:p,busLayouts:g,wires:h,annotations:l},clipboardPasteIndex:0})},cutSelection:()=>{const{selection:n,selectedAnnotations:o}=t();n.length===0&&o.length===0||(t().copySelection(),t().deleteSelection())},pasteClipboard:()=>{const{clipboard:n,clipboardPasteIndex:o,diagram:r}=t();if(!n)return;if(n.elements.length===0&&n.buses.length===0&&n.junctions.length===0){const p=n.annotations??[];if(p.length===0)return;const g=o+1,h=Fo*g,f=[];t().dispatch(b=>{let y=b;for(const w of p){const j=fn(y);f.push(j);const _={...structuredClone(w),id:j,at:[w.at[0]+h,w.at[1]+h]};y={...y,annotations:[...y.annotations??[],_]}}return y}),f.length&&e({selectedAnnotations:f,selection:[],selectedWire:null,selectedNode:null,clipboardPasteIndex:g});return}const a=o+1,i=Fo*a,l=Fo*a,s=new Map;let d=r;for(const p of n.elements){const g=Sn(d,p.kind);s.set(p.id,g),d={...d,elements:[...d.elements,{id:g,kind:p.kind}]}}for(const p of n.buses){const g=cr(d);s.set(p.id,g),d={...d,buses:[...d.buses??[],{id:g}]}}for(const p of n.junctions){const g=dr(d);s.set(p.id,g),d={...d,junctions:[...d.junctions??[],{id:g}]}}const u=[];for(const p of n.annotations??[]){const g=fn(d),h={...structuredClone(p),id:g,at:[p.at[0]+i,p.at[1]+l]};u.push(h),d={...d,annotations:[...d.annotations??[],h]}}const m=p=>{const g=p.indexOf("."),h=g<0?p:p.slice(0,g),f=s.get(h);return f?g<0?f:`${f}${p.slice(g)}`:p};t().dispatch(p=>{const g=n.elements.map(j=>{const _=structuredClone(j);return _.id=s.get(j.id),_}),h=n.buses.map(j=>{const _=structuredClone(j);_.id=s.get(j.id);const E=n.busLayouts[j.id];return E&&(_.layout={...E,at:[E.at[0]+i,E.at[1]+l]}),_}),f=n.junctions.map(j=>{const _=structuredClone(j);return _.id=s.get(j.id),_.layout&&(_.layout={at:[_.layout.at[0]+i,_.layout.at[1]+l]}),_}),b={...p.layout??{}};for(const[j,_]of s){const E=n.placements[j];E&&(b[_]={...E,at:[E.at[0]+i,E.at[1]+l]})}const y=n.wires.map(j=>{const _=[m(j.ends[0]),m(j.ends[1])];return{id:Dt(_[0],_[1]),ends:_,...j.label?{label:j.label}:{}}}),w=za(p.wires??[],y);return{...p,elements:[...p.elements,...g],buses:h.length?[...p.buses??[],...h]:p.buses,junctions:f.length?[...p.junctions??[],...f]:p.junctions,wires:w.length?w:void 0,layout:Object.keys(b).length?b:void 0,annotations:u.length?[...p.annotations??[],...u]:p.annotations}}),e({selection:Array.from(s.values()),selectedAnnotations:u.map(p=>p.id),clipboardPasteIndex:a})},autoArrangeAll:()=>{t().dispatch(n=>{var s;const o=n.layout&&Object.keys(n.layout).length>0,r=(n.buses??[]).some(d=>d.layout);if(!o&&!r)return n;const{layout:a,...i}=n,l=(s=n.buses)==null?void 0:s.map(d=>{const{layout:u,...m}=d;return m});return{...i,buses:l}})},autoArrangeSelection:()=>{const{selection:n}=t();if(n.length===0)return;const o=new Set(n);t().dispatch(r=>{let a=!1,i=r.layout;if(i){const s={};for(const[d,u]of Object.entries(i)){if(o.has(d)){a=!0;continue}s[d]=u}a&&(i=Object.keys(s).length?s:void 0)}let l=r.buses;if(l){const s=l.map(d=>{if(o.has(d.id)&&d.layout){a=!0;const{layout:u,...m}=d;return m}return d});a&&(l=s)}return a?{...r,layout:i,buses:l}:r})},fillUnplacedAll:()=>{const n=t().internal;t().dispatch(o=>{const r=o.layout??{},a={};for(const s of o.elements){if(r[s.id])continue;const d=n.layout.get(s.id);d&&(a[s.id]=Ht(d))}const i=[];if((o.buses??[]).forEach((s,d)=>{s.layout||n.buses.has(s.id)&&i.push({idx:d,bus:s})}),Object.keys(a).length===0&&i.length===0)return o;let l=o.buses;return i.length>0&&l&&(l=l.map(s=>{const d=n.buses.get(s.id);return!s.layout&&d?{...s,layout:Ft(d.geometry)}:s})),{...o,layout:{...r,...a},buses:l}})},fillUnplacedSelection:()=>{const{selection:n,internal:o}=t();n.length!==0&&t().dispatch(r=>{var d;const a=r.layout??{},i={},l=new Map;for(const u of n)if(o.buses.has(u)){const m=o.buses.get(u);(d=r.buses)!=null&&d.find(p=>p.id===u&&p.layout)||l.set(u,Ft(m.geometry))}else{if(a[u])continue;const m=o.layout.get(u);m&&(i[u]=Ht(m))}if(Object.keys(i).length===0&&l.size===0)return r;let s=r.buses;return l.size>0&&s&&(s=s.map(u=>l.has(u.id)?{...u,layout:l.get(u.id)}:u)),{...r,layout:{...a,...i},buses:s}})},moveElements:(n,o)=>{if(n.size===0&&!(o!=null&&o.size))return;const r=t().internal;t().dispatch(a=>{const i={...a.layout??{}},l=new Map,s=new Map;for(const[g,h]of n){if(r.buses.has(g)){l.set(g,h);continue}if(r.junctions.has(g)){s.set(g,h);continue}const f=r.layout.get(g),b=i[g]??(f?Ht(f):{at:[0,0]});i[g]={...b,at:[b.at[0]+h[0],b.at[1]+h[1]]}}let d=a.buses;l.size>0&&(d=(a.buses??[]).map(g=>{const h=l.get(g.id);if(!h)return g;const f=g.layout??Ft(r.buses.get(g.id).geometry);return{...g,layout:{...f,at:[f.at[0]+h[0],f.at[1]+h[1]]}}}));let u=a.junctions;s.size>0&&(u=(a.junctions??[]).map(g=>{var b,y;const h=s.get(g.id);if(!h)return g;const f=((b=g.layout)==null?void 0:b.at)??((y=r.junctions.get(g.id))==null?void 0:y.world)??[0,0];return{...g,layout:{at:[f[0]+h[0],f[1]+h[1]]}}}));let m=a.annotations;o!=null&&o.size&&m&&(m=m.map(g=>{const h=o.get(g.id);return h?{...g,at:[g.at[0]+h[0],g.at[1]+h[1]]}:g}));const p=v6(a.wires,n);return{...a,layout:i,buses:d,junctions:u,wires:p,annotations:m}})},deleteSelection:()=>{const{selection:n,selectedAnnotations:o}=t();if(n.length===0&&o.length===0)return;const r=new Set(n),a=new Set(o);t().dispatch(i=>{const l=i.elements.filter(h=>!r.has(h.id)),s=(i.buses??[]).filter(h=>!r.has(h.id)),d=(i.junctions??[]).filter(h=>!r.has(h.id)),u=(i.wires??[]).filter(h=>!r.has(Rt(h.ends[0]))&&!r.has(Rt(h.ends[1]))),m=a.size?(i.annotations??[]).filter(h=>!a.has(h.id)):i.annotations,p=Ho(i.wires??[],u,d),g=i.layout?Object.fromEntries(Object.entries(i.layout).filter(([h])=>!r.has(h))):void 0;return A6({...i,elements:l,buses:s.length?s:void 0,junctions:p.length?p:void 0,wires:u.length?u:void 0,layout:g&&Object.keys(g).length?g:void 0,annotations:m!=null&&m.length?m:void 0},r)}),e({selection:[],selectedAnnotations:[],editingAnnotation:null,editingCell:null})},deleteSelectedWire:()=>{const{selectedWire:n,internal:o}=t();if(!n)return;const r=(t().diagram.wires??[]).find(i=>i.id===n),a=new Set;if(r)for(const i of r.ends){const l=i.indexOf(".");l>0&&a.add(i.slice(0,l))}t().dispatch(i=>{const l=i.wires??[],s=l.filter(m=>m.id!==n);if(s.length===l.length)return i;const d={...i.layout??{}};for(const m of a){if(d[m])continue;const p=o.layout.get(m);p&&(d[m]=Ht(p))}const u=Ho(l,s,i.junctions??[]);return{...i,wires:s.length?s:void 0,junctions:u.length?u:void 0,layout:Object.keys(d).length?d:void 0}}),e({selectedWire:null})},deleteSelectedNode:()=>{const{selectedNode:n,internal:o}=t();if(!n)return;const r=o.nodes.get(n);if(!r)return;const a=new Set(r.terminals),i=new Set;for(const l of r.terminals){const s=l.indexOf(".");s>0&&i.add(l.slice(0,s))}t().dispatch(l=>{const s={...l.layout??{}};for(const p of i){if(s[p])continue;const g=o.layout.get(p);g&&(s[p]=Ht(g))}const d=l.wires??[],u=d.filter(p=>!a.has(p.ends[0])&&!a.has(p.ends[1])),m=Ho(d,u,l.junctions??[]);return{...l,wires:u.length?u:void 0,junctions:m.length?m:void 0,layout:Object.keys(s).length?s:void 0}}),e({selectedNode:null})},rotateSelection:n=>{const{selection:o,internal:r}=t();o.length!==0&&t().dispatch(a=>{var d,u,m,p;const i={...a.layout??{}},l=new Map;for(const g of o){if(r.junctions.has(g))continue;if(r.buses.has(g)){const b=r.buses.get(g),w=(((((m=(u=(d=a.buses)==null?void 0:d.find(j=>j.id===g))==null?void 0:u.layout)==null?void 0:m.rot)??b.geometry.rot??0)+n)%360+360)%360;l.set(g,w);continue}const h=i[g]??{at:((p=r.layout.get(g))==null?void 0:p.at)??[0,0]},f=(((h.rot??0)+n)%360+360)%360;i[g]={...h,rot:f}}let s=a.buses;return l.size>0&&(s=(a.buses??[]).map(g=>{if(!l.has(g.id))return g;const h=g.layout??Ft(r.buses.get(g.id).geometry);return{...g,layout:{...h,rot:l.get(g.id)}}})),{...a,layout:i,buses:s}})},mirrorSelection:()=>{const{selection:n,internal:o}=t();n.length!==0&&t().dispatch(r=>{var i;const a={...r.layout??{}};for(const l of n){if(o.buses.has(l)||o.junctions.has(l))continue;const s=a[l]??{at:((i=o.layout.get(l))==null?void 0:i.at)??[0,0]};a[l]={...s,mirror:!(s.mirror??!1)}}return{...r,layout:a}})},setSelectionColor:n=>{var f,b,y;const{selection:o,selectedAnnotations:r,selectedWire:a}=t();if(o.length===0&&r.length===0&&a==null)return;const i=new Set(o),l=new Set(r),s=w=>{if(n==="default"){if(w.color===void 0)return w;const{color:j,..._}=w;return _}return w.color===n?w:{...w,color:n}},d=t().diagram,u=i.size?d.elements.map(w=>i.has(w.id)?s(w):w):d.elements,m=i.size?(f=d.buses)==null?void 0:f.map(w=>i.has(w.id)?s(w):w):d.buses,p=a?(b=d.wires)==null?void 0:b.map(w=>w.id===a?s(w):w):d.wires,g=l.size?(y=d.annotations)==null?void 0:y.map(w=>l.has(w.id)?s(w):w):d.annotations,h=(w,j)=>w===j||(w==null?void 0:w.length)===(j==null?void 0:j.length)&&(w??[]).every((_,E)=>_===(j==null?void 0:j[E]));h(u,d.elements)&&h(m,d.buses)&&h(p,d.wires)&&h(g,d.annotations)||t().dispatch(w=>({...w,elements:u,buses:m,wires:p,annotations:g}))},resetSelectionLabelOffset:()=>{const n=new Set(t().selection);n.size===0||!t().diagram.elements.some(r=>n.has(r.id)&&r.labelOffset!==void 0)||t().dispatch(r=>({...r,elements:r.elements.map(a=>{if(!n.has(a.id)||a.labelOffset===void 0)return a;const{labelOffset:i,...l}=a;return l})}))},addElement:(n,o,r)=>{if(n==="busbar")return t().addBus(o,320);const a=Sn(t().diagram,n);return t().dispatch(i=>{const l={id:a,kind:n,...r??{}};return{...i,elements:[...i.elements,l],layout:{...i.layout??{},[a]:{at:o}}}}),e({selection:[a]}),a},addBus:(n,o,r)=>{const a=cr(t().diagram);return t().dispatch(i=>{const l={id:a,layout:r!==void 0?{at:n,span:o,rot:r}:{at:n,span:o}};return{...i,buses:[...i.buses??[],l]}}),e({selection:[a]}),a},addJunction:n=>{const o=dr(t().diagram);return t().dispatch(r=>{const a={id:o,layout:{at:n}};return{...r,junctions:[...r.junctions??[],a]}}),e({selection:[o]}),o},updateJunction:(n,o)=>{t().dispatch(r=>({...r,junctions:(r.junctions??[]).map(a=>a.id===n?{...a,...o}:a)}))},addWire:(n,o)=>{if(n===o)return;const r=Dt(n,o);t().dispatch(a=>{const i=a.wires??[];return i.some(l=>l.id===r)?a:{...a,wires:[...i,{id:r,ends:[n,o]}]}})},connectWire:(n,o)=>{t().dispatch(r=>{let a=r;const i=new Set([...a.elements.map(h=>h.id),...(a.buses??[]).map(h=>h.id),...(a.junctions??[]).map(h=>h.id)]),l=()=>{let h=1;for(;i.has(`J${h}`);)h++;const f=`J${h}`;return i.add(f),f},s=h=>{const f=l();return a={...a,junctions:[...a.junctions??[],{id:f,layout:{at:h}}]},f},d=h=>{if("end"in h)return h.end;if("junctionAt"in h)return s(h.junctionAt);const f=(a.wires??[]).find(j=>j.id===h.onWire),b=s(h.at);if(!f)return b;const y=(a.wires??[]).filter(j=>j.id!==h.onWire),w=(j,_)=>({id:Dt(j,_),ends:[j,_],...f.label?{label:f.label}:{}});return a={...a,wires:za(y,[w(f.ends[0],b),w(b,f.ends[1])])},b},u=d(n),m=d(o);if(u===null||m===null||u===m)return a;const p=Dt(u,m),g=a.wires??[];return g.some(h=>h.id===p)?a:{...a,wires:[...g,{id:p,ends:[u,m]}]}})},updateWirePath:(n,o)=>{t().dispatch(r=>{const a=r.wires??[];if(!a.some(d=>d.id===n))return r;const i=o&&o.length>=2?fs(o):null,l=i&&i.length>=2?i:null,s=a.map(d=>{if(d.id!==n)return d;if(l)return{...d,path:l};const{path:u,...m}=d;return m});return{...r,wires:s}})},resetWirePath:n=>{t().updateWirePath(n,null)},updateWire:(n,o)=>{t().dispatch(r=>{const a=r.wires??[];return a.some(i=>i.id===n)?{...r,wires:a.map(i=>i.id===n?{...i,...o}:i)}:r})},setHealthDismissed:(n,o)=>{t().dispatch(r=>{var d;const a=new Set(((d=r.meta)==null?void 0:d.healthDismissed)??[]);if(o===a.has(n))return r;o?a.add(n):a.delete(n);const{healthDismissed:i,...l}=r.meta??{},s=a.size?{...l,healthDismissed:[...a].sort()}:l;return{...r,meta:Object.keys(s).length?s:void 0}})},changeKind:(n,o)=>{var d;const r=wt[o];if(!r)return;const a=new Set((r.params??[]).map(u=>u.name)),i=(d=t().diagram.elements.find(u=>u.id===n))==null?void 0:d.kind;if(!i||i===o)return;const l=Pr(o),s=!!(l!=null&&l.mirrorOnSwap)&&l.kinds.includes(i);t().dispatch(u=>{var b;const m=u.elements.map(y=>{if(y.id!==n)return y;const{state:w,params:j,..._}=y,E=Object.entries(j??{}).filter(([W])=>a.has(W));return E.length>0?{..._,kind:o,params:Object.fromEntries(E)}:{..._,kind:o}}),p=(b=u.layout)==null?void 0:b[n];if(!s||!p)return{...u,elements:m};const{mirror:g,...h}=p,f=g?h:{...h,mirror:!0};return{...u,elements:m,layout:{...u.layout,[n]:f}}})},updateElement:(n,o)=>{t().dispatch(r=>({...r,elements:r.elements.map(a=>a.id===n?{...a,...o}:a)}))},updatePlacement:(n,o)=>{t().dispatch(Ma(n,o,()=>t().internal))},previewPlacement:(n,o)=>{const{diagram:r,gestureBase:a}=t(),i=Ma(n,o,()=>t().internal)(r);i!==r&&e({diagram:i,internal:pt(i),gestureBase:a??r})},endGesture:n=>{const{diagram:o,gestureBase:r,past:a}=t();if(!r)return;if(!n||o===r){e({diagram:r,internal:pt(r),gestureBase:null});return}const i=a.length>=Pa?a.slice(1):a;e({past:[...i,r],future:[],gestureBase:null})},updateBus:(n,o)=>{t().dispatch(r=>{const a=(r.buses??[]).map(i=>{if(i.id!==n)return i;const l=t().internal,s=i.layout??(l.buses.has(n)?Ft(l.buses.get(n).geometry):{at:[0,0],span:320}),d={at:o.at??s.at,span:o.span??s.span,...o.rot!==void 0?{rot:o.rot}:s.rot?{rot:s.rot}:{}};return{...i,layout:d}});return{...r,buses:a}})},addAnnotation:(n,o="")=>{const r=fn(t().diagram);return t().dispatch(a=>{const i={id:r,at:n,text:o};return{...a,annotations:[...a.annotations??[],i]}}),r},insertAnnotation:n=>{const o=fn(t().diagram);return t().dispatch(r=>({...r,annotations:[...r.annotations??[],{...n,id:o}]})),o},updateAnnotation:(n,o)=>{t().dispatch(r=>{const a=r.annotations??[];let i=!1;const l=a.map(s=>s.id!==n?s:(i=!0,{...s,...o,id:s.id}));return i?{...r,annotations:l}:r})},removeCustomKind:n=>{const o=t().diagram,r=o.elements.filter(a=>a.kind===n).length;return r>0?r:((o.customKinds??[]).some(a=>a.id===n)&&t().dispatch(a=>{const i=(a.customKinds??[]).filter(l=>l.id!==n);return{...a,customKinds:i.length?i:void 0}},"remove custom kind"),0)},deleteAnnotation:n=>{var o;t().dispatch(r=>{const a=r.annotations??[],i=a.filter(l=>l.id!==n);return i.length===a.length?r:{...r,annotations:i.length?i:void 0}}),t().selectedAnnotations.includes(n)&&e({selectedAnnotations:t().selectedAnnotations.filter(r=>r!==n),editingAnnotation:null,editingCell:null}),((o=t().annotationPreview)==null?void 0:o.id)===n&&e({annotationPreview:null})}}),x=Nn()(w$(n_,{name:"ole-editor",version:2,storage:hs(()=>({getItem:e=>localStorage.getItem(e),setItem:(e,t)=>{x.getState().readOnly||localStorage.setItem(e,t)},removeItem:e=>localStorage.removeItem(e)})),partialize:e=>({diagram:e.diagram,activeTool:e.activeTool,placeKind:e.placeKind,lastPlaceKind:e.lastPlaceKind}),onRehydrateStorage:()=>e=>{e!=null&&e.diagram&&(e.internal=pt(e.diagram))}}));function o_(){return cs()(n_)}function Qt(e){return e.selectedAnnotations.length===1&&e.selection.length===0?e.selectedAnnotations[0]:null}function Ia(e){return Array.from(new Set(e))}function za(e,t){const n=new Set(e.map(r=>r.id)),o=e.slice();for(const r of t)n.has(r.id)||(n.add(r.id),o.push(r));return o}function Ht(e){return{at:[e.at[0],e.at[1]],...e.rot?{rot:e.rot}:{},...e.mirror?{mirror:e.mirror}:{},...r_(e.scale)}}function Ma(e,t,n){return o=>{var i;const r=((i=o.layout)==null?void 0:i[e])??n().layout.get(e),a={at:t.at??(r==null?void 0:r.at)??[0,0],...t.rot!==void 0?{rot:t.rot}:r!=null&&r.rot?{rot:r.rot}:{},...t.mirror!==void 0?{mirror:t.mirror}:r!=null&&r.mirror?{mirror:r.mirror}:{},...r_(t.scale!==void 0?t.scale:r==null?void 0:r.scale)};return{...o,layout:{...o.layout??{},[e]:a}}}}function r_(e){if(e===void 0)return{};const t=ar(e);return t===1?{}:{scale:t}}function Ft(e){return{at:[e.at[0],e.at[1]],span:e.span,...e.rot?{rot:e.rot}:{}}}const a_=$.createContext(null);function i_(){return $.useContext(a_)??x}function ye(e){return ds(i_(),e)}let s_=null;function Da(e){s_=e}function st(){return s_}const co=10;function l_(){if(typeof document>"u")return!0;const e=document.querySelector(".ole-canvas-root");return!!e&&!e.classList.contains("hide-grid")}function xe(e){return l_()?Math.round(e/co)*co:e}function rt(e){return[xe(e[0]),xe(e[1])]}const N6=30,T6=144;function c_(e,t){const n=wt[e],o=x.getState(),r=o.diagram;if(!n||e==="busbar")return{newElementId:o.addElement(e,t),attachedToBus:!1};const a=P6(r,t);if(!a){const f=d_(n),b=f?[xe(t[0])-f.x,xe(t[1])-f.y]:[xe(t[0]),xe(t[1])];return{newElementId:o.addElement(e,b),attachedToBus:!1}}const{busId:i,busAt:l,axis:s}=a,d=I6(n,s),u=Sn(r,e),m=n.terminals.find(f=>f.id===d),p=s==="x"?t[0]:l[0],g=s==="y"?t[1]:l[1],h=m?[xe(p)-m.x,xe(g)-m.y]:[xe(t[0]),xe(t[1])];return o.dispatch(f=>{const b={id:u,kind:e},y={at:h},w=`${u}.${d}`,j={id:Dt(i,w),ends:[i,w]};return{...f,elements:[...f.elements,b],wires:[...f.wires??[],j],layout:{...f.layout??{},[u]:y}}}),o.setSelection([u]),{newElementId:u,attachedToBus:!0}}function P6(e,t){const n=x.getState().internal;let o=null;for(const r of e.buses??[]){const a=n.buses.get(r.id);if(!a)continue;const{axis:i,at:l,span:s}=a.geometry;let d;if(i==="x"){const u=l[0]-s/2,m=l[0]+s/2,p=t[0]<u?u-t[0]:t[0]>m?t[0]-m:0,g=Math.abs(t[1]-l[1]);d=Math.sqrt(p*p+g*g)}else{const u=l[1]-s/2,m=l[1]+s/2,p=t[1]<u?u-t[1]:t[1]>m?t[1]-m:0,g=Math.abs(t[0]-l[0]);d=Math.sqrt(g*g+p*p)}d<=N6&&(!o||d<o.dist)&&(o={busId:r.id,busAt:[l[0],l[1]],axis:i,dist:d})}return o?{busId:o.busId,busAt:o.busAt,axis:o.axis}:null}function I6(e,t){return e.terminals.length===0?"t":[...e.terminals].sort((o,r)=>t==="x"?o.y-r.y:o.x-r.x)[0].id}function d_(e){return!e||e.stretchable||e.terminals.length===0?null:[...e.terminals].sort((n,o)=>n.y-o.y)[0]}function u_(e,t){const n=x.getState().internal;if(!e.includes(".")&&n.buses.has(e)){const r=n.buses.get(e),{axis:a,at:i,span:l}=r.geometry;if(a==="x"){const g=i[0]-l/2,h=i[0]+l/2,f=Math.max(g,Math.min(h,t[0])),b=i[1],y=t[1]>=b?"s":"n";return{ref:e,world:[f,b],orientation:y,isBus:!0,busId:e}}const s=i[1]-l/2,d=i[1]+l/2,u=Math.max(s,Math.min(d,t[1])),m=i[0],p=t[0]>=m?"e":"w";return{ref:e,world:[m,u],orientation:p,isBus:!0,busId:e}}if(!e.includes(".")&&n.junctions.has(e)){const r=n.junctions.get(e),[a,i]=r.world,l=t[0]-a,s=t[1]-i,d=Math.abs(l)>=Math.abs(s)?l>=0?"e":"w":s>=0?"s":"n";return{ref:e,world:[a,i],orientation:d,isBus:!1}}const o=n.terminals.get(e);return o?{ref:e,world:o.world,orientation:o.orientation,isBus:!1}:null}const z6={n:"s",s:"n",e:"w",w:"e"};function m_(e,t,n){if(e.terminals.length===0)return{id:"t",x:0,y:0,orientation:"n"};const o=z6[t.orientation],r=e.terminals.filter(s=>s.orientation===o),a=r.length>0?r:e.terminals;let i=a[0],l=Oa(i,n,t.world);for(let s=1;s<a.length;s++){const d=a[s],u=Oa(d,n,t.world);u<l&&(l=u,i=d)}return i}function Oa(e,t,n){const o=t[0]+e.x-n[0],r=t[1]+e.y-n[1];return o*o+r*r}function M6(e,t,n){const o=wt[e],r=x.getState(),a=r.diagram;if(!o)return null;const i=u_(t,n);if(!i)return null;const l=n[0]-i.world[0],s=n[1]-i.world[1],d=l*l+s*s<=T6,u=[xe(n[0]),xe(n[1])],m=m_(o,i,u),p=d?i.world:u,g=[xe(p[0]-m.x),xe(p[1]-m.y)],h=Sn(a,e);return r.dispatch(f=>{const b={id:h,kind:e},y={at:g},w=`${h}.${m.id}`,j=i.isBus&&i.busId?i.busId:t,_={id:Dt(j,w),ends:[j,w]};return{...f,elements:[...f.elements,b],wires:[...f.wires??[],_],layout:{...f.layout??{},[h]:y}}}),r.setSelection([h]),{newElementId:h,attachedToBus:i.isBus}}const D6=9,ht=7,xo=5,wo=32;function Jt(e){return typeof e!="number"||!Number.isFinite(e)?ht:Math.min(wo,Math.max(xo,e))}function Pn(e=ht){return e*D6/ht}function vo(e,t){const n=(e??"").split(/\r\n|\r|\n/).map(o=>o.trim()).filter(o=>o!=="");return n.length>0?n:t?[t]:[]}function ko(e,t){var r;if(e.element.labelHidden)return[];const n=vo(e.element.name,e.element.id);if(t!=="all"||!((r=e.libraryDef)!=null&&r.params))return n;const o=e.element.params??{};for(const a of e.libraryDef.params){if(!a.showOnCanvas)continue;const i=o[a.name];i==null||i===""||n.push(`${i}${a.unit??""}`)}return n}function So(e,t=ht){const n=p_(e.viewBox);return n?{x:n.x+n.w+2,y:n.y+n.h/2+t/3,anchor:"start"}:{x:0,y:0,anchor:"start"}}function O6(e,t){const n=t.scale??1;let o=e.x*n,r=e.y*n;switch(t.mirror&&(o=-o),t.rot){case 90:[o,r]=[-r,o];break;case 180:[o,r]=[-o,-r];break;case 270:[o,r]=[r,-o];break}return[o+t.at[0],r+t.at[1]]}function _o(e,t,n,o,r=ht,a){const i=O6(e,n);a&&(i[0]+=a[0],i[1]+=a[1]);const l=e.anchor??"start",s=p_(t.viewBox);let d=e.x-(s?s.x+s.w/2:0),u=e.y-(s?s.y+s.h/2:0);switch(n.mirror&&(d=-d),n.rot){case 90:[d,u]=[-u,d];break;case 180:[d,u]=[-d,-u];break;case 270:[d,u]=[u,-d];break}return Math.abs(d)<1e-6&&Math.abs(u)<1e-6?{world:i,textAnchor:l,dy:0}:Math.abs(d)>=Math.abs(u)?{world:i,textAnchor:d>=0?"start":"end",dy:0}:u>0?{world:i,textAnchor:"middle",dy:r}:{world:i,textAnchor:"middle",dy:-(o-1)*Pn(r)}}function ur(e,t){let n=0;for(const o of e){const r=o.length*t*.55;r>n&&(n=r)}return Math.max(20,n)}function p_(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}const R6=8;function Co(e,t=ht){if(e.length<2)return null;let n=-1,o=0;for(let m=0;m<e.length-1;m++){const p=Math.hypot(e[m+1][0]-e[m][0],e[m+1][1]-e[m][1]);p>o&&(o=p,n=m)}if(n<0||o<=0)return null;const[r,a]=e[n],[i,l]=e[n+1],s=(r+i)/2,d=(a+l)/2,u=R6*t/ht;return Math.abs(i-r)>=Math.abs(l-a)?{world:[s,d-u],textAnchor:"middle"}:{world:[s+u,d+t/3],textAnchor:"start"}}const jo={default:{light:"black",dark:"#E5E7EB",aci:7},red:{light:"#C0392B",dark:"#FF6B6B",aci:1},blue:{light:"#1F6FEB",dark:"#58A6FF",aci:5},green:{light:"#197D3F",dark:"#4ADE80",aci:3},amber:{light:"#B45309",dark:"#FBBF24",aci:30},gray:{light:"#6B7280",dark:"#9CA3AF",aci:8}},Mr=["default","red","amber","green","blue","gray"];function Dr(e){return e!==void 0&&e in jo}function Qe(e){return Dr(e)&&e!=="default"?`ole-ink-${e}`:void 0}function dt(e){return Dr(e)?jo[e].light:"black"}function Gt(e){return Dr(e)&&e!=="default"?jo[e].aci:void 0}const mr={props:{},units:{}},h_=$.createContext(mr);function en(){return $.useContext(h_)}const Ra={none:0,warn:1,alarm:2,fault:3};function L6(e,t){const n=e??"none",o=t??"none";return Ra[n]>=Ra[o]?n:o}function Or(e){return e!=null&&e.alarm&&e.alarm!=="none"?e.alarm:void 0}function f_(e){return(e==null?void 0:e.quality)==="bad"||(e==null?void 0:e.quality)==="stale"?e.quality:void 0}function g_(){const e=ye(s=>s.internal.elements),t=ye(s=>s.internal.layout),n=ye(s=>s.internal.wireRenders),o=ye(s=>{var d;return((d=s.diagram.meta)==null?void 0:d.labelMode)??"all"}),r=ye(s=>{var d;return Jt((d=s.diagram.meta)==null?void 0:d.labelFontSize)}),a=ye(s=>s.editingElement),i=en().props,l=Pn(r);return c.jsxs("g",{className:"ole-annotation-layer",pointerEvents:"none",style:{"--ole-label-font-size":`${r}px`},children:[Array.from(e.values()).map(s=>{var w;const d=t.get(s.element.id);if(!d||!s.libraryDef)return null;const u=i[s.element.id];if((u==null?void 0:u.visible)===!1)return null;const m=s.libraryDef.label??So(s.libraryDef,r),p=(u==null?void 0:u.labelText)!==void 0?vo(u.labelText,""):ko(s,o),{world:g,textAnchor:h,dy:f}=_o(m,s.libraryDef,d,Math.max(1,p.length),r,s.element.labelOffset);if(a===s.element.id)return c.jsx(H6,{elementId:s.element.id,currentName:((w=s.element.name)==null?void 0:w.trim())||s.element.id,world:g,anchor:h,fontSize:r},s.element.id);if(o==="off"||p.length===0)return null;const b=ur(p,r),y=h==="middle"?-b/2:h==="end"?-b:0;return c.jsx("g",{className:"ole-annotation ole-element-label","data-element-label":s.element.id,transform:`translate(${g[0]} ${g[1]})`,children:c.jsxs("g",{"data-element-label-body":"",children:[c.jsx("rect",{className:"ole-element-label-hit",x:y-2,y:f-r,width:b+4,height:p.length*l+r*.4}),p.map((j,_)=>c.jsx("text",{x:0,y:f+_*l,textAnchor:h,className:"ole-annotation-text",children:j},_))]})},s.element.id)}),o!=="off"&&Array.from(n.values()).map(s=>{var m;const d=(m=s.label)==null?void 0:m.trim();if(!d)return null;const u=Co(s.path,r);return u?c.jsx("text",{"data-wire-label":s.wireId,x:u.world[0],y:u.world[1],textAnchor:u.textAnchor,className:[Qe(s.color),"ole-annotation-text"].filter(Boolean).join(" "),children:d},`wire-${s.wireId}`):null})]})}const Wo=200,B6=9;function H6({elementId:e,currentName:t,world:n,anchor:o,fontSize:r}){const a=Math.max(B6,r),i=$.useRef(null),[l,s]=$.useState(()=>Math.max(1,t.split(`
228
+ `).length));$.useEffect(()=>{const p=i.current;if(!p)return;p.focus();const g=document.createRange();g.selectNodeContents(p);const h=window.getSelection();h==null||h.removeAllRanges(),h==null||h.addRange(g)},[e]);function d(){var y;const p=x.getState(),g=p.diagram.elements.find(w=>w.id===e);if(!g){p.setEditingElement(null);return}const h=(((y=i.current)==null?void 0:y.innerText)??"").replace(/\u00a0/g," "),f=vo(h,"").join(`
229
+ `),b=f===""||f===e?void 0:f;b!==g.name&&p.updateElement(e,{name:b}),p.setEditingElement(null)}function u(p){if(p.key==="Escape"||p.key==="Enter"&&(p.metaKey||p.ctrlKey)){p.preventDefault(),d();return}p.stopPropagation()}let m=n[0];return o==="middle"?m-=Wo/2:o==="end"&&(m-=Wo),c.jsx("foreignObject",{x:m,y:n[1]-a,width:Wo,height:a*1.3*l+a,className:"ole-element-name-editor",children:c.jsx("div",{ref:i,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:d,onKeyDown:u,onInput:()=>{var p;return s(Math.max(1,(((p=i.current)==null?void 0:p.innerText)??"").split(`
230
+ `).length))},onPointerDown:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),style:{fontSize:`${a}px`,fontFamily:"ui-sans-serif, system-ui, sans-serif",color:"var(--foreground)",background:"var(--canvas-bg)",outline:"1px dashed var(--selection)",padding:"0 2px",display:"inline-block",minWidth:"20px",lineHeight:1.1,textAlign:o==="middle"?"center":o==="end"?"right":"left",whiteSpace:"pre-wrap",cursor:"text"},children:t})})}const ct=8,F6=1.25,b_="6 4",W6="1 3";function $o(e){if(e==="dashed")return b_;if(e==="dotted")return W6}function tn(e){return e??1}const y_=.05,La=8,Hn=3,$t=4,_n=3,Cn=60,jn=20,pr=16,hr=12,Ut=10,q6=10;function V6(e,t){const n=e===""?[""]:e.split(`
231
+ `);return[Math.max(20,...n.map(r=>r.length*t*.55)),n.length*t*F6]}function In(e){return e.points.map(([t,n])=>[e.at[0]+t,e.at[1]+n])}function Rr(e,t){if(!t||t==="none"||e.length<2)return[];const n=[];return(t==="end"||t==="both")&&n.push(Ba(e[e.length-2],e[e.length-1])),t==="both"&&n.push(Ba(e[1],e[0])),n}function Ba(e,t){const n=t[0]-e[0],o=t[1]-e[1],r=Math.hypot(n,o)||1,a=n/r,i=o/r,l=t[0]-a*La,s=t[1]-i*La,d=-i,u=a;return[t,[l+d*Hn,s+u*Hn],[l-d*Hn,s-u*Hn]]}function Lr(e){const[t,n]=e.at,[o,r]=e.size;return{cx:t+o/2,cy:n+r/2,rx:o/2,ry:r/2}}function G6(e,t=48){const{cx:n,cy:o,rx:r,ry:a}=Lr(e),i=[];for(let l=0;l<t;l++){const s=l/t*Math.PI*2;i.push([n+r*Math.cos(s),o+a*Math.sin(s)])}return i}function vt(e){return[Fa(e.colWidths),Fa(e.rowHeights)]}function nn(e){return x_(e.colWidths)}function on(e){return x_(e.rowHeights)}function K6(e,t){const n=t[0]-e.at[0],o=t[1]-e.at[1],[r,a]=vt(e);if(n<0||o<0||n>r||o>a)return null;const i=Ha(nn(e),n),l=Ha(on(e),o);return i===null||l===null?null:[l,i]}function Ha(e,t){for(let n=0;n<e.length-1;n++)if(t>=e[n]&&t<=e[n+1])return n;return null}function x_(e){const t=[0];let n=0;for(const o of e)n+=o,t.push(n);return t}function Fa(e){return e.reduce((t,n)=>t+n,0)}function uo(e){let t=e.current[0]-e.start[0],n=e.current[1]-e.start[1];if(e.constrain){const r=Math.max(Math.abs(t),Math.abs(n));t=Math.sign(t||1)*r,n=Math.sign(n||1)*r}return{at:[Math.min(e.start[0],e.start[0]+t),Math.min(e.start[1],e.start[1]+n)],size:[Math.abs(t),Math.abs(n)]}}function w_(e){return e.constrain?v_(e.start,e.current):e.current}function v_(e,t){const n=t[0]-e[0],o=t[1]-e[1],r=Math.hypot(n,o);if(r===0)return t;const a=Math.PI/4,i=Math.round(Math.atan2(o,n)/a)*a;return[e[0]+Math.cos(i)*r,e[1]+Math.sin(i)*r]}function k_(e){const t=Math.abs(e.current[0]-e.start[0]),n=Math.abs(e.current[1]-e.start[1]),o=Math.min(30,Math.max(1,Math.round(t/Cn))),r=Math.min(60,Math.max(1,Math.round(n/jn)));return{at:[Math.min(e.start[0],e.current[0]),Math.min(e.start[1],e.current[1])],cols:o,rows:r}}function S_(e,t){return{colWidths:Array.from({length:e},()=>Cn),rowHeights:Array.from({length:t},()=>jn),cells:Array.from({length:t},()=>Array.from({length:e},()=>""))}}function __(e){switch(e.type){case"rect":case"ellipse":{const t=e;return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+t.size[0],maxY:t.at[1]+t.size[1]}}case"line":{const t=In(e),n=t.map(r=>r[0]),o=t.map(r=>r[1]);return{minX:Math.min(...n),minY:Math.min(...o),maxX:Math.max(...n),maxY:Math.max(...o)}}case"table":{const t=e,[n,o]=vt(t);return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+n,maxY:t.at[1]+o}}default:{const t=e,n=t.fontSize??ct,[o,r]=V6(t.text,n);return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+o,maxY:t.at[1]+r}}}}const Xt=ct,mo=1.25;function C_(){const e=ye(i=>i.diagram.annotations),t=ye(i=>i.selectedAnnotations),n=ye(i=>i.editingAnnotation),o=ye(i=>i.editingCell),r=ye(i=>i.annotationPreview);if(!e||e.length===0)return null;const a=new Set(t);return c.jsx("g",{className:"ole-free-annotation-layer",children:e.map(i=>{const l=(r==null?void 0:r.id)===i.id?r:i,s=a.has(i.id);switch(ut(l)){case"rect":return c.jsx(U6,{ann:l,isSelected:s},i.id);case"ellipse":return c.jsx(X6,{ann:l,isSelected:s},i.id);case"line":return c.jsx(Y6,{ann:l,isSelected:s},i.id);case"table":return c.jsx(Z6,{ann:l,isSelected:s,editingCell:n===i.id?o:null},i.id);default:return n===i.id?c.jsx(eT,{ann:l},i.id):c.jsx(J6,{ann:l,isSelected:s},i.id)}})})}function U6({ann:e,isSelected:t}){const[n,o]=e.at,[r,a]=e.size;return c.jsxs("g",{"data-annotation-id":e.id,className:zn("ole-ann ole-ann-rect",Qe(e.color)),"data-selected":t?"true":void 0,children:[e.fill==="tint"&&c.jsx("rect",{className:"ole-ann-fill",x:n,y:o,width:r,height:a}),c.jsx("rect",{className:"ole-ann-shape-hit",x:n,y:o,width:r,height:a}),c.jsx("rect",{className:"ole-ann-rect-border",x:n,y:o,width:r,height:a,strokeDasharray:$o(e.stroke??"dashed"),strokeWidth:tn(e.strokeWidth)}),c.jsx(j_,{ann:e})]})}function X6({ann:e,isSelected:t}){const{cx:n,cy:o,rx:r,ry:a}=Lr(e);return c.jsxs("g",{"data-annotation-id":e.id,className:zn("ole-ann ole-ann-ellipse",Qe(e.color)),"data-selected":t?"true":void 0,children:[e.fill==="tint"&&c.jsx("ellipse",{className:"ole-ann-fill",cx:n,cy:o,rx:r,ry:a}),c.jsx("ellipse",{className:"ole-ann-shape-hit",cx:n,cy:o,rx:r,ry:a}),c.jsx("ellipse",{className:"ole-ann-rect-border",cx:n,cy:o,rx:r,ry:a,strokeDasharray:$o(e.stroke),strokeWidth:tn(e.strokeWidth)}),c.jsx(j_,{ann:e})]})}function j_({ann:e}){return e.label?c.jsx("text",{className:"ole-ann-label",x:e.at[0]+$t,y:e.at[1]+$t+Xt*.85,fontSize:Xt,children:e.label}):null}function zn(...e){return e.filter(Boolean).join(" ")}function Y6({ann:e,isSelected:t}){const n=In(e),o=n.map(r=>`${r[0]},${r[1]}`).join(" ");return c.jsxs("g",{"data-annotation-id":e.id,className:zn("ole-ann ole-ann-line-group",Qe(e.color)),"data-selected":t?"true":void 0,children:[c.jsx("polyline",{className:"ole-ann-shape-hit",points:o}),c.jsx("polyline",{className:"ole-ann-line",points:o,strokeDasharray:$o(e.stroke),strokeWidth:tn(e.strokeWidth)}),Rr(n,e.arrow).map((r,a)=>c.jsx("polygon",{className:"ole-ann-arrow",points:r.map(i=>`${i[0]},${i[1]}`).join(" ")},a))]})}function Z6({ann:e,isSelected:t,editingCell:n}){var g;const[o,r]=e.at,[a,i]=vt(e),l=nn(e),s=on(e),d=e.fontSize??Xt;let u="";for(let h=1;h<e.colWidths.length;h++)u+=`M${o+l[h]} ${r}V${r+i}`;for(let h=1;h<e.rowHeights.length;h++)u+=`M${o} ${r+s[h]}H${o+a}`;const m=[],p=[];for(let h=0;h<e.rowHeights.length;h++)for(let f=0;f<e.colWidths.length;f++){const b=((g=e.cells[h])==null?void 0:g[f])??"";if(b==="")continue;const y=e.colWidths[f],w=o+l[f]+_n,j=r+s[h]+e.rowHeights[h]/2+d*.35,_=b.length*d*.55>y-2*_n,E=`ole-ann-clip-${e.id}-${h}-${f}`;_&&p.push(c.jsx("clipPath",{id:E,children:c.jsx("rect",{x:o+l[f],y:r+s[h],width:y,height:e.rowHeights[h]})},E)),m.push(c.jsx("text",{className:"ole-ann-table-text",x:w,y:j,fontSize:d,clipPath:_?`url(#${E})`:void 0,children:b},`${h}-${f}`))}return c.jsxs("g",{"data-annotation-id":e.id,className:zn("ole-ann ole-ann-table",Qe(e.color)),"data-selected":t?"true":void 0,children:[p.length>0&&c.jsx("defs",{children:p}),c.jsx("rect",{className:"ole-ann-table-bg",x:o,y:r,width:a,height:i}),u&&c.jsx("path",{className:"ole-ann-table-grid",d:u}),c.jsx("rect",{className:"ole-ann-table-border",x:o,y:r,width:a,height:i}),m,n&&c.jsx(Q6,{ann:e,cell:n})]})}function Q6({ann:e,cell:t}){var g;const[n,o]=t,r=$.useRef(null),a=nn(e),i=on(e),l=e.fontSize??Xt,s=((g=e.cells[n])==null?void 0:g[o])??"";$.useEffect(()=>{const h=r.current;h&&(h.focus(),h.select())},[n,o]);function d(){var b;const h=x.getState(),f=((b=r.current)==null?void 0:b.value)??"";if(f!==s){const y=e.cells.map(w=>[...w]);for(;y.length<=n;)y.push([]);y[n][o]=f,h.updateAnnotation(e.id,{cells:y})}}function u(){x.getState().setEditingAnnotation(null)}function m(h,f){const b=e.rowHeights.length,y=e.colWidths.length;if(f>=y?(f=0,h+=1):f<0&&(f=y-1,h-=1),h<0||h>=b){u();return}x.getState().setEditingCell([h,f])}function p(h){if(h.key==="Enter"){h.preventDefault(),d(),m(n+1,o);return}if(h.key==="Tab"){h.preventDefault(),d(),m(n,h.shiftKey?o-1:o+1);return}if(h.key==="Escape"){h.preventDefault(),r.current&&(r.current.value=s),d(),u();return}h.stopPropagation()}return c.jsx("foreignObject",{x:e.at[0]+a[o],y:e.at[1]+i[n],width:e.colWidths[o],height:e.rowHeights[n],className:"ole-ann-cell-edit-fo",children:c.jsx("input",{ref:r,defaultValue:s,onBlur:()=>{d(),u()},onKeyDown:p,onPointerDown:h=>h.stopPropagation(),onMouseDown:h=>h.stopPropagation(),style:{width:"100%",height:"100%",boxSizing:"border-box",border:"1px solid var(--selection)",outline:"none",background:"var(--canvas-bg)",color:"var(--foreground)",font:`${l}px ui-sans-serif, system-ui, sans-serif`,padding:`0 ${_n}px`}},`${n}-${o}`)})}function J6({ann:e,isSelected:t}){const n=e.fontSize??Xt,o=e.text===""?[""]:e.text.split(`
232
+ `),r=Math.max(20,...o.map(i=>i.length*n*.55)),a=o.length*n*mo;return c.jsxs("g",{"data-annotation-id":e.id,className:zn("ole-free-annotation",Qe(e.color)),"data-selected":t?"true":void 0,children:[c.jsx("rect",{x:e.at[0]-1,y:e.at[1]-1,width:r+2,height:a+2,fill:"transparent",className:"ole-free-annotation-hit"}),t&&c.jsx("rect",{x:e.at[0]-1,y:e.at[1]-1,width:r+2,height:a+2,className:"ole-free-annotation-halo"}),o.map((i,l)=>c.jsx("text",{x:e.at[0],y:e.at[1]+n*.85+l*n*mo,fontSize:n,className:"ole-free-annotation-text",children:i},l))]})}function eT({ann:e}){const t=$.useRef(null),n=e.fontSize??Xt;$.useEffect(()=>{const l=t.current;if(!l)return;l.focus();const s=document.createRange();s.selectNodeContents(l);const d=window.getSelection();d==null||d.removeAllRanges(),d==null||d.addRange(s)},[e.id]);function o(){var d;const l=x.getState(),s=(((d=t.current)==null?void 0:d.innerText)??"").replace(/\u00a0/g," ").trimEnd();s===""?l.deleteAnnotation(e.id):s!==e.text&&l.updateAnnotation(e.id,{text:s}),l.setEditingAnnotation(null),s!==""&&l.setSelectedAnnotation(e.id),l.activeTool==="text"&&l.setActiveTool("select")}function r(l){if(l.key==="Escape"){l.preventDefault(),t.current&&(t.current.innerText=e.text),o();return}if(l.key==="Enter"&&!l.shiftKey){l.preventDefault(),o();return}l.stopPropagation()}return c.jsx("foreignObject",{x:e.at[0],y:e.at[1],width:320,height:200,"data-annotation-id":e.id,className:"ole-free-annotation-edit-fo",children:c.jsx("div",{ref:t,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:o,onKeyDown:r,onPointerDown:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),style:{fontSize:`${n}px`,lineHeight:mo,fontFamily:"ui-sans-serif, system-ui, sans-serif",color:"var(--foreground)",background:"var(--canvas-bg)",outline:"1px dashed var(--selection)",padding:"0 2px",minWidth:`${n}px`,minHeight:`${n*mo}px`,whiteSpace:"pre-wrap",wordBreak:"break-word",cursor:"text"},children:e.text})})}function tT(){const e=x(l=>l.annotationDraft);if(!e)return null;if(e.kind==="rect"){const{at:l,size:s}=uo(e);return c.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:c.jsx("rect",{x:l[0],y:l[1],width:s[0],height:s[1],strokeDasharray:b_})})}if(e.kind==="ellipse"){const{at:l,size:s}=uo(e);return c.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:c.jsx("ellipse",{cx:l[0]+s[0]/2,cy:l[1]+s[1]/2,rx:s[0]/2,ry:s[1]/2})})}if(e.kind==="line"){const l=w_(e);return c.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:c.jsx("line",{x1:e.start[0],y1:e.start[1],x2:l[0],y2:l[1]})})}const{at:t,cols:n,rows:o}=k_(e),r=n*Cn,a=o*jn,i=[];for(let l=1;l<n;l++){const s=t[0]+l*Cn;i.push(c.jsx("line",{x1:s,y1:t[1],x2:s,y2:t[1]+a},`c${l}`))}for(let l=1;l<o;l++){const s=t[1]+l*jn;i.push(c.jsx("line",{x1:t[0],y1:s,x2:t[0]+r,y2:s},`r${l}`))}return c.jsxs("g",{className:"ole-ann-draft",pointerEvents:"none",children:[c.jsx("rect",{x:t[0],y:t[1],width:r,height:a}),i,c.jsxs("text",{className:"ole-ann-draft-badge",x:e.current[0]+12,y:e.current[1]-8,children:[n," × ",o]})]})}const Fn=7,po=3;function nT(){const e=x(Qt),t=x(i=>i.diagram.annotations),n=x(i=>i.annotationPreview);if(x(i=>i.readOnly)||!e)return null;const r=(t??[]).find(i=>i.id===e);if(!r)return null;const a=(n==null?void 0:n.id)===e?n:r;switch(ut(a)){case"rect":case"ellipse":return c.jsx(oT,{ann:a,model:r});case"table":return c.jsx(aT,{ann:a,model:r});case"line":return c.jsx(cT,{ann:a,model:r});default:return null}}function Mn(e,t,n){const o=$.useRef(null);return{onPointerDown:s=>{if(s.button!==0)return;s.stopPropagation(),s.preventDefault();const d=st();d&&(o.current={pointerId:s.pointerId,startSvg:d.screenToSvg(s.clientX,s.clientY),orig:structuredClone(e)},s.target.setPointerCapture(s.pointerId))},onPointerMove:s=>{const d=o.current,u=st();if(!d||s.pointerId!==d.pointerId||!u)return;const m=u.screenToSvg(s.clientX,s.clientY),p=xe(m[0]-d.startSvg[0]),g=xe(m[1]-d.startSvg[1]);x.getState().setAnnotationPreview(t(d.orig,p,g,s.nativeEvent))},onPointerUp:s=>{const d=o.current;if(!d||s.pointerId!==d.pointerId)return;o.current=null;const u=s.target;u.hasPointerCapture(s.pointerId)&&u.releasePointerCapture(s.pointerId);const m=x.getState(),p=m.annotationPreview;m.setAnnotationPreview(null),p&&p.id===e.id&&m.updateAnnotation(e.id,n(p))},onPointerCancel:s=>{const d=o.current;!d||s.pointerId!==d.pointerId||(o.current=null,x.getState().setAnnotationPreview(null))}}}function $_(e,t,n,o,r,a,i,l){let[s,d]=e,[u,m]=t;return n===1&&(u=Math.max(i,t[0]+r)),n===-1&&(u=Math.max(i,t[0]-r),s=e[0]+t[0]-u),o===1&&(m=Math.max(l,t[1]+a)),o===-1&&(m=Math.max(l,t[1]-a),d=e[1]+t[1]-m),{at:[s,d],size:[u,m]}}const A_=[{dirX:-1,dirY:-1,cursor:"nwse-resize"},{dirX:0,dirY:-1,cursor:"ns-resize"},{dirX:1,dirY:-1,cursor:"nesw-resize"},{dirX:1,dirY:0,cursor:"ew-resize"},{dirX:1,dirY:1,cursor:"nwse-resize"},{dirX:0,dirY:1,cursor:"ns-resize"},{dirX:-1,dirY:1,cursor:"nesw-resize"},{dirX:-1,dirY:0,cursor:"ew-resize"}];function E_(e,t,n,o){const r=n===-1?e[0]:n===1?e[0]+t[0]:e[0]+t[0]/2,a=o===-1?e[1]:o===1?e[1]+t[1]:e[1]+t[1]/2;return[r,a]}function N_({pos:e,cursor:t,handlers:n}){return c.jsx("rect",{className:"ole-annotation-handle",x:e[0]-Fn/2,y:e[1]-Fn/2,width:Fn,height:Fn,style:{cursor:t},onPointerDown:n.onPointerDown,onPointerMove:n.onPointerMove,onPointerUp:n.onPointerUp,onPointerCancel:n.onPointerCancel})}function oT({ann:e,model:t}){return c.jsx("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:A_.map((n,o)=>c.jsx(rT,{grip:n,ann:e,model:t},o))})}function rT({grip:e,ann:t,model:n}){const o=Mn(n,(r,a,i)=>{const l=$_(r.at,r.size,e.dirX,e.dirY,a,i,Ut,Ut);return{...r,at:l.at,size:l.size}},r=>({at:r.at,size:r.size}));return c.jsx(N_,{pos:E_(t.at,t.size,e.dirX,e.dirY),cursor:e.cursor,handlers:o})}function aT({ann:e,model:t}){const n=vt(e),o=nn(e),r=on(e);return c.jsxs("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:[o.slice(1,-1).map((a,i)=>c.jsx(sT,{index:i,x:e.at[0]+a,ann:e,model:t},`c${i}`)),r.slice(1,-1).map((a,i)=>c.jsx(lT,{index:i,y:e.at[1]+a,ann:e,model:t},`r${i}`)),A_.map((a,i)=>c.jsx(iT,{grip:a,ann:e,model:t,size:n},i))]})}function iT({grip:e,ann:t,model:n,size:o}){const r=Mn(n,(a,i,l)=>{const s=vt(a),d=$_(a.at,s,e.dirX,e.dirY,i,l,pr*a.colWidths.length,hr*a.rowHeights.length),u=Wa(a.colWidths,d.size[0]/s[0],pr),m=Wa(a.rowHeights,d.size[1]/s[1],hr),p=u.reduce((f,b)=>f+b,0),g=m.reduce((f,b)=>f+b,0),h=[e.dirX===-1?a.at[0]+s[0]-p:a.at[0],e.dirY===-1?a.at[1]+s[1]-g:a.at[1]];return{...a,at:h,colWidths:u,rowHeights:m}},a=>({at:a.at,colWidths:a.colWidths,rowHeights:a.rowHeights}));return c.jsx(N_,{pos:E_(t.at,o,e.dirX,e.dirY),cursor:e.cursor,handlers:r})}function Wa(e,t,n){return e.map(o=>Math.max(n,Math.round(o*t)))}function sT({index:e,x:t,ann:n,model:o}){const[,r]=vt(n),a=Mn(o,(i,l)=>{const s=[...i.colWidths];return s[e]=Math.max(pr,i.colWidths[e]+l),{...i,colWidths:s}},i=>({colWidths:i.colWidths}));return c.jsx("rect",{className:"ole-annotation-handle ole-annotation-handle-strip",x:t-po,y:n.at[1],width:po*2,height:r,style:{cursor:"col-resize"},onPointerDown:a.onPointerDown,onPointerMove:a.onPointerMove,onPointerUp:a.onPointerUp,onPointerCancel:a.onPointerCancel})}function lT({index:e,y:t,ann:n,model:o}){const[r]=vt(n),a=Mn(o,(i,l,s)=>{const d=[...i.rowHeights];return d[e]=Math.max(hr,i.rowHeights[e]+s),{...i,rowHeights:d}},i=>({rowHeights:i.rowHeights}));return c.jsx("rect",{className:"ole-annotation-handle ole-annotation-handle-strip",x:n.at[0],y:t-po,width:r,height:po*2,style:{cursor:"row-resize"},onPointerDown:a.onPointerDown,onPointerMove:a.onPointerMove,onPointerUp:a.onPointerUp,onPointerCancel:a.onPointerCancel})}function cT({ann:e,model:t}){const n=In(e);return c.jsx("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:n.map((o,r)=>c.jsx(dT,{index:r,pos:o,model:t},r))})}function dT({index:e,pos:t,model:n}){const o=Mn(n,(r,a,i,l)=>{const s=r.points.map(u=>[...u]);let d=[r.points[e][0]+a,r.points[e][1]+i];if(l.shiftKey){const u=r.points[e-1]??r.points[e+1]??[0,0];d=v_(u,d)}return s[e]=d,{...r,points:s}},r=>({points:r.points}));return c.jsx("circle",{className:"ole-annotation-handle",cx:t[0],cy:t[1],r:4.5,style:{cursor:"move"},onPointerDown:o.onPointerDown,onPointerMove:o.onPointerMove,onPointerUp:o.onPointerUp,onPointerCancel:o.onPointerCancel})}const uT=20;function mT(){const e=x(u=>u.selection),t=x(u=>u.internal);if(e.length!==1)return null;const n=e[0],o=t.buses.get(n);if(!o)return null;const{axis:r,at:a,span:i}=o.geometry,l=i/2,s=r==="x"?[a[0]-l,a[1]]:[a[0],a[1]-l],d=r==="x"?[a[0]+l,a[1]]:[a[0],a[1]+l];return c.jsxs("g",{className:"ole-bus-handles",pointerEvents:"auto",children:[c.jsx(qa,{x:s[0],y:s[1],busId:n,side:"start",axis:r}),c.jsx(qa,{x:d[0],y:d[1],busId:n,side:"end",axis:r})]})}function qa({x:e,y:t,busId:n,side:o,axis:r}){const a=st(),i=$.useRef(null),l=u=>{if(u.button!==0||(u.stopPropagation(),u.preventDefault(),!a))return;const m=x.getState().internal.buses.get(n);m&&(i.current={pointerId:u.pointerId,startSpan:m.geometry.span,startAt:[...m.geometry.at],startSvg:a.screenToSvg(u.clientX,u.clientY)},u.target.setPointerCapture(u.pointerId))},s=u=>{const m=i.current;if(!m||u.pointerId!==m.pointerId||!a)return;const p=a.screenToSvg(u.clientX,u.clientY),g=r==="x"?p[0]-m.startSvg[0]:p[1]-m.startSvg[1],h=l_()?Math.round(g/co)*co:g,f=m.startSpan+(o==="end"?h:-h);if(f<uT)return;const b=r==="x"?[m.startAt[0]+h/2,m.startAt[1]]:[m.startAt[0],m.startAt[1]+h/2];x.getState().updateBus(n,{span:f,at:b})},d=u=>{const m=i.current;!m||u.pointerId!==m.pointerId||(u.target.hasPointerCapture(u.pointerId)&&u.target.releasePointerCapture(u.pointerId),i.current=null)};return c.jsx("circle",{className:"ole-bus-handle",cx:e,cy:t,r:5,"data-handle":o,onPointerDown:l,onPointerMove:s,onPointerUp:d,onPointerCancel:d})}const fr=.5;function xn(e,t){return Math.abs(e[1]-t[1])<fr?"h":"v"}function pT(){const e=x(l=>l.selectedWire),t=x(l=>l.internal.wireRenders);if(!e)return null;const n=t.get(e);if(!n||n.path.length<2)return null;const o=n.path,r=o.length,a=[];for(let l=1;l<r-1;l++){const s=xn(o[l-1],o[l]),d=xn(o[l],o[l+1]),u=l-1===0,m=l+1===r-1,p=u&&s==="v"||m&&d==="v",g=u&&s==="h"||m&&d==="h";p&&g||a.push(c.jsx(hT,{wireId:e,index:l,xLocked:p,yLocked:g},`v-${l}`))}const i=[];for(let l=0;l<r-1;l++){const s=o[l],d=o[l+1];Math.abs(s[0]-d[0])<fr&&Math.abs(s[1]-d[1])<fr||i.push(c.jsx(fT,{wireId:e,segIndex:l,axis:xn(s,d)},`m-${l}`))}return c.jsxs("g",{className:"ole-wire-handles",pointerEvents:"auto",children:[i,a]})}function hT({wireId:e,index:t,xLocked:n,yLocked:o}){const r=st(),a=$.useRef(null),i=x(h=>{var f;return(f=h.internal.wireRenders.get(e))==null?void 0:f.path});if(!i||t<=0||t>=i.length-1)return null;const[l,s]=i[t],d=n&&!o?"ns-resize":!n&&o?"ew-resize":"move",u=h=>{if(h.button!==0||(h.stopPropagation(),h.preventDefault(),!r))return;const f=x.getState().internal.wireRenders.get(e);f&&(a.current={pointerId:h.pointerId,startPath:f.path.map(b=>[b[0],b[1]]),startSvg:r.screenToSvg(h.clientX,h.clientY),index:t,xLocked:n,yLocked:o},document.body.style.cursor=d,h.target.setPointerCapture(h.pointerId))},m=h=>{const f=a.current;if(!f||h.pointerId!==f.pointerId||!r)return;const b=r.screenToSvg(h.clientX,h.clientY),y=f.startPath,w=f.index;if(w<=0||w>=y.length-1)return;const j=y[w],_=[f.xLocked?j[0]:xe(j[0]+(b[0]-f.startSvg[0])),f.yLocked?j[1]:xe(j[1]+(b[1]-f.startSvg[1]))];if(_[0]===j[0]&&_[1]===j[1])return;const E=y.map(ke=>[ke[0],ke[1]]);E[w]=_;const W=xn(y[w-1],y[w]);w-1>0&&(W==="h"?E[w-1]=[y[w-1][0],_[1]]:E[w-1]=[_[0],y[w-1][1]]);const Q=xn(y[w],y[w+1]);w+1<y.length-1&&(Q==="h"?E[w+1]=[y[w+1][0],_[1]]:E[w+1]=[_[0],y[w+1][1]]),x.getState().updateWirePath(e,E)},p=h=>{const f=a.current;!f||h.pointerId!==f.pointerId||(h.target.hasPointerCapture(h.pointerId)&&h.target.releasePointerCapture(h.pointerId),a.current=null,document.body.style.cursor="")},g=h=>{h.stopPropagation(),h.preventDefault();const f=x.getState().internal.wireRenders.get(e);if(!f||f.path.length<=2||t<=0||t>=f.path.length-1)return;const b=f.path.filter((y,w)=>w!==t);x.getState().updateWirePath(e,b)};return c.jsx("circle",{className:"ole-wire-handle ole-wire-vertex",cx:l,cy:s,r:5,style:{cursor:d},onPointerDown:u,onPointerMove:m,onPointerUp:p,onPointerCancel:p,onDoubleClick:g})}function fT({wireId:e,segIndex:t,axis:n}){const o=st(),r=$.useRef(null),a=x(h=>{var f;return(f=h.internal.wireRenders.get(e))==null?void 0:f.path});if(!a||t<0||t>=a.length-1)return null;const i=a[t],l=a[t+1],s=(i[0]+l[0])/2,d=(i[1]+l[1])/2,u=n==="h"?"ns-resize":"ew-resize",m=h=>{if(h.button!==0||(h.stopPropagation(),h.preventDefault(),!o))return;const f=x.getState().internal.wireRenders.get(e);f&&(r.current={pointerId:h.pointerId,startPath:f.path.map(b=>[b[0],b[1]]),startSvg:o.screenToSvg(h.clientX,h.clientY),axis:n,segIndex:t},document.body.style.cursor=u,h.currentTarget.setPointerCapture(h.pointerId))},p=h=>{const f=r.current;if(!f||h.pointerId!==f.pointerId||!o)return;const b=o.screenToSvg(h.clientX,h.clientY),y=f.startPath,w=f.segIndex;if(w>=y.length-1)return;const j=y[w],_=y[w+1],E=[];for(let W=0;W<=w;W++)E.push(y[W]);if(f.axis==="h"){const W=xe(j[1]+(b[1]-f.startSvg[1]));E.push([j[0],W]),E.push([_[0],W])}else{const W=xe(j[0]+(b[0]-f.startSvg[0]));E.push([W,j[1]]),E.push([W,_[1]])}for(let W=w+1;W<y.length;W++)E.push(y[W]);x.getState().updateWirePath(e,E)},g=h=>{const f=r.current;if(!f||h.pointerId!==f.pointerId)return;const b=h.currentTarget;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),r.current=null,document.body.style.cursor=""};return c.jsxs("g",{className:"ole-wire-handle ole-wire-midpoint-group",style:{cursor:u},onPointerDown:m,onPointerMove:p,onPointerUp:g,onPointerCancel:g,children:[c.jsx("circle",{className:"ole-wire-midpoint-hit",cx:s,cy:d,r:8}),c.jsx("circle",{className:"ole-wire-handle ole-wire-midpoint",cx:s,cy:d,r:3.5})]})}const gT=3,qo=12;function T_(){const e=ye(s=>s.internal.buses),t=ye(s=>s.selection),n=ye(s=>s.selectedNode),o=ye(s=>s.internal.nodes),r=ye(s=>s.internal.terminalToNode),a=en().props,i=new Set(t),l=new Set;if(n){const s=o.get(n);if(s)for(const d of s.terminals)!d.includes(".")&&e.has(d)&&l.add(d)}return c.jsx("g",{className:"ole-bus-layer",children:Array.from(e.values()).map(({bus:s,geometry:d})=>{const{axis:u,at:m,span:p}=d,g=p/2,h=u==="x"?m[0]-g:m[0],f=u==="x"?m[1]:m[1]-g,b=u==="x"?m[0]+g:m[0],y=u==="x"?m[1]:m[1]+g,w=i.has(s.id),j=l.has(s.id),_=a[s.id];if((_==null?void 0:_.visible)===!1)return null;const E=r.get(s.id)??void 0,W=qo/2,Q=u==="x"?m[0]-g:m[0]-W,ke=u==="x"?m[1]-W:m[1]-g,we=u==="x"?p:qo,Y=u==="x"?qo:p;return c.jsxs("g",{"data-bus-id":s.id,"data-element-id":s.id,"data-node-id":E,"data-selected":w?"true":void 0,"data-node-related":j?"true":void 0,"data-alarm":Or(_),"data-quality":f_(_),className:Qe(s.color)?`ole-bus ${Qe(s.color)}`:"ole-bus",children:[c.jsx("rect",{x:Q,y:ke,width:we,height:Y,fill:"transparent",className:"ole-bus-hit"}),c.jsx("line",{x1:h,y1:f,x2:b,y2:y,stroke:"currentColor",strokeWidth:gT,strokeLinecap:"round",fill:"none"})]},s.id)})})}function bT(){const e=x(l=>l.busbarDrawStart),t=x(l=>l.cursorSvg);if(!e||!t)return null;const n=t[0]-e[0],o=t[1]-e[1],r=Math.abs(n)>=Math.abs(o),a=r?t[0]:e[0],i=r?e[1]:t[1];return c.jsxs("g",{className:"ole-busbar-preview",pointerEvents:"none",children:[c.jsx("line",{x1:e[0],y1:e[1],x2:a,y2:i,className:"ole-busbar-preview-line"}),c.jsx("circle",{cx:e[0],cy:e[1],r:3.5,className:"ole-busbar-preview-anchor"}),c.jsx("circle",{cx:a,cy:i,r:3.5,className:"ole-busbar-preview-anchor"})]})}const yT=2.5,xT=9,wT=13,vT=-13,kT=4.5,ST=8;function P_(){const e=ye(l=>l.internal.junctions),t=ye(l=>l.selection),n=ye(l=>l.selectedNode),o=ye(l=>l.internal.nodes),r=ye(l=>l.internal.terminalToNode),a=new Set(t),i=new Set;if(n){const l=o.get(n);if(l)for(const s of l.terminals)i.add(s)}return c.jsx("g",{className:"ole-junction-layer",children:Array.from(e.values()).map(({junction:l,world:s,degree:d})=>{const u=r.get(l.id)??void 0,m=t.length===1&&t[0]===l.id,p=s[0]+wT,g=s[1]+vT;return c.jsxs("g",{"data-junction-id":l.id,"data-element-id":l.id,"data-node-id":u,"data-solder":d>=3?"true":void 0,"data-selected":a.has(l.id)?"true":void 0,"data-node-related":i.has(l.id)?"true":void 0,className:"ole-junction",children:[c.jsx("circle",{cx:s[0],cy:s[1],r:xT,fill:"transparent",className:"ole-junction-hit"}),c.jsx("circle",{cx:s[0],cy:s[1],r:yT,className:"ole-junction-dot"}),m&&c.jsxs("g",{className:"ole-junction-wire-handle-group",children:[c.jsx("line",{x1:s[0],y1:s[1],x2:p,y2:g,className:"ole-junction-wire-handle-stem"}),c.jsx("circle",{cx:p,cy:g,r:ST,fill:"transparent",className:"ole-junction-wire-handle"}),c.jsx("circle",{cx:p,cy:g,r:kT,className:"ole-junction-wire-handle-dot"})]})]},l.id)})})}function Et(e){const t=[`translate(${e.at[0]} ${e.at[1]})`];e.rot&&t.push(`rotate(${e.rot})`);const n=e.scale??1;return(e.mirror||n!==1)&&t.push(`scale(${e.mirror?-n:n} ${n})`),t.join(" ")}const Wn=new Map;function I_(e,t){const n=t??1;if(n===1||!e)return e;const o=`${n}\0${e}`,r=Wn.get(o);if(r!==void 0)return r;const a=e.replace(/stroke-width="([0-9.]+)"/g,(i,l)=>`stroke-width="${_T(Number(l)/n)}"`);return Wn.size>500&&Wn.clear(),Wn.set(o,a),a}function _T(e){return Math.round(e*1e4)/1e4}function CT(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function jT({lib:e}){const t=CT(e.viewBox);return t?c.jsx("rect",{className:"ole-element-hit",x:t.x,y:t.y,width:t.w,height:t.h}):null}function z_(){const e=ye(s=>s.internal.elements),t=ye(s=>s.internal.layout),n=ye(s=>s.selection),o=ye(s=>s.selectedNode),r=ye(s=>s.internal.nodes),a=en().props,i=new Set(n),l=new Set;if(o){const s=r.get(o);if(s)for(const d of s.terminals){const u=d.indexOf(".");u>0&&l.add(d.slice(0,u))}}return c.jsx("g",{className:"ole-element-layer",children:Array.from(e.values()).map(s=>{const d=t.get(s.element.id);if(!d)return null;const u=i.has(s.element.id),m=l.has(s.element.id),p=a[s.element.id];return(p==null?void 0:p.visible)===!1?null:s.libraryDef?c.jsxs("g",{"data-element-id":s.element.id,"data-selected":u?"true":void 0,"data-node-related":m?"true":void 0,"data-alarm":Or(p),"data-quality":f_(p),transform:Et(d),className:Qe(s.element.color)?`ole-element ${Qe(s.element.color)}`:"ole-element",children:[c.jsx(jT,{lib:s.libraryDef}),c.jsx("g",{dangerouslySetInnerHTML:{__html:I_(s.libraryDef.svg,d.scale)}}),s.libraryDef.terminalLabelsSvg&&c.jsx("g",{className:"ole-terminal-labels",dangerouslySetInnerHTML:{__html:s.libraryDef.terminalLabelsSvg}})]},s.element.id):c.jsxs("g",{"data-element-id":s.element.id,"data-selected":u?"true":void 0,"data-node-related":m?"true":void 0,transform:Et(d),className:"ole-element ole-element--unknown",children:[c.jsx("rect",{x:-10,y:-10,width:20,height:20,fill:"none",stroke:"#EF4444",strokeWidth:1,strokeDasharray:"2 2"}),c.jsx("text",{x:0,y:4,fontSize:8,fill:"#EF4444",textAnchor:"middle",fontFamily:"system-ui, sans-serif",children:"?"})]},s.element.id)})})}let M_=null;const gr=new Set;function qn(e){M_=e;for(const t of gr)t(e)}function $T(){return M_}function AT(e){return gr.add(e),()=>{gr.delete(e)}}function ET(){const[e,t]=$.useState($T());return $.useEffect(()=>AT(t),[]),!e||e.w===0&&e.h===0?null:c.jsx("rect",{className:"ole-marquee",x:e.x,y:e.y,width:e.w,height:e.h,pointerEvents:"none"})}function NT(){const e=x(u=>u.activeTool),t=x(u=>u.placeKind),n=x(u=>u.cursorSvg),o=x(u=>u.placeFromTerminal),r=x(u=>u.internal.library);if(e!=="place"||!t||!n)return null;const a=r.get(t);if(!a)return null;let i=null,l=null;if(o){const u=u_(o,n);u&&(i=m_(a,u,n),l={source:u.world,pin:n})}else i=d_(a);const s=n[0]-((i==null?void 0:i.x)??0),d=n[1]-((i==null?void 0:i.y)??0);return c.jsxs("g",{className:"ole-place-ghost-group",pointerEvents:"none",children:[l&&c.jsxs(c.Fragment,{children:[c.jsx("line",{x1:l.source[0],y1:l.source[1],x2:l.pin[0],y2:l.pin[1],className:"ole-wire-preview-line"}),c.jsx("circle",{cx:l.source[0],cy:l.source[1],r:4,className:"ole-wire-preview-anchor"})]}),c.jsx("g",{className:"ole-place-ghost",transform:`translate(${s} ${d})`,opacity:.5,children:c.jsx("g",{dangerouslySetInnerHTML:{__html:a.svg}})})]})}function D_(){const e=ye(a=>a.selection),t=ye(a=>a.internal.elements),n=ye(a=>a.internal.layout),o=ye(a=>a.internal.buses),r=en().props;return e.length===0?null:c.jsx("g",{className:"ole-selection-overlay",pointerEvents:"none",children:e.map(a=>{var u;if(((u=r[a])==null?void 0:u.visible)===!1)return null;const i=o.get(a);if(i){const{axis:m,at:p,span:g}=i.geometry,h=g/2,f=m==="x"?p[0]-h:p[0]-4,b=m==="x"?p[1]-4:p[1]-h,y=m==="x"?g:8,w=m==="x"?8:g;return c.jsx("rect",{x:f,y:b,width:y,height:w,fill:"none",className:"ole-selection-rect"},a)}const l=t.get(a),s=n.get(a);if(!(l!=null&&l.libraryDef)||!s)return null;const d=TT(l.libraryDef.viewBox);return d?c.jsx("rect",{x:d.x,y:d.y,width:d.w,height:d.h,fill:"none",className:"ole-selection-rect",transform:Et(s)},a):null})})}function TT(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}const Vn=7,PT=.05;function IT(){const e=x(_=>_.selection),t=x(_=>_.internal),n=x(_=>_.readOnly),[o,r]=$.useState(null);if(n||e.length!==1)return null;const a=e[0],i=t.elements.get(a),l=t.layout.get(a);if(!(i!=null&&i.libraryDef)||!l)return null;const s=i.libraryDef.viewBox.trim().split(/\s+/).map(Number);if(s.length!==4||s.some(_=>Number.isNaN(_)))return null;const[d,u,m,p]=s,g=[[d,u],[d+m,u],[d+m,u+p],[d,u+p]].map(_=>Ze(_,l)),h=Math.min(...g.map(_=>_[0])),f=Math.max(...g.map(_=>_[0])),b=Math.min(...g.map(_=>_[1])),y=Math.max(...g.map(_=>_[1])),w=[[h,b],[f,b],[f,y],[h,y]],j=["nwse-resize","nesw-resize","nwse-resize","nesw-resize"];return c.jsxs("g",{className:"ole-element-scale-handles",pointerEvents:"auto",children:[w.map((_,E)=>c.jsx(zT,{id:a,pos:_,cursor:j[E],opposite:w[(E+2)%4],scale:l.scale??1,onLive:r},E)),o&&c.jsxs("text",{className:"ole-element-scale-readout",x:o.at[0],y:o.at[1],textAnchor:"middle",children:[Math.round(o.scale*100),"%"]})]})}function zT({id:e,pos:t,cursor:n,opposite:o,scale:r,onLive:a}){const i=$.useRef(null),l=u=>{if(u.button!==0)return;u.stopPropagation(),u.preventDefault();const m=st();if(!m)return;const p=m.screenToSvg(u.clientX,u.clientY),g=Math.hypot(p[0]-o[0],p[1]-o[1]);g<1||(i.current={pointerId:u.pointerId,startScale:r,startDist:g,opposite:o},u.target.setPointerCapture(u.pointerId))},s=u=>{const m=i.current,p=st();if(!m||u.pointerId!==m.pointerId||!p)return;const g=p.screenToSvg(u.clientX,u.clientY),h=Math.hypot(g[0]-m.opposite[0],g[1]-m.opposite[1]);let f=m.startScale*h/m.startDist;f=Math.min(Tr,Math.max(Nr,f)),f=Math.round(f*100)/100,Math.abs(f-1)<PT&&(f=1),x.getState().previewPlacement(e,{scale:f}),a({scale:f,at:[g[0],g[1]-10]})},d=(u,m)=>{const p=i.current;if(!p||u.pointerId!==p.pointerId)return;i.current=null;const g=u.target;g.hasPointerCapture(u.pointerId)&&g.releasePointerCapture(u.pointerId),a(null),x.getState().endGesture(m)};return c.jsx("rect",{className:"ole-annotation-handle ole-element-scale-handle",x:t[0]-Vn/2,y:t[1]-Vn/2,width:Vn,height:Vn,style:{cursor:n},onPointerDown:l,onPointerMove:s,onPointerUp:u=>d(u,!0),onPointerCancel:u=>d(u,!1)})}const O_="ole-panel-open";function MT(){const e={outlineOpen:!1,healthMarkers:!0};if(typeof window>"u")return e;try{const t=window.localStorage.getItem(O_);if(!t)return e;const n=JSON.parse(t);if(typeof n!="object"||n===null)return e;const o=n;return{outlineOpen:o.outline===!0,healthMarkers:o.health!==!1}}catch{return e}}function Vo(e){try{const t={outline:e.outlineOpen,...e.healthMarkers?{}:{health:!1}};window.localStorage.setItem(O_,JSON.stringify(t))}catch{}}const at=Nn((e,t)=>({...MT(),setOutlineOpen:n=>{e({outlineOpen:n}),Vo(t())},toggleOutline:()=>{e(n=>({outlineOpen:!n.outlineOpen})),Vo(t())},setHealthMarkers:n=>{e({healthMarkers:n}),Vo(t())},healthOpen:!1,healthFocus:null,setHealthOpen:(n,o=null)=>e({healthOpen:n,healthFocus:o})})),Yt=Nn(e=>({onCreateComponent:null,onHealthEvent:null,setHostActions:t=>e(t)})),Gn=new Set(["grid-source","generator","genset","pv","wind-turbine","battery"]),Kn={breaker:["t1","t2"],fuse:["t1","t2"],disconnector:["t1","t2"],"load-switch":["t1","t2"],"fuse-switch-disconnector":["t1","t2"],"dc-disconnector":["t1","t2"],"gfci-breaker":["t1","t2"],rcd:["t1","t2"],recloser:["t1","t2"],contactor:["t1","t2"],"thermal-overload":["t1","t2"],"energy-meter":["t1","t2"],"transformer-2w":["t1","t2"],"voltage-regulator":["t1","t2"],ups:["t_in","t_out"],vfd:["t_in","t_out"],"soft-starter":["t_in","t_out"],inverter:["t_dc","t_ac"],"converter-bidir":["t_ac","t_dc"],"dc-dc-converter":["t_in","t_out"],rectifier:["t_ac","t_dc"],busduct:["t_left","t_right"]},DT=new Set(["transformer-2w","transformer-3w","autotransformer","voltage-regulator","grounding-transformer","ups","power-supply","inverter","converter-bidir","dc-dc-converter","rectifier","mppt","vfd","pt","ct"]),OT=new Set(["control","grounding","measurement"]),RT=new Set(["earth","earthing-switch","arrester","buchholz-relay","distance-relay","overcurrent-relay","phase-failure-relay","protective-relay","reverse-power-relay","undervoltage-relay"]),LT=new Set(["earth","ct","pt","buchholz-relay","distance-relay","overcurrent-relay","phase-failure-relay","protective-relay","reverse-power-relay","undervoltage-relay","ammeter","voltmeter","wattmeter","varmeter","frequency-meter","power-factor-meter","synchronoscope"]),mn=new Set(["load","heater","async-motor","sync-motor","dc-motor","ev-charger","socket-outlet","luminaire","panelboard"]),BT={"transformer-2w":{param:"S",toKVA:1e3},ups:{param:"S",toKVA:1}};function zt(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const t=/^\s*(-?\d+(?:\.\d+)?)\s*$/.exec(e);if(t)return Number(t[1])}}function R_(e,t){if(e<=0||t<=0)return!0;const n=e>t?e/t:t/e;return n<=1.15||n>=1.6&&n<=1.85}function L_(e){var s;const t=/(\d+(?:\.\d+)?)\s*(kV|V)?[^/\d]*\/\s*(\d+(?:\.\d+)?)\s*(kV|V)?/i.exec(e);if(!t)return null;const n=(s=/\b(kV|V)\b/i.exec(e.slice(t.index+t[0].length)))==null?void 0:s[1],o=(d,u)=>u?u.toLowerCase()==="v"?d/1e3:d:d>=1e3?d/1e3:d,r=t[4]??n,a=t[2]??r;let i=o(Number(t[1]),a),l=o(Number(t[3]),r);return!a&&!r&&Math.max(Number(t[1]),Number(t[3]))>=1e3&&(i=Number(t[1])/1e3,l=Number(t[3])/1e3),i>0&&l>0?i>=l?[i,l]:[l,i]:null}const B_={a:{dim:"I",scale:1},ka:{dim:"Ik",scale:1},w:{dim:"P",scale:.001},kw:{dim:"P",scale:1},mw:{dim:"P",scale:1e3},va:{dim:"S",scale:.001},kva:{dim:"S",scale:1},mva:{dim:"S",scale:1e3},v:{dim:"U",scale:.001},kv:{dim:"U",scale:1}};function HT(e){const t=new Map,n=new RegExp("(\\/\\s*)?(?<![\\w.,-])(\\d+(?:[.,]\\d+)?)\\s*(kVA|MVA|VA|kW|MW|W|kV|V|kA|A)\\b(\\s*\\/)?","g");for(const o of e.matchAll(n)){const r=B_[o[3].toLowerCase()];if(!r)continue;const a=e.slice(Math.max(0,(o.index??0)-4),o.index),i=e.slice((o.index??0)+o[0].length,(o.index??0)+o[0].length+4);if(/\d\s*[x×*]\s*$/i.test(a)||/^\s*[x×*]\s*\d/i.test(i)){t.set(r.dim,[NaN]);continue}if(o[1]||o[4]){t.set(r.dim,[NaN]);continue}const l=/,\d{3}$/.test(o[2])?o[2].replace(",",""):o[2].replace(",","."),s=Number(l)*r.scale,d=t.get(r.dim)??[];d.some(u=>Number.isNaN(u)||Math.abs(u-s)<1e-9)||d.push(s),t.set(r.dim,d)}return t}function FT(e){const t=new Map,n=new Map;for(const[r]of e.elements){const i=(e.elementToTerminals.get(r)??[]).map(l=>e.terminalToNode.get(l));t.set(r,i);for(const l of i){if(!l)continue;const s=n.get(l)??[];s.includes(r)||s.push(r),n.set(l,s)}}const o=new Map;for(const[r]of e.buses){const a=e.terminalToNode.get(r);a&&o.set(r,a)}return{devNodes:t,nodeDevs:n,busNode:o}}function H_(e,t){var G,me,pe,te,Se,ie,_e,Ie,Oe;const n=[],o=t.elements.size>0||t.buses.size>0,r=FT(t),a=O=>{var q;return((q=t.elements.get(O))==null?void 0:q.element.kind)??""},i=O=>{var q,X;return((X=(q=t.elements.get(O))==null?void 0:q.libraryDef)==null?void 0:X.category)??""},l=O=>{var q;return!!((q=t.elements.get(O))!=null&&q.libraryDef)},s=O=>!Kn[a(O)]&&(RT.has(a(O))||OT.has(i(O))),d=O=>!Kn[a(O)]&&(i(O)==="grounding"||["earth","earthing-switch","arrester"].includes(a(O))),u=O=>{var q,X;return(((X=(q=t.elements.get(O))==null?void 0:q.libraryDef)==null?void 0:X.terminals)??[]).map(ee=>ee.id)},m=(O,q)=>{var ee;const X=u(O).indexOf(q);return X<0||(ee=r.devNodes.get(O))==null?void 0:ee[X]},p=[...t.elements.keys()].filter(O=>Gn.has(a(O))),g=p.length>0,h=new Set,f=new Set,b=O=>Gn.has(a(O))||!mn.has(a(O))&&!d(O);{const O=[...p];for(const q of p)h.add(q);for(;O.length;){const q=O.shift();if(b(q)){for(const X of r.devNodes.get(q)??[])if(!(!X||f.has(X))){f.add(X);for(const ee of r.nodeDevs.get(X)??[])h.has(ee)||d(ee)||(h.add(ee),O.push(ee))}}}}const y=new Set,w=[...t.elements.keys()].some(O=>a(O)==="pv"&&(r.devNodes.get(O)??[]).some(Boolean));for(const[O,q]of t.elements){const X=r.devNodes.get(O)??[];if(X.length===0)continue;if(X.every(le=>!le)){if(y.add(O),!LT.has(q.element.kind)){const le=q.element.kind==="pv"&&w;n.push({id:`unwired:${O}`,code:"unwired",severity:le?"info":"warning",targets:[O]})}continue}const ee=Kn[q.element.kind];if(!ee)continue;const be=m(O,ee[0]),U=m(O,ee[1]);if(!!be==!!U)continue;const he=be?ee[1]:ee[0];if(g&&!h.has(O))continue;const se=g?!0:he===ee[1];n.push(se?{id:`feeder-end:${O}`,code:"feeder-end",severity:"info",targets:[O]}:{id:`open-side:${O}`,code:"open-side",severity:"info",targets:[O],data:{pin:he}})}const j=/^(n|pe|pen|neutral|neutro|nulo|neutre|earth|ground|gnd|terra|tierra|terre|земл|нейтр|ноль)\b|零线|中性|接地|地线|地排/i;for(const[O,q]of t.buses)j.test((q.bus.name??"").trim())||r.busNode.has(O)||n.push({id:`unwired:${O}`,code:"unwired",severity:"warning",targets:[O]});const _=6,E=(O,q)=>Math.hypot(O[0]-q[0],O[1]-q[1])<=_,W=O=>{for(const[,q]of t.buses){const{at:X,span:ee,axis:be}=q.geometry,U=ee/2;if(be==="x"&&Math.abs(O[1]-X[1])<=_&&O[0]>=X[0]-U-_&&O[0]<=X[0]+U+_||be==="y"&&Math.abs(O[0]-X[0])<=_&&O[1]>=X[1]-U-_&&O[1]<=X[1]+U+_)return!0}return!1};for(const[O,q]of t.junctions){if(q.degree!==1)continue;const X=t.terminalToNode.get(O),ee=[...t.junctions].some(([be,U])=>be!==O&&E(U.world,q.world)&&t.terminalToNode.get(be)!==X)||[...t.terminals.values()].some(be=>E(be.world,q.world)&&t.terminalToNode.get(be.ref)!==X)||W(q.world);n.push(ee?{id:`looks-joined:${O}`,code:"looks-joined",severity:"warning",targets:[O]}:{id:`dangling-wire:${O}`,code:"dangling-wire",severity:"info",targets:[O]})}if(g){const O=[...t.elements.keys()].filter(X=>!s(X)&&!y.has(X)&&!Gn.has(a(X))),q=O.filter(X=>!h.has(X));q.length>0&&q.length*2>O.length&&n.push({id:`supply-disconnected:${p.slice().sort()[0]}`,code:"supply-disconnected",severity:"warning",targets:p.slice().sort(),data:{count:q.length,total:O.length}})}if(g&&!n.some(O=>O.code==="supply-disconnected")){const O=new Set;for(const[q]of t.elements){if(O.has(q)||h.has(q)||y.has(q)||s(q))continue;const X=[],ee=new Set,be=[q];for(O.add(q);be.length;){const se=be.pop();if(s(se)||X.push(se),!d(se)){for(const le of r.devNodes.get(se)??[])if(!(!le||f.has(le)||ee.has(le))){ee.add(le);for(const je of r.nodeDevs.get(le)??[])O.has(je)||h.has(je)||d(je)||(O.add(je),be.push(je))}}}if(X.length===0)continue;const U=[...r.busNode].filter(([,se])=>ee.has(se)).map(([se])=>se),he=[...X.sort(),...U.sort()];n.push({id:`unsupplied:${he[0]}`,code:"unsupplied",severity:"warning",targets:he,data:{count:X.length}})}}else!g&&o&&[...t.elements.values()].some(O=>mn.has(O.element.kind))&&n.push({id:"no-origin",code:"no-origin",severity:"info",targets:[]});const Q=new Map;{let O=0;for(const q of r.nodeDevs.keys())Q.has(q)||ke(q,O++);for(const[,q]of r.busNode)Q.has(q)||ke(q,O++)}function ke(O,q){const X=[O];for(Q.set(O,q);X.length;){const ee=X.pop();for(const be of r.nodeDevs.get(ee)??[])if(!(DT.has(a(be))||!l(be)))for(const U of r.devNodes.get(be)??[])!U||Q.has(U)||(Q.set(U,q),X.push(U))}}const we=new Map,Y=(O,q,X)=>{if(!O||q===void 0||!(q>0))return;const ee=Q.get(O);if(ee===void 0)return;const be=we.get(ee)??[];be.push({kv:q,bus:X}),we.set(ee,be)};for(const[O,q]of t.buses)Y(r.busNode.get(O),zt((G=q.bus.params)==null?void 0:G.Un),O);for(const[O,q]of t.elements){const X=q.element.kind;if(X==="busbar"&&Y((me=r.devNodes.get(O))==null?void 0:me[0],zt((pe=q.element.params)==null?void 0:pe.Un),O),X==="busduct"){const ee=zt((te=q.element.params)==null?void 0:te.Un);Y((Se=r.devNodes.get(O))==null?void 0:Se.find(Boolean),ee===void 0?void 0:ee/1e3,O)}}const k=O=>{const q=[];for(const X of(O===void 0?void 0:we.get(O))??[])q.some(ee=>R_(ee.kv,X.kv))||q.push(X);return q};for(const[O,q]of we){const X=k(O);if(X.length<2)continue;const ee=[...new Set(q.map(be=>be.bus))].sort();n.push({id:`voltage-mix:${ee[0]}`,code:"voltage-mix",severity:"error",targets:ee,data:{a:X[0].kv,b:X[1].kv}})}for(const[O,q]of t.elements){if(q.element.kind!=="transformer-2w")continue;const X=(ie=q.element.params)==null?void 0:ie.ratio;if(typeof X!="string")continue;const ee=L_(X);if(!ee)continue;const be=k(Q.get(m(O,"t1")??"")),U=k(Q.get(m(O,"t2")??""));if(be.length!==1||U.length!==1)continue;const he=(ze,Ae)=>Math.abs(ze-Ae)/Math.max(ze,Ae)<=.1,se=([ze,Ae])=>he(ze,be[0].kv)&&he(Ae,U[0].kv)||he(ze,U[0].kv)&&he(Ae,be[0].kv),le=!/\bk?V\b/i.test(X);se(ee)||le&&se([ee[0]/1e3,ee[1]/1e3])||n.push({id:`ratio-mismatch:${O}`,code:"ratio-mismatch",severity:"warning",targets:[O],data:{ratio:X,a:be[0].kv,b:U[0].kv}})}for(const[O,q]of t.elements){const X=q.element.name,ee=q.libraryDef;if(!X||!(ee!=null&&ee.params))continue;const be=HT(X);if(be.size!==0)for(const U of ee.params){const he=U.unit?B_[U.unit.toLowerCase()]:void 0,se=zt((_e=q.element.params)==null?void 0:_e[U.name]);if(!he||se===void 0)continue;const le=be.get(he.dim);if(!le||le.length!==1||Number.isNaN(le[0]))continue;const je=se*he.scale;Math.abs(je-le[0])/Math.max(Math.abs(je),Math.abs(le[0]),1e-9)>.01&&n.push({id:`label-mismatch:${O}:${U.name}`,code:"label-mismatch",severity:"warning",targets:[O],data:{param:U.name,value:`${se}${U.unit??""}`}})}}const D=[];if(g){const O=U=>{var Je,nt;const he=t.elements.get(U),se=he.element.kind,le=zt((Je=he.element.params)==null?void 0:Je.P);if(le===void 0||!(le>0))return null;const je=(se.endsWith("-motor")||se==="ev-charger")&&le<.05,ze=se==="load"||je?le*1e3:le,Ae=zt((nt=he.element.params)==null?void 0:nt.cosphi),Re=Ae&&Ae>0&&Ae<=1?Ae:se==="heater"?1:.9;return{kw:ze,kva:ze/Re}},q=(U,he,se)=>{const le=new Set,je=new Set(U),ze=[...U];for(;ze.length;){const Ae=ze.pop();for(const Re of r.nodeDevs.get(Ae)??[])if(!(Re===he||le.has(Re))&&(le.add(Re),!(mn.has(a(Re))||d(Re))))for(const Je of r.devNodes.get(Re)??[])!Je||Je===se||je.has(Je)||(je.add(Je),ze.push(Je))}return le},X=U=>{let he=0,se=0,le=0,je=0;for(const ze of U){if(!mn.has(a(ze)))continue;je++;const Ae=O(ze);Ae&&(le++,he+=Ae.kw,se+=Ae.kva)}return{kw:he,kva:se,k:le,t:je}},ee=U=>[...U].some(he=>Gn.has(a(he))),be=[...[...r.busNode].map(([U,he])=>({id:U,type:"bus",node:he})),...[...t.elements].filter(([,U])=>U.element.kind==="busbar").map(([U])=>{var he;return{id:U,type:"element",node:(he=r.devNodes.get(U))==null?void 0:he[0]}}).filter(U=>!!U.node)];for(const U of be){if(!f.has(U.node))continue;const he=new Set;for(const le of r.nodeDevs.get(U.node)??[]){if(U.type==="element"&&le===U.id)continue;if(mn.has(a(le))){he.add(le);continue}const je=(r.devNodes.get(le)??[]).filter(Ae=>!!Ae&&Ae!==U.node),ze=q(je,null,U.node);if(ze.add(le),!ee(ze))for(const Ae of ze)he.add(Ae)}const se=X(he);se.t!==0&&D.push({targetId:U.id,targetType:U.type,knownKW:se.kw,knownKVA:se.kva,known:se.k,total:se.t})}for(const[U,he]of t.elements){const se=BT[he.element.kind],le=Kn[he.element.kind];if(!se||!le||!h.has(U))continue;const je=m(U,le[0]),ze=m(U,le[1]);if(!je||!ze)continue;let Ae=q([ze],U,null);if(ee(Ae)){const mt=q([je],U,null);ee(mt)||(Ae=mt)}const Re=X(Ae);if(Re.t===0)continue;const Je=zt((Ie=he.element.params)==null?void 0:Ie[se.param]),nt=Je&&Je>0?Je*se.toKVA:void 0,Dn={targetId:U,targetType:"element",knownKW:Re.kw,knownKVA:Re.kva,known:Re.k,total:Re.t,...nt?{ratingKVA:nt,loadingPct:Re.kva/nt*100}:{}};if(D.push(Dn),nt&&Re.kva>nt){const mt=Re.kva/nt;n.push({id:`overload:${U}`,code:"overload",severity:mt>1.25?"warning":"info",targets:[U],data:{load:Math.round(Re.kva),rating:Math.round(nt),...mt>10?{units:1}:{}}})}}}const M=new Set(((Oe=e.meta)==null?void 0:Oe.healthDismissed)??[]);for(const O of n)M.has(O.id)&&(O.dismissed=!0);return{issues:n,loads:D,hasOrigin:g,hasModel:o}}const Va=new WeakMap;function WT(e,t){const n=Va.get(t);if(n&&n.diagram===e)return n.report;const o=H_(e,t);return Va.set(t,{diagram:e,report:o}),o}function Br(){return x(e=>WT(e.diagram,e.internal))}function F_(e){return e.issues.filter(t=>t.severity!=="info"&&!t.dismissed)}function W_(e,t){var r,a,i;const n=(r=e.elements.get(t))==null?void 0:r.element;if(n)return(n.name??"").split(/\r\n|\r|\n/)[0].trim()||n.id;const o=(a=e.buses.get(t))==null?void 0:a.bus;return o?((i=o.name)==null?void 0:i.trim())||o.id:t}const bt=e=>typeof e=="number"?String(Math.round(e*1e3)/1e3):e??"";function q_(e,t,n){const o=n.data??{},r={name:n.targets[0]?W_(t,n.targets[0]):"",count:bt(o.count),total:bt(o.total),a:bt(o.a),b:bt(o.b),ratio:bt(o.ratio),param:bt(o.param),value:bt(o.value),load:bt(o.load),rating:bt(o.rating)},a=e(`health.code.${n.code}`,r);return o.units?`${a} ${e("health.overloadUnits")}`:a}function Hr(e,t){const n=e.elements.get(t),o=e.layout.get(t);if(n!=null&&n.libraryDef&&o){const i=n.libraryDef.viewBox.trim().split(/\s+/).map(Number);if(i.length===4&&i.every(l=>Number.isFinite(l))){const[l,s,d,u]=i,m=[[l,s],[l+d,s],[l+d,s+u],[l,s+u]].map(p=>Ze(p,o));return{minX:Math.min(...m.map(p=>p[0])),maxX:Math.max(...m.map(p=>p[0])),minY:Math.min(...m.map(p=>p[1])),maxY:Math.max(...m.map(p=>p[1]))}}}const r=e.buses.get(t);if(r){const{at:i,span:l,axis:s}=r.geometry,d=l/2;return s==="x"?{minX:i[0]-d,maxX:i[0]+d,minY:i[1]-2,maxY:i[1]+2}:{minX:i[0]-2,maxX:i[0]+2,minY:i[1]-d,maxY:i[1]+d}}const a=e.junctions.get(t);return a?{minX:a.world[0],maxX:a.world[0],minY:a.world[1],maxY:a.world[1]}:null}function qT(e,t){const n=Hr(e,t);return n?e.junctions.has(t)?[n.maxX,n.minY]:[n.maxX+2,n.minY-2]:null}function VT(e,t){const n=Hr(e,t);return n?[(n.minX+n.maxX)/2,(n.minY+n.maxY)/2]:null}const GT=300;function KT(){const e=at(s=>s.healthMarkers),t=x(s=>s.readOnly),n=x(s=>s.internal),o=Br(),r=re();if(!e||t||!o.hasModel)return null;const a=[];for(const s of o.issues){if(s.severity==="info"||s.dismissed)continue;const d=q_(r,n,s);for(const u of s.targets.slice(0,24)){if(a.length>=GT)break;const m=qT(n,u);m&&a.push({key:`${s.id}|${u}`,at:m,severity:s.severity,issueId:s.id,code:s.code,title:d})}}const i=o.loads.flatMap(s=>{var b;if(s.known===0)return[];const d=Hr(n,s.targetId);if(!d)return[];const u=Math.round(s.knownKW),m=s.loadingPct===void 0?"":` · ${Math.round(s.loadingPct)}%`,p=s.known<s.total?` (${s.known}/${s.total})`:"",g=n.buses.has(s.targetId)||((b=n.elements.get(s.targetId))==null?void 0:b.element.kind)==="busbar",h=g?[d.minX,d.minY-5]:[d.minX-4,(d.minY+d.maxY)/2],f=(s.loadingPct??0)>100;return[{key:s.targetId,at:h,anchor:g?"start":"end",text:`Σ ${u} kW${m}${p}`,over:f}]}),l=(s,d,u)=>{var p,g;const m=x.getState();(m.internal.elements.has(u)||m.internal.buses.has(u))&&m.setSelection([u]),at.getState().setHealthOpen(!0,s),(g=(p=Yt.getState()).onHealthEvent)==null||g.call(p,{type:"open",issueId:s,code:d})};return c.jsxs("g",{className:"ole-health-layer",pointerEvents:"none",children:[i.map(s=>c.jsx("text",{className:"ole-health-figure","data-over":s.over?"true":void 0,x:s.at[0],y:s.at[1],textAnchor:s.anchor,children:s.text},s.key)),a.map(s=>c.jsxs("g",{className:"ole-health-marker","data-severity":s.severity,transform:`translate(${s.at[0]} ${s.at[1]})`,onPointerDown:d=>{d.button===0&&(d.stopPropagation(),l(s.issueId,s.code,s.key.split("|")[1]))},children:[c.jsx("title",{children:s.title}),c.jsx("circle",{r:5}),c.jsx("text",{y:2.6,textAnchor:"middle",children:"!"})]},s.key))]})}function UT(){const e=x(a=>a.internal.terminals),t=x(a=>a.internal.terminalToNode),n=x(a=>a.wireFromTerminal),o=x(a=>a.selection),r=new Set(o);return c.jsx("g",{className:"ole-terminal-layer",children:Array.from(e.values()).map(a=>{const i=t.get(a.ref),l=i!==void 0,s=n===a.ref,d=r.has(a.elementId);return c.jsx("circle",{cx:a.world[0],cy:a.world[1],r:3,"data-element-id":a.elementId,"data-terminal-id":a.ref,"data-node-id":i,"data-connected":l?"true":"false","data-active":s?"true":void 0,"data-on-selected":d?"true":void 0,className:"ole-terminal"},a.ref)})})}const Ga=4;function XT(e,t,n,o){const r=t[0]-e[0],a=t[1]-e[1],i=o[0]-n[0],l=o[1]-n[1],s=r*l-a*i;if(Math.abs(s)<1e-9)return null;const d=((n[0]-e[0])*l-(n[1]-e[1])*i)/s,u=((n[0]-e[0])*a-(n[1]-e[1])*r)/s,m=1e-6;return d<=m||d>=1-m||u<=m||u>=1-m?null:[e[0]+d*r,e[1]+d*a]}function YT(e,t){const n=[];let o=[e[0]];for(let r=0;r<e.length-1;r++){const a=e[r],i=e[r+1],l=t.get(r);if(!l||l.length===0){o.push(i);continue}const s=i[0]-a[0],d=i[1]-a[1],u=Math.hypot(s,d)||1,m=s/u,p=d/u,g=f=>(f[0]-a[0])*m+(f[1]-a[1])*p,h=l.slice().sort((f,b)=>g(f)-g(b));for(const f of h){const b=g(f),y=Math.max(0,b-Ga),w=Math.min(u,b+Ga);o.push([a[0]+m*y,a[1]+p*y]),n.push(o),o=[[a[0]+m*w,a[1]+p*w]]}o.push(i)}return n.push(o),n.filter(r=>r.length>=2)}function V_(){var m,p;const e=ye(g=>g.internal.wireRenders),t=ye(g=>g.internal.terminalToNode),n=ye(g=>g.diagram.wires),o=ye(g=>g.selectedWire),r=ye(g=>g.selectedNode),a=en().props,i=new Map,l=new Map;for(const g of n??[]){const h=t.get(g.ends[0]);h&&i.set(g.id,h);const f=L6((m=a[Rt(g.ends[0])])==null?void 0:m.alarm,(p=a[Rt(g.ends[1])])==null?void 0:p.alarm);f!=="none"&&l.set(g.id,f)}const s=Array.from(e.values()).filter(g=>g.path.length>=2),d=[];for(const g of s){const h=i.get(g.wireId);for(let f=0;f<g.path.length-1;f++)d.push({wireId:g.wireId,node:h,i:f,a:g.path[f],b:g.path[f+1]})}const u=new Map;for(let g=0;g<d.length;g++)for(let h=g+1;h<d.length;h++){const f=d[g],b=d[h];if(f.wireId===b.wireId||!(f.node&&b.node&&f.node!==b.node))continue;const y=XT(f.a,f.b,b.a,b.b);if(!y)continue;const w=f.wireId<b.wireId?f:b;let j=u.get(w.wireId);j||(j=new Map,u.set(w.wireId,j));const _=j.get(w.i)??[];_.push(y),j.set(w.i,_)}return c.jsx("g",{className:"ole-wire-layer",fill:"none",stroke:"currentColor",strokeWidth:1,children:s.flatMap(g=>{const h=g.path,f=h.map(W=>`${W[0]},${W[1]}`).join(" "),b=i.get(g.wireId),y=o===g.wireId,w=r!=null&&r===b,j=y||w?"true":void 0,_=u.get(g.wireId),E=_?YT(h,_):[h];return[c.jsx("polyline",{"data-wire-id":g.wireId,"data-node-id":b,className:"ole-wire-hit",points:f},`hit-${g.wireId}`),...E.map((W,Q)=>c.jsx("polyline",{"data-wire-id":g.wireId,"data-node-id":b,"data-manual":g.userEdited?"true":void 0,"data-selected":j,"data-alarm":l.get(g.wireId),className:Qe(g.color)?`ole-wire ${Qe(g.color)}`:"ole-wire",points:W.map(ke=>`${ke[0]},${ke[1]}`).join(" ")},`${g.wireId}-${Q}`))]})})}let Mt=null;const br=new Set;function At(e){if(!(e===null&&Mt===null||e&&Mt&&e.ref===Mt.ref&&e.world[0]===Mt.world[0]&&e.world[1]===Mt.world[1])){Mt=e;for(const t of br)t(e)}}function ZT(){return Mt}function QT(e){return br.add(e),()=>{br.delete(e)}}function JT(){const e=x(s=>s.wireDragFrom),t=x(s=>s.cursorSvg),[n,o]=$.useState(ZT());if($.useEffect(()=>QT(o),[]),!e||!t)return null;const r=e.world,a=(n==null?void 0:n.world[0])??t[0],i=(n==null?void 0:n.world[1])??t[1],l=(n==null?void 0:n.create)==="junction";return c.jsxs("g",{className:"ole-wire-preview",pointerEvents:"none",children:[c.jsx("line",{x1:r[0],y1:r[1],x2:a,y2:i,className:"ole-wire-preview-line"}),c.jsx("circle",{cx:r[0],cy:r[1],r:4,className:"ole-wire-preview-anchor"}),n&&c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:n.world[0],cy:n.world[1],r:n.isBus?7:8,className:"ole-wire-preview-target-ring","data-create":l?"true":void 0}),!l&&c.jsx("circle",{cx:n.world[0],cy:n.world[1],r:n.isBus?3:4,className:"ole-wire-preview-target-dot"})]})]})}function Tt(e,t){return e instanceof Element?e.closest(`[${t}]`):null}function Nt(e){var t;return((t=Tt(e,"data-element-id"))==null?void 0:t.getAttribute("data-element-id"))??null}function e4(e){var t;return((t=Tt(e,"data-bus-id"))==null?void 0:t.getAttribute("data-bus-id"))??null}function t4(e){var t;return((t=Tt(e,"data-junction-id"))==null?void 0:t.getAttribute("data-junction-id"))??null}function Ao(e){var r;const t=(r=Tt(e,"data-terminal-id"))==null?void 0:r.getAttribute("data-terminal-id");if(t)return t;const n=t4(e);if(n)return n;const o=e4(e);return o||null}function Eo(e){var t;return((t=Tt(e,"data-node-id"))==null?void 0:t.getAttribute("data-node-id"))??null}function yr(e){var t;return((t=Tt(e,"data-wire-id"))==null?void 0:t.getAttribute("data-wire-id"))??null}function $n(e){var t;return((t=Tt(e,"data-element-label"))==null?void 0:t.getAttribute("data-element-label"))??null}function An(e){var t;return((t=Tt(e,"data-annotation-id"))==null?void 0:t.getAttribute("data-annotation-id"))??null}function G_(e,t){try{e.dispatchEvent(new PointerEvent("pointercancel",{pointerId:t,bubbles:!0,cancelable:!0,pointerType:"touch"}))}catch{}}function n4(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}function K_(){const e=x.getState(),t=e.activeTool;if(e.editingAnnotation||e.editingElement){if(typeof document<"u"){const n=document.querySelector(".ole-free-annotation-edit-fo div[contenteditable], .ole-element-name-editor div[contenteditable], .ole-ann-cell-edit-fo input");n==null||n.blur()}e.setEditingAnnotation(null),e.setEditingElement(null);return}if(t==="wire"||t==="busbar"||t==="junction"||t==="text"||t==="rect"||t==="ellipse"||t==="line"||t==="table"){e.setActiveTool("select");return}if(t==="place"){e.placeFromTerminal?e.setPlaceFromTerminal(null):e.placeKind?e.setPlaceKind(null):e.setActiveTool("select");return}(e.selectedNode||e.selectedWire||e.selection.length>0||e.selectedAnnotations.length>0)&&e.clearSelection()}function o4(){$.useEffect(()=>{const e=t=>{if(n4(t.target)||x.getState().readOnly)return;const n=t.metaKey||t.ctrlKey,o=x.getState();if(n&&t.key.toLowerCase()==="z"){t.preventDefault(),t.shiftKey?o.redo():o.undo();return}if(n&&!t.shiftKey&&t.key.toLowerCase()==="y"){t.preventDefault(),o.redo();return}if(n&&t.key.toLowerCase()==="a"){t.preventDefault();const r=x.getState().diagram.elements.map(a=>a.id);o.setSelection(r);return}if(n&&!t.shiftKey&&!t.altKey){const r=t.key.toLowerCase(),a=o.selection.length>0||o.selectedAnnotations.length>0;if(r==="c"){if(!a)return;t.preventDefault(),o.copySelection();return}if(r==="x"){if(!a)return;t.preventDefault(),o.cutSelection();return}if(r==="v"){if(!o.clipboard)return;t.preventDefault(),o.pasteClipboard();return}}if(!n)switch(t.key){case"v":case"V":o.setActiveTool("select");return;case"h":case"H":o.setActiveTool("pan");return;case"w":case"W":o.setActiveTool("wire");return;case"b":case"B":o.setActiveTool("busbar");return;case"j":case"J":o.setActiveTool("junction");return;case"p":case"P":o.setActiveTool("place");return;case"t":case"T":o.setActiveTool("text");return;case"f":case"F":o.setActiveTool("rect");return;case"o":case"O":o.setActiveTool("ellipse");return;case"l":case"L":o.setActiveTool("line");return;case"d":case"D":o.setActiveTool("table");return;case"r":case"R":o.selection.length>0&&(t.preventDefault(),o.rotateSelection(90));return;case"m":case"M":o.selection.length>0&&(t.preventDefault(),o.mirrorSelection());return;case"Delete":case"Backspace":o.selection.length>0||o.selectedAnnotations.length>0?(t.preventDefault(),o.deleteSelection()):o.selectedWire?(t.preventDefault(),o.deleteSelectedWire()):o.selectedNode&&(t.preventDefault(),o.deleteSelectedNode());return;case"Escape":K_();return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[])}let xr=null;const wr=new Set;function r4(e){if(e!==xr){xr=e;for(const t of wr)t(e)}}function a4(){return xr}function i4(e){return wr.add(e),()=>{wr.delete(e)}}const Ka="ole-hover-element-host",s4="ole-hover-terminal-on",l4="ole-hover-node-on";function c4(e){const t=i_();$.useEffect(()=>{const n=e.current;if(!n)return;let o=null,r=null;const a=new Set,i=new Set,l=(p,g,h)=>{for(const f of p)f.classList.remove(h);p.clear();for(const f of g)f.classList.add(h),p.add(f)},s=p=>{var h,f;if(p===o)return;o&&((h=n.querySelector(`[data-element-id="${Un(o)}"]`))==null||h.classList.remove(Ka)),p&&((f=n.querySelector(`[data-element-id="${Un(p)}"]`))==null||f.classList.add(Ka));const g=p?Array.from(n.querySelectorAll(`.ole-terminal[data-element-id="${Un(p)}"]`)):[];l(a,g,s4),o=p,p?n.setAttribute("data-hover-element",""):n.removeAttribute("data-hover-element"),r4(p)},d=p=>{if(p===r)return;const g=p?Array.from(n.querySelectorAll(`[data-node-id="${Un(p)}"]`)):[];l(i,g,l4),r=p,p?n.setAttribute("data-hover-node",""):n.removeAttribute("data-hover-node")},u=p=>{s(Nt(p.target));const g=Ao(p.target);let h=null;g?h=t.getState().internal.terminalToNode.get(g)??null:h=Eo(p.target),d(h)},m=()=>{s(null),d(null)};return n.addEventListener("pointermove",u),n.addEventListener("pointerleave",m),()=>{n.removeEventListener("pointermove",u),n.removeEventListener("pointerleave",m),s(null),d(null)}},[e,t])}function Un(e){return e.replace(/(["\\])/g,"\\$1")}function d4(e,t,n){const o=[];for(const a of e.elements.values()){if(!a.libraryDef)continue;const i=e.layout.get(a.element.id);if(!i)continue;const l=m4(a.libraryDef.viewBox);if(!l)continue;const s=[[l.x,l.y],[l.x+l.w,l.y],[l.x,l.y+l.h],[l.x+l.w,l.y+l.h]].map(([g,h])=>u4([g,h],i));let d=1/0,u=-1/0,m=1/0,p=-1/0;for(const[g,h]of s)g<d&&(d=g),g>u&&(u=g),h<m&&(m=h),h>p&&(p=h);Xn(n,d,m,u,p)&&o.push(a.element.id)}for(const{bus:a,geometry:i}of e.buses.values()){const{axis:l,at:s,span:d}=i,u=d/2,m=l==="x"?s[0]-u:s[0],p=l==="x"?s[0]+u:s[0],g=l==="x"?s[1]:s[1]-u,h=l==="x"?s[1]:s[1]+u;Xn(n,m,g,p,h)&&o.push(a.id)}for(const{junction:a,world:i}of e.junctions.values())Xn(n,i[0],i[1],i[0],i[1])&&o.push(a.id);const r=[];for(const a of t??[]){const i=__(a);Xn(n,i.minX,i.minY,i.maxX,i.maxY)&&r.push(a.id)}return{elements:o,annotations:r}}function Xn(e,t,n,o,r){return o>=e.x&&t<=e.x+e.w&&r>=e.y&&n<=e.y+e.h}function u4(e,t){const n=t.scale??1;let o=e[0]*n,r=e[1]*n;switch(t.mirror&&(o=-o),t.rot){case 0:break;case 90:[o,r]=[-r,o];break;case 180:[o,r]=[-o,-r];break;case 270:[o,r]=[r,-o];break}return[o+t.at[0],r+t.at[1]]}function m4(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function p4(e,t){const n=x.getState().internal;if(!e.includes(".")){const r=n.buses.get(e);if(r){const{axis:i,at:l,span:s}=r.geometry;if(i==="x"){const p=l[0]-s/2,g=l[0]+s/2,h=Math.max(p,Math.min(g,t[0]));return{ref:e,world:[h,l[1]],isBus:!0}}const d=l[1]-s/2,u=l[1]+s/2,m=Math.max(d,Math.min(u,t[1]));return{ref:e,world:[l[0],m],isBus:!0}}const a=n.junctions.get(e);return a?{ref:e,world:[a.world[0],a.world[1]],isBus:!1}:null}const o=n.terminals.get(e);return o?{ref:e,world:o.world,isBus:!1}:null}const Ua=10,Yn=e=>Math.round(e/Ua)*Ua,h4=16;function U_(e,t){let n=e[0],o=1/0;for(let r=0;r<e.length-1;r++){const[a,i]=e[r],[l,s]=e[r+1],d=l-a,u=s-i,m=d*d+u*u,p=m===0?0:Math.max(0,Math.min(1,((t[0]-a)*d+(t[1]-i)*u)/m)),g=a+p*d,h=i+p*u,f=(g-t[0])**2+(h-t[1])**2;f<o&&(o=f,n=[g,h])}return n}function ho(e,t){return typeof document<"u"?document.elementFromPoint(e,t):null}function f4(e,t){const n=x.getState().internal.wireRenders;let o=null,r=t;for(const a of n.values()){if(a.path.length<2)continue;const i=U_(a.path,e),l=Math.hypot(i[0]-e[0],i[1]-e[1]);l<=r&&(r=l,o={wireId:a.wireId,at:i})}return o}function wn(e,t,n){const o=e?Ao(e):null;if(o){const l=p4(o,t);if(l)return{spec:{end:o},world:l.world,ref:o,isBus:l.isBus,create:!1}}let r=e?yr(e):null,a=null;if(r){const l=x.getState().internal.wireRenders.get(r);a=l?U_(l.path,t):t}else{const l=f4(t,n);l&&(r=l.wireId,a=l.at)}if(r&&a){const l=[Yn(a[0]),Yn(a[1])];return{spec:{onWire:r,at:l},world:l,ref:null,isBus:!1,create:!0}}const i=[Yn(t[0]),Yn(t[1])];return{spec:{junctionAt:i},world:i,ref:null,isBus:!1,create:!0}}function vn(e,t,n){const o=e.viewport.screenToSvg(t,n),r=e.viewport.screenToSvg(t+h4,n);return Math.hypot(r[0]-o[0],r[1]-o[1])}function X_(e){return{ref:e.ref,world:e.world,isBus:e.isBus,...e.create?{create:"junction"}:{}}}function fo(e,t){return e.ref&&t.ref?e.ref===t.ref:!e.ref&&!t.ref?e.world[0]===t.world[0]&&e.world[1]===t.world[1]:!1}const Xa=3;function Go(e,t){return e.hostEl.querySelector(`[data-element-label="${Ye(t)}"] [data-element-label-body]`)}let Ce=null,Ue=null,Xe=null,Ne=null,De=null;const g4={id:"select",cursor:"default",onPointerDown(e,t){var p,g,h,f,b,y,w,j,_,E,W,Q,ke,we;if(e.button!==0||e.target instanceof Element&&e.target.closest(".ole-bus-handle, .ole-wire-handle, .ole-annotation-handle, .ole-health-marker"))return;const n=x.getState(),o=$n(e.target);if(o){e.preventDefault(),e.stopPropagation();const Y=n.diagram.elements.find(k=>k.id===o);if(!Y)return;n.selection.includes(o)||n.setSelection([o]),De={pointerId:e.pointerId,id:o,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),origin:[((p=Y.labelOffset)==null?void 0:p[0])??0,((g=Y.labelOffset)==null?void 0:g[1])??0],moved:!1};return}const r=An(e.target);if(r){e.preventDefault(),e.stopPropagation();const Y=(h=n.diagram.annotations)==null?void 0:h.find(D=>D.id===r);if(!Y)return;if(e.shiftKey){n.toggleAnnotationInSelection(r);return}if(n.selectedAnnotations.includes(r)&&n.selection.length+n.selectedAnnotations.length>1){Ya(e,t,n.selection,n.selectedAnnotations);return}const k=Qt(n)===r;n.setSelectedAnnotation(r),Ne={pointerId:e.pointerId,id:r,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),origin:[Y.at[0],Y.at[1]],moved:!1,wasSelected:k};return}const a=e.target instanceof Element?e.target.closest(".ole-junction-wire-handle"):null;if(a){const Y=(f=a.closest("[data-junction-id]"))==null?void 0:f.getAttribute("data-junction-id");if(Y){e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((y=(b=e.target).hasPointerCapture)!=null&&y.call(b,e.pointerId))&&e.target.releasePointerCapture(e.pointerId),t.hostEl.classList.add("tool-wire"),n.setWireFromTerminal(Y);const k=(w=n.internal.junctions.get(Y))==null?void 0:w.world;k&&n.setWireDragFrom({spec:{end:Y},world:k,ref:Y}),n.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY)),Xe={pointerId:e.pointerId,fromRef:Y};return}}const l=(e.target instanceof Element?(j=e.target.closest("[data-terminal-id]"))==null?void 0:j.getAttribute("data-terminal-id"):null)?Ao(e.target):null;if(l){const Y=l.indexOf("."),k=Y>0?l.slice(0,Y):"";if(k&&n.selection.includes(k)){e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((E=(_=e.target).hasPointerCapture)!=null&&E.call(_,e.pointerId))&&e.target.releasePointerCapture(e.pointerId),t.hostEl.classList.add("tool-wire"),n.setWireFromTerminal(l);const D=(W=n.internal.terminals.get(l))==null?void 0:W.world;D&&n.setWireDragFrom({spec:{end:l},world:D,ref:l}),n.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY)),Xe={pointerId:e.pointerId,fromRef:l};return}}let s=Nt(e.target);if(!s){const Y=yr(e.target);if(Y&&typeof document<"u"){const k=document.elementsFromPoint(e.clientX,e.clientY);for(const D of k){const M=(ke=(Q=D.closest)==null?void 0:Q.call(D,"[data-bus-id]"))==null?void 0:ke.getAttribute("data-bus-id");if(!M)continue;const G=(we=n.diagram.wires)==null?void 0:we.find(me=>me.id===Y);G&&(G.ends[0]===M||G.ends[1]===M)&&(s=M);break}}}if(!s){const Y=yr(e.target);if(Y){if(e.preventDefault(),e.altKey){const k=Eo(e.target);if(k){n.setSelectedNode(k);return}}n.setSelectedWire(Y);return}e.shiftKey||n.clearSelection(),Ue={pointerId:e.pointerId,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),shiftKey:e.shiftKey,baseSelection:e.shiftKey?n.selection.slice():[],baseAnnotations:e.shiftKey?n.selectedAnnotations.slice():[]},t.hostEl.setPointerCapture(e.pointerId),e.preventDefault();return}const d=n.selection;e.shiftKey?n.toggleInSelection(s):d.includes(s)||n.setSelection([s]);const u=x.getState(),m=e.shiftKey?u.selection:d.includes(s)?d:[s];Ya(e,t,m,u.selectedAnnotations)&&e.preventDefault()},onPointerMove(e,t){if(De&&e.pointerId===De.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=xe(n[0]-De.startSvg[0]),r=xe(n[1]-De.startSvg[1]);!De.moved&&(o!==0||r!==0)&&(De.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));const a=Go(t,De.id);a&&a.setAttribute("transform",`translate(${o} ${r})`);return}if(Ne&&e.pointerId===Ne.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=xe(n[0]-Ne.startSvg[0]),r=xe(n[1]-Ne.startSvg[1]);!Ne.moved&&(o!==0||r!==0)&&(Ne.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));const a=t.hostEl.querySelector(`[data-annotation-id="${Ye(Ne.id)}"]`);a&&a.setAttribute("transform",`translate(${o} ${r})`);return}if(Xe&&e.pointerId===Xe.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY);x.getState().setCursorSvg(n);const o=ho(e.clientX,e.clientY),r=wn(o,n,vn(t,e.clientX,e.clientY)),a={spec:{end:Xe.fromRef},world:[0,0],ref:Xe.fromRef};At(fo(a,r)?null:X_(r));return}if(Ce&&e.pointerId===Ce.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=xe(n[0]-Ce.startSvg[0]),r=xe(n[1]-Ce.startSvg[1]);!Ce.moved&&(o!==0||r!==0)&&(Ce.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));for(const[a,i]of Ce.originals){const l=t.hostEl.querySelector(`[data-element-id="${Ye(a)}"]`);if(!l)continue;const s={...i,at:[i.at[0]+o,i.at[1]+r]};l.setAttribute("transform",Et(s))}for(const a of Ce.busOriginals.keys()){const i=t.hostEl.querySelector(`[data-element-id="${Ye(a)}"]`);i&&i.setAttribute("transform",`translate(${o} ${r})`)}for(const a of Ce.junctionOriginals.keys()){const i=t.hostEl.querySelector(`[data-element-id="${Ye(a)}"]`);i&&i.setAttribute("transform",`translate(${o} ${r})`)}for(const a of Ce.annotationOriginals.keys()){const i=t.hostEl.querySelector(`[data-annotation-id="${Ye(a)}"]`);i&&i.setAttribute("transform",`translate(${o} ${r})`)}return}if(Ue&&e.pointerId===Ue.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY);qn(Qa(Ue.startSvg,n));return}},onPointerUp(e,t){var n;if(De&&e.pointerId===De.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=xe(o[0]-De.startSvg[0]),a=xe(o[1]-De.startSvg[1]),i=Go(t,De.id);if(i&&i.removeAttribute("transform"),De.moved&&(r!==0||a!==0)){const l=[De.origin[0]+r,De.origin[1]+a];x.getState().updateElement(De.id,{labelOffset:l[0]===0&&l[1]===0?void 0:l})}De=null;return}if(Ne&&e.pointerId===Ne.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=xe(o[0]-Ne.startSvg[0]),a=xe(o[1]-Ne.startSvg[1]),i=t.hostEl.querySelector(`[data-annotation-id="${Ye(Ne.id)}"]`);if(i&&i.removeAttribute("transform"),Ne.moved&&(r!==0||a!==0))x.getState().updateAnnotation(Ne.id,{at:[Ne.origin[0]+r,Ne.origin[1]+a]});else if(!Ne.moved&&Ne.wasSelected){const l=x.getState(),s=(n=l.diagram.annotations)==null?void 0:n.find(d=>d.id===Ne.id);s&&Za(l,s,o)}Ne=null;return}if(Xe&&e.pointerId===Xe.pointerId){const o=x.getState(),r=Xe.fromRef;Xe=null,t.hostEl.classList.remove("tool-wire"),o.setWireFromTerminal(null),o.setWireDragFrom(null),o.setCursorSvg(null),At(null);const a=t.viewport.screenToSvg(e.clientX,e.clientY),i=ho(e.clientX,e.clientY)??(e.target instanceof Element?e.target:null),l=wn(i,a,vn(t,e.clientX,e.clientY));if(fo({world:[0,0],ref:r},l))return;o.connectWire({end:r},l.spec);return}if(Ce&&e.pointerId===Ce.pointerId){if(t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId),Ce.moved){const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=xe(o[0]-Ce.startSvg[0]),a=xe(o[1]-Ce.startSvg[1]);if(r!==0||a!==0){const i=new Map;for(const s of Ce.originals.keys())i.set(s,[r,a]);for(const s of Ce.busOriginals.keys())i.set(s,[r,a]);for(const s of Ce.junctionOriginals.keys())i.set(s,[r,a]);const l=new Map;for(const s of Ce.annotationOriginals.keys())l.set(s,[r,a]);x.getState().moveElements(i,l)}for(const i of Ce.busOriginals.keys()){const l=t.hostEl.querySelector(`[data-element-id="${Ye(i)}"]`);l&&l.removeAttribute("transform")}for(const i of Ce.junctionOriginals.keys()){const l=t.hostEl.querySelector(`[data-element-id="${Ye(i)}"]`);l&&l.removeAttribute("transform")}for(const i of Ce.annotationOriginals.keys()){const l=t.hostEl.querySelector(`[data-annotation-id="${Ye(i)}"]`);l&&l.removeAttribute("transform")}}Ce=null;return}if(Ue&&e.pointerId===Ue.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=Qa(Ue.startSvg,o);if(r.w>=Xa||r.h>=Xa){const a=x.getState(),i=d4(a.internal,a.diagram.annotations,r);Ue.shiftKey?a.setSelection(Ja(Ue.baseSelection,i.elements),Ja(Ue.baseAnnotations,i.annotations)):a.setSelection(i.elements,i.annotations)}qn(null),Ue=null}},onPointerCancel(e,t){var n,o,r,a,i,l,s,d;if(De&&e.pointerId===De.pointerId){const u=Go(t,De.id);if(u&&u.removeAttribute("transform"),(o=(n=t.hostEl).hasPointerCapture)!=null&&o.call(n,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}De=null}if(Ne&&e.pointerId===Ne.pointerId){const u=t.hostEl.querySelector(`[data-annotation-id="${Ye(Ne.id)}"]`);if(u&&u.removeAttribute("transform"),(a=(r=t.hostEl).hasPointerCapture)!=null&&a.call(r,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}Ne=null}if(Ce&&e.pointerId===Ce.pointerId){for(const[u,m]of Ce.originals){const p=t.hostEl.querySelector(`[data-element-id="${Ye(u)}"]`);p&&p.setAttribute("transform",Et(m))}for(const u of Ce.busOriginals.keys()){const m=t.hostEl.querySelector(`[data-element-id="${Ye(u)}"]`);m&&m.removeAttribute("transform")}for(const u of Ce.junctionOriginals.keys()){const m=t.hostEl.querySelector(`[data-element-id="${Ye(u)}"]`);m&&m.removeAttribute("transform")}for(const u of Ce.annotationOriginals.keys()){const m=t.hostEl.querySelector(`[data-annotation-id="${Ye(u)}"]`);m&&m.removeAttribute("transform")}if((l=(i=t.hostEl).hasPointerCapture)!=null&&l.call(i,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}Ce=null}if(Xe&&e.pointerId===Xe.pointerId){t.hostEl.classList.remove("tool-wire");const u=x.getState();u.setWireFromTerminal(null),u.setWireDragFrom(null),u.setCursorSvg(null),At(null),Xe=null}if(Ue&&e.pointerId===Ue.pointerId){if((d=(s=t.hostEl).hasPointerCapture)!=null&&d.call(s,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}qn(null),Ue=null}},onDoubleClick(e,t){var a;const n=x.getState(),o=An(e.target);if(o){e.preventDefault(),e.stopPropagation();const i=(a=n.diagram.annotations)==null?void 0:a.find(l=>l.id===o);if(!i)return;n.setSelectedAnnotation(o),Za(n,i,t.viewport.screenToSvg(e.clientX,e.clientY));return}const r=$n(e.target)??Nt(e.target);r&&(e.preventDefault(),e.stopPropagation(),n.setEditingElement(r))},onDeactivate(e){if(Ce=null,Ue=null,Ne=null,De=null,Xe){e.hostEl.classList.remove("tool-wire");const t=x.getState();t.setWireFromTerminal(null),t.setWireDragFrom(null),t.setCursorSvg(null),At(null),Xe=null}qn(null)}};function Ya(e,t,n,o){const r=x.getState(),a=r.internal,i=new Map,l=new Map,s=new Map,d=new Map;for(const m of n){const p=a.buses.get(m);if(p){l.set(m,[p.geometry.at[0],p.geometry.at[1]]);continue}const g=a.junctions.get(m);if(g){s.set(m,[g.world[0],g.world[1]]);continue}const h=a.layout.get(m);h&&i.set(m,{...h})}const u=r.diagram.annotations??[];for(const m of o){const p=u.find(g=>g.id===m);p&&d.set(m,[p.at[0],p.at[1]])}return i.size===0&&l.size===0&&s.size===0&&d.size===0?!1:(Ce={pointerId:e.pointerId,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),originals:i,busOriginals:l,junctionOriginals:s,annotationOriginals:d,moved:!1},!0)}function Za(e,t,n){const o=ut(t);if(o==="table"){const r=K6(t,n);r&&(e.setEditingAnnotation(t.id),e.setEditingCell(r))}else o==="text"&&e.setEditingAnnotation(t.id)}function Qa(e,t){const n=Math.min(e[0],t[0]),o=Math.min(e[1],t[1]),r=Math.abs(t[0]-e[0]),a=Math.abs(t[1]-e[1]);return{x:n,y:o,w:r,h:a}}function Ja(e,t){const n=new Set(e);for(const o of t)n.has(o)?n.delete(o):n.add(o);return[...n]}function Ye(e){return e.replace(/(["\\])/g,"\\$1")}const b4=4;let ve=null;const y4={id:"pan",cursor:"grab",onPointerDown(e,t){if(e.button!==0)return;const n=t.viewport.getViewport(),o=x.getState().readOnly?null:Nt(e.target);let r=null;if(o){const a=x.getState();a.selection.includes(o)||a.setSelection([o]);const i=x.getState().selection,l=x.getState().internal,s=new Map,d=new Map;for(const u of i){const m=l.buses.get(u);if(m){d.set(u,[m.geometry.at[0],m.geometry.at[1]]);continue}const p=l.layout.get(u);p&&s.set(u,{...p})}(s.size>0||d.size>0)&&(r={startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),originals:s,busOriginals:d})}ve={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startTx:n.tx,startTy:n.ty,startTarget:e.target,moved:!1,elementDrag:r},t.hostEl.style.cursor="grabbing",e.preventDefault()},onPointerMove(e,t){if(!ve||e.pointerId!==ve.pointerId)return;const n=e.clientX-ve.startX,o=e.clientY-ve.startY;if(!ve.moved&&Math.hypot(n,o)>b4){ve.moved=!0;try{t.hostEl.setPointerCapture(e.pointerId)}catch{}}if(ve.moved){if(ve.elementDrag){const r=t.viewport.screenToSvg(e.clientX,e.clientY),a=xe(r[0]-ve.elementDrag.startSvg[0]),i=xe(r[1]-ve.elementDrag.startSvg[1]);for(const[l,s]of ve.elementDrag.originals){const d=t.hostEl.querySelector(`[data-element-id="${pn(l)}"]`);if(!d)continue;const u={...s,at:[s.at[0]+a,s.at[1]+i]};d.setAttribute("transform",Et(u))}for(const l of ve.elementDrag.busOriginals.keys()){const s=t.hostEl.querySelector(`[data-element-id="${pn(l)}"]`);s&&s.setAttribute("transform",`translate(${a} ${i})`)}return}t.viewport.setViewport({tx:ve.startTx+n,ty:ve.startTy+o})}},onPointerUp(e,t){if(!(!ve||e.pointerId!==ve.pointerId)){if(t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId),t.hostEl.style.cursor="grab",ve.elementDrag&&ve.moved){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=xe(n[0]-ve.elementDrag.startSvg[0]),r=xe(n[1]-ve.elementDrag.startSvg[1]);if(o!==0||r!==0){const a=new Map;for(const i of ve.elementDrag.originals.keys())a.set(i,[o,r]);for(const i of ve.elementDrag.busOriginals.keys())a.set(i,[o,r]);x.getState().moveElements(a)}for(const a of ve.elementDrag.busOriginals.keys()){const i=t.hostEl.querySelector(`[data-element-id="${pn(a)}"]`);i&&i.removeAttribute("transform")}}else!ve.moved&&!x.getState().readOnly&&x4(ve.startTarget);ve=null}},onPointerCancel(e,t){if(ve!=null&&ve.elementDrag){for(const[n,o]of ve.elementDrag.originals){const r=t.hostEl.querySelector(`[data-element-id="${pn(n)}"]`);r&&r.setAttribute("transform",Et(o))}for(const n of ve.elementDrag.busOriginals.keys()){const o=t.hostEl.querySelector(`[data-element-id="${pn(n)}"]`);o&&o.removeAttribute("transform")}}ve=null},onDeactivate(){ve=null}};function x4(e){if(!e)return;const t=x.getState(),n=An(e);if(n){t.setSelectedAnnotation(n);return}const o=Nt(e);if(o){t.setSelection([o]);return}const r=Eo(e);if(r){t.setSelectedNode(r);return}t.clearSelection()}function pn(e){return e.replace(/(["\\])/g,"\\$1")}const gn={tight:1024,compact:720,dense:520,mini:380},ei={full:0,tight:1,compact:2,dense:3,mini:4};function it(e,t){return ei[e]>=ei[t]}function w4(e){return e>=gn.tight?"full":e>=gn.compact?"tight":e>=gn.dense?"compact":e>=gn.mini?"dense":"mini"}const Y_=$.createContext("full");function Pt(){return $.useContext(Y_)}function v4(e){const[t,n]=$.useState(null);return $.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const i=o.clientWidth;n(l=>l===i?l:i)};if(r(),typeof ResizeObserver>"u")return;const a=new ResizeObserver(r);return a.observe(o),()=>a.disconnect()},[e]),t}function Z_(){if(typeof window>"u")return!1;try{if(!window.matchMedia("(pointer: coarse)").matches)return!1}catch{return!1}return window.innerWidth<gn.dense}function It(){Z_()&&x.getState().setActiveTool("pan")}function k4(){Z_()&&x.getState().setPlaceKind(null)}const S4={id:"wire",cursor:"crosshair",onActivate(e){e.hostEl.classList.add("tool-wire")},onDeactivate(e){e.hostEl.classList.remove("tool-wire");const t=x.getState();t.setWireFromTerminal(null),t.setWireDragFrom(null),t.setCursorSvg(null),At(null)},onPointerDown(e,t){var i,l;if(e.button!==0)return;e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((l=(i=e.target).hasPointerCapture)!=null&&l.call(i,e.pointerId))&&e.target.releasePointerCapture(e.pointerId);const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=vn(t,e.clientX,e.clientY),r=wn(e.target instanceof Element?e.target:null,n,o),a=x.getState();a.setWireDragFrom({spec:r.spec,world:r.world,ref:r.ref}),a.setWireFromTerminal(r.ref),a.setCursorSvg(n)},onPointerMove(e,t){const n=x.getState(),o=n.wireDragFrom;if(!o)return;const r=t.viewport.screenToSvg(e.clientX,e.clientY);n.setCursorSvg(r);const a=ho(e.clientX,e.clientY),i=wn(a,r,vn(t,e.clientX,e.clientY)),l={spec:o.spec,world:o.world,ref:o.ref,create:!o.ref};At(fo(l,i)?null:X_(i))},onPointerUp(e,t){const n=x.getState(),o=n.wireDragFrom;if(n.setWireFromTerminal(null),n.setWireDragFrom(null),n.setCursorSvg(null),At(null),!o)return;const r=t.viewport.screenToSvg(e.clientX,e.clientY),a=ho(e.clientX,e.clientY)??(e.target instanceof Element?e.target:null),i=wn(a,r,vn(t,e.clientX,e.clientY)),l={spec:o.spec,world:o.world,ref:o.ref,create:!o.ref};fo(l,i)||(n.connectWire(o.spec,i.spec),It())},onPointerLeave(){const e=x.getState();e.setWireFromTerminal(null),e.setWireDragFrom(null),e.setCursorSvg(null),At(null)}},ti=10;let hn=!1;function ni(){setTimeout(()=>k4(),0)}const _4={id:"place",cursor:"copy",onActivate(e){e.hostEl.classList.add("tool-place")},onDeactivate(e){e.hostEl.classList.remove("tool-place");const t=x.getState();t.setPlaceFromTerminal(null),t.setCursorSvg(null),hn=!1},onPointerDown(e,t){var a,i;if(e.button!==0)return;const{placeKind:n}=x.getState();if(!n)return;e.preventDefault();const o=Ao(e.target);if(o){e.stopPropagation(),e.target instanceof Element&&((i=(a=e.target).hasPointerCapture)!=null&&i.call(a,e.pointerId))&&e.target.releasePointerCapture(e.pointerId);const l=x.getState();l.setPlaceFromTerminal(o),l.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY));return}const r=t.viewport.screenToSvg(e.clientX,e.clientY);c_(n,r),hn=!0},onPointerMove(e,t){const n=t.viewport.screenToSvg(e.clientX,e.clientY);x.getState().setCursorSvg([oi(n[0]),oi(n[1])])},onPointerUp(e,t){const n=x.getState(),o=n.placeFromTerminal;if(o){n.setPlaceFromTerminal(null);const{placeKind:r}=n;if(!r)return;const a=t.viewport.screenToSvg(e.clientX,e.clientY);M6(r,o,a),ni();return}hn&&(hn=!1,ni())},onPointerLeave(){const e=x.getState();e.setPlaceFromTerminal(null),e.setCursorSvg(null)},onPointerCancel(){const e=x.getState();e.setPlaceFromTerminal(null),e.setCursorSvg(null),hn=!1}};function oi(e){return Math.round(e/ti)*ti}const ri=10,ai=20;function Wt(e){return Math.round(e/ri)*ri}const C4={id:"busbar",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=[Wt(n[0]),Wt(n[1])];x.getState().setBusbarDrawStart(o),x.getState().setCursorSvg(o)},onPointerMove(e,t){const n=t.viewport.screenToSvg(e.clientX,e.clientY);x.getState().setCursorSvg([Wt(n[0]),Wt(n[1])])},onPointerUp(e,t){const n=x.getState().busbarDrawStart;if(x.getState().setBusbarDrawStart(null),!n)return;const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=Wt(o[0]),a=Wt(o[1]),i=r-n[0],l=a-n[1],s=Math.abs(i)>=Math.abs(l);let d,u,m;if(s){if(u=Math.abs(i),u<ai)return;d=0,m=[(n[0]+r)/2,n[1]]}else{if(u=Math.abs(l),u<ai)return;d=90,m=[n[0],(n[1]+a)/2]}x.getState().addBus(m,u,d),It()},onPointerLeave(){const e=x.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)},onPointerCancel(){const e=x.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)},onDeactivate(){const e=x.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)}},ii=10,si=e=>Math.round(e/ii)*ii,j4={id:"junction",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault(),e.stopPropagation();const n=t.viewport.screenToSvg(e.clientX,e.clientY);x.getState().addJunction([si(n[0]),si(n[1])]),It()}},$4={id:"text",cursor:"text",onPointerDown(e,t){if(e.button!==0)return;const n=x.getState(),o=An(e.target);if(o){e.preventDefault(),e.stopPropagation(),n.setActiveTool("select"),n.setSelectedAnnotation(o);return}e.preventDefault();const r=t.viewport.screenToSvg(e.clientX,e.clientY),a=n.addAnnotation([r[0],r[1]],"");n.setEditingAnnotation(a),It()}},A4={id:"rect",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=rt(t.viewport.screenToSvg(e.clientX,e.clientY));x.getState().setAnnotationDraft({kind:"rect",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=x.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:rt(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=x.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=rt(t.viewport.screenToSvg(e.clientX,e.clientY)),{at:a,size:i}=uo({...o,current:r,constrain:e.shiftKey});if(i[0]<Ut||i[1]<Ut)return;const l=n.insertAnnotation({type:"rect",at:a,size:i,stroke:"dashed"});n.setSelectedAnnotation(l),n.setActiveTool("select"),It()},onPointerLeave(){x.getState().setAnnotationDraft(null)},onPointerCancel(){x.getState().setAnnotationDraft(null)},onDeactivate(){x.getState().setAnnotationDraft(null)}},E4={id:"ellipse",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=rt(t.viewport.screenToSvg(e.clientX,e.clientY));x.getState().setAnnotationDraft({kind:"ellipse",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=x.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:rt(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=x.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=rt(t.viewport.screenToSvg(e.clientX,e.clientY)),{at:a,size:i}=uo({...o,current:r,constrain:e.shiftKey});if(i[0]<Ut||i[1]<Ut)return;const l=n.insertAnnotation({type:"ellipse",at:a,size:i});n.setSelectedAnnotation(l),n.setActiveTool("select"),It()},onPointerLeave(){x.getState().setAnnotationDraft(null)},onPointerCancel(){x.getState().setAnnotationDraft(null)},onDeactivate(){x.getState().setAnnotationDraft(null)}},N4={id:"line",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=rt(t.viewport.screenToSvg(e.clientX,e.clientY));x.getState().setAnnotationDraft({kind:"line",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=x.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:rt(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=x.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=rt(t.viewport.screenToSvg(e.clientX,e.clientY)),a=w_({...o,current:r,constrain:e.shiftKey}),i=a[0]-o.start[0],l=a[1]-o.start[1];if(Math.hypot(i,l)<q6)return;const s=n.insertAnnotation({type:"line",at:o.start,points:[[0,0],[i,l]]});n.setSelectedAnnotation(s),n.setActiveTool("select"),It()},onPointerLeave(){x.getState().setAnnotationDraft(null)},onPointerCancel(){x.getState().setAnnotationDraft(null)},onDeactivate(){x.getState().setAnnotationDraft(null)}},li=15,T4=3,P4=3,I4={id:"table",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=rt(t.viewport.screenToSvg(e.clientX,e.clientY));x.getState().setAnnotationDraft({kind:"table",start:n,current:n,constrain:!1})},onPointerMove(e,t){const n=x.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:rt(t.viewport.screenToSvg(e.clientX,e.clientY))})},onPointerUp(e,t){const n=x.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=rt(t.viewport.screenToSvg(e.clientX,e.clientY)),a=Math.abs(r[0]-o.start[0]),i=Math.abs(r[1]-o.start[1]),l=a<li&&i<li,{at:s,cols:d,rows:u}=l?{at:o.start,cols:T4,rows:P4}:k_({...o,current:r}),m=n.insertAnnotation({type:"table",at:s,...S_(d,u)});n.setSelectedAnnotation(m),n.setActiveTool("select"),It()},onPointerLeave(){x.getState().setAnnotationDraft(null)},onPointerCancel(){x.getState().setAnnotationDraft(null)},onDeactivate(){x.getState().setAnnotationDraft(null)}},ci={select:g4,pan:y4,wire:S4,place:_4,busbar:C4,junction:j4,text:$4,rect:A4,ellipse:E4,line:N4,table:I4};function z4(e,t){const n=x(r=>r.activeTool),o=x(r=>r.readOnly);$.useEffect(()=>{var h;const r=e.current;if(!r)return;const a=o?"pan":n,i=o?ci.pan:ci[n],l={viewport:t,hostEl:r};r.dataset.tool=a,(h=i.onActivate)==null||h.call(i,l),i.cursor&&(r.style.cursor=i.cursor);const s=f=>{var b;return(b=i.onPointerDown)==null?void 0:b.call(i,f,l)},d=f=>{var b;return(b=i.onPointerMove)==null?void 0:b.call(i,f,l)},u=f=>{var b;return(b=i.onPointerUp)==null?void 0:b.call(i,f,l)},m=f=>{var b;return i.onPointerCancel?i.onPointerCancel(f,l):(b=i.onPointerUp)==null?void 0:b.call(i,f,l)},p=f=>{var b;return(b=i.onPointerLeave)==null?void 0:b.call(i,f,l)},g=f=>{var b;return(b=i.onDoubleClick)==null?void 0:b.call(i,f,l)};return r.addEventListener("pointerdown",s),r.addEventListener("pointermove",d),r.addEventListener("pointerup",u),r.addEventListener("pointercancel",m),r.addEventListener("pointerleave",p),r.addEventListener("dblclick",g),()=>{var f;r.removeEventListener("pointerdown",s),r.removeEventListener("pointermove",d),r.removeEventListener("pointerup",u),r.removeEventListener("pointercancel",m),r.removeEventListener("pointerleave",p),r.removeEventListener("dblclick",g),(f=i.onDeactivate)==null||f.call(i,l),r.style.cursor="",delete r.dataset.tool}},[n,o,e,t])}let vr=1;const kr=new Set;function M4(e){if(e!==vr){vr=e;for(const t of kr)t(e)}}function D4(){return vr}function O4(e){return kr.add(e),()=>{kr.delete(e)}}const Ko=.1,Uo=8,R4=1.0015,L4=1.02;function Q_(e,t,n={tx:0,ty:0,scale:1},o={}){const r=o.shared??!0,a=$.useRef({...n}),i=$.useRef(new Set),l=()=>{const s=t.current,d=e.current;if(s&&s.setAttribute("transform",`translate(${a.current.tx} ${a.current.ty}) scale(${a.current.scale})`),d&&d.style.setProperty("--canvas-scale",String(a.current.scale)),r&&M4(a.current.scale),i.current.size>0){const u={...a.current};for(const m of i.current)m(u)}};return $.useEffect(()=>{const s=e.current;if(!s)return;let d=!1,u=-1,m=0,p=0,g=0,h=0,f=!1;const b=new Map;let y=null,w=!1;const j=()=>{if(b.size<2){y=null;return}const M=[...b.values()],G=M[1].x-M[0].x,me=M[1].y-M[0].y,pe=Math.hypot(G,me)||1,te=s.getBoundingClientRect();y={startDist:pe,startScale:a.current.scale,startTx:a.current.tx,startTy:a.current.ty,startMidX:(M[0].x+M[1].x)/2-te.left,startMidY:(M[0].y+M[1].y)/2-te.top}},_=M=>{if(M.pointerType==="touch"){if(b.set(M.pointerId,{x:M.clientX,y:M.clientY}),b.size>=2&&!w){w=!0;for(const G of b.keys())G!==M.pointerId&&G_(s,G);j()}if(w){M.stopPropagation(),M.preventDefault();try{s.setPointerCapture(M.pointerId)}catch{}}}},E=M=>{if(M.pointerType!=="touch"||!b.has(M.pointerId)||(b.set(M.pointerId,{x:M.clientX,y:M.clientY}),!w||!y))return;M.stopPropagation();const G=[...b.values()];if(G.length<2)return;const me=G[1].x-G[0].x,pe=G[1].y-G[0].y,te=Math.hypot(me,pe)||1,Se=s.getBoundingClientRect(),ie=(G[0].x+G[1].x)/2-Se.left,_e=(G[0].y+G[1].y)/2-Se.top,Ie=te/y.startDist,Oe=Xo(y.startScale*Ie,Ko,Uo),O=Oe/y.startScale;a.current.tx=y.startMidX-(y.startMidX-y.startTx)*O+(ie-y.startMidX),a.current.ty=y.startMidY-(y.startMidY-y.startTy)*O+(_e-y.startMidY),a.current.scale=Oe,l()},W=M=>{var G;if(M.pointerType==="touch"&&b.has(M.pointerId)&&(b.delete(M.pointerId),w)){if(M.stopPropagation(),(G=s.hasPointerCapture)!=null&&G.call(s,M.pointerId))try{s.releasePointerCapture(M.pointerId)}catch{}b.size>=2?j():y=null,b.size===0&&(w=!1)}},Q=M=>{M.preventDefault();const G=s.getBoundingClientRect(),me=M.clientX-G.left,pe=M.clientY-G.top,te=M.ctrlKey||M.metaKey;if(M.deltaX===0||te){const _e=Math.pow(te?L4:R4,-M.deltaY),Ie=Xo(a.current.scale*_e,Ko,Uo),Oe=Ie/a.current.scale;a.current.tx=me-(me-a.current.tx)*Oe,a.current.ty=pe-(pe-a.current.ty)*Oe,a.current.scale=Ie}else a.current.tx-=M.deltaX,a.current.ty-=M.deltaY;l()},ke=M=>{const G=M.button===1,me=f&&M.button===0;!G&&!me||(M.preventDefault(),d=!0,u=M.pointerId,m=M.clientX,p=M.clientY,g=a.current.tx,h=a.current.ty,s.setPointerCapture(M.pointerId),s.style.cursor="grabbing")},we=M=>{!d||M.pointerId!==u||(a.current.tx=g+(M.clientX-m),a.current.ty=h+(M.clientY-p),l())},Y=M=>{d&&M.pointerId===u&&(d=!1,s.releasePointerCapture(M.pointerId),s.style.cursor=f?"grab":"")},k=M=>{if(M.code==="Space"&&!f){const G=M.target;if(G&&(G.tagName==="INPUT"||G.tagName==="TEXTAREA"||G.isContentEditable))return;f=!0,s.style.cursor="grab",M.preventDefault()}},D=M=>{M.code==="Space"&&(f=!1,d||(s.style.cursor=""))};return s.addEventListener("wheel",Q,{passive:!1}),s.addEventListener("pointerdown",ke),s.addEventListener("pointermove",we),s.addEventListener("pointerup",Y),s.addEventListener("pointercancel",Y),s.addEventListener("pointerdown",_,{capture:!0}),s.addEventListener("pointermove",E,{capture:!0}),s.addEventListener("pointerup",W,{capture:!0}),s.addEventListener("pointercancel",W,{capture:!0}),window.addEventListener("keydown",k),window.addEventListener("keyup",D),l(),()=>{s.removeEventListener("wheel",Q),s.removeEventListener("pointerdown",ke),s.removeEventListener("pointermove",we),s.removeEventListener("pointerup",Y),s.removeEventListener("pointercancel",Y),s.removeEventListener("pointerdown",_,{capture:!0}),s.removeEventListener("pointermove",E,{capture:!0}),s.removeEventListener("pointerup",W,{capture:!0}),s.removeEventListener("pointercancel",W,{capture:!0}),window.removeEventListener("keydown",k),window.removeEventListener("keyup",D)}},[]),$.useMemo(()=>({screenToSvg(s,d){const u=e.current;if(!u)return[s,d];const m=u.getBoundingClientRect(),p=(s-m.left-a.current.tx)/a.current.scale,g=(d-m.top-a.current.ty)/a.current.scale;return[p,g]},getViewport(){return{...a.current}},setViewport(s){s.tx!==void 0&&(a.current.tx=s.tx),s.ty!==void 0&&(a.current.ty=s.ty),s.scale!==void 0&&(a.current.scale=Xo(s.scale,Ko,Uo)),l()},subscribe(s){return i.current.add(s),()=>{i.current.delete(s)}}}),[])}function Xo(e,t,n){return e<t?t:e>n?n:e}const J_=typeof navigator<"u"&&/Mac|iP(ad|hone|od)/.test(navigator.platform),qt=J_?"⌘":"Ctrl+",B4=J_?"⇧":"Shift+",Yo=[10,20,50,100,200,500,1e3,2e3,5e3,1e4],H4=18;function F4(e){for(const t of Yo)if(t*e>=H4)return t;return Yo[Yo.length-1]}function W4(){const e=re(),t=$.useRef(null),n=$.useRef(null),o=$.useRef(null),r=Q_(t,n);z4(t,r),c4(t),$.useEffect(()=>(Da(r),()=>Da(null)),[r]),$.useEffect(()=>{const u=m=>{const p=o.current;if(!p)return;const h=F4(m.scale)*m.scale;p.setAttribute("width",String(h)),p.setAttribute("height",String(h)),p.setAttribute("patternTransform",`translate(${m.tx} ${m.ty})`)};return u(r.getViewport()),r.subscribe(u)},[r]);const a=Hj(),i=$.useCallback((u,m,p)=>{const g=x.getState();if(g.readOnly)return;const h=g.activeTool;if(h==="wire"||h==="busbar"||h==="junction"||h==="place"){K_();return}const f=An(p),b=f?null:$n(p)??Nt(p);if(f)g.selectedAnnotations.includes(f)||g.setSelectedAnnotation(f);else if(b)g.selection.includes(b)||g.setSelection([b]);else{const k=Eo(p);k&&g.selectedNode!==k&&g.setSelectedNode(k)}const y=x.getState(),w=y.selection.length>0,j=y.selectedAnnotations.length>0,_=w||j,E=y.selectedNode!=null,W=!!y.clipboard,Q=y.diagram.elements.length>0,ke=new Set(y.selection),we=y.diagram.elements.some(k=>ke.has(k.id)&&k.labelOffset!==void 0),Y=[{label:e("menu.undo"),shortcut:`${qt}Z`,icon:io,onSelect:()=>x.getState().undo(),disabled:y.past.length===0},{label:e("menu.redo"),shortcut:`${qt}${B4}Z`,icon:Ar,onSelect:()=>x.getState().redo(),disabled:y.future.length===0},{type:"separator"},{label:e("menu.cut"),shortcut:`${qt}X`,icon:Zi,onSelect:()=>x.getState().cutSelection(),disabled:!_},{label:e("menu.copy"),shortcut:`${qt}C`,icon:Gi,onSelect:()=>x.getState().copySelection(),disabled:!_},{label:e("menu.paste"),shortcut:`${qt}V`,icon:Vi,onSelect:()=>x.getState().pasteClipboard(),disabled:!W},{type:"separator"},{label:e("menu.rotate"),shortcut:"R",icon:Yi,onSelect:()=>x.getState().rotateSelection(90),disabled:!w},{label:e("menu.mirror"),shortcut:"M",icon:Ki,onSelect:()=>x.getState().mirrorSelection(),disabled:!w},{label:e("menu.resetLabel"),icon:io,onSelect:()=>x.getState().resetSelectionLabelOffset(),disabled:!we},{type:"separator"},{label:e("menu.selectAll"),shortcut:`${qt}A`,icon:aj,onSelect:()=>{const k=x.getState();k.setSelection(k.diagram.elements.map(D=>D.id))},disabled:!Q},{type:"separator"},{label:e(E&&!_?"menu.disconnect":"menu.delete"),shortcut:"Del",icon:Ji,destructive:!0,onSelect:()=>{const k=x.getState();E&&!_?k.deleteSelectedNode():k.deleteSelection()},disabled:!_&&!E}];a.open(u,m,Y)},[a,e]);$.useEffect(()=>{const u=t.current;if(!u)return;const m=700,p=4;let g,h=null;const f=()=>{g!==void 0&&window.clearTimeout(g),g=void 0,h=null},b=j=>{j.pointerType==="touch"&&(f(),h={pointerId:j.pointerId,x:j.clientX,y:j.clientY,target:j.target},g=window.setTimeout(()=>{const _=h;h=null,g=void 0,_&&(G_(u,_.pointerId),i(_.x,_.y,_.target))},m))},y=j=>{if(!h||j.pointerId!==h.pointerId)return;const _=j.clientX-h.x,E=j.clientY-h.y;Math.hypot(_,E)>p&&f()},w=j=>{!h||j.pointerId!==h.pointerId||f()};return u.addEventListener("pointerdown",b),u.addEventListener("pointermove",y),u.addEventListener("pointerup",w),u.addEventListener("pointercancel",w),()=>{f(),u.removeEventListener("pointerdown",b),u.removeEventListener("pointermove",y),u.removeEventListener("pointerup",w),u.removeEventListener("pointercancel",w)}},[i]);const l=u=>{u.dataTransfer.types.includes("application/x-oneline-kind")&&(u.preventDefault(),u.dataTransfer.dropEffect="copy")},s=u=>{if(x.getState().readOnly)return;const m=u.dataTransfer.getData("application/x-oneline-kind");if(!m)return;u.preventDefault();const p=r.screenToSvg(u.clientX,u.clientY);c_(m,p)},d=u=>{u.preventDefault(),i(u.clientX,u.clientY,u.target)};return c.jsx("div",{ref:t,className:"ole-canvas-root absolute inset-0 overflow-hidden",onDragOver:l,onDrop:s,onContextMenu:d,children:c.jsxs("svg",{className:"ole-canvas-svg block h-full w-full",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("defs",{children:c.jsx("pattern",{ref:o,id:"ole-grid-dots",width:20,height:20,patternUnits:"userSpaceOnUse",children:c.jsx("circle",{cx:0,cy:0,r:2,fill:"var(--canvas-grid-strong)"})})}),c.jsx("rect",{width:"100%",height:"100%",fill:"url(#ole-grid-dots)"}),c.jsxs("g",{ref:n,className:"ole-viewport",children:[c.jsx(T_,{}),c.jsx(V_,{}),c.jsx(P_,{}),c.jsx(z_,{}),c.jsx(g_,{}),c.jsx(C_,{}),c.jsx(D_,{}),c.jsx(mT,{}),c.jsx(pT,{}),c.jsx(nT,{}),c.jsx(IT,{}),c.jsx(KT,{}),c.jsx(UT,{}),c.jsx(JT,{}),c.jsx(bT,{}),c.jsx(tT,{}),c.jsx(NT,{}),c.jsx(ET,{})]})]})})}const di=60,q4=.1,V4=8,G4=8,K4=["[data-element-id]","[data-wire-id]","[data-element-label]","[data-wire-label]","[data-annotation-id]"].join(", ");function U4(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(const a of e)a.width===0&&a.height===0||(a.left<t&&(t=a.left),a.top<n&&(n=a.top),a.right>o&&(o=a.right),a.bottom>r&&(r=a.bottom));return t===1/0?null:{left:t,top:n,right:o,bottom:r}}function X4(e,t,n){return e<t?t:e>n?n:e}function eC(){return document.querySelector(".ole-canvas-root")}function Fr(){const e=st(),t=eC();return!e||!t?!1:to(e,t)}function to(e,t){const n=t.getBoundingClientRect();if(n.width===0||n.height===0)return!1;const o=t.querySelectorAll(K4);if(o.length===0)return e.setViewport({tx:n.width/2,ty:n.height/2,scale:1}),!0;const r=U4(Array.from(o,w=>w.getBoundingClientRect()));if(!r)return!1;const{left:a,top:i,right:l,bottom:s}=r,[d,u]=e.screenToSvg(a,i),[m,p]=e.screenToSvg(l,s),g=Math.max(m-d,1),h=Math.max(p-u,1),f=X4(Math.min((n.width-di*2)/g,(n.height-di*2)/h),q4,V4),b=(d+m)/2,y=(u+p)/2;return e.setViewport({tx:n.width/2-f*b,ty:n.height/2-f*y,scale:f}),!0}function tC(e){const t=st(),n=eC();if(!t||!n)return!1;const o=n.getBoundingClientRect();if(o.width===0||o.height===0)return!1;const{scale:r}=t.getViewport();return t.setViewport({tx:o.width/2-r*e[0],ty:o.height/2-r*e[1]}),!0}function Wr(){let e=G4;const t=()=>{Fr()||--e>0&&requestAnimationFrame(t)};requestAnimationFrame(t)}const Y4={"arc-suppression-coil.name":"消弧线圈","arrester.name":"避雷器 (FBL)","async-motor.name":"异步电动机","autotransformer.name":"自耦变压器","battery.name":"电池储能","breaker.name":"断路器 (QF)","busbar.name":"母线段","busduct.name":"母线槽","busduct-tap.name":"母线槽插接段","converter-bidir.name":"双向变流器 (PCS)","dc-dc-converter.name":"DC/DC 变换器","mppt.name":"MPPT 控制器","ct.name":"电流互感器 (CT)","disconnector.name":"隔离开关 (QS)","earth.name":"接地","earthing-switch.name":"接地刀闸 (QE)","fuse.name":"熔断器 (FU)","generator.name":"发电机 (G)","grid-source.name":"系统电源","grounding-transformer.name":"接地变 (Z形)","inverter.name":"逆变器 (DC→AC)","load-switch.name":"负荷开关","load.name":"负荷","luminaire.name":"灯具 / 照明负荷","panelboard.name":"配电箱","ngr.name":"中性点电阻 (NGR)","pt.name":"电压互感器 (PT)","pv.name":"光伏组件","rectifier.name":"整流器 (AC→DC)","series-reactor.name":"串联电抗器","shunt-capacitor.name":"并联电容器","shunt-reactor.name":"并联电抗器","sync-motor.name":"同步电动机","transformer-2w.name":"双绕组变压器","transformer-3w.name":"三绕组变压器","wind-turbine.name":"风力发电机","gfci-breaker.name":"GFCI 断路器 (RCBO)","rcd.name":"剩余电流装置 (RCD)","recloser.name":"重合闸 (Recloser)","energy-meter.name":"电能表 (Wh)","voltmeter.name":"电压表 (V)","ammeter.name":"电流表 (A)","wattmeter.name":"功率表 (W)","frequency-meter.name":"频率表 (Hz)","contactor.name":"接触器 (KM)","motor-starter.name":"电机启动器","thermal-overload.name":"热过载继电器","vfd.name":"变频器 (VFD)","soft-starter.name":"软启动器","transfer-switch.name":"切换开关 (ATS)","dc-disconnector.name":"直流隔离开关","dc-combiner.name":"直流汇流箱","ev-charger.name":"EV 充电桩","arc-suppression-coil.desc":"中性点谐振接地:电感线圈连接到地","busbar.desc":"可拉伸单母线段,多设备挂接","busduct.desc":"封闭式母线槽直线段(IEC 60617-11-17)","busduct-tap.desc":"带固定插接口的母线槽段,插接口向下引出","converter-bidir.desc":"储能变流器:双向 AC ↔ DC","dc-dc-converter.desc":"DC/DC 变换器 / 直流充电器(IEC 60617)","mppt.desc":"MPPT 太阳能充电控制器(DC/DC,最大功率点跟踪)","earthing-switch.desc":"隔离开关 + 接地连接,单端口","grid-source.desc":"无穷大母线 / 外部电网","grounding-transformer.desc":"星-曲折接线变压器,中性点接地用","load.desc":"抽象负荷(电流流出箭头)","luminaire.desc":"照明负荷(IEC 60617 荧光灯具通用符号)","panelboard.desc":"配电箱 / 负荷中心(IEC 分配中心符号):底部进线,箱顶分路示意","ngr.desc":"小电阻接地:连接变压器中性点到地","series-reactor.desc":"与并联电抗器同符号;通过用法区分","wind-turbine.desc":"风机:发电机 + 三叶轮标记","gfci-breaker.desc":"剩余电流断路器带过流保护 (UL943 / IEC 61009)。北美 GFCI / 欧洲 RCBO。","rcd.desc":"不带过流保护的剩余电流断路器 (IEC 61008)。","recloser.desc":"中压自动重合闸开关。","energy-meter.desc":"有功电能表 (kWh) — 服务入口 / 子表。","contactor.desc":"主回路接触器, 通常配热继电器和电机使用。","motor-starter.desc":"电机启动器 (IEC 60617 通用符号)。","thermal-overload.desc":"电机热过载保护继电器, 通常串接在接触器和电机之间。","vfd.desc":"Variable Frequency Drive — 异步电动机调速。","soft-starter.desc":"电机软启动器 (晶闸管降压启动)。","transfer-switch.desc":"双源切换开关 (Automatic / Manual Transfer Switch)。两个电源输入 + 一个负荷输出, 互锁不并联。","dc-disconnector.desc":"DC 隔离开关 — 光伏组串 / 储能 直流侧隔离。","dc-combiner.desc":"光伏组串汇流箱 (4 路输入示例)。","ev-charger.desc":"电动汽车充电站 / 充电桩。","breaker.state.open":"断开","disconnector.state.open":"断开","earthing-switch.state.open":"断开","fuse.state.blown":"熔断","load-switch.state.open":"断开","gfci-breaker.state.open":"断开","rcd.state.open":"断开","recloser.state.open":"断开","contactor.state.open":"断开","thermal-overload.state.tripped":"动作","transfer-switch.state.position":"位置 (normal/emergency/off)","dc-disconnector.state.open":"断开","battery.param.E":"容量","busbar.param.Un":"额定电压","busduct.param.In":"额定电流","busduct.param.Un":"额定电压","busduct-tap.param.In":"额定电流","busduct-tap.param.Itap":"插接口电流","converter-bidir.param.S":"容量","dc-dc-converter.param.P":"功率","mppt.param.I":"额定电流","load.param.P":"有功功率","load.param.cosphi":"功率因数","ngr.param.R":"电阻","shunt-capacitor.param.Q":"无功容量","shunt-capacitor.param.stages":"分组数","transformer-2w.param.S":"容量","transformer-2w.param.ratio":"变比","gfci-breaker.param.In":"额定电流","panelboard.param.In":"额定电流","gfci-breaker.param.IDn":"剩余动作电流","rcd.param.IDn":"剩余动作电流","breaker.param.In":"额定电流","breaker.param.poles":"极数","breaker.param.Icu":"分断能力","disconnector.param.In":"额定电流","fuse.param.In":"额定电流"},Z4={"arc-suppression-coil.name":"Arc-suppression coil","arrester.name":"Surge arrester (FBL)","async-motor.name":"Asynchronous motor","autotransformer.name":"Autotransformer","battery.name":"Battery storage","breaker.name":"Circuit breaker (QF)","busbar.name":"Busbar segment","busduct.name":"Busduct (busway)","busduct-tap.name":"Busduct with tap-off","converter-bidir.name":"Bidirectional converter (PCS)","dc-dc-converter.name":"DC/DC converter","mppt.name":"MPPT controller","ct.name":"Current transformer (CT)","disconnector.name":"Disconnector (QS)","earth.name":"Earth","earthing-switch.name":"Earthing switch (QE)","fuse.name":"Fuse (FU)","generator.name":"Generator (G)","grid-source.name":"Grid source","grounding-transformer.name":"Grounding transformer (zig-zag)","inverter.name":"Inverter (DC→AC)","load-switch.name":"Load break switch","load.name":"Load","luminaire.name":"Luminaire (lighting load)","panelboard.name":"Panelboard / load center","ngr.name":"Neutral grounding resistor (NGR)","pt.name":"Voltage transformer (PT)","pv.name":"PV module","rectifier.name":"Rectifier (AC→DC)","series-reactor.name":"Series reactor","shunt-capacitor.name":"Shunt capacitor","shunt-reactor.name":"Shunt reactor","sync-motor.name":"Synchronous motor","transformer-2w.name":"Two-winding transformer","transformer-3w.name":"Three-winding transformer","wind-turbine.name":"Wind turbine","gfci-breaker.name":"GFCI breaker (RCBO)","rcd.name":"Residual current device (RCD)","recloser.name":"Recloser","energy-meter.name":"Energy meter (Wh)","voltmeter.name":"Voltmeter (V)","ammeter.name":"Ammeter (A)","wattmeter.name":"Wattmeter (W)","frequency-meter.name":"Frequency meter (Hz)","contactor.name":"Contactor (KM)","motor-starter.name":"Motor starter","thermal-overload.name":"Thermal overload relay","vfd.name":"Variable frequency drive (VFD)","soft-starter.name":"Soft starter","transfer-switch.name":"Transfer switch (ATS)","dc-disconnector.name":"DC disconnector","dc-combiner.name":"DC combiner box","ev-charger.name":"EV charger","arc-suppression-coil.desc":"Resonant neutral grounding: inductor to earth","busbar.desc":"Stretchable single-bus segment with multiple taps","busduct.desc":"Straight busbar trunking section (IEC 60617-11-17)","busduct-tap.desc":"Busduct section with a fixed tap-off dropping below the run","converter-bidir.desc":"Storage converter: bidirectional AC ↔ DC","dc-dc-converter.desc":"DC/DC converter / DC charger (IEC 60617)","mppt.desc":"MPPT solar charge controller (DC/DC, maximum power point tracking)","earthing-switch.desc":"Disconnector + earth connection, single port","grid-source.desc":"Infinite bus / external grid","grounding-transformer.desc":"Wye-zigzag transformer for neutral grounding","load.desc":"Abstract load (current-out arrow)","luminaire.desc":"Lighting load (IEC 60617 general luminaire symbol)","ngr.desc":"Low-resistance grounding: transformer neutral to earth","series-reactor.desc":"Same symbol as shunt reactor; distinguished by usage","wind-turbine.desc":"Wind turbine: generator + three-blade rotor mark","gfci-breaker.desc":"Residual-current breaker with overcurrent (UL943 / IEC 61009). NA GFCI / EU RCBO.","rcd.desc":"Residual-current breaker without overcurrent (IEC 61008).","recloser.desc":"Medium-voltage automatic recloser.","energy-meter.desc":"Active energy meter (kWh) — service entrance / submeter.","contactor.desc":"Main-circuit contactor; typically used with a thermal overload and a motor.","motor-starter.desc":"Motor starter (IEC 60617 general symbol).","thermal-overload.desc":"Motor thermal-overload relay; sits between the contactor and the motor.","vfd.desc":"Variable Frequency Drive for induction motor speed control.","soft-starter.desc":"Motor soft-starter (thyristor-based reduced-voltage starting).","transfer-switch.desc":"Two-source transfer switch (ATS / manual). Two source inputs + one load output, mechanically interlocked.","dc-disconnector.desc":"DC isolating switch — PV string / battery DC-side isolation.","dc-combiner.desc":"PV string combiner box (4-input example).","ev-charger.desc":"Electric vehicle charging station.","breaker.state.open":"Open","disconnector.state.open":"Open","earthing-switch.state.open":"Open","fuse.state.blown":"Blown","load-switch.state.open":"Open","gfci-breaker.state.open":"Open","rcd.state.open":"Open","recloser.state.open":"Open","contactor.state.open":"Open","thermal-overload.state.tripped":"Tripped","transfer-switch.state.position":"Position (normal/emergency/off)","dc-disconnector.state.open":"Open","battery.param.E":"Capacity","busbar.param.Un":"Rated voltage","converter-bidir.param.S":"Capacity","dc-dc-converter.param.P":"Power","mppt.param.I":"Rated current","load.param.P":"Active power","load.param.cosphi":"Power factor","ngr.param.R":"Resistance","shunt-capacitor.param.Q":"Reactive capacity","shunt-capacitor.param.stages":"Stages","transformer-2w.param.S":"Capacity","transformer-2w.param.ratio":"Ratio","gfci-breaker.param.In":"Rated current","panelboard.param.In":"Rated current","gfci-breaker.param.IDn":"Residual operating current","rcd.param.IDn":"Residual operating current","breaker.param.In":"Rated current","breaker.param.poles":"Poles","breaker.param.Icu":"Breaking capacity","disconnector.param.In":"Rated current","fuse.param.In":"Rated current","resistor.name":"Resistor (R)","capacitor.name":"Capacitor (C)","diode.name":"Diode (D)","indicator-light.name":"Indicator light (HL)","push-button.name":"Push-button (SB)","relay-coil.name":"Relay coil (KA)","make-contact.name":"NO contact (NO)","break-contact.name":"NC contact (NC)","bell.name":"Bell (HA)","terminal.name":"Terminal / junction (X)","fuse-switch-disconnector.name":"Fuse switch-disconnector","socket-outlet.name":"Socket outlet / connector","inductor.name":"Inductor (L)","voltage-regulator.name":"Voltage regulator (T)","dc-motor.name":"DC motor (M)","heater.name":"Heating element (EH)","selector-switch.name":"Selector switch (SA)","limit-switch.name":"Limit switch (SQ)","proximity-switch.name":"Proximity switch (SQ)","time-relay.name":"Time relay (KT)","buzzer.name":"Buzzer (HA)","siren.name":"Siren (HA)","thermocouple.name":"Thermocouple (BT)","thyristor.name":"Thyristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Zener diode (D)","igbt.name":"IGBT","plc.name":"PLC / controller","ups.name":"UPS","power-supply.name":"Power supply (PS)","genset.name":"Generator set (G)","protective-relay.name":"Protective relay","overcurrent-relay.name":"Overcurrent relay (50/51)","undervoltage-relay.name":"Undervoltage relay (27)","reverse-power-relay.name":"Reverse-power relay (32)","distance-relay.name":"Distance relay (21)","phase-failure-relay.name":"Phase-failure relay","buchholz-relay.name":"Buchholz relay (63)","power-factor-meter.name":"Power-factor meter (cosφ)","synchronoscope.name":"Synchronoscope","varmeter.name":"Varmeter (var)","resistor.desc":"General resistor / current-limiting / braking resistor.","capacitor.desc":"General / filter / DC-bus capacitor. Use shunt capacitor for PF correction.","diode.desc":"Rectifier / freewheeling / protection diode. t1 = anode (top), t2 = cathode (bottom).","indicator-light.desc":"Signal / status indicator light.","push-button.desc":"Manual push-button, automatic return (NO make).","relay-coil.desc":"Relay / contactor operating coil (box).","make-contact.desc":"Normally-open auxiliary contact (make).","break-contact.desc":"Normally-closed auxiliary contact (break).","bell.desc":"Signal bell / alarm bell.","terminal.desc":"Terminal / junction box / connection node.","fuse-switch-disconnector.desc":"On-load fuse switch-disconnector.","socket-outlet.desc":"Power socket outlet / multipole connector.","inductor.desc":"General inductor / coil / choke.","voltage-regulator.desc":"Adjustable induction / autotransformer voltage regulator.","dc-motor.desc":"DC motor (series-field general symbol).","heater.desc":"Resistive heating element / heating load.","selector-switch.desc":"Selector / changeover switch (rotary, stay-put).","limit-switch.desc":"Travel / position switch (NO, mechanically operated).","proximity-switch.desc":"Proximity sensor / contactless proximity switch.","time-relay.desc":"Time-delay (slow-operating) relay coil.","buzzer.desc":"Signal buzzer.","siren.desc":"Audible siren / alarm.","thermocouple.desc":"Thermocouple temperature sensor.","thyristor.desc":"Reverse-blocking triode thyristor / SCR. t1 = anode (top), t2 = cathode (bottom).","triac.desc":"Bidirectional triode thyristor (TRIAC).","zener-diode.desc":"Zener / voltage-regulator diode. t1 = anode (top), t2 = cathode (bottom).","igbt.desc":"N-channel enhancement IGBT. t1 = collector (top), t2 = emitter (bottom), t_g = gate.","plc.desc":"Programmable logic controller (PLC).","ups.desc":"Online / standby uninterruptible power supply.","power-supply.desc":"AC→DC switched-mode / DC power supply. t_ac top (~), t_dc bottom (=).","genset.desc":"Diesel / gas generator set.","protective-relay.desc":"Measuring / protective relay, general symbol (IEC 60617).","overcurrent-relay.desc":"Overcurrent protection relay (ANSI 50/51).","undervoltage-relay.desc":"Undervoltage protection relay (ANSI 27).","reverse-power-relay.desc":"Reverse-power / reverse-current protection relay (ANSI 32).","distance-relay.desc":"Distance / under-impedance protection relay (ANSI 21).","phase-failure-relay.desc":"Phase-failure / phase-loss protection relay.","buchholz-relay.desc":"Buchholz / gas relay (ANSI 63).","power-factor-meter.desc":"Power-factor meter (cosφ).","synchronoscope.desc":"Synchronizing indicator / synchronoscope.","varmeter.desc":"Reactive-power meter (var).","make-contact.state.closed":"Closed","break-contact.state.open":"Open","on-delay-make-contact.name":"On-delay NO contact (KT)","off-delay-make-contact.name":"Off-delay NO contact (KT)","on-delay-break-contact.name":"On-delay NC contact (KT)","off-delay-break-contact.name":"Off-delay NC contact (KT)","continuation-out.name":"Continuation (outgoing)","continuation-in.name":"Continuation (incoming)","on-delay-make-contact.desc":"Timer contact, normally open: closes after the delay once the coil is energised (IEC 60617-07-05-01).","off-delay-make-contact.desc":"Timer contact, normally open: opens after the delay once the coil is de-energised (IEC 60617-07-05-02).","on-delay-break-contact.desc":"Timer contact, normally closed: opens after the delay once the coil is energised (IEC 60617-07-05-03).","off-delay-break-contact.desc":"Timer contact, normally closed: closes after the delay once the coil is de-energised (IEC 60617-07-05-04).","continuation-out.desc":"Off-page connector: the wire breaks here and continues elsewhere. Continuations with the same name are the same wire.","continuation-in.desc":"Off-page connector: a wire from elsewhere continues here. Continuations with the same name are the same wire.","on-delay-make-contact.state.closed":"Closed","on-delay-make-contact.param.delay":"Delay","off-delay-make-contact.state.closed":"Closed","off-delay-make-contact.param.delay":"Delay","on-delay-break-contact.state.open":"Open","on-delay-break-contact.param.delay":"Delay","off-delay-break-contact.state.open":"Open","off-delay-break-contact.param.delay":"Delay","continuation-out.param.target":"Continues at","continuation-in.param.target":"Comes from","async-motor.param.P":"Rated power","sync-motor.param.P":"Rated power","dc-motor.param.P":"Rated power","ev-charger.param.P":"Rated power","socket-outlet.param.P":"Rated power","luminaire.param.P":"Rated power","fuse-switch-disconnector.state.open":"Open","selector-switch.state.open":"Open","limit-switch.state.closed":"Closed","resistor.param.R":"Resistance","resistor.param.P":"Rated power","capacitor.param.C":"Capacitance","capacitor.param.Un":"Rated voltage","indicator-light.param.color":"Color","inductor.param.L":"Inductance","inductor.param.In":"Rated current","voltage-regulator.param.ratio":"Regulation range","heater.param.P":"Power","ups.param.S":"Capacity","power-supply.param.Vdc":"Output voltage","genset.param.P":"Power","busduct.param.In":"Rated current","busduct.param.Un":"Rated voltage","busduct-tap.param.In":"Rated current","busduct-tap.param.Itap":"Tap-off current"},ui={zh:Y4,en:Z4,es:Be.es.library,fr:Be.fr.library,de:Be.de.library,pt:Be.pt.library,ja:Be.ja.library,ru:Be.ru.library,fa:Be.fa.library,ar:Be.ar.library,he:Be.he.library};function Q4(e,t){return ui[e][t]??ui.en[t]}function Bt(){const e=Tn(t=>t.locale);return(t,n)=>Q4(e,t)??n??t}const mi=10,J4=100;function eP(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(hover: none), (pointer: coarse)").matches}function pi(){const e=Bt(),[t,n]=$.useState(a4()),[o,r]=$.useState(!1),[a,i]=$.useState(null),l=$.useRef(null),s=$.useRef(void 0),[d]=$.useState(eP);$.useEffect(()=>i4(f=>n(f)),[]),$.useEffect(()=>{if(window.clearTimeout(s.current),r(!1),i(null),!!t)return s.current=window.setTimeout(()=>r(!0),J4),()=>window.clearTimeout(s.current)},[t]);const u=x(f=>t?f.diagram.elements.find(b=>b.id===t)??null:null);if($.useLayoutEffect(()=>{if(!o||!t)return;let f=0,b=-1,y=-1;const w=()=>{const j=document.querySelector(`[data-element-id="${tP(t)}"]`),_=l.current;if(j&&_){const E=j.getBoundingClientRect();let W=E.bottom+mi;W+_.offsetHeight>window.innerHeight-4&&(W=E.top-_.offsetHeight-mi);let Q=E.left+E.width/2-_.offsetWidth/2;Q=Math.max(4,Math.min(Q,window.innerWidth-_.offsetWidth-4)),(W!==b||Q!==y)&&(i({top:W,left:Q}),b=W,y=Q)}f=requestAnimationFrame(w)};return f=requestAnimationFrame(w),()=>cancelAnimationFrame(f)},[o,t]),d||!o||!t||!u)return null;const m=wt[u.kind],p=u.name??u.id,g=m?e(`${m.id}.name`,m.name):u.kind,h=u.name&&u.name!==u.id;return typeof document>"u"?null:Hi.createPortal(c.jsxs("div",{ref:l,role:"tooltip",className:"ole-root ole-glass pointer-events-none fixed z-[100] flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] leading-snug shadow-md",style:{top:(a==null?void 0:a.top)??-9999,left:(a==null?void 0:a.left)??-9999,opacity:a?1:0,transition:"opacity 80ms ease-out"},children:[c.jsx("span",{className:"font-medium text-foreground",children:p}),h&&c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:u.id}),c.jsx("span",{className:"text-muted-foreground/80",children:"·"}),c.jsx("span",{className:"text-muted-foreground",children:g})]}),document.body)}function tP(e){return e.replace(/(["\\])/g,"\\$1")}function nP({width:e,children:t}){const n=e==null?"full":w4(e);return c.jsx(Y_.Provider,{value:n,children:t})}function hi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function oP(...e){return t=>{let n=!1;const o=e.map(r=>{const a=hi(r,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():hi(e[r],null)}}}}var rP=Symbol.for("react.lazy"),go=qe[" use ".trim().toString()];function aP(e){return typeof e=="object"&&e!==null&&"then"in e}function nC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rP&&"_payload"in e&&aP(e._payload)}function iP(e){const t=lP(e),n=qe.forwardRef((o,r)=>{let{children:a,...i}=o;nC(a)&&typeof go=="function"&&(a=go(a._payload));const l=qe.Children.toArray(a),s=l.find(dP);if(s){const d=s.props.children,u=l.map(m=>m===s?qe.Children.count(d)>1?qe.Children.only(null):qe.isValidElement(d)?d.props.children:null:m);return c.jsx(t,{...i,ref:r,children:qe.isValidElement(d)?qe.cloneElement(d,void 0,u):null})}return c.jsx(t,{...i,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}var sP=iP("Slot");function lP(e){const t=qe.forwardRef((n,o)=>{let{children:r,...a}=n;if(nC(r)&&typeof go=="function"&&(r=go(r._payload)),qe.isValidElement(r)){const i=mP(r),l=uP(a,r.props);return r.type!==qe.Fragment&&(l.ref=o?oP(o,i):i),qe.cloneElement(r,l)}return qe.Children.count(r)>1?qe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cP=Symbol("radix.slottable");function dP(e){return qe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cP}function uP(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...l)=>{const s=a(...l);return r(...l),s}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function mP(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const fi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gi=ns,pP=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return gi(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:a}=t,i=Object.keys(r).map(d=>{const u=n==null?void 0:n[d],m=a==null?void 0:a[d];if(u===null)return null;const p=fi(u)||fi(m);return r[d][p]}),l=n&&Object.entries(n).reduce((d,u)=>{let[m,p]=u;return p===void 0||(d[m]=p),d},{}),s=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,u)=>{let{class:m,className:p,...g}=u;return Object.entries(g).every(h=>{let[f,b]=h;return Array.isArray(b)?b.includes({...a,...l}[f]):{...a,...l}[f]===b})?[...d,m,p]:d},[]);return gi(e,i,s,n==null?void 0:n.class,n==null?void 0:n.className)},hP=pP("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ve=qe.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,...r},a)=>{const i=o?sP:"button";return c.jsx(i,{className:Ee(hP({variant:t,size:n,className:e})),ref:a,...r})});Ve.displayName="Button";const fP=350;function Fe({content:e,children:t,disabled:n,delayMs:o=fP}){const r=$.useRef(null),a=$.useRef(null),[i,l]=$.useState(!1),[s,d]=$.useState(null),u=$.useId(),m=$.useRef(void 0),p=()=>{n||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>l(!0),o))},g=()=>{window.clearTimeout(m.current),l(!1)};$.useLayoutEffect(()=>{if(!i||!r.current||!a.current)return;const y=r.current.getBoundingClientRect(),w=a.current.getBoundingClientRect(),j=8;let _="top",E=y.top-w.height-j;E<4&&(_="bottom",E=y.bottom+j);let W=y.left+y.width/2-w.width/2;W=Math.max(4,Math.min(W,window.innerWidth-w.width-4)),d({top:E,left:W,side:_})},[i,e]),$.useEffect(()=>()=>window.clearTimeout(m.current),[]),$.useEffect(()=>{if(!i)return;const y=j=>{j.key==="Escape"&&l(!1)},w=()=>l(!1);return window.addEventListener("keydown",y),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("keydown",y),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[i]);const h=t,f=h.props,b=$.cloneElement(h,{ref:y=>{r.current=y;const w=h.ref;typeof w=="function"?w(y):w&&typeof w=="object"&&(w.current=y)},onPointerEnter:y=>{var w;(w=f.onPointerEnter)==null||w.call(f,y),p()},onPointerLeave:y=>{var w;(w=f.onPointerLeave)==null||w.call(f,y),g()},onFocus:y=>{var w;(w=f.onFocus)==null||w.call(f,y),p()},onBlur:y=>{var w;(w=f.onBlur)==null||w.call(f,y),g()},"aria-describedby":i?u:f["aria-describedby"]});return c.jsxs(c.Fragment,{children:[b,i&&typeof document<"u"&&Hi.createPortal(c.jsx("div",{ref:a,id:u,role:"tooltip","data-side":(s==null?void 0:s.side)??"top",className:"ole-root ole-glass pointer-events-none fixed z-[100] max-w-[280px] rounded-md border border-border px-2 py-1 text-[11px] leading-snug text-foreground shadow-md",style:{top:(s==null?void 0:s.top)??-9999,left:(s==null?void 0:s.left)??-9999,opacity:s?1:0,transition:"opacity 80ms ease-out"},children:e}),document.body)]})}const bi={default:"ctx.colorDefault",red:"ctx.colorRed",amber:"ctx.colorAmber",green:"ctx.colorGreen",blue:"ctx.colorBlue",gray:"ctx.colorGray"},yi=12,gP=56;function bP(){var _;const e=re(),t=x(E=>E.selection),n=x(E=>E.selectedNode),o=x(E=>E.selectedWire),r=x(E=>E.activeTool),a=x(E=>E.rotateSelection),i=x(E=>E.mirrorSelection),l=x(E=>E.deleteSelection),s=x(E=>E.setSelectionColor),d=x(E=>E.selectedAnnotations),u=x(E=>E.deleteSelectedNode),m=x(E=>E.deleteSelectedWire),p=x(E=>E.resetWirePath),g=x(E=>E.internal.wireRenders),h=o!=null&&((_=g.get(o))==null?void 0:_.userEdited)===!0,f=$.useRef(null);$.useEffect(()=>{const E=f.current;if(!E)return;const W=t.length>0,Q=!W&&o!=null,ke=!W&&!Q&&n!=null;if(!((W||Q||ke)&&(r==="select"||r==="pan"))){E.style.display="none";return}E.style.display="flex";let Y=0,k="";const D=()=>{let M=1/0,G=-1/0,me=1/0,pe=-1/0,te=!1;const Se=ie=>{ie.width===0&&ie.height===0||(ie.left<M&&(M=ie.left),ie.right>G&&(G=ie.right),ie.top<me&&(me=ie.top),ie.bottom>pe&&(pe=ie.bottom),te=!0)};if(W)for(const ie of t){const _e=document.querySelector(`[data-element-id="${CSS.escape(ie)}"]`);_e&&Se(_e.getBoundingClientRect())}else if(Q&&o){const ie=document.querySelector(`polyline.ole-wire[data-wire-id="${CSS.escape(o)}"]`);ie&&Se(ie.getBoundingClientRect())}else if(ke&&n){const ie=document.querySelectorAll(`polyline.ole-wire[data-node-id="${CSS.escape(n)}"]`);for(const _e of ie)Se(_e.getBoundingClientRect())}if(te){const ie=(M+G)/2;let _e=me-yi,Ie="-100%";_e<gP&&(_e=pe+yi,Ie="0%");const Oe=`translate3d(${ie}px, ${_e}px, 0) translate(-50%, ${Ie})`;Oe!==k&&(E.style.transform=Oe,k=Oe)}Y=requestAnimationFrame(D)};return Y=requestAnimationFrame(D),()=>cancelAnimationFrame(Y)},[t,n,o,r]);const b=t.length===0&&o!=null,y=t.length===0&&!b&&n!=null,w=y||b,j=!y&&(t.length>0||o!=null||d.length>0);return c.jsxs("div",{ref:f,role:"toolbar","aria-label":e(b?"ctx.ariaWire":y?"ctx.ariaNode":"ctx.ariaElement"),className:"ole-glass pointer-events-auto fixed left-0 top-0 z-30 hidden items-center gap-0.5 rounded-2xl border border-border p-1 shadow-md",children:[b&&h&&o&&c.jsxs(c.Fragment,{children:[c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{children:c.jsx("span",{className:"font-medium",children:e("ctx.resetWirePath")})}),c.jsx("div",{className:"text-muted-foreground",children:e("ctx.resetWirePathHint")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>p(o),"aria-label":e("ctx.resetWirePath"),children:c.jsx(rj,{})})}),c.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),!w&&c.jsxs(c.Fragment,{children:[c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:e("ctx.rotate")}),c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"R"})]}),c.jsx("div",{className:"text-muted-foreground",children:e("ctx.rotateHint")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>a(90),"aria-label":e("ctx.rotate"),children:c.jsx(Yi,{})})}),c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:e("ctx.mirror")}),c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"M"})]}),c.jsx("div",{className:"text-muted-foreground",children:e("ctx.mirrorHint")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>i(),"aria-label":e("ctx.mirrorTitle"),children:c.jsx(Ki,{})})}),c.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),j&&c.jsxs(c.Fragment,{children:[c.jsx("div",{role:"group","aria-label":e("ctx.color"),className:"flex items-center gap-0.5",children:Mr.map(E=>c.jsx(Fe,{content:e(bi[E]),children:c.jsx("button",{type:"button",onClick:()=>s(E),"aria-label":e(bi[E]),className:"ole-swatch flex size-7 items-center justify-center rounded-md transition-colors hover:bg-accent",children:c.jsx("span",{"aria-hidden":!0,className:`size-3.5 rounded-full border border-border bg-current ${Qe(E)??""}`})})},E))}),c.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:e("ctx.delete")}),c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"Del"})]}),c.jsx("div",{className:"text-muted-foreground",children:e(b?"ctx.deleteHintWire":y?"ctx.deleteHintNode":"ctx.deleteHintElement")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",className:"size-7 text-destructive hover:text-destructive",onClick:()=>b?m():y?u():l(),"aria-label":e("ctx.delete"),children:c.jsx(Ji,{})})})]})}const xi=8,yP=56,Sr=".ole-ann-cell-edit-fo",_r=".ole-free-annotation-edit-fo";function wi(){return document.querySelector(`${Sr} input`)??document.querySelector(`${_r} [contenteditable]`)}function xP(){const e=re(),t=x(i=>i.editingAnnotation),n=x(i=>i.editingCell),o=$.useRef(null);$.useEffect(()=>{const i=o.current;if(!i)return;if(!t){i.style.display="none";return}i.style.display="flex";let l=0,s="";const d=()=>{const u=wi()??document.querySelector(Sr)??document.querySelector(_r)??document.querySelector(`[data-annotation-id="${CSS.escape(t)}"]`);if(u){const m=u.getBoundingClientRect();let p=m.top-xi,g="-100%";p<yP&&(p=m.bottom+xi,g="0%");const h=`translate3d(${m.left}px, ${p}px, 0) translate(0, ${g})`;h!==s&&(i.style.transform=h,s=h)}l=requestAnimationFrame(d)};return l=requestAnimationFrame(d),()=>cancelAnimationFrame(l)},[t,n]);const r=()=>{var i;(i=wi())==null||i.blur()},a=()=>{var d,u;const i=x.getState(),l=i.editingAnnotation,s=(d=i.diagram.annotations)==null?void 0:d.find(m=>m.id===l);if(!s){i.setEditingAnnotation(null);return}if(ut(s)==="table"&&i.editingCell){const m=document.querySelector(`${Sr} input`),[p,g]=i.editingCell;if(m){m.value=((u=s.cells[p])==null?void 0:u[g])??"",m.blur();return}}else{const m=document.querySelector(`${_r} [contenteditable]`);if(m){m.innerText=s.text??"",m.blur();return}}i.setEditingAnnotation(null)};return c.jsxs("div",{ref:o,role:"toolbar","aria-label":e("ctx.ariaEdit"),className:"ole-glass pointer-events-auto fixed left-0 top-0 z-40 hidden items-center gap-0.5 rounded-2xl border border-border p-1 shadow-md",children:[c.jsx(Fe,{content:c.jsxs("span",{className:"font-medium",children:[e("ctx.done")," · Enter"]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",className:"size-7 text-emerald-600 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-400",onMouseDown:i=>i.preventDefault(),onClick:r,"aria-label":e("ctx.done"),children:c.jsx(WC,{})})}),c.jsx(Fe,{content:c.jsxs("span",{className:"font-medium",children:[e("ctx.cancel")," · Esc"]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",onMouseDown:i=>i.preventDefault(),onClick:a,"aria-label":e("ctx.cancel"),children:c.jsx(bo,{})})})]})}function rn({open:e,onOpenChange:t,trigger:n,children:o}){const r=$.useRef(null);return $.useEffect(()=>{if(!e)return;const a=l=>{r.current&&!r.current.contains(l.target)&&t(!1)},i=l=>{l.key==="Escape"&&t(!1)};return window.addEventListener("mousedown",a),window.addEventListener("keydown",i),()=>{window.removeEventListener("mousedown",a),window.removeEventListener("keydown",i)}},[e,t]),c.jsxs("div",{ref:r,className:"relative",children:[n,e&&c.jsx("div",{role:"menu",className:"ole-glass absolute bottom-full right-0 mb-1.5 min-w-52 rounded-md border border-border p-1 shadow-md",children:o})]})}const oC="ole-health-intro-seen",wP=15e3;function vP(){try{return window.localStorage.getItem(oC)==="1"}catch{return!0}}function kP(){try{window.localStorage.setItem(oC,"1")}catch{}}function SP(){const e=re(),t=Br(),n=at(s=>s.healthOpen),o=at(s=>s.setHealthOpen),r=F_(t).length,a=$.useRef(null),[i,l]=$.useState(!1);return $.useEffect(()=>{var d;if(r===0||i||vP())return;const s=(d=a.current)==null?void 0:d.querySelector(".ole-health-btn");!s||s.offsetParent===null||(kP(),l(!0))},[r,i]),$.useEffect(()=>{if(!i)return;const s=setTimeout(()=>l(!1),wP);return()=>clearTimeout(s)},[i]),c.jsxs("div",{ref:a,className:"relative",children:[i&&!n&&c.jsxs("div",{role:"status",className:"ole-glass ole-health-intro absolute bottom-full end-0 mb-2 w-64 rounded-xl border border-border p-3 text-xs shadow-md",children:[c.jsx("div",{className:"text-[12px] font-medium",children:e("health.introTitle")}),c.jsx("p",{className:"mt-1 leading-snug text-muted-foreground",children:e("health.intro",{n:r})}),c.jsxs("div",{className:"mt-2 flex justify-end gap-1.5",children:[c.jsx("button",{type:"button",className:"rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent hover:text-foreground",onClick:()=>l(!1),children:e("health.introOk")}),c.jsx("button",{type:"button",className:"rounded-md bg-primary px-2 py-1 text-[11px] text-primary-foreground hover:opacity-90",onClick:()=>{l(!1),o(!0)},children:e("health.introShow")})]})]}),c.jsx(_P,{open:n,setOpen:o,count:r})]})}function _P({open:e,setOpen:t,count:n}){const o=re();return c.jsx(rn,{open:e,onOpenChange:r=>t(r),trigger:c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:o("health.title")}),c.jsx("div",{className:"text-muted-foreground",children:o("health.hint")})]}),children:c.jsxs(Ve,{variant:"ghost",size:"icon",onClick:()=>t(!e),"aria-label":o("health.title"),"aria-expanded":e,className:"ole-health-btn relative",children:[c.jsx(sj,{}),n>0&&c.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-amber-500 px-1 text-[9px] font-semibold leading-none text-white",children:n>99?"99+":n})]})}),children:c.jsx(rC,{})})}function rC(){const e=re(),t=Br(),n=x(h=>h.internal),o=at(h=>h.healthMarkers),r=at(h=>h.setHealthMarkers),a=at(h=>h.healthFocus),i=$.useRef(null),l=F_(t),s=t.issues.filter(h=>h.severity==="info"&&!h.dismissed),d=t.issues.filter(h=>h.dismissed);$.useEffect(()=>{var h,f;a&&((f=(h=i.current)==null?void 0:h.querySelector(`[data-issue="${CSS.escape(a)}"]`))==null||f.scrollIntoView({block:"nearest"}))},[a]);const u=h=>{var w,j;const f=h.targets[0];if(!f)return;const b=x.getState();(b.internal.elements.has(f)||b.internal.buses.has(f))&&b.setSelection([f]);const y=VT(b.internal,f);y&&tC(y),(j=(w=Yt.getState()).onHealthEvent)==null||j.call(w,{type:"open",issueId:h.id,code:h.code})},m=(h,f)=>{var b,y;x.getState().setHealthDismissed(h.id,f),(y=(b=Yt.getState()).onHealthEvent)==null||y.call(b,{type:f?"dismiss":"restore",issueId:h.id,code:h.code})},p=(h,f)=>c.jsxs("div",{"data-issue":h.id,className:Ee("group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent",a===h.id&&"bg-accent"),children:[c.jsx("span",{"aria-hidden":!0,className:Ee("mt-1 size-2 shrink-0 rounded-full",h.severity==="error"?"bg-red-600":h.severity==="warning"?"bg-amber-500":"bg-muted-foreground/50")}),c.jsx("button",{type:"button",onClick:()=>u(h),className:"min-w-0 flex-1 text-left text-[11px] leading-snug text-foreground",children:q_(e,n,h)}),f&&c.jsx("button",{type:"button",onClick:()=>m(h,f==="dismiss"),className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-background hover:text-foreground",children:e(f==="dismiss"?"health.dismiss":"health.restore")})]},h.id),g=(h,f)=>{const b=new Map;for(const y of h)b.set(y.code,[...b.get(y.code)??[],y]);return[...b].map(([y,w])=>w.length===1?p(w[0],f):c.jsxs("details",{open:w.some(j=>j.id===a)||void 0,children:[c.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent",children:[c.jsx("span",{"aria-hidden":!0,className:Ee("size-2 shrink-0 rounded-full",w[0].severity==="error"?"bg-red-600":w[0].severity==="warning"?"bg-amber-500":"bg-muted-foreground/50")}),c.jsx("span",{className:"min-w-0 flex-1 text-[11px] font-medium text-foreground",children:e(`health.label.${y}`)}),c.jsxs("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:["×",w.length]})]}),c.jsx("div",{className:"ms-3 border-s border-border/60 ps-1",children:w.map(j=>p(j,f))})]},y))};return c.jsxs("div",{className:"flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-1 text-xs",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1",children:[c.jsx("span",{className:"text-[12px] font-medium",children:e("health.title")}),c.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-[11px] text-muted-foreground",children:[c.jsx("input",{type:"checkbox",checked:o,onChange:h=>r(h.target.checked)}),e("health.markers")]})]}),c.jsxs("div",{ref:i,className:"flex max-h-[55vh] flex-col gap-1 overflow-y-auto",children:[l.length===0?c.jsx("div",{className:"px-2 py-1.5 text-[11px] text-muted-foreground",children:e("health.none")}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"px-2 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[e("health.sectionProblems")," · ",l.length]}),g(l,"dismiss")]}),t.loads.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"px-2 pt-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:e("health.sectionLoads")}),t.loads.map(h=>c.jsxs("div",{className:"flex items-baseline justify-between gap-2 px-2 py-0.5 text-[11px]",children:[c.jsx("span",{className:"min-w-0 truncate",children:W_(n,h.targetId)}),c.jsxs("span",{className:"shrink-0 text-right text-muted-foreground",children:[h.known===h.total?e("health.loadAll",{kw:Math.round(h.knownKW),t:h.total}):e("health.loadKnown",{kw:Math.round(h.knownKW),k:h.known,t:h.total}),h.loadingPct!==void 0&&c.jsxs(c.Fragment,{children:[" · ",c.jsx("span",{className:Ee((h.loadingPct??0)>100&&"text-amber-600"),children:e("health.loading",{pct:Math.round(h.loadingPct),rating:Math.round(h.ratingKVA??0)})})]})]})]},h.targetId))]}),s.length>0&&c.jsxs("details",{className:"px-0",children:[c.jsxs("summary",{className:"cursor-pointer px-2 pt-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[e("health.sectionNotes")," · ",s.length]}),g(s,"dismiss")]}),d.length>0&&c.jsxs("details",{children:[c.jsxs("summary",{className:"cursor-pointer px-2 pt-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[e("health.sectionDismissed")," · ",d.length]}),g(d,"restore")]})]}),c.jsx("div",{className:"border-t border-border/60 px-2 pt-1.5 text-[10px] leading-snug text-muted-foreground",children:e("health.disclaimer")})]})}const no=[.1,.25,.5,.75,1,1.25,1.5,2,3,4,6,8],aC=.1,iC=8,sC="ole-grid";function CP(){try{const e=window.localStorage.getItem(sC);return e==null?!0:e==="1"}catch{return!0}}function jP(e){try{window.localStorage.setItem(sC,e?"1":"0")}catch{}}function $P(e,t,n){return e<t?t:e>n?n:e}function lC(){return document.querySelector(".ole-canvas-root")}function qr(e){const t=st(),n=lC();if(!t||!n)return;const o=n.getBoundingClientRect(),r=o.width/2,a=o.height/2,i=t.getViewport(),l=$P(e,aC,iC),s=l/i.scale;t.setViewport({tx:r-(r-i.tx)*s,ty:a-(a-i.ty)*s,scale:l})}function AP(){const e=st();if(!e)return;const t=e.getViewport().scale,n=no.find(o=>o>t+1e-6)??iC;qr(n)}function EP(){const e=st();if(!e)return;const t=e.getViewport().scale;let n=aC;for(let o=no.length-1;o>=0;o--)if(no[o]<t-1e-6){n=no[o];break}qr(n)}const Zn=[xo,6,ht,8,9,10,12,14,16,20,24,28,wo];function NP(e){x.getState().dispatch(t=>{const n={...t.meta??{},labelMode:e};return{...t,meta:n}})}function Cr(e){x.getState().dispatch(t=>{const n={...t.meta??{}};return e===ht?delete n.labelFontSize:n.labelFontSize=e,{...t,meta:n}})}function vi(e){var o;const t=Jt((o=x.getState().diagram.meta)==null?void 0:o.labelFontSize);if(e>0){Cr(Zn.find(r=>r>t)??wo);return}let n=xo;for(let r=Zn.length-1;r>=0;r--)if(Zn[r]<t){n=Zn[r];break}Cr(n)}function cC(){const[e,t]=$.useState(()=>CP());return $.useEffect(()=>{const n=lC();n==null||n.classList.toggle("hide-grid",!e),jP(e)},[e]),$.useEffect(()=>{const n=o=>{if(o.metaKey||o.ctrlKey||o.altKey||o.key!=="g"&&o.key!=="G")return;const r=o.target;r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||(o.preventDefault(),t(a=>!a))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),[e,t]}function dC(){const e=re();return c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.zoomOut")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.zoomOutHint")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",onClick:EP,"aria-label":e("view.zoomOut"),children:c.jsx($r,{})})})}function uC(){const e=re();return c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.zoomIn")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.zoomInHint")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",onClick:AP,"aria-label":e("view.zoomIn"),children:c.jsx(Xi,{})})})}function mC(){const e=re(),[t,n]=$.useState(D4);return $.useEffect(()=>O4(n),[]),c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.reset")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.current",{z:Math.round(t*100)})})]}),children:c.jsxs("button",{type:"button",onClick:()=>qr(1),className:"min-w-12 rounded-md px-2 py-1 text-center text-xs tabular-nums text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":e("view.reset"),children:[Math.round(t*100),"%"]})})}function pC(){const e=re();return c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.fit")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.fitHint")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",onClick:Fr,"aria-label":e("view.fit"),children:c.jsx(JC,{})})})}function hC({grid:e,setGrid:t}){const n=re();return c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:n(e?"view.gridHide":"view.gridShow")}),c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:n("view.gridHotkey")})]}),c.jsx("div",{className:"text-muted-foreground",children:n(e?"view.gridHideHint":"view.gridShowHint")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",onClick:()=>t(o=>!o),"aria-label":n(e?"view.gridHideAria":"view.gridShowAria"),"aria-pressed":e,className:Ee(!e&&"text-muted-foreground/60"),children:c.jsx(ZC,{})})})}function fC(){const e=re(),t=x(r=>{var a;return((a=r.diagram.meta)==null?void 0:a.labelMode)??"all"}),n=x(r=>{var a;return Jt((a=r.diagram.meta)==null?void 0:a.labelFontSize)}),o=[{value:"off",label:e("view.labelOff")},{value:"id",label:e("view.labelId")},{value:"all",label:e("view.labelAll")}];return c.jsxs("div",{className:"flex flex-col gap-1.5 px-1.5 py-1",children:[c.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:e("view.label")}),c.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:o.map(r=>c.jsx("button",{type:"button","aria-pressed":t===r.value,onClick:()=>NP(r.value),className:Ee("h-7 flex-1 whitespace-nowrap px-1.5 text-[11px] transition-colors",t===r.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.label},r.value))}),c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-[11px] text-muted-foreground",children:e("view.labelSize")}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{type:"button","aria-label":e("view.labelSizeSmaller"),disabled:n<=xo,onClick:()=>vi(-1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"−"}),c.jsx("button",{type:"button","aria-label":e("view.labelSizeReset"),onClick:()=>Cr(ht),className:"w-9 rounded-md py-1 text-center font-mono text-[11px] tabular-nums hover:bg-accent hover:text-accent-foreground",children:n}),c.jsx("button",{type:"button","aria-label":e("view.labelSizeLarger"),disabled:n>=wo,onClick:()=>vi(1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"+"})]})]})]})}function TP(e){x.getState().dispatch(t=>{const n={...t.meta??{}};return e==="iec"?delete n.symbolStandard:n.symbolStandard=e,{...t,meta:n}})}function gC(){const e=re(),t=x(o=>{var r;return((r=o.diagram.meta)==null?void 0:r.symbolStandard)??"iec"}),n=[{value:"iec",label:e("view.standardIec")},{value:"ansi",label:e("view.standardAnsi")}];return c.jsxs("div",{className:"flex flex-col gap-1.5 px-1.5 py-1",children:[c.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:e("view.standard")}),c.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:n.map(o=>c.jsx("button",{type:"button","aria-pressed":t===o.value,onClick:()=>TP(o.value),className:Ee("h-7 flex-1 whitespace-nowrap px-1.5 text-[11px] transition-colors",t===o.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:o.label},o.value))}),c.jsx("div",{className:"max-w-[210px] text-[10px] leading-snug text-muted-foreground",children:e("view.standardHint")})]})}function PP(){const e=re(),[t,n]=$.useState(!1),o=x(r=>{var a;return((a=r.diagram.meta)==null?void 0:a.labelMode)??"all"});return c.jsxs(rn,{open:t,onOpenChange:n,trigger:c.jsx(Fe,{content:c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:e("view.label")}),c.jsx("div",{className:"text-muted-foreground",children:e("view.labelHint")})]}),children:c.jsx(Ve,{variant:"ghost",size:"icon",onClick:()=>n(r=>!r),"aria-label":e("view.label"),"aria-expanded":t,className:Ee(o==="off"&&"text-muted-foreground/60"),children:c.jsx(es,{})})}),children:[c.jsx(fC,{}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(gC,{})]})}function IP({stacked:e}={}){const t=re(),[n,o]=$.useState(!1),[r,a]=cC(),i=c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:t("view.menu")}),c.jsx("div",{className:"text-muted-foreground",children:t("view.menuHint")})]}),l=e?c.jsx(Fe,{content:i,children:c.jsxs("button",{type:"button",onClick:()=>o(s=>!s),"aria-label":t("view.menu"),"aria-pressed":n,className:Ee("flex h-12 w-12 flex-col items-center justify-center gap-0.5 rounded-md text-[10px] font-medium leading-tight transition-colors",n?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[c.jsx(tr,{className:"size-4"}),c.jsx("span",{className:"max-w-full truncate",children:t("view.menu")})]})}):c.jsx(Fe,{content:i,children:c.jsx(Ve,{variant:"ghost",size:"icon",onClick:()=>o(s=>!s),"aria-label":t("view.menu"),"aria-pressed":n,children:c.jsx(tr,{})})});return c.jsx(rn,{open:n,onOpenChange:o,trigger:l,children:c.jsxs("div",{className:"flex flex-col gap-0.5",children:[c.jsx(mC,{}),c.jsxs("div",{className:"flex items-center gap-0.5",children:[c.jsx(dC,{}),c.jsx(uC,{})]}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsxs("div",{className:"flex items-center gap-0.5",children:[c.jsx(pC,{}),c.jsx(hC,{grid:r,setGrid:a})]}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(fC,{}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(gC,{}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(rC,{})]})})}function ki(){const e=Pt();return!x(n=>n.readOnly)&&it(e,"dense")?null:c.jsx(zP,{tier:e})}function zP({tier:e}){const t=it(e,"tight"),n=x(a=>a.readOnly),[o,r]=cC();return c.jsx("div",{className:"absolute z-50",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))",right:"calc(0.75rem + env(safe-area-inset-right, 0px))"},children:c.jsxs("div",{className:"ole-glass flex items-center gap-0.5 rounded-2xl border border-border p-1.5 shadow-sm",children:[c.jsx(dC,{}),!t&&c.jsx(mC,{}),c.jsx(uC,{}),c.jsx("div",{"aria-hidden":!0,className:"mx-1 h-4 w-px bg-border"}),c.jsx(pC,{}),c.jsx(hC,{grid:o,setGrid:r}),!n&&c.jsx(PP,{}),!n&&c.jsx(SP,{})]})})}const bC=[{id:"select",labelKey:"tool.select",hotkey:"V",descriptionKey:"tool.selectHint",icon:ej,switchTo:"select",iconOnly:!0},{id:"pan",labelKey:"tool.pan",hotkey:"H",descriptionKey:"tool.panHint",icon:QC,switchTo:"pan",groupBreakAfter:!0,iconOnly:!0},{id:"busbar",labelKey:"tool.bus",hotkey:"B",descriptionKey:"tool.busHint",icon:$r,switchTo:"busbar"},{id:"junction",labelKey:"tool.junction",hotkey:"J",descriptionKey:"tool.junctionHint",icon:qC,switchTo:"junction",iconOnly:!0},{id:"place",labelKey:"tool.place",hotkey:"P",descriptionKey:"tool.placeHint",icon:Qi,switchTo:"place"},{id:"wire",labelKey:"tool.wire",hotkey:"W",descriptionKey:"tool.wireHint",icon:Wi,switchTo:"wire",groupBreakAfter:!0},{id:"text",labelKey:"tool.text",hotkey:"T",descriptionKey:"tool.textHint",icon:es,switchTo:"text",iconOnly:!0,drawing:!0},{id:"rect",labelKey:"tool.rect",hotkey:"F",descriptionKey:"tool.rectHint",icon:ij,switchTo:"rect",iconOnly:!0,drawing:!0},{id:"ellipse",labelKey:"tool.ellipse",hotkey:"O",descriptionKey:"tool.ellipseHint",icon:VC,switchTo:"ellipse",iconOnly:!0,drawing:!0},{id:"line",labelKey:"tool.line",hotkey:"L",descriptionKey:"tool.lineHint",icon:oj,switchTo:"line",iconOnly:!0,drawing:!0},{id:"table",labelKey:"tool.table",hotkey:"D",descriptionKey:"tool.tableHint",icon:lj,switchTo:"table",iconOnly:!0,drawing:!0}],Si=bC.filter(e=>e.drawing),_i=bC.filter(e=>!e.drawing);function MP(){const e=re(),t=x(p=>p.activeTool),n=x(p=>p.placeKind),o=x(p=>p.placeFromTerminal),r=x(p=>p.wireDragFrom),a=x(p=>p.busbarDrawStart),i=x(p=>p.selection.length>0||p.selectedNode!=null),l=x(p=>p.editingAnnotation),s=x(p=>{var f;const g=Qt(p);if(!g)return null;const h=(f=p.diagram.annotations)==null?void 0:f.find(b=>b.id===g);return h?ut(h):null});if(l)return c.jsx("div",{className:"ole-glass pointer-events-none flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground shadow-sm",children:c.jsx("span",{children:e("mode.annEditing")})});let d=null,u=!1;switch(t){case"select":if(s){d=e(s==="table"?"mode.annTableSel":s==="text"?"mode.annTextSel":"mode.annShapeSel"),u=!0;break}d=e(i?"mode.selectWithSel":"mode.selectEmpty"),i&&(u=!0);break;case"pan":d=e("mode.pan");break;case"wire":d=e(r?"mode.wireDragging":"mode.wireInit"),u=!0;break;case"busbar":d=e(a?"mode.busDragging":"mode.busInit"),u=!0;break;case"junction":d=e("mode.junction"),u=!0;break;case"place":n?o?d=e("mode.placeFromTerm"):d=e("mode.placeNormal"):d=e("mode.placeNoKind"),u=!0;break;case"text":d=e("mode.text"),u=!0;break;case"rect":d=e("mode.rect"),u=!0;break;case"ellipse":d=e("mode.ellipse"),u=!0;break;case"line":d=e("mode.line"),u=!0;break;case"table":d=e("mode.table"),u=!0;break}if(!d)return null;const m=e(t==="select"?"mode.escSelect":"mode.escOther");return c.jsxs("div",{className:"ole-glass pointer-events-none flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground shadow-sm",children:[c.jsx("span",{children:d}),u&&c.jsxs("span",{className:"text-muted-foreground/70",children:["· ",m]})]})}function DP(){const e=re(),t=x(y=>y.activeTool),n=x(y=>y.placeKind),o=x(y=>y.setActiveTool),r=x(y=>y.past.length),a=x(y=>y.future.length),i=x(y=>y.undo),l=x(y=>y.redo),s=Pt(),d=it(s,"tight"),u=!it(s,"dense"),m=it(s,"dense"),p=new Set(["select"]),g=m?_i.filter(y=>!p.has(y.id)):_i,h=y=>t===y.switchTo,[f,b]=$.useState(!1);return c.jsxs("div",{className:"absolute left-1/2 z-20 flex -translate-x-1/2 flex-col items-center gap-1.5",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))"},children:[u&&c.jsx("div",{className:Ee("transition-opacity duration-150",f&&"pointer-events-none opacity-0"),children:c.jsx(MP,{})}),c.jsxs("div",{onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),className:Ee("ole-glass flex flex-row items-center rounded-2xl border border-border shadow-sm",m?"gap-0.5 p-1":"gap-0.5 p-1.5"),children:[m&&c.jsx(OP,{stacked:!0}),g.map(y=>{const w=y.icon,j=h(y),_=y.id==="place"&&j&&n==null?e("tool.placeNoKindTooltip"):e(y.descriptionKey);return c.jsxs($.Fragment,{children:[c.jsx(Lt,{icon:w,label:e(y.labelKey),hotkey:y.hotkey,active:j,iconOnly:!m&&(y.iconOnly||d),stacked:m,description:_,onClick:()=>{o(y.switchTo,{placeKind:y.presetPlaceKind!==void 0?y.presetPlaceKind:void 0})}}),y.groupBreakAfter&&!m&&c.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"})]},y.id)}),c.jsx(BP,{stacked:m}),!m&&c.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"}),m?c.jsx(HP,{stacked:!0}):c.jsxs(c.Fragment,{children:[c.jsx(Lt,{icon:io,label:e("tool.undo"),hotkey:"⌘Z",description:e("tool.undoHint"),iconOnly:!0,disabled:r===0,onClick:i}),c.jsx(Lt,{icon:Ar,label:e("tool.redo"),hotkey:"⌘⇧Z",description:e("tool.redoHint"),iconOnly:!0,disabled:a===0,onClick:l}),c.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"}),c.jsx(RP,{iconOnly:d})]}),m&&c.jsx(IP,{stacked:!0})]})]})}function OP({stacked:e}){const t=re(),n=at(r=>r.outlineOpen),o=at(r=>r.toggleOutline);return c.jsx(Lt,{icon:Ui,label:t("outline.title"),active:n,iconOnly:!0,stacked:e,onClick:o})}function Lt({icon:e,label:t,hotkey:n,active:o,disabled:r,iconOnly:a,stacked:i,onClick:l,description:s,hasMenu:d,suppressTooltip:u}){const m=c.jsxs("div",{className:"space-y-0.5",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:t}),n&&c.jsx("span",{className:"ml-1.5 text-muted-foreground",children:n})]}),s&&c.jsx("div",{className:"text-muted-foreground",children:s})]});return c.jsx(Fe,{content:m,disabled:r||u,children:c.jsxs("button",{type:"button",onClick:l,disabled:r,"aria-label":t,"aria-pressed":o,className:Ee("rounded-md font-medium transition-colors",i?"flex h-12 w-12 flex-col items-center justify-center gap-0.5 text-[10px] leading-tight":"flex h-9 items-center gap-1.5 text-xs",!i&&(a?"w-9 justify-center":"px-2.5"),o?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground",r&&"pointer-events-none opacity-40"),children:[c.jsxs("span",{className:"relative inline-flex shrink-0",children:[c.jsx(e,{className:"size-4"}),d&&(a||i)&&c.jsx("span",{"aria-hidden":!0,className:Ee("pointer-events-none absolute -bottom-[3px] -right-[3px] border-b-[3px] border-l-[3px] border-b-current border-l-transparent",o?"text-primary-foreground/70":"text-muted-foreground/60")}),n&&!i&&c.jsx("span",{"aria-hidden":!0,className:Ee("pointer-events-none absolute -right-1.5 -top-1.5 rounded-sm px-1 font-mono text-[8px] leading-[1.1]",o?"bg-primary-foreground/20 text-primary-foreground/85":"bg-foreground/10 text-muted-foreground"),children:n})]}),i?c.jsx("span",{className:"max-w-full truncate",children:t}):!a&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:t}),d&&c.jsx(qi,{"aria-hidden":!0,className:Ee("-ml-0.5 size-3 shrink-0",o?"opacity-70":"opacity-50")})]})]})})}function yC(){const e=x(r=>r.diagram.elements),t=x(r=>r.diagram.layout),n=x(r=>r.selection),o=t??{};return{hasAnyElement:e.length>0,hasArrangedAny:Object.keys(o).length>0,hasGapsAll:e.some(r=>!o[r.id]),hasSelection:n.length>0,selectionHasArranged:n.some(r=>!!o[r]),selectionHasGaps:n.some(r=>!o[r])}}function RP({iconOnly:e}){const t=re(),[n,o]=$.useState(!1),r=yC(),a=i=>()=>{o(!1),i()};return c.jsxs(rn,{open:n,onOpenChange:o,trigger:c.jsx(Lt,{icon:bn,label:t("layout.label"),description:t("layout.hint"),active:n,iconOnly:e,onClick:()=>o(i=>!i)}),children:[c.jsx(et,{onClick:a(()=>x.getState().autoArrangeAll()),icon:c.jsx(bn,{}),disabled:!r.hasAnyElement||!r.hasArrangedAny,children:t("layout.allAuto")}),c.jsx(et,{onClick:a(()=>x.getState().autoArrangeSelection()),icon:c.jsx(bn,{}),disabled:!r.hasSelection||!r.selectionHasArranged,children:t("layout.selAuto")}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(et,{onClick:a(()=>x.getState().fillUnplacedAll()),icon:c.jsx(ao,{}),disabled:!r.hasGapsAll,children:t("layout.allFill")}),c.jsx(et,{onClick:a(()=>x.getState().fillUnplacedSelection()),icon:c.jsx(ao,{}),disabled:!r.hasSelection||!r.selectionHasGaps,children:t("layout.selFill")})]})}function LP({className:e}){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",className:e,"aria-hidden":!0,children:[c.jsx("rect",{x:"1.25",y:"1.25",width:"8.5",height:"8.5",rx:"1"}),c.jsx("circle",{cx:"10.5",cy:"10.5",r:"4.25"})]})}function BP({stacked:e}){const t=re(),[n,o]=$.useState(!1),r=x(s=>s.activeTool),a=x(s=>s.setActiveTool),i=Si.find(s=>s.switchTo===r),l=(i==null?void 0:i.icon)??LP;return c.jsx(rn,{open:n,onOpenChange:o,trigger:c.jsx(Lt,{icon:l,label:t("tool.draw"),description:t("tool.drawHint"),active:!!i||n,iconOnly:!1,hasMenu:!0,suppressTooltip:n,stacked:e,onClick:()=>o(s=>!s)}),children:Si.map(s=>{const d=s.icon;return c.jsx(et,{onClick:()=>{o(!1),a(s.switchTo)},icon:c.jsx(d,{}),active:r===s.switchTo,hotkey:s.hotkey,children:t(s.labelKey)},s.id)})})}function HP({stacked:e}){const t=re(),[n,o]=$.useState(!1),r=x(p=>p.past.length),a=x(p=>p.future.length),i=x(p=>p.undo),l=x(p=>p.redo),s=x(p=>p.selection.length>0),d=x(p=>p.clipboard!=null),u=yC(),m=p=>()=>{o(!1),p()};return c.jsxs(rn,{open:n,onOpenChange:o,trigger:c.jsx(Lt,{icon:tr,label:t("tool.more"),description:t("tool.moreHint"),active:n,iconOnly:!0,stacked:e,onClick:()=>o(p=>!p)}),children:[c.jsx(et,{onClick:m(i),icon:c.jsx(io,{}),disabled:r===0,children:t("tool.undo")}),c.jsx(et,{onClick:m(l),icon:c.jsx(Ar,{}),disabled:a===0,children:t("tool.redo")}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(et,{onClick:m(()=>x.getState().cutSelection()),icon:c.jsx(Zi,{}),disabled:!s,children:t("menu.cut")}),c.jsx(et,{onClick:m(()=>x.getState().copySelection()),icon:c.jsx(Gi,{}),disabled:!s,children:t("menu.copy")}),c.jsx(et,{onClick:m(()=>x.getState().pasteClipboard()),icon:c.jsx(Vi,{}),disabled:!d,children:t("menu.paste")}),c.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),c.jsx(et,{onClick:m(()=>x.getState().autoArrangeAll()),icon:c.jsx(bn,{}),disabled:!u.hasAnyElement||!u.hasArrangedAny,children:t("layout.allAuto")}),c.jsx(et,{onClick:m(()=>x.getState().autoArrangeSelection()),icon:c.jsx(bn,{}),disabled:!u.hasSelection||!u.selectionHasArranged,children:t("layout.selAuto")}),c.jsx(et,{onClick:m(()=>x.getState().fillUnplacedAll()),icon:c.jsx(ao,{}),disabled:!u.hasGapsAll,children:t("layout.allFill")}),c.jsx(et,{onClick:m(()=>x.getState().fillUnplacedSelection()),icon:c.jsx(ao,{}),disabled:!u.hasSelection||!u.selectionHasGaps,children:t("layout.selFill")})]})}function et({children:e,icon:t,onClick:n,disabled:o,active:r,hotkey:a}){return c.jsxs("button",{type:"button",role:"menuitem","aria-current":r?"true":void 0,disabled:o,onClick:n,className:Ee("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",r&&"bg-accent/60 font-medium text-accent-foreground",o&&"pointer-events-none text-muted-foreground opacity-60 hover:bg-transparent"),children:[t,c.jsx("span",{className:"flex-1",children:e}),a&&c.jsx("kbd",{className:"ml-2 shrink-0 font-mono text-[10px] text-muted-foreground",children:a})]})}function FP(){const e=at(r=>r.outlineOpen),t=at(r=>r.setOutlineOpen),n=Pt();return it(n,"dense")?e?c.jsx("div",{className:"absolute z-10",style:{left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",bottom:"calc(4rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px) + 0.75rem)"},children:c.jsx(Ci,{onClose:()=>t(!1),sheet:!0})}):null:c.jsx("div",{className:"absolute z-10 flex flex-col items-start",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))",left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",maxHeight:"calc(100% - 1.5rem)"},children:e?c.jsx(Ci,{onClose:()=>t(!1)}):c.jsx(WP,{onClick:()=>t(!0)})})}function WP({onClick:e}){const t=re(),n=Pt(),o=it(n,"compact");return c.jsxs("button",{type:"button",onClick:e,"aria-label":t("outline.title"),title:t("outline.title"),className:Ee("ole-glass flex h-12 items-center rounded-2xl border border-border text-muted-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",o?"w-12 justify-center":"gap-2 px-3"),children:[c.jsx(Ui,{className:"size-4 shrink-0"}),!o&&c.jsx("span",{className:"text-xs font-medium",children:t("outline.title")})]})}function Ci({onClose:e,sheet:t}){const n=re(),o=x(d=>d.diagram.elements),r=x(d=>d.activeTool==="place"),a=Pt(),i=it(a,"compact"),l=it(a,"dense"),s=t?"min(50vh, calc(100vh - 9rem))":r?"min(40vh, calc(100vh - 200px))":"min(70vh, calc(100vh - 100px))";return c.jsxs("aside",{className:Ee("ole-glass flex flex-col overflow-hidden rounded-2xl border border-border shadow-sm",t?"w-full":i?"w-52":"w-64"),style:{height:s},children:[c.jsxs("button",{type:"button",onClick:e,"aria-label":n("outline.collapseAria"),title:n("outline.collapse"),className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2 text-left transition-colors hover:bg-muted/40",children:[c.jsx("span",{className:"flex-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:n("outline.title")}),!l&&c.jsx(VP,{children:o.length}),c.jsx(tj,{className:"size-3.5 text-muted-foreground"})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:o.length===0?c.jsx("p",{className:"px-2 py-2 text-xs italic text-muted-foreground",children:n("outline.empty")}):c.jsx("ul",{className:"space-y-px",children:o.map(d=>c.jsx(qP,{element:d},d.id))})})]})}function qP({element:e}){const t=x(s=>s.internal.library.get(e.kind)),n=x(s=>s.selection.includes(e.id)),o=x(s=>s.setSelection),r=x(s=>s.toggleInSelection),a=Pt(),i=!it(a,"compact"),l=s=>{s.shiftKey||s.metaKey||s.ctrlKey?r(e.id):o([e.id])};return c.jsxs("li",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1 hover:bg-accent data-[selected=true]:bg-[color-mix(in_oklch,var(--selection)_18%,transparent)]",title:e.note??`${e.name??e.id} (${e.kind})`,"data-element-id":e.id,"data-selected":n?"true":void 0,onClick:l,children:[c.jsx("div",{className:"flex h-4 w-6 shrink-0 items-center justify-center",children:t&&c.jsx("svg",{viewBox:t.viewBox,className:"ole-symbol size-full",preserveAspectRatio:"xMidYMid meet",dangerouslySetInnerHTML:{__html:t.svg}})}),c.jsx("span",{className:"flex-1 truncate text-xs text-foreground/90 group-hover:text-accent-foreground",children:e.name??e.id}),i&&c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:e.id})]})}function VP({children:e}){return c.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e})}const xC="ole-palette-collapsed",GP=new Set(["busbar"]),kn="__custom__";function KP(e){const t={};for(const n of e.values()){if(GP.has(n.id))continue;const o=yo(n.id)?kn:n.category;(t[o]??(t[o]=[])).push(n)}return t}function UP(e){var o;const t=new Set([...ba,kn]),n=Object.keys(e).filter(r=>!t.has(r));return[...(o=e[kn])!=null&&o.length?[kn]:[],...ba.filter(r=>{var a;return(a=e[r])==null?void 0:a.length}),...n]}function XP(){try{const e=window.localStorage.getItem(xC);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(n=>typeof n=="string")):new Set}catch{return new Set}}function YP(e){try{window.localStorage.setItem(xC,JSON.stringify([...e]))}catch{}}function ZP(){const e=re(),t=x(m=>m.activeTool==="place"),n=x(m=>m.placeKind),o=x(m=>m.setActiveTool),r=at(m=>m.outlineOpen),a=Pt(),i=it(a,"dense"),l=68,d=i?void 0:`calc(100vh - ${l}px - ${r?"calc(40vh + 20px)":"68px"})`;if(!t||i&&n!=null)return null;const u=i?{top:`calc(${l}px + var(--ole-top-inset, 0px) + var(--ole-safe-top, 0px))`,left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",bottom:"calc(4rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px) + 0.75rem)"}:{top:l};return c.jsx("div",{className:i?"absolute z-20":"absolute left-3 z-20",style:u,role:"dialog","aria-label":e("library.title"),children:c.jsxs("aside",{className:i?"ole-glass flex h-full w-full flex-col overflow-hidden rounded-2xl border border-border shadow-md":"ole-glass flex w-72 flex-col overflow-hidden rounded-2xl border border-border shadow-md",style:d?{maxHeight:d}:void 0,children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2",children:[c.jsx("span",{className:"flex-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e("library.title")}),c.jsx("button",{type:"button",onClick:()=>o(i?"pan":"select"),className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":e("common.close"),title:e("common.close"),children:c.jsx(bo,{className:"size-3.5"})})]}),c.jsx(QP,{sheet:i})]})})}function QP({sheet:e}){const t=re(),n=Bt(),[o,r]=$.useState(""),[a,i]=$.useState(()=>XP()),l=x(f=>f.internal.library),s=Yt(f=>f.onCreateComponent),d=$.useMemo(()=>KP(l),[l]),u=$.useMemo(()=>UP(d),[d]),m=$.useMemo(()=>{const f=o.trim().toLowerCase();if(!f)return d;const b={};for(const[y,w]of Object.entries(d)){const j=w.filter(_=>{const E=n(`${_.id}.name`,_.name).toLowerCase(),W=n(`${_.id}.desc`,_.description??"").toLowerCase();return E.includes(f)||_.id.toLowerCase().includes(f)||W.includes(f)});j.length&&(b[y]=j)}return b},[o,n,d]),p=o.trim().length>0,g=p&&Object.values(m).every(f=>!(f!=null&&f.length)),h=$.useCallback((f,b)=>{i(y=>{const w=new Set(y);return b?w.delete(f):w.add(f),YP(w),w})},[]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-1.5 px-2 pb-1.5 pt-2",children:[c.jsx(JP,{value:o,onChange:r}),s&&c.jsxs("button",{type:"button",onClick:s,className:"flex w-full cursor-pointer items-center gap-1.5 rounded-md border border-dashed border-border px-2 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:border-solid hover:bg-accent hover:text-accent-foreground",children:[c.jsx(Xi,{className:"size-3.5 shrink-0"}),c.jsx("span",{className:"truncate",children:t("library.createComponent")})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:g?c.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:t("library.empty")}):u.map(f=>{var _;const b=m[f];if(!(b!=null&&b.length))return null;const y=((_=d[f])==null?void 0:_.length)??b.length,w=t(f===kn?"cat.custom":`cat.${f}`),j=p||!a.has(f);return c.jsxs("details",{open:j,className:"group mb-2 last:mb-0",onToggle:E=>{p||h(f,E.currentTarget.open)},children:[c.jsxs("summary",{className:"flex cursor-pointer select-none items-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:[c.jsx(qi,{className:"size-3 transition-transform [details:not([open])>summary>&]:-rotate-90"}),c.jsx("span",{className:"flex-1",children:w}),c.jsx(tI,{children:p&&b.length!==y?`${b.length}/${y}`:y})]}),c.jsx("ul",{className:"mt-0.5 space-y-px",children:b.map(E=>c.jsx(eI,{entry:E,sheet:e},E.id))})]},f)})})]})}function JP({value:e,onChange:t}){const n=re();return c.jsxs("div",{className:"relative",children:[c.jsx(nj,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),c.jsx("input",{type:"text",value:e,onChange:o=>t(o.target.value),placeholder:n("library.searchPlaceholder"),className:"h-7 w-full rounded-md border border-border/60 bg-background/50 pl-7 pr-7 text-xs placeholder:text-muted-foreground focus:border-border focus:outline-none focus:ring-1 focus:ring-ring","aria-label":n("library.searchAria")}),e&&c.jsx("button",{type:"button","aria-label":n("library.clearSearch"),onClick:()=>t(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:c.jsx(bo,{className:"size-3"})})]})}function eI({entry:e,sheet:t}){const n=re(),o=Bt(),r=o(`${e.id}.name`,e.name),a=yo(e.id),i=o(`${e.id}.desc`,e.description??""),l=x(p=>p.setActiveTool),s=x(p=>p.activeTool==="place"&&p.placeKind===e.id),d=x(p=>t&&p.activeTool==="place"&&p.placeKind==null&&p.lastPlaceKind===e.id),u=$.useRef(null);$.useEffect(()=>{var p;d&&((p=u.current)==null||p.scrollIntoView({block:"nearest"}))},[d]);const m=p=>{p.dataTransfer.effectAllowed="copy",p.dataTransfer.setData("application/x-oneline-kind",e.id),p.dataTransfer.setData("text/plain",e.id);const g=document.createElement("div");g.className="ole-glass",g.style.cssText=["position:absolute","top:-9999px","left:-9999px","width:64px","height:64px","display:flex","align-items:center","justify-content:center","border-radius:12px","border:1px solid var(--border)","box-shadow:0 4px 12px rgba(0,0,0,0.12)","color:var(--foreground)","padding:8px"].join(";"),g.innerHTML=`<svg class="ole-symbol" viewBox="${e.viewBox}" width="48" height="48" preserveAspectRatio="xMidYMid meet">${e.svg}</svg>`,document.body.appendChild(g),p.dataTransfer.setDragImage(g,32,32),setTimeout(()=>g.remove(),0)};return c.jsxs("li",{ref:u,className:`group flex cursor-grab items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-accent active:cursor-grabbing ${s?"bg-accent ring-1 ring-[var(--selection)]/60":d?"ring-1 ring-[var(--selection)]/30":""}`,draggable:!0,onDragStart:m,onClick:()=>l("place",{placeKind:e.id}),"data-kind":e.id,title:i?`${r} — ${i}`:`${r} — ${n("library.itemHint")}`,children:[c.jsx("div",{className:"flex h-7 w-12 shrink-0 items-center justify-center",children:c.jsx("svg",{viewBox:e.viewBox,className:"ole-symbol size-full",preserveAspectRatio:"xMidYMid meet",dangerouslySetInnerHTML:{__html:e.svg}})}),c.jsx("span",{className:"truncate text-xs text-foreground/80 group-hover:text-accent-foreground",children:r}),a&&c.jsx("span",{className:"ml-auto shrink-0 rounded-sm border border-border/70 px-1 py-px font-mono text-[9px] leading-none text-muted-foreground/70",title:n("library.customHint"),children:n("library.customTag")})]})}function tI({children:e}){return c.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e})}const jr="ole-onboarding-dismissed";function nI(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(jr)==="1"}catch{return!1}}function ji(e){try{e?window.localStorage.setItem(jr,"1"):window.localStorage.removeItem(jr)}catch{}}const $i=Nn(e=>({dismissed:nI(),dismiss:()=>{ji(!0),e({dismissed:!0})},reset:()=>{ji(!1),e({dismissed:!1})}}));function oI(){const e=re(),t=$i(o=>o.dismissed),n=$i(o=>o.dismiss);return t?null:c.jsxs("div",{role:"dialog","aria-label":e("onboard.title"),className:"ole-glass pointer-events-none absolute left-1/2 top-1/2 z-10 w-[min(420px,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-border p-5 shadow-md",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold",children:e("onboard.title")}),c.jsx("button",{type:"button",onClick:n,"aria-label":e("onboard.dismiss"),className:"pointer-events-auto rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:c.jsx(bo,{className:"size-3.5"})})]}),c.jsxs("ol",{className:"mt-3 space-y-2.5",children:[c.jsx(Zo,{n:1,icon:c.jsx(Qi,{}),title:e("onboard.step1.title"),body:e("onboard.step1.body")}),c.jsx(Zo,{n:2,icon:c.jsx(Wi,{}),title:e("onboard.step2.title"),body:e("onboard.step2.body")}),c.jsx(Zo,{n:3,icon:c.jsx($r,{}),title:e("onboard.step3.title"),body:e("onboard.step3.body")})]}),c.jsx("button",{type:"button",onClick:n,className:"pointer-events-auto mt-4 w-full rounded-md bg-primary py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90",children:e("onboard.dismiss")})]})}function Zo({n:e,icon:t,title:n,body:o}){return c.jsxs("li",{className:"flex items-start gap-2.5",children:[c.jsx("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_oklch,var(--selection)_18%,transparent)] font-mono text-[10px] font-semibold tabular-nums text-[var(--selection)]","aria-hidden":!0,children:e}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[c.jsx("span",{className:"text-muted-foreground [&>svg]:size-3.5",children:t}),c.jsx("span",{children:n})]}),c.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-muted-foreground",children:o})]})]})}function rI(){const e=re(),t=x(f=>f.selection),n=x(f=>f.diagram.elements),o=x(f=>f.diagram.buses),r=x(f=>f.diagram.junctions),a=x(f=>f.selectedNode),i=x(f=>f.selectedWire),l=x(f=>f.selectedAnnotations),s=x(Qt);if(i)return c.jsx(xI,{wireId:i});if(a)return c.jsx(vI,{nodeId:a});if(s)return c.jsx(dI,{annId:s});const d=t.length+l.length;if(d===0)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:e("props.empty")});if(d>1)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:e("props.multi",{n:d})});const u=t[0],m=(o??[]).find(f=>f.id===u);if(m)return c.jsx(lI,{bus:m});const p=(r??[]).find(f=>f.id===u);if(p)return c.jsx(wI,{junction:p});const g=n.find(f=>f.id===u);if(!g)return null;const h=wt[g.kind];return c.jsxs("div",{className:"flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs",children:[c.jsx(pI,{id:u,kind:g.kind}),c.jsx(kt,{label:e("props.name"),value:g.name??"",placeholder:g.id,multiline:!0,onCommit:f=>{const b=vo(f,"").join(`
233
+ `);x.getState().updateElement(u,{name:b===""?void 0:b})}}),c.jsx(tt,{label:e("props.label"),children:c.jsx(To,{active:!g.labelHidden,onClick:()=>x.getState().updateElement(u,{labelHidden:g.labelHidden?void 0:!0}),children:g.labelHidden?e("props.labelHidden"):e("props.labelShown")})}),c.jsx(Vr,{label:e("props.note"),value:g.note??"",onCommit:f=>x.getState().updateElement(u,{note:f.trim()===""?void 0:f.trim()})},u),c.jsx(Ot,{label:e("props.color"),value:g.color,onChange:f=>x.getState().updateElement(u,{color:f==="default"?void 0:f})}),h&&c.jsx(fI,{id:u}),Ir(g.kind)&&c.jsx(hI,{id:u,name:g.name}),(h==null?void 0:h.state)&&h.state.length>0&&c.jsx("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:h.state.map(f=>c.jsx(_I,{id:u,element:g,field:f},f.name))}),c.jsx(aI,{id:u,element:g,schema:(h==null?void 0:h.params)??[]})]})}function aI({id:e,element:t,schema:n}){const o=new Set(n.map(a=>a.name)),r=t.params?Object.entries(t.params).filter(([a])=>!o.has(a)):[];return n.length===0&&r.length===0?null:c.jsxs("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:[n.map(a=>c.jsx(iI,{id:e,element:t,field:a},a.name)),r.map(([a,i])=>c.jsx(sI,{id:e,element:t,fieldKey:a,value:i},a))]})}function iI({id:e,element:t,field:n}){var s;const o=re(),r=Bt(),a=((s=t.params)==null?void 0:s[n.name])??n.default,i=r(`${t.kind}.param.${n.name}`,n.label??n.name),l=d=>{const u={...t.params??{}};d===void 0||d===""?delete u[n.name]:u[n.name]=d,x.getState().updateElement(e,{params:Object.keys(u).length>0?u:void 0})};return n.type==="boolean"?c.jsx(tt,{label:i,children:c.jsx(To,{active:!!a,onClick:()=>l(!a),children:o(a?"common.yes":"common.no")})}):n.type==="number"?c.jsx(No,{label:i,value:typeof a=="number"?a:0,unit:n.unit,onCommit:l}):c.jsx(kt,{label:i,value:typeof a=="string"?a:"",unit:n.unit,onCommit:d=>l(d.trim()===""?void 0:d)})}function sI({id:e,element:t,fieldKey:n,value:o}){const r=re(),a=i=>{const l={...t.params??{}};i===void 0?delete l[n]:l[n]=i,x.getState().updateElement(e,{params:Object.keys(l).length>0?l:void 0})};return typeof o=="boolean"?c.jsx(tt,{label:n,children:c.jsx(To,{active:o,onClick:()=>a(!o),children:r(o?"common.yes":"common.no")})}):typeof o=="number"?c.jsx(No,{label:n,value:o,onCommit:a}):c.jsx(kt,{label:n,value:o,onCommit:i=>a(i.trim()===""?void 0:i)})}function lI({bus:e}){const t=re(),n=e.id,o=r=>{const a=r.trim();oo(n,{name:a===""?void 0:a})};return c.jsxs("div",{className:"flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs",children:[c.jsx(kt,{label:t("props.name"),value:e.name??"",placeholder:e.id,onCommit:o}),c.jsx(Vr,{label:t("props.note"),value:e.note??"",onCommit:r=>oo(n,{note:r.trim()===""?void 0:r.trim()})},n),c.jsx(Ot,{label:t("props.color"),value:e.color,onChange:r=>oo(n,{color:r==="default"?void 0:r})}),c.jsx(cI,{bus:e})]})}function cI({bus:e}){const t=(o,r)=>{const a={...e.params??{}};r===void 0||r===""?delete a[o]:a[o]=r,oo(e.id,{params:Object.keys(a).length>0?a:void 0})},n=e.params??{};return c.jsx("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:c.jsx(No,{label:"Un",value:typeof n.Un=="number"?n.Un:0,unit:"kV",onCommit:o=>t("Un",o)})})}function oo(e,t){x.getState().dispatch(n=>{const o=(n.buses??[]).map(r=>r.id===e?{...r,...t}:r);return{...n,buses:o}})}function dI({annId:e}){const t=re(),n=x(a=>(a.diagram.annotations??[]).find(i=>i.id===e));if(!n)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.annNotFound",{id:e})});const o=a=>x.getState().updateAnnotation(e,a),r=ut(n);switch(r){case"rect":case"ellipse":{const a=n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsx(kt,{label:t("props.annLabel"),value:a.label??"",placeholder:t("props.annLabelPlaceholder"),onCommit:i=>o({label:i.trim()===""?void 0:i.trim()})}),c.jsx(Ot,{label:t("props.color"),value:a.color,onChange:i=>o({color:i==="default"?void 0:i})}),c.jsx(Ai,{stroke:a.stroke,strokeWidth:a.strokeWidth,defaultStroke:r==="rect"?"dashed":"solid",patch:o}),c.jsx(En,{label:t("props.annFill"),value:a.fill??"none",options:[{value:"none",label:t("props.annFillNone")},{value:"tint",label:t("props.annFillTint")}],onChange:i=>o({fill:i==="none"?void 0:i})})]})}case"line":{const a=n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsx(Ot,{label:t("props.color"),value:a.color,onChange:i=>o({color:i==="default"?void 0:i})}),c.jsx(Ai,{stroke:a.stroke,strokeWidth:a.strokeWidth,defaultStroke:"solid",patch:o}),c.jsx(En,{label:t("props.annArrow"),value:a.arrow??"none",options:[{value:"none",label:t("props.annArrowNone")},{value:"end",label:t("props.annArrowEnd")},{value:"both",label:t("props.annArrowBoth")}],onChange:i=>o({arrow:i==="none"?void 0:i})})]})}case"table":{const a=n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsx(Ei,{label:t("props.annRows"),value:a.rowHeights.length,min:1,onChange:i=>o(uI(a,i))}),c.jsx(Ei,{label:t("props.annCols"),value:a.colWidths.length,min:1,onChange:i=>o(mI(a,i))}),c.jsx(Ot,{label:t("props.color"),value:a.color,onChange:i=>o({color:i==="default"?void 0:i})}),c.jsx(Ni,{label:t("props.annFontSize"),value:a.fontSize,onCommit:i=>o({fontSize:i})})]})}default:{const a=n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsx(Ot,{label:t("props.color"),value:a.color,onChange:i=>o({color:i==="default"?void 0:i})}),c.jsx(Ni,{label:t("props.annFontSize"),value:a.fontSize,onCommit:i=>o({fontSize:i})})]})}}}function uI(e,t){const n=e.colWidths.length,o=e.rowHeights[e.rowHeights.length-1]??jn,r=e.rowHeights.slice(0,t);for(;r.length<t;)r.push(o);const a=e.cells.slice(0,t).map(i=>[...i]);for(;a.length<t;)a.push(S_(n,1).cells[0]);return{rowHeights:r,cells:a}}function mI(e,t){const n=e.colWidths[e.colWidths.length-1]??Cn,o=e.colWidths.slice(0,t);for(;o.length<t;)o.push(n);const r=e.cells.map(a=>{const i=a.slice(0,t);for(;i.length<t;)i.push("");return i});return{colWidths:o,cells:r}}function Ot({label:e,value:t,onChange:n}){const o=re(),r=t??"default";return c.jsx(tt,{label:e,children:c.jsx("div",{className:"flex gap-1",children:Mr.map(a=>c.jsx("button",{type:"button","aria-pressed":r===a,"aria-label":o(`props.color.${a}`),title:o(`props.color.${a}`),onClick:()=>n(a),className:Ee("size-6 rounded-md border transition-shadow",r===a?"border-primary ring-1 ring-primary":"border-border/60 hover:border-border"),children:c.jsx("span",{className:Ee("block size-full rounded-[3px]",Qe(a)),style:{backgroundColor:a==="default"?"var(--foreground)":"currentColor"}})},a))})})}function Ai({stroke:e,strokeWidth:t,defaultStroke:n,patch:o}){const r=re();return c.jsxs(c.Fragment,{children:[c.jsx(En,{label:r("props.annStroke"),value:e??n,options:[{value:"solid",label:r("props.annStrokeSolid"),glyph:c.jsx(Vt,{width:1.5})},{value:"dashed",label:r("props.annStrokeDashed"),glyph:c.jsx(Vt,{width:1.5,dash:"5 3"})},{value:"dotted",label:r("props.annStrokeDotted"),glyph:c.jsx(Vt,{width:1.5,dash:"0.1 3"})}],onChange:a=>o({stroke:a})}),c.jsx(En,{label:r("props.annStrokeWidth"),value:String(t??1),options:[{value:"1",label:r("props.annWidthThin"),glyph:c.jsx(Vt,{width:1})},{value:"2",label:r("props.annWidthMedium"),glyph:c.jsx(Vt,{width:2.5})},{value:"3",label:r("props.annWidthThick"),glyph:c.jsx(Vt,{width:4})}],onChange:a=>o({strokeWidth:Number(a)})})]})}function En({label:e,value:t,options:n,onChange:o}){return c.jsx(tt,{label:e,children:c.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:n.map(r=>c.jsx("button",{type:"button","aria-pressed":t===r.value,"aria-label":r.label,title:r.label,onClick:()=>o(r.value),className:Ee("h-7 flex-1 truncate px-1.5 text-[11px] transition-colors",r.glyph&&"flex items-center justify-center",t===r.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.glyph??r.label},r.value))})})}function Vt({width:e,dash:t}){return c.jsx("svg",{viewBox:"0 0 28 12",className:"h-3 w-7","aria-hidden":!0,children:c.jsx("line",{x1:"2",y1:"6",x2:"26",y2:"6",stroke:"currentColor",strokeWidth:e,strokeDasharray:t,strokeLinecap:"round"})})}function pI({id:e,kind:t}){const n=re(),o=Bt(),r=Pr(t);if(!r)return null;const a=l=>x.getState().changeKind(e,l);if(r.id==="continuation")return c.jsx(En,{label:n("props.direction"),value:t,options:[{value:"continuation-out",label:n("props.directionOut")},{value:"continuation-in",label:n("props.directionIn")}],onChange:a});const i=n("props.contactType");return c.jsx(tt,{label:i,children:c.jsx("select",{"aria-label":i,value:t,onChange:l=>a(l.target.value),className:"h-7 w-full min-w-0 rounded-md border border-border/60 bg-transparent px-1.5 text-[11px]",children:r.kinds.map(l=>{var s;return c.jsx("option",{value:l,children:o(`${l}.name`,((s=wt[l])==null?void 0:s.name)??l)},l)})})})}function hI({id:e,name:t}){const n=re(),o=lr(t),r=x(l=>l.diagram.elements),a=o?r.filter(l=>l.id!==e&&Ir(l.kind)&&lr(l.name)===o).map(l=>l.id):[],i=l=>{var u;const s=x.getState();s.setSelection([l]);const d=(u=s.internal.layout.get(l))==null?void 0:u.at;d&&tC(d)};return c.jsx(tt,{label:n("props.partner"),children:o?a.length===0?c.jsx("span",{className:"text-[11px] text-muted-foreground",children:n("props.partnerNone")}):c.jsx("div",{className:"flex flex-wrap gap-1",children:a.map(l=>c.jsx("button",{type:"button",onClick:()=>i(l),className:"h-7 rounded-md border border-border/60 px-2 text-[11px] hover:bg-accent",children:n("props.partnerJump",{id:l})},l))}):c.jsx("span",{className:"text-[11px] text-muted-foreground",children:n("props.partnerUnnamed")})})}function fI({id:e}){const t=re(),n=x(d=>{var u;return((u=d.internal.layout.get(e))==null?void 0:u.scale)??1}),o=Math.round(n*100),[r,a]=$.useState(null),i=d=>{const u=Math.min(Tr,Math.max(Nr,d/100));x.getState().updatePlacement(e,{scale:Math.round(u*100)/100})},l=()=>{if(r===null)return;const d=parseFloat(r.replace(",","."));a(null),Number.isFinite(d)&&d>0&&Math.round(d)!==o&&i(d)},s=t("props.size");return c.jsx(tt,{label:s,children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("div",{className:"relative min-w-0 flex-1",children:[c.jsx("input",{"aria-label":s,inputMode:"decimal",value:r??String(o),onChange:d=>a(d.target.value),onBlur:l,onKeyDown:d=>{d.key==="Enter"&&d.target.blur(),d.key==="Escape"&&a(null)},className:"h-7 w-full rounded-md border border-border/60 bg-transparent pr-5 pl-2 font-mono text-[11px] tabular-nums outline-none focus:border-primary"}),c.jsx("span",{className:"pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-[11px] text-muted-foreground",children:"%"})]}),o!==100&&c.jsx("button",{type:"button",title:t("props.sizeReset"),"aria-label":t("props.sizeReset"),onClick:()=>i(100),className:"h-7 w-7 shrink-0 rounded-md text-[13px] leading-none text-muted-foreground hover:bg-accent",children:"↺"})]})})}function Ei({label:e,value:t,min:n,onChange:o}){return c.jsx(tt,{label:e,children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{type:"button","aria-label":`${e} −`,disabled:t<=n,onClick:()=>o(t-1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"−"}),c.jsx("span",{className:"w-8 text-center font-mono text-[11px] tabular-nums",children:t}),c.jsx("button",{type:"button","aria-label":`${e} +`,onClick:()=>o(t+1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent",children:"+"})]})})}const gI=5,bI=32,yI=8;function Ni({label:e,value:t,onCommit:n}){return c.jsx(kt,{label:e,value:t!=null?String(t):"",placeholder:String(yI),unit:"px",onCommit:o=>{const r=o.trim();if(r===""){n(void 0);return}const a=Number(r);Number.isFinite(a)&&n(Math.min(bI,Math.max(gI,Math.round(a))))}})}function xI({wireId:e}){const t=re(),n=x(b=>b.diagram.wires),o=x(b=>b.diagram.elements),r=x(b=>b.diagram.buses),a=x(b=>b.diagram.junctions),i=x(b=>b.internal.terminalToNode),l=x(b=>b.setSelectedNode),s=(n??[]).find(b=>b.id===e);if(!s)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.wireNotFound",{id:e})});const d=i.get(s.ends[0]),u=new Map(o.map(b=>[b.id,b])),m=new Map((r??[]).map(b=>[b.id,b])),p=new Map((a??[]).map(b=>[b.id,b])),g=b=>{if(!b.includes(".")){const E=m.get(b);if(E)return{id:b,label:E.name??b};const W=p.get(b);return{id:b,label:(W==null?void 0:W.name)??b}}const y=b.indexOf("."),w=b.slice(0,y),j=b.slice(y+1),_=u.get(w);return{id:w,label:(_==null?void 0:_.name)??w,pin:j}},h=g(s.ends[0]),f=g(s.ends[1]);return c.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 text-xs",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.wire")}),c.jsx("div",{className:"font-mono text-[12px]",children:s.id})]}),c.jsx(kt,{label:t("props.label"),value:s.label??"",placeholder:t("props.labelPlaceholder"),onCommit:b=>x.getState().updateWire(e,{label:b.trim()===""?void 0:b.trim()})}),c.jsx(Ot,{label:t("props.color"),value:s.color,onChange:b=>x.getState().updateWire(e,{color:b==="default"?void 0:b})}),c.jsx("ul",{className:"space-y-0.5 border-t border-border/40 pt-2",children:[h,f].map((b,y)=>c.jsxs("li",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 hover:bg-accent",onClick:()=>x.getState().setSelection([b.id]),children:[c.jsx("span",{className:"flex-1 truncate font-mono text-[11px]",children:b.id}),c.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:b.label}),b.pin&&c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:b.pin})]},y))}),d&&c.jsx("button",{type:"button",className:"self-start rounded-md border border-border/60 px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent",onClick:()=>l(d),children:t("props.selectWholeNode")})]})}function wI({junction:e}){var r;const t=re(),n=x(a=>{var i;return(i=a.internal.junctions.get(e.id))==null?void 0:i.world}),o=((r=e.layout)==null?void 0:r.at)??n;return c.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.junction")}),c.jsx("div",{className:"font-mono text-[12px]",children:e.id})]}),c.jsx(kt,{label:t("props.name"),value:e.name??"",placeholder:e.id,onCommit:a=>x.getState().updateJunction(e.id,{name:a.trim()===""?void 0:a.trim()})}),c.jsx(Vr,{label:t("props.note"),value:e.note??"",onCommit:a=>x.getState().updateJunction(e.id,{note:a.trim()===""?void 0:a.trim()})},e.id),o&&c.jsxs("div",{className:"flex items-center justify-between border-t border-border/40 pt-2",children:[c.jsx("span",{className:"text-muted-foreground",children:t("props.junctionPos")}),c.jsxs("span",{className:"font-mono text-[11px]",children:[Math.round(o[0]),", ",Math.round(o[1])]})]})]})}function vI({nodeId:e}){const t=re(),n=x(l=>l.internal.nodes.get(e)),o=x(l=>l.diagram.elements),r=x(l=>l.setSelection);if(!n)return c.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.nodeNotFound",{id:e})});const a=new Map;for(const l of n.terminals){const s=l.indexOf(".");if(s<0)continue;const d=l.slice(0,s),u=l.slice(s+1),m=a.get(d)??[];m.push(u),a.set(d,m)}const i=new Map(o.map(l=>[l.id,l]));return c.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 text-xs",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.node")}),c.jsx("div",{className:"font-mono text-[12px]",children:n.id}),c.jsx("div",{className:"text-[11px] text-muted-foreground",children:t("props.nodeStats",{terminals:n.terminals.length,elements:a.size})})]}),c.jsx("ul",{className:"space-y-0.5 border-t border-border/40 pt-2",children:[...a.entries()].map(([l,s])=>{const d=i.get(l);return c.jsxs("li",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 hover:bg-accent",onClick:()=>r([l]),title:t("props.selectElement",{label:l}),children:[c.jsx("span",{className:"flex-1 truncate font-mono text-[11px]",children:l}),c.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:(d==null?void 0:d.name)??""}),c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:s.join(", ")})]},l)})})]})}function tt({label:e,children:t}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("label",{className:"w-16 shrink-0 truncate text-[11px] text-muted-foreground",children:e}),c.jsx("div",{className:"min-w-0 flex-1",children:t})]})}const kI=6;function kt({label:e,value:t,placeholder:n,unit:o,multiline:r,onCommit:a}){const[i,l]=$.useState(t),s=$.useRef(null);$.useEffect(()=>l(t),[t]);const d={value:i,placeholder:n,onChange:u=>l(u.target.value),onBlur:()=>{i!==t&&a(i)},className:Ee("w-full rounded-md border border-border/60 bg-background/50 px-2 text-[11px] focus:border-border focus:outline-none focus:ring-1 focus:ring-ring",o&&"pr-8",r?"resize-none py-1.5 leading-snug":"h-7")};return c.jsx(tt,{label:e,children:c.jsxs("div",{className:"relative",children:[r?c.jsx("textarea",{ref:s,rows:Math.min(kI,Math.max(1,i.split(`
234
+ `).length)),onKeyDown:u=>{var m,p;u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),(m=s.current)==null||m.blur()),u.key==="Escape"&&(l(t),(p=s.current)==null||p.blur()),u.stopPropagation()},...d}):c.jsx("input",{ref:s,type:"text",onKeyDown:u=>{var m,p;u.key==="Enter"&&((m=s.current)==null||m.blur()),u.key==="Escape"&&(l(t),(p=s.current)==null||p.blur())},...d}),o&&c.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:o})]})})}const SI=350;function Vr({label:e,value:t,onCommit:n}){const[o,r]=$.useState(t),a=$.useRef(!1),i=$.useRef(null),l=$.useRef({local:o,value:t,onCommit:n});l.current={local:o,value:t,onCommit:n};const s=$.useRef(null);$.useEffect(()=>{a.current||(r(t),s.current=null)},[t]);const d=()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null);const m=l.current;m.local===m.value||m.local===s.current||(s.current=m.local,m.onCommit(m.local))},u=$.useRef(d);return u.current=d,$.useEffect(()=>()=>u.current(),[]),c.jsx(tt,{label:e,children:c.jsx("textarea",{rows:2,value:o,onFocus:()=>{a.current=!0},onChange:m=>{r(m.target.value),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null,u.current()},SI)},onBlur:()=>{a.current=!1,d()},className:"w-full resize-none rounded-md border border-border/60 bg-background/50 px-2 py-1 text-[11px] focus:border-border focus:outline-none focus:ring-1 focus:ring-ring"})})}function No({label:e,value:t,min:n,unit:o,onCommit:r}){const[a,i]=$.useState(String(t)),l=$.useRef(null);return $.useEffect(()=>i(String(t)),[t]),c.jsx(tt,{label:e,children:c.jsxs("div",{className:"relative",children:[c.jsx("input",{ref:l,type:"number",value:a,onChange:s=>i(s.target.value),onBlur:()=>{const s=Number(a);Number.isFinite(s)&&s!==t?r(s):i(String(t))},onKeyDown:s=>{var d,u;s.key==="Enter"&&((d=l.current)==null||d.blur()),s.key==="Escape"&&(i(String(t)),(u=l.current)==null||u.blur())},min:n,className:Ee("h-7 w-full rounded-md border border-border/60 bg-background/50 px-2 font-mono text-[11px] tabular-nums focus:border-border focus:outline-none focus:ring-1 focus:ring-ring",o&&"pr-8")}),o&&c.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:o})]})})}function To({active:e,onClick:t,children:n}){return c.jsx("button",{type:"button",onClick:t,className:Ee("flex h-6 w-full items-center justify-center gap-1.5 rounded border text-[10px] transition-colors",e?"border-[var(--selection)] bg-[var(--selection)]/15 text-foreground":"border-border/60 text-muted-foreground hover:bg-accent"),"aria-pressed":e,children:n})}function _I({id:e,element:t,field:n}){var s;const o=re(),a=Bt()(`${t.kind}.state.${n.name}`,n.label??n.name),i=((s=t.state)==null?void 0:s[n.name])??n.default,l=d=>{const u={...t.state??{}};d===void 0||d===n.default?delete u[n.name]:u[n.name]=d,x.getState().updateElement(e,{state:Object.keys(u).length>0?u:void 0})};return n.type==="boolean"?c.jsx(tt,{label:a,children:c.jsx(To,{active:!!i,onClick:()=>l(!i),children:o(i?"common.yes":"common.no")})}):n.type==="number"?c.jsx(No,{label:a,value:typeof i=="number"?i:0,onCommit:l}):c.jsx(kt,{label:a,value:typeof i=="string"?i:"",onCommit:d=>l(d.trim()===""?void 0:d)})}function CI(){const e=re(),t=Bt(),n=x(h=>h.selection),o=x(h=>h.selectedNode),r=x(h=>h.selectedWire),a=x(h=>h.selectedAnnotations),i=x(Qt),l=x(h=>h.diagram.annotations),s=x(h=>h.diagram.elements),d=x(h=>h.diagram.buses),u=Pt(),m=it(u,"dense");if(n.length===0&&a.length===0&&!o&&!r)return null;let p=e("props.title"),g=null;if(r)p=e("props.wire");else if(o)p=e("props.node");else if(i){const h=(l??[]).find(y=>y.id===i),f=h?ut(h):"text";p=e({rect:"props.annRect",ellipse:"props.annEllipse",line:"props.annLine",table:"props.annTable",text:"props.annText"}[f])}else if(n.length===1&&a.length===0){const h=n[0],f=(d??[]).find(b=>b.id===h);if(f)p=f.name??e("props.bus");else{const b=s.find(y=>y.id===h);if(b){const y=wt[b.kind];p=y?t(`${y.id}.name`,y.name):b.kind}}}else g=n.length+a.length;return c.jsxs("aside",{className:Ee("ole-glass absolute z-10 flex flex-col overflow-hidden rounded-2xl border border-border shadow-sm",m?"w-48":"w-56"),style:{top:`calc(${m?"4.5rem":"0.75rem"} + var(--ole-top-inset, 0px) + var(--ole-safe-top, 0px))`,right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",maxHeight:`calc(100% - ${m?"5.25rem":"1.5rem"} - var(--ole-top-inset, 0px) - var(--ole-safe-top, 0px) - var(--ole-bottom-inset, 0px) - var(--ole-safe-bottom, 0px) - 4.5rem)`},children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2",children:[c.jsx("span",{className:"flex-1 truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:p}),g!=null&&c.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e("props.nSelected",{n:g})})]}),c.jsx(rI,{})]})}function jI(){$.useEffect(()=>{const e=n=>{const o=n.target;if(!o||o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable)return;const r=o.closest("button");r&&r.closest(".ole-glass")&&n.preventDefault()},t=n=>{const o=n.target;if(!o||!o.closest(".ole-canvas-root"))return;const r=document.activeElement;!r||r===document.body||r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable||r.blur()};return window.addEventListener("mousedown",e),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("pointerdown",t,!0)}},[])}function $I(){jI();const e=x(o=>o.readOnly),t=$.useRef(null),n=v4(t);return c.jsx(Fj,{children:c.jsx("div",{ref:t,className:"relative h-full w-full overflow-hidden bg-background text-foreground",children:c.jsxs(nP,{width:n,children:[c.jsx(W4,{}),e?c.jsxs(c.Fragment,{children:[c.jsx(ki,{}),c.jsx(pi,{})]}):c.jsxs(c.Fragment,{children:[c.jsx(FP,{}),c.jsx(CI,{}),c.jsx(DP,{}),c.jsx(ki,{}),c.jsx(bP,{}),c.jsx(xP,{}),c.jsx(ZP,{}),c.jsx(oI,{}),c.jsx(pi,{})]})]})})})}const AI="ole-theme";function EI(){try{const e=window.localStorage.getItem(AI);return e==="light"||e==="dark"?e:null}catch{return null}}function NI(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches}function TI(){return typeof window>"u"?"light":EI()??(NI()?"dark":"light")}function wC(e){typeof document>"u"||document.documentElement.classList.toggle("dark",e==="dark")}function PI({className:e,diagram:t,readOnly:n,locale:o,theme:r,onCreateComponent:a,onHealthEvent:i}){return $.useEffect(()=>{Yt.getState().setHostActions({onCreateComponent:n?null:a??null,onHealthEvent:n?null:i??null})},[a,i,n]),$.useEffect(()=>{x.getState().setReadOnly(!!n)},[n]),$.useEffect(()=>{if(!t)return;if(n){x.getState().setDiagram(t),x.getState().setActiveTool("pan");return}x.getState().diagram.elements.length===0&&x.getState().setDiagram(t)},[t,n]),$.useEffect(()=>{o&&Tn.getState().setLocale(o)},[o]),$.useEffect(()=>{r&&wC(r)},[r]),$.useEffect(()=>{Wr()},[]),o4(),c.jsx("div",{className:`ole-root ${e??"h-full w-full"}`,children:c.jsx($I,{})})}const vC=6,II=3,Qo=vC+3,zI=3,Ti=4,Pi=2;function MI(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:[t[0],t[1],t[2],t[3]]}function DI(e,t){const n=MI(e);if(!n)return null;const[o,r,a,i]=n,l=[[o,r],[o+a,r],[o,r+i],[o+a,r+i]],s={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const d of l){const[u,m]=Ze(d,t);u<s.minX&&(s.minX=u),m<s.minY&&(s.minY=m),u>s.maxX&&(s.maxX=u),m>s.maxY&&(s.maxY=m)}return s}function OI(e){return e==null?"":typeof e=="number"?Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,""):typeof e=="boolean"?e?"ON":"OFF":String(e)}function RI({id:e,box:t,rt:n,unit:o}){const r=n.quality==="bad"||n.quality==="stale",a=n.value!==void 0&&n.value!==null?`${OI(n.value)}${o?` ${o}`:""}`:"",i=n.badge??"";if(!r&&!a&&!i)return null;const l=i.length*vC*.6+II*2;return c.jsxs("g",{className:"ole-rt","data-rt-for":e,"data-alarm":Or(n),children:[a&&c.jsx("text",{className:"ole-rt-value",x:t.maxX+zI,y:t.maxY,textAnchor:"start",children:a}),i&&c.jsxs("g",{className:"ole-rt-badge",transform:`translate(${t.maxX+l/2-Pi} ${t.minY})`,children:[c.jsx("rect",{x:-l/2,y:-Qo/2,width:l,height:Qo,rx:Qo/2,className:"ole-rt-badge-bg"}),c.jsx("text",{x:0,y:0,textAnchor:"middle",className:"ole-rt-badge-text",children:i})]}),r&&c.jsxs("g",{className:"ole-rt-quality","data-quality":n.quality,transform:`translate(${t.minX-Ti+Pi} ${t.minY})`,children:[c.jsx("circle",{r:Ti,className:"ole-rt-quality-bg"}),c.jsx("text",{x:0,y:0,textAnchor:"middle",className:"ole-rt-quality-text",children:"?"})]})]})}function LI(){const{props:e,units:t}=en(),n=ye(i=>i.internal.elements),o=ye(i=>i.internal.layout),r=ye(i=>i.internal.buses),a=Object.keys(e);return a.length===0?null:c.jsx("g",{className:"ole-rt-layer",pointerEvents:"none",children:a.map(i=>{const l=e[i];if(l.visible===!1)return null;let s=null;const d=n.get(i),u=o.get(i);if(d!=null&&d.libraryDef&&u)s=DI(d.libraryDef.viewBox,u);else{const m=r.get(i);if(m){const{axis:p,at:g,span:h}=m.geometry,f=h/2;s=p==="x"?{minX:g[0]-f,maxX:g[0]+f,minY:g[1]-4,maxY:g[1]+4}:{minX:g[0]-4,maxX:g[0]+4,minY:g[1]-f,maxY:g[1]+f}}}return s?c.jsx(RI,{id:i,box:s,rt:l,unit:t[i]},i):null})})}const BI=100,HI=8,FI=4,WI=1.5;function qI(e){const t={},n=e.bindings,o=e.tags;if(!n||!o)return t;const r=new Map;for(const a of o)a.unit&&r.set(a.path,a.unit);for(const a of n){if(a.prop!=="value")continue;const i=r.get(a.tag);i&&(t[a.target]=i)}return t}function VI(e,t){const[n,o]=$.useState(mr);return $.useEffect(()=>{const r=e.bindings??[];if(!t||r.length===0){o(mr);return}const a=qI(e),i=()=>o({props:e_(e,t),units:a});i();let l=null;const s=Array.from(new Set(r.map(u=>u.tag))),d=t.subscribe(s,()=>{l===null&&(l=window.setTimeout(()=>{l=null,i()},BI))});return()=>{d(),l!==null&&window.clearTimeout(l)}},[e,t]),n}function GI({diagram:e,tags:t,selectedIds:n,hoveredId:o,onElementClick:r,onElementHover:a,onBackgroundClick:i,theme:l,className:s,style:d,fit:u=!0,onReady:m}){const[p]=$.useState(()=>{const f=o_();return f.getState().setReadOnly(!0),f.getState().setActiveTool("pan"),f.getState().setDiagram(e),f});$.useLayoutEffect(()=>{p.getState().diagram!==e&&p.getState().setDiagram(e)},[e,p]),$.useLayoutEffect(()=>{n!==void 0&&p.getState().setSelection(n)},[n,e,p]);const g=VI(e,t),h=["ole-root","ole-viewer",l==="dark"?"dark":"",s??"h-full w-full"].filter(Boolean).join(" ");return c.jsx("div",{className:h,style:d,children:c.jsx(a_.Provider,{value:p,children:c.jsx(h_.Provider,{value:g,children:c.jsx("div",{className:"relative h-full w-full overflow-hidden",children:c.jsx(KI,{store:p,diagram:e,hoveredId:o,selectionControlled:n!==void 0,onElementClick:r,onElementHover:a,onBackgroundClick:i,fit:u,onReady:m})})})})})}function KI({store:e,diagram:t,hoveredId:n,selectionControlled:o,onElementClick:r,onElementHover:a,onBackgroundClick:i,fit:l,onReady:s}){const d=$.useRef(null),u=$.useRef(null),m=Q_(d,u,void 0,{shared:!1});XI(d,n,a);const p=YI(d,m),g=$.useRef(o);g.current=o;const h=$.useMemo(()=>({fit(){const y=d.current;y&&to(m,y)},focus(y){const w=d.current;if(!w)return;const j=UI(e.getState(),y);if(!j)return;const _=w.getBoundingClientRect(),E=Math.max(m.getViewport().scale,WI);m.setViewport({scale:E,tx:_.width/2-E*j[0],ty:_.height/2-E*j[1]})},select(y){g.current||e.getState().setSelection(y)}}),[m,e]);$.useEffect(()=>{if(!l)return;let y=HI,w=0;const j=()=>{const _=d.current;_&&to(m,_)||--y>0&&(w=requestAnimationFrame(j))};return w=requestAnimationFrame(j),()=>cancelAnimationFrame(w)},[l,t,m]),$.useEffect(()=>{const y=d.current;if(!l||!y||typeof ResizeObserver>"u")return;const w=new ResizeObserver(()=>{to(m,y)});return w.observe(y),()=>w.disconnect()},[l,m]);const f=$.useRef(s);f.current=s,$.useEffect(()=>{var y;(y=f.current)==null||y.call(f,h)},[h]);const b=$.useCallback(y=>{if(p.current){p.current=!1;return}const w=Nt(y.target)??$n(y.target);w?r==null||r(w,y):i==null||i()},[r,i,p]);return c.jsx("div",{ref:d,className:"ole-canvas-root absolute inset-0 overflow-hidden","data-tool":"pan",onClick:b,children:c.jsx("svg",{className:"ole-canvas-svg block h-full w-full",xmlns:"http://www.w3.org/2000/svg",children:c.jsxs("g",{ref:u,className:"ole-viewport",children:[c.jsx(T_,{}),c.jsx(V_,{}),c.jsx(P_,{}),c.jsx(z_,{}),c.jsx(g_,{}),c.jsx(C_,{}),c.jsx(D_,{}),c.jsx(LI,{})]})})})}function UI(e,t){const n=e.internal.layout.get(t);if(n)return n.at;const o=e.internal.buses.get(t);if(o)return o.geometry.at;const r=e.internal.junctions.get(t);return r?r.world:null}const Ii="ole-hover-element-host";function zi(e){return e.replace(/(["\\])/g,"\\$1")}function XI(e,t,n){const o=$.useRef(null),r=$.useRef(null),a=$.useRef(t);a.current=t;const i=$.useRef(n);i.current=n;const l=$.useCallback(s=>{var u,m;const d=e.current;!d||s===o.current||(o.current&&((u=d.querySelector(`[data-element-id="${zi(o.current)}"]`))==null||u.classList.remove(Ii)),s&&((m=d.querySelector(`[data-element-id="${zi(s)}"]`))==null||m.classList.add(Ii)),o.current=s)},[e]);$.useEffect(()=>{l(t===void 0?r.current:t)},[t,l]),$.useEffect(()=>{const s=e.current;if(!s)return;const d=p=>{var g;p!==r.current&&(r.current=p,(g=i.current)==null||g.call(i,p),a.current===void 0&&l(p))},u=p=>d(Nt(p.target)??$n(p.target)),m=()=>d(null);return s.addEventListener("pointermove",u),s.addEventListener("pointerleave",m),()=>{s.removeEventListener("pointermove",u),s.removeEventListener("pointerleave",m),l(null)}},[e,l])}function YI(e,t){const n=$.useRef(!1);return $.useEffect(()=>{const o=e.current;if(!o)return;let r=null;const a=s=>{if(s.button!==0)return;const d=t.getViewport();r={pointerId:s.pointerId,startX:s.clientX,startY:s.clientY,startTx:d.tx,startTy:d.ty,moved:!1},n.current=!1},i=s=>{if(!r||s.pointerId!==r.pointerId)return;const d=s.clientX-r.startX,u=s.clientY-r.startY;if(!r.moved){if(Math.hypot(d,u)<=FI)return;r.moved=!0,n.current=!0,o.classList.add("ole-viewer-panning");try{o.setPointerCapture(s.pointerId)}catch{}}t.setViewport({tx:r.startTx+d,ty:r.startTy+u})},l=s=>{var d;if(!(!r||s.pointerId!==r.pointerId)){if((d=o.hasPointerCapture)!=null&&d.call(o,s.pointerId))try{o.releasePointerCapture(s.pointerId)}catch{}o.classList.remove("ole-viewer-panning"),r=null}};return o.addEventListener("pointerdown",a),o.addEventListener("pointermove",i),o.addEventListener("pointerup",l),o.addEventListener("pointercancel",l),()=>{o.removeEventListener("pointerdown",a),o.removeEventListener("pointermove",i),o.removeEventListener("pointerup",l),o.removeEventListener("pointercancel",l),o.classList.remove("ole-viewer-panning")}},[e,t]),n}function ro(e){return e!==null&&typeof e=="object"&&"v"in e?e:{v:e}}function ZI(e={}){const t=new Map;for(const[r,a]of Object.entries(e))t.set(r,ro(a));const n=new Set,o=r=>{for(const a of n){let i=null;for(const l in r)a.paths.has(l)&&((i??(i={}))[l]=r[l]);i&&a.onChange(i)}};return{get:r=>t.get(r),subscribe(r,a){const i={paths:new Set(r),onChange:a};return n.add(i),()=>{n.delete(i)}},set(r,a){const i=ro(a);t.set(r,i),o({[r]:i})},setMany(r){const a={};for(const[i,l]of Object.entries(r)){const s=ro(l);t.set(i,s),a[i]=s}o(a)}}}const kC=new Set(["g","line","rect","circle","ellipse","polyline","polygon","path","text","tspan"]),SC=new Set(["fill","stroke","stroke-width","stroke-dasharray","stroke-linecap","stroke-linejoin","fill-opacity","stroke-opacity","opacity","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","points","d","transform","font-family","font-size","font-weight","text-anchor","dominant-baseline"]);function QI(e){const t=new Set,n=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,"image/svg+xml"),o=n.documentElement;if(!o||n.querySelector("parsererror"))return{svg:"",removed:["parse-error"]};const r=a=>{for(const i of[...a.children]){const l=i.tagName.toLowerCase();if(!kC.has(l)){t.add(`element:${l}`),i.remove();continue}for(const s of[...i.attributes]){const d=(s.localName??s.name).toLowerCase();SC.has(d)||(t.add(`attr:${s.name.toLowerCase()}`),i.removeAttribute(s.name))}r(i)}};return r(o),{svg:o.innerHTML.trim(),removed:[...t].sort()}}const Qn=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function JI(e){var l,s,d,u,m;const t=[],n=(p,g)=>t.push({field:p,message:g});(l=e.id)!=null&&l.startsWith("custom:")||n("id","a document-defined kind must have a `custom:` id so it can never shadow a built-in"),(s=e.name)!=null&&s.trim()||n("name","name is required — it is what the user sees in the palette"),(d=e.category)!=null&&d.trim()||n("category","category is required for palette grouping");const o=(e.viewBox??"").trim().split(/[\s,]+/).map(Number),r=o.length===4&&o.every(p=>Number.isFinite(p))&&o[2]>0&&o[3]>0;r||n("viewBox",'viewBox must be four finite numbers "minX minY width height" with positive extent'),(u=e.svg)!=null&&u.trim()||n("svg","svg is empty — a symbol with no geometry is invisible on the canvas");const a=e.terminals??[];a.length||n("terminals","declare at least one terminal, or nothing can ever be wired to this symbol");const i=new Set;for(const p of a){if(!((m=p==null?void 0:p.id)!=null&&m.trim())){n("terminals","every terminal needs an id");continue}if(i.has(p.id)&&n("terminals",`duplicate terminal id '${p.id}'`),i.add(p.id),Qn(p.x)===null||Qn(p.y)===null){n("terminals",`terminal '${p.id}' needs finite x and y`);continue}if(r){const[g,h,f,b]=o;p.x>=g&&p.x<=g+f&&p.y>=h&&p.y<=h+b||n("terminals",`terminal '${p.id}' at (${p.x}, ${p.y}) is outside the viewBox — a pin floating off the symbol body leaves a visible gap at every connection`)}}if(a.length===2){const[p,g]=a;Qn(p.x)!==null&&Qn(g.x)!==null&&p.x!==g.x&&p.y!==g.y&&n("terminals",`the two terminals share neither an x (${p.x} vs ${g.x}) nor a y (${p.y} vs ${g.y}). A series device whose pins are offset on both axes renders every wire into it with a right-angle jog, in every drawing, permanently — put both pins on the run axis.`)}return t}const _C={"application/json":[".json"]},CC=()=>typeof window<"u"&&typeof window.showOpenFilePicker=="function",jC=e=>e instanceof DOMException&&e.name==="AbortError";function Mi(e){let t;try{t=JSON.parse(e)}catch(o){throw new Error(He("io.parseFailed",{err:o.message}))}if(!t||typeof t!="object"||Array.isArray(t))throw new Error(He("io.notObject"));const n=t;if(n.version!=="1")throw new Error(He("io.versionMismatch",{actual:JSON.stringify(n.version)}));if(!Array.isArray(n.elements))throw new Error(He("io.elementsMissing"));return n}function ez(e){return JSON.stringify(e,null,2)+`
235
+ `}async function tz(){if(CC()){let e;try{[e]=await window.showOpenFilePicker({multiple:!1,types:[{description:He("topbar.file.fileDescription"),accept:_C}]})}catch(n){if(jC(n))return null;throw n}const t=await e.getFile();return{diagram:Mi(await t.text()),session:{handle:e,name:t.name}}}return new Promise((e,t)=>{const n=document.createElement("input");n.type="file",n.accept=".json,application/json",n.addEventListener("change",async()=>{var r;const o=(r=n.files)==null?void 0:r[0];if(!o)return e(null);try{e({diagram:Mi(await o.text()),session:{name:o.name}})}catch(a){t(a)}}),n.addEventListener("cancel",()=>e(null)),n.click()})}async function Di(e,t,n={}){const o=ez(e);if(!n.saveAs&&(t!=null&&t.handle)){const i=await t.handle.createWritable();return await i.write(o),await i.close(),t}if(CC()){let i;try{i=await window.showSaveFilePicker({suggestedName:(t==null?void 0:t.name)??"diagram.json",types:[{description:He("topbar.file.fileDescription"),accept:_C}]})}catch(s){if(jC(s))return null;throw s}const l=await i.createWritable();return await l.write(o),await l.close(),{handle:i,name:i.name}}const r=URL.createObjectURL(new Blob([o],{type:"application/json"})),a=document.createElement("a");return a.href=r,a.download=(t==null?void 0:t.name)??"diagram.json",a.click(),URL.revokeObjectURL(r),t??{name:"diagram.json"}}function nz(){const e=re(),t=x(m=>m.fileSession),n=(t==null?void 0:t.name)??e("common.unnamed"),{onNew:o,onOpen:r,onSave:a,onSaveAs:i}=oz(),[l,s]=$.useState(!1),d=$.useRef(null);$.useEffect(()=>{const m=p=>{if(!(p.metaKey||p.ctrlKey))return;const g=p.key.toLowerCase();g==="o"?(p.preventDefault(),r()):g==="s"&&(p.preventDefault(),p.shiftKey?i():a())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[r,a,i]),$.useEffect(()=>{if(!l)return;const m=g=>{d.current&&!d.current.contains(g.target)&&s(!1)},p=g=>{g.key==="Escape"&&s(!1)};return window.addEventListener("mousedown",m),window.addEventListener("keydown",p),()=>{window.removeEventListener("mousedown",m),window.removeEventListener("keydown",p)}},[l]);const u=m=>()=>{s(!1),m()};return c.jsxs("div",{ref:d,className:"relative",children:[c.jsxs(Ve,{variant:"ghost",size:"sm",className:"gap-1.5","aria-haspopup":"menu","aria-expanded":l,onClick:()=>s(m=>!m),children:[c.jsx(la,{}),e("topbar.file.label")]}),l&&c.jsxs("div",{role:"menu",className:"ole-glass absolute left-0 top-full mt-1.5 min-w-44 rounded-md border border-border p-1 shadow-md",children:[c.jsx("div",{className:"border-b border-border px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:n}),c.jsx(Jn,{onClick:u(o),icon:c.jsx(XC,{}),children:e("topbar.file.new")}),c.jsx(Jn,{onClick:u(r),icon:c.jsx(la,{}),hint:"⌘O",children:e("topbar.file.open")}),c.jsx(Jn,{onClick:u(a),icon:c.jsx(ca,{}),hint:"⌘S",children:e("topbar.file.save")}),c.jsx(Jn,{onClick:u(i),icon:c.jsx(ca,{}),hint:"⌘⇧S",children:e("topbar.file.saveAs")})]})]})}function Jn({children:e,icon:t,hint:n,onClick:o}){return c.jsxs("button",{type:"button",role:"menuitem",onClick:o,className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[t,c.jsx("span",{className:"flex-1",children:e}),n&&c.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:n})]})}function oz(){const e=re(),t=x(s=>s.loadDiagramFromFile),n=x(s=>s.setFileSession),o=x(s=>s.setDiagram);return{onNew:()=>{const{diagram:s}=x.getState();s.elements.length>0&&!confirm(e("topbar.file.newConfirm"))||(o({version:"1",elements:[]}),n(null))},onOpen:async()=>{try{const s=await tz();s&&(t(s.diagram,s.session),Wr())}catch(s){alert(e("topbar.file.openFailed",{err:s.message}))}},onSave:async()=>{try{const{diagram:s,fileSession:d}=x.getState(),u=await Di(s,d);u&&n(u)}catch(s){alert(e("topbar.file.saveFailed",{err:s.message}))}},onSaveAs:async()=>{try{const{diagram:s,fileSession:d}=x.getState(),u=await Di(s,d,{saveAs:!0});u&&n(u)}catch(s){alert(e("topbar.file.saveFailed",{err:s.message}))}}}}const Jo="WIRES",St="ELEMENTS",er="LABELS",ot="ANNOTATIONS",Oi=32,Ri=64,rz=8,az=1.25,iz=6;function $C(e,t={}){var i,l;const n=new xz(t.precision??6);n.header(t.title),n.tables([{name:Jo,color:7},{name:St,color:7},{name:er,color:8},{name:ot,color:3}]),n.beginEntities();for(const s of e.wireRenders.values())s.path.length<2||(n.setColor(Gt(s.color)),n.polyline(Jo,s.path.map(Te),!1));n.setColor(void 0);for(const{bus:s,geometry:d}of e.buses.values()){const{axis:u,at:m,span:p}=d,g=p/2,h=u==="x"?[m[0]-g,m[1]]:[m[0],m[1]-g],f=u==="x"?[m[0]+g,m[1]]:[m[0],m[1]+g];n.setColor(Gt(s.color)),n.polyline(Jo,[h,f].map(Te),!1)}n.setColor(void 0);for(const s of e.elements.values()){const d=e.layout.get(s.element.id),u=s.libraryDef;!d||!u||(n.setColor(Gt(s.element.color)),sz(n,u.svg,d))}n.setColor(void 0);const o=t.labelMode??"all",r=Jt(t.labelFontSize),a=Pn(r);if(o!=="off"){for(const s of e.elements.values()){const d=e.layout.get(s.element.id);if(!d||!s.libraryDef)continue;const u=ko(s,o);if(u.length===0)continue;const m=s.libraryDef.label??So(s.libraryDef,r),{world:[p,g],textAnchor:h,dy:f}=_o(m,s.libraryDef,d,u.length,r,s.element.labelOffset);for(let b=0;b<u.length;b++){const[y,w]=Te([p,g+f+b*a]);n.text(er,[y,w],u[b],r,0,!1,h)}}for(const s of e.wireRenders.values()){const d=(i=s.label)==null?void 0:i.trim();if(!d)continue;const u=Co(s.path,r);if(!u)continue;const m=Te(u.world);n.setColor(Gt(s.color)),n.text(er,m,d,r,0,!1,u.textAnchor)}n.setColor(void 0)}for(const s of t.annotations??[])switch(n.setColor(Gt(s.color)),ut(s)){case"ellipse":{const d=s;if(n.polyline(ot,G6(d).map(Te),!0),d.label){const u=Te([d.at[0]+$t,d.at[1]+$t+ct]);n.text(ot,u,d.label,ct,0,!1)}break}case"rect":{const d=s,[u,m]=d.at,[p,g]=d.size;if(n.polyline(ot,[[u,m],[u+p,m],[u+p,m+g],[u,m+g]].map(Te),!0),d.label){const h=Te([u+$t,m+$t+ct]);n.text(ot,h,d.label,ct,0,!1)}break}case"line":{const d=s,u=In(d);if(u.length<2)break;n.polyline(ot,u.map(Te),!1);for(const m of Rr(u,d.arrow))n.polyline(ot,m.map(Te),!0);break}case"table":{const d=s,[u,m]=d.at,[p,g]=vt(d),h=nn(d),f=on(d),b=d.fontSize??ct;n.polyline(ot,[[u,m],[u+p,m],[u+p,m+g],[u,m+g]].map(Te),!0);for(let y=1;y<d.colWidths.length;y++)n.line(ot,Te([u+h[y],m]),Te([u+h[y],m+g]));for(let y=1;y<d.rowHeights.length;y++)n.line(ot,Te([u,m+f[y]]),Te([u+p,m+f[y]]));for(let y=0;y<d.rowHeights.length;y++)for(let w=0;w<d.colWidths.length;w++){const j=((l=d.cells[y])==null?void 0:l[w])??"";if(j==="")continue;const _=Te([u+h[w]+_n,m+f[y]+d.rowHeights[y]/2+b*.35]);n.text(ot,_,j,b,0,!1)}break}default:{const d=s;if(!d.text)break;const u=d.fontSize??rz,m=d.text.split(`
236
+ `);for(let p=0;p<m.length;p++){const[g,h]=Te([d.at[0],d.at[1]+(p+1)*u*az]);n.text(ot,[g,h],m[p],u,0,!1)}break}}return n.endEntities(),n.toString()}async function AC(e,t="diagram.dxf",n){const o=$C(e,n),r=URL.createObjectURL(new Blob([o],{type:"application/dxf;charset=utf-8"})),a=document.createElement("a");a.href=r,a.download=t,a.click(),URL.revokeObjectURL(r)}function sz(e,t,n){const o=`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,a=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;if(!(!a||a.querySelector("parsererror")))for(const i of Array.from(a.children))switch(i.tagName.toLowerCase()){case"line":lz(e,i,n);break;case"polyline":Li(e,i,n,!1);break;case"polygon":Li(e,i,n,!0);break;case"rect":cz(e,i,n);break;case"circle":dz(e,i,n);break;case"ellipse":uz(e,i,n);break;case"path":fz(e,i,n);break;case"text":hz(e,i,n);break}}function lz(e,t,n){const o=We(t,"x1"),r=We(t,"y1"),a=We(t,"x2"),i=We(t,"y2"),l=Te(xt([o,r],n)),s=Te(xt([a,i],n));e.line(St,l,s)}function Li(e,t,n,o){const r=yz(t.getAttribute("points")??"");if(r.length<2)return;const a=r.map(i=>Te(xt(i,n)));e.polyline(St,a,o)}function cz(e,t,n){const o=We(t,"x"),r=We(t,"y"),a=We(t,"width"),i=We(t,"height"),s=[[o,r],[o+a,r],[o+a,r+i],[o,r+i]].map(d=>Te(xt(d,n)));e.polyline(St,s,!0)}function dz(e,t,n){const o=We(t,"cx"),r=We(t,"cy"),a=We(t,"r"),i=Te(xt([o,r],n));e.circle(St,i,a*(n.scale??1))}function uz(e,t,n){const o=We(t,"cx"),r=We(t,"cy"),a=We(t,"rx"),i=We(t,"ry");if(Math.abs(a-i)<1e-6){mz(e,o,r,a,n);return}pz(e,o,r,a,i,n)}function mz(e,t,n,o,r){const a=Te(xt([t,n],r));e.circle(St,a,o*(r.scale??1))}function pz(e,t,n,o,r,a){const i=[];for(let l=0;l<Ri;l++){const s=l/Ri*Math.PI*2;i.push(Te(xt([t+o*Math.cos(s),n+r*Math.sin(s)],a)))}e.polyline(St,i,!0)}function hz(e,t,n){const o=We(t,"x"),r=We(t,"y"),a=parseFloat(t.getAttribute("font-size")??"")||iz,i=(t.textContent??"").trim();if(!i)return;const l=Te(xt([o,r],n));e.text(St,l,i,a*(n.scale??1),n.rot,n.mirror)}function fz(e,t,n){const o=t.getAttribute("d")??"",r=gz(o);if(r.length===0)return;let a=null,i=[];const l=()=>{i.length>=2&&e.polyline(St,i.map(s=>Te(xt(s,n))),!1),i=[]};for(const s of r)if(s.cmd==="M")l(),a=[s.args[0],s.args[1]],i.push(a);else if(s.cmd==="A"&&a){const[d,u,,m,p,g,h]=s.args,f=bz(a,[g,h],d,u,m!==0,p!==0);if(f)for(let b=1;b<=Oi;b++){const y=f.theta1+f.delta*b/Oi;i.push([f.cx+d*Math.cos(y),f.cy+u*Math.sin(y)])}else i.push([g,h]);a=[g,h]}l()}function gz(e){const t=[],n=/([MmAa])([^MmAa]*)/g;let o;for(;(o=n.exec(e))!==null;){const r=o[1].toUpperCase(),a=o[2].trim().split(/[\s,]+/).filter(i=>i.length>0).map(Number);t.push({cmd:r,args:a})}return t}function bz(e,t,n,o,r,a){if(n<=0||o<=0)return null;const[i,l]=e,[s,d]=t;if(i===s&&l===d)return null;const u=(i-s)/2,m=(l-d)/2;let p=Math.abs(n),g=Math.abs(o);const h=p*p,f=g*g,b=u*u/h+m*m/f;if(b>1){const D=Math.sqrt(b);p*=D,g*=D}const y=r===a?-1:1,w=p*p*g*g-p*p*m*m-g*g*u*u,j=p*p*m*m+g*g*u*u,_=y*Math.sqrt(Math.max(0,w/j)),E=_*(p*m)/g,W=_*-(g*u)/p,Q=E+(i+s)/2,ke=W+(l+d)/2,we=(D,M,G,me)=>{const pe=D*G+M*me,te=Math.hypot(D,M)*Math.hypot(G,me);let Se=Math.acos(Math.max(-1,Math.min(1,pe/te)));return D*me-M*G<0&&(Se=-Se),Se},Y=we(1,0,(u-E)/p,(m-W)/g);let k=we((u-E)/p,(m-W)/g,(-u-E)/p,(-m-W)/g);return!a&&k>0?k-=2*Math.PI:a&&k<0&&(k+=2*Math.PI),{cx:Q,cy:ke,theta1:Y,delta:k}}function xt(e,t){return Ze(e,t)}function Te(e){return[e[0],-e[1]]}function We(e,t){const n=parseFloat(e.getAttribute(t)??"");return Number.isFinite(n)?n:0}function yz(e){const t=e.trim().split(/[\s,]+/).map(Number).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o+1<t.length;o+=2)n.push([t[o],t[o+1]]);return n}class xz{constructor(t){lt(this,"out",[]);lt(this,"precision");lt(this,"minX",1/0);lt(this,"minY",1/0);lt(this,"maxX",-1/0);lt(this,"maxY",-1/0);lt(this,"extentsSlot",-1);lt(this,"currentColor");this.precision=t}track(t,n){!Number.isFinite(t)||!Number.isFinite(n)||(t<this.minX&&(this.minX=t),t>this.maxX&&(this.maxX=t),n<this.minY&&(this.minY=n),n>this.maxY&&(this.maxY=n))}toString(){return this.extentsSlot>=0&&Number.isFinite(this.minX)&&(this.out[this.extentsSlot]=`9
232
237
  $EXTMIN
233
238
  10
234
239
  ${this.fmt(this.minX)}
@@ -246,7 +251,7 @@ ${this.fmt(this.maxY)}
246
251
  0
247
252
  `),this.out.join("")}g(t,n){this.out.push(`${t}
248
253
  ${this.fmt(n)}
249
- `)}fmt(t){return typeof t=="number"?Number.isFinite(t)?Number.isInteger(t)?String(t):t.toFixed(this.precision):"0":t}header(t){this.g(0,"SECTION"),this.g(2,"HEADER"),this.g(9,"$ACADVER"),this.g(1,"AC1009"),this.g(9,"$INSUNITS"),this.g(70,0),this.extentsSlot=this.out.length,this.out.push(""),t&&(this.g(9,"$PROJECTNAME"),this.g(1,Ss(t))),this.g(0,"ENDSEC")}tables(t){this.g(0,"SECTION"),this.g(2,"TABLES"),this.g(0,"TABLE"),this.g(2,"LAYER"),this.g(70,t.length);for(const n of t)this.g(0,"LAYER"),this.g(2,n.name),this.g(70,0),this.g(62,n.color),this.g(6,"CONTINUOUS");this.g(0,"ENDTAB"),this.g(0,"ENDSEC")}beginEntities(){this.g(0,"SECTION"),this.g(2,"ENTITIES")}endEntities(){this.g(0,"ENDSEC"),this.g(0,"EOF")}setColor(t){this.currentColor=t}color(){this.currentColor!==void 0&&this.g(62,this.currentColor)}line(t,n,o){this.g(0,"LINE"),this.g(8,t),this.color(),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(11,o[0]),this.g(21,o[1]),this.g(31,0),this.track(n[0],n[1]),this.track(o[0],o[1])}polyline(t,n,o){if(!(n.length<2)){this.g(0,"POLYLINE"),this.g(8,t),this.color(),this.g(66,1),this.g(70,o?1:0),this.g(10,0),this.g(20,0),this.g(30,0);for(const[r,i]of n)this.g(0,"VERTEX"),this.g(8,t),this.g(10,r),this.g(20,i),this.g(30,0),this.track(r,i);this.g(0,"SEQEND"),this.g(8,t)}}circle(t,n,o){this.g(0,"CIRCLE"),this.g(8,t),this.color(),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(40,o),this.track(n[0]-o,n[1]-o),this.track(n[0]+o,n[1]+o)}text(t,n,o,r,i,s,l="start"){this.g(0,"TEXT"),this.g(8,t),this.color(),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(40,r),this.g(1,Ss(o)),this.track(n[0],n[1]),this.track(n[0],n[1]+r),i!==0&&this.g(50,i),s&&this.g(71,2),l!=="start"&&(this.g(72,l==="middle"?1:2),this.g(11,n[0]),this.g(21,n[1]),this.g(31,0))}}function Ss(e){return e.replace(/[\r\n]+/g," ").slice(0,250)}const Y4="http://www.w3.org/2000/svg",Dn=24,Z4=1.25;function _r(e,t={}){var h;const n=rI(e,t),o=Math.floor(n.minX-Dn),r=Math.floor(n.minY-Dn),i=Math.ceil(n.maxX+Dn)-o,s=Math.ceil(n.maxY+Dn)-r,l=t.background??"#FFFFFF",a=[];a.push('<?xml version="1.0" encoding="UTF-8"?>'),a.push(`<svg xmlns="${Y4}" viewBox="${o} ${r} ${i} ${s}" width="${i}" height="${s}">`),t.title&&a.push(` <title>${et(t.title)}</title>`),l!=="transparent"&&a.push(` <rect x="${o}" y="${r}" width="${i}" height="${s}" fill="${l}"/>`),a.push(' <g fill="none" stroke="black" stroke-width="1">');for(const g of e.wireRenders.values()){if(g.path.length<2)continue;const f=g.path.map(([y,v])=>`${y},${v}`).join(" "),b=g.color?` stroke="${Ve(g.color)}"`:"";a.push(` <polyline points="${f}"${b}/>`)}a.push(" </g>");for(const{bus:g,geometry:f}of e.buses.values()){const{axis:b,at:y,span:v}=f,j=v/2,S=b==="x"?y[0]-j:y[0],N=b==="x"?y[1]:y[1]-j,W=b==="x"?y[0]+j:y[0],ne=b==="x"?y[1]:y[1]+j;a.push(` <line id="${et(g.id)}" x1="${S}" y1="${N}" x2="${W}" y2="${ne}" stroke="${Ve(g.color)}" stroke-width="3" stroke-linecap="round" fill="none"/>`)}for(const{junction:g,world:f,degree:b}of e.junctions.values())b<3||a.push(` <circle id="${et(g.id)}" cx="${f[0]}" cy="${f[1]}" r="3.5" fill="black"/>`);for(const g of e.elements.values()){if(!g.libraryDef)continue;const f=e.layout.get(g.element.id);f&&(a.push(` <g id="${et(g.element.id)}" transform="${ut(f)}">`),a.push(` ${Q4(V2(g.libraryDef.svg,f.scale),g.element.color)}`),a.push(" </g>"))}const d=t.labelMode??"all",u=zt(t.labelFontSize),m=hn(u);if(d!=="off"){const g=l==="transparent"?"#FFFFFF":l;a.push(` <g fill="black" font-family="ui-sans-serif, system-ui, sans-serif" font-size="${u}" paint-order="stroke" stroke="${g}" stroke-width="2" stroke-linejoin="round">`);for(const f of e.elements.values()){const b=e.layout.get(f.element.id);if(!b||!f.libraryDef)continue;const y=ro(f,d);if(y.length===0)continue;const v=f.libraryDef.label??io(f.libraryDef,u),{world:[j,S],textAnchor:N,dy:W}=so(v,f.libraryDef,b,y.length,u,f.element.labelOffset);for(let ne=0;ne<y.length;ne++)a.push(` <text x="${j}" y="${S+W+ne*m}" text-anchor="${N}">${et(y[ne])}</text>`)}for(const f of e.wireRenders.values()){const b=(h=f.label)==null?void 0:h.trim();if(!b)continue;const y=ao(f.path,u);if(!y)continue;const v=f.color?` fill="${Ve(f.color)}"`:"";a.push(` <text x="${y.world[0]}" y="${y.world[1]}" text-anchor="${y.textAnchor}"${v}>${et(b)}</text>`)}a.push(" </g>")}const p=t.annotations??[];if(p.length>0){const g=l==="transparent"?"#FFFFFF":l,f=l==="transparent"?"none":l,b=`font-family="ui-sans-serif, system-ui, sans-serif" paint-order="stroke" stroke="${g}" stroke-width="2" stroke-linejoin="round"`;for(const y of p)switch(Xe(y)){case"rect":eI(a,y,b);break;case"ellipse":tI(a,y,b);break;case"line":nI(a,y);break;case"table":oI(a,y,f);break;default:J4(a,y,b);break}}return a.push("</svg>"),a.join(`
250
- `)}function Q4(e,t){if(!t||t==="default")return e;const n=Ve(t);return e.replace(/(stroke|fill)="(black|#000|#000000)"/gi,(o,r)=>`${r}="${n}"`)}function J4(e,t,n){if(!t.text)return;const o=t.fontSize??Ge,r=t.text.split(`
251
- `);e.push(` <g fill="${Ve(t.color)}" ${n}>`);for(let i=0;i<r.length;i++){const s=t.at[1]+o*.85+i*o*Z4;e.push(` <text x="${t.at[0]}" y="${s}" font-size="${o}">${et(r[i])}</text>`)}e.push(" </g>")}function eI(e,t,n){const[o,r]=t.at,[i,s]=t.size,l=Ve(t.color);t.fill==="tint"&&e.push(` <rect x="${o}" y="${r}" width="${i}" height="${s}" fill="${l}" fill-opacity="${T2}"/>`),e.push(` <rect x="${o}" y="${r}" width="${i}" height="${s}" fill="none" stroke="${l}" stroke-width="${Dt(t.strokeWidth)}"${Cr(t.stroke??"dashed")}/>`),TS(e,t,n)}function tI(e,t,n){const{cx:o,cy:r,rx:i,ry:s}=yr(t),l=Ve(t.color);t.fill==="tint"&&e.push(` <ellipse cx="${o}" cy="${r}" rx="${i}" ry="${s}" fill="${l}" fill-opacity="${T2}"/>`),e.push(` <ellipse cx="${o}" cy="${r}" rx="${i}" ry="${s}" fill="none" stroke="${l}" stroke-width="${Dt(t.strokeWidth)}"${Cr(t.stroke)}/>`),TS(e,t,n)}function TS(e,t,n){if(!t.label)return;const[o,r]=t.at;e.push(` <g fill="${Ve(t.color)}" ${n}>`),e.push(` <text x="${o+ct}" y="${r+ct+Ge*.85}" font-size="${Ge}">${et(t.label)}</text>`),e.push(" </g>")}function Cr(e){const t=co(e);return t?` stroke-dasharray="${t}"`:""}function nI(e,t){const n=fn(t);if(n.length<2)return;const o=Ve(t.color),r=n.map(([i,s])=>`${i},${s}`).join(" ");e.push(` <polyline points="${r}" fill="none" stroke="${o}" stroke-width="${Dt(t.strokeWidth)}"${Cr(t.stroke)}/>`);for(const i of br(n,t.arrow))e.push(` <polygon points="${i.map(([s,l])=>`${s},${l}`).join(" ")}" fill="${o}"/>`)}function oI(e,t,n){var h;const[o,r]=t.at,i=Ve(t.color),[s,l]=nt(t),a=Rt(t),d=Ot(t),u=t.fontSize??Ge;n!=="none"&&e.push(` <rect x="${o}" y="${r}" width="${s}" height="${l}" fill="${n}"/>`);let m="";for(let g=1;g<t.colWidths.length;g++)m+=`M${o+a[g]} ${r}V${r+l}`;for(let g=1;g<t.rowHeights.length;g++)m+=`M${o} ${r+d[g]}H${o+s}`;m&&e.push(` <path d="${m}" fill="none" stroke="${i}" stroke-width="0.5"/>`),e.push(` <rect x="${o}" y="${r}" width="${s}" height="${l}" fill="none" stroke="${i}" stroke-width="1"/>`);const p=[];for(let g=0;g<t.rowHeights.length;g++)for(let f=0;f<t.colWidths.length;f++){const b=((h=t.cells[g])==null?void 0:h[f])??"";if(b==="")continue;const y=o+a[f]+sn,v=r+d[g]+t.rowHeights[g]/2+u*.35;p.push(` <text x="${y}" y="${v}" font-size="${u}">${et(b)}</text>`)}p.length>0&&(e.push(` <g fill="${i}" font-family="ui-sans-serif, system-ui, sans-serif">`),e.push(...p),e.push(" </g>"))}function rI(e,t){var u;let n=1/0,o=1/0,r=-1/0,i=-1/0;const s=(m,p)=>{m<n&&(n=m),m>r&&(r=m),p<o&&(o=p),p>i&&(i=p)};for(const m of e.terminals.values())s(m.world[0],m.world[1]);for(const m of e.junctions.values())s(m.world[0],m.world[1]);for(const m of e.elements.values()){const p=e.layout.get(m.element.id),h=m.libraryDef;if(!p||!h)continue;const g=iI(h.viewBox);if(!g){s(p.at[0],p.at[1]);continue}const f=[[g.x,g.y],[g.x+g.w,g.y],[g.x,g.y+g.h],[g.x+g.w,g.y+g.h]];for(const b of f){const[y,v]=Le(b,p);s(y,v)}}for(const{geometry:m}of e.buses.values()){const{axis:p,at:h,span:g}=m,f=g/2;p==="x"?(s(h[0]-f,h[1]),s(h[0]+f,h[1])):(s(h[0],h[1]-f),s(h[0],h[1]+f))}for(const m of e.wireRenders.values())for(const[p,h]of m.path)s(p,h);const l=t.labelMode??"all",a=zt(t.labelFontSize),d=hn(a);if(l!=="off"){for(const m of e.elements.values()){const p=e.layout.get(m.element.id);if(!p||!m.libraryDef)continue;const h=ro(m,l);if(h.length===0)continue;const g=m.libraryDef.label??io(m.libraryDef,a),{world:[f,b],textAnchor:y,dy:v}=so(g,m.libraryDef,p,h.length,a,m.element.labelOffset),j=Vo(h,a),S=h.length*d,N=y==="middle"?f-j/2:y==="end"?f-j:f;s(N,b+v-a),s(N+j,b+v+S)}for(const m of e.wireRenders.values()){const p=(u=m.label)==null?void 0:u.trim();if(!p)continue;const h=ao(m.path,a);if(!h)continue;const[g,f]=h.world,b=Vo([p],a),y=h.textAnchor==="middle"?g-b/2:g;s(y,f-a),s(y+b,f)}}for(const m of t.annotations??[]){if(Xe(m)==="text"&&!m.text)continue;const p=R2(m);s(p.minX,p.minY),s(p.maxX,p.maxY)}return n===1/0&&(n=0,o=0,r=0,i=0),{minX:n,minY:o,maxX:r,maxY:i}}function iI(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function et(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function IS(e,t="diagram.svg",n){const o=_r(e,n);zS(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),t)}async function PS(e,t="diagram.png",n){const o=_r(e,n),r=(n==null?void 0:n.scale)??2,i=URL.createObjectURL(new Blob([o],{type:"image/svg+xml;charset=utf-8"}));try{const s=await sI(i),l=document.createElement("canvas");l.width=Math.round(s.naturalWidth*r),l.height=Math.round(s.naturalHeight*r);const a=l.getContext("2d");if(!a)throw new Error("canvas 2d context unavailable");n!=null&&n.background&&n.background!=="transparent"&&(a.fillStyle=n.background,a.fillRect(0,0,l.width,l.height)),a.drawImage(s,0,0,l.width,l.height);const d=await new Promise((u,m)=>{l.toBlob(p=>p?u(p):m(new Error("toBlob failed")),"image/png")});zS(d,t)}finally{URL.revokeObjectURL(i)}}function sI(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>t(o),o.onerror=()=>n(new Error("failed to load SVG into image")),o.src=e})}function zS(e,t){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=t,o.click(),URL.revokeObjectURL(n)}function aI(){const e=re(),[t,n]=C.useState(!1),o=C.useRef(null);C.useEffect(()=>{if(!t)return;const i=l=>{o.current&&!o.current.contains(l.target)&&n(!1)},s=l=>{l.key==="Escape"&&n(!1)};return window.addEventListener("mousedown",i),window.addEventListener("keydown",s),()=>{window.removeEventListener("mousedown",i),window.removeEventListener("keydown",s)}},[t]);const r=i=>()=>{var m,p,h,g,f;n(!1);const{internal:s,diagram:l,fileSession:a}=x.getState(),d=((m=a==null?void 0:a.name)==null?void 0:m.replace(/\.json$/i,""))??((p=l.meta)==null?void 0:p.title)??"diagram",u={title:(h=l.meta)==null?void 0:h.title,labelMode:(g=l.meta)==null?void 0:g.labelMode,labelFontSize:(f=l.meta)==null?void 0:f.labelFontSize,annotations:l.annotations};i==="svg"?IS(s,`${d}.svg`,u):i==="png"?PS(s,`${d}.png`,{...u,scale:2}).catch(b=>{console.error(b),alert(e("topbar.export.pngFailed",{err:b.message}))}):NS(s,`${d}.dxf`,u).catch(b=>{console.error(b),alert(e("topbar.export.dxfFailed",{err:b.message}))})};return c.jsxs("div",{ref:o,className:"relative",children:[c.jsxs(De,{variant:"ghost",size:"sm",className:"gap-1.5","aria-haspopup":"menu","aria-expanded":t,onClick:()=>n(i=>!i),children:[c.jsx(e_,{}),e("topbar.export.label")]}),t&&c.jsxs("div",{role:"menu",className:"ole-glass absolute left-0 top-full mt-1.5 min-w-40 rounded-md border border-border p-1 shadow-md",children:[c.jsxs("button",{type:"button",role:"menuitem",onClick:r("svg"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[c.jsx(r_,{}),c.jsx("span",{className:"flex-1",children:"SVG"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:r("png"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[c.jsx(n_,{}),c.jsx("span",{className:"flex-1",children:"PNG (2×)"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:r("dxf"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[c.jsx(t_,{}),c.jsx("span",{className:"flex-1",children:"DXF"})]})]})]})}exports.ALLOWED_ATTRS=CS;exports.ALLOWED_ELEMENTS=_S;exports.COLOR_ORDER=hr;exports.CUSTOM_KIND_PREFIX=l2;exports.ExportMenu=aI;exports.FileMenu=I4;exports.LIBRARY=Wn;exports.NAMED_COLORS=lo;exports.OneLineEditor=l4;exports.OneLineViewer=k4;exports.annotationKind=Xe;exports.applyTheme=kS;exports.bindingsOf=xE;exports.buildExportDxf=ES;exports.buildExportSvg=_r;exports.compile=Ye;exports.createEditorStore=g2;exports.createStaticTagSource=A4;exports.downloadDxf=NS;exports.downloadPng=PS;exports.downloadSvg=IS;exports.dxfColor=$t;exports.emptyInternalModel=d2;exports.exportInk=Ve;exports.fitToContent=xr;exports.fitToContentSoon=wr;exports.getInitialTheme=a4;exports.getLibraryEntry=nE;exports.inkClass=Re;exports.isCustomKind=eo;exports.isTextAnnotation=$C;exports.mergeCustomKinds=c2;exports.newAnnotationId=Yt;exports.newBusId=qo;exports.newElementId=rn;exports.newJunctionId=Go;exports.orientationVec=Wo;exports.removeBindings=vE;exports.resolveBindings=p2;exports.resolvePlacement=u2;exports.sanitizeSymbolSvg=$4;exports.soleSelectedAnnotation=Pt;exports.toTagValue=Bn;exports.transformOrientation=Jt;exports.transformPoint=Le;exports.upsertBinding=wE;exports.useEditorStore=x;exports.useHostActions=kr;exports.useLocale=pn;exports.validateCustomKind=E4;exports.wireIdFromEnds=bt;
254
+ `)}fmt(t){return typeof t=="number"?Number.isFinite(t)?Number.isInteger(t)?String(t):t.toFixed(this.precision):"0":t}header(t){this.g(0,"SECTION"),this.g(2,"HEADER"),this.g(9,"$ACADVER"),this.g(1,"AC1009"),this.g(9,"$INSUNITS"),this.g(70,0),this.extentsSlot=this.out.length,this.out.push(""),t&&(this.g(9,"$PROJECTNAME"),this.g(1,Bi(t))),this.g(0,"ENDSEC")}tables(t){this.g(0,"SECTION"),this.g(2,"TABLES"),this.g(0,"TABLE"),this.g(2,"LAYER"),this.g(70,t.length);for(const n of t)this.g(0,"LAYER"),this.g(2,n.name),this.g(70,0),this.g(62,n.color),this.g(6,"CONTINUOUS");this.g(0,"ENDTAB"),this.g(0,"ENDSEC")}beginEntities(){this.g(0,"SECTION"),this.g(2,"ENTITIES")}endEntities(){this.g(0,"ENDSEC"),this.g(0,"EOF")}setColor(t){this.currentColor=t}color(){this.currentColor!==void 0&&this.g(62,this.currentColor)}line(t,n,o){this.g(0,"LINE"),this.g(8,t),this.color(),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(11,o[0]),this.g(21,o[1]),this.g(31,0),this.track(n[0],n[1]),this.track(o[0],o[1])}polyline(t,n,o){if(!(n.length<2)){this.g(0,"POLYLINE"),this.g(8,t),this.color(),this.g(66,1),this.g(70,o?1:0),this.g(10,0),this.g(20,0),this.g(30,0);for(const[r,a]of n)this.g(0,"VERTEX"),this.g(8,t),this.g(10,r),this.g(20,a),this.g(30,0),this.track(r,a);this.g(0,"SEQEND"),this.g(8,t)}}circle(t,n,o){this.g(0,"CIRCLE"),this.g(8,t),this.color(),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(40,o),this.track(n[0]-o,n[1]-o),this.track(n[0]+o,n[1]+o)}text(t,n,o,r,a,i,l="start"){this.g(0,"TEXT"),this.g(8,t),this.color(),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(40,r),this.g(1,Bi(o)),this.track(n[0],n[1]),this.track(n[0],n[1]+r),a!==0&&this.g(50,a),i&&this.g(71,2),l!=="start"&&(this.g(72,l==="middle"?1:2),this.g(11,n[0]),this.g(21,n[1]),this.g(31,0))}}function Bi(e){return e.replace(/[\r\n]+/g," ").slice(0,250)}const wz="http://www.w3.org/2000/svg",eo=24,vz=1.25;function Gr(e,t={}){var g;const n=Az(e,t),o=Math.floor(n.minX-eo),r=Math.floor(n.minY-eo),a=Math.ceil(n.maxX+eo)-o,i=Math.ceil(n.maxY+eo)-r,l=t.background??"#FFFFFF",s=[];s.push('<?xml version="1.0" encoding="UTF-8"?>'),s.push(`<svg xmlns="${wz}" viewBox="${o} ${r} ${a} ${i}" width="${a}" height="${i}">`),t.title&&s.push(` <title>${yt(t.title)}</title>`),l!=="transparent"&&s.push(` <rect x="${o}" y="${r}" width="${a}" height="${i}" fill="${l}"/>`),s.push(' <g fill="none" stroke="black" stroke-width="1">');for(const h of e.wireRenders.values()){if(h.path.length<2)continue;const f=h.path.map(([y,w])=>`${y},${w}`).join(" "),b=h.color?` stroke="${dt(h.color)}"`:"";s.push(` <polyline points="${f}"${b}/>`)}s.push(" </g>");for(const{bus:h,geometry:f}of e.buses.values()){const{axis:b,at:y,span:w}=f,j=w/2,_=b==="x"?y[0]-j:y[0],E=b==="x"?y[1]:y[1]-j,W=b==="x"?y[0]+j:y[0],Q=b==="x"?y[1]:y[1]+j;s.push(` <line id="${yt(h.id)}" x1="${_}" y1="${E}" x2="${W}" y2="${Q}" stroke="${dt(h.color)}" stroke-width="3" stroke-linecap="round" fill="none"/>`)}for(const{junction:h,world:f,degree:b}of e.junctions.values())b<3||s.push(` <circle id="${yt(h.id)}" cx="${f[0]}" cy="${f[1]}" r="3.5" fill="black"/>`);for(const h of e.elements.values()){if(!h.libraryDef)continue;const f=e.layout.get(h.element.id);f&&(s.push(` <g id="${yt(h.element.id)}" transform="${Et(f)}">`),s.push(` ${kz(I_(h.libraryDef.svg,f.scale),h.element.color)}`),s.push(" </g>"))}const d=t.labelMode??"all",u=Jt(t.labelFontSize),m=Pn(u);if(d!=="off"){const h=l==="transparent"?"#FFFFFF":l;s.push(` <g fill="black" font-family="ui-sans-serif, system-ui, sans-serif" font-size="${u}" paint-order="stroke" stroke="${h}" stroke-width="2" stroke-linejoin="round">`);for(const f of e.elements.values()){const b=e.layout.get(f.element.id);if(!b||!f.libraryDef)continue;const y=ko(f,d);if(y.length===0)continue;const w=f.libraryDef.label??So(f.libraryDef,u),{world:[j,_],textAnchor:E,dy:W}=_o(w,f.libraryDef,b,y.length,u,f.element.labelOffset);for(let Q=0;Q<y.length;Q++)s.push(` <text x="${j}" y="${_+W+Q*m}" text-anchor="${E}">${yt(y[Q])}</text>`)}for(const f of e.wireRenders.values()){const b=(g=f.label)==null?void 0:g.trim();if(!b)continue;const y=Co(f.path,u);if(!y)continue;const w=f.color?` fill="${dt(f.color)}"`:"";s.push(` <text x="${y.world[0]}" y="${y.world[1]}" text-anchor="${y.textAnchor}"${w}>${yt(b)}</text>`)}s.push(" </g>")}const p=t.annotations??[];if(p.length>0){const h=l==="transparent"?"#FFFFFF":l,f=l==="transparent"?"none":l,b=`font-family="ui-sans-serif, system-ui, sans-serif" paint-order="stroke" stroke="${h}" stroke-width="2" stroke-linejoin="round"`;for(const y of p)switch(ut(y)){case"rect":_z(s,y,b);break;case"ellipse":Cz(s,y,b);break;case"line":jz(s,y);break;case"table":$z(s,y,f);break;default:Sz(s,y,b);break}}return s.push("</svg>"),s.join(`
255
+ `)}function kz(e,t){if(!t||t==="default")return e;const n=dt(t);return e.replace(/(stroke|fill)="(black|#000|#000000)"/gi,(o,r)=>`${r}="${n}"`)}function Sz(e,t,n){if(!t.text)return;const o=t.fontSize??ct,r=t.text.split(`
256
+ `);e.push(` <g fill="${dt(t.color)}" ${n}>`);for(let a=0;a<r.length;a++){const i=t.at[1]+o*.85+a*o*vz;e.push(` <text x="${t.at[0]}" y="${i}" font-size="${o}">${yt(r[a])}</text>`)}e.push(" </g>")}function _z(e,t,n){const[o,r]=t.at,[a,i]=t.size,l=dt(t.color);t.fill==="tint"&&e.push(` <rect x="${o}" y="${r}" width="${a}" height="${i}" fill="${l}" fill-opacity="${y_}"/>`),e.push(` <rect x="${o}" y="${r}" width="${a}" height="${i}" fill="none" stroke="${l}" stroke-width="${tn(t.strokeWidth)}"${Kr(t.stroke??"dashed")}/>`),EC(e,t,n)}function Cz(e,t,n){const{cx:o,cy:r,rx:a,ry:i}=Lr(t),l=dt(t.color);t.fill==="tint"&&e.push(` <ellipse cx="${o}" cy="${r}" rx="${a}" ry="${i}" fill="${l}" fill-opacity="${y_}"/>`),e.push(` <ellipse cx="${o}" cy="${r}" rx="${a}" ry="${i}" fill="none" stroke="${l}" stroke-width="${tn(t.strokeWidth)}"${Kr(t.stroke)}/>`),EC(e,t,n)}function EC(e,t,n){if(!t.label)return;const[o,r]=t.at;e.push(` <g fill="${dt(t.color)}" ${n}>`),e.push(` <text x="${o+$t}" y="${r+$t+ct*.85}" font-size="${ct}">${yt(t.label)}</text>`),e.push(" </g>")}function Kr(e){const t=$o(e);return t?` stroke-dasharray="${t}"`:""}function jz(e,t){const n=In(t);if(n.length<2)return;const o=dt(t.color),r=n.map(([a,i])=>`${a},${i}`).join(" ");e.push(` <polyline points="${r}" fill="none" stroke="${o}" stroke-width="${tn(t.strokeWidth)}"${Kr(t.stroke)}/>`);for(const a of Rr(n,t.arrow))e.push(` <polygon points="${a.map(([i,l])=>`${i},${l}`).join(" ")}" fill="${o}"/>`)}function $z(e,t,n){var g;const[o,r]=t.at,a=dt(t.color),[i,l]=vt(t),s=nn(t),d=on(t),u=t.fontSize??ct;n!=="none"&&e.push(` <rect x="${o}" y="${r}" width="${i}" height="${l}" fill="${n}"/>`);let m="";for(let h=1;h<t.colWidths.length;h++)m+=`M${o+s[h]} ${r}V${r+l}`;for(let h=1;h<t.rowHeights.length;h++)m+=`M${o} ${r+d[h]}H${o+i}`;m&&e.push(` <path d="${m}" fill="none" stroke="${a}" stroke-width="0.5"/>`),e.push(` <rect x="${o}" y="${r}" width="${i}" height="${l}" fill="none" stroke="${a}" stroke-width="1"/>`);const p=[];for(let h=0;h<t.rowHeights.length;h++)for(let f=0;f<t.colWidths.length;f++){const b=((g=t.cells[h])==null?void 0:g[f])??"";if(b==="")continue;const y=o+s[f]+_n,w=r+d[h]+t.rowHeights[h]/2+u*.35;p.push(` <text x="${y}" y="${w}" font-size="${u}">${yt(b)}</text>`)}p.length>0&&(e.push(` <g fill="${a}" font-family="ui-sans-serif, system-ui, sans-serif">`),e.push(...p),e.push(" </g>"))}function Az(e,t){var u;let n=1/0,o=1/0,r=-1/0,a=-1/0;const i=(m,p)=>{m<n&&(n=m),m>r&&(r=m),p<o&&(o=p),p>a&&(a=p)};for(const m of e.terminals.values())i(m.world[0],m.world[1]);for(const m of e.junctions.values())i(m.world[0],m.world[1]);for(const m of e.elements.values()){const p=e.layout.get(m.element.id),g=m.libraryDef;if(!p||!g)continue;const h=Ez(g.viewBox);if(!h){i(p.at[0],p.at[1]);continue}const f=[[h.x,h.y],[h.x+h.w,h.y],[h.x,h.y+h.h],[h.x+h.w,h.y+h.h]];for(const b of f){const[y,w]=Ze(b,p);i(y,w)}}for(const{geometry:m}of e.buses.values()){const{axis:p,at:g,span:h}=m,f=h/2;p==="x"?(i(g[0]-f,g[1]),i(g[0]+f,g[1])):(i(g[0],g[1]-f),i(g[0],g[1]+f))}for(const m of e.wireRenders.values())for(const[p,g]of m.path)i(p,g);const l=t.labelMode??"all",s=Jt(t.labelFontSize),d=Pn(s);if(l!=="off"){for(const m of e.elements.values()){const p=e.layout.get(m.element.id);if(!p||!m.libraryDef)continue;const g=ko(m,l);if(g.length===0)continue;const h=m.libraryDef.label??So(m.libraryDef,s),{world:[f,b],textAnchor:y,dy:w}=_o(h,m.libraryDef,p,g.length,s,m.element.labelOffset),j=ur(g,s),_=g.length*d,E=y==="middle"?f-j/2:y==="end"?f-j:f;i(E,b+w-s),i(E+j,b+w+_)}for(const m of e.wireRenders.values()){const p=(u=m.label)==null?void 0:u.trim();if(!p)continue;const g=Co(m.path,s);if(!g)continue;const[h,f]=g.world,b=ur([p],s),y=g.textAnchor==="middle"?h-b/2:h;i(y,f-s),i(y+b,f)}}for(const m of t.annotations??[]){if(ut(m)==="text"&&!m.text)continue;const p=__(m);i(p.minX,p.minY),i(p.maxX,p.maxY)}return n===1/0&&(n=0,o=0,r=0,a=0),{minX:n,minY:o,maxX:r,maxY:a}}function Ez(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function yt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function NC(e,t="diagram.svg",n){const o=Gr(e,n);PC(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),t)}async function TC(e,t="diagram.png",n){const o=Gr(e,n),r=(n==null?void 0:n.scale)??2,a=URL.createObjectURL(new Blob([o],{type:"image/svg+xml;charset=utf-8"}));try{const i=await Nz(a),l=document.createElement("canvas");l.width=Math.round(i.naturalWidth*r),l.height=Math.round(i.naturalHeight*r);const s=l.getContext("2d");if(!s)throw new Error("canvas 2d context unavailable");n!=null&&n.background&&n.background!=="transparent"&&(s.fillStyle=n.background,s.fillRect(0,0,l.width,l.height)),s.drawImage(i,0,0,l.width,l.height);const d=await new Promise((u,m)=>{l.toBlob(p=>p?u(p):m(new Error("toBlob failed")),"image/png")});PC(d,t)}finally{URL.revokeObjectURL(a)}}function Nz(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>t(o),o.onerror=()=>n(new Error("failed to load SVG into image")),o.src=e})}function PC(e,t){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=t,o.click(),URL.revokeObjectURL(n)}function Tz(){const e=re(),[t,n]=$.useState(!1),o=$.useRef(null);$.useEffect(()=>{if(!t)return;const a=l=>{o.current&&!o.current.contains(l.target)&&n(!1)},i=l=>{l.key==="Escape"&&n(!1)};return window.addEventListener("mousedown",a),window.addEventListener("keydown",i),()=>{window.removeEventListener("mousedown",a),window.removeEventListener("keydown",i)}},[t]);const r=a=>()=>{var m,p,g,h,f;n(!1);const{internal:i,diagram:l,fileSession:s}=x.getState(),d=((m=s==null?void 0:s.name)==null?void 0:m.replace(/\.json$/i,""))??((p=l.meta)==null?void 0:p.title)??"diagram",u={title:(g=l.meta)==null?void 0:g.title,labelMode:(h=l.meta)==null?void 0:h.labelMode,labelFontSize:(f=l.meta)==null?void 0:f.labelFontSize,annotations:l.annotations};a==="svg"?NC(i,`${d}.svg`,u):a==="png"?TC(i,`${d}.png`,{...u,scale:2}).catch(b=>{console.error(b),alert(e("topbar.export.pngFailed",{err:b.message}))}):AC(i,`${d}.dxf`,u).catch(b=>{console.error(b),alert(e("topbar.export.dxfFailed",{err:b.message}))})};return c.jsxs("div",{ref:o,className:"relative",children:[c.jsxs(Ve,{variant:"ghost",size:"sm",className:"gap-1.5","aria-haspopup":"menu","aria-expanded":t,onClick:()=>n(a=>!a),children:[c.jsx(GC,{}),e("topbar.export.label")]}),t&&c.jsxs("div",{role:"menu",className:"ole-glass absolute left-0 top-full mt-1.5 min-w-40 rounded-md border border-border p-1 shadow-md",children:[c.jsxs("button",{type:"button",role:"menuitem",onClick:r("svg"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[c.jsx(YC,{}),c.jsx("span",{className:"flex-1",children:"SVG"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:r("png"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[c.jsx(UC,{}),c.jsx("span",{className:"flex-1",children:"PNG (2×)"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:r("dxf"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[c.jsx(KC,{}),c.jsx("span",{className:"flex-1",children:"DXF"})]})]})]})}exports.ALLOWED_ATTRS=SC;exports.ALLOWED_ELEMENTS=kC;exports.COLOR_ORDER=Mr;exports.CUSTOM_KIND_PREFIX=XS;exports.ExportMenu=Tz;exports.FileMenu=nz;exports.LIBRARY=so;exports.NAMED_COLORS=jo;exports.OneLineEditor=PI;exports.OneLineViewer=GI;exports.annotationKind=ut;exports.applyTheme=wC;exports.bindingsOf=C6;exports.buildExportDxf=$C;exports.buildExportSvg=Gr;exports.checkHealth=H_;exports.compile=pt;exports.createEditorStore=o_;exports.createStaticTagSource=ZI;exports.downloadDxf=AC;exports.downloadPng=TC;exports.downloadSvg=NC;exports.dxfColor=Gt;exports.emptyInternalModel=ZS;exports.exportInk=dt;exports.fitToContent=Fr;exports.fitToContentSoon=Wr;exports.getInitialTheme=TI;exports.getLibraryEntry=s6;exports.inkClass=Qe;exports.isCustomKind=yo;exports.isTextAnnotation=v$;exports.mergeCustomKinds=YS;exports.newAnnotationId=fn;exports.newBusId=cr;exports.newElementId=Sn;exports.newJunctionId=dr;exports.orientationVec=sr;exports.parseRatio=L_;exports.removeBindings=$6;exports.resolveBindings=e_;exports.resolvePlacement=QS;exports.sameVoltageLevel=R_;exports.sanitizeSymbolSvg=QI;exports.soleSelectedAnnotation=Qt;exports.toTagValue=ro;exports.transformOrientation=yn;exports.transformPoint=Ze;exports.upsertBinding=j6;exports.useEditorStore=x;exports.useHostActions=Yt;exports.useLocale=Tn;exports.validateCustomKind=JI;exports.wireIdFromEnds=Dt;
252
257
  //# sourceMappingURL=sldeditor.cjs.map