aptechka 0.83.1 → 0.84.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 (285) hide show
  1. package/lib/Animation-BAiM6_n1.js +111 -0
  2. package/lib/Animation-DMWabSR0.cjs +1 -0
  3. package/lib/Composed-B0fvCtZz.cjs +1 -0
  4. package/lib/Composed-CgA9lLWA.js +75 -0
  5. package/lib/Damped-BLo-OAVb.cjs +1 -0
  6. package/lib/Damped-Dcz5UdMH.js +57 -0
  7. package/lib/DerivedArray-DFhxap_z.js +63 -0
  8. package/lib/DerivedArray-DYtWMW0n.cjs +1 -0
  9. package/lib/DragControls-BPHsDeH6.cjs +1 -0
  10. package/lib/DragControls-D2a1Cifp.js +234 -0
  11. package/lib/LocalLinks-BWFJYhGX.cjs +1 -0
  12. package/lib/LocalLinks-Dwgf3No6.js +65 -0
  13. package/lib/PageAnnouncerElement-DPMlVJZG.cjs +1 -0
  14. package/lib/PageAnnouncerElement-DV9pm_od.js +28 -0
  15. package/lib/PageScroll-BAatKJx6.cjs +1 -0
  16. package/lib/PageScroll-m3TsHnzR.js +65 -0
  17. package/lib/SourceElement-941MrYpq.js +265 -0
  18. package/lib/SourceElement-DBLZ7b5k.cjs +5 -0
  19. package/lib/Store-BCW70G3Z.cjs +1 -0
  20. package/lib/Store-uLDYY9ed.js +158 -0
  21. package/lib/Tweened-BvtjLCa3.js +48 -0
  22. package/lib/Tweened-DdXm1dbF.cjs +1 -0
  23. package/lib/Viewport-BiDoiU8M.js +113 -0
  24. package/lib/Viewport-CXGKUyDy.cjs +1 -0
  25. package/lib/accordion/index.cjs +1 -1
  26. package/lib/accordion/index.js +97 -93
  27. package/lib/animation/index.cjs +1 -1
  28. package/lib/animation/index.js +6 -6
  29. package/lib/api-fetcher/index.cjs +1 -1
  30. package/lib/api-fetcher/index.js +67 -66
  31. package/lib/attribute/index.cjs +1 -1
  32. package/lib/attribute/index.js +37 -34
  33. package/lib/attributes-BADnRZpK.cjs +1 -0
  34. package/lib/attributes-FObgMNCf.js +36 -0
  35. package/lib/billboard/index.cjs +1 -1
  36. package/lib/billboard/index.js +240 -232
  37. package/lib/cache/index.cjs +1 -1
  38. package/lib/cache/index.js +26 -23
  39. package/lib/canvas/index.cjs +1 -1
  40. package/lib/canvas/index.js +62 -59
  41. package/lib/canvas-BP1ceie3.cjs +1 -0
  42. package/lib/canvas-DsglKco1.js +40 -0
  43. package/lib/connector/index.cjs +1 -1
  44. package/lib/connector/index.js +44 -41
  45. package/lib/controls/index.cjs +1 -1
  46. package/lib/controls/index.js +6 -6
  47. package/lib/coordinates--JG1U6kQ.js +29 -0
  48. package/lib/coordinates-DQ9XV9M1.cjs +1 -0
  49. package/lib/css-property/index.cjs +1 -1
  50. package/lib/css-property/index.d.ts +1 -1
  51. package/lib/css-property/index.js +40 -37
  52. package/lib/css-unit-parser/index.cjs +2 -2
  53. package/lib/css-unit-parser/index.js +22 -19
  54. package/lib/css-value-parser/index.cjs +1 -1
  55. package/lib/css-value-parser/index.js +13 -11
  56. package/lib/custom-elements-BfZCJde6.cjs +1 -0
  57. package/lib/custom-elements-HEMuF7yH.js +27 -0
  58. package/lib/dev/index.cjs +2 -1
  59. package/lib/dev/index.d.ts +1 -0
  60. package/lib/dev/index.js +25 -10
  61. package/lib/device/index.cjs +1 -1
  62. package/lib/device/index.js +5 -5
  63. package/lib/dom-B40i6NXw.cjs +1 -0
  64. package/lib/dom-D8D-_9ty.js +108 -0
  65. package/lib/easings-BSGJFMAo.js +40 -0
  66. package/lib/easings-BWq0pPLq.cjs +1 -0
  67. package/lib/element-CqD0jqBJ.cjs +1 -0
  68. package/lib/element-DKw5H-Tu.js +10 -0
  69. package/lib/element-linked-store/index.cjs +1 -1
  70. package/lib/element-linked-store/index.js +53 -52
  71. package/lib/element-resizer/index.cjs +1 -1
  72. package/lib/element-resizer/index.js +47 -44
  73. package/lib/en3/index.cjs +4 -4
  74. package/lib/en3/index.js +192 -185
  75. package/lib/events-Ds-TuvYW.js +9 -0
  76. package/lib/events-UlGk63iC.cjs +1 -0
  77. package/lib/file-DwQs6bB6.js +28 -0
  78. package/lib/file-RHfA3OS-.cjs +1 -0
  79. package/lib/function-H4b_gTg6.cjs +1 -0
  80. package/lib/function-UmbPrOHm.js +19 -0
  81. package/lib/gestures-DmKKNnh4.js +14 -0
  82. package/lib/gestures-DtYbQr49.cjs +1 -0
  83. package/lib/history/index.cjs +1 -1
  84. package/lib/history/index.js +24 -21
  85. package/lib/iframe/index.cjs +1 -1
  86. package/lib/iframe/index.js +27 -24
  87. package/lib/image/index.cjs +1 -1
  88. package/lib/image/index.js +17 -13
  89. package/lib/index-BpO2RJ__.cjs +1 -0
  90. package/lib/index-DpKsHe97.js +68 -0
  91. package/lib/intersector/index.cjs +1 -1
  92. package/lib/intersector/index.js +3 -3
  93. package/lib/jsx/ComponentElement.d.ts +4 -0
  94. package/lib/jsx/h.d.ts +7 -16
  95. package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
  96. package/lib/jsx/hooks/cssProperty.d.ts +6 -0
  97. package/lib/jsx/hooks/resize.d.ts +4 -0
  98. package/lib/jsx/hooks/store.d.ts +1 -2
  99. package/lib/jsx/hooks/ticker.d.ts +5 -0
  100. package/lib/jsx/index.cjs +1 -1
  101. package/lib/jsx/index.d.ts +4 -4
  102. package/lib/jsx/index.js +171 -349
  103. package/lib/jsx/plugins/vite/index.cjs +49 -0
  104. package/lib/jsx/plugins/vite/index.d.ts +38 -0
  105. package/lib/jsx/plugins/vite/index.js +104 -0
  106. package/lib/jsx/render.d.ts +2 -0
  107. package/lib/jsx/type.d.ts +228 -190
  108. package/lib/ladder/index.cjs +1 -1
  109. package/lib/ladder/index.js +86 -84
  110. package/lib/layout-C26zkY7D.js +35 -0
  111. package/lib/layout-CnGLl7oe.cjs +1 -0
  112. package/lib/layout-box/index.cjs +1 -1
  113. package/lib/layout-box/index.js +221 -217
  114. package/lib/loading/index.cjs +1 -1
  115. package/lib/loading/index.js +48 -45
  116. package/lib/local-links/index.cjs +1 -1
  117. package/lib/local-links/index.js +2 -2
  118. package/lib/masonry-layout/index.cjs +1 -1
  119. package/lib/masonry-layout/index.js +48 -45
  120. package/lib/math-C-knY2TL.cjs +1 -0
  121. package/lib/math-r8V23YFe.js +57 -0
  122. package/lib/media/index.cjs +1 -1
  123. package/lib/media/index.js +28 -25
  124. package/lib/metadata-BNdkmeeD.js +15 -0
  125. package/lib/metadata-BrHUfpV9.cjs +1 -0
  126. package/lib/morph/index.cjs +1 -1
  127. package/lib/morph/index.js +561 -556
  128. package/lib/morph-BtgB1YQP.js +256 -0
  129. package/lib/morph-Buhxq-X0.cjs +1 -0
  130. package/lib/need_redo_tweaker/index.cjs +4 -4
  131. package/lib/need_redo_tweaker/index.js +862 -834
  132. package/lib/notifier/index.cjs +1 -1
  133. package/lib/notifier/index.js +29 -26
  134. package/lib/number-Bu4sGvW7.cjs +1 -0
  135. package/lib/number-DiVt2xnh.js +47 -0
  136. package/lib/object-CiIdEmJx.js +98 -0
  137. package/lib/object-DTY_W6xG.cjs +1 -0
  138. package/lib/order/index.cjs +1 -1
  139. package/lib/order/index.js +3 -3
  140. package/lib/page-announcer/index.cjs +1 -1
  141. package/lib/page-announcer/index.js +2 -2
  142. package/lib/page-scroll/index.cjs +1 -1
  143. package/lib/page-scroll/index.js +2 -2
  144. package/lib/pixel-perfect/index.cjs +4 -4
  145. package/lib/pixel-perfect/index.js +43 -40
  146. package/lib/pointer/index.cjs +1 -1
  147. package/lib/pointer/index.js +125 -122
  148. package/lib/polyfills-CG1XJNia.js +28 -0
  149. package/lib/polyfills-DZCuDBkA.cjs +1 -0
  150. package/lib/popover/index.cjs +1 -1
  151. package/lib/popover/index.js +249 -245
  152. package/lib/radio/index.cjs +1 -1
  153. package/lib/radio/index.js +58 -55
  154. package/lib/render-DLcWVnuH.js +355 -0
  155. package/lib/render-DdomypCo.cjs +1 -0
  156. package/lib/router/index.cjs +1 -1
  157. package/lib/router/index.js +196 -194
  158. package/lib/scroll/index.cjs +1 -1
  159. package/lib/scroll/index.js +890 -877
  160. package/lib/scroll-BvIWh1xB.js +41 -0
  161. package/lib/scroll-CT0lpyRZ.cjs +1 -0
  162. package/lib/scroll-entries/index.cjs +1 -1
  163. package/lib/scroll-entries/index.js +37 -34
  164. package/lib/scroll-kit/index.cjs +1 -1
  165. package/lib/scroll-kit/index.js +214 -209
  166. package/lib/sequence/index.cjs +1 -1
  167. package/lib/sequence/index.js +102 -98
  168. package/lib/size-element/index.cjs +1 -1
  169. package/lib/size-element/index.js +29 -26
  170. package/lib/slicer/index.cjs +1 -1
  171. package/lib/slicer/index.js +118 -113
  172. package/lib/source/index.cjs +1 -1
  173. package/lib/source/index.js +5 -5
  174. package/lib/spa/index.cjs +1 -1
  175. package/lib/spa/index.js +94 -94
  176. package/lib/store/index.cjs +1 -1
  177. package/lib/store/index.d.ts +2 -2
  178. package/lib/store/index.js +10 -8
  179. package/lib/string-B3lm2b7v.js +84 -0
  180. package/lib/string-CbRNzmd9.cjs +1 -0
  181. package/lib/style-DBoQWK0d.js +14 -0
  182. package/lib/style-IDJ6db6n.cjs +1 -0
  183. package/lib/stylesheet-CHvuef16.js +28 -0
  184. package/lib/stylesheet-CQdBaIAA.cjs +1 -0
  185. package/lib/ticker/index.cjs +1 -1
  186. package/lib/ticker/index.js +96 -92
  187. package/lib/url-CPCO10Sy.cjs +1 -0
  188. package/lib/url-CWCY_qe_.js +124 -0
  189. package/lib/utils/attributes.d.ts +2 -0
  190. package/lib/utils/dom.d.ts +1 -0
  191. package/lib/utils/index.cjs +1 -1
  192. package/lib/utils/index.js +245 -226
  193. package/lib/utils/polyfills.d.ts +1 -1
  194. package/lib/video/index.cjs +1 -1
  195. package/lib/video/index.js +36 -33
  196. package/lib/window-resizer/index.cjs +1 -1
  197. package/lib/window-resizer/index.js +27 -24
  198. package/lib/youtube/index.cjs +1 -1
  199. package/lib/youtube/index.js +56 -54
  200. package/package.json +11 -24
  201. package/lib/Animation-BzTjZIE-.js +0 -108
  202. package/lib/Animation-C39Ah-LM.cjs +0 -1
  203. package/lib/Composed-C-TV9te3.cjs +0 -1
  204. package/lib/Composed-DyAWjEXE.js +0 -121
  205. package/lib/Damped-CRusiRIV.js +0 -56
  206. package/lib/Damped-Prr0iKu1.cjs +0 -1
  207. package/lib/DragControls-8rNZwQrs.cjs +0 -1
  208. package/lib/DragControls-DBNdMBA4.js +0 -228
  209. package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
  210. package/lib/LocalLinks-DFZFpbjs.js +0 -62
  211. package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
  212. package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
  213. package/lib/PageScroll-0LxFblry.js +0 -62
  214. package/lib/PageScroll-BXJUQwG7.cjs +0 -1
  215. package/lib/SourceElement-BHqPFbna.cjs +0 -5
  216. package/lib/SourceElement-DjbHjynf.js +0 -260
  217. package/lib/Store-Blf4msDz.cjs +0 -1
  218. package/lib/Store-ZThXYBQd.js +0 -152
  219. package/lib/Tweened-Bw1Cn1PJ.js +0 -47
  220. package/lib/Tweened-DWtk9E-O.cjs +0 -1
  221. package/lib/Viewport-BxCr0GlB.cjs +0 -1
  222. package/lib/Viewport-Dt-d9DPi.js +0 -109
  223. package/lib/attributes-69we3byR.js +0 -10
  224. package/lib/attributes-Bf2svn4j.cjs +0 -1
  225. package/lib/canvas-CU5Xjahf.cjs +0 -1
  226. package/lib/canvas-DeZ0SLUJ.js +0 -34
  227. package/lib/coordinates-CgdGoSYs.js +0 -24
  228. package/lib/coordinates-D8Np3cPD.cjs +0 -1
  229. package/lib/custom-elements-DBnCK7Zx.js +0 -24
  230. package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
  231. package/lib/dom-BETkVSSZ.js +0 -82
  232. package/lib/dom-CBLlqORw.cjs +0 -1
  233. package/lib/easings-BEmRlrDd.js +0 -38
  234. package/lib/easings-GegIwET5.cjs +0 -1
  235. package/lib/element-CGVl1jA-.js +0 -7
  236. package/lib/element-yhcBhsho.cjs +0 -1
  237. package/lib/events-CsVF98U6.js +0 -6
  238. package/lib/events-KVanG9sR.cjs +0 -1
  239. package/lib/file-DSpfWdd9.cjs +0 -1
  240. package/lib/file-GHShUlue.js +0 -24
  241. package/lib/function-C10DGppn.js +0 -17
  242. package/lib/function-MthRj-GJ.cjs +0 -1
  243. package/lib/gestures-C7gbKx11.cjs +0 -1
  244. package/lib/gestures-CcXV6fCp.js +0 -11
  245. package/lib/index-OE2INULi.cjs +0 -1
  246. package/lib/index-e9eDuagL.js +0 -65
  247. package/lib/jsx/hydrate.d.ts +0 -1
  248. package/lib/jsx/integrations/astro/client.cjs +0 -1
  249. package/lib/jsx/integrations/astro/client.d.ts +0 -2
  250. package/lib/jsx/integrations/astro/client.js +0 -50
  251. package/lib/jsx/integrations/astro/index.cjs +0 -1
  252. package/lib/jsx/integrations/astro/index.d.ts +0 -2
  253. package/lib/jsx/integrations/astro/index.js +0 -54
  254. package/lib/jsx/integrations/astro/server.cjs +0 -1
  255. package/lib/jsx/integrations/astro/server.d.ts +0 -3
  256. package/lib/jsx/integrations/astro/server.js +0 -35
  257. package/lib/jsx/plugins/vite.d.ts +0 -21
  258. package/lib/layout-BSMtwCga.js +0 -29
  259. package/lib/layout-Ctc2p3uz.cjs +0 -1
  260. package/lib/math-BOBiC4TN.js +0 -45
  261. package/lib/math-GDWEqu7y.cjs +0 -1
  262. package/lib/metadata-BcYZ5w3T.cjs +0 -1
  263. package/lib/metadata-jfowcCyz.js +0 -12
  264. package/lib/morph-B6sGhLCi.cjs +0 -1
  265. package/lib/morph-BQErz7qP.js +0 -242
  266. package/lib/number-ChAm68cm.cjs +0 -1
  267. package/lib/number-CumqY64S.js +0 -40
  268. package/lib/object-CcMK4y_r.js +0 -87
  269. package/lib/object-baN9pgbU.cjs +0 -1
  270. package/lib/polyfills-DJrTJQky.js +0 -24
  271. package/lib/polyfills-Df4r-ETT.cjs +0 -1
  272. package/lib/render-DQs7rIoN.cjs +0 -1
  273. package/lib/render-D_0FCWEu.js +0 -18
  274. package/lib/scroll-BA2WnUrb.cjs +0 -1
  275. package/lib/scroll-DY5senkF.js +0 -37
  276. package/lib/string-BlMQbe8b.js +0 -70
  277. package/lib/string-DUXXtU8v.cjs +0 -1
  278. package/lib/style-At6aDoqG.cjs +0 -1
  279. package/lib/style-j2TwriJ_.js +0 -10
  280. package/lib/stylesheet-5_o7PFzM.cjs +0 -1
  281. package/lib/stylesheet-DdBzowZY.js +0 -24
  282. package/lib/url-CHgcNwJ1.cjs +0 -1
  283. package/lib/url-CYgo5vrG.js +0 -113
  284. package/lib/vite-C-i3hVDL.js +0 -75
  285. package/lib/vite-DzanPumM.cjs +0 -44
