@mhmo91/schmancy 0.9.10 → 0.9.12

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 (395) hide show
  1. package/custom-elements.json +4 -4
  2. package/dist/{area-BafkBc1f.cjs → area-CBjmKtN-.cjs} +1 -1
  3. package/dist/{area-BafkBc1f.cjs.map → area-CBjmKtN-.cjs.map} +1 -1
  4. package/dist/{area-D03HRn1L.js → area-CjX0Ckh9.js} +1 -1
  5. package/dist/{area-D03HRn1L.js.map → area-CjX0Ckh9.js.map} +1 -1
  6. package/dist/area.cjs +1 -1
  7. package/dist/area.js +1 -1
  8. package/dist/{autocomplete-BeLg4A3T.cjs → autocomplete-WQxz4VGO.cjs} +1 -1
  9. package/dist/{autocomplete-BeLg4A3T.cjs.map → autocomplete-WQxz4VGO.cjs.map} +1 -1
  10. package/dist/{autocomplete-BotVnTfP.js → autocomplete-ppoaK_GD.js} +2 -2
  11. package/dist/{autocomplete-BotVnTfP.js.map → autocomplete-ppoaK_GD.js.map} +1 -1
  12. package/dist/autocomplete.cjs +1 -1
  13. package/dist/autocomplete.js +1 -1
  14. package/dist/badge.cjs +1 -1
  15. package/dist/badge.js +1 -1
  16. package/dist/{boat-4hSLFsGy.cjs → boat-C-T9RDiG.cjs} +1 -1
  17. package/dist/{boat-4hSLFsGy.cjs.map → boat-C-T9RDiG.cjs.map} +1 -1
  18. package/dist/{boat-C1wGdoaF.js → boat-C4JnoakD.js} +1 -1
  19. package/dist/{boat-C1wGdoaF.js.map → boat-C4JnoakD.js.map} +1 -1
  20. package/dist/boat.cjs +1 -1
  21. package/dist/boat.js +1 -1
  22. package/dist/breadcrumb.cjs +1 -1
  23. package/dist/breadcrumb.js +1 -1
  24. package/dist/{busy-C0qP0TiL.cjs → busy-BMRUS_Ns.cjs} +1 -1
  25. package/dist/{busy-C0qP0TiL.cjs.map → busy-BMRUS_Ns.cjs.map} +1 -1
  26. package/dist/{busy-D74-XaFn.js → busy-DuV4A5PX.js} +1 -1
  27. package/dist/{busy-D74-XaFn.js.map → busy-DuV4A5PX.js.map} +1 -1
  28. package/dist/busy.cjs +1 -1
  29. package/dist/busy.js +1 -1
  30. package/dist/button.cjs +29 -29
  31. package/dist/button.cjs.map +1 -1
  32. package/dist/button.js +52 -50
  33. package/dist/button.js.map +1 -1
  34. package/dist/{card-DUq_MsxC.cjs → card-DBjGfCxi.cjs} +1 -1
  35. package/dist/{card-DUq_MsxC.cjs.map → card-DBjGfCxi.cjs.map} +1 -1
  36. package/dist/{card-C8Ns2mRo.js → card-DzXRouJC.js} +1 -1
  37. package/dist/{card-C8Ns2mRo.js.map → card-DzXRouJC.js.map} +1 -1
  38. package/dist/card.cjs +1 -1
  39. package/dist/card.js +1 -1
  40. package/dist/charts.cjs +1 -1
  41. package/dist/charts.js +1 -1
  42. package/dist/{checkbox-qPH_5Viu.cjs → checkbox-BibOr-sJ.cjs} +1 -1
  43. package/dist/{checkbox-qPH_5Viu.cjs.map → checkbox-BibOr-sJ.cjs.map} +1 -1
  44. package/dist/{checkbox-D18r6c0V.js → checkbox-BwuhSBDG.js} +2 -2
  45. package/dist/{checkbox-D18r6c0V.js.map → checkbox-BwuhSBDG.js.map} +1 -1
  46. package/dist/checkbox.cjs +1 -1
  47. package/dist/checkbox.js +1 -1
  48. package/dist/{chips-BI_kt5BS.cjs → chips-D5QvIKt6.cjs} +1 -1
  49. package/dist/{chips-BI_kt5BS.cjs.map → chips-D5QvIKt6.cjs.map} +1 -1
  50. package/dist/{chips-0rKPqQt8.js → chips-DiB2BfTQ.js} +3 -3
  51. package/dist/{chips-0rKPqQt8.js.map → chips-DiB2BfTQ.js.map} +1 -1
  52. package/dist/chips.cjs +1 -1
  53. package/dist/chips.js +2 -2
  54. package/dist/{code-highlight-ClzG4FL4.js → code-highlight-B5_zONzv.js} +1 -1
  55. package/dist/{code-highlight-ClzG4FL4.js.map → code-highlight-B5_zONzv.js.map} +1 -1
  56. package/dist/{code-highlight-DGInmDAW.cjs → code-highlight-Q2x2hrWg.cjs} +1 -1
  57. package/dist/{code-highlight-DGInmDAW.cjs.map → code-highlight-Q2x2hrWg.cjs.map} +1 -1
  58. package/dist/code-highlight.cjs +1 -1
  59. package/dist/code-highlight.js +1 -1
  60. package/dist/{components-RbvrLE3U.js → components-CjLqW8Jp.js} +1 -1
  61. package/dist/{components-RbvrLE3U.js.map → components-CjLqW8Jp.js.map} +1 -1
  62. package/dist/{components-7hOtFi_q.cjs → components-jfFxyq6z.cjs} +1 -1
  63. package/dist/{components-7hOtFi_q.cjs.map → components-jfFxyq6z.cjs.map} +1 -1
  64. package/dist/components.cjs +1 -1
  65. package/dist/components.js +1 -1
  66. package/dist/connectivity.cjs +1 -1
  67. package/dist/connectivity.js +1 -1
  68. package/dist/content-drawer.cjs +1 -1
  69. package/dist/content-drawer.js +1 -1
  70. package/dist/context-BRtGc7PP.cjs +1 -0
  71. package/dist/context-BRtGc7PP.cjs.map +1 -0
  72. package/dist/context-DgD3c6q-.js +3 -0
  73. package/dist/context-DgD3c6q-.js.map +1 -0
  74. package/dist/{date-range-B0kW9np7.cjs → date-range-DF5ROfrb.cjs} +1 -1
  75. package/dist/{date-range-B0kW9np7.cjs.map → date-range-DF5ROfrb.cjs.map} +1 -1
  76. package/dist/{date-range-CfIIPIA_.js → date-range-Dcy8GSov.js} +3 -3
  77. package/dist/{date-range-CfIIPIA_.js.map → date-range-Dcy8GSov.js.map} +1 -1
  78. package/dist/{date-range-inline-B87TDYI6.js.map → date-range-inline-B_g1YXu3.js.map} +1 -1
  79. package/dist/{date-range-inline-De-M0VmL.cjs.map → date-range-inline-LLC3Y0mi.cjs.map} +1 -1
  80. package/dist/date-range-inline.cjs +1 -1
  81. package/dist/date-range-inline.js +1 -1
  82. package/dist/date-range.cjs +1 -1
  83. package/dist/date-range.js +1 -1
  84. package/dist/{delay-CPoyWZuQ.js → delay-B7TvigGw.js} +4 -4
  85. package/dist/{delay-CPoyWZuQ.js.map → delay-B7TvigGw.js.map} +1 -1
  86. package/dist/{delay-k_HiVnhP.cjs → delay-aQRihOO4.cjs} +1 -1
  87. package/dist/{delay-k_HiVnhP.cjs.map → delay-aQRihOO4.cjs.map} +1 -1
  88. package/dist/delay.cjs +1 -1
  89. package/dist/delay.js +1 -1
  90. package/dist/{details-CQIbCUY0.cjs → details-Cs8yStsJ.cjs} +1 -1
  91. package/dist/{details-CQIbCUY0.cjs.map → details-Cs8yStsJ.cjs.map} +1 -1
  92. package/dist/{details-BU5kx0Jh.js → details-DfYDNHuv.js} +1 -1
  93. package/dist/{details-BU5kx0Jh.js.map → details-DfYDNHuv.js.map} +1 -1
  94. package/dist/details.cjs +1 -1
  95. package/dist/details.js +1 -1
  96. package/dist/{dialog-service-ClFrOWf4.js → dialog-service-CCFGpU7a.js} +1 -1
  97. package/dist/{dialog-service-ClFrOWf4.js.map → dialog-service-CCFGpU7a.js.map} +1 -1
  98. package/dist/{dialog-service-DcuAavp2.cjs → dialog-service-DXLGSshF.cjs} +1 -1
  99. package/dist/{dialog-service-DcuAavp2.cjs.map → dialog-service-DXLGSshF.cjs.map} +1 -1
  100. package/dist/dialog.cjs +1 -1
  101. package/dist/dialog.js +2 -2
  102. package/dist/{divider-D9borfuG.js → divider-DE9pcMw3.js} +1 -1
  103. package/dist/{divider-D9borfuG.js.map → divider-DE9pcMw3.js.map} +1 -1
  104. package/dist/{divider-IX9sp29l.cjs → divider-DY4ocl-Z.cjs} +1 -1
  105. package/dist/{divider-IX9sp29l.cjs.map → divider-DY4ocl-Z.cjs.map} +1 -1
  106. package/dist/divider.cjs +1 -1
  107. package/dist/divider.js +1 -1
  108. package/dist/dropdown.cjs +1 -1
  109. package/dist/dropdown.js +2 -2
  110. package/dist/{expand-dIrDcH9Y.cjs → expand-Cuu9u0j5.cjs} +1 -1
  111. package/dist/{expand-dIrDcH9Y.cjs.map → expand-Cuu9u0j5.cjs.map} +1 -1
  112. package/dist/{expand-Dw9tbuFG.js → expand-Cwis2Y6U.js} +2 -2
  113. package/dist/{expand-Dw9tbuFG.js.map → expand-Cwis2Y6U.js.map} +1 -1
  114. package/dist/expand.cjs +1 -1
  115. package/dist/expand.js +1 -1
  116. package/dist/{extra-BFpPepJn.cjs → extra-DRIgrdHx.cjs} +1 -1
  117. package/dist/{extra-BFpPepJn.cjs.map → extra-DRIgrdHx.cjs.map} +1 -1
  118. package/dist/{extra-D3sZLtFY.js → extra-DoxLBpZ-.js} +1 -1
  119. package/dist/{extra-D3sZLtFY.js.map → extra-DoxLBpZ-.js.map} +1 -1
  120. package/dist/extra.cjs +1 -1
  121. package/dist/extra.js +1 -1
  122. package/dist/{float-BKd4pilD.js → float-2aPqW2lz.js} +1 -1
  123. package/dist/{float-BKd4pilD.js.map → float-2aPqW2lz.js.map} +1 -1
  124. package/dist/{float-CJ3SuEcG.cjs → float-I4wePTk7.cjs} +1 -1
  125. package/dist/{float-CJ3SuEcG.cjs.map → float-I4wePTk7.cjs.map} +1 -1
  126. package/dist/float.cjs +1 -1
  127. package/dist/float.js +1 -1
  128. package/dist/{flow-CqgDEIqK.js.map → flow-BPDtbhLe.js.map} +1 -1
  129. package/dist/{flow-DSu4PLt1.cjs.map → flow-Dn9AZktE.cjs.map} +1 -1
  130. package/dist/{form-D2cJ58TB.js.map → form-C1qS9uvS.js.map} +1 -1
  131. package/dist/{form-CAY9GSCd.cjs.map → form-CzD0JLxM.cjs.map} +1 -1
  132. package/dist/form.cjs +1 -1
  133. package/dist/form.js +1 -1
  134. package/dist/{hashContent-nD2uWwi2.js.map → hashContent-BUqULUiZ.js.map} +1 -1
  135. package/dist/{hashContent-kKvXKFa9.cjs.map → hashContent-CI39BY-_.cjs.map} +1 -1
  136. package/dist/{icons-DqIVrIIK.js → icons-DDQBxhDC.js} +29 -25
  137. package/dist/icons-DDQBxhDC.js.map +1 -0
  138. package/dist/{icons-1AkKNd7O.cjs → icons-UOqapID2.cjs} +4 -4
  139. package/dist/icons-UOqapID2.cjs.map +1 -0
  140. package/dist/icons.cjs +1 -1
  141. package/dist/icons.js +1 -1
  142. package/dist/{iframe-D4R1Rq7G.js → iframe-CMTUyiz1.js} +1 -1
  143. package/dist/{iframe-D4R1Rq7G.js.map → iframe-CMTUyiz1.js.map} +1 -1
  144. package/dist/{iframe-CtDetaw3.cjs → iframe-FZCULDVM.cjs} +1 -1
  145. package/dist/{iframe-CtDetaw3.cjs.map → iframe-FZCULDVM.cjs.map} +1 -1
  146. package/dist/iframe.cjs +1 -1
  147. package/dist/iframe.js +1 -1
  148. package/dist/index.cjs +1 -1
  149. package/dist/index.js +40 -40
  150. package/dist/{input-DMjpf6V8.cjs.map → input-DIuyi3Gm.cjs.map} +1 -1
  151. package/dist/{input-Ri72dn5t.js.map → input-HzweUBSn.js.map} +1 -1
  152. package/dist/{input-chip-B4uw64rQ.js → input-chip-Bt2Lzi-2.js} +1 -1
  153. package/dist/{input-chip-B4uw64rQ.js.map → input-chip-Bt2Lzi-2.js.map} +1 -1
  154. package/dist/{input-chip-DY9IEbQj.cjs → input-chip-nghCxe9L.cjs} +1 -1
  155. package/dist/{input-chip-DY9IEbQj.cjs.map → input-chip-nghCxe9L.cjs.map} +1 -1
  156. package/dist/input.cjs +1 -1
  157. package/dist/input.js +1 -1
  158. package/dist/{intersection-LfEsy29T.js.map → intersection-C0JuW_7U.js.map} +1 -1
  159. package/dist/{intersection-D1v1UCVv.cjs.map → intersection-MvbRovUz.cjs.map} +1 -1
  160. package/dist/json.cjs +1 -1
  161. package/dist/json.js +2 -2
  162. package/dist/kbd.cjs +1 -1
  163. package/dist/kbd.js +1 -1
  164. package/dist/{layout-Dh0qW7XU.js → layout-BUq6VVj0.js} +2 -2
  165. package/dist/{layout-Dh0qW7XU.js.map → layout-BUq6VVj0.js.map} +1 -1
  166. package/dist/{layout-B1gXjlIO.cjs → layout-DHt4hK1n.cjs} +1 -1
  167. package/dist/{layout-B1gXjlIO.cjs.map → layout-DHt4hK1n.cjs.map} +1 -1
  168. package/dist/layout.cjs +1 -1
  169. package/dist/layout.js +2 -2
  170. package/dist/{lightbox-BUuGltX9.cjs → lightbox-CbAbyhzE.cjs} +1 -1
  171. package/dist/{lightbox-BUuGltX9.cjs.map → lightbox-CbAbyhzE.cjs.map} +1 -1
  172. package/dist/{lightbox-BM_Bpk_l.js → lightbox-p_uYC9Hy.js} +3 -3
  173. package/dist/{lightbox-BM_Bpk_l.js.map → lightbox-p_uYC9Hy.js.map} +1 -1
  174. package/dist/lightbox.cjs +1 -1
  175. package/dist/lightbox.js +1 -1
  176. package/dist/{list-DrF_av2K.js → list-DG1shv4_.js} +2 -2
  177. package/dist/{list-DrF_av2K.js.map → list-DG1shv4_.js.map} +1 -1
  178. package/dist/{list-C1GMiAi_.cjs → list-pvbKwpnz.cjs} +1 -1
  179. package/dist/{list-C1GMiAi_.cjs.map → list-pvbKwpnz.cjs.map} +1 -1
  180. package/dist/list.cjs +1 -1
  181. package/dist/list.js +1 -1
  182. package/dist/{litElement.mixin-D6ZHgGZv.js → litElement.mixin-BLb2kIHg.js} +1 -1
  183. package/dist/{litElement.mixin-D6ZHgGZv.js.map → litElement.mixin-BLb2kIHg.js.map} +1 -1
  184. package/dist/{litElement.mixin-De5SG5z7.cjs → litElement.mixin-Bx9Avv0M.cjs} +1 -1
  185. package/dist/{litElement.mixin-De5SG5z7.cjs.map → litElement.mixin-Bx9Avv0M.cjs.map} +1 -1
  186. package/dist/{mailbox-BjB502y9.js → mailbox-BCRplIro.js} +5 -5
  187. package/dist/{mailbox-BjB502y9.js.map → mailbox-BCRplIro.js.map} +1 -1
  188. package/dist/{mailbox-D0iXsqyx.cjs → mailbox-CZevIxwZ.cjs} +1 -1
  189. package/dist/{mailbox-D0iXsqyx.cjs.map → mailbox-CZevIxwZ.cjs.map} +1 -1
  190. package/dist/mailbox.cjs +1 -1
  191. package/dist/mailbox.js +1 -1
  192. package/dist/{map-BZTxFRVH.js → map-BUcxWqBH.js} +1 -1
  193. package/dist/{map-BZTxFRVH.js.map → map-BUcxWqBH.js.map} +1 -1
  194. package/dist/{map-uRYJeifl.cjs → map-C6kDkAju.cjs} +1 -1
  195. package/dist/{map-uRYJeifl.cjs.map → map-C6kDkAju.cjs.map} +1 -1
  196. package/dist/map.cjs +1 -1
  197. package/dist/map.js +1 -1
  198. package/dist/{menu-BamT46lt.js → menu-BleltblR.js} +2 -2
  199. package/dist/{menu-BamT46lt.js.map → menu-BleltblR.js.map} +1 -1
  200. package/dist/{menu-CXFa_bk4.cjs → menu-DhmDz_js.cjs} +1 -1
  201. package/dist/{menu-CXFa_bk4.cjs.map → menu-DhmDz_js.cjs.map} +1 -1
  202. package/dist/menu.cjs +1 -1
  203. package/dist/menu.js +1 -1
  204. package/dist/mixins.cjs +1 -1
  205. package/dist/mixins.js +2 -2
  206. package/dist/nav-drawer.cjs +1 -1
  207. package/dist/nav-drawer.js +1 -1
  208. package/dist/navigation-bar.cjs +1 -1
  209. package/dist/navigation-bar.js +1 -1
  210. package/dist/navigation-rail.cjs +1 -1
  211. package/dist/navigation-rail.js +1 -1
  212. package/dist/{notification-Xid-o7gi.cjs → notification-BT84PlwC.cjs} +1 -1
  213. package/dist/{notification-Xid-o7gi.cjs.map → notification-BT84PlwC.cjs.map} +1 -1
  214. package/dist/{notification-COgjQodt.js → notification-DvrozLTu.js} +2 -2
  215. package/dist/{notification-COgjQodt.js.map → notification-DvrozLTu.js.map} +1 -1
  216. package/dist/notification.cjs +1 -1
  217. package/dist/notification.js +1 -1
  218. package/dist/{option-DdYe_l1A.js → option-EEYkHd44.js} +1 -1
  219. package/dist/{option-DdYe_l1A.js.map → option-EEYkHd44.js.map} +1 -1
  220. package/dist/{option-CNWUeHW3.cjs → option-y5FY8sz-.cjs} +1 -1
  221. package/dist/{option-CNWUeHW3.cjs.map → option-y5FY8sz-.cjs.map} +1 -1
  222. package/dist/option.cjs +1 -1
  223. package/dist/option.js +1 -1
  224. package/dist/{overlay-stack-Ca4EK2Mu.js.map → overlay-stack-BJt_r6aZ.js.map} +1 -1
  225. package/dist/{overlay-stack-CEYGD9T1.cjs.map → overlay-stack-J_eJCUTX.cjs.map} +1 -1
  226. package/dist/page.cjs +1 -1
  227. package/dist/page.js +2 -2
  228. package/dist/{progress-Bw-VD6wH.cjs → progress-B1if5cWu.cjs} +1 -1
  229. package/dist/{progress-Bw-VD6wH.cjs.map → progress-B1if5cWu.cjs.map} +1 -1
  230. package/dist/{progress-OQvbUkDs.js → progress-B8nfhvrc.js} +1 -1
  231. package/dist/{progress-OQvbUkDs.js.map → progress-B8nfhvrc.js.map} +1 -1
  232. package/dist/progress.cjs +1 -1
  233. package/dist/progress.js +1 -1
  234. package/dist/{provide-C4L6R1lo.js → provide-BEMtticm.js} +1 -1
  235. package/dist/{provide-C4L6R1lo.js.map → provide-BEMtticm.js.map} +1 -1
  236. package/dist/{provide-Dsoh3FdP.cjs → provide-BbFbvIEk.cjs} +1 -1
  237. package/dist/{provide-Dsoh3FdP.cjs.map → provide-BbFbvIEk.cjs.map} +1 -1
  238. package/dist/qr-scanner.cjs +1 -1
  239. package/dist/qr-scanner.js +1 -1
  240. package/dist/{radio-group-DI1JXW5r.js → radio-group-DKXbC-jL.js} +1 -1
  241. package/dist/{radio-group-DI1JXW5r.js.map → radio-group-DKXbC-jL.js.map} +1 -1
  242. package/dist/{radio-group-D5t8f2Ob.cjs → radio-group-DafTK0PB.cjs} +1 -1
  243. package/dist/{radio-group-D5t8f2Ob.cjs.map → radio-group-DafTK0PB.cjs.map} +1 -1
  244. package/dist/radio-group.cjs +1 -1
  245. package/dist/radio-group.js +1 -1
  246. package/dist/range.cjs +1 -1
  247. package/dist/range.js +1 -1
  248. package/dist/{rxjs-utils-Bldch1RO.js.map → rxjs-utils-CN9fv8Xq.js.map} +1 -1
  249. package/dist/{rxjs-utils-hAgKC7vk.cjs.map → rxjs-utils-Vn6DCKgL.cjs.map} +1 -1
  250. package/dist/rxjs-utils.cjs +1 -1
  251. package/dist/rxjs-utils.js +1 -1
  252. package/dist/{scroll-BG5qMncw.cjs → scroll-C6Hub5gG.cjs} +1 -1
  253. package/dist/{scroll-BG5qMncw.cjs.map → scroll-C6Hub5gG.cjs.map} +1 -1
  254. package/dist/{scroll-Dym-6yPI.js → scroll-pdsp_9bT.js} +1 -1
  255. package/dist/{scroll-Dym-6yPI.js.map → scroll-pdsp_9bT.js.map} +1 -1
  256. package/dist/{select-B1nN5Ac4.cjs → select-Zg9UqtCA.cjs} +1 -1
  257. package/dist/{select-B1nN5Ac4.cjs.map → select-Zg9UqtCA.cjs.map} +1 -1
  258. package/dist/{select-C3L3imJM.js → select-_Qkleofb.js} +2 -2
  259. package/dist/{select-C3L3imJM.js.map → select-_Qkleofb.js.map} +1 -1
  260. package/dist/select.cjs +1 -1
  261. package/dist/select.js +1 -1
  262. package/dist/{sheet-BZRMpyXt.cjs → sheet-7LWVKgW9.cjs} +1 -1
  263. package/dist/{sheet-BZRMpyXt.cjs.map → sheet-7LWVKgW9.cjs.map} +1 -1
  264. package/dist/{sheet-BS9WlMaj.js → sheet-N9TET_t_.js} +3 -3
  265. package/dist/{sheet-BS9WlMaj.js.map → sheet-N9TET_t_.js.map} +1 -1
  266. package/dist/sheet.cjs +1 -1
  267. package/dist/sheet.js +2 -2
  268. package/dist/{sheet.service-DQWkiYEe.js → sheet.service-DCe4FOkQ.js} +2 -2
  269. package/dist/{sheet.service-DQWkiYEe.js.map → sheet.service-DCe4FOkQ.js.map} +1 -1
  270. package/dist/{sheet.service-l9jTUaot.cjs → sheet.service-P2CkJW86.cjs} +1 -1
  271. package/dist/{sheet.service-l9jTUaot.cjs.map → sheet.service-P2CkJW86.cjs.map} +1 -1
  272. package/dist/skeleton.cjs +1 -1
  273. package/dist/skeleton.js +1 -1
  274. package/dist/skills/SKILL.md +5 -3
  275. package/dist/skills/schmancy/SKILL.md +5 -3
  276. package/dist/slider.cjs +1 -1
  277. package/dist/slider.js +1 -1
  278. package/dist/{splash-screen-M-v_jiLs.js → splash-screen-B5Sgz7eG.js} +1 -1
  279. package/dist/{splash-screen-M-v_jiLs.js.map → splash-screen-B5Sgz7eG.js.map} +1 -1
  280. package/dist/{splash-screen-DuFJ0gbD.cjs → splash-screen-BUKRc46i.cjs} +1 -1
  281. package/dist/{splash-screen-DuFJ0gbD.cjs.map → splash-screen-BUKRc46i.cjs.map} +1 -1
  282. package/dist/splash-screen.cjs +1 -1
  283. package/dist/splash-screen.js +1 -1
  284. package/dist/{src-CbR3znbw.js → src-59eVZMmI.js} +46 -46
  285. package/dist/{src-CbR3znbw.js.map → src-59eVZMmI.js.map} +1 -1
  286. package/dist/{src-Ba-S6DFW.cjs → src-r2bV-AFk.cjs} +1 -1
  287. package/dist/{src-Ba-S6DFW.cjs.map → src-r2bV-AFk.cjs.map} +1 -1
  288. package/dist/steps.cjs +1 -1
  289. package/dist/steps.js +3 -3
  290. package/dist/{surface-PECoCLgx.cjs → surface-B-y5Zzmz.cjs} +1 -1
  291. package/dist/{surface-PECoCLgx.cjs.map → surface-B-y5Zzmz.cjs.map} +1 -1
  292. package/dist/{surface-kM2aYH4g.js → surface-BL6YlaS3.js} +2 -2
  293. package/dist/{surface-kM2aYH4g.js.map → surface-BL6YlaS3.js.map} +1 -1
  294. package/dist/surface.cjs +1 -1
  295. package/dist/surface.js +1 -1
  296. package/dist/switch.cjs +1 -1
  297. package/dist/switch.js +1 -1
  298. package/dist/{table-DrMgc8Aw.js → table-B0-Pi4G5.js} +3 -3
  299. package/dist/{table-DrMgc8Aw.js.map → table-B0-Pi4G5.js.map} +1 -1
  300. package/dist/{table-CENjXiu-.cjs → table-CzcIcVFc.cjs} +2 -2
  301. package/dist/{table-CENjXiu-.cjs.map → table-CzcIcVFc.cjs.map} +1 -1
  302. package/dist/table.cjs +1 -1
  303. package/dist/table.js +1 -1
  304. package/dist/{tabs-CRA9FMNl.cjs → tabs-CzC8kJyY.cjs} +1 -1
  305. package/dist/{tabs-CRA9FMNl.cjs.map → tabs-CzC8kJyY.cjs.map} +1 -1
  306. package/dist/{tabs-BvFiM0y-.js → tabs-D-VbZiFu.js} +2 -2
  307. package/dist/{tabs-BvFiM0y-.js.map → tabs-D-VbZiFu.js.map} +1 -1
  308. package/dist/tabs.cjs +1 -1
  309. package/dist/tabs.js +1 -1
  310. package/dist/tailwind.mixin-BCz3GEpw.js +219 -0
  311. package/dist/tailwind.mixin-BCz3GEpw.js.map +1 -0
  312. package/dist/tailwind.mixin-ZzkXQTFA.cjs +2 -0
  313. package/dist/tailwind.mixin-ZzkXQTFA.cjs.map +1 -0
  314. package/dist/teleport.cjs +1 -1
  315. package/dist/teleport.js +1 -1
  316. package/dist/{textarea-CfwGEIvf.cjs → textarea-CgB6XptL.cjs} +1 -1
  317. package/dist/{textarea-CfwGEIvf.cjs.map → textarea-CgB6XptL.cjs.map} +1 -1
  318. package/dist/{textarea-DD5gxIsG.js → textarea-ZopeteYQ.js} +1 -1
  319. package/dist/{textarea-DD5gxIsG.js.map → textarea-ZopeteYQ.js.map} +1 -1
  320. package/dist/textarea.cjs +1 -1
  321. package/dist/textarea.js +1 -1
  322. package/dist/{theme-DNJmVFXF.js → theme-C7As-iVa.js} +4 -4
  323. package/dist/{theme-DNJmVFXF.js.map → theme-C7As-iVa.js.map} +1 -1
  324. package/dist/{theme-BiM_CUpn.cjs → theme-D9bRCDs9.cjs} +1 -1
  325. package/dist/{theme-BiM_CUpn.cjs.map → theme-D9bRCDs9.cjs.map} +1 -1
  326. package/dist/{theme-button-19T3SFrv.js → theme-button-BDXtIhZC.js} +1 -1
  327. package/dist/{theme-button-19T3SFrv.js.map → theme-button-BDXtIhZC.js.map} +1 -1
  328. package/dist/{theme-button-BwJs6N4k.cjs → theme-button-D2nMfwSr.cjs} +1 -1
  329. package/dist/{theme-button-BwJs6N4k.cjs.map → theme-button-D2nMfwSr.cjs.map} +1 -1
  330. package/dist/theme-button.cjs +1 -1
  331. package/dist/theme-button.js +1 -1
  332. package/dist/theme.cjs +1 -1
  333. package/dist/{theme.interface-CM26m9te.cjs.map → theme.interface-CCE3L1ql.cjs.map} +1 -1
  334. package/dist/{theme.interface-FAUIgbIq.js.map → theme.interface-Cyqv5XWY.js.map} +1 -1
  335. package/dist/theme.js +3 -3
  336. package/dist/tree.cjs +1 -1
  337. package/dist/tree.js +1 -1
  338. package/dist/{tslib.es6-Bd-92OW3.cjs.map → tslib.es6-PMITL0Z3.cjs.map} +1 -1
  339. package/dist/{tslib.es6-CI1onEZb.js.map → tslib.es6-vJQZBGJO.js.map} +1 -1
  340. package/dist/{typewriter-BH7nsW7R.cjs → typewriter-BjuFsiR3.cjs} +1 -1
  341. package/dist/{typewriter-BH7nsW7R.cjs.map → typewriter-BjuFsiR3.cjs.map} +1 -1
  342. package/dist/{typewriter-Z-8bbwOh.js → typewriter-DaTkMEHc.js} +5 -5
  343. package/dist/{typewriter-Z-8bbwOh.js.map → typewriter-DaTkMEHc.js.map} +1 -1
  344. package/dist/typewriter.cjs +1 -1
  345. package/dist/typewriter.js +1 -1
  346. package/dist/typography.cjs +1 -1
  347. package/dist/typography.js +1 -1
  348. package/dist/{utils-D2kE-6zc.cjs → utils-C8PD8So2.cjs} +1 -1
  349. package/dist/{utils-D2kE-6zc.cjs.map → utils-C8PD8So2.cjs.map} +1 -1
  350. package/dist/{utils-Cq0m3LYo.js → utils-DVuCPDfw.js} +2 -2
  351. package/dist/{utils-Cq0m3LYo.js.map → utils-DVuCPDfw.js.map} +1 -1
  352. package/dist/utils.cjs +1 -1
  353. package/dist/utils.js +3 -3
  354. package/dist/visually-hidden.cjs +1 -1
  355. package/dist/visually-hidden.js +1 -1
  356. package/dist/{window-NDXXyj5v.cjs → window-DAWRoXo1.cjs} +1 -1
  357. package/dist/{window-NDXXyj5v.cjs.map → window-DAWRoXo1.cjs.map} +1 -1
  358. package/dist/{window-Du_ougyw.js → window-DPSIGCUq.js} +2 -2
  359. package/dist/{window-Du_ougyw.js.map → window-DPSIGCUq.js.map} +1 -1
  360. package/dist/window.cjs +1 -1
  361. package/dist/window.js +1 -1
  362. package/package.json +1 -1
  363. package/skills/schmancy/SKILL.md +5 -3
  364. package/src/button/button.ts +6 -1
  365. package/src/button/context.ts +9 -0
  366. package/src/icons/icon.ts +19 -3
  367. package/types/src/button/button.d.ts +4 -1
  368. package/types/src/button/context.d.ts +8 -0
  369. package/types/src/icons/icon.d.ts +9 -0
  370. package/dist/icons-1AkKNd7O.cjs.map +0 -1
  371. package/dist/icons-DqIVrIIK.js.map +0 -1
  372. package/dist/tailwind.mixin-Bug3G6K6.cjs +0 -2
  373. package/dist/tailwind.mixin-Bug3G6K6.cjs.map +0 -1
  374. package/dist/tailwind.mixin-ywtUNG2c.js +0 -219
  375. package/dist/tailwind.mixin-ywtUNG2c.js.map +0 -1
  376. /package/dist/{date-range-inline-B87TDYI6.js → date-range-inline-B_g1YXu3.js} +0 -0
  377. /package/dist/{date-range-inline-De-M0VmL.cjs → date-range-inline-LLC3Y0mi.cjs} +0 -0
  378. /package/dist/{flow-CqgDEIqK.js → flow-BPDtbhLe.js} +0 -0
  379. /package/dist/{flow-DSu4PLt1.cjs → flow-Dn9AZktE.cjs} +0 -0
  380. /package/dist/{form-D2cJ58TB.js → form-C1qS9uvS.js} +0 -0
  381. /package/dist/{form-CAY9GSCd.cjs → form-CzD0JLxM.cjs} +0 -0
  382. /package/dist/{hashContent-nD2uWwi2.js → hashContent-BUqULUiZ.js} +0 -0
  383. /package/dist/{hashContent-kKvXKFa9.cjs → hashContent-CI39BY-_.cjs} +0 -0
  384. /package/dist/{input-DMjpf6V8.cjs → input-DIuyi3Gm.cjs} +0 -0
  385. /package/dist/{input-Ri72dn5t.js → input-HzweUBSn.js} +0 -0
  386. /package/dist/{intersection-LfEsy29T.js → intersection-C0JuW_7U.js} +0 -0
  387. /package/dist/{intersection-D1v1UCVv.cjs → intersection-MvbRovUz.cjs} +0 -0
  388. /package/dist/{overlay-stack-Ca4EK2Mu.js → overlay-stack-BJt_r6aZ.js} +0 -0
  389. /package/dist/{overlay-stack-CEYGD9T1.cjs → overlay-stack-J_eJCUTX.cjs} +0 -0
  390. /package/dist/{rxjs-utils-Bldch1RO.js → rxjs-utils-CN9fv8Xq.js} +0 -0
  391. /package/dist/{rxjs-utils-hAgKC7vk.cjs → rxjs-utils-Vn6DCKgL.cjs} +0 -0
  392. /package/dist/{theme.interface-CM26m9te.cjs → theme.interface-CCE3L1ql.cjs} +0 -0
  393. /package/dist/{theme.interface-FAUIgbIq.js → theme.interface-Cyqv5XWY.js} +0 -0
  394. /package/dist/{tslib.es6-Bd-92OW3.cjs → tslib.es6-PMITL0Z3.cjs} +0 -0
  395. /package/dist/{tslib.es6-CI1onEZb.js → tslib.es6-vJQZBGJO.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"window-Du_ougyw.js","names":[],"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\tprivate readonly _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\tlet 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 = {\n\t\t\t...bounds,\n\t\t\tleft: bounds.left + CASCADE_OFFSET,\n\t\t\ttop: bounds.top + CASCADE_OFFSET,\n\t\t}\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 { $LitElement } 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 $LitElement(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\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\t/** Whether this window is the focused window in the manager — drives visual ring */\n\t@state() private _focused = 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(): string {\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\twindowManager.selectFocused().pipe(\n\t\t\t\t\ttap(focusedId => {\n\t\t\t\t\t\tthis._focused = focusedId === this.id\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'ring-1': !this._focused,\n\t\t\t'ring-2': this._focused,\n\t\t\t'ring-primary-default/30': this._focused,\n\t\t\t'ring-primary-default/15': this.open && !this._focused,\n\t\t\t'rounded-2xl': this.open,\n\t\t\t'ring-outline-variant/40': !this.open && !this._focused,\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\televation=\"${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,IAA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":"window-DPSIGCUq.js","names":[],"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\tprivate readonly _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\tlet 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 = {\n\t\t\t...bounds,\n\t\t\tleft: bounds.left + CASCADE_OFFSET,\n\t\t\ttop: bounds.top + CASCADE_OFFSET,\n\t\t}\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 { $LitElement } 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 $LitElement(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\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\t/** Whether this window is the focused window in the manager — drives visual ring */\n\t@state() private _focused = 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(): string {\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\twindowManager.selectFocused().pipe(\n\t\t\t\t\ttap(focusedId => {\n\t\t\t\t\t\tthis._focused = focusedId === this.id\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'ring-1': !this._focused,\n\t\t\t'ring-2': this._focused,\n\t\t\t'ring-primary-default/30': this._focused,\n\t\t\t'ring-primary-default/15': this.open && !this._focused,\n\t\t\t'rounded-2xl': this.open,\n\t\t\t'ring-outline-variant/40': !this.open && !this._focused,\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\televation=\"${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,SAAS,EAAa,GAAiB,GAAA;AACtC,QAAA,EAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE;;AAGzH,IAAA,GAAa,IArLb,MAAM,EAAA;CAWL,cAAA;AAAA,OAAA,UAR2B,IAAI,EAAqC;GACnE,yBAAS,IAAI,KAAA;GACb,WAAW;GACX,YAAY,EAAA;GAAA,CAAA,EAAA,KAAA,SAGK,KAAK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,WAAA,aAAA,KAAA,EAAA,EAAA,EAAA,CAE3B,EAAS,EAAE,MAAM,SAAA,CAAA,CAAA,EAAU,EAAA,WAAA,gBAAA,KAAA,EAAA,EAAA,EAAA,CAE3B,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,eAAA,KAAA,EAAA,EAAA,EAAA,CAEzC,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,EAAA,CAE1B,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,aAAA,KAAA,EAAA,EAAA,EAAA,CAG1B,EAAS;CAAE,MAAM;CAAS,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAK1C,GAAA,CAAA,EAAO,EAAA,WAAA,cAAA,KAAA,EAAA,EAAA,EAAA,CAEP,GAAA,CAAA,EAAO,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,EAAA,CAIP,GAAA,CAAA,EAAO,EAAA,WAAA,kBAAA,KAAA,EAAA;AAAA,IAAA,IAAA,IAAA,IAAA,EAAA,CA3CR,EAAc,kBAAA,CAAA,EAAkB,EAAA;AAAA,SAAA,KAAA,GAAA,KAAA"}
