@mhmo91/schmancy 0.10.37 → 0.10.39

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 (558) hide show
  1. package/custom-elements.json +39 -0
  2. package/dist/{SchmancyElement-CDT2q1lA.js → SchmancyElement-BNnyBOwk.js} +9 -7
  3. package/dist/{SchmancyElement-CDT2q1lA.js.map → SchmancyElement-BNnyBOwk.js.map} +1 -1
  4. package/dist/{SchmancyElement-BHfQg3Tj.cjs → SchmancyElement-C41uPa6l.cjs} +2 -2
  5. package/dist/{SchmancyElement-BHfQg3Tj.cjs.map → SchmancyElement-C41uPa6l.cjs.map} +1 -1
  6. package/dist/agent/schmancy.agent.js +2334 -2297
  7. package/dist/agent/schmancy.agent.js.map +1 -1
  8. package/dist/area-2FrTZI_T.cjs +21 -0
  9. package/dist/area-2FrTZI_T.cjs.map +1 -0
  10. package/dist/{area-KtULlxuA.js → area-KVDzhT4s.js} +4 -4
  11. package/dist/area-KVDzhT4s.js.map +1 -0
  12. package/dist/area.cjs +1 -1
  13. package/dist/area.js +2 -2
  14. package/dist/{audio-zIJVTo_V.js → audio-D3gnp15Y.js} +1 -1
  15. package/dist/{audio-zIJVTo_V.js.map → audio-D3gnp15Y.js.map} +1 -1
  16. package/dist/{audio-CUMAv9D_.cjs → audio-EaD0Ggfh.cjs} +1 -1
  17. package/dist/{audio-CUMAv9D_.cjs.map → audio-EaD0Ggfh.cjs.map} +1 -1
  18. package/dist/audio.cjs +1 -1
  19. package/dist/audio.js +2 -2
  20. package/dist/autocomplete-DMmxsvUe.cjs +115 -0
  21. package/dist/autocomplete-DMmxsvUe.cjs.map +1 -0
  22. package/dist/{autocomplete-DIScyo8Q.js → autocomplete-DWiEqlQf.js} +96 -96
  23. package/dist/autocomplete-DWiEqlQf.js.map +1 -0
  24. package/dist/autocomplete.cjs +1 -1
  25. package/dist/autocomplete.js +1 -1
  26. package/dist/avatar.cjs +1 -1
  27. package/dist/avatar.js +3 -3
  28. package/dist/badge.cjs +1 -1
  29. package/dist/badge.js +1 -1
  30. package/dist/{boat-OBZ77exO.cjs → boat-DsFJNfPH.cjs} +1 -1
  31. package/dist/{boat-OBZ77exO.cjs.map → boat-DsFJNfPH.cjs.map} +1 -1
  32. package/dist/{boat-BHPqSqJd.js → boat-fqodYt2n.js} +4 -4
  33. package/dist/{boat-BHPqSqJd.js.map → boat-fqodYt2n.js.map} +1 -1
  34. package/dist/boat.cjs +1 -1
  35. package/dist/boat.js +1 -1
  36. package/dist/breadcrumb.cjs +3 -3
  37. package/dist/breadcrumb.cjs.map +1 -1
  38. package/dist/breadcrumb.js +4 -4
  39. package/dist/breadcrumb.js.map +1 -1
  40. package/dist/{busy-BJNsKSCM.cjs → busy-Cj_PV7oC.cjs} +1 -1
  41. package/dist/{busy-BJNsKSCM.cjs.map → busy-Cj_PV7oC.cjs.map} +1 -1
  42. package/dist/{busy-Dut78y4L.js → busy-enYCTssB.js} +2 -2
  43. package/dist/{busy-Dut78y4L.js.map → busy-enYCTssB.js.map} +1 -1
  44. package/dist/busy.cjs +1 -1
  45. package/dist/busy.js +1 -1
  46. package/dist/button-B9RfBt-n.cjs +63 -0
  47. package/dist/button-B9RfBt-n.cjs.map +1 -0
  48. package/dist/{button-kcpPQavY.js → button-D6LJC-HC.js} +11 -9
  49. package/dist/button-D6LJC-HC.js.map +1 -0
  50. package/dist/button.cjs +7 -6
  51. package/dist/button.cjs.map +1 -1
  52. package/dist/button.js +18 -16
  53. package/dist/button.js.map +1 -1
  54. package/dist/{card-DxSKxCid.js → card-BHTz1GwB.js} +16 -16
  55. package/dist/card-BHTz1GwB.js.map +1 -0
  56. package/dist/{card-BLxPLqdQ.cjs → card-ThG_ZaQE.cjs} +3 -3
  57. package/dist/card-ThG_ZaQE.cjs.map +1 -0
  58. package/dist/card.cjs +1 -1
  59. package/dist/card.js +1 -1
  60. package/dist/{checkbox-BCLkhp5G.cjs → checkbox-C4zeib84.cjs} +2 -2
  61. package/dist/{checkbox-BCLkhp5G.cjs.map → checkbox-C4zeib84.cjs.map} +1 -1
  62. package/dist/{checkbox-B1wiM3Dv.js → checkbox-Ce0DlAdW.js} +6 -6
  63. package/dist/{checkbox-B1wiM3Dv.js.map → checkbox-Ce0DlAdW.js.map} +1 -1
  64. package/dist/checkbox.cjs +1 -1
  65. package/dist/checkbox.js +1 -1
  66. package/dist/{chips-vWmwqQed.js → chips-BoZSpSh_.js} +21 -19
  67. package/dist/chips-BoZSpSh_.js.map +1 -0
  68. package/dist/{chips-C9dS1WKn.cjs → chips-wfJ7YtWv.cjs} +4 -3
  69. package/dist/chips-wfJ7YtWv.cjs.map +1 -0
  70. package/dist/chips.cjs +1 -1
  71. package/dist/chips.js +2 -2
  72. package/dist/connectivity.cjs +1 -1
  73. package/dist/connectivity.js +3 -3
  74. package/dist/content-drawer.cjs +1 -1
  75. package/dist/content-drawer.js +1 -1
  76. package/dist/cursor-glow-Ah7VXSj7.js.map +1 -1
  77. package/dist/cursor-glow-Bulq-38P.cjs.map +1 -1
  78. package/dist/{date-range-BV6HuvLw.cjs → date-range-BHSzlwSL.cjs} +2 -2
  79. package/dist/date-range-BHSzlwSL.cjs.map +1 -0
  80. package/dist/{date-range-D3ge1b4c.js → date-range-DJrdpzev.js} +4 -4
  81. package/dist/date-range-DJrdpzev.js.map +1 -0
  82. package/dist/{date-range-inline-DpYgdLRv.cjs → date-range-inline-D0I6k84h.cjs} +1 -1
  83. package/dist/{date-range-inline-DpYgdLRv.cjs.map → date-range-inline-D0I6k84h.cjs.map} +1 -1
  84. package/dist/{date-range-inline-DuWQaWps.js → date-range-inline-DjRdMZ1z.js} +2 -2
  85. package/dist/{date-range-inline-DuWQaWps.js.map → date-range-inline-DjRdMZ1z.js.map} +1 -1
  86. package/dist/date-range-inline.cjs +1 -1
  87. package/dist/date-range-inline.js +1 -1
  88. package/dist/date-range.cjs +1 -1
  89. package/dist/date-range.js +1 -1
  90. package/dist/delay.cjs +1 -1
  91. package/dist/delay.js +2 -2
  92. package/dist/{details-C-GZaq3j.js → details-CY49XVfp.js} +43 -35
  93. package/dist/details-CY49XVfp.js.map +1 -0
  94. package/dist/details-DQNj2oaU.cjs +164 -0
  95. package/dist/details-DQNj2oaU.cjs.map +1 -0
  96. package/dist/details.cjs +1 -1
  97. package/dist/details.js +1 -1
  98. package/dist/{directives-D_l1E5H6.cjs → directives-Bb0S1DKZ.cjs} +3 -3
  99. package/dist/directives-Bb0S1DKZ.cjs.map +1 -0
  100. package/dist/{directives-DyS51FUh.js → directives-Bfm1lkoy.js} +6 -8
  101. package/dist/directives-Bfm1lkoy.js.map +1 -0
  102. package/dist/directives.cjs +1 -1
  103. package/dist/directives.js +2 -2
  104. package/dist/{divider-nQffE0AD.js → divider-BeyX_C0A.js} +2 -2
  105. package/dist/{divider-nQffE0AD.js.map → divider-BeyX_C0A.js.map} +1 -1
  106. package/dist/{divider-CBnAmHMZ.cjs → divider-Ck2C1sKl.cjs} +1 -1
  107. package/dist/{divider-CBnAmHMZ.cjs.map → divider-Ck2C1sKl.cjs.map} +1 -1
  108. package/dist/divider.cjs +1 -1
  109. package/dist/divider.js +1 -1
  110. package/dist/dropdown.cjs +1 -1
  111. package/dist/dropdown.js +2 -2
  112. package/dist/{expand-DvTb-UPR.js → expand-BYsSEtp6.js} +53 -53
  113. package/dist/expand-BYsSEtp6.js.map +1 -0
  114. package/dist/expand-CUF163mg.cjs +141 -0
  115. package/dist/expand-CUF163mg.cjs.map +1 -0
  116. package/dist/expand.cjs +1 -1
  117. package/dist/expand.js +1 -1
  118. package/dist/fab.cjs +2 -1
  119. package/dist/fab.cjs.map +1 -1
  120. package/dist/fab.js +3 -2
  121. package/dist/fab.js.map +1 -1
  122. package/dist/{float-C-Ko0Le3.js → float-Cgllk_H9.js} +2 -2
  123. package/dist/{float-C-Ko0Le3.js.map → float-Cgllk_H9.js.map} +1 -1
  124. package/dist/{float-C17xgMT1.cjs → float-OvqX0nqG.cjs} +1 -1
  125. package/dist/{float-C17xgMT1.cjs.map → float-OvqX0nqG.cjs.map} +1 -1
  126. package/dist/float.cjs +1 -1
  127. package/dist/float.js +1 -1
  128. package/dist/form-4GKROq2P.cjs +27 -0
  129. package/dist/form-4GKROq2P.cjs.map +1 -0
  130. package/dist/{form-DA0hUu2h.js → form-DxaV_Ose.js} +39 -39
  131. package/dist/form-DxaV_Ose.js.map +1 -0
  132. package/dist/form.cjs +3 -3
  133. package/dist/form.cjs.map +1 -1
  134. package/dist/form.js +34 -34
  135. package/dist/form.js.map +1 -1
  136. package/dist/gravity-6pL6CfIr.cjs.map +1 -1
  137. package/dist/gravity-sVK3zGBF.js.map +1 -1
  138. package/dist/handover/agent-runtime-followups.md +1 -1
  139. package/dist/handover/agent-runtime-v1.md +3 -3
  140. package/dist/{icons-C6UfxmHZ.js → icons-CJ2mXcBi.js} +9 -9
  141. package/dist/icons-CJ2mXcBi.js.map +1 -0
  142. package/dist/icons-sZ-LybA9.cjs +24 -0
  143. package/dist/icons-sZ-LybA9.cjs.map +1 -0
  144. package/dist/icons.cjs +1 -1
  145. package/dist/icons.js +1 -1
  146. package/dist/{iframe-BTjZfYyh.js → iframe-DWvN5nGB.js} +11 -11
  147. package/dist/iframe-DWvN5nGB.js.map +1 -0
  148. package/dist/{iframe-wuYT2xFz.cjs → iframe-DpCv-QH2.cjs} +7 -7
  149. package/dist/iframe-DpCv-QH2.cjs.map +1 -0
  150. package/dist/iframe.cjs +1 -1
  151. package/dist/iframe.js +1 -1
  152. package/dist/index.cjs +1 -1
  153. package/dist/index.js +35 -35
  154. package/dist/{input-B_4g2ulO.js → input-BCCHz6tB.js} +7 -7
  155. package/dist/input-BCCHz6tB.js.map +1 -0
  156. package/dist/{input-BrDiIT60.cjs → input-Z-3N5JMv.cjs} +2 -2
  157. package/dist/input-Z-3N5JMv.cjs.map +1 -0
  158. package/dist/{input-chip-BlWhOruv.js → input-chip-BOrcKH-H.js} +2 -2
  159. package/dist/{input-chip-BlWhOruv.js.map → input-chip-BOrcKH-H.js.map} +1 -1
  160. package/dist/{input-chip-B-XWh4aE.cjs → input-chip-ChAgRCXZ.cjs} +1 -1
  161. package/dist/{input-chip-B-XWh4aE.cjs.map → input-chip-ChAgRCXZ.cjs.map} +1 -1
  162. package/dist/input.cjs +1 -1
  163. package/dist/input.js +1 -1
  164. package/dist/json.cjs +1 -1
  165. package/dist/json.js +3 -3
  166. package/dist/kbd.cjs +1 -1
  167. package/dist/kbd.js +2 -2
  168. package/dist/{layout-Dxit9enO.js → layout-CFiG3lNT.js} +1 -1
  169. package/dist/{layout-Dxit9enO.js.map → layout-CFiG3lNT.js.map} +1 -1
  170. package/dist/{layout-BhyIcEVu.cjs → layout-DZ4dpLh9.cjs} +1 -1
  171. package/dist/{layout-BhyIcEVu.cjs.map → layout-DZ4dpLh9.cjs.map} +1 -1
  172. package/dist/layout.cjs +1 -1
  173. package/dist/layout.js +2 -2
  174. package/dist/lazy-BaAiIUru.js +19 -0
  175. package/dist/lazy-BaAiIUru.js.map +1 -0
  176. package/dist/lazy-C-7a4FAe.cjs +1 -0
  177. package/dist/lazy-C-7a4FAe.cjs.map +1 -0
  178. package/dist/{lightbox-D85XAAuC.js → lightbox-B7Y4Nij_.js} +2 -2
  179. package/dist/lightbox-B7Y4Nij_.js.map +1 -0
  180. package/dist/{lightbox-CVBogswK.cjs → lightbox-Dpwsn8Qr.cjs} +1 -1
  181. package/dist/lightbox-Dpwsn8Qr.cjs.map +1 -0
  182. package/dist/lightbox.cjs +1 -1
  183. package/dist/lightbox.js +1 -1
  184. package/dist/{list-nVjLskgx.cjs → list-BhM-6dAi.cjs} +1 -1
  185. package/dist/{list-nVjLskgx.cjs.map → list-BhM-6dAi.cjs.map} +1 -1
  186. package/dist/{list-DOF_yVn5.js → list-C5WVoIfJ.js} +2 -2
  187. package/dist/{list-DOF_yVn5.js.map → list-C5WVoIfJ.js.map} +1 -1
  188. package/dist/list.cjs +1 -1
  189. package/dist/list.js +1 -1
  190. package/dist/magnetic-DKtc4umC.cjs.map +1 -1
  191. package/dist/magnetic-DaOOv5Dz.js.map +1 -1
  192. package/dist/{menu-QrAK5Uu9.js → menu-Dvi_tQgH.js} +3 -3
  193. package/dist/{menu-QrAK5Uu9.js.map → menu-Dvi_tQgH.js.map} +1 -1
  194. package/dist/{menu-DqmNjLgY.cjs → menu-GZARYp6I.cjs} +1 -1
  195. package/dist/{menu-DqmNjLgY.cjs.map → menu-GZARYp6I.cjs.map} +1 -1
  196. package/dist/menu.cjs +1 -1
  197. package/dist/menu.js +1 -1
  198. package/dist/{mixins-De1zjyhy.js → mixins-DGBI7YPO.js} +11 -11
  199. package/dist/mixins-DGBI7YPO.js.map +1 -0
  200. package/dist/{mixins-DxHpyMHA.cjs → mixins-fIpzhVMd.cjs} +1 -1
  201. package/dist/mixins-fIpzhVMd.cjs.map +1 -0
  202. package/dist/mixins.cjs +1 -1
  203. package/dist/mixins.js +2 -2
  204. package/dist/nav-drawer.cjs +1 -1
  205. package/dist/nav-drawer.js +1 -1
  206. package/dist/navigation-bar.cjs +1 -1
  207. package/dist/navigation-bar.js +1 -1
  208. package/dist/navigation-rail.cjs +3 -3
  209. package/dist/navigation-rail.cjs.map +1 -1
  210. package/dist/navigation-rail.js +11 -10
  211. package/dist/navigation-rail.js.map +1 -1
  212. package/dist/notification-B6yDL91t.cjs +24 -0
  213. package/dist/notification-B6yDL91t.cjs.map +1 -0
  214. package/dist/{notification-BtAK7NK8.js → notification-BB9OBRCr.js} +22 -22
  215. package/dist/notification-BB9OBRCr.js.map +1 -0
  216. package/dist/notification.cjs +1 -1
  217. package/dist/notification.js +1 -1
  218. package/dist/{option-DHwA0miA.js → option-B21ImL0k.js} +2 -2
  219. package/dist/{option-DHwA0miA.js.map → option-B21ImL0k.js.map} +1 -1
  220. package/dist/{option-DnSPa8ro.cjs → option-CJQM5I9q.cjs} +1 -1
  221. package/dist/{option-DnSPa8ro.cjs.map → option-CJQM5I9q.cjs.map} +1 -1
  222. package/dist/option.cjs +1 -1
  223. package/dist/option.js +1 -1
  224. package/dist/{overlay-Del1sBEB.js → overlay-DwJWVyk2.js} +75 -67
  225. package/dist/overlay-DwJWVyk2.js.map +1 -0
  226. package/dist/overlay-N0trD-4u.cjs +58 -0
  227. package/dist/overlay-N0trD-4u.cjs.map +1 -0
  228. package/dist/overlay.cjs +1 -1
  229. package/dist/{overlay.confirm-body-BV9umTAl.cjs → overlay.confirm-body-CtXIi421.cjs} +3 -3
  230. package/dist/overlay.confirm-body-CtXIi421.cjs.map +1 -0
  231. package/dist/{overlay.confirm-body-DSONXUzl.js → overlay.confirm-body-DwzKhXxM.js} +10 -10
  232. package/dist/overlay.confirm-body-DwzKhXxM.js.map +1 -0
  233. package/dist/overlay.js +4 -4
  234. package/dist/{overlay.service-BTp5Oq7f.js → overlay.service-BDLi0p5M.js} +4 -4
  235. package/dist/{overlay.service-BTp5Oq7f.js.map → overlay.service-BDLi0p5M.js.map} +1 -1
  236. package/dist/overlay.service-Dbu5uP9E.cjs +1 -0
  237. package/dist/{overlay.service-XLlrsSdA.cjs.map → overlay.service-Dbu5uP9E.cjs.map} +1 -1
  238. package/dist/{progress-DUbTL9g9.cjs → progress-B-Qg44XY.cjs} +1 -1
  239. package/dist/{progress-DUbTL9g9.cjs.map → progress-B-Qg44XY.cjs.map} +1 -1
  240. package/dist/{progress-DYA83CFU.js → progress-CUSS1sNz.js} +2 -2
  241. package/dist/{progress-DYA83CFU.js.map → progress-CUSS1sNz.js.map} +1 -1
  242. package/dist/progress.cjs +1 -1
  243. package/dist/progress.js +1 -1
  244. package/dist/{radio-group-DxX0iJBo.js → radio-group-AHLvrN8O.js} +7 -7
  245. package/dist/radio-group-AHLvrN8O.js.map +1 -0
  246. package/dist/{radio-group-B-ORNtvR.cjs → radio-group-BEtvCSS1.cjs} +2 -2
  247. package/dist/radio-group-BEtvCSS1.cjs.map +1 -0
  248. package/dist/radio-group.cjs +1 -1
  249. package/dist/radio-group.js +1 -1
  250. package/dist/range.cjs +1 -1
  251. package/dist/range.js +2 -2
  252. package/dist/select-BWpV2iv-.cjs +56 -0
  253. package/dist/select-BWpV2iv-.cjs.map +1 -0
  254. package/dist/{select-C7gkA-ab.js → select-Cawz88lG.js} +46 -46
  255. package/dist/select-Cawz88lG.js.map +1 -0
  256. package/dist/select.cjs +1 -1
  257. package/dist/select.js +1 -1
  258. package/dist/skeleton.cjs +1 -1
  259. package/dist/skeleton.js +2 -2
  260. package/dist/skills/SKILL.md +9 -0
  261. package/dist/skills/overlay.md +14 -7
  262. package/dist/skills/schmancy/SKILL.md +9 -0
  263. package/dist/skills/schmancy/overlay.md +14 -7
  264. package/dist/slider.cjs +1 -1
  265. package/dist/slider.js +2 -2
  266. package/dist/{sound.service-O0232os6.js → sound.service-CK-5zob-.js} +4 -3
  267. package/dist/sound.service-CK-5zob-.js.map +1 -0
  268. package/dist/{sound.service-C7FDY_yD.cjs → sound.service-D2GGaBXc.cjs} +1 -1
  269. package/dist/sound.service-D2GGaBXc.cjs.map +1 -0
  270. package/dist/{splash-screen-jfE47xl0.js → splash-screen-BUEtjHXC.js} +13 -13
  271. package/dist/splash-screen-BUEtjHXC.js.map +1 -0
  272. package/dist/{splash-screen-DIS4odDr.cjs → splash-screen-DqPuipox.cjs} +6 -6
  273. package/dist/splash-screen-DqPuipox.cjs.map +1 -0
  274. package/dist/splash-screen.cjs +1 -1
  275. package/dist/splash-screen.js +1 -1
  276. package/dist/{src-BP3h-9d9.js → src-8VJ7eluk.js} +46 -45
  277. package/dist/src-8VJ7eluk.js.map +1 -0
  278. package/dist/{src-Um_pzb-U.cjs → src-GJA8uSAS.cjs} +7 -6
  279. package/dist/src-GJA8uSAS.cjs.map +1 -0
  280. package/dist/{state-Bj0M9a6T.cjs → state-BxDNox-2.cjs} +1 -1
  281. package/dist/{state-Bj0M9a6T.cjs.map → state-BxDNox-2.cjs.map} +1 -1
  282. package/dist/{state-DscWQpoM.js → state-CnZCDMT0.js} +9 -9
  283. package/dist/{state-DscWQpoM.js.map → state-CnZCDMT0.js.map} +1 -1
  284. package/dist/state.cjs +1 -1
  285. package/dist/state.js +2 -2
  286. package/dist/steps.cjs +1 -1
  287. package/dist/steps.js +2 -2
  288. package/dist/{surface-B4Wn4SOO.js → surface-BMdG3dKQ.js} +2 -2
  289. package/dist/{surface-B4Wn4SOO.js.map → surface-BMdG3dKQ.js.map} +1 -1
  290. package/dist/{surface-DRq6cVW6.cjs → surface-CWwYD_z2.cjs} +1 -1
  291. package/dist/{surface-DRq6cVW6.cjs.map → surface-CWwYD_z2.cjs.map} +1 -1
  292. package/dist/surface.cjs +1 -1
  293. package/dist/surface.js +1 -1
  294. package/dist/switch.cjs +4 -4
  295. package/dist/switch.cjs.map +1 -1
  296. package/dist/switch.js +11 -11
  297. package/dist/switch.js.map +1 -1
  298. package/dist/table.cjs +1 -1
  299. package/dist/table.js +2 -2
  300. package/dist/{tabs-CnQPo-XS.js → tabs-CDQYDc6v.js} +2 -2
  301. package/dist/{tabs-CnQPo-XS.js.map → tabs-CDQYDc6v.js.map} +1 -1
  302. package/dist/{tabs-Ca_fbHPW.cjs → tabs-CbD9E1gd.cjs} +1 -1
  303. package/dist/{tabs-Ca_fbHPW.cjs.map → tabs-CbD9E1gd.cjs.map} +1 -1
  304. package/dist/tabs.cjs +1 -1
  305. package/dist/tabs.js +1 -1
  306. package/dist/teleport.cjs +1 -1
  307. package/dist/teleport.js +1 -1
  308. package/dist/textarea-Brgi-vD2.cjs +43 -0
  309. package/dist/textarea-Brgi-vD2.cjs.map +1 -0
  310. package/dist/{textarea-BvqENhTW.js → textarea-MPyrMi-S.js} +4 -4
  311. package/dist/textarea-MPyrMi-S.js.map +1 -0
  312. package/dist/textarea.cjs +1 -1
  313. package/dist/textarea.js +1 -1
  314. package/dist/{theme-BSwJ2YZo.cjs → theme-BMbXoqi0.cjs} +1 -1
  315. package/dist/{theme-BSwJ2YZo.cjs.map → theme-BMbXoqi0.cjs.map} +1 -1
  316. package/dist/{theme-BV0EzHQ1.js → theme-DZu-xmVp.js} +5 -5
  317. package/dist/{theme-BV0EzHQ1.js.map → theme-DZu-xmVp.js.map} +1 -1
  318. package/dist/{theme-button-C6fpUzPM.cjs → theme-button-B0OLb-43.cjs} +1 -1
  319. package/dist/{theme-button-C6fpUzPM.cjs.map → theme-button-B0OLb-43.cjs.map} +1 -1
  320. package/dist/{theme-button-O_xNCgI7.js → theme-button-D_qGvEYs.js} +2 -2
  321. package/dist/{theme-button-O_xNCgI7.js.map → theme-button-D_qGvEYs.js.map} +1 -1
  322. package/dist/theme-button.cjs +1 -1
  323. package/dist/theme-button.js +1 -1
  324. package/dist/theme.cjs +1 -1
  325. package/dist/theme.js +3 -3
  326. package/dist/{theme.service-DwLhhOmP.js → theme.service-7VkM-hVf.js} +15 -11
  327. package/dist/theme.service-7VkM-hVf.js.map +1 -0
  328. package/dist/theme.service-B15FdjOS.cjs +1 -0
  329. package/dist/theme.service-B15FdjOS.cjs.map +1 -0
  330. package/dist/tree.cjs +4 -4
  331. package/dist/tree.cjs.map +1 -1
  332. package/dist/tree.js +8 -8
  333. package/dist/tree.js.map +1 -1
  334. package/dist/{typography-opFYuUYS.cjs → typography-D4Fo1UGh.cjs} +3 -3
  335. package/dist/{typography-opFYuUYS.cjs.map → typography-D4Fo1UGh.cjs.map} +1 -1
  336. package/dist/{typography-Dtdooaic.js → typography-SZhjb_4R.js} +9 -9
  337. package/dist/{typography-Dtdooaic.js.map → typography-SZhjb_4R.js.map} +1 -1
  338. package/dist/typography.cjs +1 -1
  339. package/dist/typography.js +1 -1
  340. package/dist/visually-hidden.cjs +1 -1
  341. package/dist/visually-hidden.js +2 -2
  342. package/dist/{window-ConcHirJ.js → window-BDVyrBnk.js} +101 -100
  343. package/dist/window-BDVyrBnk.js.map +1 -0
  344. package/dist/window-BbBYjm7R.cjs +59 -0
  345. package/dist/window-BbBYjm7R.cjs.map +1 -0
  346. package/dist/window.cjs +1 -1
  347. package/dist/window.js +1 -1
  348. package/package.json +1 -1
  349. package/skills/schmancy/SKILL.md +9 -0
  350. package/skills/schmancy/overlay.md +14 -7
  351. package/src/area/area.component.ts +1 -1
  352. package/src/area/area.service.test.ts +2 -2
  353. package/src/area/area.service.ts +1 -1
  354. package/src/area/lazy.ts +87 -83
  355. package/src/audio/sound.service.ts +3 -3
  356. package/src/badge/badge.ts +1 -0
  357. package/src/breadcrumb/breadcrumb.ts +2 -2
  358. package/src/button/button.ts +12 -11
  359. package/src/button/icon-button.ts +19 -18
  360. package/src/card/card.ts +16 -16
  361. package/src/content-drawer/drawer.ts +6 -6
  362. package/src/details/details.ts +55 -55
  363. package/src/directives/ai-badge.ts +2 -1
  364. package/src/directives/animate-text.ts +2 -1
  365. package/src/directives/art/art.directive.ts +2 -1
  366. package/src/directives/battery.ts +2 -1
  367. package/src/directives/confirm-click.ts +5 -3
  368. package/src/directives/cursor-glow.ts +2 -1
  369. package/src/directives/cycle-text.ts +2 -1
  370. package/src/directives/depth-of-field.ts +2 -1
  371. package/src/directives/drag.ts +4 -2
  372. package/src/directives/fyi.ts +2 -1
  373. package/src/directives/gravity.ts +2 -1
  374. package/src/directives/hummingbird.ts +2 -1
  375. package/src/directives/intersect.ts +3 -2
  376. package/src/directives/liquid.ts +2 -1
  377. package/src/directives/living-border.ts +2 -1
  378. package/src/directives/long-press.ts +2 -1
  379. package/src/directives/magnetic.ts +2 -1
  380. package/src/directives/missed-punch.ts +2 -1
  381. package/src/directives/nebula.ts +6 -5
  382. package/src/directives/overflow-within.ts +2 -1
  383. package/src/directives/reveal.ts +2 -1
  384. package/src/directives/urgent.ts +2 -1
  385. package/src/directives/working-snake.ts +2 -1
  386. package/src/expand/expand-root.component.ts +27 -27
  387. package/src/expand/expand.component.ts +48 -48
  388. package/src/fab/fab.ts +1 -0
  389. package/src/form/fields/autocomplete/autocomplete.ts +154 -154
  390. package/src/form/fields/checkbox/checkbox.ts +4 -4
  391. package/src/form/fields/chips/chips.ts +2 -2
  392. package/src/form/fields/chips/filter-chip.ts +16 -15
  393. package/src/form/fields/date-range/date-range.ts +2 -2
  394. package/src/form/fields/input/input.ts +12 -12
  395. package/src/form/fields/radio-group/radio-button.ts +2 -2
  396. package/src/form/fields/radio-group/radio-group.ts +3 -3
  397. package/src/form/fields/select/select.ts +56 -56
  398. package/src/form/fields/switch/switch.ts +10 -10
  399. package/src/form/fields/textarea/textarea.ts +2 -2
  400. package/src/form/form-summary.ts +33 -33
  401. package/src/form/form.ts +45 -45
  402. package/src/icons/icon.ts +10 -8
  403. package/src/iframe/iframe.ts +11 -11
  404. package/src/lightbox/flip-directive.ts +2 -1
  405. package/src/lightbox/lightbox.directive.ts +2 -1
  406. package/src/nav-drawer/navbar.ts +3 -3
  407. package/src/navigation-rail/navigation-rail.ts +10 -10
  408. package/src/notification/notification.ts +22 -22
  409. package/src/overlay/overlay.component.ts +106 -83
  410. package/src/overlay/overlay.confirm-body.ts +4 -4
  411. package/src/overlay/overlay.service.ts +3 -3
  412. package/src/overlay/overlay.types.ts +4 -2
  413. package/src/splash-screen/splash-screen.ts +11 -11
  414. package/src/state/index.ts +12 -12
  415. package/src/state/schmancy-context.ts +9 -9
  416. package/src/teleport/teleport.component.ts +2 -2
  417. package/src/theme/theme.service.ts +17 -17
  418. package/src/tree/tree.ts +7 -7
  419. package/src/typography/typography.ts +7 -7
  420. package/src/window/window-manager.ts +20 -20
  421. package/src/window/window.ts +100 -100
  422. package/types/mixins/SchmancyElement.d.ts +3 -2
  423. package/types/mixins/formField.mixin.d.ts +1 -1
  424. package/types/src/area/area.service.d.ts +1 -1
  425. package/types/src/area/lazy.d.ts +0 -6
  426. package/types/src/audio/sound.service.d.ts +1 -2
  427. package/types/src/breadcrumb/breadcrumb.d.ts +1 -1
  428. package/types/src/button/button.d.ts +3 -3
  429. package/types/src/button/icon-button.d.ts +6 -7
  430. package/types/src/card/card.d.ts +5 -5
  431. package/types/src/content-drawer/drawer.d.ts +1 -1
  432. package/types/src/details/details.d.ts +2 -21
  433. package/types/src/directives/ai-badge.d.ts +2 -2
  434. package/types/src/directives/animate-text.d.ts +2 -2
  435. package/types/src/directives/art/art.directive.d.ts +2 -2
  436. package/types/src/directives/battery.d.ts +2 -2
  437. package/types/src/directives/confirm-click.d.ts +2 -2
  438. package/types/src/directives/cursor-glow.d.ts +2 -2
  439. package/types/src/directives/cycle-text.d.ts +2 -2
  440. package/types/src/directives/depth-of-field.d.ts +2 -2
  441. package/types/src/directives/drag.d.ts +4 -4
  442. package/types/src/directives/fyi.d.ts +2 -2
  443. package/types/src/directives/gravity.d.ts +2 -2
  444. package/types/src/directives/hummingbird.d.ts +2 -2
  445. package/types/src/directives/intersect.d.ts +2 -2
  446. package/types/src/directives/liquid.d.ts +2 -2
  447. package/types/src/directives/living-border.d.ts +2 -2
  448. package/types/src/directives/long-press.d.ts +2 -2
  449. package/types/src/directives/magnetic.d.ts +2 -2
  450. package/types/src/directives/missed-punch.d.ts +2 -2
  451. package/types/src/directives/nebula.d.ts +2 -2
  452. package/types/src/directives/overflow-within.d.ts +2 -2
  453. package/types/src/directives/reveal.d.ts +2 -2
  454. package/types/src/directives/urgent.d.ts +2 -2
  455. package/types/src/directives/working-snake.d.ts +2 -2
  456. package/types/src/expand/expand-root.component.d.ts +8 -8
  457. package/types/src/expand/expand.component.d.ts +11 -11
  458. package/types/src/form/fields/autocomplete/autocomplete.d.ts +29 -29
  459. package/types/src/form/fields/checkbox/checkbox.d.ts +1 -1
  460. package/types/src/form/fields/chips/chips.d.ts +1 -1
  461. package/types/src/form/fields/chips/filter-chip.d.ts +1 -2
  462. package/types/src/form/fields/input/input.d.ts +3 -3
  463. package/types/src/form/fields/radio-group/radio-button.d.ts +1 -1
  464. package/types/src/form/fields/radio-group/radio-group.d.ts +1 -1
  465. package/types/src/form/fields/select/select.d.ts +8 -8
  466. package/types/src/form/fields/switch/switch.d.ts +3 -3
  467. package/types/src/form/fields/textarea/textarea.d.ts +1 -1
  468. package/types/src/form/form-summary.d.ts +7 -7
  469. package/types/src/form/form.d.ts +11 -11
  470. package/types/src/icons/icon.d.ts +2 -2
  471. package/types/src/iframe/iframe.d.ts +3 -3
  472. package/types/src/lightbox/flip-directive.d.ts +2 -2
  473. package/types/src/lightbox/lightbox.directive.d.ts +2 -2
  474. package/types/src/nav-drawer/navbar.d.ts +1 -1
  475. package/types/src/navigation-rail/navigation-rail.d.ts +2 -2
  476. package/types/src/notification/notification.d.ts +8 -8
  477. package/types/src/overlay/overlay.component.d.ts +16 -16
  478. package/types/src/overlay/overlay.confirm-body.d.ts +1 -1
  479. package/types/src/overlay/overlay.types.d.ts +4 -2
  480. package/types/src/splash-screen/splash-screen.d.ts +2 -2
  481. package/types/src/state/index.d.ts +1 -1
  482. package/types/src/state/schmancy-context.d.ts +3 -3
  483. package/types/src/teleport/teleport.component.d.ts +1 -1
  484. package/types/src/theme/theme.service.d.ts +1 -4
  485. package/types/src/tree/tree.d.ts +3 -3
  486. package/types/src/typography/typography.d.ts +1 -1
  487. package/types/src/window/window-manager.d.ts +2 -2
  488. package/types/src/window/window.d.ts +20 -20
  489. package/dist/area-KtULlxuA.js.map +0 -1
  490. package/dist/area-fdKhYB6T.cjs +0 -21
  491. package/dist/area-fdKhYB6T.cjs.map +0 -1
  492. package/dist/autocomplete-DEZk6wBD.cjs +0 -115
  493. package/dist/autocomplete-DEZk6wBD.cjs.map +0 -1
  494. package/dist/autocomplete-DIScyo8Q.js.map +0 -1
  495. package/dist/button-DzlHLjWO.cjs +0 -62
  496. package/dist/button-DzlHLjWO.cjs.map +0 -1
  497. package/dist/button-kcpPQavY.js.map +0 -1
  498. package/dist/card-BLxPLqdQ.cjs.map +0 -1
  499. package/dist/card-DxSKxCid.js.map +0 -1
  500. package/dist/chips-C9dS1WKn.cjs.map +0 -1
  501. package/dist/chips-vWmwqQed.js.map +0 -1
  502. package/dist/date-range-BV6HuvLw.cjs.map +0 -1
  503. package/dist/date-range-D3ge1b4c.js.map +0 -1
  504. package/dist/details-C-GZaq3j.js.map +0 -1
  505. package/dist/details-Dp5rLIWk.cjs +0 -164
  506. package/dist/details-Dp5rLIWk.cjs.map +0 -1
  507. package/dist/directives-D_l1E5H6.cjs.map +0 -1
  508. package/dist/directives-DyS51FUh.js.map +0 -1
  509. package/dist/expand-DvTb-UPR.js.map +0 -1
  510. package/dist/expand-mlP_3XWz.cjs +0 -141
  511. package/dist/expand-mlP_3XWz.cjs.map +0 -1
  512. package/dist/form-CwPHcQYB.cjs +0 -27
  513. package/dist/form-CwPHcQYB.cjs.map +0 -1
  514. package/dist/form-DA0hUu2h.js.map +0 -1
  515. package/dist/icons-C6UfxmHZ.js.map +0 -1
  516. package/dist/icons-CW3-oMSb.cjs +0 -24
  517. package/dist/icons-CW3-oMSb.cjs.map +0 -1
  518. package/dist/iframe-BTjZfYyh.js.map +0 -1
  519. package/dist/iframe-wuYT2xFz.cjs.map +0 -1
  520. package/dist/input-B_4g2ulO.js.map +0 -1
  521. package/dist/input-BrDiIT60.cjs.map +0 -1
  522. package/dist/lazy-CayEFyC3.cjs +0 -1
  523. package/dist/lazy-CayEFyC3.cjs.map +0 -1
  524. package/dist/lazy-D-bO2r4m.js +0 -13
  525. package/dist/lazy-D-bO2r4m.js.map +0 -1
  526. package/dist/lightbox-CVBogswK.cjs.map +0 -1
  527. package/dist/lightbox-D85XAAuC.js.map +0 -1
  528. package/dist/mixins-De1zjyhy.js.map +0 -1
  529. package/dist/mixins-DxHpyMHA.cjs.map +0 -1
  530. package/dist/notification-BtAK7NK8.js.map +0 -1
  531. package/dist/notification-DYzbUb5C.cjs +0 -24
  532. package/dist/notification-DYzbUb5C.cjs.map +0 -1
  533. package/dist/overlay-BVkqZmoS.cjs +0 -58
  534. package/dist/overlay-BVkqZmoS.cjs.map +0 -1
  535. package/dist/overlay-Del1sBEB.js.map +0 -1
  536. package/dist/overlay.confirm-body-BV9umTAl.cjs.map +0 -1
  537. package/dist/overlay.confirm-body-DSONXUzl.js.map +0 -1
  538. package/dist/overlay.service-XLlrsSdA.cjs +0 -1
  539. package/dist/radio-group-B-ORNtvR.cjs.map +0 -1
  540. package/dist/radio-group-DxX0iJBo.js.map +0 -1
  541. package/dist/select-B9uj_u-s.cjs +0 -56
  542. package/dist/select-B9uj_u-s.cjs.map +0 -1
  543. package/dist/select-C7gkA-ab.js.map +0 -1
  544. package/dist/sound.service-C7FDY_yD.cjs.map +0 -1
  545. package/dist/sound.service-O0232os6.js.map +0 -1
  546. package/dist/splash-screen-DIS4odDr.cjs.map +0 -1
  547. package/dist/splash-screen-jfE47xl0.js.map +0 -1
  548. package/dist/src-BP3h-9d9.js.map +0 -1
  549. package/dist/src-Um_pzb-U.cjs.map +0 -1
  550. package/dist/textarea-BvqENhTW.js.map +0 -1
  551. package/dist/textarea-qr7oL8oU.cjs +0 -43
  552. package/dist/textarea-qr7oL8oU.cjs.map +0 -1
  553. package/dist/theme.service-DwLhhOmP.js.map +0 -1
  554. package/dist/theme.service-kn9MC025.cjs +0 -1
  555. package/dist/theme.service-kn9MC025.cjs.map +0 -1
  556. package/dist/window-BSAemI9J.cjs +0 -59
  557. package/dist/window-BSAemI9J.cjs.map +0 -1
  558. package/dist/window-ConcHirJ.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-BDVyrBnk.js","names":["#state$"],"sources":["../src/window/window-manager.ts","../src/window/window-position.ts","../src/window/window.ts"],"sourcesContent":["/**\n * Window Manager — singleton service for multi-window coordination.\n *\n * Tracks all schmancy-window instances: positions, z-indices, focus, visual states.\n * Components register on connectedCallback, unregister on disconnectedCallback.\n * Focus changes, position updates, and overlap queries all flow through here.\n *\n * Follows the ThemeService singleton pattern (theme/theme.service.ts).\n *\n * Example:\n * windowManager.register('chat-1', bounds, 'bottom-right')\n * windowManager.focus('chat-1') // bumps z-index, updates focusedId\n * const overlaps = windowManager.findOverlaps(projectedBounds, 'chat-1')\n */\n\nimport { BehaviorSubject, Observable, distinctUntilChanged, map } from 'rxjs'\nimport { overlayStack } from '../utils/overlay-stack.js'\nimport type { WindowBounds, WindowRecord, WindowRegistryState, SnapTarget } from './window-registry.js'\n\nconst STORAGE_PREFIX = 'schmancy-window-'\nconst LEGACY_STORAGE_PREFIX = 'schmancy-float-'\n\nclass WindowManagerService {\n\tprivate static instance: WindowManagerService\n\n\treadonly #state$ = new BehaviorSubject<WindowRegistryState>({\n\t\twindows: new Map(),\n\t\tfocusedId: null,\n\t\tstackOrder: [],\n\t})\n\n\treadonly state$ = this.#state$.asObservable()\n\n\tprivate constructor() {}\n\n\tstatic getInstance(): WindowManagerService {\n\t\tif (!WindowManagerService.instance) {\n\t\t\tWindowManagerService.instance = new WindowManagerService()\n\t\t}\n\t\treturn WindowManagerService.instance\n\t}\n\n\t// ── Synchronous accessors ──────────────────────────────────────────\n\n\tget windows(): Map<string, WindowRecord> {\n\t\treturn this.#state$.value.windows\n\t}\n\n\tget focusedId(): string | null {\n\t\treturn this.#state$.value.focusedId\n\t}\n\n\t// ── Registration ───────────────────────────────────────────────────\n\n\tregister(id: string, initialBounds: WindowBounds, snapTarget: SnapTarget): void {\n\t\tconst state = this.#state$.value\n\t\tif (state.windows.has(id)) return\n\n\t\tconst zIndex = overlayStack.assignZIndex(id)\n\t\tconst record: WindowRecord = {\n\t\t\tid,\n\t\t\tbounds: initialBounds,\n\t\t\tvisualState: 'normal',\n\t\t\tzIndex,\n\t\t\topen: false,\n\t\t\tsnapTarget,\n\t\t}\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, record)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis.#state$.next({ ...state, windows, stackOrder })\n\t}\n\n\tunregister(id: string): void {\n\t\tconst state = this.#state$.value\n\t\tif (!state.windows.has(id)) return\n\n\t\toverlayStack.releaseId(id)\n\t\tconst windows = new Map(state.windows)\n\t\twindows.delete(id)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\t\tconst focusedId = state.focusedId === id ? null : state.focusedId\n\n\t\tthis.#state$.next({ ...state, windows, stackOrder, focusedId })\n\t}\n\n\t// ── State mutations ────────────────────────────────────────────────\n\n\tupdateBounds(id: string, bounds: WindowBounds): void {\n\t\tthis.updateRecord(id, { bounds })\n\t}\n\n\tupdateVisualState(id: string, visualState: WindowRecord['visualState']): void {\n\t\tthis.updateRecord(id, { visualState })\n\t}\n\n\tupdateOpen(id: string, open: boolean): void {\n\t\tthis.updateRecord(id, { open })\n\t}\n\n\tfocus(id: string): void {\n\t\tconst state = this.#state$.value\n\t\tif (!state.windows.has(id)) return\n\t\tif (state.focusedId === id) return\n\n\t\tconst zIndex = overlayStack.bringToFront(id)\n\t\tconst windows = new Map(state.windows)\n\t\tconst record = windows.get(id)\n\t\tif (record) {\n\t\t\twindows.set(id, { ...record, zIndex })\n\t\t}\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis.#state$.next({ ...state, windows, stackOrder, focusedId: id })\n\t}\n\n\t// ── Queries ────────────────────────────────────────────────────────\n\n\tfindOverlaps(bounds: WindowBounds, excludeId: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [id, record] of this.#state$.value.windows) {\n\t\t\tif (id === excludeId) continue\n\t\t\tif (rectsOverlap(bounds, record.bounds)) {\n\t\t\t\tresult.push(record)\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n\n\tgetNeighbors(id: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [otherId, record] of this.#state$.value.windows) {\n\t\t\tif (otherId !== id) result.push(record)\n\t\t}\n\t\treturn result\n\t}\n\n\t// ── Selectors ──────────────────────────────────────────────────────\n\n\tselectWindow(id: string): Observable<WindowRecord | undefined> {\n\t\treturn this.#state$.pipe(\n\t\t\tmap(state => state.windows.get(id)),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\tselectFocused(): Observable<string | null> {\n\t\treturn this.#state$.pipe(\n\t\t\tmap(state => state.focusedId),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\t// ── Persistence ────────────────────────────────────────────────────\n\n\tloadPosition(id: string): { x: number; y: number; anchor: string } | null {\n\t\ttry {\n\t\t\t// Try new key first, fall back to legacy\n\t\t\tconst raw = localStorage.getItem(STORAGE_PREFIX + id) ?? localStorage.getItem(LEGACY_STORAGE_PREFIX + id)\n\t\t\tif (!raw) return null\n\t\t\treturn JSON.parse(raw) as { x: number; y: number; anchor: string }\n\t\t} catch {\n\t\t\treturn null\n\t\t}\n\t}\n\n\tsavePosition(id: string, data: { x: number; y: number; anchor: string }): void {\n\t\ttry {\n\t\t\tlocalStorage.setItem(STORAGE_PREFIX + id, JSON.stringify(data))\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tclearPosition(id: string): void {\n\t\ttry {\n\t\t\tlocalStorage.removeItem(STORAGE_PREFIX + id)\n\t\t\tlocalStorage.removeItem(LEGACY_STORAGE_PREFIX + id)\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t// ── Internal ───────────────────────────────────────────────────────\n\n\tprivate updateRecord(id: string, updates: Partial<WindowRecord>): void {\n\t\tconst state = this.#state$.value\n\t\tconst record = state.windows.get(id)\n\t\tif (!record) return\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, { ...record, ...updates })\n\t\tthis.#state$.next({ ...state, windows })\n\t}\n}\n\n/** Simple rect overlap check (inline — no circular import with window-position) */\nfunction rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\nexport const windowManager = WindowManagerService.getInstance()\n","/**\n * Window Position — pure functions for overlap resolution, cascade, and snapping.\n *\n * All functions are stateless: they take window bounds and viewport dimensions,\n * return new bounds. No side effects, no DOM access, no subscriptions.\n *\n * Example:\n * const projected = { left: 100, top: 400, width: 360, height: 500 }\n * const neighbors = windowManager.findOverlaps(projected, 'my-id')\n * const resolved = resolveOverlap(projected, neighbors, { width: 1440, height: 900 })\n * // → { left: 144, top: 444, width: 360, height: 500 } (cascaded away from conflict)\n */\n\nimport type { WindowBounds, WindowRecord } from './window-registry.js'\n\nconst HEAD_HEIGHT = 44\nconst CASCADE_OFFSET = HEAD_HEIGHT\nconst MAX_CASCADE_ATTEMPTS = 10\n\n/** Check if two rectangles overlap (edges touching does NOT count as overlap) */\nexport function rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\n/**\n * Resolve overlap by cascading diagonally until no conflict.\n * Shifts by (HEAD_HEIGHT, HEAD_HEIGHT) per attempt, clamped to viewport.\n */\nexport function resolveOverlap(\n\tcandidate: WindowBounds,\n\texisting: WindowRecord[],\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\tconst bounds = { ...candidate }\n\n\tfor (let attempt = 0; attempt < MAX_CASCADE_ATTEMPTS; attempt++) {\n\t\tconst hasOverlap = existing.some(w => rectsOverlap(bounds, w.bounds))\n\t\tif (!hasOverlap) break\n\n\t\tbounds.left += CASCADE_OFFSET\n\t\tbounds.top += CASCADE_OFFSET\n\t}\n\n\treturn clampToViewport(bounds, viewport)\n}\n\n/**\n * Clamp bounds so the window stays fully within the viewport.\n */\nexport function clampToViewport(\n\tbounds: WindowBounds,\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\treturn {\n\t\twidth: bounds.width,\n\t\theight: bounds.height,\n\t\tleft: Math.max(0, Math.min(bounds.left, viewport.width - bounds.width)),\n\t\ttop: Math.max(0, Math.min(bounds.top, viewport.height - bounds.height)),\n\t}\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport {\n\tanimationFrameScheduler,\n\tauditTime,\n\tcatchError,\n\tEMPTY,\n\tfilter,\n\tfinalize,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tObservable,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n} from 'rxjs'\nimport { SPRING_SMOOTH, SPRING_SNAPPY } from '../utils/animation.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { reducedMotion$ } from '../directives/reduced-motion'\nimport { theme } from '../theme/theme.service.js'\nimport type { SnapCorner, WindowBounds, WindowVisualState } from './window-registry.js'\nimport { windowManager } from './window-manager.js'\nimport { resolveOverlap } from './window-position.js'\n\nconst HEAD_HEIGHT = 48\nconst DRAG_THRESHOLD = 5\n\ninterface Position {\n\tx: number\n\ty: number\n}\n\n@customElement('schmancy-window')\nexport default class SchmancyWindow extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: contents;\n\t\tposition: relative;\n\t\tz-index: 1000;\n\t}\n\t:host([hidden]) {\n\t\tdisplay: none !important;\n\t}\n`]\n\n\t@property({ type: String }) id: string = 'default'\n\t/** Override the expanded panel width (e.g. '320px', '24rem'). Defaults to responsive sizing. */\n\t@property({ type: String }) expandedWidth?: string\n\t/** Override the expanded panel height (e.g. '400px', '50vh'). */\n\t@property({ type: String }) expandedHeight?: string\n\t/** When true, uses a lower elevation shadow in the collapsed state. */\n\t@property({ type: Boolean, reflect: true }) lowered: boolean = false\n\t/** Corner the window is anchored to. */\n\t@property({ type: String }) corner: SnapCorner = 'bottom-right'\n\t/** When true, window can be resized by the user. */\n\t@property({ type: Boolean }) resizable = false\n\t/** When true, window stays at its dragged position instead of snapping to a corner. */\n\t@property({ type: Boolean }) freePosition = false\n\t/** Visual state of the window (minimized, normal, maximized). */\n\t@property({ type: String, reflect: true }) visualState: WindowVisualState = 'normal'\n\t/** Minimum width in pixels. */\n\t@property({ type: Number }) minWidth = 280\n\t/** Minimum height in pixels. */\n\t@property({ type: Number }) minHeight = 200\n\n\t/** Whether the body is expanded. */\n\t@property({ type: Boolean, reflect: true }) open = false\n\n\tprivate currentAnimation?: Animation\n\n\t/** Lazy rendering: body content not in DOM until first expand. */\n\t@state() private hasOpened = false\n\n\t// Internal position -- plain fields, updated directly during drag\n\tprivate position: Position = { x: 16, y: 16 }\n\t@state() private currentCorner: SnapCorner = 'bottom-right'\n\n\t// Track applied corner to avoid unnecessary style.removeProperty calls during drag\n\tprivate appliedCorner: string = ''\n\n\t// Refs\n\tprivate containerRef = createRef<HTMLElement>()\n\tprivate bodyRef = createRef<HTMLElement>()\n\tprivate headRef = createRef<HTMLElement>()\n\n\t// ============================================\n\t// COMPUTED\n\t// ============================================\n\n\tprivate get panelWidth(): string {\n\t\treturn this.expandedWidth ?? 'min(360px, calc(100vw - 32px))'\n\t}\n\n\tprivate get isBottomCorner(): boolean {\n\t\treturn this.currentCorner.startsWith('bottom')\n\t}\n\n\tprivate get closedClipPath(): string {\n\t\treturn this.isBottomCorner\n\t\t\t? `inset(calc(100% - ${HEAD_HEIGHT}px) 0px 0px 0px round 22px)`\n\t\t\t: `inset(0px 0px calc(100% - ${HEAD_HEIGHT}px) 0px round 22px)`\n\t}\n\n\tprivate get openClipPath(): string {\n\t\treturn 'inset(0px 0px 0px 0px round 12px)'\n\t}\n\n\tprivate get elevation(): 0 | 1 | 2 | 3 | 4 | 5 {\n\t\tif (this.open) return 4\n\t\treturn this.lowered ? 1 : 3\n\t}\n\n\t// ============================================\n\t// POSITION MANAGEMENT\n\t// ============================================\n\n\tprivate applyContainerPosition() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\t\t// Only clear position properties when corner changes (avoids 4 style invalidations per drag frame)\n\t\tif (this.appliedCorner !== this.currentCorner) {\n\t\t\tcontainer.style.removeProperty('left')\n\t\t\tcontainer.style.removeProperty('right')\n\t\t\tcontainer.style.removeProperty('top')\n\t\t\tcontainer.style.removeProperty('bottom')\n\t\t\tthis.appliedCorner = this.currentCorner\n\t\t}\n\t\tconst { x, y } = this.position\n\t\tif (this.currentCorner.includes('right')) {\n\t\t\tcontainer.style.right = `${x}px`\n\t\t} else {\n\t\t\tcontainer.style.left = `${x}px`\n\t\t}\n\t\tif (this.currentCorner.includes('bottom')) {\n\t\t\tcontainer.style.bottom = `${y + theme.bottomOffset}px`\n\t\t} else {\n\t\t\tcontainer.style.top = `${y}px`\n\t\t}\n\t}\n\n\tprivate static readonly VALID_CORNERS = new Set<string>(['top-left', 'top-right', 'bottom-left', 'bottom-right'])\n\n\tprivate loadPosition() {\n\t\tconst saved = windowManager.loadPosition(this.id)\n\t\tif (saved) {\n\t\t\tthis.position = { x: saved.x, y: saved.y }\n\t\t\tif (SchmancyWindow.VALID_CORNERS.has(saved.anchor)) {\n\t\t\t\tthis.currentCorner = saved.anchor as SnapCorner\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate savePosition() {\n\t\twindowManager.savePosition(this.id, { ...this.position, anchor: this.currentCorner })\n\t}\n\n\tprivate validateBounds() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\t\tconst rect = container.getBoundingClientRect()\n\t\tif (rect.width === 0) return\n\t\tconst vw = window.innerWidth\n\t\tconst vh = window.innerHeight\n\t\tconst isRight = this.currentCorner.includes('right')\n\t\tconst isBottom = this.currentCorner.includes('bottom')\n\t\tconst actualLeft = isRight ? vw - this.position.x - rect.width : this.position.x\n\t\tconst actualTop = isBottom ? vh - this.position.y - rect.height : this.position.y\n\t\tconst newLeft = Math.max(0, Math.min(actualLeft, vw - rect.width))\n\t\tconst newTop = Math.max(0, Math.min(actualTop, vh - rect.height))\n\t\tthis.position = {\n\t\t\tx: isRight ? vw - newLeft - rect.width : newLeft,\n\t\t\ty: isBottom ? vh - newTop - rect.height : newTop,\n\t\t}\n\t\tthis.applyContainerPosition()\n\t}\n\n\t// ============================================\n\t// CORNER SNAPPING\n\t// ============================================\n\n\tprivate reorientToNearestCorner(skipAnimation = false): void {\n\t\t// Free position mode: skip corner snapping\n\t\tif (this.freePosition) {\n\t\t\tthis.savePosition()\n\t\t\tconst rect = this.containerRef.value?.getBoundingClientRect()\n\t\t\tif (rect) {\n\t\t\t\twindowManager.updateBounds(this.id, { left: rect.left, top: rect.top, width: rect.width, height: rect.height })\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\n\t\t// F -- record current screen position before DOM mutation\n\t\tconst rect = container.getBoundingClientRect()\n\n\t\t// L -- calculate nearest corner using head visual center\n\t\tconst currentIsBottom = this.currentCorner.includes('bottom')\n\t\tconst headCenterX = rect.left + rect.width / 2\n\t\tconst headCenterY = currentIsBottom\n\t\t\t? rect.bottom - HEAD_HEIGHT / 2\n\t\t\t: rect.top + HEAD_HEIGHT / 2\n\t\tconst side = headCenterX > window.innerWidth / 2 ? 'right' : 'left'\n\t\tconst vert = headCenterY > window.innerHeight / 2 ? 'bottom' : 'top'\n\t\tconst newCorner: SnapCorner = `${vert}-${side}` as SnapCorner\n\n\t\t// Snap corner and reset offset to standard edge gap\n\t\tthis.currentCorner = newCorner\n\t\tthis.position = { x: 16, y: 16 }\n\t\tthis.applyContainerPosition()\n\t\t// Sync clip-path to new corner\n\t\tif (!this.open) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t}\n\n\t\tif (skipAnimation || reducedMotion$.value) {\n\t\t\tthis.savePosition()\n\t\t\tconst snapRect = container.getBoundingClientRect()\n\t\t\twindowManager.updateBounds(this.id, { left: snapRect.left, top: snapRect.top, width: snapRect.width, height: snapRect.height })\n\t\t\treturn\n\t\t}\n\n\t\t// I -- invert: shift element back to its original visual position\n\t\tconst newRect = container.getBoundingClientRect()\n\t\tconst dx = rect.left - newRect.left\n\t\tconst dy = rect.top - newRect.top\n\t\tcontainer.style.translate = `${dx}px ${dy}px`\n\n\t\t// P -- play: animate from the inverse offset to natural resting position\n\t\tconst flipKeyframes: Keyframe[] = [{ translate: `${dx}px ${dy}px` }, { translate: '0px 0px' }]\n\t\tconst anim = container.animate(\n\t\t\tflipKeyframes,\n\t\t\t{\n\t\t\t\tduration: SPRING_SMOOTH.duration,\n\t\t\t\teasing: SPRING_SMOOTH.easingFallback,\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t)\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) container.style.translate = ''\n\t\t\t\t// Report final resting bounds after animation completes\n\t\t\t\tconst finalRect = container.getBoundingClientRect()\n\t\t\t\twindowManager.updateBounds(this.id, { left: finalRect.left, top: finalRect.top, width: finalRect.width, height: finalRect.height })\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.savePosition()\n\t}\n\n\t// ============================================\n\t// DRAG PIPELINE\n\t// ============================================\n\n\tprivate drag$(): Observable<never> {\n\t\treturn new Observable(() => {\n\t\t\tconst head = this.headRef.value\n\t\t\tconst container = this.containerRef.value\n\t\t\tif (!head || !container) return\n\n\t\t\tlet didDrag = false\n\n\t\t\tconst sub = fromEvent<PointerEvent>(head, 'pointerdown').pipe(\n\t\t\t\tfilter(e => e.button === 0),\n\t\t\t\tfilter(e => {\n\t\t\t\t\tconst tag = (e.target as HTMLElement).tagName?.toLowerCase()\n\t\t\t\t\treturn !['input', 'textarea', 'select', 'button'].includes(tag)\n\t\t\t\t\t\t&& !(e.target as HTMLElement).closest('schmancy-input, schmancy-icon-button, button, a')\n\t\t\t\t}),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(e => {\n\t\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\t\tconst isBottom = this.currentCorner.includes('bottom')\n\t\t\t\t\t\tconst wasOpen = this.open\n\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstartX: e.clientX,\n\t\t\t\t\t\t\tstartY: e.clientY,\n\t\t\t\t\t\t\toffsetX: e.clientX - rect.left,\n\t\t\t\t\t\t\toffsetY: e.clientY - rect.top,\n\t\t\t\t\t\t\trect,\n\t\t\t\t\t\t\tvw: window.innerWidth,\n\t\t\t\t\t\t\tvh: window.innerHeight,\n\t\t\t\t\t\t\tisBottom,\n\t\t\t\t\t\t\twasOpen,\n\t\t\t\t\t\t\tpointerId: e.pointerId,\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tswitchMap(({ startX, startY, offsetX, offsetY, rect, vw, vh, isBottom, wasOpen, pointerId }) => {\n\t\t\t\t\t\tconst move$ = fromEvent<PointerEvent>(window, 'pointermove').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\t\t\t\tmap(e => ({ clientX: e.clientX, clientY: e.clientY })),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst end$ = fromEvent<PointerEvent>(window, 'pointerup').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn move$.pipe(\n\t\t\t\t\t\t\ttap(({ clientX, clientY }) => {\n\t\t\t\t\t\t\t\tconst dx = clientX - startX\n\t\t\t\t\t\t\t\tconst dy = clientY - startY\n\t\t\t\t\t\t\t\tif (Math.sqrt(dx * dx + dy * dy) > DRAG_THRESHOLD && !didDrag) {\n\t\t\t\t\t\t\t\t\tdidDrag = true\n\t\t\t\t\t\t\t\t\tthis.applyDragVisuals(true)\n\t\t\t\t\t\t\t\t\t// Collapse on first confirmed drag move\n\t\t\t\t\t\t\t\t\tif (wasOpen) {\n\t\t\t\t\t\t\t\t\t\tthis.open = false\n\t\t\t\t\t\t\t\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\t\t\t\t\t\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\t\t\t\t\t\t\t\tconst body = this.bodyRef.value\n\t\t\t\t\t\t\t\t\t\tif (body) {\n\t\t\t\t\t\t\t\t\t\t\tbody.inert = true\n\t\t\t\t\t\t\t\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!didDrag) return\n\n\t\t\t\t\t\t\t\tconst left = Math.max(0, Math.min(clientX - offsetX, vw - rect.width))\n\t\t\t\t\t\t\t\tconst minTop = isBottom ? HEAD_HEIGHT - rect.height : 0\n\t\t\t\t\t\t\t\tconst maxTop = isBottom ? vh - rect.height : vh - HEAD_HEIGHT\n\t\t\t\t\t\t\t\tconst top = Math.max(minTop, Math.min(clientY - offsetY, maxTop))\n\n\t\t\t\t\t\t\t\tthis.position = {\n\t\t\t\t\t\t\t\t\tx: this.currentCorner.includes('right') ? vw - left - rect.width : left,\n\t\t\t\t\t\t\t\t\ty: isBottom ? vh - top - rect.height : top,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.applyContainerPosition()\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttakeUntil(end$),\n\t\t\t\t\t\t\tfinalize(() => {\n\t\t\t\t\t\t\t\tif (didDrag) {\n\t\t\t\t\t\t\t\t\tthis.reorientToNearestCorner()\n\t\t\t\t\t\t\t\t\tthis.applyDragVisuals(false)\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t\tthis.toggle()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\treturn () => sub.unsubscribe()\n\t\t})\n\t}\n\n\t// ============================================\n\t// LIFECYCLE\n\t// ============================================\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Pipeline 1: DOM setup + manager registration + drag + z-index sync\n\t\tfrom(this.updateComplete).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis.currentCorner = this.corner\n\t\t\t\tthis.loadPosition()\n\t\t\t\tthis.applyContainerPosition()\n\t\t\t\tthis.initDOMState()\n\t\t\t\t// Register with window manager\n\t\t\t\tconst container = this.containerRef.value\n\t\t\t\tif (container) {\n\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\tconst bounds: WindowBounds = { left: rect.left, top: rect.top, width: rect.width, height: rect.height }\n\t\t\t\t\twindowManager.register(this.id, bounds, this.freePosition ? 'free' : this.currentCorner)\n\t\t\t\t}\n\t\t\t}),\n\t\t\tswitchMap(() => merge(\n\t\t\t\tthis.drag$(),\n\t\t\t\twindowManager.selectWindow(this.id).pipe(\n\t\t\t\t\ttap(record => {\n\t\t\t\t\t\tif (!record) return\n\t\t\t\t\t\tconst container = this.containerRef.value\n\t\t\t\t\t\tif (container) container.style.zIndex = String(record.zIndex)\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t)),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\n\t\t// Pipeline 3: Environment -- one subscription\n\t\tmerge(\n\t\t\tfromEvent(window, 'resize').pipe(\n\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\ttap(() => this.validateBounds()),\n\t\t\t),\n\t\t\ttheme.bottomOffset$.pipe(\n\t\t\t\ttap(() => this.applyContainerPosition()),\n\t\t\t),\n\t\t).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\twindowManager.unregister(this.id)\n\t}\n\n\tprivate initDOMState() {\n\t\tconst container = this.containerRef.value\n\t\tconst body = this.bodyRef.value\n\t\tif (!container) return\n\n\t\tthis.applyContainerPosition()\n\n\t\tif (this.open) {\n\t\t\tthis.hasOpened = true\n\t\t\tcontainer.style.overflow = ''\n\t\t\tif (body) {\n\t\t\t\tbody.inert = false\n\t\t\t\tbody.style.visibility = 'visible'\n\t\t\t}\n\t\t} else {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tif (body) {\n\t\t\t\tbody.inert = true\n\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t}\n\t\t}\n\t}\n\n\t// ============================================\n\t// ANIMATION\n\t// ============================================\n\n\tprivate animateOpen() {\n\t\tconst container = this.containerRef.value\n\t\tconst body = this.bodyRef.value\n\t\tif (!container) return\n\n\t\tthis.hasOpened = true\n\t\tthis.open = true\n\n\t\t// Overlap avoidance\n\t\tconst rect = container.getBoundingClientRect()\n\t\tconst projectedBounds: WindowBounds = {\n\t\t\tleft: rect.left,\n\t\t\ttop: this.isBottomCorner ? rect.top - 400 : rect.top,\n\t\t\twidth: rect.width,\n\t\t\theight: 400 + HEAD_HEIGHT,\n\t\t}\n\t\tconst overlaps = windowManager.findOverlaps(projectedBounds, this.id)\n\t\tif (overlaps.length > 0) {\n\t\t\tconst resolved = resolveOverlap(projectedBounds, overlaps, { width: window.innerWidth, height: window.innerHeight })\n\t\t\tif (Math.abs(resolved.left - projectedBounds.left) > 10 || Math.abs(resolved.top - projectedBounds.top) > 10) {\n\t\t\t\tconst isRight = this.currentCorner.includes('right')\n\t\t\t\tconst isBottom = this.currentCorner.includes('bottom')\n\t\t\t\tthis.position = {\n\t\t\t\t\tx: isRight ? window.innerWidth - resolved.left - resolved.width : resolved.left,\n\t\t\t\t\ty: isBottom ? window.innerHeight - resolved.top - resolved.height : resolved.top,\n\t\t\t\t}\n\t\t\t\tthis.applyContainerPosition()\n\t\t\t}\n\t\t}\n\n\t\tif (body) {\n\t\t\tbody.style.visibility = 'visible'\n\t\t\tbody.inert = false\n\t\t}\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = ''\n\t\t\tcontainer.style.overflow = ''\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t\t\treturn\n\t\t}\n\n\t\tthis.currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst openKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t]\n\t\tconst anim = container.animate(openKeyframes, {\n\t\t\tduration: SPRING_SNAPPY.duration,\n\t\t\teasing: SPRING_SNAPPY.easingFallback,\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis.currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) {\n\t\t\t\t\tcontainer.style.clipPath = ''\n\t\t\t\t\tcontainer.style.overflow = ''\n\t\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t}\n\n\tprivate animateClose() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tthis.open = false\n\t\t\tconst body = this.bodyRef.value\n\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t\t\treturn\n\t\t}\n\n\t\tthis.currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst closeKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t]\n\t\tconst anim = container.animate(closeKeyframes, {\n\t\t\tduration: Math.round(SPRING_SNAPPY.duration * 0.7),\n\t\t\teasing: 'cubic-bezier(0.4, 0, 0.8, 0.15)',\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis.currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis.open = false\n\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\tconst body = this.bodyRef.value\n\t\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t}\n\n\t// ============================================\n\t// VISUAL STATE HELPERS\n\t// ============================================\n\n\t/** Apply drag visuals directly on DOM refs — avoids full Lit re-render for cursor + opacity */\n\tprivate applyDragVisuals(dragging: boolean) {\n\t\tconst head = this.headRef.value\n\t\tconst container = this.containerRef.value\n\t\tif (head) {\n\t\t\thead.classList.toggle('cursor-grabbing', dragging)\n\t\t\thead.classList.toggle('cursor-move', !dragging)\n\t\t}\n\t\tif (container) {\n\t\t\tcontainer.style.opacity = dragging ? '0.95' : ''\n\t\t}\n\t}\n\n\tprivate handleFocus = () => windowManager.focus(this.id)\n\n\tprivate handleHeadKeydown = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault()\n\t\t\tthis.toggle()\n\t\t\treturn\n\t\t}\n\t\tif (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n\t\t\te.preventDefault()\n\t\t\tconst step = e.shiftKey ? 20 : 5\n\t\t\tconst dx = e.key === 'ArrowRight' ? step : e.key === 'ArrowLeft' ? -step : 0\n\t\t\tconst dy = e.key === 'ArrowDown' ? step : e.key === 'ArrowUp' ? -step : 0\n\t\t\tthis.position = { x: this.position.x + dx, y: this.position.y + dy }\n\t\t\tthis.applyContainerPosition()\n\t\t\tthis.savePosition()\n\t\t}\n\t}\n\n\t// ============================================\n\t// PUBLIC API\n\t// ============================================\n\n\ttoggle() {\n\t\tif (this.open) this.animateClose()\n\t\telse this.animateOpen()\n\t}\n\n\texpand() {\n\t\tif (this.open) return\n\t\tthis.animateOpen()\n\t}\n\n\tclose() {\n\t\tif (!this.open) return\n\t\tthis.animateClose()\n\t}\n\n\t// ============================================\n\t// RENDER\n\t// ============================================\n\n\tprotected render(): unknown {\n\t\tconst isBottom = this.currentCorner.startsWith('bottom')\n\n\t\tconst containerClasses = classMap({\n\t\t\tfixed: true,\n\t\t\tflex: true,\n\t\t\t'flex-col': isBottom,\n\t\t\t'flex-col-reverse': !isBottom,\n\t\t\t'z-1000': true,\n\t\t\t'rounded-2xl': this.open,\n\t\t\t'rounded-[22px]': !this.open,\n\t\t\t'overflow-hidden': true,\n\t\t})\n\n\t\tconst containerStyles = styleMap({\n\t\t\twidth: this.panelWidth,\n\t\t\t'max-height': 'calc(100vh - 32px)',\n\t\t\t'pointer-events': 'none',\n\t\t})\n\n\t\tconst bodyStyles = styleMap({\n\t\t\t'pointer-events': this.open ? 'auto' : 'none',\n\t\t})\n\n\t\tconst headClasses = classMap({\n\t\t\t'h-full': true,\n\t\t\t'px-3': true,\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'gap-2': true,\n\t\t\t'select-none': true,\n\t\t\t'cursor-move': true,\n\t\t})\n\n\t\treturn html`\n\t\t\t<schmancy-surface\n\t\t\t\t${ref(this.containerRef)}\n\t\t\t\ttype=\"glass\"\n\t\t\t\t.elevation=${this.elevation}\n\t\t\t\tclass=${containerClasses}\n\t\t\t\tstyle=${containerStyles}\n\t\t\t\taria-expanded=${this.open}\n\t\t\t\t@pointerdown=${this.handleFocus}\n\t\t\t>\n\t\t\t\t<!-- Details section (visually above summary for bottom corners) -->\n\t\t\t\t<section\n\t\t\t\t\t${ref(this.bodyRef)}\n\t\t\t\t\tclass=\"flex-1 min-h-0 overflow-hidden flex flex-col\"\n\t\t\t\t\tstyle=${bodyStyles}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Expandable content\"\n\t\t\t\t>\n\t\t\t\t\t${this.hasOpened ? html`<slot name=\"details\"></slot>` : nothing}\n\t\t\t\t</section>\n\n\t\t\t\t<!-- Summary section -- always interactive, always visible -->\n\t\t\t\t<section\n\t\t\t\t\tclass=\"shrink-0 bg-surface-lowest\"\n\t\t\t\t\tstyle=${styleMap({ 'pointer-events': 'auto', height: `${HEAD_HEIGHT}px` })}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\t${ref(this.headRef)}\n\t\t\t\t\t\t${cursorGlow({ radius: 200, intensity: 0.10 })}\n\t\t\t\t\t\tclass=${headClasses}\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\ttitle=\"Drag to move, click to expand\"\n\t\t\t\t\t\taria-label=\"${this.open ? 'Collapse window' : 'Expand window'}\"\n\t\t\t\t\t\t@keydown=${this.handleHeadKeydown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"flex-1 min-w-0\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"\n\t\t\t\t\t\t\tclass=\"shrink-0 text-surface-on/40 transition-transform duration-200 ${this.open ? 'rotate-180' : ''}\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M6 9L12 15L18 9\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-window': SchmancyWindow\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,IAAM,IAAiB,oBACjB,IAAwB;AAmL9B,S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CAAA;AAAA,SAAA,KAAA,GAAA,KAAA"}