@@ -1,25 +1,27 @@
1
- var vt = (r) => {
2
- throw TypeError(r);
1
+ var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
3
4
  };
4
- var Xe = (r, s, e) => s.has(r) || vt("Cannot " + e);
5
- var t = (r, s, e) => (Xe(r, s, "read from private field"), e ? e.call(r) : s.get(r)), o = (r, s, e) => s.has(r) ? vt("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, e), c = (r, s, e, i) => (Xe(r, s, "write to private field"), i ? i.call(r, e) : s.set(r, e), e), l = (r, s, e) => (Xe(r, s, "access private method"), e);
6
- import { i as p } from "../index-e9eDuagL.js";
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
6
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
7
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
8
+ import { i as isBrowser } from "../index-DpKsHe97.js";
7
9
  import "construct-style-sheets-polyfill";
8
10
  import "../ticker/index.js";
9
- import { S as $, s as K, a as j } from "../Store-ZThXYBQd.js";
10
- import { c as Ut } from "../file-GHShUlue.js";
11
- import { d as Xt } from "../function-C10DGppn.js";
12
- import { s as Et } from "../gestures-CcXV6fCp.js";
13
- import { connector as Qt } from "../connector/index.js";
14
- import { c as Oe, u as jt } from "../string-BlMQbe8b.js";
15
- import { i as yt } from "../object-CcMK4y_r.js";
16
- import { a as es } from "../Viewport-Dt-d9DPi.js";
17
- import { c as ts } from "../math-BOBiC4TN.js";
18
- import { t as ss } from "../number-CumqY64S.js";
19
- import { n as St } from "../polyfills-DJrTJQky.js";
20
- import { elementResizer as kt } from "../element-resizer/index.js";
21
- import { g as is } from "../style-j2TwriJ_.js";
22
- const ns = /* @__PURE__ */ new Set([
11
+ import { S as Store, s as storeRegistry, a as activeStores } from "../Store-uLDYY9ed.js";
12
+ import { c as createJSONAndSave } from "../file-DwQs6bB6.js";
13
+ import { d as debounce } from "../function-UmbPrOHm.js";
14
+ import { s as setupDrag } from "../gestures-DmKKNnh4.js";
15
+ import { connector } from "../connector/index.js";
16
+ import { c as camelToKebab, u as uncapitalize } from "../string-B3lm2b7v.js";
17
+ import { i as isESClass } from "../object-CiIdEmJx.js";
18
+ import { a as ViewportMediaRules } from "../Viewport-BiDoiU8M.js";
19
+ import { c as clamp } from "../math-r8V23YFe.js";
20
+ import { t as toStep } from "../number-DiVt2xnh.js";
21
+ import { n as nullishCoalescing } from "../polyfills-CG1XJNia.js";
22
+ import { elementResizer } from "../element-resizer/index.js";
23
+ import { g as getElementTransitionDurationMS } from "../style-DBoQWK0d.js";
24
+ const knownSvgTags = /* @__PURE__ */ new Set([
23
25
  // 'a', 'style', 'title', 'script',
24
26
  "animate",
25
27
  "animateMotion",
@@ -84,241 +86,241 @@ const ns = /* @__PURE__ */ new Set([
84
86
  "view",
85
87
  "use"
86
88
  ]);
87
- var d, I, y, we, H, D, a, xt, Ct, Lt, Qe, je, Tt, zt, Mt, At, et, tt, Nt, st, it, Rt, nt, Be, ot, rt, at, We, qe;
88
- const Je = class Je {
89
- constructor(...s) {
90
- o(this, a);
91
- o(this, d, null);
92
- o(this, I, /* @__PURE__ */ new Set());
93
- o(this, y, /* @__PURE__ */ new Set());
94
- o(this, we);
95
- o(this, H);
96
- o(this, D);
97
- o(this, We, (s) => {
98
- t(this, I).forEach((e) => {
99
- e(s);
100
- }), t(this, I).clear();
101
- });
102
- o(this, qe, (s, e) => {
103
- t(this, y).forEach((i) => {
104
- i(s, e);
105
- }), t(this, y).clear(), l(this, a, it).call(this);
106
- });
107
- if (p) {
108
- const e = s[0], i = s[1];
109
- c(this, d, l(this, a, xt).call(this, e, i == null ? void 0 : i.forceSvg)), l(this, a, Lt).call(this, i);
89
+ var _node, _connectCallbacks, _disconnectCallbacks, _connectorUnsubscribeCallback, _storeRootElements, _events, _ElementConstructor_instances, createNode_fn, isSvgOrHtmlElement_fn, applyProperties_fn, watchNode_fn, createClassList_fn, manageStringStoreClass_fn, manageBooleanStoreClass_fn, createStyle_fn, createAttributeStyle_fn, createJSSStyle_fn, setStyleProperty_fn, createEvents_fn, attachEvents_fn, detachEvents_fn, createAttributes_fn, setAttribute_fn, createChildren_fn, appendChild_fn, getNode_fn, getOrCreateNode_fn, _connect, _disconnect;
90
+ const _ElementConstructor = class _ElementConstructor {
91
+ constructor(...args) {
92
+ __privateAdd(this, _ElementConstructor_instances);
93
+ __privateAdd(this, _node, null);
94
+ __privateAdd(this, _connectCallbacks, /* @__PURE__ */ new Set());
95
+ __privateAdd(this, _disconnectCallbacks, /* @__PURE__ */ new Set());
96
+ __privateAdd(this, _connectorUnsubscribeCallback);
97
+ __privateAdd(this, _storeRootElements);
98
+ __privateAdd(this, _events);
99
+ __privateAdd(this, _connect, /* @__PURE__ */ __name((node) => {
100
+ __privateGet(this, _connectCallbacks).forEach((callback) => {
101
+ callback(node);
102
+ }), __privateGet(this, _connectCallbacks).clear();
103
+ }, "#connect"));
104
+ __privateAdd(this, _disconnect, /* @__PURE__ */ __name((node, expired) => {
105
+ __privateGet(this, _disconnectCallbacks).forEach((callback) => {
106
+ callback(node, expired);
107
+ }), __privateGet(this, _disconnectCallbacks).clear(), __privateMethod(this, _ElementConstructor_instances, detachEvents_fn).call(this);
108
+ }, "#disconnect"));
109
+ if (isBrowser) {
110
+ const p1 = args[0], p2 = args[1];
111
+ __privateSet(this, _node, __privateMethod(this, _ElementConstructor_instances, createNode_fn).call(this, p1, p2 == null ? void 0 : p2.forceSvg)), __privateMethod(this, _ElementConstructor_instances, applyProperties_fn).call(this, p2);
110
112
  }
111
113
  }
112
114
  get node() {
113
- return t(this, d);
115
+ return __privateGet(this, _node);
114
116
  }
115
- set node(s) {
116
- var e;
117
- l(this, a, it).call(this), c(this, d, s), (e = t(this, we)) == null || e.call(this), t(this, d) instanceof Element && c(this, H, [
118
- ...t(this, d).querySelectorAll("store-root")
119
- ]), l(this, a, st).call(this), l(this, a, Qe).call(this);
117
+ set node(v) {
118
+ var _a;
119
+ __privateMethod(this, _ElementConstructor_instances, detachEvents_fn).call(this), __privateSet(this, _node, v), (_a = __privateGet(this, _connectorUnsubscribeCallback)) == null || _a.call(this), __privateGet(this, _node) instanceof Element && __privateSet(this, _storeRootElements, [
120
+ ...__privateGet(this, _node).querySelectorAll("store-root")
121
+ ]), __privateMethod(this, _ElementConstructor_instances, attachEvents_fn).call(this), __privateMethod(this, _ElementConstructor_instances, watchNode_fn).call(this);
120
122
  }
121
123
  };
122
- d = new WeakMap(), I = new WeakMap(), y = new WeakMap(), we = new WeakMap(), H = new WeakMap(), D = new WeakMap(), a = new WeakSet(), xt = function(s, e) {
123
- let i = null;
124
- if (s instanceof Node)
125
- i = s;
126
- else if (typeof s == "string")
127
- if (!s.includes("<") && s.includes("-"))
128
- i = new (customElements.get(s))();
129
- else if (s.includes("<")) {
130
- const n = document.createElement("div");
131
- n.innerHTML = s, i = n.firstElementChild;
132
- } else ns.has(s) || e ? i = document.createElementNS(
124
+ _node = new WeakMap(), _connectCallbacks = new WeakMap(), _disconnectCallbacks = new WeakMap(), _connectorUnsubscribeCallback = new WeakMap(), _storeRootElements = new WeakMap(), _events = new WeakMap(), _ElementConstructor_instances = new WeakSet(), createNode_fn = /* @__PURE__ */ __name(function(value, forceSvg) {
125
+ let node = null;
126
+ if (value instanceof Node)
127
+ node = value;
128
+ else if (typeof value == "string")
129
+ if (!value.includes("<") && value.includes("-"))
130
+ node = new (customElements.get(value))();
131
+ else if (value.includes("<")) {
132
+ const wrapper = document.createElement("div");
133
+ wrapper.innerHTML = value, node = wrapper.firstElementChild;
134
+ } else knownSvgTags.has(value) || forceSvg ? node = document.createElementNS(
133
135
  "http://www.w3.org/2000/svg",
134
- s
135
- ) : i = document.createElement(s);
136
+ value
137
+ ) : node = document.createElement(value);
136
138
  else
137
- i = document.createElement("div");
138
- return i;
139
- }, Ct = function(s) {
140
- return s instanceof HTMLElement || s instanceof SVGElement;
141
- }, Lt = function(s) {
142
- if (!s) return;
143
- const e = l(this, a, Ct).call(this, t(this, d)), i = s.ref;
144
- delete s.ref, s != null && s.onConnect && (t(this, I).add(s.onConnect), delete s.onConnect), s != null && s.onDisconnect && (t(this, y).add(s.onDisconnect), delete s.onDisconnect);
145
- let n, h;
146
- for (const u in s) {
147
- const m = s[u];
148
- u === "class" && e ? l(this, a, je).call(this, m) : u === "style" && e ? l(this, a, Mt).call(this, m) : u === "lightChildren" ? l(this, a, Be).call(this, t(this, d), m) : u === "children" ? l(this, a, Be).call(this, t(this, d) instanceof Element ? t(this, d).shadowRoot || t(this, d) : t(this, d), m) : u === "connectedClass" ? t(this, I).add(() => {
139
+ node = document.createElement("div");
140
+ return node;
141
+ }, "#createNode"), isSvgOrHtmlElement_fn = /* @__PURE__ */ __name(function(node) {
142
+ return node instanceof HTMLElement || node instanceof SVGElement;
143
+ }, "#isSvgOrHtmlElement"), applyProperties_fn = /* @__PURE__ */ __name(function(properties) {
144
+ if (!properties) return;
145
+ const isSvgOrHtml = __privateMethod(this, _ElementConstructor_instances, isSvgOrHtmlElement_fn).call(this, __privateGet(this, _node)), ref = properties.ref;
146
+ delete properties.ref, properties != null && properties.onConnect && (__privateGet(this, _connectCallbacks).add(properties.onConnect), delete properties.onConnect), properties != null && properties.onDisconnect && (__privateGet(this, _disconnectCallbacks).add(properties.onDisconnect), delete properties.onDisconnect);
147
+ let attributes, events;
148
+ for (const propertyName in properties) {
149
+ const value = properties[propertyName];
150
+ propertyName === "class" && isSvgOrHtml ? __privateMethod(this, _ElementConstructor_instances, createClassList_fn).call(this, value) : propertyName === "style" && isSvgOrHtml ? __privateMethod(this, _ElementConstructor_instances, createStyle_fn).call(this, value) : propertyName === "lightChildren" ? __privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, __privateGet(this, _node), value) : propertyName === "children" ? __privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, __privateGet(this, _node) instanceof Element ? __privateGet(this, _node).shadowRoot || __privateGet(this, _node) : __privateGet(this, _node), value) : propertyName === "connectedClass" ? __privateGet(this, _connectCallbacks).add(() => {
149
151
  requestAnimationFrame(() => {
150
- t(this, d).classList.add(
151
- typeof m == "boolean" ? "connected" : m
152
+ __privateGet(this, _node).classList.add(
153
+ typeof value == "boolean" ? "connected" : value
152
154
  );
153
155
  });
154
- }) : u.startsWith("on") ? (h || (h = {}), h[u] = m) : (n || (n = {}), n[u] = m);
155
- }
156
- l(this, a, Rt).call(this, n), l(this, a, Nt).call(this, h), i && (typeof i == "function" ? i(t(this, d)) : i.current = t(this, d)), l(this, a, Qe).call(this);
157
- }, Qe = function() {
158
- if (p && (t(this, y).size || t(this, I).size)) {
159
- const s = t(this, d) instanceof DocumentFragment ? t(this, d).firstChild : t(this, d);
160
- c(this, we, Qt.subscribe(
161
- s,
156
+ }) : propertyName.startsWith("on") ? (events || (events = {}), events[propertyName] = value) : (attributes || (attributes = {}), attributes[propertyName] = value);
157
+ }
158
+ __privateMethod(this, _ElementConstructor_instances, createAttributes_fn).call(this, attributes), __privateMethod(this, _ElementConstructor_instances, createEvents_fn).call(this, events), ref && (typeof ref == "function" ? ref(__privateGet(this, _node)) : ref.current = __privateGet(this, _node)), __privateMethod(this, _ElementConstructor_instances, watchNode_fn).call(this);
159
+ }, "#applyProperties"), watchNode_fn = /* @__PURE__ */ __name(function() {
160
+ if (isBrowser && (__privateGet(this, _disconnectCallbacks).size || __privateGet(this, _connectCallbacks).size)) {
161
+ const watchNode = __privateGet(this, _node) instanceof DocumentFragment ? __privateGet(this, _node).firstChild : __privateGet(this, _node);
162
+ __privateSet(this, _connectorUnsubscribeCallback, connector.subscribe(
163
+ watchNode,
162
164
  {
163
- connectCallback: t(this, We),
164
- disconnectCallback: t(this, qe),
165
+ connectCallback: __privateGet(this, _connect),
166
+ disconnectCallback: __privateGet(this, _disconnect),
165
167
  unsubscribeAfterDisconnect: !0,
166
168
  maxWaitSec: 20
167
169
  }
168
170
  ));
169
171
  }
170
- }, je = function(s) {
171
- if (s) {
172
- if (typeof s == "string")
173
- t(this, d).classList.add(s);
174
- else if (Array.isArray(s))
175
- s.forEach((e) => {
176
- e && l(this, a, je).call(this, e);
172
+ }, "#watchNode"), createClassList_fn = /* @__PURE__ */ __name(function(classObject) {
173
+ if (classObject) {
174
+ if (typeof classObject == "string")
175
+ __privateGet(this, _node).classList.add(classObject);
176
+ else if (Array.isArray(classObject))
177
+ classObject.forEach((v) => {
178
+ v && __privateMethod(this, _ElementConstructor_instances, createClassList_fn).call(this, v);
177
179
  });
178
- else if (typeof s == "object")
179
- if (s instanceof $)
180
- l(this, a, Tt).call(this, s);
180
+ else if (typeof classObject == "object")
181
+ if (classObject instanceof Store)
182
+ __privateMethod(this, _ElementConstructor_instances, manageStringStoreClass_fn).call(this, classObject);
181
183
  else
182
- for (const e in s) {
183
- const i = s[e];
184
- i instanceof $ ? l(this, a, zt).call(this, e, i) : i ? t(this, d).classList.add(e) : t(this, d).classList.remove(e);
184
+ for (const className in classObject) {
185
+ const isActive = classObject[className];
186
+ isActive instanceof Store ? __privateMethod(this, _ElementConstructor_instances, manageBooleanStoreClass_fn).call(this, className, isActive) : isActive ? __privateGet(this, _node).classList.add(className) : __privateGet(this, _node).classList.remove(className);
185
187
  }
186
188
  } else return;
187
- }, Tt = function(s) {
188
- t(this, y).add(
189
- s.subscribe(({ current: e, previous: i }) => {
190
- i && [i].flat().forEach((n) => {
191
- n && t(this, d).classList.remove(n);
192
- }), e && [e].flat().forEach((n) => {
193
- n && t(this, d).classList.add(n);
189
+ }, "#createClassList"), manageStringStoreClass_fn = /* @__PURE__ */ __name(function(store) {
190
+ __privateGet(this, _disconnectCallbacks).add(
191
+ store.subscribe(({ current, previous }) => {
192
+ previous && [previous].flat().forEach((v) => {
193
+ v && __privateGet(this, _node).classList.remove(v);
194
+ }), current && [current].flat().forEach((v) => {
195
+ v && __privateGet(this, _node).classList.add(v);
194
196
  });
195
197
  })
196
198
  );
197
- }, zt = function(s, e) {
198
- t(this, y).add(
199
- e.subscribe(({ current: i }) => {
200
- i ? t(this, d).classList.add(s) : t(this, d).classList.remove(s);
199
+ }, "#manageStringStoreClass"), manageBooleanStoreClass_fn = /* @__PURE__ */ __name(function(className, store) {
200
+ __privateGet(this, _disconnectCallbacks).add(
201
+ store.subscribe(({ current }) => {
202
+ current ? __privateGet(this, _node).classList.add(className) : __privateGet(this, _node).classList.remove(className);
201
203
  })
202
204
  );
203
- }, Mt = function(s) {
204
- if (!s)
205
+ }, "#manageBooleanStoreClass"), createStyle_fn = /* @__PURE__ */ __name(function(object) {
206
+ if (!object)
205
207
  return;
206
- t(this, d).tagName === "style" || t(this, d).tagName === "STYLE" ? l(this, a, et).call(this, s) : l(this, a, At).call(this, s);
207
- }, At = function(s) {
208
- for (const e in s) {
209
- const i = e, n = s[i];
210
- n instanceof $ ? t(this, y).add(
211
- n.subscribe(({ current: h }) => {
212
- l(this, a, tt).call(this, i, h);
208
+ __privateGet(this, _node).tagName === "style" || __privateGet(this, _node).tagName === "STYLE" ? __privateMethod(this, _ElementConstructor_instances, createJSSStyle_fn).call(this, object) : __privateMethod(this, _ElementConstructor_instances, createAttributeStyle_fn).call(this, object);
209
+ }, "#createStyle"), createAttributeStyle_fn = /* @__PURE__ */ __name(function(object) {
210
+ for (const k in object) {
211
+ const token = k, value = object[token];
212
+ value instanceof Store ? __privateGet(this, _disconnectCallbacks).add(
213
+ value.subscribe(({ current }) => {
214
+ __privateMethod(this, _ElementConstructor_instances, setStyleProperty_fn).call(this, token, current);
213
215
  })
214
- ) : l(this, a, tt).call(this, i, n);
215
- }
216
- }, et = function(s) {
217
- for (const e in s) {
218
- const i = s[e];
219
- if (typeof i == "object" && !(i instanceof $))
220
- t(this, d).appendChild(
221
- document.createTextNode(`${e} {`)
222
- ), l(this, a, et).call(this, i), t(this, d).appendChild(document.createTextNode("}"));
223
- else if (i instanceof $) {
224
- const n = document.createTextNode("");
225
- t(this, y).add(
226
- i.subscribe((h) => {
227
- h.current ? n.nodeValue = `${Oe(e)}: ${h.current};` : n.nodeValue = "";
216
+ ) : __privateMethod(this, _ElementConstructor_instances, setStyleProperty_fn).call(this, token, value);
217
+ }
218
+ }, "#createAttributeStyle"), createJSSStyle_fn = /* @__PURE__ */ __name(function(object) {
219
+ for (const key in object) {
220
+ const value = object[key];
221
+ if (typeof value == "object" && !(value instanceof Store))
222
+ __privateGet(this, _node).appendChild(
223
+ document.createTextNode(`${key} {`)
224
+ ), __privateMethod(this, _ElementConstructor_instances, createJSSStyle_fn).call(this, value), __privateGet(this, _node).appendChild(document.createTextNode("}"));
225
+ else if (value instanceof Store) {
226
+ const text = document.createTextNode("");
227
+ __privateGet(this, _disconnectCallbacks).add(
228
+ value.subscribe((e) => {
229
+ e.current ? text.nodeValue = `${camelToKebab(key)}: ${e.current};` : text.nodeValue = "";
228
230
  })
229
- ), t(this, d).appendChild(n);
231
+ ), __privateGet(this, _node).appendChild(text);
230
232
  } else
231
- t(this, d).appendChild(
232
- document.createTextNode(`${Oe(e)}: ${i};`)
233
+ __privateGet(this, _node).appendChild(
234
+ document.createTextNode(`${camelToKebab(key)}: ${value};`)
233
235
  );
234
236
  }
235
- }, tt = function(s, e) {
236
- s.includes("--") ? e ? t(this, d).style.setProperty(s, e.toString()) : t(this, d).style.removeProperty(s) : e ? t(this, d).style[s] = e.toString() : t(this, d).style[s] = "";
237
- }, Nt = function(s) {
238
- if (s) {
239
- t(this, D) || c(this, D, []);
240
- for (const e in s) {
241
- const i = e, n = jt(
242
- i.split("on").slice(1).join("on")
243
- ), h = s[i];
244
- typeof h == "object" ? t(this, D).push({
245
- name: n,
246
- callback: h.callback,
247
- options: h.options
248
- }) : typeof h == "function" && t(this, D).push({
249
- name: n,
250
- callback: h
237
+ }, "#createJSSStyle"), setStyleProperty_fn = /* @__PURE__ */ __name(function(token, value) {
238
+ token.includes("--") ? value ? __privateGet(this, _node).style.setProperty(token, value.toString()) : __privateGet(this, _node).style.removeProperty(token) : value ? __privateGet(this, _node).style[token] = value.toString() : __privateGet(this, _node).style[token] = "";
239
+ }, "#setStyleProperty"), createEvents_fn = /* @__PURE__ */ __name(function(events) {
240
+ if (events) {
241
+ __privateGet(this, _events) || __privateSet(this, _events, []);
242
+ for (const k in events) {
243
+ const eventName = k, readyEventName = uncapitalize(
244
+ eventName.split("on").slice(1).join("on")
245
+ ), listener = events[eventName];
246
+ typeof listener == "object" ? __privateGet(this, _events).push({
247
+ name: readyEventName,
248
+ callback: listener.callback,
249
+ options: listener.options
250
+ }) : typeof listener == "function" && __privateGet(this, _events).push({
251
+ name: readyEventName,
252
+ callback: listener
251
253
  });
252
254
  }
253
- l(this, a, st).call(this);
254
- }
255
- }, st = function() {
256
- var s;
257
- (s = t(this, D)) == null || s.forEach((e) => {
258
- t(this, d).addEventListener(
259
- e.name,
260
- e.callback,
261
- e.options
255
+ __privateMethod(this, _ElementConstructor_instances, attachEvents_fn).call(this);
256
+ }
257
+ }, "#createEvents"), attachEvents_fn = /* @__PURE__ */ __name(function() {
258
+ var _a;
259
+ (_a = __privateGet(this, _events)) == null || _a.forEach((event) => {
260
+ __privateGet(this, _node).addEventListener(
261
+ event.name,
262
+ event.callback,
263
+ event.options
262
264
  );
263
265
  });
264
- }, it = function() {
265
- var s;
266
- (s = t(this, D)) == null || s.forEach((e) => {
267
- t(this, d).removeEventListener(
268
- e.name,
269
- e.callback,
270
- e.options
266
+ }, "#attachEvents"), detachEvents_fn = /* @__PURE__ */ __name(function() {
267
+ var _a;
268
+ (_a = __privateGet(this, _events)) == null || _a.forEach((event) => {
269
+ __privateGet(this, _node).removeEventListener(
270
+ event.name,
271
+ event.callback,
272
+ event.options
271
273
  );
272
274
  });
273
- }, Rt = function(s) {
274
- for (const e in s) {
275
- const i = s[e];
276
- i instanceof $ ? t(this, y).add(
277
- i.subscribe(({ current: n }) => {
278
- l(this, a, nt).call(this, e, n);
275
+ }, "#detachEvents"), createAttributes_fn = /* @__PURE__ */ __name(function(attributes) {
276
+ for (const attributeName in attributes) {
277
+ const value = attributes[attributeName];
278
+ value instanceof Store ? __privateGet(this, _disconnectCallbacks).add(
279
+ value.subscribe(({ current }) => {
280
+ __privateMethod(this, _ElementConstructor_instances, setAttribute_fn).call(this, attributeName, current);
279
281
  })
280
- ) : l(this, a, nt).call(this, e, i);
281
- }
282
- }, nt = function(s, e) {
283
- var n, h;
284
- const i = t(this, d);
285
- if (s in i && !((h = (n = i.constructor) == null ? void 0 : n.observedAttributes) != null && h.includes(s)))
286
- e != null && (i[s] = e.toString());
287
- else if (e != null) {
288
- const u = e.toString();
289
- s.includes("xlink") ? i.setAttributeNS("http://www.w3.org/1999/xlink", s, u) : i.setAttribute(s, u);
290
- }
291
- }, Be = function(s, e) {
292
- e && (e = [e].flat(), e.forEach((i) => {
293
- if (i instanceof $) {
294
- const n = document.createElement("div");
295
- n.style.display = "contents", s.appendChild(n), t(this, H) || c(this, H, []);
296
- const h = t(this, H).length;
297
- n.setAttribute("store-root", ""), t(this, H).push(n), t(this, y).add(
298
- i.subscribe(({ current: u, previous: m }) => {
299
- const k = t(this, H)[h];
300
- k.dispatchEvent(
282
+ ) : __privateMethod(this, _ElementConstructor_instances, setAttribute_fn).call(this, attributeName, value);
283
+ }
284
+ }, "#createAttributes"), setAttribute_fn = /* @__PURE__ */ __name(function(name, value) {
285
+ var _a, _b;
286
+ const element2 = __privateGet(this, _node);
287
+ if (name in element2 && !((_b = (_a = element2.constructor) == null ? void 0 : _a.observedAttributes) != null && _b.includes(name)))
288
+ value != null && (element2[name] = value.toString());
289
+ else if (value != null) {
290
+ const str = value.toString();
291
+ name.includes("xlink") ? element2.setAttributeNS("http://www.w3.org/1999/xlink", name, str) : element2.setAttribute(name, str);
292
+ }
293
+ }, "#setAttribute"), createChildren_fn = /* @__PURE__ */ __name(function(root, children) {
294
+ children && (children = [children].flat(), children.forEach((child) => {
295
+ if (child instanceof Store) {
296
+ const storeRootElement = document.createElement("div");
297
+ storeRootElement.style.display = "contents", root.appendChild(storeRootElement), __privateGet(this, _storeRootElements) || __privateSet(this, _storeRootElements, []);
298
+ const storeRootElementIndex = __privateGet(this, _storeRootElements).length;
299
+ storeRootElement.setAttribute("store-root", ""), __privateGet(this, _storeRootElements).push(storeRootElement), __privateGet(this, _disconnectCallbacks).add(
300
+ child.subscribe(({ current, previous }) => {
301
+ const rootElement = __privateGet(this, _storeRootElements)[storeRootElementIndex];
302
+ rootElement.dispatchEvent(
301
303
  new CustomEvent("beforeChildrenChange", {
302
304
  bubbles: !0,
303
305
  composed: !0
304
306
  })
305
307
  );
306
- const L = Array.from(k.childNodes), v = Array.isArray(u) ? u : [u], ge = Array.isArray(m) ? m : [m], _e = [], x = [];
307
- L.length && ge.forEach((R, P) => {
308
- v.includes(R) ? x.push(R) : _e.push(L[P]);
309
- }), v.forEach((R, P) => {
310
- if (x[P] != null) {
311
- if (R !== x[P]) {
312
- const B = l(this, a, rt).call(this, R), q = L[P];
313
- B instanceof Node && !q.isEqualNode(B) ? k.replaceChild(B, q) : k.removeChild(q);
308
+ const currentNodes = Array.from(rootElement.childNodes), currentItems = Array.isArray(current) ? current : [current], previousItems = Array.isArray(previous) ? previous : [previous], nodesToDelete = [], similarPreviousItems = [];
309
+ currentNodes.length && previousItems.forEach((previousItem, index) => {
310
+ currentItems.includes(previousItem) ? similarPreviousItems.push(previousItem) : nodesToDelete.push(currentNodes[index]);
311
+ }), currentItems.forEach((currentItem, index) => {
312
+ if (similarPreviousItems[index] != null) {
313
+ if (currentItem !== similarPreviousItems[index]) {
314
+ const newNode = __privateMethod(this, _ElementConstructor_instances, getNode_fn).call(this, currentItem), currentNode = currentNodes[index];
315
+ newNode instanceof Node && !currentNode.isEqualNode(newNode) ? rootElement.replaceChild(newNode, currentNode) : rootElement.removeChild(currentNode);
314
316
  }
315
317
  } else {
316
- const B = l(this, a, rt).call(this, R);
317
- B instanceof Node && n.appendChild(B);
318
+ const newNode = __privateMethod(this, _ElementConstructor_instances, getNode_fn).call(this, currentItem);
319
+ newNode instanceof Node && storeRootElement.appendChild(newNode);
318
320
  }
319
- }), _e.forEach((R) => {
320
- k.removeChild(R);
321
- }), k.dispatchEvent(
321
+ }), nodesToDelete.forEach((node) => {
322
+ rootElement.removeChild(node);
323
+ }), rootElement.dispatchEvent(
322
324
  new CustomEvent("afterChildrenChange", {
323
325
  bubbles: !0,
324
326
  composed: !0
@@ -326,82 +328,93 @@ d = new WeakMap(), I = new WeakMap(), y = new WeakMap(), we = new WeakMap(), H =
326
328
  );
327
329
  })
328
330
  );
329
- } else if (i instanceof Je)
330
- l(this, a, ot).call(this, s, i.node);
331
- else if (i instanceof Function)
332
- l(this, a, Be).call(this, s, yt(i) ? new i() : i());
331
+ } else if (child instanceof _ElementConstructor)
332
+ __privateMethod(this, _ElementConstructor_instances, appendChild_fn).call(this, root, child.node);
333
+ else if (child instanceof Function)
334
+ __privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, root, isESClass(child) ? new child() : child());
333
335
  else {
334
- const n = l(this, a, at).call(this, i);
335
- n instanceof Node && l(this, a, ot).call(this, s, n);
336
+ const childNodeOrUndefined = __privateMethod(this, _ElementConstructor_instances, getOrCreateNode_fn).call(this, child);
337
+ childNodeOrUndefined instanceof Node && __privateMethod(this, _ElementConstructor_instances, appendChild_fn).call(this, root, childNodeOrUndefined);
336
338
  }
337
339
  }));
338
- }, ot = function(s, e) {
339
- !(s instanceof ShadowRoot) && e instanceof HTMLElement && e.tagName === "STYLE" ? (t(this, I).add(() => {
340
- [...document.head.querySelectorAll("style")].find((n) => n.outerHTML === e.outerHTML) || document.head.appendChild(e);
341
- }), t(this, y).add(() => {
342
- e.remove();
343
- })) : s.appendChild(e);
344
- }, rt = function(s) {
345
- return s instanceof Je ? s.node : typeof s == "function" ? yt(s) ? new s() : s() : l(this, a, at).call(this, s);
346
- }, at = function(s) {
347
- if (s instanceof Node)
348
- return s;
349
- if (s != null) {
350
- const e = String(s);
351
- if (e.trim().startsWith("<") && e.trim().endsWith(">")) {
352
- const i = document.createElement("div");
353
- return i.innerHTML = e, i.firstElementChild;
340
+ }, "#createChildren"), appendChild_fn = /* @__PURE__ */ __name(function(root, node) {
341
+ !(root instanceof ShadowRoot) && node instanceof HTMLElement && node.tagName === "STYLE" ? (__privateGet(this, _connectCallbacks).add(() => {
342
+ [...document.head.querySelectorAll("style")].find((s) => s.outerHTML === node.outerHTML) || document.head.appendChild(node);
343
+ }), __privateGet(this, _disconnectCallbacks).add(() => {
344
+ node.remove();
345
+ })) : root.appendChild(node);
346
+ }, "#appendChild"), getNode_fn = /* @__PURE__ */ __name(function(child) {
347
+ return child instanceof _ElementConstructor ? child.node : typeof child == "function" ? isESClass(child) ? new child() : child() : __privateMethod(this, _ElementConstructor_instances, getOrCreateNode_fn).call(this, child);
348
+ }, "#getNode"), getOrCreateNode_fn = /* @__PURE__ */ __name(function(child) {
349
+ if (child instanceof Node)
350
+ return child;
351
+ if (child != null) {
352
+ const str = String(child);
353
+ if (str.trim().startsWith("<") && str.trim().endsWith(">")) {
354
+ const wrapper = document.createElement("div");
355
+ return wrapper.innerHTML = str, wrapper.firstElementChild;
354
356
  } else
355
- return document.createTextNode(e);
357
+ return document.createTextNode(str);
356
358
  } else
357
359
  return;
358
- }, We = new WeakMap(), qe = new WeakMap();
359
- let N = Je;
360
- function g(...r) {
361
- return new N(...r);
360
+ }, "#getOrCreateNode"), _connect = new WeakMap(), _disconnect = new WeakMap(), __name(_ElementConstructor, "ElementConstructor");
361
+ let ElementConstructor = _ElementConstructor;
362
+ function element(...args) {
363
+ return new ElementConstructor(...args);
362
364
  }
363
- function os(r) {
364
- return new N("a", r);
365
+ __name(element, "element");
366
+ function a(object2) {
367
+ return new ElementConstructor("a", object2);
365
368
  }
366
- function ee(r) {
367
- return new N("button", r);
369
+ __name(a, "a");
370
+ function button(object2) {
371
+ return new ElementConstructor("button", object2);
368
372
  }
369
- function w(r) {
370
- return new N("div", r);
373
+ __name(button, "button");
374
+ function div(object2) {
375
+ return new ElementConstructor("div", object2);
371
376
  }
372
- function Ve(r) {
373
- return new N("input", r);
377
+ __name(div, "div");
378
+ function input(object2) {
379
+ return new ElementConstructor("input", object2);
374
380
  }
375
- function Ft(r) {
376
- return new N("label", r);
381
+ __name(input, "input");
382
+ function label(object2) {
383
+ return new ElementConstructor("label", object2);
377
384
  }
378
- function me(r) {
379
- return new N("slot", r);
385
+ __name(label, "label");
386
+ function slot(object2) {
387
+ return new ElementConstructor("slot", object2);
380
388
  }
381
- function lt(r) {
382
- return new N("span", r);
389
+ __name(slot, "slot");
390
+ function span(object2) {
391
+ return new ElementConstructor("span", object2);
383
392
  }
384
- function Pt(r) {
385
- return new N("style", {
386
- style: r
393
+ __name(span, "span");
394
+ function style(object2) {
395
+ return new ElementConstructor("style", {
396
+ style: object2
387
397
  });
388
398
  }
389
- function E(r) {
390
- const s = new CSSStyleSheet();
391
- return s.replaceSync(Pt(r).node.innerHTML), s;
399
+ __name(style, "style");
400
+ function createStylesheet(object) {
401
+ const sheet = new CSSStyleSheet();
402
+ return sheet.replaceSync(style(object).node.innerHTML), sheet;
392
403
  }
393
- function rs(r, s) {
394
- const e = s == null ? void 0 : s.prefix, i = {
404
+ __name(createStylesheet, "createStylesheet");
405
+ function createTheme(object, options) {
406
+ const prefix = options == null ? void 0 : options.prefix, result = {
395
407
  style: {}
396
408
  };
397
- for (const n in r)
398
- i[n] = {
399
- var: `var(--${e}${Oe(n)})`,
400
- value: r[n]
401
- }, i.style[`--${e}${Oe(n)}`] = r[n];
402
- return i;
409
+ for (const key in object)
410
+ result[key] = {
411
+ var: `var(--${prefix}${camelToKebab(key)})`,
412
+ value: object[key]
413
+ }, result.style[`--${prefix}${camelToKebab(key)}`] = object[key];
414
+ return result;
403
415
  }
404
- const f = rs(
416
+ __name(createTheme, "createTheme");
417
+ const aptechkaTheme = createTheme(
405
418
  {
406
419
  colorMain: "#1c1c1c",
407
420
  colorMainAux: "#282828",
@@ -412,13 +425,13 @@ const f = rs(
412
425
  },
413
426
  { prefix: "aptechka-" }
414
427
  );
415
- if (p) {
416
- const r = Pt({
417
- ":root": f.style
428
+ if (isBrowser) {
429
+ const styleNode = style({
430
+ ":root": aptechkaTheme.style
418
431
  }).node;
419
- r.setAttribute("data-permanent", ""), document.head.appendChild(r);
432
+ styleNode.setAttribute("data-permanent", ""), document.head.appendChild(styleNode);
420
433
  }
421
- const $t = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>', It = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>', as = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>', ls = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>', Ht = `<svg
434
+ const resetIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>', copyIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>', downloadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>', uploadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>', arrowIcon = `<svg
422
435
  xmlns="http://www.w3.org/2000/svg"
423
436
  width="32"
424
437
  height="32"
@@ -427,57 +440,58 @@ const $t = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewB
427
440
  <path d="m12.37 15.835l6.43-6.63C19.201 8.79 18.958 8 18.43 8H5.57c-.528 0-.771.79-.37 1.205l6.43 6.63c.213.22.527.22.74 0Z" />
428
441
  </svg>
429
442
  `;
430
- var J, T, V;
431
- class hs {
443
+ var _localStorageStudioName, _openedPanels, _changedSizes;
444
+ const _TweakerStorage = class _TweakerStorage {
432
445
  constructor() {
433
- o(this, J);
434
- o(this, T);
435
- o(this, V);
436
- this.scrollValue = 0, c(this, J, ""), c(this, T, []), c(this, V, {}), c(this, J, K.name + "-tweaker");
446
+ __privateAdd(this, _localStorageStudioName);
447
+ __privateAdd(this, _openedPanels);
448
+ __privateAdd(this, _changedSizes);
449
+ this.scrollValue = 0, __privateSet(this, _localStorageStudioName, ""), __privateSet(this, _openedPanels, []), __privateSet(this, _changedSizes, {}), __privateSet(this, _localStorageStudioName, storeRegistry.name + "-tweaker");
437
450
  }
438
- openPanel(s) {
439
- t(this, T).includes(s) || t(this, T).push(s);
451
+ openPanel(key) {
452
+ __privateGet(this, _openedPanels).includes(key) || __privateGet(this, _openedPanels).push(key);
440
453
  }
441
- closePanel(s) {
442
- c(this, T, t(this, T).filter((e) => e !== s));
454
+ closePanel(key) {
455
+ __privateSet(this, _openedPanels, __privateGet(this, _openedPanels).filter((v) => v !== key));
443
456
  }
444
- isPanelOpened(s) {
445
- return t(this, T).includes(s);
457
+ isPanelOpened(key) {
458
+ return __privateGet(this, _openedPanels).includes(key);
446
459
  }
447
- changedSizes(s) {
448
- return t(this, V)[s];
460
+ changedSizes(key) {
461
+ return __privateGet(this, _changedSizes)[key];
449
462
  }
450
- changeSize(s, e) {
451
- e ? t(this, V)[s] = e : delete t(this, V)[s];
463
+ changeSize(key, value) {
464
+ value ? __privateGet(this, _changedSizes)[key] = value : delete __privateGet(this, _changedSizes)[key];
452
465
  }
453
466
  save() {
454
- const s = {
455
- openedPanels: t(this, T),
456
- changedSizes: t(this, V),
467
+ const state = {
468
+ openedPanels: __privateGet(this, _openedPanels),
469
+ changedSizes: __privateGet(this, _changedSizes),
457
470
  scrollValue: this.scrollValue
458
471
  };
459
- localStorage.setItem(t(this, J), JSON.stringify(s)), K.saveState();
472
+ localStorage.setItem(__privateGet(this, _localStorageStudioName), JSON.stringify(state)), storeRegistry.saveState();
460
473
  }
461
474
  load() {
462
- K.loadState();
463
- const s = localStorage.getItem(t(this, J));
464
- if (s)
475
+ storeRegistry.loadState();
476
+ const stringState = localStorage.getItem(__privateGet(this, _localStorageStudioName));
477
+ if (stringState)
465
478
  try {
466
- const e = JSON.parse(s);
467
- e.openedPanels && c(this, T, e.openedPanels), e.changedSizes && c(this, V, e.changedSizes), e.scrollValue && (this.scrollValue = e.scrollValue);
479
+ const state = JSON.parse(stringState);
480
+ state.openedPanels && __privateSet(this, _openedPanels, state.openedPanels), state.changedSizes && __privateSet(this, _changedSizes, state.changedSizes), state.scrollValue && (this.scrollValue = state.scrollValue);
468
481
  } catch (e) {
469
482
  console.error(e);
470
483
  }
471
484
  }
472
- }
473
- J = new WeakMap(), T = new WeakMap(), V = new WeakMap();
474
- const C = new hs(), cs = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path d="m243.33 90.91l-128.41 128.4a16 16 0 0 1-22.63 0l-71.62-72a16 16 0 0 1 0-22.61l24-24a16 16 0 0 1 22.57-.06l36.64 35.27l.11.11l92.73-91.37a16 16 0 0 1 22.58 0l24 23.56a16 16 0 0 1 .03 22.7Z"/></svg>', ds = E({
485
+ };
486
+ _localStorageStudioName = new WeakMap(), _openedPanels = new WeakMap(), _changedSizes = new WeakMap(), __name(_TweakerStorage, "TweakerStorage");
487
+ let TweakerStorage = _TweakerStorage;
488
+ const tweakerStorage = new TweakerStorage(), checkIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path d="m243.33 90.91l-128.41 128.4a16 16 0 0 1-22.63 0l-71.62-72a16 16 0 0 1 0-22.61l24-24a16 16 0 0 1 22.57-.06l36.64 35.27l.11.11l92.73-91.37a16 16 0 0 1 22.58 0l24 23.56a16 16 0 0 1 .03 22.7Z"/></svg>', stylesheet$c = createStylesheet({
475
489
  ":host": {
476
490
  position: "relative",
477
491
  display: "inline-block",
478
492
  width: "30px",
479
493
  height: "30px",
480
- borderRadius: f.borderRadiusSmall.var,
494
+ borderRadius: aptechkaTheme.borderRadiusSmall.var,
481
495
  overflow: "hidden"
482
496
  },
483
497
  "label, .fake": {
@@ -500,12 +514,12 @@ const C = new hs(), cs = '<svg xmlns="http://www.w3.org/2000/svg" width="32" hei
500
514
  display: "flex",
501
515
  alignItems: "center",
502
516
  justifyContent: "center",
503
- backgroundColor: f.colorMainAux.var
517
+ backgroundColor: aptechkaTheme.colorMainAux.var
504
518
  },
505
519
  ".default svg": {
506
520
  width: "60%",
507
521
  height: "60%",
508
- fill: f.colorFont.var,
522
+ fill: aptechkaTheme.colorFont.var,
509
523
  opacity: 0,
510
524
  transition: "var(--duration-short)"
511
525
  },
@@ -513,88 +527,89 @@ const C = new hs(), cs = '<svg xmlns="http://www.w3.org/2000/svg" width="32" hei
513
527
  opacity: 1
514
528
  }
515
529
  });
516
- var O, te, Y, be;
517
- const gt = class gt extends HTMLElement {
530
+ var _inputElement, _internals, _CheckboxElement_instances, setFormValue_fn;
531
+ const _CheckboxElement = class _CheckboxElement extends HTMLElement {
518
532
  constructor() {
519
533
  super();
520
- o(this, Y);
521
- o(this, O, null);
522
- o(this, te);
523
- const e = this.attachShadow({ mode: "open" });
524
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ds], c(this, te, this.attachInternals()), g(this, {
525
- children: Ft({
534
+ __privateAdd(this, _CheckboxElement_instances);
535
+ __privateAdd(this, _inputElement, null);
536
+ __privateAdd(this, _internals);
537
+ const shadow = this.attachShadow({ mode: "open" });
538
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$c], __privateSet(this, _internals, this.attachInternals()), element(this, {
539
+ children: label({
526
540
  children: [
527
- lt({
541
+ span({
528
542
  class: "fake",
529
- children: me({
543
+ children: slot({
530
544
  children: [
531
- lt({
545
+ span({
532
546
  class: "default",
533
- children: [cs]
547
+ children: [checkIcon]
534
548
  })
535
549
  ]
536
550
  })
537
551
  }),
538
- Ve({
539
- ref: (i) => {
540
- c(this, O, i), i.required = this.hasAttribute("required"), i.value = this.getAttribute("value") || "", i.checked = this.hasAttribute("checked"), i.name = this.getAttribute("name") || "", l(this, Y, be).call(this);
541
- },
552
+ input({
553
+ ref: /* @__PURE__ */ __name((e) => {
554
+ __privateSet(this, _inputElement, e), e.required = this.hasAttribute("required"), e.value = this.getAttribute("value") || "", e.checked = this.hasAttribute("checked"), e.name = this.getAttribute("name") || "", __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
555
+ }, "ref"),
542
556
  class: "real",
543
557
  type: "checkbox",
544
- onChange: () => {
545
- l(this, Y, be).call(this), this.dispatchEvent(
558
+ onChange: /* @__PURE__ */ __name(() => {
559
+ __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this), this.dispatchEvent(
546
560
  new Event("change", {
547
561
  composed: !0
548
562
  })
549
563
  );
550
- }
564
+ }, "onChange")
551
565
  })
552
566
  ]
553
567
  })
554
568
  });
555
569
  }
556
570
  get checked() {
557
- return t(this, O).checked;
571
+ return __privateGet(this, _inputElement).checked;
558
572
  }
559
- set checked(e) {
560
- t(this, O).checked = e, l(this, Y, be).call(this);
573
+ set checked(state) {
574
+ __privateGet(this, _inputElement).checked = state, __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
561
575
  }
562
576
  get value() {
563
- return t(this, O).value;
577
+ return __privateGet(this, _inputElement).value;
564
578
  }
565
- set value(e) {
566
- t(this, O).value = e, l(this, Y, be).call(this);
579
+ set value(value) {
580
+ __privateGet(this, _inputElement).value = value, __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
567
581
  }
568
582
  };
569
- O = new WeakMap(), te = new WeakMap(), Y = new WeakSet(), be = function() {
570
- this.checked ? t(this, te).setFormValue(this.value) : t(this, te).setFormValue(null), this.classList.toggle("checked", this.checked);
571
- }, gt.formAssociated = !0;
572
- let ht = gt;
573
- p && !customElements.get("e-checkbox") && customElements.define("e-checkbox", ht);
574
- var Z;
575
- class pe extends HTMLElement {
576
- constructor(...e) {
583
+ _inputElement = new WeakMap(), _internals = new WeakMap(), _CheckboxElement_instances = new WeakSet(), setFormValue_fn = /* @__PURE__ */ __name(function() {
584
+ this.checked ? __privateGet(this, _internals).setFormValue(this.value) : __privateGet(this, _internals).setFormValue(null), this.classList.toggle("checked", this.checked);
585
+ }, "#setFormValue"), __name(_CheckboxElement, "CheckboxElement"), _CheckboxElement.formAssociated = !0;
586
+ let CheckboxElement = _CheckboxElement;
587
+ isBrowser && !customElements.get("e-checkbox") && customElements.define("e-checkbox", CheckboxElement);
588
+ var _stores;
589
+ const _TweakerStoreManagerElement = class _TweakerStoreManagerElement extends HTMLElement {
590
+ constructor(...stores) {
577
591
  super();
578
- o(this, Z);
579
- c(this, Z, e);
592
+ __privateAdd(this, _stores);
593
+ __privateSet(this, _stores, stores);
580
594
  }
581
- addStore(e) {
582
- t(this, Z).push(e);
595
+ addStore(store) {
596
+ __privateGet(this, _stores).push(store);
583
597
  }
584
598
  get firstStore() {
585
- return t(this, Z)[0];
599
+ return __privateGet(this, _stores)[0];
586
600
  }
587
601
  get stores() {
588
- return t(this, Z);
602
+ return __privateGet(this, _stores);
589
603
  }
590
- updateStores(e) {
591
- t(this, Z).forEach((i) => {
592
- i.current = e;
604
+ updateStores(value) {
605
+ __privateGet(this, _stores).forEach((store) => {
606
+ store.current = value;
593
607
  });
594
608
  }
595
- }
596
- Z = new WeakMap();
597
- const us = E({
609
+ };
610
+ _stores = new WeakMap(), __name(_TweakerStoreManagerElement, "TweakerStoreManagerElement");
611
+ let TweakerStoreManagerElement = _TweakerStoreManagerElement;
612
+ const stylesheet$b = createStylesheet({
598
613
  ":host": {
599
614
  width: "100%",
600
615
  display: "inline-flex",
@@ -604,34 +619,35 @@ const us = E({
604
619
  "--size": "calc(var(--height-input) * 0.8)",
605
620
  width: "var(--size)",
606
621
  height: "var(--size)",
607
- borderRadius: f.borderRadiusSmall.var
622
+ borderRadius: aptechkaTheme.borderRadiusSmall.var
608
623
  }
609
- });
610
- class Dt extends pe {
611
- constructor(...s) {
612
- super(...s);
613
- const e = this.attachShadow({ mode: "open" });
614
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, us], g(this, {
624
+ }), _TweakerBooleanManagerElement = class _TweakerBooleanManagerElement extends TweakerStoreManagerElement {
625
+ constructor(...stores) {
626
+ super(...stores);
627
+ const shadow = this.attachShadow({ mode: "open" });
628
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$b], element(this, {
615
629
  children: [
616
- g("e-checkbox", {
617
- onChange: (i) => {
618
- this.updateStores(i.currentTarget.checked);
619
- },
620
- ref: (i) => {
621
- this.firstStore.subscribe((n) => {
622
- i.checked = n.current;
630
+ element("e-checkbox", {
631
+ onChange: /* @__PURE__ */ __name((e) => {
632
+ this.updateStores(e.currentTarget.checked);
633
+ }, "onChange"),
634
+ ref: /* @__PURE__ */ __name((e) => {
635
+ this.firstStore.subscribe((d) => {
636
+ e.checked = d.current;
623
637
  });
624
- }
638
+ }, "ref")
625
639
  })
626
640
  ]
627
641
  });
628
642
  }
629
- }
630
- p && !customElements.get("e-tweaker-boolean-manager") && customElements.define(
643
+ };
644
+ __name(_TweakerBooleanManagerElement, "TweakerBooleanManagerElement");
645
+ let TweakerBooleanManagerElement = _TweakerBooleanManagerElement;
646
+ isBrowser && !customElements.get("e-tweaker-boolean-manager") && customElements.define(
631
647
  "e-tweaker-boolean-manager",
632
- Dt
648
+ TweakerBooleanManagerElement
633
649
  );
634
- const fs = E({
650
+ const stylesheet$a = createStylesheet({
635
651
  ":host": {
636
652
  width: "100%",
637
653
  display: "inline-flex",
@@ -642,7 +658,7 @@ const fs = E({
642
658
  height: "var(--height-input)",
643
659
  padding: "0",
644
660
  background: "none",
645
- borderRadius: f.borderRadius.var,
661
+ borderRadius: aptechkaTheme.borderRadius.var,
646
662
  border: "none",
647
663
  blockSize: "unset"
648
664
  },
@@ -650,52 +666,54 @@ const fs = E({
650
666
  boxSizing: "border-box",
651
667
  padding: "0px",
652
668
  border: "none",
653
- borderRadius: f.borderRadius.var,
669
+ borderRadius: aptechkaTheme.borderRadius.var,
654
670
  height: "calc(var(--height-input) * 0.93)"
655
671
  }
656
- });
657
- class Vt extends pe {
658
- constructor(...s) {
659
- super(...s);
660
- const e = this.attachShadow({ mode: "open" });
661
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, fs], g(this, {
672
+ }), _TweakerColorManagerElement = class _TweakerColorManagerElement extends TweakerStoreManagerElement {
673
+ constructor(...stores) {
674
+ super(...stores);
675
+ const shadow = this.attachShadow({ mode: "open" });
676
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$a], element(this, {
662
677
  children: [
663
- Ve({
678
+ input({
664
679
  type: "color",
665
680
  value: this.firstStore,
666
- onInput: (i) => {
667
- this.updateStores(i.currentTarget.value);
668
- }
681
+ onInput: /* @__PURE__ */ __name((e) => {
682
+ this.updateStores(e.currentTarget.value);
683
+ }, "onInput")
669
684
  })
670
685
  ]
671
686
  });
672
687
  }
673
- }
674
- p && !customElements.get("e-tweaker-color-manager") && customElements.define("e-tweaker-color-manager", Vt);
675
- const ms = E({
688
+ };
689
+ __name(_TweakerColorManagerElement, "TweakerColorManagerElement");
690
+ let TweakerColorManagerElement = _TweakerColorManagerElement;
691
+ isBrowser && !customElements.get("e-tweaker-color-manager") && customElements.define("e-tweaker-color-manager", TweakerColorManagerElement);
692
+ const stylesheet$9 = createStylesheet({
676
693
  a: {
677
694
  color: "inherit",
678
695
  fontSize: "var(--font-size-small)"
679
696
  }
680
- });
681
- class _t extends pe {
682
- constructor(...s) {
683
- var i;
684
- super(...s);
685
- const e = this.attachShadow({ mode: "open" });
686
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ms], g(this, {
697
+ }), _TweakerLinkManagerElement = class _TweakerLinkManagerElement extends TweakerStoreManagerElement {
698
+ constructor(...stores) {
699
+ var _a;
700
+ super(...stores);
701
+ const shadow = this.attachShadow({ mode: "open" });
702
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$9], element(this, {
687
703
  children: [
688
- os({
704
+ a({
689
705
  href: this.firstStore,
690
- target: (i = this.firstStore.__manager) != null && i.sameWindow ? "_self" : "_blank",
706
+ target: (_a = this.firstStore.__manager) != null && _a.sameWindow ? "_self" : "_blank",
691
707
  children: this.firstStore
692
708
  })
693
709
  ]
694
710
  });
695
711
  }
696
- }
697
- p && !customElements.get("e-tweaker-link-manager") && customElements.define("e-tweaker-link-manager", _t);
698
- const ps = E({
712
+ };
713
+ __name(_TweakerLinkManagerElement, "TweakerLinkManagerElement");
714
+ let TweakerLinkManagerElement = _TweakerLinkManagerElement;
715
+ isBrowser && !customElements.get("e-tweaker-link-manager") && customElements.define("e-tweaker-link-manager", TweakerLinkManagerElement);
716
+ const stylesheet$8 = createStylesheet({
699
717
  ":host": {
700
718
  width: "100%",
701
719
  display: "flex",
@@ -720,7 +738,7 @@ const ps = E({
720
738
  margin: "0",
721
739
  padding: "0 var(--gap-small)",
722
740
  backgroundColor: "rgba(255, 255, 255, 0.1)",
723
- borderRadius: f.borderRadius.var
741
+ borderRadius: aptechkaTheme.borderRadius.var
724
742
  },
725
743
  ".drag": {
726
744
  position: "relative",
@@ -736,12 +754,12 @@ const ps = E({
736
754
  width: "100%",
737
755
  zIndex: "-1",
738
756
  height: "1px",
739
- borderBottom: `1px solid ${f.colorFont.var}`,
757
+ borderBottom: `1px solid ${aptechkaTheme.colorFont.var}`,
740
758
  transform: "translateY(-50%)",
741
759
  opacity: "0.3"
742
760
  },
743
761
  ":host(.infinite) .drag::before": {
744
- borderBottom: `1px dashed ${f.colorFont.var}`
762
+ borderBottom: `1px dashed ${aptechkaTheme.colorFont.var}`
745
763
  },
746
764
  ".drag-knob": {
747
765
  "--size": "calc(var(--height-input) * 0.4)",
@@ -751,96 +769,96 @@ const ps = E({
751
769
  ".drag-knob-inner": {
752
770
  width: "100%",
753
771
  height: "100%",
754
- backgroundColor: f.colorFont.var,
755
- borderRadius: f.borderRadiusSmall.var,
772
+ backgroundColor: aptechkaTheme.colorFont.var,
773
+ borderRadius: aptechkaTheme.borderRadiusSmall.var,
756
774
  transition: "opacity var(--duration-short)"
757
775
  },
758
776
  ":host(.infinite) .grabbing .drag-knob-inner": {
759
777
  opacity: 0.3
760
778
  }
761
779
  });
762
- var G, se, ie, _, W, ve, ye, F, U, Se, ke, b, Q, ct, dt, Ke, Ee;
763
- class Bt extends pe {
764
- constructor(...e) {
765
- var n, h, u, m;
766
- super(...e);
767
- o(this, b);
768
- o(this, G, []);
769
- o(this, se, []);
770
- o(this, ie);
771
- o(this, _);
772
- o(this, W);
773
- o(this, ve);
774
- o(this, ye);
775
- o(this, F);
776
- o(this, U, !1);
777
- o(this, Se, (e) => {
778
- const i = l(this, b, Q).call(this, e);
779
- return i.map((n, h) => {
780
- const u = typeof n == "string" ? parseFloat(n) || t(this, _) : n, m = ts(u, t(this, _), t(this, W)), k = ss(m, t(this, ie));
781
- i[h] = k;
782
- }), t(this, ye) === "number" ? i[0] : i;
783
- });
784
- o(this, ke, () => {
785
- l(this, b, Q).call(this).map((e, i) => {
786
- const n = t(this, G)[i];
787
- n && (n.value = (e || 0).toString());
788
- }), l(this, b, ct).call(this);
789
- });
790
- o(this, Ee, () => {
791
- l(this, b, ct).call(this);
792
- });
793
- const i = this.attachShadow({ mode: "open" });
794
- i.adoptedStyleSheets = [...i.adoptedStyleSheets, ps], c(this, _, St((n = this.firstStore.__manager) == null ? void 0 : n.min, -1 / 0)), c(this, W, St((h = this.firstStore.__manager) == null ? void 0 : h.max, 1 / 0)), c(this, ie, ((u = this.firstStore.__manager) == null ? void 0 : u.step) || 0.01), c(this, ve, ((m = this.firstStore.__manager) == null ? void 0 : m.ease) || 1), c(this, ye, Array.isArray(this.firstStore.current) ? "array" : "number"), c(this, F, isFinite(t(this, W)) && isFinite(t(this, _))), g(this, {
795
- class: t(this, F) ? "" : "infinite",
796
- children: l(this, b, Q).call(this).map((k, L) => w({
780
+ var _inputElements, _knobElements, _step, _min, _max, _ease, _type, _isFinite, _isDragging, _storeMiddleware, _storeChangeListener, _TweakerNumberManagerElement_instances, getArray_fn, updateKnobPositions_fn, getDistance_fn, getKnobPosition_fn, _resizeListener;
781
+ const _TweakerNumberManagerElement = class _TweakerNumberManagerElement extends TweakerStoreManagerElement {
782
+ constructor(...stores) {
783
+ var _a, _b, _c, _d;
784
+ super(...stores);
785
+ __privateAdd(this, _TweakerNumberManagerElement_instances);
786
+ __privateAdd(this, _inputElements, []);
787
+ __privateAdd(this, _knobElements, []);
788
+ __privateAdd(this, _step);
789
+ __privateAdd(this, _min);
790
+ __privateAdd(this, _max);
791
+ __privateAdd(this, _ease);
792
+ __privateAdd(this, _type);
793
+ __privateAdd(this, _isFinite);
794
+ __privateAdd(this, _isDragging, !1);
795
+ __privateAdd(this, _storeMiddleware, /* @__PURE__ */ __name((value) => {
796
+ const arr = __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this, value);
797
+ return arr.map((v, i) => {
798
+ const number = typeof v == "string" ? parseFloat(v) || __privateGet(this, _min) : v, clamped = clamp(number, __privateGet(this, _min), __privateGet(this, _max)), fixed = toStep(clamped, __privateGet(this, _step));
799
+ arr[i] = fixed;
800
+ }), __privateGet(this, _type) === "number" ? arr[0] : arr;
801
+ }, "#storeMiddleware"));
802
+ __privateAdd(this, _storeChangeListener, /* @__PURE__ */ __name(() => {
803
+ __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => {
804
+ const inputElement = __privateGet(this, _inputElements)[i];
805
+ inputElement && (inputElement.value = (v || 0).toString());
806
+ }), __privateMethod(this, _TweakerNumberManagerElement_instances, updateKnobPositions_fn).call(this);
807
+ }, "#storeChangeListener"));
808
+ __privateAdd(this, _resizeListener, /* @__PURE__ */ __name(() => {
809
+ __privateMethod(this, _TweakerNumberManagerElement_instances, updateKnobPositions_fn).call(this);
810
+ }, "#resizeListener"));
811
+ const shadow = this.attachShadow({ mode: "open" });
812
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$8], __privateSet(this, _min, nullishCoalescing((_a = this.firstStore.__manager) == null ? void 0 : _a.min, -1 / 0)), __privateSet(this, _max, nullishCoalescing((_b = this.firstStore.__manager) == null ? void 0 : _b.max, 1 / 0)), __privateSet(this, _step, ((_c = this.firstStore.__manager) == null ? void 0 : _c.step) || 0.01), __privateSet(this, _ease, ((_d = this.firstStore.__manager) == null ? void 0 : _d.ease) || 1), __privateSet(this, _type, Array.isArray(this.firstStore.current) ? "array" : "number"), __privateSet(this, _isFinite, isFinite(__privateGet(this, _max)) && isFinite(__privateGet(this, _min))), element(this, {
813
+ class: __privateGet(this, _isFinite) ? "" : "infinite",
814
+ children: __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => div({
797
815
  class: "inputs-wrapper",
798
816
  children: [
799
- Ve({
817
+ input({
800
818
  type: "number",
801
- step: t(this, ie),
802
- min: t(this, _),
803
- max: t(this, W),
804
- ref: (v) => t(this, G).push(v),
805
- value: k,
806
- onChange: () => {
819
+ step: __privateGet(this, _step),
820
+ min: __privateGet(this, _min),
821
+ max: __privateGet(this, _max),
822
+ ref: /* @__PURE__ */ __name((e) => __privateGet(this, _inputElements).push(e), "ref"),
823
+ value: v,
824
+ onChange: /* @__PURE__ */ __name(() => {
807
825
  this.updateStores(
808
- t(this, G).map((v) => parseFloat(v.value))
826
+ __privateGet(this, _inputElements).map((el) => parseFloat(el.value))
809
827
  );
810
- }
828
+ }, "onChange")
811
829
  }),
812
- w({
830
+ div({
813
831
  class: "drag",
814
832
  children: [
815
- w({
833
+ div({
816
834
  class: "drag-knob",
817
- ref: (v) => t(this, se).push(v),
818
- onPointerdown: (v) => {
819
- v.preventDefault(), c(this, U, !0);
820
- const ge = l(this, b, Q).call(this), _e = ge[L], x = t(this, se)[L], R = t(this, G)[L];
821
- if (x && R) {
822
- const P = x.parentElement, B = l(this, b, dt).call(this);
823
- P.classList.add("grabbing"), Et(
824
- (q) => {
825
- const wt = q.x - v.x, Jt = t(this, F) ? P.offsetWidth / (B || 1) : 1, Yt = _e + wt / Jt * t(this, ve);
826
- if (ge[L] = Yt, !t(this, F)) {
827
- const Gt = l(this, b, Ke).call(this, x, 0);
828
- x.style.transform = `translateX(${Gt + wt}px)`;
835
+ ref: /* @__PURE__ */ __name((e) => __privateGet(this, _knobElements).push(e), "ref"),
836
+ onPointerdown: /* @__PURE__ */ __name((grabEvent) => {
837
+ grabEvent.preventDefault(), __privateSet(this, _isDragging, !0);
838
+ const arr = __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this), startValue = arr[i], knobElement = __privateGet(this, _knobElements)[i], inputElement = __privateGet(this, _inputElements)[i];
839
+ if (knobElement && inputElement) {
840
+ const knobParentElement = knobElement.parentElement, distance = __privateMethod(this, _TweakerNumberManagerElement_instances, getDistance_fn).call(this);
841
+ knobParentElement.classList.add("grabbing"), setupDrag(
842
+ (moveEvent) => {
843
+ const delta = moveEvent.x - grabEvent.x, del = __privateGet(this, _isFinite) ? knobParentElement.offsetWidth / (distance || 1) : 1, newValue = startValue + delta / del * __privateGet(this, _ease);
844
+ if (arr[i] = newValue, !__privateGet(this, _isFinite)) {
845
+ const pos = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, 0);
846
+ knobElement.style.transform = `translateX(${pos + delta}px)`;
829
847
  }
830
- this.updateStores([...ge]);
848
+ this.updateStores([...arr]);
831
849
  },
832
850
  () => {
833
- if (c(this, U, !1), !t(this, F)) {
834
- const q = l(this, b, Ke).call(this, x, 0);
835
- x.style.transition = "transform 0.1s", x.style.transform = `translateX(${q}px)`, P.classList.remove("grabbing"), setTimeout(() => {
836
- x.style.transition = "";
851
+ if (__privateSet(this, _isDragging, !1), !__privateGet(this, _isFinite)) {
852
+ const pos = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, 0);
853
+ knobElement.style.transition = "transform 0.1s", knobElement.style.transform = `translateX(${pos}px)`, knobParentElement.classList.remove("grabbing"), setTimeout(() => {
854
+ knobElement.style.transition = "";
837
855
  }, 100);
838
856
  }
839
857
  }
840
858
  );
841
859
  }
842
- },
843
- children: w({
860
+ }, "onPointerdown"),
861
+ children: div({
844
862
  class: "drag-knob-inner"
845
863
  })
846
864
  })
@@ -851,46 +869,49 @@ class Bt extends pe {
851
869
  });
852
870
  }
853
871
  connectedCallback() {
854
- this.firstStore.addMiddleware(t(this, Se)), this.firstStore.subscribe(t(this, ke)), kt.subscribe(this, t(this, Ee));
872
+ this.firstStore.addMiddleware(__privateGet(this, _storeMiddleware)), this.firstStore.subscribe(__privateGet(this, _storeChangeListener)), elementResizer.subscribe(this, __privateGet(this, _resizeListener));
855
873
  }
856
874
  disconnectedCallback() {
857
- this.firstStore.removeMiddleware(t(this, Se)), this.firstStore.unsubscribe(t(this, ke)), kt.unsubscribe(t(this, Ee));
875
+ this.firstStore.removeMiddleware(__privateGet(this, _storeMiddleware)), this.firstStore.unsubscribe(__privateGet(this, _storeChangeListener)), elementResizer.unsubscribe(__privateGet(this, _resizeListener));
858
876
  }
859
- }
860
- G = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), _ = new WeakMap(), W = new WeakMap(), ve = new WeakMap(), ye = new WeakMap(), F = new WeakMap(), U = new WeakMap(), Se = new WeakMap(), ke = new WeakMap(), b = new WeakSet(), Q = function(e = this.firstStore.current) {
861
- return Array.isArray(e) ? e : [e];
862
- }, ct = function() {
863
- l(this, b, Q).call(this).map((e, i) => {
864
- const n = t(this, se)[i];
865
- if (n && (!t(this, U) || t(this, U) && t(this, F))) {
866
- const h = l(this, b, Ke).call(this, n, e);
867
- n.style.transform = `translateX(${h}px)`;
877
+ };
878
+ _inputElements = new WeakMap(), _knobElements = new WeakMap(), _step = new WeakMap(), _min = new WeakMap(), _max = new WeakMap(), _ease = new WeakMap(), _type = new WeakMap(), _isFinite = new WeakMap(), _isDragging = new WeakMap(), _storeMiddleware = new WeakMap(), _storeChangeListener = new WeakMap(), _TweakerNumberManagerElement_instances = new WeakSet(), getArray_fn = /* @__PURE__ */ __name(function(value = this.firstStore.current) {
879
+ return Array.isArray(value) ? value : [value];
880
+ }, "#getArray"), updateKnobPositions_fn = /* @__PURE__ */ __name(function() {
881
+ __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => {
882
+ const knobElement = __privateGet(this, _knobElements)[i];
883
+ if (knobElement && (!__privateGet(this, _isDragging) || __privateGet(this, _isDragging) && __privateGet(this, _isFinite))) {
884
+ const position = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, v);
885
+ knobElement.style.transform = `translateX(${position}px)`;
868
886
  }
869
887
  });
870
- }, dt = function() {
871
- return t(this, F) ? t(this, W) - t(this, _) : 0;
872
- }, Ke = function(e, i) {
873
- const n = e.parentElement, h = l(this, b, dt).call(this), u = h ? i / h : 0.5;
874
- return (n.offsetWidth - e.offsetWidth) * u;
875
- }, Ee = new WeakMap();
876
- p && !customElements.get("e-tweaker-number-manager") && customElements.define("e-tweaker-number-manager", Bt);
877
- function Kt(r) {
878
- r.dispatchEvent(
888
+ }, "#updateKnobPositions"), getDistance_fn = /* @__PURE__ */ __name(function() {
889
+ return __privateGet(this, _isFinite) ? __privateGet(this, _max) - __privateGet(this, _min) : 0;
890
+ }, "#getDistance"), getKnobPosition_fn = /* @__PURE__ */ __name(function(knobElement, inputValue) {
891
+ const parentElement = knobElement.parentElement, distance = __privateMethod(this, _TweakerNumberManagerElement_instances, getDistance_fn).call(this), progress = distance ? inputValue / distance : 0.5;
892
+ return (parentElement.offsetWidth - knobElement.offsetWidth) * progress;
893
+ }, "#getKnobPosition"), _resizeListener = new WeakMap(), __name(_TweakerNumberManagerElement, "TweakerNumberManagerElement");
894
+ let TweakerNumberManagerElement = _TweakerNumberManagerElement;
895
+ isBrowser && !customElements.get("e-tweaker-number-manager") && customElements.define("e-tweaker-number-manager", TweakerNumberManagerElement);
896
+ function dispatchSizeChangeEvent(node) {
897
+ node.dispatchEvent(
879
898
  new CustomEvent("sizeChange", {
880
899
  bubbles: !0,
881
900
  composed: !0
882
901
  })
883
902
  );
884
903
  }
885
- function gs(r) {
886
- r.dispatchEvent(
904
+ __name(dispatchSizeChangeEvent, "dispatchSizeChangeEvent");
905
+ function dispatchBeforeSizeChangeEvent(node) {
906
+ node.dispatchEvent(
887
907
  new CustomEvent("beforeSizeChange", {
888
908
  bubbles: !0,
889
909
  composed: !0
890
910
  })
891
911
  );
892
912
  }
893
- const bs = E({
913
+ __name(dispatchBeforeSizeChangeEvent, "dispatchBeforeSizeChangeEvent");
914
+ const stylesheet$7 = createStylesheet({
894
915
  ":host": {
895
916
  position: "relative"
896
917
  },
@@ -925,112 +946,113 @@ const bs = E({
925
946
  paddingTop: "var(--gap, 0px)"
926
947
  }
927
948
  });
928
- var ne, oe, z, X, re, ae, Ye, xe, ft;
929
- const bt = class bt extends HTMLElement {
949
+ var _internals2, _value, _bodyElement, _opened, _timeoutId, _resizeObserver, _resizeObserverListener, _SelectElement_instances, dispatchToggleEvent_fn;
950
+ const _SelectElement = class _SelectElement extends HTMLElement {
930
951
  constructor() {
931
952
  super();
932
- o(this, xe);
933
- o(this, ne, null);
934
- o(this, oe, "");
935
- o(this, z, null);
936
- o(this, X, !1);
937
- o(this, re);
938
- o(this, ae, null);
939
- o(this, Ye, () => {
940
- Kt(this);
941
- });
942
- if (p) {
943
- const e = this.attachShadow({ mode: "open" });
944
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, bs], c(this, ne, this.attachInternals()), c(this, ae, new ResizeObserver(t(this, Ye))), g(this, {
953
+ __privateAdd(this, _SelectElement_instances);
954
+ __privateAdd(this, _internals2, null);
955
+ __privateAdd(this, _value, "");
956
+ __privateAdd(this, _bodyElement, null);
957
+ __privateAdd(this, _opened, !1);
958
+ __privateAdd(this, _timeoutId);
959
+ __privateAdd(this, _resizeObserver, null);
960
+ __privateAdd(this, _resizeObserverListener, /* @__PURE__ */ __name(() => {
961
+ dispatchSizeChangeEvent(this);
962
+ }, "#resizeObserverListener"));
963
+ if (isBrowser) {
964
+ const shadow = this.attachShadow({ mode: "open" });
965
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$7], __privateSet(this, _internals2, this.attachInternals()), __privateSet(this, _resizeObserver, new ResizeObserver(__privateGet(this, _resizeObserverListener))), element(this, {
945
966
  children: [
946
- ee({
967
+ button({
947
968
  class: "head",
948
- children: me({ name: "head" }),
949
- onClick: () => {
969
+ children: slot({ name: "head" }),
970
+ onClick: /* @__PURE__ */ __name(() => {
950
971
  this.opened ? this.close() : this.open();
951
- }
972
+ }, "onClick")
952
973
  }),
953
- w({
974
+ div({
954
975
  class: "body",
955
976
  style: {
956
977
  height: "0px"
957
978
  },
958
- children: w({
979
+ children: div({
959
980
  class: "body-inner",
960
- children: me()
981
+ children: slot()
961
982
  }),
962
- ref: (i) => {
963
- c(this, z, i);
964
- }
983
+ ref: /* @__PURE__ */ __name((e) => {
984
+ __privateSet(this, _bodyElement, e);
985
+ }, "ref")
965
986
  })
966
987
  ]
967
988
  });
968
989
  }
969
990
  }
970
991
  get value() {
971
- return t(this, oe);
992
+ return __privateGet(this, _value);
972
993
  }
973
- set value(e) {
974
- c(this, oe, e), this.dispatchEvent(
994
+ set value(value) {
995
+ __privateSet(this, _value, value), this.dispatchEvent(
975
996
  new Event("change", {
976
997
  bubbles: !0,
977
998
  composed: !0
978
999
  })
979
- ), t(this, ne).setFormValue(t(this, oe));
1000
+ ), __privateGet(this, _internals2).setFormValue(__privateGet(this, _value));
980
1001
  }
981
1002
  get internals() {
982
- return t(this, ne);
1003
+ return __privateGet(this, _internals2);
983
1004
  }
984
1005
  get opened() {
985
- return t(this, X);
1006
+ return __privateGet(this, _opened);
986
1007
  }
987
1008
  open() {
988
- clearTimeout(t(this, re)), c(this, X, !0), t(this, z).style.display = "grid", this.classList.add("triggered"), setTimeout(() => {
989
- this.classList.add("opened"), t(this, z).style.height = t(this, z).scrollHeight + "px", l(this, xe, ft).call(this);
1009
+ clearTimeout(__privateGet(this, _timeoutId)), __privateSet(this, _opened, !0), __privateGet(this, _bodyElement).style.display = "grid", this.classList.add("triggered"), setTimeout(() => {
1010
+ this.classList.add("opened"), __privateGet(this, _bodyElement).style.height = __privateGet(this, _bodyElement).scrollHeight + "px", __privateMethod(this, _SelectElement_instances, dispatchToggleEvent_fn).call(this);
990
1011
  }, 0);
991
1012
  }
992
1013
  close() {
993
- c(this, X, !1), t(this, z).style.height = "0px", this.classList.remove("opened"), l(this, xe, ft).call(this), c(this, re, setTimeout(() => {
994
- this.classList.remove("triggered"), t(this, z).style.display = "none";
995
- }, is(t(this, z))));
1014
+ __privateSet(this, _opened, !1), __privateGet(this, _bodyElement).style.height = "0px", this.classList.remove("opened"), __privateMethod(this, _SelectElement_instances, dispatchToggleEvent_fn).call(this), __privateSet(this, _timeoutId, setTimeout(() => {
1015
+ this.classList.remove("triggered"), __privateGet(this, _bodyElement).style.display = "none";
1016
+ }, getElementTransitionDurationMS(__privateGet(this, _bodyElement))));
996
1017
  }
997
1018
  connectedCallback() {
998
- t(this, ae).observe(t(this, z));
1019
+ __privateGet(this, _resizeObserver).observe(__privateGet(this, _bodyElement));
999
1020
  }
1000
1021
  disconnectedCallback() {
1001
- clearTimeout(t(this, re)), t(this, ae).disconnect();
1022
+ clearTimeout(__privateGet(this, _timeoutId)), __privateGet(this, _resizeObserver).disconnect();
1002
1023
  }
1003
1024
  };
1004
- ne = new WeakMap(), oe = new WeakMap(), z = new WeakMap(), X = new WeakMap(), re = new WeakMap(), ae = new WeakMap(), Ye = new WeakMap(), xe = new WeakSet(), ft = function() {
1005
- gs(this), this.dispatchEvent(
1025
+ _internals2 = new WeakMap(), _value = new WeakMap(), _bodyElement = new WeakMap(), _opened = new WeakMap(), _timeoutId = new WeakMap(), _resizeObserver = new WeakMap(), _resizeObserverListener = new WeakMap(), _SelectElement_instances = new WeakSet(), dispatchToggleEvent_fn = /* @__PURE__ */ __name(function() {
1026
+ dispatchBeforeSizeChangeEvent(this), this.dispatchEvent(
1006
1027
  new CustomEvent("selectToggle", {
1007
1028
  bubbles: !0,
1008
1029
  composed: !0,
1009
1030
  detail: {
1010
- opened: t(this, X)
1031
+ opened: __privateGet(this, _opened)
1011
1032
  }
1012
1033
  })
1013
1034
  );
1014
- }, bt.formAssociated = !0;
1015
- let ut = bt;
1016
- p && !customElements.get("e-select") && customElements.define("e-select", ut);
1017
- var Ce;
1018
- class Ot extends HTMLElement {
1035
+ }, "#dispatchToggleEvent"), __name(_SelectElement, "SelectElement"), _SelectElement.formAssociated = !0;
1036
+ let SelectElement = _SelectElement;
1037
+ isBrowser && !customElements.get("e-select") && customElements.define("e-select", SelectElement);
1038
+ var _selectElement;
1039
+ const _SelectUserElement = class _SelectUserElement extends HTMLElement {
1019
1040
  constructor() {
1020
1041
  super(...arguments);
1021
- o(this, Ce, null);
1042
+ __privateAdd(this, _selectElement, null);
1022
1043
  }
1023
1044
  get selectElement() {
1024
- return t(this, Ce);
1045
+ return __privateGet(this, _selectElement);
1025
1046
  }
1026
1047
  connectedCallback() {
1027
- var i, n;
1028
- const e = (n = (i = this.assignedSlot) == null ? void 0 : i.getRootNode()) == null ? void 0 : n.host;
1029
- e ? c(this, Ce, e) : console.log(this, "e-select not found");
1048
+ var _a, _b;
1049
+ const selectElement = (_b = (_a = this.assignedSlot) == null ? void 0 : _a.getRootNode()) == null ? void 0 : _b.host;
1050
+ selectElement ? __privateSet(this, _selectElement, selectElement) : console.log(this, "e-select not found");
1030
1051
  }
1031
- }
1032
- Ce = new WeakMap();
1033
- const ws = E({
1052
+ };
1053
+ _selectElement = new WeakMap(), __name(_SelectUserElement, "SelectUserElement");
1054
+ let SelectUserElement = _SelectUserElement;
1055
+ const stylesheet$6 = createStylesheet({
1034
1056
  ":host": {
1035
1057
  width: "100%",
1036
1058
  height: "40px",
@@ -1038,25 +1060,25 @@ const ws = E({
1038
1060
  alignItems: "center"
1039
1061
  }
1040
1062
  });
1041
- var le, Le, mt;
1042
- class vs extends Ot {
1063
+ var _changeListener, _SelectOptionElement_instances, pick_fn;
1064
+ const _SelectOptionElement = class _SelectOptionElement extends SelectUserElement {
1043
1065
  constructor() {
1044
1066
  super();
1045
- o(this, Le);
1046
- o(this, le, () => {
1067
+ __privateAdd(this, _SelectOptionElement_instances);
1068
+ __privateAdd(this, _changeListener, /* @__PURE__ */ __name(() => {
1047
1069
  this.selectElement.value === this.value ? this.style.display = "none" : this.style.display = "";
1048
- });
1049
- if (p) {
1050
- const e = this.attachShadow({ mode: "open" });
1051
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ws], g(this, {
1070
+ }, "#changeListener"));
1071
+ if (isBrowser) {
1072
+ const shadow = this.attachShadow({ mode: "open" });
1073
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$6], element(this, {
1052
1074
  tabindex: 0,
1053
- onClick: () => {
1054
- l(this, Le, mt).call(this);
1055
- },
1056
- onKeydown: (i) => {
1057
- i.code === "Space" && l(this, Le, mt).call(this);
1058
- },
1059
- children: me()
1075
+ onClick: /* @__PURE__ */ __name(() => {
1076
+ __privateMethod(this, _SelectOptionElement_instances, pick_fn).call(this);
1077
+ }, "onClick"),
1078
+ onKeydown: /* @__PURE__ */ __name((e) => {
1079
+ e.code === "Space" && __privateMethod(this, _SelectOptionElement_instances, pick_fn).call(this);
1080
+ }, "onKeydown"),
1081
+ children: slot()
1060
1082
  });
1061
1083
  }
1062
1084
  }
@@ -1064,19 +1086,20 @@ class vs extends Ot {
1064
1086
  return (this.hasAttribute("value") ? this.getAttribute("value") : this.innerText) || "";
1065
1087
  }
1066
1088
  connectedCallback() {
1067
- super.connectedCallback(), this.hasAttribute("default") && (this.selectElement.value || (this.selectElement.value = this.value)), this.selectElement.addEventListener("change", t(this, le)), setTimeout(() => {
1068
- t(this, le).call(this);
1089
+ super.connectedCallback(), this.hasAttribute("default") && (this.selectElement.value || (this.selectElement.value = this.value)), this.selectElement.addEventListener("change", __privateGet(this, _changeListener)), setTimeout(() => {
1090
+ __privateGet(this, _changeListener).call(this);
1069
1091
  });
1070
1092
  }
1071
1093
  disconnectedCallback() {
1072
- this.selectElement.removeEventListener("change", t(this, le));
1094
+ this.selectElement.removeEventListener("change", __privateGet(this, _changeListener));
1073
1095
  }
1074
- }
1075
- le = new WeakMap(), Le = new WeakSet(), mt = function() {
1076
- this.selectElement.value = this.value, this.selectElement.close();
1077
1096
  };
1078
- p && !customElements.get("e-select-option") && customElements.define("e-select-option", vs);
1079
- const ys = E({
1097
+ _changeListener = new WeakMap(), _SelectOptionElement_instances = new WeakSet(), pick_fn = /* @__PURE__ */ __name(function() {
1098
+ this.selectElement.value = this.value, this.selectElement.close();
1099
+ }, "#pick"), __name(_SelectOptionElement, "SelectOptionElement");
1100
+ let SelectOptionElement = _SelectOptionElement;
1101
+ isBrowser && !customElements.get("e-select-option") && customElements.define("e-select-option", SelectOptionElement);
1102
+ const stylesheet$5 = createStylesheet({
1080
1103
  ":host": {
1081
1104
  width: "100%",
1082
1105
  height: "40px",
@@ -1088,7 +1111,7 @@ const ys = E({
1088
1111
  flexShrink: "0",
1089
1112
  width: "var(--arrow-size, 1em)",
1090
1113
  height: "var(--arrow-size, 1em)",
1091
- fill: `var(--arrow-color, ${f.colorMain.var})`,
1114
+ fill: `var(--arrow-color, ${aptechkaTheme.colorMain.var})`,
1092
1115
  transitionProperty: "transform",
1093
1116
  transitionDuration: "var(--duration, var(--duration-short))"
1094
1117
  },
@@ -1096,47 +1119,48 @@ const ys = E({
1096
1119
  transform: "scaleY(-1)"
1097
1120
  }
1098
1121
  });
1099
- var Te, he, ze;
1100
- class Ss extends Ot {
1122
+ var _valueElement, _changeListener2, _toggleListener;
1123
+ const _SelectHeadElement = class _SelectHeadElement extends SelectUserElement {
1101
1124
  constructor() {
1102
1125
  super();
1103
- o(this, Te, null);
1104
- o(this, he, () => {
1105
- const i = this.selectElement.shadowRoot.querySelector(
1126
+ __privateAdd(this, _valueElement, null);
1127
+ __privateAdd(this, _changeListener2, /* @__PURE__ */ __name(() => {
1128
+ const currentOption = this.selectElement.shadowRoot.querySelector(
1106
1129
  ".body slot"
1107
- ).assignedElements().find((n) => n.value === this.selectElement.value);
1108
- i && (t(this, Te).innerHTML = i.innerHTML);
1109
- });
1110
- o(this, ze, () => {
1130
+ ).assignedElements().find((e) => e.value === this.selectElement.value);
1131
+ currentOption && (__privateGet(this, _valueElement).innerHTML = currentOption.innerHTML);
1132
+ }, "#changeListener"));
1133
+ __privateAdd(this, _toggleListener, /* @__PURE__ */ __name(() => {
1111
1134
  this.classList.toggle("opened", this.selectElement.opened);
1112
- });
1113
- if (p) {
1114
- const e = this.attachShadow({ mode: "open" });
1115
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ys], g(this, {
1135
+ }, "#toggleListener"));
1136
+ if (isBrowser) {
1137
+ const shadow = this.attachShadow({ mode: "open" });
1138
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$5], element(this, {
1116
1139
  children: [
1117
- me(),
1118
- me({
1140
+ slot(),
1141
+ slot({
1119
1142
  name: "arrow",
1120
- children: g(Ht, { class: "default-arrow" })
1143
+ children: element(arrowIcon, { class: "default-arrow" })
1121
1144
  })
1122
1145
  ]
1123
1146
  }), this.slot = "head";
1124
1147
  }
1125
1148
  }
1126
1149
  connectedCallback() {
1127
- super.connectedCallback(), c(this, Te, this.querySelector("[data-value-holder]") || this), this.selectElement.addEventListener("change", t(this, he)), t(this, he).call(this), this.selectElement.addEventListener("selectToggle", t(this, ze));
1150
+ super.connectedCallback(), __privateSet(this, _valueElement, this.querySelector("[data-value-holder]") || this), this.selectElement.addEventListener("change", __privateGet(this, _changeListener2)), __privateGet(this, _changeListener2).call(this), this.selectElement.addEventListener("selectToggle", __privateGet(this, _toggleListener));
1128
1151
  }
1129
1152
  disconnectedCallback() {
1130
- this.selectElement.removeEventListener("change", t(this, he)), this.selectElement.removeEventListener("selectToggle", t(this, ze));
1153
+ this.selectElement.removeEventListener("change", __privateGet(this, _changeListener2)), this.selectElement.removeEventListener("selectToggle", __privateGet(this, _toggleListener));
1131
1154
  }
1132
- }
1133
- Te = new WeakMap(), he = new WeakMap(), ze = new WeakMap();
1134
- p && !customElements.get("e-select-head") && customElements.define("e-select-head", Ss);
1135
- const ks = E({
1155
+ };
1156
+ _valueElement = new WeakMap(), _changeListener2 = new WeakMap(), _toggleListener = new WeakMap(), __name(_SelectHeadElement, "SelectHeadElement");
1157
+ let SelectHeadElement = _SelectHeadElement;
1158
+ isBrowser && !customElements.get("e-select-head") && customElements.define("e-select-head", SelectHeadElement);
1159
+ const stylesheet$4 = createStylesheet({
1136
1160
  "e-select": {
1137
1161
  display: "block",
1138
1162
  width: "100%",
1139
- "--arrow-color": f.colorFont.var
1163
+ "--arrow-color": aptechkaTheme.colorFont.var
1140
1164
  },
1141
1165
  "e-select-head": {
1142
1166
  width: "100%",
@@ -1153,54 +1177,55 @@ const ks = E({
1153
1177
  fontSize: "var(--font-size-small)"
1154
1178
  },
1155
1179
  "e-select-option:hover": {
1156
- color: f.colorActive.var
1180
+ color: aptechkaTheme.colorActive.var
1157
1181
  },
1158
1182
  svg: {
1159
1183
  width: "16px",
1160
1184
  height: "16px",
1161
- fill: f.colorFont.var,
1185
+ fill: aptechkaTheme.colorFont.var,
1162
1186
  transitionProperty: "transform",
1163
1187
  transitionDuration: "var(--duration-short)"
1164
1188
  },
1165
1189
  ".opened svg": {
1166
1190
  transform: "scaleY(-1)"
1167
1191
  }
1168
- });
1169
- class Zt extends pe {
1170
- constructor(...s) {
1171
- var n;
1172
- super(...s);
1173
- const e = this.attachShadow({ mode: "open" });
1174
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ks];
1175
- const i = ((n = this.firstStore.__manager) == null ? void 0 : n.variants) || [];
1176
- g(this, {
1177
- children: g("e-select", {
1192
+ }), _TweakerSelectManagerElement = class _TweakerSelectManagerElement extends TweakerStoreManagerElement {
1193
+ constructor(...stores) {
1194
+ var _a;
1195
+ super(...stores);
1196
+ const shadow = this.attachShadow({ mode: "open" });
1197
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$4];
1198
+ const variants = ((_a = this.firstStore.__manager) == null ? void 0 : _a.variants) || [];
1199
+ element(this, {
1200
+ children: element("e-select", {
1178
1201
  value: this.firstStore,
1179
- onChange: (h) => {
1180
- this.updateStores(h.currentTarget.value);
1181
- },
1202
+ onChange: /* @__PURE__ */ __name((e) => {
1203
+ this.updateStores(e.currentTarget.value);
1204
+ }, "onChange"),
1182
1205
  lightChildren: [
1183
- g("e-select-head", {
1206
+ element("e-select-head", {
1184
1207
  lightChildren: [
1185
- lt({
1208
+ span({
1186
1209
  "data-value-holder": ""
1187
1210
  })
1188
1211
  ]
1189
1212
  }),
1190
1213
  // @ts-ignore
1191
- ...i.map(
1192
- (h, u) => g("e-select-option", {
1193
- lightChildren: h,
1194
- default: u === 0 ? !0 : null
1214
+ ...variants.map(
1215
+ (v, i) => element("e-select-option", {
1216
+ lightChildren: v,
1217
+ default: i === 0 ? !0 : null
1195
1218
  })
1196
1219
  )
1197
1220
  ]
1198
1221
  })
1199
1222
  });
1200
1223
  }
1201
- }
1202
- p && !customElements.get("e-tweaker-select-manager") && customElements.define("e-tweaker-select-manager", Zt);
1203
- const Es = E({
1224
+ };
1225
+ __name(_TweakerSelectManagerElement, "TweakerSelectManagerElement");
1226
+ let TweakerSelectManagerElement = _TweakerSelectManagerElement;
1227
+ isBrowser && !customElements.get("e-tweaker-select-manager") && customElements.define("e-tweaker-select-manager", TweakerSelectManagerElement);
1228
+ const stylesheet$3 = createStylesheet({
1204
1229
  ":host": {
1205
1230
  width: "100%",
1206
1231
  display: "flex",
@@ -1219,44 +1244,45 @@ const Es = E({
1219
1244
  margin: "0",
1220
1245
  padding: "0 var(--gap-small)",
1221
1246
  backgroundColor: "rgba(255, 255, 255, 0.1)",
1222
- borderRadius: f.borderRadius.var
1247
+ borderRadius: aptechkaTheme.borderRadius.var
1223
1248
  }
1224
- });
1225
- class Wt extends pe {
1226
- constructor(...s) {
1227
- super(...s);
1228
- const e = this.attachShadow({ mode: "open" });
1229
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, Es], g(this, {
1249
+ }), _TweakerStringManagerElement = class _TweakerStringManagerElement extends TweakerStoreManagerElement {
1250
+ constructor(...stores) {
1251
+ super(...stores);
1252
+ const shadow = this.attachShadow({ mode: "open" });
1253
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$3], element(this, {
1230
1254
  children: [
1231
- Ve({
1255
+ input({
1232
1256
  class: "text-input",
1233
1257
  type: "string",
1234
1258
  value: this.firstStore,
1235
- onChange: (i) => {
1259
+ onChange: /* @__PURE__ */ __name((e) => {
1236
1260
  this.updateStores(
1237
- i.currentTarget.value
1261
+ e.currentTarget.value
1238
1262
  );
1239
- }
1263
+ }, "onChange")
1240
1264
  })
1241
1265
  ]
1242
1266
  });
1243
1267
  }
1244
- }
1245
- p && !customElements.get("e-tweaker-string-manager") && customElements.define("e-tweaker-string-manager", Wt);
1246
- const xs = {
1247
- boolean: Dt,
1248
- color: Vt,
1249
- link: _t,
1250
- number: Bt,
1251
- select: Zt,
1252
- string: Wt
1253
- }, Cs = E({
1268
+ };
1269
+ __name(_TweakerStringManagerElement, "TweakerStringManagerElement");
1270
+ let TweakerStringManagerElement = _TweakerStringManagerElement;
1271
+ isBrowser && !customElements.get("e-tweaker-string-manager") && customElements.define("e-tweaker-string-manager", TweakerStringManagerElement);
1272
+ const tweakerManagerConstructors = {
1273
+ boolean: TweakerBooleanManagerElement,
1274
+ color: TweakerColorManagerElement,
1275
+ link: TweakerLinkManagerElement,
1276
+ number: TweakerNumberManagerElement,
1277
+ select: TweakerSelectManagerElement,
1278
+ string: TweakerStringManagerElement
1279
+ }, stylesheet$2 = createStylesheet({
1254
1280
  ":host": {
1255
1281
  display: "grid",
1256
1282
  gridAutoFlow: "column",
1257
1283
  gridTemplateColumns: "0.5fr 1fr",
1258
1284
  alignItems: "center",
1259
- color: f.colorFont.var,
1285
+ color: aptechkaTheme.colorFont.var,
1260
1286
  gap: "var(--gap-medium)"
1261
1287
  },
1262
1288
  ":host(.disabled)": {
@@ -1279,7 +1305,7 @@ const xs = {
1279
1305
  margin: "0",
1280
1306
  border: "none",
1281
1307
  background: "none",
1282
- fill: f.colorFont.var,
1308
+ fill: aptechkaTheme.colorFont.var,
1283
1309
  transitionDuration: "var(--duration-short)",
1284
1310
  transitionProperty: "fill, opacity",
1285
1311
  opacity: "0"
@@ -1288,105 +1314,106 @@ const xs = {
1288
1314
  opacity: "1"
1289
1315
  },
1290
1316
  ".head-button:hover": {
1291
- fill: f.colorActive.var
1317
+ fill: aptechkaTheme.colorActive.var
1292
1318
  },
1293
1319
  ".head-button svg": {
1294
1320
  width: "100%",
1295
1321
  height: "100%"
1296
1322
  }
1297
1323
  });
1298
- var M, ce, de, ue, fe, Me, Ae;
1299
- class pt extends HTMLElement {
1300
- constructor(e) {
1301
- var h, u;
1324
+ var _stores2, _key, _name, _pointerEnter, _storeManager, _storesChangeListener, _keydownListener;
1325
+ const _TweakerFieldElement = class _TweakerFieldElement extends HTMLElement {
1326
+ constructor(parameters) {
1327
+ var _a, _b;
1302
1328
  super();
1303
- o(this, M, []);
1304
- o(this, ce);
1305
- o(this, de);
1306
- o(this, ue, !1);
1307
- o(this, fe);
1308
- o(this, Me, () => {
1309
- j.current.find((e) => t(this, M).includes(e)) || this.remove();
1310
- });
1311
- o(this, Ae, (e) => {
1312
- t(this, ue) && ((e.metaKey || e.ctrlKey) && e.code === "KeyC" ? navigator.clipboard.writeText(t(this, M)[0].current) : (e.metaKey || e.ctrlKey) && e.code === "KeyR" && (t(this, M).forEach((i) => {
1313
- i.reset();
1329
+ __privateAdd(this, _stores2, []);
1330
+ __privateAdd(this, _key);
1331
+ __privateAdd(this, _name);
1332
+ __privateAdd(this, _pointerEnter, !1);
1333
+ __privateAdd(this, _storeManager);
1334
+ __privateAdd(this, _storesChangeListener, /* @__PURE__ */ __name(() => {
1335
+ activeStores.current.find((s) => __privateGet(this, _stores2).includes(s)) || this.remove();
1336
+ }, "#storesChangeListener"));
1337
+ __privateAdd(this, _keydownListener, /* @__PURE__ */ __name((e) => {
1338
+ __privateGet(this, _pointerEnter) && ((e.metaKey || e.ctrlKey) && e.code === "KeyC" ? navigator.clipboard.writeText(__privateGet(this, _stores2)[0].current) : (e.metaKey || e.ctrlKey) && e.code === "KeyR" && (__privateGet(this, _stores2).forEach((store) => {
1339
+ store.reset();
1314
1340
  }), e.preventDefault()));
1315
- });
1316
- c(this, M, [e.store]), c(this, ce, e.store.name), c(this, de, t(this, ce).split(".").slice(-1).toString());
1317
- const i = ((h = e.store.__manager) == null ? void 0 : h.type) || "string";
1318
- c(this, fe, new xs[i](
1319
- t(this, M)[0]
1341
+ }, "#keydownListener"));
1342
+ __privateSet(this, _stores2, [parameters.store]), __privateSet(this, _key, parameters.store.name), __privateSet(this, _name, __privateGet(this, _key).split(".").slice(-1).toString());
1343
+ const type = ((_a = parameters.store.__manager) == null ? void 0 : _a.type) || "string";
1344
+ __privateSet(this, _storeManager, new tweakerManagerConstructors[type](
1345
+ __privateGet(this, _stores2)[0]
1320
1346
  ));
1321
- const n = this.attachShadow({ mode: "open" });
1322
- n.adoptedStyleSheets = [...n.adoptedStyleSheets, Cs], g(this, {
1347
+ const shadow = this.attachShadow({ mode: "open" });
1348
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$2], element(this, {
1323
1349
  class: {
1324
- disabled: ((u = e.store.__manager) == null ? void 0 : u.disabled) || !1
1325
- },
1326
- onPointerleave: () => {
1327
- c(this, ue, !1);
1328
- },
1329
- onPointerenter: () => {
1330
- c(this, ue, !0);
1350
+ disabled: ((_b = parameters.store.__manager) == null ? void 0 : _b.disabled) || !1
1331
1351
  },
1352
+ onPointerleave: /* @__PURE__ */ __name(() => {
1353
+ __privateSet(this, _pointerEnter, !1);
1354
+ }, "onPointerleave"),
1355
+ onPointerenter: /* @__PURE__ */ __name(() => {
1356
+ __privateSet(this, _pointerEnter, !0);
1357
+ }, "onPointerenter"),
1332
1358
  children: [
1333
- w({
1359
+ div({
1334
1360
  class: "head",
1335
1361
  children: [
1336
- w({ class: "name", children: t(this, de) + ":" }),
1337
- w({
1362
+ div({ class: "name", children: __privateGet(this, _name) + ":" }),
1363
+ div({
1338
1364
  class: "head-buttons",
1339
1365
  children: [
1340
- ee({
1366
+ button({
1341
1367
  class: "head-button",
1342
- children: It,
1343
- onClick: () => {
1344
- navigator.clipboard.writeText(t(this, M)[0].current);
1345
- }
1368
+ children: copyIcon,
1369
+ onClick: /* @__PURE__ */ __name(() => {
1370
+ navigator.clipboard.writeText(__privateGet(this, _stores2)[0].current);
1371
+ }, "onClick")
1346
1372
  }),
1347
- ee({
1373
+ button({
1348
1374
  class: "head-button",
1349
- children: $t,
1350
- onClick: () => {
1351
- t(this, M).forEach((m) => {
1352
- m.reset();
1375
+ children: resetIcon,
1376
+ onClick: /* @__PURE__ */ __name(() => {
1377
+ __privateGet(this, _stores2).forEach((store) => {
1378
+ store.reset();
1353
1379
  });
1354
- }
1380
+ }, "onClick")
1355
1381
  })
1356
1382
  ]
1357
1383
  })
1358
1384
  ]
1359
1385
  }),
1360
- t(this, fe)
1386
+ __privateGet(this, _storeManager)
1361
1387
  ]
1362
1388
  });
1363
1389
  }
1364
1390
  get key() {
1365
- return t(this, ce);
1391
+ return __privateGet(this, _key);
1366
1392
  }
1367
1393
  get name() {
1368
- return t(this, de);
1394
+ return __privateGet(this, _name);
1369
1395
  }
1370
1396
  get stores() {
1371
- return t(this, M);
1397
+ return __privateGet(this, _stores2);
1372
1398
  }
1373
- addStore(e) {
1374
- t(this, fe).addStore(e);
1399
+ addStore(store) {
1400
+ __privateGet(this, _storeManager).addStore(store);
1375
1401
  }
1376
1402
  connectedCallback() {
1377
- j.subscribe(t(this, Me)), addEventListener("keydown", t(this, Ae)), Kt(this);
1403
+ activeStores.subscribe(__privateGet(this, _storesChangeListener)), addEventListener("keydown", __privateGet(this, _keydownListener)), dispatchSizeChangeEvent(this);
1378
1404
  }
1379
1405
  disconnectedCallback() {
1380
- j.unsubscribe(t(this, Me)), removeEventListener("keydown", t(this, Ae));
1406
+ activeStores.unsubscribe(__privateGet(this, _storesChangeListener)), removeEventListener("keydown", __privateGet(this, _keydownListener));
1381
1407
  }
1382
- }
1383
- M = new WeakMap(), ce = new WeakMap(), de = new WeakMap(), ue = new WeakMap(), fe = new WeakMap(), Me = new WeakMap(), Ae = new WeakMap();
1384
- p && !customElements.get("e-tweaker-field") && customElements.define("e-tweaker-field", pt);
1385
- const Ls = E({
1408
+ };
1409
+ _stores2 = new WeakMap(), _key = new WeakMap(), _name = new WeakMap(), _pointerEnter = new WeakMap(), _storeManager = new WeakMap(), _storesChangeListener = new WeakMap(), _keydownListener = new WeakMap(), __name(_TweakerFieldElement, "TweakerFieldElement");
1410
+ let TweakerFieldElement = _TweakerFieldElement;
1411
+ isBrowser && !customElements.get("e-tweaker-field") && customElements.define("e-tweaker-field", TweakerFieldElement);
1412
+ const stylesheet$1 = createStylesheet({
1386
1413
  ".wrapper": {
1387
1414
  boxSizing: "border-box",
1388
1415
  backgroundColor: "rgba(255, 255, 255, 0.1)",
1389
- borderRadius: f.borderRadius.var
1416
+ borderRadius: aptechkaTheme.borderRadius.var
1390
1417
  },
1391
1418
  ".head": {
1392
1419
  boxSizing: "border-box",
@@ -1397,12 +1424,12 @@ const Ls = E({
1397
1424
  display: "flex",
1398
1425
  alignItems: "center",
1399
1426
  justifyContent: "space-between",
1400
- backgroundColor: f.colorMainAux.var,
1401
- borderRadius: f.borderRadius.var
1427
+ backgroundColor: aptechkaTheme.colorMainAux.var,
1428
+ borderRadius: aptechkaTheme.borderRadius.var
1402
1429
  },
1403
1430
  ".name": {
1404
1431
  fontSize: "var(--font-size-large)",
1405
- color: f.colorFont.var
1432
+ color: aptechkaTheme.colorFont.var
1406
1433
  },
1407
1434
  ".body": {
1408
1435
  display: "none",
@@ -1430,127 +1457,127 @@ const Ls = E({
1430
1457
  ".arrow": {
1431
1458
  width: "20px",
1432
1459
  height: "20px",
1433
- fill: f.colorFont.var,
1460
+ fill: aptechkaTheme.colorFont.var,
1434
1461
  transition: "transform var(--duration-short)"
1435
1462
  },
1436
1463
  ".opened .arrow": {
1437
1464
  transform: "scaleY(-1)"
1438
1465
  }
1439
1466
  });
1440
- var A, Ne, S, Re, Fe, Pe, $e, Ge;
1441
- const Ue = class Ue extends HTMLElement {
1442
- constructor(e) {
1467
+ var _key2, _head, _content, _mutationObserver, _bodyElement2, _contentElement, _contentRootElement, _mutationListener;
1468
+ const _TweakerFolderElement = class _TweakerFolderElement extends HTMLElement {
1469
+ constructor(parameters) {
1443
1470
  super();
1444
- o(this, A);
1445
- o(this, Ne, new $(null));
1446
- o(this, S, new $([]));
1447
- o(this, Re);
1448
- o(this, Fe, null);
1449
- o(this, Pe, null);
1450
- o(this, $e, null);
1451
- o(this, Ge, (e) => {
1452
- let i = [], n = [];
1453
- e.forEach((h) => {
1454
- i = [...i, ...h.removedNodes], n = [...n, ...h.addedNodes];
1455
- }), t(this, S).current = t(this, S).current.filter(
1456
- (h) => !i.includes(h)
1457
- ), t(this, A) && !t(this, S).current.length && !n.length && this.remove();
1458
- });
1459
- const i = this.attachShadow({ mode: "open" });
1460
- i.adoptedStyleSheets = [...i.adoptedStyleSheets, Ls], c(this, A, e.key), c(this, Re, new MutationObserver(t(this, Ge))), g(this, {
1471
+ __privateAdd(this, _key2);
1472
+ __privateAdd(this, _head, new Store(null));
1473
+ __privateAdd(this, _content, new Store([]));
1474
+ __privateAdd(this, _mutationObserver);
1475
+ __privateAdd(this, _bodyElement2, null);
1476
+ __privateAdd(this, _contentElement, null);
1477
+ __privateAdd(this, _contentRootElement, null);
1478
+ __privateAdd(this, _mutationListener, /* @__PURE__ */ __name((mutations) => {
1479
+ let removedNodes = [], addedNodes = [];
1480
+ mutations.forEach((m) => {
1481
+ removedNodes = [...removedNodes, ...m.removedNodes], addedNodes = [...addedNodes, ...m.addedNodes];
1482
+ }), __privateGet(this, _content).current = __privateGet(this, _content).current.filter(
1483
+ (v) => !removedNodes.includes(v)
1484
+ ), __privateGet(this, _key2) && !__privateGet(this, _content).current.length && !addedNodes.length && this.remove();
1485
+ }, "#mutationListener"));
1486
+ const shadow = this.attachShadow({ mode: "open" });
1487
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$1], __privateSet(this, _key2, parameters.key), __privateSet(this, _mutationObserver, new MutationObserver(__privateGet(this, _mutationListener))), element(this, {
1461
1488
  children: [
1462
- w({
1489
+ div({
1463
1490
  class: "wrapper",
1464
1491
  children: [
1465
- w({
1492
+ div({
1466
1493
  class: "head",
1467
- onClick: (n) => {
1468
- this.classList.toggle("opened"), this.classList.contains("opened") ? C.openPanel(t(this, A)) : C.closePanel(t(this, A));
1469
- },
1494
+ onClick: /* @__PURE__ */ __name((e) => {
1495
+ this.classList.toggle("opened"), this.classList.contains("opened") ? tweakerStorage.openPanel(__privateGet(this, _key2)) : tweakerStorage.closePanel(__privateGet(this, _key2));
1496
+ }, "onClick"),
1470
1497
  children: [
1471
- t(this, A) ? w({
1498
+ __privateGet(this, _key2) ? div({
1472
1499
  class: "name",
1473
- children: [t(this, A).split(".").slice(-1).toString()]
1500
+ children: [__privateGet(this, _key2).split(".").slice(-1).toString()]
1474
1501
  }) : null,
1475
- t(this, Ne),
1476
- g(Ht, {
1502
+ __privateGet(this, _head),
1503
+ element(arrowIcon, {
1477
1504
  class: "arrow"
1478
1505
  })
1479
1506
  ]
1480
1507
  }),
1481
- w({
1508
+ div({
1482
1509
  class: "body",
1483
- ref: (n) => {
1484
- c(this, Fe, n);
1485
- },
1486
- children: w({
1510
+ ref: /* @__PURE__ */ __name((e) => {
1511
+ __privateSet(this, _bodyElement2, e);
1512
+ }, "ref"),
1513
+ children: div({
1487
1514
  class: "body-content",
1488
- children: t(this, S),
1489
- ref: (n) => {
1490
- c(this, Pe, n), c(this, $e, n.firstElementChild);
1491
- }
1515
+ children: __privateGet(this, _content),
1516
+ ref: /* @__PURE__ */ __name((e) => {
1517
+ __privateSet(this, _contentElement, e), __privateSet(this, _contentRootElement, e.firstElementChild);
1518
+ }, "ref")
1492
1519
  })
1493
1520
  })
1494
1521
  ]
1495
1522
  })
1496
1523
  ]
1497
- }), e != null && e.storeBox && this.handleStore(e.storeBox);
1524
+ }), parameters != null && parameters.storeBox && this.handleStore(parameters.storeBox);
1498
1525
  }
1499
1526
  get key() {
1500
- return t(this, A);
1527
+ return __privateGet(this, _key2);
1501
1528
  }
1502
1529
  get head() {
1503
- return t(this, Ne);
1530
+ return __privateGet(this, _head);
1504
1531
  }
1505
1532
  get content() {
1506
- return t(this, S);
1533
+ return __privateGet(this, _content);
1507
1534
  }
1508
1535
  get bodyElement() {
1509
- return t(this, Fe);
1536
+ return __privateGet(this, _bodyElement2);
1510
1537
  }
1511
1538
  get contentElement() {
1512
- return t(this, Pe);
1539
+ return __privateGet(this, _contentElement);
1513
1540
  }
1514
1541
  connectedCallback() {
1515
- C.isPanelOpened(t(this, A)) && this.classList.add("opened"), setTimeout(() => {
1542
+ tweakerStorage.isPanelOpened(__privateGet(this, _key2)) && this.classList.add("opened"), setTimeout(() => {
1516
1543
  this.classList.add("transition-allowed");
1517
- }), t(this, Re).observe(t(this, $e), {
1544
+ }), __privateGet(this, _mutationObserver).observe(__privateGet(this, _contentRootElement), {
1518
1545
  childList: !0
1519
1546
  });
1520
1547
  }
1521
- handleStore(e) {
1522
- if (e.remainingFolders.length) {
1523
- const n = e.store.name.split("."), h = n.slice(0, n.length - e.remainingFolders.length).join("."), u = t(this, S).current.find((m) => m.key === h);
1524
- u instanceof Ue ? u.handleStore({
1525
- store: e.store,
1526
- remainingFolders: e.remainingFolders.slice(1)
1527
- }) : t(this, S).current = [
1528
- ...t(this, S).current,
1529
- new Ue({
1530
- key: h,
1548
+ handleStore(storeBox) {
1549
+ if (storeBox.remainingFolders.length) {
1550
+ const splittedName = storeBox.store.name.split("."), key = splittedName.slice(0, splittedName.length - storeBox.remainingFolders.length).join("."), found = __privateGet(this, _content).current.find((v) => v.key === key);
1551
+ found instanceof _TweakerFolderElement ? found.handleStore({
1552
+ store: storeBox.store,
1553
+ remainingFolders: storeBox.remainingFolders.slice(1)
1554
+ }) : __privateGet(this, _content).current = [
1555
+ ...__privateGet(this, _content).current,
1556
+ new _TweakerFolderElement({
1557
+ key,
1531
1558
  storeBox: {
1532
- store: e.store,
1533
- remainingFolders: e.remainingFolders.slice(1)
1559
+ store: storeBox.store,
1560
+ remainingFolders: storeBox.remainingFolders.slice(1)
1534
1561
  }
1535
1562
  })
1536
1563
  ];
1537
1564
  } else {
1538
- const i = t(this, S).current.find(
1539
- (n) => n.key === e.store.name
1565
+ const found = __privateGet(this, _content).current.find(
1566
+ (v) => v.key === storeBox.store.name
1540
1567
  );
1541
- i instanceof pt ? i.addStore(e.store) : t(this, S).current = [
1542
- ...t(this, S).current,
1543
- new pt({
1544
- store: e.store
1568
+ found instanceof TweakerFieldElement ? found.addStore(storeBox.store) : __privateGet(this, _content).current = [
1569
+ ...__privateGet(this, _content).current,
1570
+ new TweakerFieldElement({
1571
+ store: storeBox.store
1545
1572
  })
1546
1573
  ];
1547
1574
  }
1548
1575
  }
1549
1576
  };
1550
- A = new WeakMap(), Ne = new WeakMap(), S = new WeakMap(), Re = new WeakMap(), Fe = new WeakMap(), Pe = new WeakMap(), $e = new WeakMap(), Ge = new WeakMap();
1551
- let Ze = Ue;
1552
- p && !customElements.get("e-tweaker-folder") && customElements.define("e-tweaker-folder", Ze);
1553
- const Ts = E({
1577
+ _key2 = new WeakMap(), _head = new WeakMap(), _content = new WeakMap(), _mutationObserver = new WeakMap(), _bodyElement2 = new WeakMap(), _contentElement = new WeakMap(), _contentRootElement = new WeakMap(), _mutationListener = new WeakMap(), __name(_TweakerFolderElement, "TweakerFolderElement");
1578
+ let TweakerFolderElement = _TweakerFolderElement;
1579
+ isBrowser && !customElements.get("e-tweaker-folder") && customElements.define("e-tweaker-folder", TweakerFolderElement);
1580
+ const stylesheet = createStylesheet({
1554
1581
  ":host": {
1555
1582
  "--tweaker-width": "550px",
1556
1583
  "--tweaker-offset": "20px",
@@ -1569,8 +1596,8 @@ const Ts = E({
1569
1596
  top: "var(--tweaker-offset)",
1570
1597
  right: "var(--tweaker-offset)",
1571
1598
  width: "var(--tweaker-width)",
1572
- backgroundColor: f.colorMain.var,
1573
- borderRadius: f.borderRadius.var,
1599
+ backgroundColor: aptechkaTheme.colorMain.var,
1600
+ borderRadius: aptechkaTheme.borderRadius.var,
1574
1601
  transition: "opacity 0.1s",
1575
1602
  zIndex: "100",
1576
1603
  opacity: "0.1"
@@ -1599,12 +1626,12 @@ const Ts = E({
1599
1626
  margin: "0",
1600
1627
  background: "none",
1601
1628
  border: "none",
1602
- fill: f.colorFont.var,
1629
+ fill: aptechkaTheme.colorFont.var,
1603
1630
  transitionProperty: "fill",
1604
1631
  transitionDuration: "var(--duration-short)"
1605
1632
  },
1606
1633
  ".tweaker-button:hover": {
1607
- fill: f.colorActive.var
1634
+ fill: aptechkaTheme.colorActive.var
1608
1635
  },
1609
1636
  ".tweaker-button svg": {
1610
1637
  width: "100%",
@@ -1625,7 +1652,7 @@ const Ts = E({
1625
1652
  ":host .body-content::-webkit-scrollbar": {
1626
1653
  display: "none"
1627
1654
  },
1628
- [`@media ${es["<=mobile"]}`]: {
1655
+ [`@media ${ViewportMediaRules["<=mobile"]}`]: {
1629
1656
  ":host": {
1630
1657
  position: "absolute",
1631
1658
  top: "0",
@@ -1642,125 +1669,126 @@ const Ts = E({
1642
1669
  }
1643
1670
  }
1644
1671
  });
1645
- var Ie, He, De;
1646
- class qt extends Ze {
1672
+ var _scrollRestored, _unloadListener, _storesChangeListener2;
1673
+ const _TweakerElement = class _TweakerElement extends TweakerFolderElement {
1647
1674
  constructor() {
1648
1675
  super({
1649
1676
  key: ""
1650
1677
  });
1651
- o(this, Ie, !1);
1652
- o(this, He, () => {
1653
- C.save();
1654
- });
1655
- o(this, De, Xt(() => {
1656
- j.current.forEach((e) => {
1657
- if (e.name) {
1658
- const i = e.name.split(".");
1678
+ __privateAdd(this, _scrollRestored, !1);
1679
+ __privateAdd(this, _unloadListener, /* @__PURE__ */ __name(() => {
1680
+ tweakerStorage.save();
1681
+ }, "#unloadListener"));
1682
+ __privateAdd(this, _storesChangeListener2, debounce(() => {
1683
+ activeStores.current.forEach((store) => {
1684
+ if (store.name) {
1685
+ const sname = store.name.split(".");
1659
1686
  this.handleStore({
1660
- store: e,
1661
- remainingFolders: i.length > 1 ? i.slice(0, -1) : []
1687
+ store,
1688
+ remainingFolders: sname.length > 1 ? sname.slice(0, -1) : []
1662
1689
  });
1663
1690
  }
1664
- }), t(this, Ie) || (c(this, Ie, !0), this.contentElement.scroll({
1665
- top: C.scrollValue
1691
+ }), __privateGet(this, _scrollRestored) || (__privateSet(this, _scrollRestored, !0), this.contentElement.scroll({
1692
+ top: tweakerStorage.scrollValue
1666
1693
  }), this.contentElement.addEventListener("scroll", () => {
1667
- C.scrollValue = this.contentElement.scrollTop;
1694
+ tweakerStorage.scrollValue = this.contentElement.scrollTop;
1668
1695
  }));
1669
1696
  }, 10));
1670
- C.load(), this.shadowRoot.adoptedStyleSheets = [
1697
+ tweakerStorage.load(), this.shadowRoot.adoptedStyleSheets = [
1671
1698
  ...this.shadowRoot.adoptedStyleSheets,
1672
- Ts
1699
+ stylesheet
1673
1700
  ], this.head.current = [
1674
- w({
1701
+ div({
1675
1702
  class: "tweaker-buttons",
1676
- onClick: (e) => {
1703
+ onClick: /* @__PURE__ */ __name((e) => {
1677
1704
  e.stopPropagation();
1678
- },
1705
+ }, "onClick"),
1679
1706
  children: [
1680
- ee({
1707
+ button({
1681
1708
  class: "tweaker-button",
1682
- children: $t,
1683
- onClick: () => {
1684
- K.resetState();
1685
- }
1709
+ children: resetIcon,
1710
+ onClick: /* @__PURE__ */ __name(() => {
1711
+ storeRegistry.resetState();
1712
+ }, "onClick")
1686
1713
  }),
1687
- ee({
1714
+ button({
1688
1715
  class: ["tweaker-button"],
1689
- children: [It],
1690
- onClick: () => {
1716
+ children: [copyIcon],
1717
+ onClick: /* @__PURE__ */ __name(() => {
1691
1718
  navigator.clipboard.writeText(
1692
- JSON.stringify(K.getState())
1719
+ JSON.stringify(storeRegistry.getState())
1693
1720
  );
1694
- }
1721
+ }, "onClick")
1695
1722
  }),
1696
- ee({
1723
+ button({
1697
1724
  class: "tweaker-button",
1698
- children: as,
1699
- onClick: () => {
1700
- Ut(K.name, K.getState());
1701
- }
1725
+ children: downloadIcon,
1726
+ onClick: /* @__PURE__ */ __name(() => {
1727
+ createJSONAndSave(storeRegistry.name, storeRegistry.getState());
1728
+ }, "onClick")
1702
1729
  }),
1703
- Ft({
1730
+ label({
1704
1731
  class: "tweaker-button",
1705
1732
  children: [
1706
- ls,
1707
- Ve({
1733
+ uploadIcon,
1734
+ input({
1708
1735
  type: "file",
1709
1736
  style: {
1710
1737
  display: "none"
1711
1738
  },
1712
- onChange: (e) => {
1713
- var h;
1714
- const n = (h = e.currentTarget.files) == null ? void 0 : h[0];
1715
- if (n) {
1716
- const u = new FileReader();
1717
- u.onload = (m) => {
1718
- var L, v;
1719
- const k = (v = (L = m.target) == null ? void 0 : L.result) == null ? void 0 : v.toString();
1720
- k && K.loadState(k);
1721
- }, u.readAsText(n);
1739
+ onChange: /* @__PURE__ */ __name((e) => {
1740
+ var _a;
1741
+ const file = (_a = e.currentTarget.files) == null ? void 0 : _a[0];
1742
+ if (file) {
1743
+ const reader = new FileReader();
1744
+ reader.onload = (e2) => {
1745
+ var _a2, _b;
1746
+ const result = (_b = (_a2 = e2.target) == null ? void 0 : _a2.result) == null ? void 0 : _b.toString();
1747
+ result && storeRegistry.loadState(result);
1748
+ }, reader.readAsText(file);
1722
1749
  }
1723
- }
1750
+ }, "onChange")
1724
1751
  })
1725
1752
  ]
1726
1753
  })
1727
1754
  ]
1728
1755
  })
1729
- ], g(this.bodyElement, {
1756
+ ], element(this.bodyElement, {
1730
1757
  children: [
1731
- w({
1758
+ div({
1732
1759
  class: "resize",
1733
- onPointerdown: (e) => {
1734
- e.preventDefault();
1735
- const i = this.getBoundingClientRect(), n = this.contentElement.scrollTop;
1736
- Et(
1737
- (h) => {
1738
- const u = e.x - h.x, m = Math.max(400, i.width + u);
1739
- this.style.width = m + "px", C.changeSize("tweaker", m);
1760
+ onPointerdown: /* @__PURE__ */ __name((grabEvent) => {
1761
+ grabEvent.preventDefault();
1762
+ const rect = this.getBoundingClientRect(), scrollValue = this.contentElement.scrollTop;
1763
+ setupDrag(
1764
+ (moveEvent) => {
1765
+ const dx = grabEvent.x - moveEvent.x, newSize = Math.max(400, rect.width + dx);
1766
+ this.style.width = newSize + "px", tweakerStorage.changeSize("tweaker", newSize);
1740
1767
  },
1741
1768
  () => {
1742
1769
  setTimeout(() => {
1743
1770
  this.contentElement.scroll({
1744
- top: n
1771
+ top: scrollValue
1745
1772
  });
1746
1773
  }, 10);
1747
1774
  }
1748
1775
  );
1749
- },
1750
- onDblclick: () => {
1751
- this.style.width = "", C.changeSize("tweaker", null);
1752
- }
1776
+ }, "onPointerdown"),
1777
+ onDblclick: /* @__PURE__ */ __name(() => {
1778
+ this.style.width = "", tweakerStorage.changeSize("tweaker", null);
1779
+ }, "onDblclick")
1753
1780
  })
1754
1781
  ]
1755
1782
  });
1756
1783
  }
1757
1784
  connectedCallback() {
1758
- super.connectedCallback(), window.addEventListener("beforeunload", t(this, He)), j.subscribe(t(this, De)), C.changedSizes("tweaker") && (this.style.width = C.changedSizes("tweaker") + "px");
1785
+ super.connectedCallback(), window.addEventListener("beforeunload", __privateGet(this, _unloadListener)), activeStores.subscribe(__privateGet(this, _storesChangeListener2)), tweakerStorage.changedSizes("tweaker") && (this.style.width = tweakerStorage.changedSizes("tweaker") + "px");
1759
1786
  }
1760
1787
  disconnectedCallback() {
1761
- window.removeEventListener("beforeunload", t(this, He)), C.save(), j.unsubscribe(t(this, De));
1788
+ window.removeEventListener("beforeunload", __privateGet(this, _unloadListener)), tweakerStorage.save(), activeStores.unsubscribe(__privateGet(this, _storesChangeListener2));
1762
1789
  }
1763
- }
1764
- Ie = new WeakMap(), He = new WeakMap(), De = new WeakMap();
1765
- p && !customElements.get("e-tweaker") && customElements.define("e-tweaker", qt);
1766
- p && document.body.appendChild(new qt());
1790
+ };
1791
+ _scrollRestored = new WeakMap(), _unloadListener = new WeakMap(), _storesChangeListener2 = new WeakMap(), __name(_TweakerElement, "TweakerElement");
1792
+ let TweakerElement = _TweakerElement;
1793
+ isBrowser && !customElements.get("e-tweaker") && customElements.define("e-tweaker", TweakerElement);
1794
+ isBrowser && document.body.appendChild(new TweakerElement());