package/dist/window.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./window-NDXXyj5v.cjs`);exports.SchmancyWindow=e.t,exports.windowManager=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./window-DAWRoXo1.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-Du_ougyw.js";
1
+ import { n as e, t } from "./window-DPSIGCUq.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.9.10",
3
+ "version": "0.9.12",
4
4
  "description": "UI library build with web components",
5
5
  "main": "./dist/index.js",
6
6
  "customElements": "custom-elements.json",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: schmancy
3
- description: UI patterns, component APIs, and conventions for the @mhmo91/schmancy web-component library (Lit + RxJS + Tailwind). Activate whenever the user works on any <schmancy-*> tag, routing with schmancy-area, state with createContext/@select, the $LitElement base class, theme, directives, or overlay services ($dialog, $notify, schmancyContentDrawer, sheet).
3
+ description: UI patterns, component APIs, and conventions for the @mhmo91/schmancy web-component library (Lit + RxJS + Tailwind) — the exclusive UI stack in this repo's `web/` workspace. Fire this skill on ANY web-UI work, even when the user doesn't name schmancy explicitly — including adding or editing a component, building a form, showing a dialog / toast / side drawer / bottom sheet, wiring routing, reading or writing a context, styling with theme tokens, adding a drop zone / file input / date picker / autocomplete, working with `$LitElement`, or touching any `<schmancy-*>` tag. Also fire on prompts like "build a page", "add a modal", "wire a route", "save user prefs in storage", "animate this", "style with our theme", "make a notification", "how do I do X in Lit", "my drag-and-drop", "dark mode toggle".
4
4
  ---
5
5
 
6
6
  # Schmancy
@@ -67,12 +67,14 @@ Use component tags (`<schmancy-menu>`, `<schmancy-dropdown>`, `<schmancy-tooltip
67
67
  - Lists: `repeat(items, i => i.id, tpl)`. Never `.map()`.