@@ -0,0 +1,59 @@
1
+ require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-C41uPa6l.cjs`);require(`./mixins-fIpzhVMd.cjs`);const t=require(`./animation-CCOIW4wJ.cjs`),n=require(`./reduced-motion-Ds-HjMzn.cjs`),r=require(`./cursor-glow-Bulq-38P.cjs`),i=require(`./theme.service-B15FdjOS.cjs`),a=require(`./overlay-stack-Bdr9lOqi.cjs`);let o=require(`rxjs`),s=require(`lit/directives/class-map.js`),c=require(`lit/directives/style-map.js`),l=require(`lit/decorators.js`),u=require(`lit`),d=require(`lit/directives/ref.js`);var f=`schmancy-window-`,p=`schmancy-float-`;function m(e,t){return!(e.left>=t.left+t.width||e.left+e.width<=t.left||e.top>=t.top+t.height||e.top+e.height<=t.top)}var h,g=class e{#e;constructor(){this.#e=new o.BehaviorSubject({windows:new Map,focusedId:null,stackOrder:[]}),this.state$=this.#e.asObservable()}static getInstance(){return e.instance||=new e,e.instance}get windows(){return this.#e.value.windows}get focusedId(){return this.#e.value.focusedId}register(e,t,n){let r=this.#e.value;if(r.windows.has(e))return;let i={id:e,bounds:t,visualState:`normal`,zIndex:a.t.assignZIndex(e),open:!1,snapTarget:n},o=new Map(r.windows);o.set(e,i);let s=a.t.getStackOrder();this.#e.next({...r,windows:o,stackOrder:s})}unregister(e){let t=this.#e.value;if(!t.windows.has(e))return;a.t.releaseId(e);let n=new Map(t.windows);n.delete(e);let r=a.t.getStackOrder(),i=t.focusedId===e?null:t.focusedId;this.#e.next({...t,windows:n,stackOrder:r,focusedId:i})}updateBounds(e,t){this.updateRecord(e,{bounds:t})}updateVisualState(e,t){this.updateRecord(e,{visualState:t})}updateOpen(e,t){this.updateRecord(e,{open:t})}focus(e){let t=this.#e.value;if(!t.windows.has(e)||t.focusedId===e)return;let n=a.t.bringToFront(e),r=new Map(t.windows),i=r.get(e);i&&r.set(e,{...i,zIndex:n});let o=a.t.getStackOrder();this.#e.next({...t,windows:r,stackOrder:o,focusedId:e})}findOverlaps(e,t){let n=[];for(let[r,i]of this.#e.value.windows)r!==t&&m(e,i.bounds)&&n.push(i);return n}getNeighbors(e){let t=[];for(let[n,r]of this.#e.value.windows)n!==e&&t.push(r);return t}selectWindow(e){return this.#e.pipe((0,o.map)(t=>t.windows.get(e)),(0,o.distinctUntilChanged)())}selectFocused(){return this.#e.pipe((0,o.map)(e=>e.focusedId),(0,o.distinctUntilChanged)())}loadPosition(e){try{let t=localStorage.getItem(f+e)??localStorage.getItem(p+e);return t?JSON.parse(t):null}catch{return null}}savePosition(e,t){try{localStorage.setItem(f+e,JSON.stringify(t))}catch{}}clearPosition(e){try{localStorage.removeItem(f+e),localStorage.removeItem(p+e)}catch{}}updateRecord(e,t){let n=this.#e.value,r=n.windows.get(e);if(!r)return;let i=new Map(n.windows);i.set(e,{...r,...t}),this.#e.next({...n,windows:i})}}.getInstance();function _(e,t,n){let r={...e};for(let e=0;e<10&&t.some(e=>{return t=r,n=e.bounds,!(t.left>=n.left+n.width||t.left+t.width<=n.left||t.top>=n.top+n.height||t.top+t.height<=n.top);var t,n});e++)r.left+=44,r.top+=44;return function(e,t){return{width:e.width,height:e.height,left:Math.max(0,Math.min(e.left,t.width-e.width)),top:Math.max(0,Math.min(e.top,t.height-e.height))}}(r,n)}var v=48,y=class extends e.t{static{h=this}constructor(...e){super(...e),this.id=`default`,this.lowered=!1,this.corner=`bottom-right`,this.resizable=!1,this.freePosition=!1,this.visualState=`normal`,this.minWidth=280,this.minHeight=200,this.open=!1,this.hasOpened=!1,this.position={x:16,y:16},this.currentCorner=`bottom-right`,this.appliedCorner=``,this.containerRef=(0,d.createRef)(),this.bodyRef=(0,d.createRef)(),this.headRef=(0,d.createRef)(),this.handleFocus=()=>g.focus(this.id),this.handleHeadKeydown=e=>{if(e.key===`Enter`||e.key===` `)return e.preventDefault(),void this.toggle();if(e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault();let t=e.shiftKey?20:5,n=e.key===`ArrowRight`?t:e.key===`ArrowLeft`?-t:0,r=e.key===`ArrowDown`?t:e.key===`ArrowUp`?-t:0;this.position={x:this.position.x+n,y:this.position.y+r},this.applyContainerPosition(),this.savePosition()}}}static{this.styles=[u.css`
2
+ :host {
3
+ display: contents;
4
+ position: relative;
5
+ z-index: 1000;
6
+ }
7
+ :host([hidden]) {
8
+ display: none !important;
9
+ }
10
+ `]}get panelWidth(){return this.expandedWidth??`min(360px, calc(100vw - 32px))`}get isBottomCorner(){return this.currentCorner.startsWith(`bottom`)}get closedClipPath(){return this.isBottomCorner?`inset(calc(100% - 48px) 0px 0px 0px round 22px)`:`inset(0px 0px calc(100% - 48px) 0px round 22px)`}get openClipPath(){return`inset(0px 0px 0px 0px round 12px)`}get elevation(){return this.open?4:this.lowered?1:3}applyContainerPosition(){let e=this.containerRef.value;if(!e)return;this.appliedCorner!==this.currentCorner&&(e.style.removeProperty(`left`),e.style.removeProperty(`right`),e.style.removeProperty(`top`),e.style.removeProperty(`bottom`),this.appliedCorner=this.currentCorner);let{x:t,y:n}=this.position;this.currentCorner.includes(`right`)?e.style.right=`${t}px`:e.style.left=`${t}px`,this.currentCorner.includes(`bottom`)?e.style.bottom=`${n+i.n.bottomOffset}px`:e.style.top=`${n}px`}static{this.VALID_CORNERS=new Set([`top-left`,`top-right`,`bottom-left`,`bottom-right`])}loadPosition(){let e=g.loadPosition(this.id);e&&(this.position={x:e.x,y:e.y},h.VALID_CORNERS.has(e.anchor)&&(this.currentCorner=e.anchor))}savePosition(){g.savePosition(this.id,{...this.position,anchor:this.currentCorner})}validateBounds(){let e=this.containerRef.value;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0)return;let n=window.innerWidth,r=window.innerHeight,i=this.currentCorner.includes(`right`),a=this.currentCorner.includes(`bottom`),o=i?n-this.position.x-t.width:this.position.x,s=a?r-this.position.y-t.height:this.position.y,c=Math.max(0,Math.min(o,n-t.width)),l=Math.max(0,Math.min(s,r-t.height));this.position={x:i?n-c-t.width:c,y:a?r-l-t.height:l},this.applyContainerPosition()}reorientToNearestCorner(e=!1){if(this.freePosition){this.savePosition();let e=this.containerRef.value?.getBoundingClientRect();e&&g.updateBounds(this.id,{left:e.left,top:e.top,width:e.width,height:e.height});return}let r=this.containerRef.value;if(!r)return;let i=r.getBoundingClientRect(),a=this.currentCorner.includes(`bottom`),s=i.left+i.width/2,c=a?i.bottom-24:i.top+24,l=s>window.innerWidth/2?`right`:`left`,u=`${c>window.innerHeight/2?`bottom`:`top`}-${l}`;if(this.currentCorner=u,this.position={x:16,y:16},this.applyContainerPosition(),this.open||(r.style.clipPath=this.closedClipPath),e||n.t.value){this.savePosition();let e=r.getBoundingClientRect();g.updateBounds(this.id,{left:e.left,top:e.top,width:e.width,height:e.height});return}let d=r.getBoundingClientRect(),f=i.left-d.left,p=i.top-d.top;r.style.translate=`${f}px ${p}px`;let m=[{translate:`${f}px ${p}px`},{translate:`0px 0px`}];(0,o.from)(r.animate(m,{duration:t.d.duration,easing:t.d.easingFallback,fill:`forwards`}).finished).pipe((0,o.take)(1),(0,o.tap)(()=>{r.isConnected&&(r.style.translate=``);let e=r.getBoundingClientRect();g.updateBounds(this.id,{left:e.left,top:e.top,width:e.width,height:e.height})}),(0,o.catchError)(()=>o.EMPTY),(0,o.takeUntil)(this.disconnecting)).subscribe(),this.savePosition()}drag$(){return new o.Observable(()=>{let e=this.headRef.value,t=this.containerRef.value;if(!e||!t)return;let n=!1,r=(0,o.fromEvent)(e,`pointerdown`).pipe((0,o.filter)(e=>e.button===0),(0,o.filter)(e=>{let t=e.target.tagName?.toLowerCase();return![`input`,`textarea`,`select`,`button`].includes(t)&&!e.target.closest(`schmancy-input, schmancy-icon-button, button, a`)}),(0,o.tap)(e=>{e.preventDefault(),e.stopPropagation()})).pipe((0,o.map)(e=>{let r=t.getBoundingClientRect(),i=this.currentCorner.includes(`bottom`),a=this.open;return n=!1,{startX:e.clientX,startY:e.clientY,offsetX:e.clientX-r.left,offsetY:e.clientY-r.top,rect:r,vw:window.innerWidth,vh:window.innerHeight,isBottom:i,wasOpen:a,pointerId:e.pointerId}}),(0,o.switchMap)(({startX:e,startY:r,offsetX:i,offsetY:a,rect:s,vw:c,vh:l,isBottom:u,wasOpen:d,pointerId:f})=>{let p=(0,o.fromEvent)(window,`pointermove`).pipe((0,o.filter)(e=>e.pointerId===f),(0,o.auditTime)(0,o.animationFrameScheduler),(0,o.map)(e=>({clientX:e.clientX,clientY:e.clientY}))),m=(0,o.fromEvent)(window,`pointerup`).pipe((0,o.filter)(e=>e.pointerId===f));return p.pipe((0,o.tap)(({clientX:o,clientY:f})=>{let p=o-e,m=f-r;if(Math.sqrt(p*p+m*m)>5&&!n&&(n=!0,this.applyDragVisuals(!0),d)){this.open=!1,t.style.clipPath=this.closedClipPath,t.style.overflow=`hidden`;let e=this.bodyRef.value;e&&(e.inert=!0,e.style.visibility=`hidden`)}if(!n)return;let h=Math.max(0,Math.min(o-i,c-s.width)),g=u?v-s.height:0,_=u?l-s.height:l-v,y=Math.max(g,Math.min(f-a,_));this.position={x:this.currentCorner.includes(`right`)?c-h-s.width:h,y:u?l-y-s.height:y},this.applyContainerPosition()}),(0,o.takeUntil)(m),(0,o.finalize)(()=>{n?(this.reorientToNearestCorner(),this.applyDragVisuals(!1),n=!1):(n=!1,this.toggle())}))})).subscribe();return()=>r.unsubscribe()})}connectedCallback(){super.connectedCallback(),(0,o.from)(this.updateComplete).pipe((0,o.take)(1),(0,o.tap)(()=>{this.currentCorner=this.corner,this.loadPosition(),this.applyContainerPosition(),this.initDOMState();let e=this.containerRef.value;if(e){let t=e.getBoundingClientRect(),n={left:t.left,top:t.top,width:t.width,height:t.height};g.register(this.id,n,this.freePosition?`free`:this.currentCorner)}}),(0,o.switchMap)(()=>(0,o.merge)(this.drag$(),g.selectWindow(this.id).pipe((0,o.tap)(e=>{if(!e)return;let t=this.containerRef.value;t&&(t.style.zIndex=String(e.zIndex))})))),(0,o.takeUntil)(this.disconnecting)).subscribe(),(0,o.merge)((0,o.fromEvent)(window,`resize`).pipe((0,o.auditTime)(0,o.animationFrameScheduler),(0,o.tap)(()=>this.validateBounds())),i.n.bottomOffset$.pipe((0,o.tap)(()=>this.applyContainerPosition()))).pipe((0,o.takeUntil)(this.disconnecting)).subscribe()}disconnectedCallback(){super.disconnectedCallback(),g.unregister(this.id)}initDOMState(){let e=this.containerRef.value,t=this.bodyRef.value;e&&(this.applyContainerPosition(),this.open?(this.hasOpened=!0,e.style.overflow=``,t&&(t.inert=!1,t.style.visibility=`visible`)):(e.style.clipPath=this.closedClipPath,e.style.overflow=`hidden`,t&&(t.inert=!0,t.style.visibility=`hidden`)))}animateOpen(){let e=this.containerRef.value,r=this.bodyRef.value;if(!e)return;this.hasOpened=!0,this.open=!0;let i=e.getBoundingClientRect(),a={left:i.left,top:this.isBottomCorner?i.top-400:i.top,width:i.width,height:448},s=g.findOverlaps(a,this.id);if(s.length>0){let e=_(a,s,{width:window.innerWidth,height:window.innerHeight});if(Math.abs(e.left-a.left)>10||Math.abs(e.top-a.top)>10){let t=this.currentCorner.includes(`right`),n=this.currentCorner.includes(`bottom`);this.position={x:t?window.innerWidth-e.left-e.width:e.left,y:n?window.innerHeight-e.top-e.height:e.top},this.applyContainerPosition()}}if(r&&(r.style.visibility=`visible`,r.inert=!1),n.t.value)return e.style.clipPath=``,e.style.overflow=``,void this.dispatchScopedEvent(`window-toggle`,{state:`expanded`});this.currentAnimation?.cancel(),e.style.overflow=`hidden`,e.style.willChange=`opacity`;let c=[{clipPath:this.closedClipPath,opacity:.95},{clipPath:this.openClipPath,opacity:1}],l=e.animate(c,{duration:t.f.duration,easing:t.f.easingFallback,fill:`forwards`});this.currentAnimation=l,(0,o.from)(l.finished).pipe((0,o.take)(1),(0,o.tap)(()=>{e.isConnected&&(e.style.clipPath=``,e.style.overflow=``,e.style.willChange=``)}),(0,o.catchError)(()=>o.EMPTY),(0,o.takeUntil)(this.disconnecting)).subscribe(),this.dispatchScopedEvent(`window-toggle`,{state:`expanded`})}animateClose(){let e=this.containerRef.value;if(!e)return;if(n.t.value){e.style.clipPath=this.closedClipPath,e.style.overflow=`hidden`,this.open=!1;let t=this.bodyRef.value;t&&(t.inert=!0,t.style.visibility=`hidden`),this.dispatchScopedEvent(`window-toggle`,{state:`collapsed`});return}this.currentAnimation?.cancel(),e.style.overflow=`hidden`,e.style.willChange=`opacity`;let r=[{clipPath:this.openClipPath,opacity:1},{clipPath:this.closedClipPath,opacity:.95}],i=e.animate(r,{duration:Math.round(.7*t.f.duration),easing:`cubic-bezier(0.4, 0, 0.8, 0.15)`,fill:`forwards`});this.currentAnimation=i,(0,o.from)(i.finished).pipe((0,o.take)(1),(0,o.tap)(()=>{this.open=!1,e.style.willChange=``;let t=this.bodyRef.value;t&&(t.inert=!0,t.style.visibility=`hidden`)}),(0,o.catchError)(()=>o.EMPTY),(0,o.takeUntil)(this.disconnecting)).subscribe(),this.dispatchScopedEvent(`window-toggle`,{state:`collapsed`})}applyDragVisuals(e){let t=this.headRef.value,n=this.containerRef.value;t&&(t.classList.toggle(`cursor-grabbing`,e),t.classList.toggle(`cursor-move`,!e)),n&&(n.style.opacity=e?`0.95`:``)}toggle(){this.open?this.animateClose():this.animateOpen()}expand(){this.open||this.animateOpen()}close(){this.open&&this.animateClose()}render(){let e=this.currentCorner.startsWith(`bottom`),t=(0,s.classMap)({fixed:!0,flex:!0,"flex-col":e,"flex-col-reverse":!e,"z-1000":!0,"rounded-2xl":this.open,"rounded-[22px]":!this.open,"overflow-hidden":!0}),n=(0,c.styleMap)({width:this.panelWidth,"max-height":`calc(100vh - 32px)`,"pointer-events":`none`}),i=(0,c.styleMap)({"pointer-events":this.open?`auto`:`none`}),a=(0,s.classMap)({"h-full":!0,"px-3":!0,flex:!0,"items-center":!0,"gap-2":!0,"select-none":!0,"cursor-move":!0});return u.html`
11
+ <schmancy-surface
12
+ ${(0,d.ref)(this.containerRef)}
13
+ type="glass"
14
+ .elevation=${this.elevation}
15
+ class=${t}
16
+ style=${n}
17
+ aria-expanded=${this.open}
18
+ @pointerdown=${this.handleFocus}
19
+ >
20
+ <!-- Details section (visually above summary for bottom corners) -->
21
+ <section
22
+ ${(0,d.ref)(this.bodyRef)}
23
+ class="flex-1 min-h-0 overflow-hidden flex flex-col"
24
+ style=${i}
25
+ role="region"
26
+ aria-label="Expandable content"
27
+ >
28
+ ${this.hasOpened?u.html`<slot name="details"></slot>`:u.nothing}
29
+ </section>
30
+
31
+ <!-- Summary section -- always interactive, always visible -->
32
+ <section
33
+ class="shrink-0 bg-surface-lowest"
34
+ style=${(0,c.styleMap)({"pointer-events":`auto`,height:`48px`})}
35
+ >
36
+ <div
37
+ ${(0,d.ref)(this.headRef)}
38
+ ${r.t({radius:200,intensity:.1})}
39
+ class=${a}
40
+ role="button"
41
+ tabindex="0"
42
+ title="Drag to move, click to expand"
43
+ aria-label="${this.open?`Collapse window`:`Expand window`}"
44
+ @keydown=${this.handleHeadKeydown}
45
+ >
46
+ <div class="flex-1 min-w-0">
47
+ <slot></slot>
48
+ </div>
49
+ <svg
50
+ width="16" height="16" viewBox="0 0 24 24" fill="none"
51
+ class="shrink-0 text-surface-on/40 transition-transform duration-200 ${this.open?`rotate-180`:``}"
52
+ aria-hidden="true"
53
+ >
54
+ <path d="M6 9L12 15L18 9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
55
+ </svg>
56
+ </div>
57
+ </section>
58
+ </schmancy-surface>
59
+ `}};e.u([(0,l.property)({type:String})],y.prototype,`id`,void 0),e.u([(0,l.property)({type:String})],y.prototype,`expandedWidth`,void 0),e.u([(0,l.property)({type:String})],y.prototype,`expandedHeight`,void 0),e.u([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`lowered`,void 0),e.u([(0,l.property)({type:String})],y.prototype,`corner`,void 0),e.u([(0,l.property)({type:Boolean})],y.prototype,`resizable`,void 0),e.u([(0,l.property)({type:Boolean})],y.prototype,`freePosition`,void 0),e.u([(0,l.property)({type:String,reflect:!0})],y.prototype,`visualState`,void 0),e.u([(0,l.property)({type:Number})],y.prototype,`minWidth`,void 0),e.u([(0,l.property)({type:Number})],y.prototype,`minHeight`,void 0),e.u([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`open`,void 0),e.u([(0,l.state)()],y.prototype,`hasOpened`,void 0),e.u([(0,l.state)()],y.prototype,`currentCorner`,void 0);var b=y=h=e.u([(0,l.customElement)(`schmancy-window`)],y);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-BbBYjm7R.cjs","names":["#state$"],"sources":["../src/window/window-manager.ts","../src/window/window-position.ts","../src/window/window.ts"],"sourcesContent":["/**\n * Window Manager — singleton service for multi-window coordination.\n *\n * Tracks all schmancy-window instances: positions, z-indices, focus, visual states.\n * Components register on connectedCallback, unregister on disconnectedCallback.\n * Focus changes, position updates, and overlap queries all flow through here.\n *\n * Follows the ThemeService singleton pattern (theme/theme.service.ts).\n *\n * Example:\n * windowManager.register('chat-1', bounds, 'bottom-right')\n * windowManager.focus('chat-1') // bumps z-index, updates focusedId\n * const overlaps = windowManager.findOverlaps(projectedBounds, 'chat-1')\n */\n\nimport { BehaviorSubject, Observable, distinctUntilChanged, map } from 'rxjs'\nimport { overlayStack } from '../utils/overlay-stack.js'\nimport type { WindowBounds, WindowRecord, WindowRegistryState, SnapTarget } from './window-registry.js'\n\nconst STORAGE_PREFIX = 'schmancy-window-'\nconst LEGACY_STORAGE_PREFIX = 'schmancy-float-'\n\nclass WindowManagerService {\n\tprivate static instance: WindowManagerService\n\n\treadonly #state$ = new BehaviorSubject<WindowRegistryState>({\n\t\twindows: new Map(),\n\t\tfocusedId: null,\n\t\tstackOrder: [],\n\t})\n\n\treadonly state$ = this.#state$.asObservable()\n\n\tprivate constructor() {}\n\n\tstatic getInstance(): WindowManagerService {\n\t\tif (!WindowManagerService.instance) {\n\t\t\tWindowManagerService.instance = new WindowManagerService()\n\t\t}\n\t\treturn WindowManagerService.instance\n\t}\n\n\t// ── Synchronous accessors ──────────────────────────────────────────\n\n\tget windows(): Map<string, WindowRecord> {\n\t\treturn this.#state$.value.windows\n\t}\n\n\tget focusedId(): string | null {\n\t\treturn this.#state$.value.focusedId\n\t}\n\n\t// ── Registration ───────────────────────────────────────────────────\n\n\tregister(id: string, initialBounds: WindowBounds, snapTarget: SnapTarget): void {\n\t\tconst state = this.#state$.value\n\t\tif (state.windows.has(id)) return\n\n\t\tconst zIndex = overlayStack.assignZIndex(id)\n\t\tconst record: WindowRecord = {\n\t\t\tid,\n\t\t\tbounds: initialBounds,\n\t\t\tvisualState: 'normal',\n\t\t\tzIndex,\n\t\t\topen: false,\n\t\t\tsnapTarget,\n\t\t}\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, record)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis.#state$.next({ ...state, windows, stackOrder })\n\t}\n\n\tunregister(id: string): void {\n\t\tconst state = this.#state$.value\n\t\tif (!state.windows.has(id)) return\n\n\t\toverlayStack.releaseId(id)\n\t\tconst windows = new Map(state.windows)\n\t\twindows.delete(id)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\t\tconst focusedId = state.focusedId === id ? null : state.focusedId\n\n\t\tthis.#state$.next({ ...state, windows, stackOrder, focusedId })\n\t}\n\n\t// ── State mutations ────────────────────────────────────────────────\n\n\tupdateBounds(id: string, bounds: WindowBounds): void {\n\t\tthis.updateRecord(id, { bounds })\n\t}\n\n\tupdateVisualState(id: string, visualState: WindowRecord['visualState']): void {\n\t\tthis.updateRecord(id, { visualState })\n\t}\n\n\tupdateOpen(id: string, open: boolean): void {\n\t\tthis.updateRecord(id, { open })\n\t}\n\n\tfocus(id: string): void {\n\t\tconst state = this.#state$.value\n\t\tif (!state.windows.has(id)) return\n\t\tif (state.focusedId === id) return\n\n\t\tconst zIndex = overlayStack.bringToFront(id)\n\t\tconst windows = new Map(state.windows)\n\t\tconst record = windows.get(id)\n\t\tif (record) {\n\t\t\twindows.set(id, { ...record, zIndex })\n\t\t}\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis.#state$.next({ ...state, windows, stackOrder, focusedId: id })\n\t}\n\n\t// ── Queries ────────────────────────────────────────────────────────\n\n\tfindOverlaps(bounds: WindowBounds, excludeId: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [id, record] of this.#state$.value.windows) {\n\t\t\tif (id === excludeId) continue\n\t\t\tif (rectsOverlap(bounds, record.bounds)) {\n\t\t\t\tresult.push(record)\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n\n\tgetNeighbors(id: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [otherId, record] of this.#state$.value.windows) {\n\t\t\tif (otherId !== id) result.push(record)\n\t\t}\n\t\treturn result\n\t}\n\n\t// ── Selectors ──────────────────────────────────────────────────────\n\n\tselectWindow(id: string): Observable<WindowRecord | undefined> {\n\t\treturn this.#state$.pipe(\n\t\t\tmap(state => state.windows.get(id)),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\tselectFocused(): Observable<string | null> {\n\t\treturn this.#state$.pipe(\n\t\t\tmap(state => state.focusedId),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\t// ── Persistence ────────────────────────────────────────────────────\n\n\tloadPosition(id: string): { x: number; y: number; anchor: string } | null {\n\t\ttry {\n\t\t\t// Try new key first, fall back to legacy\n\t\t\tconst raw = localStorage.getItem(STORAGE_PREFIX + id) ?? localStorage.getItem(LEGACY_STORAGE_PREFIX + id)\n\t\t\tif (!raw) return null\n\t\t\treturn JSON.parse(raw) as { x: number; y: number; anchor: string }\n\t\t} catch {\n\t\t\treturn null\n\t\t}\n\t}\n\n\tsavePosition(id: string, data: { x: number; y: number; anchor: string }): void {\n\t\ttry {\n\t\t\tlocalStorage.setItem(STORAGE_PREFIX + id, JSON.stringify(data))\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tclearPosition(id: string): void {\n\t\ttry {\n\t\t\tlocalStorage.removeItem(STORAGE_PREFIX + id)\n\t\t\tlocalStorage.removeItem(LEGACY_STORAGE_PREFIX + id)\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t// ── Internal ───────────────────────────────────────────────────────\n\n\tprivate updateRecord(id: string, updates: Partial<WindowRecord>): void {\n\t\tconst state = this.#state$.value\n\t\tconst record = state.windows.get(id)\n\t\tif (!record) return\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, { ...record, ...updates })\n\t\tthis.#state$.next({ ...state, windows })\n\t}\n}\n\n/** Simple rect overlap check (inline — no circular import with window-position) */\nfunction rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\nexport const windowManager = WindowManagerService.getInstance()\n","/**\n * Window Position — pure functions for overlap resolution, cascade, and snapping.\n *\n * All functions are stateless: they take window bounds and viewport dimensions,\n * return new bounds. No side effects, no DOM access, no subscriptions.\n *\n * Example:\n * const projected = { left: 100, top: 400, width: 360, height: 500 }\n * const neighbors = windowManager.findOverlaps(projected, 'my-id')\n * const resolved = resolveOverlap(projected, neighbors, { width: 1440, height: 900 })\n * // → { left: 144, top: 444, width: 360, height: 500 } (cascaded away from conflict)\n */\n\nimport type { WindowBounds, WindowRecord } from './window-registry.js'\n\nconst HEAD_HEIGHT = 44\nconst CASCADE_OFFSET = HEAD_HEIGHT\nconst MAX_CASCADE_ATTEMPTS = 10\n\n/** Check if two rectangles overlap (edges touching does NOT count as overlap) */\nexport function rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\n/**\n * Resolve overlap by cascading diagonally until no conflict.\n * Shifts by (HEAD_HEIGHT, HEAD_HEIGHT) per attempt, clamped to viewport.\n */\nexport function resolveOverlap(\n\tcandidate: WindowBounds,\n\texisting: WindowRecord[],\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\tconst bounds = { ...candidate }\n\n\tfor (let attempt = 0; attempt < MAX_CASCADE_ATTEMPTS; attempt++) {\n\t\tconst hasOverlap = existing.some(w => rectsOverlap(bounds, w.bounds))\n\t\tif (!hasOverlap) break\n\n\t\tbounds.left += CASCADE_OFFSET\n\t\tbounds.top += CASCADE_OFFSET\n\t}\n\n\treturn clampToViewport(bounds, viewport)\n}\n\n/**\n * Clamp bounds so the window stays fully within the viewport.\n */\nexport function clampToViewport(\n\tbounds: WindowBounds,\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\treturn {\n\t\twidth: bounds.width,\n\t\theight: bounds.height,\n\t\tleft: Math.max(0, Math.min(bounds.left, viewport.width - bounds.width)),\n\t\ttop: Math.max(0, Math.min(bounds.top, viewport.height - bounds.height)),\n\t}\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport {\n\tanimationFrameScheduler,\n\tauditTime,\n\tcatchError,\n\tEMPTY,\n\tfilter,\n\tfinalize,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tObservable,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n} from 'rxjs'\nimport { SPRING_SMOOTH, SPRING_SNAPPY } from '../utils/animation.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { reducedMotion$ } from '../directives/reduced-motion'\nimport { theme } from '../theme/theme.service.js'\nimport type { SnapCorner, WindowBounds, WindowVisualState } from './window-registry.js'\nimport { windowManager } from './window-manager.js'\nimport { resolveOverlap } from './window-position.js'\n\nconst HEAD_HEIGHT = 48\nconst DRAG_THRESHOLD = 5\n\ninterface Position {\n\tx: number\n\ty: number\n}\n\n@customElement('schmancy-window')\nexport default class SchmancyWindow extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: contents;\n\t\tposition: relative;\n\t\tz-index: 1000;\n\t}\n\t:host([hidden]) {\n\t\tdisplay: none !important;\n\t}\n`]\n\n\t@property({ type: String }) id: string = 'default'\n\t/** Override the expanded panel width (e.g. '320px', '24rem'). Defaults to responsive sizing. */\n\t@property({ type: String }) expandedWidth?: string\n\t/** Override the expanded panel height (e.g. '400px', '50vh'). */\n\t@property({ type: String }) expandedHeight?: string\n\t/** When true, uses a lower elevation shadow in the collapsed state. */\n\t@property({ type: Boolean, reflect: true }) lowered: boolean = false\n\t/** Corner the window is anchored to. */\n\t@property({ type: String }) corner: SnapCorner = 'bottom-right'\n\t/** When true, window can be resized by the user. */\n\t@property({ type: Boolean }) resizable = false\n\t/** When true, window stays at its dragged position instead of snapping to a corner. */\n\t@property({ type: Boolean }) freePosition = false\n\t/** Visual state of the window (minimized, normal, maximized). */\n\t@property({ type: String, reflect: true }) visualState: WindowVisualState = 'normal'\n\t/** Minimum width in pixels. */\n\t@property({ type: Number }) minWidth = 280\n\t/** Minimum height in pixels. */\n\t@property({ type: Number }) minHeight = 200\n\n\t/** Whether the body is expanded. */\n\t@property({ type: Boolean, reflect: true }) open = false\n\n\tprivate currentAnimation?: Animation\n\n\t/** Lazy rendering: body content not in DOM until first expand. */\n\t@state() private hasOpened = false\n\n\t// Internal position -- plain fields, updated directly during drag\n\tprivate position: Position = { x: 16, y: 16 }\n\t@state() private currentCorner: SnapCorner = 'bottom-right'\n\n\t// Track applied corner to avoid unnecessary style.removeProperty calls during drag\n\tprivate appliedCorner: string = ''\n\n\t// Refs\n\tprivate containerRef = createRef<HTMLElement>()\n\tprivate bodyRef = createRef<HTMLElement>()\n\tprivate headRef = createRef<HTMLElement>()\n\n\t// ============================================\n\t// COMPUTED\n\t// ============================================\n\n\tprivate get panelWidth(): string {\n\t\treturn this.expandedWidth ?? 'min(360px, calc(100vw - 32px))'\n\t}\n\n\tprivate get isBottomCorner(): boolean {\n\t\treturn this.currentCorner.startsWith('bottom')\n\t}\n\n\tprivate get closedClipPath(): string {\n\t\treturn this.isBottomCorner\n\t\t\t? `inset(calc(100% - ${HEAD_HEIGHT}px) 0px 0px 0px round 22px)`\n\t\t\t: `inset(0px 0px calc(100% - ${HEAD_HEIGHT}px) 0px round 22px)`\n\t}\n\n\tprivate get openClipPath(): string {\n\t\treturn 'inset(0px 0px 0px 0px round 12px)'\n\t}\n\n\tprivate get elevation(): 0 | 1 | 2 | 3 | 4 | 5 {\n\t\tif (this.open) return 4\n\t\treturn this.lowered ? 1 : 3\n\t}\n\n\t// ============================================\n\t// POSITION MANAGEMENT\n\t// ============================================\n\n\tprivate applyContainerPosition() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\t\t// Only clear position properties when corner changes (avoids 4 style invalidations per drag frame)\n\t\tif (this.appliedCorner !== this.currentCorner) {\n\t\t\tcontainer.style.removeProperty('left')\n\t\t\tcontainer.style.removeProperty('right')\n\t\t\tcontainer.style.removeProperty('top')\n\t\t\tcontainer.style.removeProperty('bottom')\n\t\t\tthis.appliedCorner = this.currentCorner\n\t\t}\n\t\tconst { x, y } = this.position\n\t\tif (this.currentCorner.includes('right')) {\n\t\t\tcontainer.style.right = `${x}px`\n\t\t} else {\n\t\t\tcontainer.style.left = `${x}px`\n\t\t}\n\t\tif (this.currentCorner.includes('bottom')) {\n\t\t\tcontainer.style.bottom = `${y + theme.bottomOffset}px`\n\t\t} else {\n\t\t\tcontainer.style.top = `${y}px`\n\t\t}\n\t}\n\n\tprivate static readonly VALID_CORNERS = new Set<string>(['top-left', 'top-right', 'bottom-left', 'bottom-right'])\n\n\tprivate loadPosition() {\n\t\tconst saved = windowManager.loadPosition(this.id)\n\t\tif (saved) {\n\t\t\tthis.position = { x: saved.x, y: saved.y }\n\t\t\tif (SchmancyWindow.VALID_CORNERS.has(saved.anchor)) {\n\t\t\t\tthis.currentCorner = saved.anchor as SnapCorner\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate savePosition() {\n\t\twindowManager.savePosition(this.id, { ...this.position, anchor: this.currentCorner })\n\t}\n\n\tprivate validateBounds() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\t\tconst rect = container.getBoundingClientRect()\n\t\tif (rect.width === 0) return\n\t\tconst vw = window.innerWidth\n\t\tconst vh = window.innerHeight\n\t\tconst isRight = this.currentCorner.includes('right')\n\t\tconst isBottom = this.currentCorner.includes('bottom')\n\t\tconst actualLeft = isRight ? vw - this.position.x - rect.width : this.position.x\n\t\tconst actualTop = isBottom ? vh - this.position.y - rect.height : this.position.y\n\t\tconst newLeft = Math.max(0, Math.min(actualLeft, vw - rect.width))\n\t\tconst newTop = Math.max(0, Math.min(actualTop, vh - rect.height))\n\t\tthis.position = {\n\t\t\tx: isRight ? vw - newLeft - rect.width : newLeft,\n\t\t\ty: isBottom ? vh - newTop - rect.height : newTop,\n\t\t}\n\t\tthis.applyContainerPosition()\n\t}\n\n\t// ============================================\n\t// CORNER SNAPPING\n\t// ============================================\n\n\tprivate reorientToNearestCorner(skipAnimation = false): void {\n\t\t// Free position mode: skip corner snapping\n\t\tif (this.freePosition) {\n\t\t\tthis.savePosition()\n\t\t\tconst rect = this.containerRef.value?.getBoundingClientRect()\n\t\t\tif (rect) {\n\t\t\t\twindowManager.updateBounds(this.id, { left: rect.left, top: rect.top, width: rect.width, height: rect.height })\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\n\t\t// F -- record current screen position before DOM mutation\n\t\tconst rect = container.getBoundingClientRect()\n\n\t\t// L -- calculate nearest corner using head visual center\n\t\tconst currentIsBottom = this.currentCorner.includes('bottom')\n\t\tconst headCenterX = rect.left + rect.width / 2\n\t\tconst headCenterY = currentIsBottom\n\t\t\t? rect.bottom - HEAD_HEIGHT / 2\n\t\t\t: rect.top + HEAD_HEIGHT / 2\n\t\tconst side = headCenterX > window.innerWidth / 2 ? 'right' : 'left'\n\t\tconst vert = headCenterY > window.innerHeight / 2 ? 'bottom' : 'top'\n\t\tconst newCorner: SnapCorner = `${vert}-${side}` as SnapCorner\n\n\t\t// Snap corner and reset offset to standard edge gap\n\t\tthis.currentCorner = newCorner\n\t\tthis.position = { x: 16, y: 16 }\n\t\tthis.applyContainerPosition()\n\t\t// Sync clip-path to new corner\n\t\tif (!this.open) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t}\n\n\t\tif (skipAnimation || reducedMotion$.value) {\n\t\t\tthis.savePosition()\n\t\t\tconst snapRect = container.getBoundingClientRect()\n\t\t\twindowManager.updateBounds(this.id, { left: snapRect.left, top: snapRect.top, width: snapRect.width, height: snapRect.height })\n\t\t\treturn\n\t\t}\n\n\t\t// I -- invert: shift element back to its original visual position\n\t\tconst newRect = container.getBoundingClientRect()\n\t\tconst dx = rect.left - newRect.left\n\t\tconst dy = rect.top - newRect.top\n\t\tcontainer.style.translate = `${dx}px ${dy}px`\n\n\t\t// P -- play: animate from the inverse offset to natural resting position\n\t\tconst flipKeyframes: Keyframe[] = [{ translate: `${dx}px ${dy}px` }, { translate: '0px 0px' }]\n\t\tconst anim = container.animate(\n\t\t\tflipKeyframes,\n\t\t\t{\n\t\t\t\tduration: SPRING_SMOOTH.duration,\n\t\t\t\teasing: SPRING_SMOOTH.easingFallback,\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t)\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) container.style.translate = ''\n\t\t\t\t// Report final resting bounds after animation completes\n\t\t\t\tconst finalRect = container.getBoundingClientRect()\n\t\t\t\twindowManager.updateBounds(this.id, { left: finalRect.left, top: finalRect.top, width: finalRect.width, height: finalRect.height })\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.savePosition()\n\t}\n\n\t// ============================================\n\t// DRAG PIPELINE\n\t// ============================================\n\n\tprivate drag$(): Observable<never> {\n\t\treturn new Observable(() => {\n\t\t\tconst head = this.headRef.value\n\t\t\tconst container = this.containerRef.value\n\t\t\tif (!head || !container) return\n\n\t\t\tlet didDrag = false\n\n\t\t\tconst sub = fromEvent<PointerEvent>(head, 'pointerdown').pipe(\n\t\t\t\tfilter(e => e.button === 0),\n\t\t\t\tfilter(e => {\n\t\t\t\t\tconst tag = (e.target as HTMLElement).tagName?.toLowerCase()\n\t\t\t\t\treturn !['input', 'textarea', 'select', 'button'].includes(tag)\n\t\t\t\t\t\t&& !(e.target as HTMLElement).closest('schmancy-input, schmancy-icon-button, button, a')\n\t\t\t\t}),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(e => {\n\t\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\t\tconst isBottom = this.currentCorner.includes('bottom')\n\t\t\t\t\t\tconst wasOpen = this.open\n\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstartX: e.clientX,\n\t\t\t\t\t\t\tstartY: e.clientY,\n\t\t\t\t\t\t\toffsetX: e.clientX - rect.left,\n\t\t\t\t\t\t\toffsetY: e.clientY - rect.top,\n\t\t\t\t\t\t\trect,\n\t\t\t\t\t\t\tvw: window.innerWidth,\n\t\t\t\t\t\t\tvh: window.innerHeight,\n\t\t\t\t\t\t\tisBottom,\n\t\t\t\t\t\t\twasOpen,\n\t\t\t\t\t\t\tpointerId: e.pointerId,\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tswitchMap(({ startX, startY, offsetX, offsetY, rect, vw, vh, isBottom, wasOpen, pointerId }) => {\n\t\t\t\t\t\tconst move$ = fromEvent<PointerEvent>(window, 'pointermove').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\t\t\t\tmap(e => ({ clientX: e.clientX, clientY: e.clientY })),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst end$ = fromEvent<PointerEvent>(window, 'pointerup').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn move$.pipe(\n\t\t\t\t\t\t\ttap(({ clientX, clientY }) => {\n\t\t\t\t\t\t\t\tconst dx = clientX - startX\n\t\t\t\t\t\t\t\tconst dy = clientY - startY\n\t\t\t\t\t\t\t\tif (Math.sqrt(dx * dx + dy * dy) > DRAG_THRESHOLD && !didDrag) {\n\t\t\t\t\t\t\t\t\tdidDrag = true\n\t\t\t\t\t\t\t\t\tthis.applyDragVisuals(true)\n\t\t\t\t\t\t\t\t\t// Collapse on first confirmed drag move\n\t\t\t\t\t\t\t\t\tif (wasOpen) {\n\t\t\t\t\t\t\t\t\t\tthis.open = false\n\t\t\t\t\t\t\t\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\t\t\t\t\t\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\t\t\t\t\t\t\t\tconst body = this.bodyRef.value\n\t\t\t\t\t\t\t\t\t\tif (body) {\n\t\t\t\t\t\t\t\t\t\t\tbody.inert = true\n\t\t\t\t\t\t\t\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!didDrag) return\n\n\t\t\t\t\t\t\t\tconst left = Math.max(0, Math.min(clientX - offsetX, vw - rect.width))\n\t\t\t\t\t\t\t\tconst minTop = isBottom ? HEAD_HEIGHT - rect.height : 0\n\t\t\t\t\t\t\t\tconst maxTop = isBottom ? vh - rect.height : vh - HEAD_HEIGHT\n\t\t\t\t\t\t\t\tconst top = Math.max(minTop, Math.min(clientY - offsetY, maxTop))\n\n\t\t\t\t\t\t\t\tthis.position = {\n\t\t\t\t\t\t\t\t\tx: this.currentCorner.includes('right') ? vw - left - rect.width : left,\n\t\t\t\t\t\t\t\t\ty: isBottom ? vh - top - rect.height : top,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.applyContainerPosition()\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttakeUntil(end$),\n\t\t\t\t\t\t\tfinalize(() => {\n\t\t\t\t\t\t\t\tif (didDrag) {\n\t\t\t\t\t\t\t\t\tthis.reorientToNearestCorner()\n\t\t\t\t\t\t\t\t\tthis.applyDragVisuals(false)\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t\tthis.toggle()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\treturn () => sub.unsubscribe()\n\t\t})\n\t}\n\n\t// ============================================\n\t// LIFECYCLE\n\t// ============================================\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Pipeline 1: DOM setup + manager registration + drag + z-index sync\n\t\tfrom(this.updateComplete).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis.currentCorner = this.corner\n\t\t\t\tthis.loadPosition()\n\t\t\t\tthis.applyContainerPosition()\n\t\t\t\tthis.initDOMState()\n\t\t\t\t// Register with window manager\n\t\t\t\tconst container = this.containerRef.value\n\t\t\t\tif (container) {\n\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\tconst bounds: WindowBounds = { left: rect.left, top: rect.top, width: rect.width, height: rect.height }\n\t\t\t\t\twindowManager.register(this.id, bounds, this.freePosition ? 'free' : this.currentCorner)\n\t\t\t\t}\n\t\t\t}),\n\t\t\tswitchMap(() => merge(\n\t\t\t\tthis.drag$(),\n\t\t\t\twindowManager.selectWindow(this.id).pipe(\n\t\t\t\t\ttap(record => {\n\t\t\t\t\t\tif (!record) return\n\t\t\t\t\t\tconst container = this.containerRef.value\n\t\t\t\t\t\tif (container) container.style.zIndex = String(record.zIndex)\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t)),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\n\t\t// Pipeline 3: Environment -- one subscription\n\t\tmerge(\n\t\t\tfromEvent(window, 'resize').pipe(\n\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\ttap(() => this.validateBounds()),\n\t\t\t),\n\t\t\ttheme.bottomOffset$.pipe(\n\t\t\t\ttap(() => this.applyContainerPosition()),\n\t\t\t),\n\t\t).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\twindowManager.unregister(this.id)\n\t}\n\n\tprivate initDOMState() {\n\t\tconst container = this.containerRef.value\n\t\tconst body = this.bodyRef.value\n\t\tif (!container) return\n\n\t\tthis.applyContainerPosition()\n\n\t\tif (this.open) {\n\t\t\tthis.hasOpened = true\n\t\t\tcontainer.style.overflow = ''\n\t\t\tif (body) {\n\t\t\t\tbody.inert = false\n\t\t\t\tbody.style.visibility = 'visible'\n\t\t\t}\n\t\t} else {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tif (body) {\n\t\t\t\tbody.inert = true\n\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t}\n\t\t}\n\t}\n\n\t// ============================================\n\t// ANIMATION\n\t// ============================================\n\n\tprivate animateOpen() {\n\t\tconst container = this.containerRef.value\n\t\tconst body = this.bodyRef.value\n\t\tif (!container) return\n\n\t\tthis.hasOpened = true\n\t\tthis.open = true\n\n\t\t// Overlap avoidance\n\t\tconst rect = container.getBoundingClientRect()\n\t\tconst projectedBounds: WindowBounds = {\n\t\t\tleft: rect.left,\n\t\t\ttop: this.isBottomCorner ? rect.top - 400 : rect.top,\n\t\t\twidth: rect.width,\n\t\t\theight: 400 + HEAD_HEIGHT,\n\t\t}\n\t\tconst overlaps = windowManager.findOverlaps(projectedBounds, this.id)\n\t\tif (overlaps.length > 0) {\n\t\t\tconst resolved = resolveOverlap(projectedBounds, overlaps, { width: window.innerWidth, height: window.innerHeight })\n\t\t\tif (Math.abs(resolved.left - projectedBounds.left) > 10 || Math.abs(resolved.top - projectedBounds.top) > 10) {\n\t\t\t\tconst isRight = this.currentCorner.includes('right')\n\t\t\t\tconst isBottom = this.currentCorner.includes('bottom')\n\t\t\t\tthis.position = {\n\t\t\t\t\tx: isRight ? window.innerWidth - resolved.left - resolved.width : resolved.left,\n\t\t\t\t\ty: isBottom ? window.innerHeight - resolved.top - resolved.height : resolved.top,\n\t\t\t\t}\n\t\t\t\tthis.applyContainerPosition()\n\t\t\t}\n\t\t}\n\n\t\tif (body) {\n\t\t\tbody.style.visibility = 'visible'\n\t\t\tbody.inert = false\n\t\t}\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = ''\n\t\t\tcontainer.style.overflow = ''\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t\t\treturn\n\t\t}\n\n\t\tthis.currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst openKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t]\n\t\tconst anim = container.animate(openKeyframes, {\n\t\t\tduration: SPRING_SNAPPY.duration,\n\t\t\teasing: SPRING_SNAPPY.easingFallback,\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis.currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) {\n\t\t\t\t\tcontainer.style.clipPath = ''\n\t\t\t\t\tcontainer.style.overflow = ''\n\t\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t}\n\n\tprivate animateClose() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tthis.open = false\n\t\t\tconst body = this.bodyRef.value\n\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t\t\treturn\n\t\t}\n\n\t\tthis.currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst closeKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t]\n\t\tconst anim = container.animate(closeKeyframes, {\n\t\t\tduration: Math.round(SPRING_SNAPPY.duration * 0.7),\n\t\t\teasing: 'cubic-bezier(0.4, 0, 0.8, 0.15)',\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis.currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis.open = false\n\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\tconst body = this.bodyRef.value\n\t\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t}\n\n\t// ============================================\n\t// VISUAL STATE HELPERS\n\t// ============================================\n\n\t/** Apply drag visuals directly on DOM refs — avoids full Lit re-render for cursor + opacity */\n\tprivate applyDragVisuals(dragging: boolean) {\n\t\tconst head = this.headRef.value\n\t\tconst container = this.containerRef.value\n\t\tif (head) {\n\t\t\thead.classList.toggle('cursor-grabbing', dragging)\n\t\t\thead.classList.toggle('cursor-move', !dragging)\n\t\t}\n\t\tif (container) {\n\t\t\tcontainer.style.opacity = dragging ? '0.95' : ''\n\t\t}\n\t}\n\n\tprivate handleFocus = () => windowManager.focus(this.id)\n\n\tprivate handleHeadKeydown = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault()\n\t\t\tthis.toggle()\n\t\t\treturn\n\t\t}\n\t\tif (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n\t\t\te.preventDefault()\n\t\t\tconst step = e.shiftKey ? 20 : 5\n\t\t\tconst dx = e.key === 'ArrowRight' ? step : e.key === 'ArrowLeft' ? -step : 0\n\t\t\tconst dy = e.key === 'ArrowDown' ? step : e.key === 'ArrowUp' ? -step : 0\n\t\t\tthis.position = { x: this.position.x + dx, y: this.position.y + dy }\n\t\t\tthis.applyContainerPosition()\n\t\t\tthis.savePosition()\n\t\t}\n\t}\n\n\t// ============================================\n\t// PUBLIC API\n\t// ============================================\n\n\ttoggle() {\n\t\tif (this.open) this.animateClose()\n\t\telse this.animateOpen()\n\t}\n\n\texpand() {\n\t\tif (this.open) return\n\t\tthis.animateOpen()\n\t}\n\n\tclose() {\n\t\tif (!this.open) return\n\t\tthis.animateClose()\n\t}\n\n\t// ============================================\n\t// RENDER\n\t// ============================================\n\n\tprotected render(): unknown {\n\t\tconst isBottom = this.currentCorner.startsWith('bottom')\n\n\t\tconst containerClasses = classMap({\n\t\t\tfixed: true,\n\t\t\tflex: true,\n\t\t\t'flex-col': isBottom,\n\t\t\t'flex-col-reverse': !isBottom,\n\t\t\t'z-1000': true,\n\t\t\t'rounded-2xl': this.open,\n\t\t\t'rounded-[22px]': !this.open,\n\t\t\t'overflow-hidden': true,\n\t\t})\n\n\t\tconst containerStyles = styleMap({\n\t\t\twidth: this.panelWidth,\n\t\t\t'max-height': 'calc(100vh - 32px)',\n\t\t\t'pointer-events': 'none',\n\t\t})\n\n\t\tconst bodyStyles = styleMap({\n\t\t\t'pointer-events': this.open ? 'auto' : 'none',\n\t\t})\n\n\t\tconst headClasses = classMap({\n\t\t\t'h-full': true,\n\t\t\t'px-3': true,\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'gap-2': true,\n\t\t\t'select-none': true,\n\t\t\t'cursor-move': true,\n\t\t})\n\n\t\treturn html`\n\t\t\t<schmancy-surface\n\t\t\t\t${ref(this.containerRef)}\n\t\t\t\ttype=\"glass\"\n\t\t\t\t.elevation=${this.elevation}\n\t\t\t\tclass=${containerClasses}\n\t\t\t\tstyle=${containerStyles}\n\t\t\t\taria-expanded=${this.open}\n\t\t\t\t@pointerdown=${this.handleFocus}\n\t\t\t>\n\t\t\t\t<!-- Details section (visually above summary for bottom corners) -->\n\t\t\t\t<section\n\t\t\t\t\t${ref(this.bodyRef)}\n\t\t\t\t\tclass=\"flex-1 min-h-0 overflow-hidden flex flex-col\"\n\t\t\t\t\tstyle=${bodyStyles}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Expandable content\"\n\t\t\t\t>\n\t\t\t\t\t${this.hasOpened ? html`<slot name=\"details\"></slot>` : nothing}\n\t\t\t\t</section>\n\n\t\t\t\t<!-- Summary section -- always interactive, always visible -->\n\t\t\t\t<section\n\t\t\t\t\tclass=\"shrink-0 bg-surface-lowest\"\n\t\t\t\t\tstyle=${styleMap({ 'pointer-events': 'auto', height: `${HEAD_HEIGHT}px` })}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\t${ref(this.headRef)}\n\t\t\t\t\t\t${cursorGlow({ radius: 200, intensity: 0.10 })}\n\t\t\t\t\t\tclass=${headClasses}\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\ttitle=\"Drag to move, click to expand\"\n\t\t\t\t\t\taria-label=\"${this.open ? 'Collapse window' : 'Expand window'}\"\n\t\t\t\t\t\t@keydown=${this.handleHeadKeydown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"flex-1 min-w-0\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"\n\t\t\t\t\t\t\tclass=\"shrink-0 text-surface-on/40 transition-transform duration-200 ${this.open ? 'rotate-180' : ''}\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M6 9L12 15L18 9\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-window': SchmancyWindow\n\t}\n}\n"],"mappings":"igBAmBA,IAAM,EAAiB,mBACjB,EAAwB,kBAmL9B,SAAS,EAAa,EAAiB,EAAA,CACtC,MAAA,EAAS,EAAE,MAAQ,EAAE,KAAO,EAAE,OAAS,EAAE,KAAO,EAAE,OAAS,EAAE,MAAQ,EAAE,KAAO,EAAE,IAAM,EAAE,QAAU,EAAE,IAAM,EAAE,QAAU,EAAE,IACzH,CAEA,IAAA,EAAa,EArLb,MAAM,CAAA,CAGL,GAQA,aAAA,CAAA,KAAA,GARmB,IAAI,EAAA,gBAAqC,CAC3D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,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAEjB,CAAE,KAAM,OAAQ,QAAA,CAAS,CAAA,CAAA,CAAA,EAAM,EAAA,UAAA,cAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAE/B,CAAE,KAAM,MAAA,CAAA,CAAA,EAAQ,EAAA,UAAA,WAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAEhB,CAAE,KAAM,MAAA,CAAA,CAAA,EAAQ,EAAA,UAAA,YAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAGhB,CAAE,KAAM,QAAS,QAAA,CAAS,CAAA,CAAA,CAAA,EAAM,EAAA,UAAA,OAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAAA,CAAA,EAKnC,EAAA,UAAA,YAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAAA,CAAA,EAIA,EAAA,UAAA,gBAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eA3CO,iBAAA,CAAA,EAAiB,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
package/dist/window.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./window-BSAemI9J.cjs`);exports.SchmancyWindow=e.t,exports.windowManager=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./window-BbBYjm7R.cjs`);exports.SchmancyWindow=e.t,exports.windowManager=e.n;
package/dist/window.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./window-ConcHirJ.js";
1
+ import { n as e, t } from "./window-BDVyrBnk.js";
2
2
  export { t as SchmancyWindow, e as windowManager };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhmo91/schmancy",
