@mhmo91/schmancy 0.2.194 → 0.2.196

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 (328) hide show
  1. package/ai/animated-text.md +114 -0
  2. package/ai/area.md +158 -78
  3. package/ai/card.md +162 -131
  4. package/ai/circular-progress.md +91 -0
  5. package/ai/content-drawer.md +190 -0
  6. package/ai/date-range.md +142 -0
  7. package/ai/delay.md +158 -0
  8. package/ai/dialog.md +10 -0
  9. package/ai/divider.md +153 -0
  10. package/ai/index.md +43 -3
  11. package/ai/nav-drawer.md +206 -0
  12. package/ai/option.md +173 -0
  13. package/ai/slider.md +227 -0
  14. package/ai/steps.md +231 -0
  15. package/ai/surface.md +139 -200
  16. package/ai/table.md +99 -1
  17. package/ai/teleport.md +196 -0
  18. package/ai/theme-button.md +173 -0
  19. package/ai/theme.md +241 -0
  20. package/ai/typewriter.md +217 -0
  21. package/dist/_headers +2 -0
  22. package/dist/ai/animated-text.md +114 -0
  23. package/dist/ai/area.md +158 -78
  24. package/dist/ai/card.md +162 -131
  25. package/dist/ai/circular-progress.md +91 -0
  26. package/dist/ai/content-drawer.md +190 -0
  27. package/dist/ai/date-range.md +142 -0
  28. package/dist/ai/delay.md +158 -0
  29. package/dist/ai/dialog.md +10 -0
  30. package/dist/ai/divider.md +153 -0
  31. package/dist/ai/index.md +43 -3
  32. package/dist/ai/nav-drawer.md +206 -0
  33. package/dist/ai/option.md +173 -0
  34. package/dist/ai/slider.md +227 -0
  35. package/dist/ai/steps.md +231 -0
  36. package/dist/ai/surface.md +139 -200
  37. package/dist/ai/table.md +99 -1
  38. package/dist/ai/teleport.md +196 -0
  39. package/dist/ai/theme-button.md +173 -0
  40. package/dist/ai/theme.md +241 -0
  41. package/dist/ai/typewriter.md +217 -0
  42. package/dist/{animated-text-9AM64DHd.cjs → animated-text-DnX2TopW.cjs} +2 -2
  43. package/dist/{animated-text-9AM64DHd.cjs.map → animated-text-DnX2TopW.cjs.map} +1 -1
  44. package/dist/{animated-text-CVStWn5N.js → animated-text-jv1yAwLh.js} +3 -3
  45. package/dist/{animated-text-CVStWn5N.js.map → animated-text-jv1yAwLh.js.map} +1 -1
  46. package/dist/animated-text.cjs +1 -1
  47. package/dist/animated-text.js +1 -1
  48. package/dist/area.cjs +1 -1
  49. package/dist/area.component-DMD20wqd.js +191 -0
  50. package/dist/area.component-DMD20wqd.js.map +1 -0
  51. package/dist/area.component-Vs2WGXgk.cjs +8 -0
  52. package/dist/area.component-Vs2WGXgk.cjs.map +1 -0
  53. package/dist/area.js +21 -6
  54. package/dist/area.js.map +1 -1
  55. package/dist/{autocomplete-DBXvIJgc.cjs → autocomplete-BrAxEJJq.cjs} +2 -2
  56. package/dist/{autocomplete-DBXvIJgc.cjs.map → autocomplete-BrAxEJJq.cjs.map} +1 -1
  57. package/dist/{autocomplete-ih92pPkb.js → autocomplete-OS61ngsy.js} +3 -3
  58. package/dist/{autocomplete-ih92pPkb.js.map → autocomplete-OS61ngsy.js.map} +1 -1
  59. package/dist/autocomplete.cjs +1 -1
  60. package/dist/autocomplete.js +1 -1
  61. package/dist/{avatar-Bmg5TXj9.cjs → avatar-CEdv8DJY.cjs} +62 -24
  62. package/dist/avatar-CEdv8DJY.cjs.map +1 -0
  63. package/dist/{avatar-CgP1tBZq.js → avatar-CUHTDenQ.js} +183 -145
  64. package/dist/avatar-CUHTDenQ.js.map +1 -0
  65. package/dist/badge.cjs +1 -1
  66. package/dist/badge.js +1 -1
  67. package/dist/busy.cjs +1 -1
  68. package/dist/busy.js +1 -1
  69. package/dist/button.cjs +1 -1
  70. package/dist/button.js +1 -1
  71. package/dist/card.cjs +1 -1
  72. package/dist/card.js +1 -1
  73. package/dist/{checkbox-Jxxbjxp0.js → checkbox-CVXRiSWP.js} +72 -65
  74. package/dist/{checkbox-Jxxbjxp0.js.map → checkbox-CVXRiSWP.js.map} +1 -1
  75. package/dist/{checkbox-DtnX5sT6.cjs → checkbox-Chd-COYm.cjs} +10 -10
  76. package/dist/{checkbox-DtnX5sT6.cjs.map → checkbox-Chd-COYm.cjs.map} +1 -1
  77. package/dist/checkbox.cjs +1 -1
  78. package/dist/checkbox.js +1 -1
  79. package/dist/{chips-CVDnpVUM.cjs → chips-Bx9gSvN1.cjs} +2 -2
  80. package/dist/{chips-CVDnpVUM.cjs.map → chips-Bx9gSvN1.cjs.map} +1 -1
  81. package/dist/{chips-lP7ohQep.js → chips-Dx_erk55.js} +3 -3
  82. package/dist/{chips-lP7ohQep.js.map → chips-Dx_erk55.js.map} +1 -1
  83. package/dist/chips.cjs +1 -1
  84. package/dist/chips.js +1 -1
  85. package/dist/circular-progress-BQnGvbss.js +35 -0
  86. package/dist/circular-progress-BQnGvbss.js.map +1 -0
  87. package/dist/circular-progress-CNBah5dz.cjs +9 -0
  88. package/dist/circular-progress-CNBah5dz.cjs.map +1 -0
  89. package/dist/circular-progress.cjs +2 -0
  90. package/dist/circular-progress.cjs.map +1 -0
  91. package/dist/circular-progress.js +5 -0
  92. package/dist/circular-progress.js.map +1 -0
  93. package/dist/components.cjs +1 -1
  94. package/dist/components.js +1 -1
  95. package/dist/content-drawer.cjs +1 -1
  96. package/dist/content-drawer.js +1 -1
  97. package/dist/{date-range-DbPA5Y-t.cjs → date-range-Cq0diVSY.cjs} +4 -3
  98. package/dist/{date-range-DbPA5Y-t.cjs.map → date-range-Cq0diVSY.cjs.map} +1 -1
  99. package/dist/{date-range-Ca9WLI4Q.js → date-range-wxdt6Ha0.js} +5 -4
  100. package/dist/date-range-wxdt6Ha0.js.map +1 -0
  101. package/dist/date-range.cjs +1 -1
  102. package/dist/date-range.js +1 -1
  103. package/dist/{delay-BgNgQV2G.cjs → delay-BzkhDhs0.cjs} +2 -2
  104. package/dist/{delay-BgNgQV2G.cjs.map → delay-BzkhDhs0.cjs.map} +1 -1
  105. package/dist/{delay-5cCl7ji3.js → delay-Ds5suSsc.js} +2 -2
  106. package/dist/{delay-5cCl7ji3.js.map → delay-Ds5suSsc.js.map} +1 -1
  107. package/dist/delay.cjs +1 -1
  108. package/dist/delay.js +1 -1
  109. package/dist/{dialog-content-qj1E8aye.cjs → dialog-content-CJY69qfC.cjs} +8 -8
  110. package/dist/dialog-content-CJY69qfC.cjs.map +1 -0
  111. package/dist/{dialog-content-9pumpyLD.js → dialog-content-DFJnYzff.js} +86 -82
  112. package/dist/dialog-content-DFJnYzff.js.map +1 -0
  113. package/dist/dialog.cjs +1 -1
  114. package/dist/dialog.js +1 -1
  115. package/dist/{divider-r8-9eNnl.js → divider-C3w1_-N1.js} +3 -3
  116. package/dist/{divider-r8-9eNnl.js.map → divider-C3w1_-N1.js.map} +1 -1
  117. package/dist/{divider-CHckHGEQ.cjs → divider-CFzbCFsr.cjs} +2 -2
  118. package/dist/{divider-CHckHGEQ.cjs.map → divider-CFzbCFsr.cjs.map} +1 -1
  119. package/dist/divider.cjs +1 -1
  120. package/dist/divider.js +1 -1
  121. package/dist/{dropdown-content-D-TddflQ.js → dropdown-content-BGFYBXcx.js} +3 -3
  122. package/dist/{dropdown-content-D-TddflQ.js.map → dropdown-content-BGFYBXcx.js.map} +1 -1
  123. package/dist/{dropdown-content-B41MDDRG.cjs → dropdown-content-PaMOJphI.cjs} +2 -2
  124. package/dist/{dropdown-content-B41MDDRG.cjs.map → dropdown-content-PaMOJphI.cjs.map} +1 -1
  125. package/dist/dropdown.cjs +1 -1
  126. package/dist/dropdown.js +1 -1
  127. package/dist/extra.cjs +1 -1
  128. package/dist/extra.js +1 -1
  129. package/dist/{flex-Bf0zNqji.js → flex-Cy4Stl_1.js} +2 -2
  130. package/dist/{flex-Bf0zNqji.js.map → flex-Cy4Stl_1.js.map} +1 -1
  131. package/dist/{flex-CFv-Zb76.cjs → flex-DP5O5644.cjs} +2 -2
  132. package/dist/{flex-CFv-Zb76.cjs.map → flex-DP5O5644.cjs.map} +1 -1
  133. package/dist/{form-uYcr1RLJ.js → form-BQamcLFL.js} +2 -2
  134. package/dist/{form-uYcr1RLJ.js.map → form-BQamcLFL.js.map} +1 -1
  135. package/dist/{form-BN75s0PI.cjs → form-CG3kns69.cjs} +2 -2
  136. package/dist/{form-BN75s0PI.cjs.map → form-CG3kns69.cjs.map} +1 -1
  137. package/dist/form.cjs +1 -1
  138. package/dist/form.js +1 -1
  139. package/dist/{icon-BR-jE0Y2.js → icon-Cd4p9jRB.js} +3 -3
  140. package/dist/{icon-BR-jE0Y2.js.map → icon-Cd4p9jRB.js.map} +1 -1
  141. package/dist/{icon-Cu-imayV.cjs → icon-CilwMTXB.cjs} +2 -2
  142. package/dist/{icon-Cu-imayV.cjs.map → icon-CilwMTXB.cjs.map} +1 -1
  143. package/dist/{icon-button-1tZaicyb.js → icon-button-By17is4V.js} +3 -3
  144. package/dist/{icon-button-1tZaicyb.js.map → icon-button-By17is4V.js.map} +1 -1
  145. package/dist/{icon-button-D0BbHnDL.cjs → icon-button-C4Hf63hY.cjs} +2 -2
  146. package/dist/{icon-button-D0BbHnDL.cjs.map → icon-button-C4Hf63hY.cjs.map} +1 -1
  147. package/dist/icons.cjs +1 -1
  148. package/dist/icons.js +1 -1
  149. package/dist/index.cjs +1 -1
  150. package/dist/index.js +190 -173
  151. package/dist/index.js.map +1 -1
  152. package/dist/{input-B2oV6Hck.cjs → input-BIi0rS2t.cjs} +2 -2
  153. package/dist/{input-B2oV6Hck.cjs.map → input-BIi0rS2t.cjs.map} +1 -1
  154. package/dist/{input-kiz5O3dY.js → input-C8OAokVe.js} +2 -2
  155. package/dist/{input-kiz5O3dY.js.map → input-C8OAokVe.js.map} +1 -1
  156. package/dist/input.cjs +1 -1
  157. package/dist/input.js +1 -1
  158. package/dist/layout.cjs +1 -1
  159. package/dist/layout.js +1 -1
  160. package/dist/{list-wT4DLXCh.js → list-BC3OE3Pu.js} +2 -2
  161. package/dist/{list-wT4DLXCh.js.map → list-BC3OE3Pu.js.map} +1 -1
  162. package/dist/{list-CMHoPfX9.cjs → list-jFsCubuy.cjs} +2 -2
  163. package/dist/{list-CMHoPfX9.cjs.map → list-jFsCubuy.cjs.map} +1 -1
  164. package/dist/list.cjs +1 -1
  165. package/dist/list.js +1 -1
  166. package/dist/{litElement.mixin-B9Qdq5S_.js → litElement.mixin-C6PzcPXd.js} +2 -2
  167. package/dist/{litElement.mixin-B9Qdq5S_.js.map → litElement.mixin-C6PzcPXd.js.map} +1 -1
  168. package/dist/{litElement.mixin-CHvyxfxf.cjs → litElement.mixin-Cypiq-N-.cjs} +2 -2
  169. package/dist/{litElement.mixin-CHvyxfxf.cjs.map → litElement.mixin-Cypiq-N-.cjs.map} +1 -1
  170. package/dist/{menu-BcSplMNh.cjs → menu-CDjqdEd6.cjs} +2 -2
  171. package/dist/{menu-BcSplMNh.cjs.map → menu-CDjqdEd6.cjs.map} +1 -1
  172. package/dist/{menu-Dl1QU86K.js → menu-n_Doj-bW.js} +3 -3
  173. package/dist/{menu-Dl1QU86K.js.map → menu-n_Doj-bW.js.map} +1 -1
  174. package/dist/menu.cjs +1 -1
  175. package/dist/menu.js +1 -1
  176. package/dist/nav-drawer.cjs +1 -1
  177. package/dist/nav-drawer.js +1 -1
  178. package/dist/{notification-service-BV9ybQBu.cjs → notification-service--VLqOJJg.cjs} +2 -2
  179. package/dist/{notification-service-BV9ybQBu.cjs.map → notification-service--VLqOJJg.cjs.map} +1 -1
  180. package/dist/{notification-service-CC698xHg.js → notification-service-DHIhgWQr.js} +3 -3
  181. package/dist/{notification-service-CC698xHg.js.map → notification-service-DHIhgWQr.js.map} +1 -1
  182. package/dist/notification.cjs +1 -1
  183. package/dist/notification.js +1 -1
  184. package/dist/{option-CkLBgH71.cjs → option-B359EBiZ.cjs} +2 -2
  185. package/dist/{option-CkLBgH71.cjs.map → option-B359EBiZ.cjs.map} +1 -1
  186. package/dist/{option-DDxxXwwc.js → option-oyyjCwnL.js} +2 -2
  187. package/dist/{option-DDxxXwwc.js.map → option-oyyjCwnL.js.map} +1 -1
  188. package/dist/option.cjs +1 -1
  189. package/dist/option.js +1 -1
  190. package/dist/{payment-card-form-UWbAYNPR.cjs → payment-card-form-B-ZAsSED.cjs} +2 -2
  191. package/dist/{payment-card-form-UWbAYNPR.cjs.map → payment-card-form-B-ZAsSED.cjs.map} +1 -1
  192. package/dist/{payment-card-form-DDTO5_AA.js → payment-card-form-BSueaw97.js} +3 -3
  193. package/dist/{payment-card-form-DDTO5_AA.js.map → payment-card-form-BSueaw97.js.map} +1 -1
  194. package/dist/{radio-button-wWoxPDfq.js → radio-button-84TD7rpH.js} +2 -2
  195. package/dist/{radio-button-wWoxPDfq.js.map → radio-button-84TD7rpH.js.map} +1 -1
  196. package/dist/{radio-button-BykiVxTD.cjs → radio-button-BO6mIWCi.cjs} +2 -2
  197. package/dist/{radio-button-BykiVxTD.cjs.map → radio-button-BO6mIWCi.cjs.map} +1 -1
  198. package/dist/radio-group.cjs +1 -1
  199. package/dist/radio-group.js +1 -1
  200. package/dist/{schmancy-steps-container-B1mIGa9M.cjs → schmancy-steps-container-Cfq8OsWt.cjs} +2 -2
  201. package/dist/{schmancy-steps-container-B1mIGa9M.cjs.map → schmancy-steps-container-Cfq8OsWt.cjs.map} +1 -1
  202. package/dist/{schmancy-steps-container-ByO98z7L.js → schmancy-steps-container-Lo4d27n3.js} +2 -2
  203. package/dist/{schmancy-steps-container-ByO98z7L.js.map → schmancy-steps-container-Lo4d27n3.js.map} +1 -1
  204. package/dist/{select-BIOhocL7.js → select-B-zgP_v6.js} +3 -3
  205. package/dist/{select-BIOhocL7.js.map → select-B-zgP_v6.js.map} +1 -1
  206. package/dist/{select-DE57Nios.cjs → select-DhEVsWh6.cjs} +2 -2
  207. package/dist/{select-DE57Nios.cjs.map → select-DhEVsWh6.cjs.map} +1 -1
  208. package/dist/select.cjs +1 -1
  209. package/dist/select.js +1 -1
  210. package/dist/{sheet-fZYAWGsm.cjs → sheet-BEWq40cN.cjs} +2 -2
  211. package/dist/{sheet-fZYAWGsm.cjs.map → sheet-BEWq40cN.cjs.map} +1 -1
  212. package/dist/{sheet-Dh4MLVsU.js → sheet-DDY4pbD4.js} +3 -3
  213. package/dist/{sheet-Dh4MLVsU.js.map → sheet-DDY4pbD4.js.map} +1 -1
  214. package/dist/sheet.cjs +1 -1
  215. package/dist/sheet.js +1 -1
  216. package/dist/{slider-DVlJoDgU.js → slider--irxEv_B.js} +3 -3
  217. package/dist/{slider-DVlJoDgU.js.map → slider--irxEv_B.js.map} +1 -1
  218. package/dist/{slider-CejrdmPF.cjs → slider-De-H5fe8.cjs} +2 -2
  219. package/dist/{slider-CejrdmPF.cjs.map → slider-De-H5fe8.cjs.map} +1 -1
  220. package/dist/slider.cjs +1 -1
  221. package/dist/slider.js +1 -1
  222. package/dist/{spinner-DbTnai_Q.js → spinner-Bl9n09Z5.js} +3 -3
  223. package/dist/{spinner-DbTnai_Q.js.map → spinner-Bl9n09Z5.js.map} +1 -1
  224. package/dist/{spinner-DxVJ7QJZ.cjs → spinner-DNz1IjmL.cjs} +2 -2
  225. package/dist/{spinner-DxVJ7QJZ.cjs.map → spinner-DNz1IjmL.cjs.map} +1 -1
  226. package/dist/steps.cjs +1 -1
  227. package/dist/steps.js +1 -1
  228. package/dist/surface-BAEUiWcq.cjs +92 -0
  229. package/dist/surface-BAEUiWcq.cjs.map +1 -0
  230. package/dist/surface-h9dLHMTm.js +113 -0
  231. package/dist/surface-h9dLHMTm.js.map +1 -0
  232. package/dist/surface.cjs +1 -1
  233. package/dist/surface.js +1 -1
  234. package/dist/{table-CqUv1TOC.js → table-CxazXBjI.js} +72 -68
  235. package/dist/{table-CqUv1TOC.js.map → table-CxazXBjI.js.map} +1 -1
  236. package/dist/{table-CBhyHINV.cjs → table-Dn07ykGG.cjs} +4 -4
  237. package/dist/{table-CBhyHINV.cjs.map → table-Dn07ykGG.cjs.map} +1 -1
  238. package/dist/table.cjs +1 -1
  239. package/dist/table.js +1 -1
  240. package/dist/{tabs-compatibility-DUo2f_sV.js → tabs-compatibility-B8I0vg7Y.js} +2 -2
  241. package/dist/{tabs-compatibility-DUo2f_sV.js.map → tabs-compatibility-B8I0vg7Y.js.map} +1 -1
  242. package/dist/{tabs-compatibility-DPD6jfGF.cjs → tabs-compatibility-BrTxeSS-.cjs} +2 -2
  243. package/dist/{tabs-compatibility-DPD6jfGF.cjs.map → tabs-compatibility-BrTxeSS-.cjs.map} +1 -1
  244. package/dist/tabs.cjs +1 -1
  245. package/dist/tabs.js +1 -1
  246. package/dist/tailwind.mixin-Du4i6vQR.js +43 -0
  247. package/dist/{tailwind.mixin-Di7KWye7.js.map → tailwind.mixin-Du4i6vQR.js.map} +1 -1
  248. package/dist/tailwind.mixin-qyIcoDLk.cjs +2 -0
  249. package/dist/{tailwind.mixin-Dm5QDZav.cjs.map → tailwind.mixin-qyIcoDLk.cjs.map} +1 -1
  250. package/dist/teleport.cjs +1 -1
  251. package/dist/teleport.js +1 -1
  252. package/dist/{textarea-Dbz18REy.js → textarea-DibCLxC2.js} +2 -2
  253. package/dist/{textarea-Dbz18REy.js.map → textarea-DibCLxC2.js.map} +1 -1
  254. package/dist/{textarea-CesFdBkm.cjs → textarea-pMec4Wpg.cjs} +2 -2
  255. package/dist/{textarea-CesFdBkm.cjs.map → textarea-pMec4Wpg.cjs.map} +1 -1
  256. package/dist/textarea.cjs +1 -1
  257. package/dist/textarea.js +1 -1
  258. package/dist/{theme-button-Bt2OV4iu.cjs → theme-button-CG1w_waw.cjs} +2 -2
  259. package/dist/{theme-button-Bt2OV4iu.cjs.map → theme-button-CG1w_waw.cjs.map} +1 -1
  260. package/dist/{theme-button-lqbT2_LL.js → theme-button-irLEczd5.js} +2 -2
  261. package/dist/{theme-button-lqbT2_LL.js.map → theme-button-irLEczd5.js.map} +1 -1
  262. package/dist/theme-button.cjs +1 -1
  263. package/dist/theme-button.js +1 -1
  264. package/dist/theme.cjs +1 -1
  265. package/dist/{theme.component-xarFSe8p.js → theme.component-CMM8Xws2.js} +2 -2
  266. package/dist/{theme.component-xarFSe8p.js.map → theme.component-CMM8Xws2.js.map} +1 -1
  267. package/dist/{theme.component-BlBaN7d6.cjs → theme.component-CpRuySmd.cjs} +3 -3
  268. package/dist/{theme.component-BlBaN7d6.cjs.map → theme.component-CpRuySmd.cjs.map} +1 -1
  269. package/dist/theme.js +1 -1
  270. package/dist/{timezone-DwT_pQrj.js → timezone-DIrmlnD6.js} +3 -3
  271. package/dist/{timezone-DwT_pQrj.js.map → timezone-DIrmlnD6.js.map} +1 -1
  272. package/dist/{timezone-VUMRmZaJ.cjs → timezone-n5GflDRe.cjs} +2 -2
  273. package/dist/{timezone-VUMRmZaJ.cjs.map → timezone-n5GflDRe.cjs.map} +1 -1
  274. package/dist/{tooltip-Cvoroe7w.cjs → tooltip-0vIcVm5-.cjs} +2 -2
  275. package/dist/{tooltip-Cvoroe7w.cjs.map → tooltip-0vIcVm5-.cjs.map} +1 -1
  276. package/dist/{tooltip-BKOHVCMK.js → tooltip-N_B-vsDa.js} +2 -2
  277. package/dist/{tooltip-BKOHVCMK.js.map → tooltip-N_B-vsDa.js.map} +1 -1
  278. package/dist/tooltip.cjs +1 -1
  279. package/dist/tooltip.js +1 -1
  280. package/dist/{tree-_FJnHVmP.js → tree-2Hf2X0Hv.js} +2 -2
  281. package/dist/{tree-_FJnHVmP.js.map → tree-2Hf2X0Hv.js.map} +1 -1
  282. package/dist/{tree-Cyp2AZ8g.cjs → tree-Q8AMxJxP.cjs} +2 -2
  283. package/dist/{tree-Cyp2AZ8g.cjs.map → tree-Q8AMxJxP.cjs.map} +1 -1
  284. package/dist/tree.cjs +1 -1
  285. package/dist/tree.js +1 -1
  286. package/dist/{typewriter-BIm2tOe4.cjs → typewriter-CsL-NfYC.cjs} +2 -2
  287. package/dist/{typewriter-BIm2tOe4.cjs.map → typewriter-CsL-NfYC.cjs.map} +1 -1
  288. package/dist/{typewriter-DWfXPBni.js → typewriter-bqbNKczJ.js} +22 -22
  289. package/dist/{typewriter-DWfXPBni.js.map → typewriter-bqbNKczJ.js.map} +1 -1
  290. package/dist/typewriter.cjs +1 -1
  291. package/dist/typewriter.js +1 -1
  292. package/dist/{typography-DaKLzjFB.js → typography-CbrvouLo.js} +2 -2
  293. package/dist/{typography-DaKLzjFB.js.map → typography-CbrvouLo.js.map} +1 -1
  294. package/dist/{typography-OpLt6LNd.cjs → typography-Hlts-hzc.cjs} +2 -2
  295. package/dist/{typography-OpLt6LNd.cjs.map → typography-Hlts-hzc.cjs.map} +1 -1
  296. package/dist/typography.cjs +1 -1
  297. package/dist/typography.js +1 -1
  298. package/dist/utils-BqFGvnN9.cjs +2 -0
  299. package/dist/utils-BqFGvnN9.cjs.map +1 -0
  300. package/dist/utils-jduntaQU.js +128 -0
  301. package/dist/utils-jduntaQU.js.map +1 -0
  302. package/package.json +13 -14
  303. package/types/src/area/area.component.d.ts +1 -1
  304. package/types/src/area/area.service.d.ts +44 -26
  305. package/types/src/area/index.d.ts +1 -0
  306. package/types/src/area/utils.d.ts +91 -1
  307. package/types/src/checkbox/checkbox.d.ts +9 -0
  308. package/types/src/circular-progress/circular-progress.d.ts +15 -0
  309. package/types/src/circular-progress/index.d.ts +1 -0
  310. package/types/src/dialog/dailog.d.ts +8 -0
  311. package/types/src/dialog/dialog-service.d.ts +1 -0
  312. package/types/src/index.d.ts +1 -0
  313. package/types/src/table/table.d.ts +1 -0
  314. package/dist/area.component-CzFJM7Y4.js +0 -143
  315. package/dist/area.component-CzFJM7Y4.js.map +0 -1
  316. package/dist/area.component-WxccFh1z.cjs +0 -8
  317. package/dist/area.component-WxccFh1z.cjs.map +0 -1
  318. package/dist/avatar-Bmg5TXj9.cjs.map +0 -1
  319. package/dist/avatar-CgP1tBZq.js.map +0 -1
  320. package/dist/date-range-Ca9WLI4Q.js.map +0 -1
  321. package/dist/dialog-content-9pumpyLD.js.map +0 -1
  322. package/dist/dialog-content-qj1E8aye.cjs.map +0 -1
  323. package/dist/surface-BTuzKmT2.cjs +0 -20
  324. package/dist/surface-BTuzKmT2.cjs.map +0 -1
  325. package/dist/surface-DXx1bJN4.js +0 -43
  326. package/dist/surface-DXx1bJN4.js.map +0 -1
  327. package/dist/tailwind.mixin-Di7KWye7.js +0 -43
  328. package/dist/tailwind.mixin-Dm5QDZav.cjs +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-content-CJY69qfC.cjs","sources":["../src/dialog/dailog.ts","../src/dialog/dialog-service.ts","../src/dialog/dialog.component.ts","../src/dialog/dialog-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String })\n\tsubtitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Confirm button color\n\t */\n\t@property({ type: String, attribute: 'confirm-color' })\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Store resize subscription\n\t */\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\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\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Get the CSS class for the confirm button based on color\n\t */\n\tprivate getConfirmButtonClass(): string {\n\t\t// Map confirmColor to appropriate CSS classes\n\t\tconst colorMap = {\n\t\t\terror: 'bg-red-600 hover:bg-red-700 text-white',\n\t\t\twarning: 'bg-orange-600 hover:bg-orange-700 text-white',\n\t\t\tsuccess: 'bg-green-600 hover:bg-green-700 text-white',\n\t\t\tprimary: ''\n\t\t}\n\n\t\t// If variant is danger, use error color\n\t\tif (this.variant === 'danger' || this.confirmColor === 'error') {\n\t\t\treturn colorMap.error\n\t\t}\n\n\t\treturn colorMap[this.confirmColor || 'primary'] || ''\n\t}\n\n\trender() {\n\t\t// For initial rendering, use transform-based centering from CSS\n\t\t// firstUpdated will handle precise positioning after measuring\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\t\t// Only show buttons if both confirmText and cancelText are non-empty strings\n\t\tconst showButtons =\n\t\t\tthis.confirmText && this.confirmText.trim() !== '' && this.cancelText && this.cancelText.trim() !== ''\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} class=\"p-4\">\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title && this.title.trim() !== '',\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\" class=\"mb-1\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\tthis.subtitle && this.subtitle.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t() => html``\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\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"${showButtons ? 'mb-4' : ''}\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\tthis.message && this.message.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tshowButtons,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.subtitle) dialog.subtitle = options.subtitle\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { render, TemplateResult } from 'lit'\nimport { ConfirmDialog } from './dailog'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\n\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n\thideActions?: boolean // Set to true to hide all buttons and title\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: 'Cancel',\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\t// Apply default options\n\t\tconst completeOptions = {\n\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t}\n\n\t\t// If no position is provided, center the dialog\n\t\tif (!completeOptions.position) {\n\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t}\n\n\t\t// Create or find the dialog\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set basic options\n\t\tif (completeOptions.title) dialog.title = completeOptions.title\n\t\tif (completeOptions.subtitle) dialog.subtitle = completeOptions.subtitle\n\t\tif (completeOptions.message) dialog.message = completeOptions.message\n\t\tif (completeOptions.confirmText) dialog.confirmText = completeOptions.confirmText\n\t\tif (completeOptions.cancelText) dialog.cancelText = completeOptions.cancelText\n\t\tif (completeOptions.variant) dialog.variant = completeOptions.variant\n\t\tif (completeOptions.confirmColor) dialog.confirmColor = completeOptions.confirmColor\n\t\tif (completeOptions.width) dialog.style.setProperty('--dialog-width', completeOptions.width)\n\n\t\t// Handle custom content if provided\n\t\tif (completeOptions.content) {\n\t\t\tconst contentContainer = document.createElement('div')\n\t\t\tcontentContainer.slot = 'content'\n\n\t\t\tif (typeof completeOptions.content === 'function') {\n\t\t\t\tconst result = completeOptions.content()\n\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t} else {\n\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t}\n\t\t\t} else if (completeOptions.content instanceof HTMLElement) {\n\t\t\t\tcontentContainer.appendChild(completeOptions.content)\n\t\t\t} else {\n\t\t\t\trender(completeOptions.content, contentContainer)\n\t\t\t}\n\n\t\t\tdialog.appendChild(contentContainer)\n\t\t}\n\n\t\t// Set up event listeners for optional callbacks\n\t\tif (completeOptions.onConfirm) {\n\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\tcompleteOptions.onConfirm!()\n\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t}\n\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t}\n\n\t\tif (completeOptions.onCancel) {\n\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\tcompleteOptions.onCancel!()\n\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t}\n\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t}\n\n\t\t// Add this dialog to active dialogs\n\t\tthis.activeDialogs.push(dialog)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(completeOptions.position).finally(() => {\n\t\t\t// Remove from active dialogs when closed\n\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t}\n\n\t\t\t// Clean up the content when dialog closes\n\t\t\tif (completeOptions.content) {\n\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\tif (contentEl) {\n\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\t// Create a direct container for the component without any wrapping\n\t\tconst directContentContainer = document.createElement('div');\n\t\tdirectContentContainer.style.height = '100%';\n\t\tdirectContentContainer.style.width = '100%';\n\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container');\n\t\t\n\t\t// Render the content directly\n\t\tif (typeof content === 'function') {\n\t\t\tconst result = content();\n\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\tdirectContentContainer.appendChild(result);\n\t\t\t} else {\n\t\t\t\trender(result, directContentContainer);\n\t\t\t}\n\t\t} else if (content instanceof HTMLElement) {\n\t\t\tdirectContentContainer.appendChild(content);\n\t\t} else {\n\t\t\trender(content, directContentContainer);\n\t\t}\n\t\t\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('schmancy-dialog') as any;\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('schmancy-dialog');\n\t\t\tdocument.body.appendChild(dialog);\n\t\t}\n\t\t\n\t\t// Always use raw component rendering with no actions\n\t\tdialog.appendChild(directContentContainer);\n\t\t\n\t\t// Set width from options\n\t\tif (options.width) {\n\t\t\tdialog.style.setProperty('--dialog-width', options.width);\n\t\t}\n\t\t\n\t\t// Add to active raw dialogs for dismiss functionality\n\t\tthis.activeRawDialogs.push(dialog);\n\t\t\n\t\t// Show dialog and return promise with cleanup\n\t\tconst promise = dialog.show(options.position);\n\t\treturn promise.finally(() => {\n\t\t\t// Clean up content when dialog closes\n\t\t\tif (directContentContainer && directContentContainer.parentNode) {\n\t\t\t\tdirectContentContainer.parentNode.removeChild(directContentContainer);\n\t\t\t}\n\t\t\t\n\t\t\t// Remove from active raw dialogs\n\t\t\tconst index = this.activeRawDialogs.indexOf(dialog);\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.activeRawDialogs.splice(index, 1);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1];\n\t\t\t\n\t\t\t// Hide the dialog\n\t\t\tdialog.hide(false);\n\t\t\t\n\t\t\t// Remove from active dialogs\n\t\t\tthis.activeRawDialogs.pop();\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1];\n\t\t\t\n\t\t\t// Hide the dialog (with cancel result)\n\t\t\tdialog.hide(false);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService","import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A basic dialog web component without title or actions\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(result = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(result)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\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\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t// Store resize subscription\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle close action\n\t */\n\tprivate handleClose() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleClose}></div>\n\n\t\t\t<div class=\"dialog\" role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n/**\n * A basic dialog content component that doesn't add any padding or styling\n * Used for rendering raw content in a dialog\n *\n * @element schmancy-dialog-content\n * @slot default - Content slot for dialog content without any styling\n */\n@customElement('schmancy-dialog-content')\nexport class SchmancyDialogContent extends $LitElement(css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n`) {\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-dialog-content': SchmancyDialogContent\n }\n}"],"names":["ConfirmDialog","$LitElement","css","super","arguments","this","title","subtitle","message","confirmText","cancelText","variant","position","x","y","positionOrEvent","clientX","clientY","touches","length","pos","window","innerWidth","innerHeight","virtualReference","getBoundingClientRect","DOMRect","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","cleanupAutoUpdate","dialog","viewportWidth","viewportHeight","Math","abs","classList","add","autoUpdate","document","body","contains","availableHeight","offsetHeight","style","maxHeight","elementResize","ancestorScroll","remove","updatePosition","ancestorResize","animationFrame","min","computePosition","placement","strategy","middleware","offset","flip","fallbackPlacements","fallbackStrategy","shift","padding","size","availableWidth","elements","floating","offsetWidth","Object","assign","maxWidth","max","margin","left","round","top","transform","disconnectedCallback","resizeSubscription","unsubscribe","shadowRoot","querySelector","setupPositioning","fromEvent","pipe","debounceTime","subscribe","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","getConfirmButtonClass","colorMap","error","warning","success","primary","confirmColor","hasCustomContent","querySelectorAll","showButtons","trim","html","handleCancel","when","options","createElement","appendChild","width","setProperty","show","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","DialogService","activeDialogs","activeRawDialogs","getInstance","instance","completeOptions","DEFAULT_OPTIONS","getCenteredPosition","content","contentContainer","slot","result","HTMLElement","render","onConfirm","_e","removeEventListener","addEventListener","onCancel","push","finally","index","indexOf","splice","contentEl","removeChild","directContentContainer","height","parentNode","dismiss","pop","_d","$dialog","ask","danger","component","simple","SchmancyDialog","constructor","apply","firstUpdated","handleClose","SchmancyDialogContent"],"mappings":"miBAeaA,QAAAA,cAAN,cAA4BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAxC,CAAA,CAAA,aAAAC,CAAAA,MAAAA,GAAAC,SAsCEC,EAAAA,KAAAC,MAAA,OAMGD,KAAAE,SAAAA,OAMDF,KAAAG,QAAA,OAMIH,KAAAI,YAAA,UAMDJ,KAAAK,WAAA,SAMmBL,KAAAM,QAAA,UAWhCN,KAAQO,SAAW,CAAEC,EAAG,EAAGC,EAAG,CAAE,CAAA,CA4BhC,WAAWC,EAAAA,CAEV,IAAIF,EAAWC,EAEf,GAAKC,EAIL,GAAW,YAAaA,EAEvBF,EAAIE,EAAgBC,QACpBF,EAAIC,EAAgBE,gBACV,YAAaF,GAAmBA,EAAgBG,QAAQC,OAE9DN,EAAAE,EAAgBG,QAAQ,CAA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AAAA;AAAAA,GAOrD,QAAAwI,CACS,OAAA/B,EAAAA,mBAAA,GARE4D,QAANA,4HAAA,CADN3C,EAAAA,cAAc,yBAAA,CAAA,EACF2C"}
@@ -1,16 +1,16 @@
1
- import { autoUpdate as g, computePosition as x, offset as C, flip as P, shift as R, size as T } from "@floating-ui/dom";
2
- import { fromEvent as S } from "rxjs";
1
+ import { autoUpdate as g, computePosition as x, offset as C, flip as P, shift as R, size as S } from "@floating-ui/dom";
2
+ import { fromEvent as T } from "rxjs";
3
3
  import "lit/directives/class-map.js";
4
4
  import "lit/directives/style-map.js";
5
- import { $ as f } from "./litElement.mixin-B9Qdq5S_.js";
6
- import "./tailwind.mixin-Di7KWye7.js";
5
+ import { $ as f } from "./litElement.mixin-C6PzcPXd.js";
6
+ import "./tailwind.mixin-Du4i6vQR.js";
7
7
  import { css as v, html as c, render as m } from "lit";
8
8
  import { property as p, customElement as y } from "lit/decorators.js";
9
9
  import { when as u } from "lit/directives/when.js";
10
10
  import { debounceTime as H } from "rxjs/operators";
11
- var M = Object.defineProperty, k = Object.getOwnPropertyDescriptor, d = (t, i, s, e) => {
12
- for (var o, n = e > 1 ? void 0 : e ? k(i, s) : i, a = t.length - 1; a >= 0; a--) (o = t[a]) && (n = (e ? o(i, s, n) : o(n)) || n);
13
- return e && n && M(i, s, n), n;
11
+ var M = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, l = (t, i, n, e) => {
12
+ for (var o, s = e > 1 ? void 0 : e ? $(i, n) : i, a = t.length - 1; a >= 0; a--) (o = t[a]) && (s = (e ? o(i, n, s) : o(s)) || s);
13
+ return e && s && M(i, n, s), s;
14
14
  };
15
15
  let r = class extends f(v`
16
16
  :host {
@@ -50,15 +50,15 @@ let r = class extends f(v`
50
50
  super(...arguments), this.title = void 0, this.subtitle = void 0, this.message = void 0, this.confirmText = "Confirm", this.cancelText = "Cancel", this.variant = "default", this.position = { x: 0, y: 0 };
51
51
  }
52
52
  async show(t) {
53
- let i, s;
54
- if (t) if ("clientX" in t) i = t.clientX, s = t.clientY;
55
- else if ("touches" in t && t.touches.length) i = t.touches[0].clientX, s = t.touches[0].clientY;
53
+ let i, n;
54
+ if (t) if ("clientX" in t) i = t.clientX, n = t.clientY;
55
+ else if ("touches" in t && t.touches.length) i = t.touches[0].clientX, n = t.touches[0].clientY;
56
56
  else {
57
57
  const e = t;
58
- i = e.x, s = e.y;
58
+ i = e.x, n = e.y;
59
59
  }
60
- else i = window.innerWidth / 2, s = window.innerHeight / 2;
61
- return this.position = { x: i, y: s }, this.virtualReference = { getBoundingClientRect: () => new DOMRect(i, s, 0, 0) }, this.setAttribute("active", ""), new Promise((e) => {
60
+ else i = window.innerWidth / 2, n = window.innerHeight / 2;
61
+ return this.position = { x: i, y: n }, this.virtualReference = { getBoundingClientRect: () => new DOMRect(i, n, 0, 0) }, this.setAttribute("active", ""), new Promise((e) => {
62
62
  this.resolvePromise = e;
63
63
  });
64
64
  }
@@ -66,8 +66,8 @@ let r = class extends f(v`
66
66
  this.removeAttribute("active"), this.cleanupAutoUpdate && (this.cleanupAutoUpdate(), this.cleanupAutoUpdate = void 0), this.resolvePromise && (this.resolvePromise(t), this.resolvePromise = void 0);
67
67
  }
68
68
  setupPositioning(t) {
69
- const i = window.innerWidth, s = window.innerHeight;
70
- if (Math.abs(this.position.x - i / 2) < 10 && Math.abs(this.position.y - s / 2) < 10) return t.classList.add("centered"), void (this.cleanupAutoUpdate = g(document.body, t, () => {
69
+ const i = window.innerWidth, n = window.innerHeight;
70
+ if (Math.abs(this.position.x - i / 2) < 10 && Math.abs(this.position.y - n / 2) < 10) return t.classList.add("centered"), void (this.cleanupAutoUpdate = g(document.body, t, () => {
71
71
  if (t.classList.contains("centered")) {
72
72
  const e = window.innerHeight - 40;
73
73
  t.offsetHeight > e && (t.style.maxHeight = `${e}px`);
@@ -78,13 +78,13 @@ let r = class extends f(v`
78
78
  async updatePosition(t) {
79
79
  if (!this.virtualReference) return;
80
80
  if (this.position.x > 0 && this.position.y > 0) {
81
- const e = window.innerWidth, o = window.innerHeight, n = Math.min(this.position.x, e - 20), a = Math.min(this.position.y, o - 20);
82
- this.virtualReference = { getBoundingClientRect: () => new DOMRect(n, a, 0, 0) };
81
+ const e = window.innerWidth, o = window.innerHeight, s = Math.min(this.position.x, e - 20), a = Math.min(this.position.y, o - 20);
82
+ this.virtualReference = { getBoundingClientRect: () => new DOMRect(s, a, 0, 0) };
83
83
  }
84
- const { x: i, y: s } = await x(this.virtualReference, t, { placement: "bottom-start", strategy: "absolute", middleware: [C(20), P({ fallbackPlacements: ["top-start", "bottom-end", "top-end"], fallbackStrategy: "bestFit" }), R({ padding: 20 }), T({ apply({ availableWidth: e, availableHeight: o, elements: n }) {
85
- n.floating.offsetWidth > e && Object.assign(n.floating.style, { maxWidth: `${Math.max(e - 40, 280)}px` }), n.floating.offsetHeight > o && Object.assign(n.floating.style, { maxHeight: o - 40 + "px" });
84
+ const { x: i, y: n } = await x(this.virtualReference, t, { placement: "bottom-start", strategy: "absolute", middleware: [C(20), P({ fallbackPlacements: ["top-start", "bottom-end", "top-end"], fallbackStrategy: "bestFit" }), R({ padding: 20 }), S({ apply({ availableWidth: e, availableHeight: o, elements: s }) {
85
+ s.floating.offsetWidth > e && Object.assign(s.floating.style, { maxWidth: `${Math.max(e - 40, 280)}px` }), s.floating.offsetHeight > o && Object.assign(s.floating.style, { maxHeight: o - 40 + "px" });
86
86
  }, padding: 20 })] });
87
- Object.assign(t.style, { left: `${Math.round(i)}px`, top: `${Math.round(s)}px`, transform: "none" });
87
+ Object.assign(t.style, { left: `${Math.round(i)}px`, top: `${Math.round(n)}px`, transform: "none" });
88
88
  }
89
89
  disconnectedCallback() {
90
90
  super.disconnectedCallback(), this.resizeSubscription && (this.resizeSubscription.unsubscribe(), this.resizeSubscription = void 0), this.cleanupAutoUpdate && (this.cleanupAutoUpdate(), this.cleanupAutoUpdate = void 0);
@@ -92,9 +92,9 @@ let r = class extends f(v`
92
92
  firstUpdated() {
93
93
  var i;
94
94
  const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".dialog");
95
- t && (this.setupPositioning(t), this.resizeSubscription = S(window, "resize").pipe(H(50)).subscribe(() => {
96
- const s = window.innerWidth, e = window.innerHeight;
97
- Math.abs(this.position.x - s / 2) < 10 && Math.abs(this.position.y - e / 2) < 10 && (this.position = { x: s / 2, y: e / 2 }), this.updatePosition(t);
95
+ t && (this.setupPositioning(t), this.resizeSubscription = T(window, "resize").pipe(H(50)).subscribe(() => {
96
+ const n = window.innerWidth, e = window.innerHeight;
97
+ Math.abs(this.position.x - n / 2) < 10 && Math.abs(this.position.y - e / 2) < 10 && (this.position = { x: n / 2, y: e / 2 }), this.updatePosition(t);
98
98
  }));
99
99
  }
100
100
  handleConfirm() {
@@ -103,6 +103,10 @@ let r = class extends f(v`
103
103
  handleCancel() {
104
104
  this.hide(!1), this.dispatchEvent(new CustomEvent("cancel", { bubbles: !0, composed: !0 }));
105
105
  }
106
+ getConfirmButtonClass() {
107
+ const t = { error: "bg-red-600 hover:bg-red-700 text-white", warning: "bg-orange-600 hover:bg-orange-700 text-white", success: "bg-green-600 hover:bg-green-700 text-white", primary: "" };
108
+ return this.variant === "danger" || this.confirmColor === "error" ? t.error : t[this.confirmColor || "primary"] || "";
109
+ }
106
110
  render() {
107
111
  const t = this.querySelectorAll('[slot="content"]').length > 0, i = this.confirmText && this.confirmText.trim() !== "" && this.cancelText && this.cancelText.trim() !== "";
108
112
  return c`
@@ -123,7 +127,7 @@ let r = class extends f(v`
123
127
  ${u(i, () => c`
124
128
  <div class="flex justify-end gap-3">
125
129
  <schmancy-button variant="outlined" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>
126
- <schmancy-button type="submit" variant="filled"> ${this.confirmText} </schmancy-button>
130
+ <schmancy-button type="submit" variant="filled" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>
127
131
  </div>
128
132
  `)}
129
133
  </schmancy-form>
@@ -139,64 +143,64 @@ let r = class extends f(v`
139
143
  return this.confirm({ message: t, position: i });
140
144
  }
141
145
  };
142
- d([p({ type: String })], r.prototype, "title", 2), d([p({ type: String })], r.prototype, "subtitle", 2), d([p({ type: String })], r.prototype, "message", 2), d([p({ type: String, attribute: "confirm-text" })], r.prototype, "confirmText", 2), d([p({ type: String, attribute: "cancel-text" })], r.prototype, "cancelText", 2), d([p({ type: String })], r.prototype, "variant", 2), r = d([y("confirm-dialog")], r);
143
- const h = class h {
146
+ l([p({ type: String })], r.prototype, "title", 2), l([p({ type: String })], r.prototype, "subtitle", 2), l([p({ type: String })], r.prototype, "message", 2), l([p({ type: String, attribute: "confirm-text" })], r.prototype, "confirmText", 2), l([p({ type: String, attribute: "cancel-text" })], r.prototype, "cancelText", 2), l([p({ type: String })], r.prototype, "variant", 2), l([p({ type: String, attribute: "confirm-color" })], r.prototype, "confirmColor", 2), r = l([y("confirm-dialog")], r);
147
+ const d = class d {
144
148
  constructor() {
145
149
  this.activeDialogs = [], this.activeRawDialogs = [];
146
150
  }
147
151
  static getInstance() {
148
- return h.instance || (h.instance = new h()), h.instance;
152
+ return d.instance || (d.instance = new d()), d.instance;
149
153
  }
150
154
  confirm(i) {
151
- const s = { ...h.DEFAULT_OPTIONS, ...i };
152
- s.position || (s.position = this.getCenteredPosition());
155
+ const n = { ...d.DEFAULT_OPTIONS, ...i };
156
+ n.position || (n.position = this.getCenteredPosition());
153
157
  let e = document.querySelector("confirm-dialog");
154
- if (e || (e = document.createElement("confirm-dialog"), document.body.appendChild(e)), s.title && (e.title = s.title), s.subtitle && (e.subtitle = s.subtitle), s.message && (e.message = s.message), s.confirmText && (e.confirmText = s.confirmText), s.cancelText && (e.cancelText = s.cancelText), s.variant && (e.variant = s.variant), s.width && e.style.setProperty("--dialog-width", s.width), s.content) {
158
+ if (e || (e = document.createElement("confirm-dialog"), document.body.appendChild(e)), n.title && (e.title = n.title), n.subtitle && (e.subtitle = n.subtitle), n.message && (e.message = n.message), n.confirmText && (e.confirmText = n.confirmText), n.cancelText && (e.cancelText = n.cancelText), n.variant && (e.variant = n.variant), n.confirmColor && (e.confirmColor = n.confirmColor), n.width && e.style.setProperty("--dialog-width", n.width), n.content) {
155
159
  const o = document.createElement("div");
156
- if (o.slot = "content", typeof s.content == "function") {
157
- const n = s.content();
158
- n instanceof HTMLElement ? o.appendChild(n) : m(n, o);
159
- } else s.content instanceof HTMLElement ? o.appendChild(s.content) : m(s.content, o);
160
+ if (o.slot = "content", typeof n.content == "function") {
161
+ const s = n.content();
162
+ s instanceof HTMLElement ? o.appendChild(s) : m(s, o);
163
+ } else n.content instanceof HTMLElement ? o.appendChild(n.content) : m(n.content, o);
160
164
  e.appendChild(o);
161
165
  }
162
- if (s.onConfirm) {
163
- const o = (n) => {
164
- s.onConfirm(), e.removeEventListener("confirm", o);
166
+ if (n.onConfirm) {
167
+ const o = (s) => {
168
+ n.onConfirm(), e.removeEventListener("confirm", o);
165
169
  };
166
170
  e.addEventListener("confirm", o);
167
171
  }
168
- if (s.onCancel) {
169
- const o = (n) => {
170
- s.onCancel(), e.removeEventListener("cancel", o);
172
+ if (n.onCancel) {
173
+ const o = (s) => {
174
+ n.onCancel(), e.removeEventListener("cancel", o);
171
175
  };
172
176
  e.addEventListener("cancel", o);
173
177
  }
174
- return this.activeDialogs.push(e), e.show(s.position).finally(() => {
178
+ return this.activeDialogs.push(e), e.show(n.position).finally(() => {
175
179
  const o = this.activeDialogs.indexOf(e);
176
- if (o !== -1 && this.activeDialogs.splice(o, 1), s.content) {
177
- const n = e.querySelector('[slot="content"]');
178
- n && e.removeChild(n);
180
+ if (o !== -1 && this.activeDialogs.splice(o, 1), n.content) {
181
+ const s = e.querySelector('[slot="content"]');
182
+ s && e.removeChild(s);
179
183
  }
180
184
  });
181
185
  }
182
- component(i, s = {}) {
186
+ component(i, n = {}) {
183
187
  const e = document.createElement("div");
184
188
  if (e.style.height = "100%", e.style.width = "100%", e.classList.add("schmancy-dialog-content-container"), typeof i == "function") {
185
- const n = i();
186
- n instanceof HTMLElement ? e.appendChild(n) : m(n, e);
189
+ const s = i();
190
+ s instanceof HTMLElement ? e.appendChild(s) : m(s, e);
187
191
  } else i instanceof HTMLElement ? e.appendChild(i) : m(i, e);
188
192
  let o = document.querySelector("schmancy-dialog");
189
- return o || (o = document.createElement("schmancy-dialog"), document.body.appendChild(o)), o.appendChild(e), s.width && o.style.setProperty("--dialog-width", s.width), this.activeRawDialogs.push(o), o.show(s.position).finally(() => {
193
+ return o || (o = document.createElement("schmancy-dialog"), document.body.appendChild(o)), o.appendChild(e), n.width && o.style.setProperty("--dialog-width", n.width), this.activeRawDialogs.push(o), o.show(n.position).finally(() => {
190
194
  e && e.parentNode && e.parentNode.removeChild(e);
191
- const n = this.activeRawDialogs.indexOf(o);
192
- n !== -1 && this.activeRawDialogs.splice(n, 1);
195
+ const s = this.activeRawDialogs.indexOf(o);
196
+ s !== -1 && this.activeRawDialogs.splice(s, 1);
193
197
  });
194
198
  }
195
199
  dismiss() {
196
200
  return this.activeRawDialogs.length > 0 ? (this.activeRawDialogs[this.activeRawDialogs.length - 1].hide(!1), this.activeRawDialogs.pop(), !0) : this.activeDialogs.length > 0 ? (this.activeDialogs[this.activeDialogs.length - 1].hide(!1), !0) : !1;
197
201
  }
198
- ask(i, s) {
199
- return this.confirm({ message: i, position: s });
202
+ ask(i, n) {
203
+ return this.confirm({ message: i, position: n });
200
204
  }
201
205
  danger(i) {
202
206
  return this.confirm({ ...i, variant: "danger" });
@@ -205,10 +209,10 @@ const h = class h {
205
209
  return { x: window.innerWidth / 2, y: window.innerHeight / 2 };
206
210
  }
207
211
  };
208
- h.DEFAULT_OPTIONS = { title: void 0, subtitle: void 0, confirmText: void 0, cancelText: "Cancel", variant: "default", width: "360px" };
209
- let l = h;
210
- const F = { confirm: (t) => l.getInstance().confirm(t), ask: (t, i) => l.getInstance().ask(t, i), danger: (t) => l.getInstance().danger(t), component: (t, i) => l.getInstance().component(t, i), simple: (t, i) => l.getInstance().component(t, i), dismiss: () => l.getInstance().dismiss() };
211
- var A = Object.getOwnPropertyDescriptor;
212
+ d.DEFAULT_OPTIONS = { title: void 0, subtitle: void 0, confirmText: void 0, cancelText: "Cancel", variant: "default", width: "360px" };
213
+ let h = d;
214
+ const B = { confirm: (t) => h.getInstance().confirm(t), ask: (t, i) => h.getInstance().ask(t, i), danger: (t) => h.getInstance().danger(t), component: (t, i) => h.getInstance().component(t, i), simple: (t, i) => h.getInstance().component(t, i), dismiss: () => h.getInstance().dismiss() };
215
+ var k = Object.getOwnPropertyDescriptor;
212
216
  let b = class extends f(v`
213
217
  :host {
214
218
  position: fixed;
@@ -247,15 +251,15 @@ let b = class extends f(v`
247
251
  super(...arguments), this.position = { x: 0, y: 0 };
248
252
  }
249
253
  async show(t) {
250
- let i, s;
251
- if (t) if ("clientX" in t) i = t.clientX, s = t.clientY;
252
- else if ("touches" in t && t.touches.length) i = t.touches[0].clientX, s = t.touches[0].clientY;
254
+ let i, n;
255
+ if (t) if ("clientX" in t) i = t.clientX, n = t.clientY;
256
+ else if ("touches" in t && t.touches.length) i = t.touches[0].clientX, n = t.touches[0].clientY;
253
257
  else {
254
258
  const e = t;
255
- i = e.x, s = e.y;
259
+ i = e.x, n = e.y;
256
260
  }
257
- else i = window.innerWidth / 2, s = window.innerHeight / 2;
258
- return this.position = { x: i, y: s }, this.virtualReference = { getBoundingClientRect: () => new DOMRect(i, s, 0, 0) }, this.setAttribute("active", ""), new Promise((e) => {
261
+ else i = window.innerWidth / 2, n = window.innerHeight / 2;
262
+ return this.position = { x: i, y: n }, this.virtualReference = { getBoundingClientRect: () => new DOMRect(i, n, 0, 0) }, this.setAttribute("active", ""), new Promise((e) => {
259
263
  this.resolvePromise = e;
260
264
  });
261
265
  }
@@ -263,8 +267,8 @@ let b = class extends f(v`
263
267
  this.removeAttribute("active"), this.cleanupAutoUpdate && (this.cleanupAutoUpdate(), this.cleanupAutoUpdate = void 0), this.resolvePromise && (this.resolvePromise(t), this.resolvePromise = void 0);
264
268
  }
265
269
  setupPositioning(t) {
266
- const i = window.innerWidth, s = window.innerHeight;
267
- if (Math.abs(this.position.x - i / 2) < 10 && Math.abs(this.position.y - s / 2) < 10) return t.classList.add("centered"), void (this.cleanupAutoUpdate = g(document.body, t, () => {
270
+ const i = window.innerWidth, n = window.innerHeight;
271
+ if (Math.abs(this.position.x - i / 2) < 10 && Math.abs(this.position.y - n / 2) < 10) return t.classList.add("centered"), void (this.cleanupAutoUpdate = g(document.body, t, () => {
268
272
  if (t.classList.contains("centered")) {
269
273
  const e = window.innerHeight - 40;
270
274
  t.offsetHeight > e && (t.style.maxHeight = `${e}px`);
@@ -275,13 +279,13 @@ let b = class extends f(v`
275
279
  async updatePosition(t) {
276
280
  if (!this.virtualReference) return;
277
281
  if (this.position.x > 0 && this.position.y > 0) {
278
- const e = window.innerWidth, o = window.innerHeight, n = Math.min(this.position.x, e - 20), a = Math.min(this.position.y, o - 20);
279
- this.virtualReference = { getBoundingClientRect: () => new DOMRect(n, a, 0, 0) };
282
+ const e = window.innerWidth, o = window.innerHeight, s = Math.min(this.position.x, e - 20), a = Math.min(this.position.y, o - 20);
283
+ this.virtualReference = { getBoundingClientRect: () => new DOMRect(s, a, 0, 0) };
280
284
  }
281
- const { x: i, y: s } = await x(this.virtualReference, t, { placement: "bottom-start", strategy: "absolute", middleware: [C(20), P({ fallbackPlacements: ["top-start", "bottom-end", "top-end"], fallbackStrategy: "bestFit" }), R({ padding: 20 }), T({ apply({ availableWidth: e, availableHeight: o, elements: n }) {
282
- n.floating.offsetWidth > e && Object.assign(n.floating.style, { maxWidth: `${Math.max(e - 40, 280)}px` }), n.floating.offsetHeight > o && Object.assign(n.floating.style, { maxHeight: o - 40 + "px" });
285
+ const { x: i, y: n } = await x(this.virtualReference, t, { placement: "bottom-start", strategy: "absolute", middleware: [C(20), P({ fallbackPlacements: ["top-start", "bottom-end", "top-end"], fallbackStrategy: "bestFit" }), R({ padding: 20 }), S({ apply({ availableWidth: e, availableHeight: o, elements: s }) {
286
+ s.floating.offsetWidth > e && Object.assign(s.floating.style, { maxWidth: `${Math.max(e - 40, 280)}px` }), s.floating.offsetHeight > o && Object.assign(s.floating.style, { maxHeight: o - 40 + "px" });
283
287
  }, padding: 20 })] });
284
- Object.assign(t.style, { left: `${Math.round(i)}px`, top: `${Math.round(s)}px`, transform: "none" });
288
+ Object.assign(t.style, { left: `${Math.round(i)}px`, top: `${Math.round(n)}px`, transform: "none" });
285
289
  }
286
290
  disconnectedCallback() {
287
291
  super.disconnectedCallback(), this.resizeSubscription && (this.resizeSubscription.unsubscribe(), this.resizeSubscription = void 0), this.cleanupAutoUpdate && (this.cleanupAutoUpdate(), this.cleanupAutoUpdate = void 0);
@@ -289,9 +293,9 @@ let b = class extends f(v`
289
293
  firstUpdated() {
290
294
  var i;
291
295
  const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".dialog");
292
- t && (this.setupPositioning(t), this.resizeSubscription = S(window, "resize").pipe(H(50)).subscribe(() => {
293
- const s = window.innerWidth, e = window.innerHeight;
294
- Math.abs(this.position.x - s / 2) < 10 && Math.abs(this.position.y - e / 2) < 10 && (this.position = { x: s / 2, y: e / 2 }), this.updatePosition(t);
296
+ t && (this.setupPositioning(t), this.resizeSubscription = T(window, "resize").pipe(H(50)).subscribe(() => {
297
+ const n = window.innerWidth, e = window.innerHeight;
298
+ Math.abs(this.position.x - n / 2) < 10 && Math.abs(this.position.y - e / 2) < 10 && (this.position = { x: n / 2, y: e / 2 }), this.updatePosition(t);
295
299
  }));
296
300
  }
297
301
  handleClose() {
@@ -309,11 +313,11 @@ let b = class extends f(v`
309
313
  `;
310
314
  }
311
315
  };
312
- b = ((t, i, s, e) => {
313
- for (var o, n = e > 1 ? void 0 : e ? A(i, s) : i, a = t.length - 1; a >= 0; a--) (o = t[a]) && (n = o(n) || n);
314
- return n;
316
+ b = ((t, i, n, e) => {
317
+ for (var o, s = e > 1 ? void 0 : e ? k(i, n) : i, a = t.length - 1; a >= 0; a--) (o = t[a]) && (s = o(s) || s);
318
+ return s;
315
319
  })([y("schmancy-dialog")], b);
316
- var D = Object.getOwnPropertyDescriptor;
320
+ var A = Object.getOwnPropertyDescriptor;
317
321
  let w = class extends f(v`
318
322
  :host {
319
323
  display: block;
@@ -325,15 +329,15 @@ let w = class extends f(v`
325
329
  return c`<slot></slot>`;
326
330
  }
327
331
  };
328
- w = ((t, i, s, e) => {
329
- for (var o, n = e > 1 ? void 0 : e ? D(i, s) : i, a = t.length - 1; a >= 0; a--) (o = t[a]) && (n = o(n) || n);
330
- return n;
332
+ w = ((t, i, n, e) => {
333
+ for (var o, s = e > 1 ? void 0 : e ? A(i, n) : i, a = t.length - 1; a >= 0; a--) (o = t[a]) && (s = o(s) || s);
334
+ return s;
331
335
  })([y("schmancy-dialog-content")], w);
332
336
  export {
333
- F as $,
337
+ B as $,
334
338
  r as C,
335
- l as D,
339
+ h as D,
336
340
  b as S,
337
341
  w as a
338
342
  };
339
- //# sourceMappingURL=dialog-content-9pumpyLD.js.map
343
+ //# sourceMappingURL=dialog-content-DFJnYzff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-content-DFJnYzff.js","sources":["../src/dialog/dailog.ts","../src/dialog/dialog-service.ts","../src/dialog/dialog.component.ts","../src/dialog/dialog-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String })\n\tsubtitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Confirm button color\n\t */\n\t@property({ type: String, attribute: 'confirm-color' })\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Store resize subscription\n\t */\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\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\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Get the CSS class for the confirm button based on color\n\t */\n\tprivate getConfirmButtonClass(): string {\n\t\t// Map confirmColor to appropriate CSS classes\n\t\tconst colorMap = {\n\t\t\terror: 'bg-red-600 hover:bg-red-700 text-white',\n\t\t\twarning: 'bg-orange-600 hover:bg-orange-700 text-white',\n\t\t\tsuccess: 'bg-green-600 hover:bg-green-700 text-white',\n\t\t\tprimary: ''\n\t\t}\n\n\t\t// If variant is danger, use error color\n\t\tif (this.variant === 'danger' || this.confirmColor === 'error') {\n\t\t\treturn colorMap.error\n\t\t}\n\n\t\treturn colorMap[this.confirmColor || 'primary'] || ''\n\t}\n\n\trender() {\n\t\t// For initial rendering, use transform-based centering from CSS\n\t\t// firstUpdated will handle precise positioning after measuring\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\t\t// Only show buttons if both confirmText and cancelText are non-empty strings\n\t\tconst showButtons =\n\t\t\tthis.confirmText && this.confirmText.trim() !== '' && this.cancelText && this.cancelText.trim() !== ''\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} class=\"p-4\">\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title && this.title.trim() !== '',\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\" class=\"mb-1\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\tthis.subtitle && this.subtitle.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t() => html``\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\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"${showButtons ? 'mb-4' : ''}\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\tthis.message && this.message.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tshowButtons,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.subtitle) dialog.subtitle = options.subtitle\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { render, TemplateResult } from 'lit'\nimport { ConfirmDialog } from './dailog'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\n\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n\thideActions?: boolean // Set to true to hide all buttons and title\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: 'Cancel',\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\t// Apply default options\n\t\tconst completeOptions = {\n\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t}\n\n\t\t// If no position is provided, center the dialog\n\t\tif (!completeOptions.position) {\n\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t}\n\n\t\t// Create or find the dialog\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set basic options\n\t\tif (completeOptions.title) dialog.title = completeOptions.title\n\t\tif (completeOptions.subtitle) dialog.subtitle = completeOptions.subtitle\n\t\tif (completeOptions.message) dialog.message = completeOptions.message\n\t\tif (completeOptions.confirmText) dialog.confirmText = completeOptions.confirmText\n\t\tif (completeOptions.cancelText) dialog.cancelText = completeOptions.cancelText\n\t\tif (completeOptions.variant) dialog.variant = completeOptions.variant\n\t\tif (completeOptions.confirmColor) dialog.confirmColor = completeOptions.confirmColor\n\t\tif (completeOptions.width) dialog.style.setProperty('--dialog-width', completeOptions.width)\n\n\t\t// Handle custom content if provided\n\t\tif (completeOptions.content) {\n\t\t\tconst contentContainer = document.createElement('div')\n\t\t\tcontentContainer.slot = 'content'\n\n\t\t\tif (typeof completeOptions.content === 'function') {\n\t\t\t\tconst result = completeOptions.content()\n\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t} else {\n\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t}\n\t\t\t} else if (completeOptions.content instanceof HTMLElement) {\n\t\t\t\tcontentContainer.appendChild(completeOptions.content)\n\t\t\t} else {\n\t\t\t\trender(completeOptions.content, contentContainer)\n\t\t\t}\n\n\t\t\tdialog.appendChild(contentContainer)\n\t\t}\n\n\t\t// Set up event listeners for optional callbacks\n\t\tif (completeOptions.onConfirm) {\n\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\tcompleteOptions.onConfirm!()\n\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t}\n\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t}\n\n\t\tif (completeOptions.onCancel) {\n\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\tcompleteOptions.onCancel!()\n\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t}\n\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t}\n\n\t\t// Add this dialog to active dialogs\n\t\tthis.activeDialogs.push(dialog)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(completeOptions.position).finally(() => {\n\t\t\t// Remove from active dialogs when closed\n\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t}\n\n\t\t\t// Clean up the content when dialog closes\n\t\t\tif (completeOptions.content) {\n\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\tif (contentEl) {\n\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\t// Create a direct container for the component without any wrapping\n\t\tconst directContentContainer = document.createElement('div');\n\t\tdirectContentContainer.style.height = '100%';\n\t\tdirectContentContainer.style.width = '100%';\n\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container');\n\t\t\n\t\t// Render the content directly\n\t\tif (typeof content === 'function') {\n\t\t\tconst result = content();\n\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\tdirectContentContainer.appendChild(result);\n\t\t\t} else {\n\t\t\t\trender(result, directContentContainer);\n\t\t\t}\n\t\t} else if (content instanceof HTMLElement) {\n\t\t\tdirectContentContainer.appendChild(content);\n\t\t} else {\n\t\t\trender(content, directContentContainer);\n\t\t}\n\t\t\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('schmancy-dialog') as any;\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('schmancy-dialog');\n\t\t\tdocument.body.appendChild(dialog);\n\t\t}\n\t\t\n\t\t// Always use raw component rendering with no actions\n\t\tdialog.appendChild(directContentContainer);\n\t\t\n\t\t// Set width from options\n\t\tif (options.width) {\n\t\t\tdialog.style.setProperty('--dialog-width', options.width);\n\t\t}\n\t\t\n\t\t// Add to active raw dialogs for dismiss functionality\n\t\tthis.activeRawDialogs.push(dialog);\n\t\t\n\t\t// Show dialog and return promise with cleanup\n\t\tconst promise = dialog.show(options.position);\n\t\treturn promise.finally(() => {\n\t\t\t// Clean up content when dialog closes\n\t\t\tif (directContentContainer && directContentContainer.parentNode) {\n\t\t\t\tdirectContentContainer.parentNode.removeChild(directContentContainer);\n\t\t\t}\n\t\t\t\n\t\t\t// Remove from active raw dialogs\n\t\t\tconst index = this.activeRawDialogs.indexOf(dialog);\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.activeRawDialogs.splice(index, 1);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1];\n\t\t\t\n\t\t\t// Hide the dialog\n\t\t\tdialog.hide(false);\n\t\t\t\n\t\t\t// Remove from active dialogs\n\t\t\tthis.activeRawDialogs.pop();\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1];\n\t\t\t\n\t\t\t// Hide the dialog (with cancel result)\n\t\t\tdialog.hide(false);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService","import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A basic dialog web component without title or actions\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: rgba(0, 0, 0, 0.4);\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\tmax-width: var(--dialog-width);\n\t\twidth: max-content;\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(result = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(result)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\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\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t// Store resize subscription\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle close action\n\t */\n\tprivate handleClose() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleClose}></div>\n\n\t\t\t<div class=\"dialog\" role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n/**\n * A basic dialog content component that doesn't add any padding or styling\n * Used for rendering raw content in a dialog\n *\n * @element schmancy-dialog-content\n * @slot default - Content slot for dialog content without any styling\n */\n@customElement('schmancy-dialog-content')\nexport class SchmancyDialogContent extends $LitElement(css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n`) {\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-dialog-content': SchmancyDialogContent\n }\n}"],"names":["ConfirmDialog","$LitElement","css","super","arguments","this","title","subtitle","message","confirmText","cancelText","variant","position","x","y","show","positionOrEvent","clientX","clientY","touches","length","pos","window","innerWidth","innerHeight","virtualReference","getBoundingClientRect","DOMRect","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","cleanupAutoUpdate","dialog","viewportWidth","viewportHeight","Math","abs","classList","add","autoUpdate","document","body","contains","availableHeight","offsetHeight","style","maxHeight","elementResize","ancestorScroll","remove","updatePosition","ancestorResize","animationFrame","min","computePosition","placement","strategy","middleware","offset","flip","fallbackPlacements","fallbackStrategy","shift","padding","size","apply","availableWidth","elements","floating","offsetWidth","Object","assign","maxWidth","max","margin","left","round","top","transform","disconnectedCallback","resizeSubscription","unsubscribe","firstUpdated","shadowRoot","querySelector","setupPositioning","fromEvent","pipe","debounceTime","subscribe","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","getConfirmButtonClass","colorMap","error","warning","success","primary","confirmColor","hasCustomContent","querySelectorAll","showButtons","trim","html","handleCancel","when","options","createElement","appendChild","width","setProperty","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","DialogService","constructor","activeDialogs","activeRawDialogs","getInstance","instance","completeOptions","DEFAULT_OPTIONS","getCenteredPosition","content","contentContainer","slot","result","HTMLElement","render","onConfirm","_e","removeEventListener","addEventListener","onCancel","push","finally","index","indexOf","splice","contentEl","removeChild","directContentContainer","height","parentNode","pop","_v","$dialog","ask","danger","component","simple","dismiss","SchmancyDialog","handleClose","SchmancyDialogContent"],"mappings":";;;;;;;;;;;;;;AAea,IAAAA,IAAN,cAA4BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;A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