68
68
  - View switching: `cache(...)`.
69
69
  - Expensive work: `guard([deps], () => expensive())`.
70
- - Conditionals: `when(...)` / `choose(...)` / `ifDefined(...)`.
70
+ - Conditionals: every `${...}` placeholder whose value is a `TemplateResult` or `nothing` uses a directive imported from `lit/directives/` — `when(condition, () => html\`...\`, () => html\`...\`?)` for a two-way branch, `choose(value, [['case', () => html\`...\`], …])` for a three-or-more-way dispatch, `ifDefined(maybeUndef)` for nullable attribute values. A chain of `?:` or `&&` expressions whose else-arm is `nothing` evaluates every branch on every render and defeats lit's directive-aware diffing; the pre-edit hook flags this as `NO_TERNARY_NOTHING_DISPATCH`.
71
71
  - DOM access: `ref(createRef())`.
72
72
  - `classMap(this.classMap({...}))` must be the sole expression in `class=` — never mix with string interpolation.
73
73
 
74
74
  **Styling**
75
- - Colors: prefer Tailwind shortcut utilities (`bg-surface-default`, `text-error-default`, `border-outline-variant`) over the arbitrary-value form (`bg-[var(--schmancy-sys-color-X)]`). Every `--schmancy-sys-color-*` token is aliased to `--color-*`, which Tailwind v4 auto-generates into `bg-*`/`text-*`/`border-*`/etc. Full token map: [theme.md § Tailwind utilities](./theme.md#tailwind-utilities). Use the arbitrary-value form only when the token isn't aliased. Never hardcoded hex.
75
+ - Styling uses Tailwind and schmancy tokens. The `css` template passed to `$LitElement` contains only `:host` rules, `@keyframes`, and selectors targeting vendor pseudo-elements (`::-webkit-*`, `::-moz-*`). Other styling is set through Tailwind utility classes and schmancy theme tokens on the `class=` attribute. The `style=` attribute holds per-instance dynamic values only (e.g. `style="--tide: ${value}"`).
76
+ Remediation: move declarations to Tailwind on the `class=` attribute (`backdrop-filter: blur(20px)` → `backdrop-blur-xl`; `color-mix(in oklch, Canvas 72%, transparent)` → `bg-surface/70`; `border-radius: 14px` → `rounded-2xl`; `transition: opacity 80ms linear` → `transition-opacity duration-75 ease-linear`). When a visual pattern seems to want its own class (like `.glass`), check `INDEX.md` — schmancy likely ships the component.
77
+ - Colors: `--schmancy-sys-color-*` CSS vars or Tailwind theme classes. Never hardcoded hex.
76
78
  - No `setTimeout` / `setInterval` / `addEventListener` — use RxJS (`timer`, `interval`, `fromEvent`).
77
79
 
78
80
  **Accessibility (combobox forms)**
@@ -1,9 +1,11 @@
1
1
  import { $LitElement } from '@mixins/index'
2
+ import { provide } from '@lit/context'
2
3
  import { css, html, LitElement } from 'lit'
3
4
  import { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'
4
5
  import { ifDefined } from 'lit/directives/if-defined.js'
5
6
  import { when } from 'lit/directives/when.js'
6
7
  import { magnetic } from '../directives/magnetic'
8
+ import { SchmancyButtonSizeContext, type SchmancyButtonSize } from './context'
7
9
 
8
10
  export interface SchmancyButtonEventMap {
9
11
  SchmancyFocus: CustomEvent<void>
@@ -132,13 +134,16 @@ export class SchmancyButton extends $LitElement(
132
134
 
133
135
  /**
134
136
  * The size of the button.
137
+ * Provided as `SchmancyButtonSizeContext` to descendant elements so children
138
+ * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.
135
139
  * @attr
136
140
  * @type {'xxs' | 'xs' | 'sm' | 'md' | 'lg'}
137
141
  * @default 'md'
138
142
  * @public
139
143
  */
144
+ @provide({ context: SchmancyButtonSizeContext })
140
145
  @property({ type: String })
141
- public size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' = 'md'
146
+ public size: SchmancyButtonSize = 'md'
142
147
 
143
148
  /**
144
149
  * The type of the button.
@@ -0,0 +1,9 @@
1
+ import { createContext } from '@lit/context'
2
+
3
+ export type SchmancyButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg'
4
+
5
+ /**
6
+ * Provided by `<schmancy-button>` to its descendants so children
7
+ * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.
8
+ */
9
+ export const SchmancyButtonSizeContext = createContext<SchmancyButtonSize>('schmancy-button-size')
package/src/icons/icon.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { TailwindElement } from '@mixins/index'
2
+ import { consume } from '@lit/context'
2
3
  import { css, html } from 'lit'
3
4
  import { customElement, property, state } from 'lit/decorators.js'
4
5
  import { BehaviorSubject, combineLatest, takeUntil } from 'rxjs'
5
6
  import { tap } from 'rxjs/operators'
7
+ import { SchmancyButtonSizeContext, type SchmancyButtonSize } from '../button/context'
6
8
 
7
9
  /**
8
10
  * Icon size tokens - M3 aligned with optical size optimization
@@ -127,10 +129,22 @@ export default class SchmancyIcon extends TailwindElement(css`
127
129
  * Size of the icon - M3 aligned tokens or custom string
128
130
  * Tokens: 'xxs' (12px), 'xs' (16px), 'sm' (20px), 'md' (24px), 'lg' (32px)
129
131
  * Custom: any CSS size string like '48px', '2rem'
132
+ *
133
+ * When this icon is a descendant of `<schmancy-button>`, the button's
134
+ * `size` wins (via `SchmancyButtonSizeContext`). The local `size` only
135
+ * applies when there is no ancestor button.
130
136
  */
131
137
  @property({ type: String, reflect: true })
132
138
  size: IconSize = 'md'
133
139
 
140
+ /**
141
+ * Size inherited from an ancestor `<schmancy-button>` via context.
142
+ * Undefined when the icon is not nested in a button.
143
+ */
144
+ @consume({ context: SchmancyButtonSizeContext, subscribe: true })
145
+ @state()
146
+ private _buttonSize?: SchmancyButtonSize
147
+
134
148
  /**
135
149
  * Icon name - use this instead of slot content to prevent translation breaking icons.
136
150
  * When set, this takes precedence over slot content.
@@ -259,10 +273,12 @@ export default class SchmancyIcon extends TailwindElement(css`
259
273
  'sharp': 'Material Symbols Sharp'
260
274
  }[this.variant] || 'Material Symbols Outlined'
261
275
 
276
+ // Effective size: ancestor `<schmancy-button>` wins via context, else local `size`.
277
+ const effectiveSize: IconSize = this._buttonSize ?? this.size
262
278
  // Resolve size: token → px, bare number → px, or pass through as-is
263
- const sizeConfig = SchmancyIcon.tokenSizes[this.size]
264
- const isNumeric = !sizeConfig && /^\d+(\.\d+)?$/.test(this.size)
265
- const iconSize = sizeConfig?.size || (isNumeric ? `${this.size}px` : this.size)
279
+ const sizeConfig = SchmancyIcon.tokenSizes[effectiveSize]
280
+ const isNumeric = !sizeConfig && /^\d+(\.\d+)?$/.test(effectiveSize)
281
+ const iconSize = sizeConfig?.size || (isNumeric ? `${effectiveSize}px` : effectiveSize)
266
282
  const opticalSize = sizeConfig?.opsz || SchmancyIcon.computeOpticalSize(iconSize)
267
283
 
268
284
  // Set size on HOST so :host CSS picks it up
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import { type SchmancyButtonSize } from './context';
2
3
  export interface SchmancyButtonEventMap {
3
4
  SchmancyFocus: CustomEvent<void>;
4
5
  SchmancyBlur: CustomEvent<void>;
@@ -55,12 +56,14 @@ export declare class SchmancyButton extends SchmancyButton_base {
55
56
  width: 'full' | 'auto';
56
57
  /**
57
58
  * The size of the button.
59
+ * Provided as `SchmancyButtonSizeContext` to descendant elements so children
60
+ * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.
58
61
  * @attr
59
62
  * @type {'xxs' | 'xs' | 'sm' | 'md' | 'lg'}
60
63
  * @default 'md'
61
64
  * @public
62
65
  */
63
- size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
66
+ size: SchmancyButtonSize;
64
67
  /**
65
68
  * The type of the button.
66
69
  * Defaults to 'button' (preventing accidental form submissions).
@@ -0,0 +1,8 @@
1
+ export type SchmancyButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
2
+ /**
3
+ * Provided by `<schmancy-button>` to its descendants so children
4
+ * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.
5
+ */
6
+ export declare const SchmancyButtonSizeContext: {
7
+ __context__: SchmancyButtonSize;
8
+ };
@@ -50,8 +50,17 @@ export default class SchmancyIcon extends SchmancyIcon_base {
50
50
  * Size of the icon - M3 aligned tokens or custom string
51
51
  * Tokens: 'xxs' (12px), 'xs' (16px), 'sm' (20px), 'md' (24px), 'lg' (32px)
52
52
  * Custom: any CSS size string like '48px', '2rem'
53
+ *
54
+ * When this icon is a descendant of `<schmancy-button>`, the button's
55
+ * `size` wins (via `SchmancyButtonSizeContext`). The local `size` only
56
+ * applies when there is no ancestor button.
53
57
  */
54
58
  size: IconSize;
59
+ /**
60
+ * Size inherited from an ancestor `<schmancy-button>` via context.
61
+ * Undefined when the icon is not nested in a button.
62
+ */
63
+ private _buttonSize?;
55
64
  /**
56
65
  * Icon name - use this instead of slot content to prevent translation breaking icons.
57
66
  * When set, this takes precedence over slot content.
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons-1AkKNd7O.cjs","names":[],"sources":["../src/icons/icon.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { BehaviorSubject, combineLatest, takeUntil } from 'rxjs'\nimport { tap } from 'rxjs/operators'\n\n/**\n * Icon size tokens - M3 aligned with optical size optimization\n * - xxs: 12px (opsz: 20) - fits in 24px buttons (ultra-compact)\n * - xs: 16px (opsz: 20) - fits in 32px buttons\n * - sm: 20px (opsz: 20) - fits in 40px buttons\n * - md: 24px (opsz: 24) - fits in 48px buttons (default)\n * - lg: 32px (opsz: 40) - fits in 56px buttons\n * - Or custom string like '48px'\n */\nexport type IconSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | string\n\n/**\n * @element schmancy-icon\n * Material Symbols icon component with flexible font variation properties\n *\n * @cssprop --schmancy-icon-size - The size of the icon (default: 24px)\n * @cssprop --schmancy-icon-fill - Fill value for icon (0-1)\n * @cssprop --schmancy-icon-weight - Weight value for icon (100-700)\n * @cssprop --schmancy-icon-grade - Grade value for icon (-50-200)\n * @cssprop --schmancy-icon-opsz - Optical size (default: 24)\n * @csspart icon - The inner `<span>` carrying the Material Symbols glyph.\n */\n@customElement('schmancy-icon')\nexport default class SchmancyIcon extends TailwindElement(css`\n\t:host {\n\t\t--schmancy-icon-size: 24px;\n\t\t--schmancy-icon-fill: 0;\n\t\t--schmancy-icon-weight: 400;\n\t\t--schmancy-icon-grade: 0;\n\t\t--schmancy-icon-opsz: 24;\n\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: var(--schmancy-icon-size);\n\t\theight: var(--schmancy-icon-size);\n\t\tfont-size: var(--schmancy-icon-size);\n\t\tcolor: inherit;\n\t\ttransition: font-variation-settings 0.2s ease;\n\t}\n\n\t.material-symbols {\n\t\tfont-family: var(--schmancy-icon-font, 'Material Symbols Outlined');\n\t\tfont-weight: normal;\n\t\tfont-style: normal;\n\t\tline-height: 1;\n\t\tletter-spacing: normal;\n\t\ttext-transform: none;\n\t\tdisplay: inline-block;\n\t\twhite-space: nowrap;\n\t\tword-wrap: normal;\n\t\tdirection: ltr;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-webkit-font-feature-settings: 'liga';\n\t\tfont-feature-settings: 'liga';\n\t\tfont-variation-settings:\n\t\t\t'FILL' var(--schmancy-icon-fill),\n\t\t\t'wght' var(--schmancy-icon-weight),\n\t\t\t'GRAD' var(--schmancy-icon-grade),\n\t\t\t'opsz' var(--schmancy-icon-opsz);\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t}\n\n\t/* CSS-generated content is NOT translated by Google Translate */\n\t.material-symbols[data-icon]::before {\n\t\tcontent: attr(data-icon);\n\t}\n`) {\n\t// Static flag to track if Google Fonts have been loaded\n\tprivate static fontsLoaded = false\n\n\t/**\n\t * Load Material Symbols fonts from Google Fonts CDN\n\t */\n\tprivate static loadFonts(): void {\n\t\tif (SchmancyIcon.fontsLoaded) {\n\t\t\treturn\n\t\t}\n\n\t\tconst link = document.createElement('link')\n\t\tlink.rel = 'stylesheet'\n\t\tlink.href = 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap'\n\t\tdocument.head.appendChild(link)\n\n\t\tSchmancyIcon.fontsLoaded = true\n\t}\n\n\t/**\n\t * Fill value for the icon (0-1)\n\t * 0 = outlined, 1 = filled\n\t */\n\t@property({ type: Number, reflect: true })\n\tfill = 0\n\n\t/**\n\t * Weight value for the icon (100-700)\n\t * Controls the thickness of the icon strokes\n\t */\n\t@property({ type: Number, reflect: true })\n\tweight = 400\n\n\t/**\n\t * Grade value for the icon (-50-200)\n\t * Adjusts the visual weight/grade\n\t */\n\t@property({ type: Number, reflect: true })\n\tgrade = 0\n\n\t/**\n\t * Icon variant style\n\t * @values outlined | rounded | sharp\n\t */\n\t@property({ type: String, reflect: true })\n\tvariant: 'outlined' | 'rounded' | 'sharp' = 'outlined'\n\n\t/**\n\t * Size of the icon - M3 aligned tokens or custom string\n\t * Tokens: 'xxs' (12px), 'xs' (16px), 'sm' (20px), 'md' (24px), 'lg' (32px)\n\t * Custom: any CSS size string like '48px', '2rem'\n\t */\n\t@property({ type: String, reflect: true })\n\tsize: IconSize = 'md'\n\n\t/**\n\t * Icon name - use this instead of slot content to prevent translation breaking icons.\n\t * When set, this takes precedence over slot content.\n\t * Example: <schmancy-icon icon=\"delete\"></schmancy-icon>\n\t */\n\t@property({ type: String })\n\ticon?: string\n\n\t// M3 aligned token sizes with optimal optical sizes\n\tprivate static readonly tokenSizes: Record<string, { size: string; opsz: number }> = {\n\t\txxs: { size: '12px', opsz: 20 }, // fits in 24px buttons (ultra-compact)\n\t\txs: { size: '16px', opsz: 20 }, // fits in 32px buttons\n\t\tsm: { size: '20px', opsz: 20 }, // fits in 40px buttons\n\t\tmd: { size: '24px', opsz: 24 }, // fits in 48px buttons (default)\n\t\tlg: { size: '32px', opsz: 40 }, // fits in 56px buttons\n\t}\n\n\t/** Extract pixel value from a custom size string for optical size */\n\tprivate static computeOpticalSize(size: string): number {\n\t\tconst px = parseFloat(size)\n\t\treturn isNaN(px) ? 24 : Math.max(20, Math.min(48, Math.round(px)))\n\t}\n\n\t// RxJS subjects for reactive property updates\n\tprivate fill$ = new BehaviorSubject(this.fill)\n\tprivate weight$ = new BehaviorSubject(this.weight)\n\tprivate grade$ = new BehaviorSubject(this.grade)\n\tprivate variant$ = new BehaviorSubject(this.variant)\n\n\t// Captured icon name from slot content (translation-proof)\n\t@state()\n\tprivate _capturedIcon?: string\n\n\t// Observer for text content changes (ternaries update text nodes, not DOM structure)\n\tprivate _observer?: MutationObserver\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\n\t\t// Capture initial icon name\n\t\tthis._updateCapturedIcon()\n\n\t\t// Watch for text content changes (characterData) for dynamic icon updates\n\t\tthis._observer = new MutationObserver(() => this._updateCapturedIcon())\n\t\tthis._observer.observe(this, { childList: true, characterData: true, subtree: true })\n\n\t\t// Load Google Fonts if not already loaded\n\t\tSchmancyIcon.loadFonts()\n\n\t\t// Prevent browser translation from breaking icon ligatures\n\t\t// Using multiple methods for maximum compatibility:\n\t\t// - translate=\"no\" (HTML5 standard)\n\t\t// - class=\"notranslate\" (Google Translate specific)\n\t\tthis.setAttribute('translate', 'no')\n\t\tthis.classList.add('notranslate')\n\n\t\t// Set accessibility attributes for decorative icons\n\t\tif (!this.hasAttribute('aria-label') &&\n\t\t !this.hasAttribute('aria-labelledby') &&\n\t\t !this.hasAttribute('aria-hidden') &&\n\t\t !this.hasAttribute('role')) {\n\t\t\tthis.setAttribute('aria-hidden', 'true')\n\t\t}\n\n\t\t// Setup reactive CSS variable updates\n\t\tcombineLatest([\n\t\t\tthis.fill$,\n\t\t\tthis.weight$,\n\t\t\tthis.grade$,\n\t\t\tthis.variant$\n\t\t]).pipe(\n\t\t\ttap(([fill, weight, grade, variant]) => {\n\t\t\t\t// Update CSS custom properties for smooth transitions\n\t\t\t\tthis.style.setProperty('--schmancy-icon-fill', String(fill))\n\t\t\t\tthis.style.setProperty('--schmancy-icon-weight', String(weight))\n\t\t\t\tthis.style.setProperty('--schmancy-icon-grade', String(grade))\n\n\t\t\t\t// Update font family based on variant\n\t\t\t\tconst fontFamily = {\n\t\t\t\t\t'outlined': 'Material Symbols Outlined',\n\t\t\t\t\t'rounded': 'Material Symbols Rounded',\n\t\t\t\t\t'sharp': 'Material Symbols Sharp'\n\t\t\t\t}[variant] || 'Material Symbols Outlined'\n\n\t\t\t\tthis.style.setProperty('--schmancy-icon-font', fontFamily)\n\t\t\t}),\n\t\t\ttakeUntil(this.disconnecting)\n\t\t).subscribe()\n\n\t}\n\n\t/**\n\t * Update captured icon from current text content\n\t */\n\tprivate _updateCapturedIcon(): void {\n\t\tif (!this.icon) {\n\t\t\tconst textContent = this.textContent?.trim()\n\t\t\tif (textContent && textContent !== this._capturedIcon) {\n\t\t\t\tthis._capturedIcon = textContent\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\n\t\t// Update BehaviorSubjects when properties change\n\t\tif (changedProperties.has('fill')) {\n\t\t\tthis.fill$.next(this.fill)\n\t\t}\n\t\tif (changedProperties.has('weight')) {\n\t\t\tthis.weight$.next(this.weight)\n\t\t}\n\t\tif (changedProperties.has('grade')) {\n\t\t\tthis.grade$.next(this.grade)\n\t\t}\n\t\tif (changedProperties.has('variant')) {\n\t\t\tthis.variant$.next(this.variant)\n\t\t}\n\t}\n\n\tprotected render(): unknown {\n\t\tconst fontFamily = {\n\t\t\t'outlined': 'Material Symbols Outlined',\n\t\t\t'rounded': 'Material Symbols Rounded',\n\t\t\t'sharp': 'Material Symbols Sharp'\n\t\t}[this.variant] || 'Material Symbols Outlined'\n\n\t\t// Resolve size: token → px, bare number → px, or pass through as-is\n\t\tconst sizeConfig = SchmancyIcon.tokenSizes[this.size]\n\t\tconst isNumeric = !sizeConfig && /^\\d+(\\.\\d+)?$/.test(this.size)\n\t\tconst iconSize = sizeConfig?.size || (isNumeric ? `${this.size}px` : this.size)\n\t\tconst opticalSize = sizeConfig?.opsz || SchmancyIcon.computeOpticalSize(iconSize)\n\n\t\t// Set size on HOST so :host CSS picks it up\n\t\tthis.style.setProperty('--schmancy-icon-size', iconSize)\n\t\tthis.style.setProperty('--schmancy-icon-opsz', String(opticalSize))\n\n\t\tconst style = {\n\t\t\t'--schmancy-icon-fill': this.fill,\n\t\t\t'--schmancy-icon-weight': this.weight,\n\t\t\t'--schmancy-icon-grade': this.grade,\n\t\t\t'--schmancy-icon-font': fontFamily,\n\t\t}\n\n\t\t// Priority: icon property > captured icon (for dynamic content)\n\t\tconst iconName = this.icon || this._capturedIcon\n\n\t\t// Always render slot (hidden) to observe content changes, display via data-icon\n\t\treturn html`\n\t\t\t<span class=\"material-symbols notranslate\" part=\"icon\" translate=\"no\" data-icon=${iconName || ''} style=${this.styleMap(style)}></span>\n\t\t\t<slot style=\"display:none\"></slot>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-icon': SchmancyIcon\n\t}\n}"],"mappings":"sPA6Be,EAAA,cAA2B,EAAA,EAAgB,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDAyErD,EAAA,KAAA,OAOE,IAAA,KAAA,MAOD,EAAA,KAAA,QAOoC,WAAA,KAAA,KAQ3B,KAAA,KAAA,MA0BD,IAAI,EAAA,gBAAgB,KAAK,KAAA,CAAA,KAAA,QACvB,IAAI,EAAA,gBAAgB,KAAK,OAAA,CAAA,KAAA,OAC1B,IAAI,EAAA,gBAAgB,KAAK,MAAA,CAAA,KAAA,SACvB,IAAI,EAAA,gBAAgB,KAAK,QAAA,CAAA,OAAA,KAAA,YAAA,CAjFf,EAK7B,OAAA,WAAe,CACd,GAAA,EAAiB,YAChB,OAGD,IAAM,EAAO,SAAS,cAAc,OAAA,CACpC,EAAK,IAAM,aACX,EAAK,KAAO,sSACZ,SAAS,KAAK,YAAY,EAAA,CAE1B,EAAa,YAAA,CAAc,EAAA,OAAA,KAAA,WAgDyD,CACpF,IAAK,CAAE,KAAM,OAAQ,KAAM,GAAA,CAC3B,GAAI,CAAE,KAAM,OAAQ,KAAM,GAAA,CAC1B,GAAI,CAAE,KAAM,OAAQ,KAAM,GAAA,CAC1B,GAAI,CAAE,KAAM,OAAQ,KAAM,GAAA,CAC1B,GAAI,CAAE,KAAM,OAAQ,KAAM,GAAA,CAAA,CAI3B,OAAA,mBAAkC,EAAA,CACjC,IAAM,EAAK,WAAW,EAAA,CACtB,OAAO,MAAM,EAAA,CAAM,GAAK,KAAK,IAAI,GAAI,KAAK,IAAI,GAAI,KAAK,MAAM,EAAA,CAAA,CAAA,CAgB9D,mBAAA,CACC,MAAM,mBAAA,CAGN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EAAA,EAAA,UAQhC,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CAyBnB,EAAA,UAAA,gBAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eAvIM,gBAAA,CAAA,CAAgB,EAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons-DqIVrIIK.js","names":[],"sources":["../src/icons/icon.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { BehaviorSubject, combineLatest, takeUntil } from 'rxjs'\nimport { tap } from 'rxjs/operators'\n\n/**\n * Icon size tokens - M3 aligned with optical size optimization\n * - xxs: 12px (opsz: 20) - fits in 24px buttons (ultra-compact)\n * - xs: 16px (opsz: 20) - fits in 32px buttons\n * - sm: 20px (opsz: 20) - fits in 40px buttons\n * - md: 24px (opsz: 24) - fits in 48px buttons (default)\n * - lg: 32px (opsz: 40) - fits in 56px buttons\n * - Or custom string like '48px'\n */\nexport type IconSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | string\n\n/**\n * @element schmancy-icon\n * Material Symbols icon component with flexible font variation properties\n *\n * @cssprop --schmancy-icon-size - The size of the icon (default: 24px)\n * @cssprop --schmancy-icon-fill - Fill value for icon (0-1)\n * @cssprop --schmancy-icon-weight - Weight value for icon (100-700)\n * @cssprop --schmancy-icon-grade - Grade value for icon (-50-200)\n * @cssprop --schmancy-icon-opsz - Optical size (default: 24)\n * @csspart icon - The inner `<span>` carrying the Material Symbols glyph.\n */\n@customElement('schmancy-icon')\nexport default class SchmancyIcon extends TailwindElement(css`\n\t:host {\n\t\t--schmancy-icon-size: 24px;\n\t\t--schmancy-icon-fill: 0;\n\t\t--schmancy-icon-weight: 400;\n\t\t--schmancy-icon-grade: 0;\n\t\t--schmancy-icon-opsz: 24;\n\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: var(--schmancy-icon-size);\n\t\theight: var(--schmancy-icon-size);\n\t\tfont-size: var(--schmancy-icon-size);\n\t\tcolor: inherit;\n\t\ttransition: font-variation-settings 0.2s ease;\n\t}\n\n\t.material-symbols {\n\t\tfont-family: var(--schmancy-icon-font, 'Material Symbols Outlined');\n\t\tfont-weight: normal;\n\t\tfont-style: normal;\n\t\tline-height: 1;\n\t\tletter-spacing: normal;\n\t\ttext-transform: none;\n\t\tdisplay: inline-block;\n\t\twhite-space: nowrap;\n\t\tword-wrap: normal;\n\t\tdirection: ltr;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-webkit-font-feature-settings: 'liga';\n\t\tfont-feature-settings: 'liga';\n\t\tfont-variation-settings:\n\t\t\t'FILL' var(--schmancy-icon-fill),\n\t\t\t'wght' var(--schmancy-icon-weight),\n\t\t\t'GRAD' var(--schmancy-icon-grade),\n\t\t\t'opsz' var(--schmancy-icon-opsz);\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t}\n\n\t/* CSS-generated content is NOT translated by Google Translate */\n\t.material-symbols[data-icon]::before {\n\t\tcontent: attr(data-icon);\n\t}\n`) {\n\t// Static flag to track if Google Fonts have been loaded\n\tprivate static fontsLoaded = false\n\n\t/**\n\t * Load Material Symbols fonts from Google Fonts CDN\n\t */\n\tprivate static loadFonts(): void {\n\t\tif (SchmancyIcon.fontsLoaded) {\n\t\t\treturn\n\t\t}\n\n\t\tconst link = document.createElement('link')\n\t\tlink.rel = 'stylesheet'\n\t\tlink.href = 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap'\n\t\tdocument.head.appendChild(link)\n\n\t\tSchmancyIcon.fontsLoaded = true\n\t}\n\n\t/**\n\t * Fill value for the icon (0-1)\n\t * 0 = outlined, 1 = filled\n\t */\n\t@property({ type: Number, reflect: true })\n\tfill = 0\n\n\t/**\n\t * Weight value for the icon (100-700)\n\t * Controls the thickness of the icon strokes\n\t */\n\t@property({ type: Number, reflect: true })\n\tweight = 400\n\n\t/**\n\t * Grade value for the icon (-50-200)\n\t * Adjusts the visual weight/grade\n\t */\n\t@property({ type: Number, reflect: true })\n\tgrade = 0\n\n\t/**\n\t * Icon variant style\n\t * @values outlined | rounded | sharp\n\t */\n\t@property({ type: String, reflect: true })\n\tvariant: 'outlined' | 'rounded' | 'sharp' = 'outlined'\n\n\t/**\n\t * Size of the icon - M3 aligned tokens or custom string\n\t * Tokens: 'xxs' (12px), 'xs' (16px), 'sm' (20px), 'md' (24px), 'lg' (32px)\n\t * Custom: any CSS size string like '48px', '2rem'\n\t */\n\t@property({ type: String, reflect: true })\n\tsize: IconSize = 'md'\n\n\t/**\n\t * Icon name - use this instead of slot content to prevent translation breaking icons.\n\t * When set, this takes precedence over slot content.\n\t * Example: <schmancy-icon icon=\"delete\"></schmancy-icon>\n\t */\n\t@property({ type: String })\n\ticon?: string\n\n\t// M3 aligned token sizes with optimal optical sizes\n\tprivate static readonly tokenSizes: Record<string, { size: string; opsz: number }> = {\n\t\txxs: { size: '12px', opsz: 20 }, // fits in 24px buttons (ultra-compact)\n\t\txs: { size: '16px', opsz: 20 }, // fits in 32px buttons\n\t\tsm: { size: '20px', opsz: 20 }, // fits in 40px buttons\n\t\tmd: { size: '24px', opsz: 24 }, // fits in 48px buttons (default)\n\t\tlg: { size: '32px', opsz: 40 }, // fits in 56px buttons\n\t}\n\n\t/** Extract pixel value from a custom size string for optical size */\n\tprivate static computeOpticalSize(size: string): number {\n\t\tconst px = parseFloat(size)\n\t\treturn isNaN(px) ? 24 : Math.max(20, Math.min(48, Math.round(px)))\n\t}\n\n\t// RxJS subjects for reactive property updates\n\tprivate fill$ = new BehaviorSubject(this.fill)\n\tprivate weight$ = new BehaviorSubject(this.weight)\n\tprivate grade$ = new BehaviorSubject(this.grade)\n\tprivate variant$ = new BehaviorSubject(this.variant)\n\n\t// Captured icon name from slot content (translation-proof)\n\t@state()\n\tprivate _capturedIcon?: string\n\n\t// Observer for text content changes (ternaries update text nodes, not DOM structure)\n\tprivate _observer?: MutationObserver\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\n\t\t// Capture initial icon name\n\t\tthis._updateCapturedIcon()\n\n\t\t// Watch for text content changes (characterData) for dynamic icon updates\n\t\tthis._observer = new MutationObserver(() => this._updateCapturedIcon())\n\t\tthis._observer.observe(this, { childList: true, characterData: true, subtree: true })\n\n\t\t// Load Google Fonts if not already loaded\n\t\tSchmancyIcon.loadFonts()\n\n\t\t// Prevent browser translation from breaking icon ligatures\n\t\t// Using multiple methods for maximum compatibility:\n\t\t// - translate=\"no\" (HTML5 standard)\n\t\t// - class=\"notranslate\" (Google Translate specific)\n\t\tthis.setAttribute('translate', 'no')\n\t\tthis.classList.add('notranslate')\n\n\t\t// Set accessibility attributes for decorative icons\n\t\tif (!this.hasAttribute('aria-label') &&\n\t\t !this.hasAttribute('aria-labelledby') &&\n\t\t !this.hasAttribute('aria-hidden') &&\n\t\t !this.hasAttribute('role')) {\n\t\t\tthis.setAttribute('aria-hidden', 'true')\n\t\t}\n\n\t\t// Setup reactive CSS variable updates\n\t\tcombineLatest([\n\t\t\tthis.fill$,\n\t\t\tthis.weight$,\n\t\t\tthis.grade$,\n\t\t\tthis.variant$\n\t\t]).pipe(\n\t\t\ttap(([fill, weight, grade, variant]) => {\n\t\t\t\t// Update CSS custom properties for smooth transitions\n\t\t\t\tthis.style.setProperty('--schmancy-icon-fill', String(fill))\n\t\t\t\tthis.style.setProperty('--schmancy-icon-weight', String(weight))\n\t\t\t\tthis.style.setProperty('--schmancy-icon-grade', String(grade))\n\n\t\t\t\t// Update font family based on variant\n\t\t\t\tconst fontFamily = {\n\t\t\t\t\t'outlined': 'Material Symbols Outlined',\n\t\t\t\t\t'rounded': 'Material Symbols Rounded',\n\t\t\t\t\t'sharp': 'Material Symbols Sharp'\n\t\t\t\t}[variant] || 'Material Symbols Outlined'\n\n\t\t\t\tthis.style.setProperty('--schmancy-icon-font', fontFamily)\n\t\t\t}),\n\t\t\ttakeUntil(this.disconnecting)\n\t\t).subscribe()\n\n\t}\n\n\t/**\n\t * Update captured icon from current text content\n\t */\n\tprivate _updateCapturedIcon(): void {\n\t\tif (!this.icon) {\n\t\t\tconst textContent = this.textContent?.trim()\n\t\t\tif (textContent && textContent !== this._capturedIcon) {\n\t\t\t\tthis._capturedIcon = textContent\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\n\t\t// Update BehaviorSubjects when properties change\n\t\tif (changedProperties.has('fill')) {\n\t\t\tthis.fill$.next(this.fill)\n\t\t}\n\t\tif (changedProperties.has('weight')) {\n\t\t\tthis.weight$.next(this.weight)\n\t\t}\n\t\tif (changedProperties.has('grade')) {\n\t\t\tthis.grade$.next(this.grade)\n\t\t}\n\t\tif (changedProperties.has('variant')) {\n\t\t\tthis.variant$.next(this.variant)\n\t\t}\n\t}\n\n\tprotected render(): unknown {\n\t\tconst fontFamily = {\n\t\t\t'outlined': 'Material Symbols Outlined',\n\t\t\t'rounded': 'Material Symbols Rounded',\n\t\t\t'sharp': 'Material Symbols Sharp'\n\t\t}[this.variant] || 'Material Symbols Outlined'\n\n\t\t// Resolve size: token → px, bare number → px, or pass through as-is\n\t\tconst sizeConfig = SchmancyIcon.tokenSizes[this.size]\n\t\tconst isNumeric = !sizeConfig && /^\\d+(\\.\\d+)?$/.test(this.size)\n\t\tconst iconSize = sizeConfig?.size || (isNumeric ? `${this.size}px` : this.size)\n\t\tconst opticalSize = sizeConfig?.opsz || SchmancyIcon.computeOpticalSize(iconSize)\n\n\t\t// Set size on HOST so :host CSS picks it up\n\t\tthis.style.setProperty('--schmancy-icon-size', iconSize)\n\t\tthis.style.setProperty('--schmancy-icon-opsz', String(opticalSize))\n\n\t\tconst style = {\n\t\t\t'--schmancy-icon-fill': this.fill,\n\t\t\t'--schmancy-icon-weight': this.weight,\n\t\t\t'--schmancy-icon-grade': this.grade,\n\t\t\t'--schmancy-icon-font': fontFamily,\n\t\t}\n\n\t\t// Priority: icon property > captured icon (for dynamic content)\n\t\tconst iconName = this.icon || this._capturedIcon\n\n\t\t// Always render slot (hidden) to observe content changes, display via data-icon\n\t\treturn html`\n\t\t\t<span class=\"material-symbols notranslate\" part=\"icon\" translate=\"no\" data-icon=${iconName || ''} style=${this.styleMap(style)}></span>\n\t\t\t<slot style=\"display:none\"></slot>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-icon': SchmancyIcon\n\t}\n}"],"mappings":";;;;;;;OA6Be,IAAA,cAA2B,EAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAyErD,GAAA,KAAA,SAOE,KAAA,KAAA,QAOD,GAAA,KAAA,UAOoC,YAAA,KAAA,OAQ3B,MAAA,KAAA,QA0BD,IAAI,EAAgB,KAAK,KAAA,EAAA,KAAA,UACvB,IAAI,EAAgB,KAAK,OAAA,EAAA,KAAA,SAC1B,IAAI,EAAgB,KAAK,MAAA,EAAA,KAAA,WACvB,IAAI,EAAgB,KAAK,QAAA;;CAAA;AAAA,OAAA,cAAA,CAjFf;;CAK7B,OAAA,YAAe;AACd,MAAA,EAAiB,YAChB;EAGD,IAAM,IAAO,SAAS,cAAc,OAAA;AACpC,IAAK,MAAM,cACX,EAAK,OAAO,uSACZ,SAAS,KAAK,YAAY,EAAA,EAE1B,EAAa,cAAA,CAAc;;CAAA;AAAA,OAAA,aAgDyD;GACpF,KAAK;IAAE,MAAM;IAAQ,MAAM;I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