3
- "version": "0.10.37",
3
+ "version": "0.10.39",
4
4
  "description": "UI library build with web components",
5
5
  "main": "./dist/index.js",
6
6
  "customElements": "custom-elements.json",
@@ -99,6 +99,9 @@ A value-controlled `<schmancy-*>` component (`schmancy-steps`, `schmancy-input`,
99
99
  - `await state.ready` (or `if (state.loaded)`) before reading persisted-backend values that hydrate asynchronously.
100
100
  - Storage tiers: `.memory()` (regenerable) · `.session()` (per-tab) · `.local()` (user prefs) · `.idb()` (>100-entry collections).
101
101
 
102
+ **SIGNAL_TRACKING_BEYOND_RENDER**
103
+ A `SchmancyElement` makes any imperative side-effect reactive to signal changes by running it inside `this.updateEffect(fn, { manualDispose: true })`, which applies the same auto-tracking the component's `render()` receives to any arbitrary effect and returns a disposer for integration with the component's teardown path.
104
+
102
105
  **Routing**
103
106
  - Route guards are `Observable<boolean>`, never cached booleans.
104
107
  - `when="tag-name"` must exactly match `@customElement('tag-name')`.
@@ -162,6 +165,12 @@ html`
162
165
 
163
166
  See `layout.md` for the full shell pattern with rail + content area.
164
167
 
168
+ ## Rules
169
+
170
+ ### INLINE_FLEX_HOST_NO_SHRINK
171
+
172
+ A web-component host that establishes `inline-flex` layout declares `flex-shrink: 0` in its `:host` block so it preserves its intrinsic content size regardless of the flex container it lands in.
173
+
165
174
  ## Workflow
166
175
 
167
176
  1. User describes a UI task.
@@ -14,17 +14,24 @@ import {
14
14
 
15
15
  ## The novel default — anchored
16
16
 
17
- When you're triggering an overlay from a user gesture (click, touch), pass the event as `anchor`. The overlay blooms from the point of attention instead of materializing at the viewport center.
17
+ Schmancy tracks the last user gesture automatically. When you call `show()` from a `@click` handler, the overlay positions itself near the interaction point without you passing anything:
18
18
 
19
19
  ```ts
20
- private handlePick = (ev: MouseEvent) => {
21
- show(TemplatePicker, { anchor: ev, props: { kind: 'email' } })
20
+ private handlePick = () => {
21
+ show(TemplatePicker, { props: { kind: 'email' } })
22
22
  .pipe(takeUntil(this.disconnecting))
23
23
  .subscribe(picked => { if (picked) this.template = picked })
24
24
  }
25
25
  ```
26
26
 
27
- Centered is the fallback (no anchor given). Sheet is the responsive adaptation (narrow viewport / touch / oversized content). You never pick layout the system does.
27
+ Pass `anchor` explicitly only when the gesture and the `show()` call are decoupled — e.g. the click fires in a child component but `show()` runs in a parent, or you're opening from a programmatic trigger with no gesture context:
28
+
29
+ ```ts
30
+ show(Picker, { anchor: ev }) // explicit — only when gesture context is lost
31
+ show(Picker) // idiomatic — gesture tracked automatically
32
+ ```
33
+
34
+ Centered is the fallback when there is genuinely no gesture context. Sheet is the responsive adaptation (narrow viewport / touch / oversized content). You never pick layout — the system does.
28
35
 
29
36
  ## Content forms
30
37
 
@@ -33,11 +40,11 @@ Centered is the fallback (no anchor given). Sheet is the responsive adaptation (
33
40
  | Form | When to use |
34
41
  |---|---|
35
42
  | `show(MyComponent)` | Component class — most common |
36
- | `show(html\`...\`)` | Inline template (eager — values frozen at call site) |
37
- | `show(() => html\`...\`)` | **Preferred for templates** — factory called at mount time; closed-over variables are read lazily, no snapshot staleness |
43
+ | `show(html\`...\`)` | Inline template (eager — a frozen one-shot snapshot, never re-renders) |
44
+ | `show(() => html\`...\`)` | **Reactive form** — factory re-invoked when any signal it reads changes (parity with a component's render()); closed-over variables always current |
38
45
  | `show(lazy(() => import('./x')))` | Async / code-split component |
39
46
 
40
- Always prefer `() => html\`...\`` over `html\`...\`` when the template closes over any variable — the factory form evaluates those variables at mount time rather than baking them in at the call site.
47
+ Always prefer `() => html\`...\`` over `html\`...\``: the factory form is reactive — the overlay re-runs it whenever a signal it reads changes, exactly like a component's `render()`. The eager `html\`...\`` form is a frozen snapshot captured at the call site and never updates. Bind `.value=${someState.value}` inside a factory and the overlay content tracks the state live.
41
48
 
42
49
  ## Default padding
43
50
 
@@ -245,7 +245,7 @@ export class SchmancyArea extends SchmancyElement {
245
245
  area.$current.next(area.current)
246
246
 
247
247
  if (area.enableHistoryMode) {
248
- area._updateBrowserHistory(
248
+ area.updateBrowserHistory(
249
249
  this.name,
250
250
  activeRoute,
251
251
  carry.historyStrategy ?? HISTORY_STRATEGY.push,
@@ -938,8 +938,8 @@ describe('AreaService - Integration Tests', () => {
938
938
  props: {}
939
939
  })
940
940
 
941
- // Call _updateBrowserHistory directly to test history behavior
942
- area._updateBrowserHistory('main', {
941
+ // Call updateBrowserHistory directly to test history behavior
942
+ area.updateBrowserHistory('main', {
943
943
  area: 'main',
944
944
  component: 'test',
945
945
  state: {},
@@ -352,7 +352,7 @@ class AreaService implements AreaSubscription {
352
352
  /**
353
353
  * Update browser history state (called by area components)
354
354
  */
355
- _updateBrowserHistory(areaName: string, route: ActiveRoute, historyStrategy?: string, clearQueryParams?: string[] | boolean | null, customPath?: string) {
355
+ updateBrowserHistory(areaName: string, route: ActiveRoute, historyStrategy?: string, clearQueryParams?: string[] | boolean | null, customPath?: string) {
356
356
  if (!this.enableHistoryMode) return
357
357
 
358
358
  try {