@mhmo91/schmancy 0.1.3 → 0.1.4

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 (206) hide show
  1. package/dist/{animated-text-CXWL8BLX.js → animated-text-BCx3uq9B.js} +3 -3
  2. package/dist/{animated-text-CXWL8BLX.js.map → animated-text-BCx3uq9B.js.map} +1 -1
  3. package/dist/{animated-text-Be1GRrxM.cjs → animated-text-D_T5sX3t.cjs} +2 -2
  4. package/dist/{animated-text-Be1GRrxM.cjs.map → animated-text-D_T5sX3t.cjs.map} +1 -1
  5. package/dist/animated-text.cjs +1 -1
  6. package/dist/animated-text.js +1 -1
  7. package/dist/area.cjs +1 -1
  8. package/dist/{area.component-lv5p1JAi.js → area.component-BalqG_FH.js} +3 -3
  9. package/dist/{area.component-lv5p1JAi.js.map → area.component-BalqG_FH.js.map} +1 -1
  10. package/dist/{area.component-BdOz0QVI.cjs → area.component-Bibvw6d1.cjs} +2 -2
  11. package/dist/{area.component-BdOz0QVI.cjs.map → area.component-Bibvw6d1.cjs.map} +1 -1
  12. package/dist/area.js +1 -1
  13. package/dist/{autocomplete-DUasFfQd.cjs → autocomplete-BgIIYq3a.cjs} +2 -2
  14. package/dist/{autocomplete-DUasFfQd.cjs.map → autocomplete-BgIIYq3a.cjs.map} +1 -1
  15. package/dist/{autocomplete-IIohssup.js → autocomplete-Cy1fRL5A.js} +3 -3
  16. package/dist/{autocomplete-IIohssup.js.map → autocomplete-Cy1fRL5A.js.map} +1 -1
  17. package/dist/autocomplete.cjs +1 -1
  18. package/dist/autocomplete.js +1 -1
  19. package/dist/busy.cjs +1 -1
  20. package/dist/busy.js +1 -1
  21. package/dist/button.cjs +1 -1
  22. package/dist/button.js +1 -1
  23. package/dist/card.cjs +1 -1
  24. package/dist/card.js +1 -1
  25. package/dist/{checkbox-rX1ai5aE.js → checkbox-BzuKq4qC.js} +2 -2
  26. package/dist/{checkbox-rX1ai5aE.js.map → checkbox-BzuKq4qC.js.map} +1 -1
  27. package/dist/{checkbox-UGSiC4-7.cjs → checkbox-Ds3EPb8t.cjs} +2 -2
  28. package/dist/{checkbox-UGSiC4-7.cjs.map → checkbox-Ds3EPb8t.cjs.map} +1 -1
  29. package/dist/checkbox.cjs +1 -1
  30. package/dist/checkbox.js +1 -1
  31. package/dist/{chips-DKyOFX0b.js → chips-BvcQDTi1.js} +3 -3
  32. package/dist/{chips-DKyOFX0b.js.map → chips-BvcQDTi1.js.map} +1 -1
  33. package/dist/{chips-42rqq7eR.cjs → chips-COxP_IMG.cjs} +2 -2
  34. package/dist/{chips-42rqq7eR.cjs.map → chips-COxP_IMG.cjs.map} +1 -1
  35. package/dist/chips.cjs +1 -1
  36. package/dist/chips.js +1 -1
  37. package/dist/components.cjs +1 -1
  38. package/dist/components.js +1 -1
  39. package/dist/content-drawer.cjs +1 -1
  40. package/dist/content-drawer.js +1 -1
  41. package/dist/{date-range-Dx0X9XkD.cjs → date-range-Cmxn4OYH.cjs} +2 -2
  42. package/dist/{date-range-Dx0X9XkD.cjs.map → date-range-Cmxn4OYH.cjs.map} +1 -1
  43. package/dist/{date-range-Cv7J4zqk.js → date-range-DhYgGxEE.js} +3 -3
  44. package/dist/{date-range-Cv7J4zqk.js.map → date-range-DhYgGxEE.js.map} +1 -1
  45. package/dist/date-range.cjs +1 -1
  46. package/dist/date-range.js +1 -1
  47. package/dist/{delay-DDTFbzUT.js → delay-6UC8dFu4.js} +2 -2
  48. package/dist/{delay-DDTFbzUT.js.map → delay-6UC8dFu4.js.map} +1 -1
  49. package/dist/{delay-BknG_sX0.cjs → delay-DGSs_qVV.cjs} +2 -2
  50. package/dist/{delay-BknG_sX0.cjs.map → delay-DGSs_qVV.cjs.map} +1 -1
  51. package/dist/delay.cjs +1 -1
  52. package/dist/delay.js +1 -1
  53. package/dist/{divider-LocxHBJv.js → divider--AgsKuTg.js} +3 -3
  54. package/dist/{divider-LocxHBJv.js.map → divider--AgsKuTg.js.map} +1 -1
  55. package/dist/{divider-CA2cFFcc.cjs → divider-DDJxZlO5.cjs} +2 -2
  56. package/dist/{divider-CA2cFFcc.cjs.map → divider-DDJxZlO5.cjs.map} +1 -1
  57. package/dist/divider.cjs +1 -1
  58. package/dist/divider.js +1 -1
  59. package/dist/{form-RAgk2SSz.cjs → form-CxU9C4Sr.cjs} +2 -2
  60. package/dist/{form-RAgk2SSz.cjs.map → form-CxU9C4Sr.cjs.map} +1 -1
  61. package/dist/{form-BV79BLFu.js → form-F1Rt7sdm.js} +2 -2
  62. package/dist/{form-BV79BLFu.js.map → form-F1Rt7sdm.js.map} +1 -1
  63. package/dist/form.cjs +1 -1
  64. package/dist/form.js +1 -1
  65. package/dist/{icon-DBIGGdxd.cjs → icon-BxgOV323.cjs} +2 -2
  66. package/dist/{icon-DBIGGdxd.cjs.map → icon-BxgOV323.cjs.map} +1 -1
  67. package/dist/{icon-DMom-EmW.js → icon-DQoD7nQe.js} +3 -3
  68. package/dist/{icon-DMom-EmW.js.map → icon-DQoD7nQe.js.map} +1 -1
  69. package/dist/{icon-button-cP-S-rgo.cjs → icon-button-DxMW937h.cjs} +2 -2
  70. package/dist/{icon-button-cP-S-rgo.cjs.map → icon-button-DxMW937h.cjs.map} +1 -1
  71. package/dist/{icon-button-B1siCgt2.js → icon-button-DxkT7RlS.js} +3 -3
  72. package/dist/{icon-button-B1siCgt2.js.map → icon-button-DxkT7RlS.js.map} +1 -1
  73. package/dist/icons.cjs +1 -1
  74. package/dist/icons.js +1 -1
  75. package/dist/index.cjs +1 -1
  76. package/dist/index.js +30 -30
  77. package/dist/{input-JeE5xI6K.js → input-Bej6rZig.js} +2 -2
  78. package/dist/{input-JeE5xI6K.js.map → input-Bej6rZig.js.map} +1 -1
  79. package/dist/{input-BE2Nmifh.cjs → input-C8EwWgnx.cjs} +2 -2
  80. package/dist/{input-BE2Nmifh.cjs.map → input-C8EwWgnx.cjs.map} +1 -1
  81. package/dist/input.cjs +1 -1
  82. package/dist/input.js +1 -1
  83. package/dist/layout.cjs +1 -1
  84. package/dist/layout.js +1 -1
  85. package/dist/list.cjs +1 -1
  86. package/dist/list.js +1 -1
  87. package/dist/{litElement.mixin-BQQ8SViR.js → litElement.mixin-BXHgZn36.js} +2 -2
  88. package/dist/{litElement.mixin-BQQ8SViR.js.map → litElement.mixin-BXHgZn36.js.map} +1 -1
  89. package/dist/{litElement.mixin-T2hfvva-.cjs → litElement.mixin-Dr3N9KpR.cjs} +2 -2
  90. package/dist/{litElement.mixin-T2hfvva-.cjs.map → litElement.mixin-Dr3N9KpR.cjs.map} +1 -1
  91. package/dist/{menu-HLuts8V3.js → menu-CYQ61iYv.js} +3 -3
  92. package/dist/{menu-HLuts8V3.js.map → menu-CYQ61iYv.js.map} +1 -1
  93. package/dist/{menu-CcoCzR8e.cjs → menu-FVfRm6pe.cjs} +2 -2
  94. package/dist/{menu-CcoCzR8e.cjs.map → menu-FVfRm6pe.cjs.map} +1 -1
  95. package/dist/menu.cjs +1 -1
  96. package/dist/menu.js +1 -1
  97. package/dist/mixins/tailwind.css +387 -1
  98. package/dist/nav-drawer.cjs +1 -1
  99. package/dist/nav-drawer.js +1 -1
  100. package/dist/notification.cjs +1 -1
  101. package/dist/notification.js +1 -1
  102. package/dist/{option-Bzi4aanD.cjs → option-CI-vjChb.cjs} +2 -2
  103. package/dist/{option-Bzi4aanD.cjs.map → option-CI-vjChb.cjs.map} +1 -1
  104. package/dist/{option-C5egpChO.js → option-DoH4NEmh.js} +2 -2
  105. package/dist/{option-C5egpChO.js.map → option-DoH4NEmh.js.map} +1 -1
  106. package/dist/option.cjs +1 -1
  107. package/dist/option.js +1 -1
  108. package/dist/{outlet-CQ6YXEen.cjs → outlet-BJ525TFe.cjs} +2 -2
  109. package/dist/{outlet-CQ6YXEen.cjs.map → outlet-BJ525TFe.cjs.map} +1 -1
  110. package/dist/{outlet-CXxpQ37y.js → outlet-ENTF9Aj-.js} +2 -2
  111. package/dist/{outlet-CXxpQ37y.js.map → outlet-ENTF9Aj-.js.map} +1 -1
  112. package/dist/{payment-card-form-DNI4IjK7.cjs → payment-card-form-C2PD41dx.cjs} +2 -2
  113. package/dist/{payment-card-form-DNI4IjK7.cjs.map → payment-card-form-C2PD41dx.cjs.map} +1 -1
  114. package/dist/{payment-card-form-BNCVkn4A.js → payment-card-form-Knq6tf3U.js} +3 -3
  115. package/dist/{payment-card-form-BNCVkn4A.js.map → payment-card-form-Knq6tf3U.js.map} +1 -1
  116. package/dist/{radio-group-CPmdicYZ.js → radio-group-BXJjZm-z.js} +2 -2
  117. package/dist/{radio-group-CPmdicYZ.js.map → radio-group-BXJjZm-z.js.map} +1 -1
  118. package/dist/{radio-group-DiecmCUy.cjs → radio-group-Ci2VDqG-.cjs} +2 -2
  119. package/dist/{radio-group-DiecmCUy.cjs.map → radio-group-Ci2VDqG-.cjs.map} +1 -1
  120. package/dist/radio-group.cjs +1 -1
  121. package/dist/radio-group.js +1 -1
  122. package/dist/{scroll-CmQioZO_.cjs → scroll-DBqmP5Nd.cjs} +2 -2
  123. package/dist/{scroll-CmQioZO_.cjs.map → scroll-DBqmP5Nd.cjs.map} +1 -1
  124. package/dist/{scroll-C2AdiqOm.js → scroll-Dt87Newt.js} +2 -2
  125. package/dist/{scroll-C2AdiqOm.js.map → scroll-Dt87Newt.js.map} +1 -1
  126. package/dist/{select-CHqzliGG.js → select-B6VZmKFM.js} +3 -3
  127. package/dist/{select-CHqzliGG.js.map → select-B6VZmKFM.js.map} +1 -1
  128. package/dist/{select-BPPcWB35.cjs → select-CbxcDK55.cjs} +2 -2
  129. package/dist/{select-BPPcWB35.cjs.map → select-CbxcDK55.cjs.map} +1 -1
  130. package/dist/select.cjs +1 -1
  131. package/dist/select.js +1 -1
  132. package/dist/{sheet-KV0oZtrR.cjs → sheet-Cy9Cw12T.cjs} +2 -2
  133. package/dist/{sheet-KV0oZtrR.cjs.map → sheet-Cy9Cw12T.cjs.map} +1 -1
  134. package/dist/{sheet-CGmu7xn7.js → sheet-DIbsOEmM.js} +3 -3
  135. package/dist/{sheet-CGmu7xn7.js.map → sheet-DIbsOEmM.js.map} +1 -1
  136. package/dist/sheet.cjs +1 -1
  137. package/dist/sheet.js +1 -1
  138. package/dist/{slider-D-M3pFtn.js → slider-BTMAoZhi.js} +3 -3
  139. package/dist/{slider-D-M3pFtn.js.map → slider-BTMAoZhi.js.map} +1 -1
  140. package/dist/{slider-D8zKzxgN.cjs → slider-C-wDCLNT.cjs} +2 -2
  141. package/dist/{slider-D8zKzxgN.cjs.map → slider-C-wDCLNT.cjs.map} +1 -1
  142. package/dist/slider.cjs +1 -1
  143. package/dist/slider.js +1 -1
  144. package/dist/{spinner-C-2I7yH9.cjs → spinner-CwgKGgNf.cjs} +2 -2
  145. package/dist/{spinner-C-2I7yH9.cjs.map → spinner-CwgKGgNf.cjs.map} +1 -1
  146. package/dist/{spinner-Bxpq8jN0.js → spinner-DpSRuFXK.js} +2 -2
  147. package/dist/{spinner-Bxpq8jN0.js.map → spinner-DpSRuFXK.js.map} +1 -1
  148. package/dist/{surface-B0Wpttcp.js → surface-BLP3a7_t.js} +2 -2
  149. package/dist/{surface-B0Wpttcp.js.map → surface-BLP3a7_t.js.map} +1 -1
  150. package/dist/{surface-K6V6QGZ7.cjs → surface-CcDN3qmB.cjs} +2 -2
  151. package/dist/{surface-K6V6QGZ7.cjs.map → surface-CcDN3qmB.cjs.map} +1 -1
  152. package/dist/surface.cjs +1 -1
  153. package/dist/surface.js +1 -1
  154. package/dist/{table-CNa5CVCb.cjs → table-C3g0IaFH.cjs} +2 -2
  155. package/dist/{table-CNa5CVCb.cjs.map → table-C3g0IaFH.cjs.map} +1 -1
  156. package/dist/{table-DXYjwhsS.js → table-fOcTT-Aa.js} +2 -2
  157. package/dist/{table-DXYjwhsS.js.map → table-fOcTT-Aa.js.map} +1 -1
  158. package/dist/table.cjs +1 -1
  159. package/dist/table.js +1 -1
  160. package/dist/{tabs-group-B6L2cvkm.cjs → tabs-group-CPLdWIDf.cjs} +2 -2
  161. package/dist/{tabs-group-B6L2cvkm.cjs.map → tabs-group-CPLdWIDf.cjs.map} +1 -1
  162. package/dist/{tabs-group-jVXSw4vO.js → tabs-group-CQ35dSM7.js} +2 -2
  163. package/dist/{tabs-group-jVXSw4vO.js.map → tabs-group-CQ35dSM7.js.map} +1 -1
  164. package/dist/tabs.cjs +1 -1
  165. package/dist/tabs.js +1 -1
  166. package/dist/tailwind.mixin-DTfnCU8A.js +43 -0
  167. package/dist/{tailwind.mixin-DZctuRzi.js.map → tailwind.mixin-DTfnCU8A.js.map} +1 -1
  168. package/dist/tailwind.mixin-DXloUbDW.cjs +2 -0
  169. package/dist/{tailwind.mixin-BXsGUMQ1.cjs.map → tailwind.mixin-DXloUbDW.cjs.map} +1 -1
  170. package/dist/teleport.cjs +1 -1
  171. package/dist/teleport.js +1 -1
  172. package/dist/{textarea-B6Pl8Y2D.cjs → textarea-Ciy-fDVT.cjs} +2 -2
  173. package/dist/{textarea-B6Pl8Y2D.cjs.map → textarea-Ciy-fDVT.cjs.map} +1 -1
  174. package/dist/{textarea-Buxkp6z0.js → textarea-D1v_yuuH.js} +2 -2
  175. package/dist/{textarea-Buxkp6z0.js.map → textarea-D1v_yuuH.js.map} +1 -1
  176. package/dist/textarea.cjs +1 -1
  177. package/dist/textarea.js +1 -1
  178. package/dist/{theme-button-CWM-0CJh.cjs → theme-button-CHqm5wRe.cjs} +3 -3
  179. package/dist/theme-button-CHqm5wRe.cjs.map +1 -0
  180. package/dist/{theme-button-BQZkb1t4.js → theme-button-DzklvaUI.js} +33 -33
  181. package/dist/theme-button-DzklvaUI.js.map +1 -0
  182. package/dist/theme-button.cjs +1 -1
  183. package/dist/theme-button.js +1 -1
  184. package/dist/{tree-7PVEhRCU.js → tree-ChmtrAZ4.js} +2 -2
  185. package/dist/{tree-7PVEhRCU.js.map → tree-ChmtrAZ4.js.map} +1 -1
  186. package/dist/{tree-nmdWfp9I.cjs → tree-tDas5Jqs.cjs} +2 -2
  187. package/dist/{tree-nmdWfp9I.cjs.map → tree-tDas5Jqs.cjs.map} +1 -1
  188. package/dist/tree.cjs +1 -1
  189. package/dist/tree.js +1 -1
  190. package/dist/{typewriter-DnGkvyDG.cjs → typewriter-CPS8Fql3.cjs} +2 -2
  191. package/dist/{typewriter-DnGkvyDG.cjs.map → typewriter-CPS8Fql3.cjs.map} +1 -1
  192. package/dist/{typewriter-ZnPAe8JA.js → typewriter-DgJpnOI0.js} +4 -4
  193. package/dist/{typewriter-ZnPAe8JA.js.map → typewriter-DgJpnOI0.js.map} +1 -1
  194. package/dist/typewriter.cjs +1 -1
  195. package/dist/typewriter.js +1 -1
  196. package/dist/{typography-oGjgh4qJ.cjs → typography-BLCdd5_e.cjs} +2 -2
  197. package/dist/{typography-oGjgh4qJ.cjs.map → typography-BLCdd5_e.cjs.map} +1 -1
  198. package/dist/{typography-L0ZKDX-X.js → typography-R8MNzkWa.js} +2 -2
  199. package/dist/{typography-L0ZKDX-X.js.map → typography-R8MNzkWa.js.map} +1 -1
  200. package/dist/typography.cjs +1 -1
  201. package/dist/typography.js +1 -1
  202. package/package.json +1 -1
  203. package/dist/tailwind.mixin-BXsGUMQ1.cjs +0 -2
  204. package/dist/tailwind.mixin-DZctuRzi.js +0 -43
  205. package/dist/theme-button-BQZkb1t4.js.map +0 -1
  206. package/dist/theme-button-CWM-0CJh.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import "rxjs";
2
2
  import "lit/directives/class-map.js";
3
3
  import "lit/directives/style-map.js";
4
- import { T as c } from "./tailwind.mixin-DZctuRzi.js";
4
+ import { T as c } from "./tailwind.mixin-DTfnCU8A.js";
5
5
  import { html as h } from "lit";
6
6
  import { property as p, customElement as u } from "lit/decorators.js";
7
7
  var d = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (t, e, n, s) => {
@@ -37,4 +37,4 @@ let r = class extends c() {
37
37
  }
38
38
  };
39
39
  i([p({ type: String, reflect: !0 })], r.prototype, "value", 2), i([p({ type: String, reflect: !0 })], r.prototype, "label", 2), i([p({ type: Boolean })], r.prototype, "selected", 2), r = i([u("schmancy-option")], r);
40
- //# sourceMappingURL=option-C5egpChO.js.map
40
+ //# sourceMappingURL=option-DoH4NEmh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"option-C5egpChO.js","sources":["../src/option/option.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nexport type SchmancyOptionChangeEvent = CustomEvent<{\n\tvalue: string\n\tlabel: string\n}>\n@customElement('schmancy-option')\nexport default class SchmancyOption extends TailwindElement() {\n\t@property({ type: String, reflect: true }) value: string = ''\n\t@property({ type: String, reflect: true }) label: string | undefined\n\t@property({ type: Boolean }) selected: boolean = false\n\n\thandleOptionClick(option: string) {\n\t\tthis.value = option\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('click', {\n\t\t\t\tdetail: { value: option, label: this.label ?? this.innerText },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}) as SchmancyOptionChangeEvent,\n\t\t)\n\t}\n\n\tprotected render(): unknown {\n\t\tconst classes = {\n\t\t\t'font-semibold relative cursor-pointer py-2 px-3': true,\n\t\t\t'bg-secondary-container text-secondery-onContainer': this.selected,\n\t\t}\n\t\tconst stateLayerClasses = {\n\t\t\t'duration-500 transition-opacity': true,\n\t\t\t'hover:bg-surface-on opacity-[0.08] cursor-pointer absolute inset-0': true,\n\t\t}\n\n\t\treturn html` <li\n\t\t\ttabindex=\"0\"\n\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\trole=\"option\"\n\t\t\t@click=${e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.handleOptionClick(this.value)\n\t\t\t}}\n\t\t\t@keydown=${e => {\n\t\t\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\tthis.handleOptionClick(this.value)\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div class=\"${this.classMap(stateLayerClasses)}\"></div>\n\t\t\t<schmancy-flex align=\"center\" justify=\"between\">\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"support\"></slot>\n\t\t\t</schmancy-flex>\n\t\t</li>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-option': SchmancyOption\n\t}\n}\n"],"names":["SchmancyOption","TailwindElement","super","arguments","this","value","selected","option","dispatchEvent","CustomEvent","detail","label","innerText","bubbles","composed","classes","html","classMap","e","stopPropagation","preventDefault","handleOptionClick","key","__decorateClass","property","type","String","reflect","prototype","Boolean","customElement"],"mappings":";;;;;;;;;;AAQA,IAAqBA,IAArB,cAA4CC,EAA5C,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAC4DC,GAAAA,KAAAC,QAAA,IAEVD,KAAAE,WAAA;AAAA,EAAA;AAAA,EAEjD,kBAAkBC,GAAAA;AACjBH,SAAKC,QAAQE,GACRH,KAAAI,cACJ,IAAIC,YAAY,SAAS,EACxBC,QAAQ,EAAEL,OAAOE,GAAQI,OAAOP,KAAKO,SAASP,KAAKQ,UACnDC,GAAAA,SAAAA,IACAC,UAAAA;EAEF;AAAA,EAGS,SACT;AAAA,UAAMC,IAAU,EACf,mDAAmD,IACnD,qDAAqDX,KAAKE,SAOpD;AAAA,WAAAU;AAAAA;AAAAA,YAEGZ,KAAKa,SAASF,CAAAA,CAAAA;AAAAA;AAAAA,YAETG,CAAAA,MAAAA;AACbA,MAAAA,EAAEC,gBACFD,GAAAA,EAAEE,kBACGhB,KAAAiB,kBAAkBjB,KAAKC,KAAK;AAAA,IAAA,CAAA;AAAA,cAElBa,CAAAA,MAAAA;AACD,MAAVA,EAAEI,QAAQ,WAAWJ,EAAEI,QAAQ,QAClCJ,EAAEC,gBAAAA,GACFD,EAAEE,eAAAA,GACGhB,KAAAiB,kBAAkBjB,KAAKC,KAAK;AAAA,IAAA,CAAA;AAAA;AAAA,iBAIrBD,KAAKa,SAtBM,EACzB,mCAAmC,IACnC,sEAAsE,GAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBxB;AAAA;AA1CLM,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAS,GAAA,CAAA,CAAA,GADf3B,EACuB4B,WAAA,SAAA,CACAL,GAAAA,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAAA,GAFN3B,CAAAA,CAAAA,GAAAA,EAEuB4B,WAAA,SAAA,CAAA,GACdL,EAAA,CAA5BC,EAAS,EAAEC,MAAMI,QAHE7B,CAAAA,CAAAA,GAAAA,EAGS4B,WAAA,YAAA,CAAA,GAHT5B,IAArBuB,EAAA,CADCO,EAAc,iBACM9B,CAAAA,GAAAA,CAAAA;"}
1
+ {"version":3,"file":"option-DoH4NEmh.js","sources":["../src/option/option.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nexport type SchmancyOptionChangeEvent = CustomEvent<{\n\tvalue: string\n\tlabel: string\n}>\n@customElement('schmancy-option')\nexport default class SchmancyOption extends TailwindElement() {\n\t@property({ type: String, reflect: true }) value: string = ''\n\t@property({ type: String, reflect: true }) label: string | undefined\n\t@property({ type: Boolean }) selected: boolean = false\n\n\thandleOptionClick(option: string) {\n\t\tthis.value = option\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('click', {\n\t\t\t\tdetail: { value: option, label: this.label ?? this.innerText },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}) as SchmancyOptionChangeEvent,\n\t\t)\n\t}\n\n\tprotected render(): unknown {\n\t\tconst classes = {\n\t\t\t'font-semibold relative cursor-pointer py-2 px-3': true,\n\t\t\t'bg-secondary-container text-secondery-onContainer': this.selected,\n\t\t}\n\t\tconst stateLayerClasses = {\n\t\t\t'duration-500 transition-opacity': true,\n\t\t\t'hover:bg-surface-on opacity-[0.08] cursor-pointer absolute inset-0': true,\n\t\t}\n\n\t\treturn html` <li\n\t\t\ttabindex=\"0\"\n\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\trole=\"option\"\n\t\t\t@click=${e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.handleOptionClick(this.value)\n\t\t\t}}\n\t\t\t@keydown=${e => {\n\t\t\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\tthis.handleOptionClick(this.value)\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div class=\"${this.classMap(stateLayerClasses)}\"></div>\n\t\t\t<schmancy-flex align=\"center\" justify=\"between\">\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"support\"></slot>\n\t\t\t</schmancy-flex>\n\t\t</li>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-option': SchmancyOption\n\t}\n}\n"],"names":["SchmancyOption","TailwindElement","super","arguments","this","value","selected","option","dispatchEvent","CustomEvent","detail","label","innerText","bubbles","composed","classes","html","classMap","e","stopPropagation","preventDefault","handleOptionClick","key","__decorateClass","property","type","String","reflect","prototype","Boolean","customElement"],"mappings":";;;;;;;;;;AAQA,IAAqBA,IAArB,cAA4CC,EAA5C,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAC4DC,GAAAA,KAAAC,QAAA,IAEVD,KAAAE,WAAA;AAAA,EAAA;AAAA,EAEjD,kBAAkBC,GAAAA;AACjBH,SAAKC,QAAQE,GACRH,KAAAI,cACJ,IAAIC,YAAY,SAAS,EACxBC,QAAQ,EAAEL,OAAOE,GAAQI,OAAOP,KAAKO,SAASP,KAAKQ,UACnDC,GAAAA,SAAAA,IACAC,UAAAA;EAEF;AAAA,EAGS,SACT;AAAA,UAAMC,IAAU,EACf,mDAAmD,IACnD,qDAAqDX,KAAKE,SAOpD;AAAA,WAAAU;AAAAA;AAAAA,YAEGZ,KAAKa,SAASF,CAAAA,CAAAA;AAAAA;AAAAA,YAETG,CAAAA,MAAAA;AACbA,MAAAA,EAAEC,gBACFD,GAAAA,EAAEE,kBACGhB,KAAAiB,kBAAkBjB,KAAKC,KAAK;AAAA,IAAA,CAAA;AAAA,cAElBa,CAAAA,MAAAA;AACD,MAAVA,EAAEI,QAAQ,WAAWJ,EAAEI,QAAQ,QAClCJ,EAAEC,gBAAAA,GACFD,EAAEE,eAAAA,GACGhB,KAAAiB,kBAAkBjB,KAAKC,KAAK;AAAA,IAAA,CAAA;AAAA;AAAA,iBAIrBD,KAAKa,SAtBM,EACzB,mCAAmC,IACnC,sEAAsE,GAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBxB;AAAA;AA1CLM,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAS,GAAA,CAAA,CAAA,GADf3B,EACuB4B,WAAA,SAAA,CACAL,GAAAA,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAAA,GAFN3B,CAAAA,CAAAA,GAAAA,EAEuB4B,WAAA,SAAA,CAAA,GACdL,EAAA,CAA5BC,EAAS,EAAEC,MAAMI,QAHE7B,CAAAA,CAAAA,GAAAA,EAGS4B,WAAA,YAAA,CAAA,GAHT5B,IAArBuB,EAAA,CADCO,EAAc,iBACM9B,CAAAA,GAAAA,CAAAA;"}
package/dist/option.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";require("./option-Bzi4aanD.cjs");
1
+ "use strict";require("./option-CI-vjChb.cjs");
2
2
  //# sourceMappingURL=option.cjs.map
package/dist/option.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./option-C5egpChO.js";
1
+ import "./option-DoH4NEmh.js";
2
2
  //# sourceMappingURL=option.js.map
@@ -1,4 +1,4 @@
1
- "use strict";const l=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const f=require("./tailwind.mixin-BXsGUMQ1.cjs"),d=require("lit"),u=require("lit/decorators.js");function a(n,e){const t=document.createElement("schmancy-notification");return t.setAttribute("type",e),t.innerHTML=n,t}const o=new l.Subject,p={success:(n,e)=>{const t=a(n,"success");return o.next({component:t,config:e}),t},error:(n,e)=>{const t=a(n,"error");return o.next({component:t,config:e}),t},warning:(n,e)=>{const t=a(n,"warning");return o.next({component:t,config:e}),t},info:(n,e)=>{const t=a(n,"info");return o.next({component:t,config:e}),t}};o.pipe(l.buffer(o.pipe(l.debounceTime(1e3)))).subscribe(n=>{if(n.length>1){const e=n[n.length-1];o.next({component:e.component,config:e.config})}}),o.subscribe(({component:n,config:e})=>{var t;(t=document.body)==null||t.appendChild(n),l.race(l.fromEvent(n,"close"),l.timer((e==null?void 0:e.duration)??3e3)).subscribe(()=>{n.remove()})});var h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,m=(n,e,t,r)=>{for(var s,i=r>1?void 0:r?v(e,t):e,c=n.length-1;c>=0;c--)(s=n[c])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&h(e,t,i),i};exports.SchmancyNotification=class extends f.TailwindElement(){constructor(){super(...arguments),this.type="success"}render(){return d.html`
1
+ "use strict";const l=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const f=require("./tailwind.mixin-DXloUbDW.cjs"),d=require("lit"),u=require("lit/decorators.js");function a(n,e){const t=document.createElement("schmancy-notification");return t.setAttribute("type",e),t.innerHTML=n,t}const o=new l.Subject,p={success:(n,e)=>{const t=a(n,"success");return o.next({component:t,config:e}),t},error:(n,e)=>{const t=a(n,"error");return o.next({component:t,config:e}),t},warning:(n,e)=>{const t=a(n,"warning");return o.next({component:t,config:e}),t},info:(n,e)=>{const t=a(n,"info");return o.next({component:t,config:e}),t}};o.pipe(l.buffer(o.pipe(l.debounceTime(1e3)))).subscribe(n=>{if(n.length>1){const e=n[n.length-1];o.next({component:e.component,config:e.config})}}),o.subscribe(({component:n,config:e})=>{var t;(t=document.body)==null||t.appendChild(n),l.race(l.fromEvent(n,"close"),l.timer((e==null?void 0:e.duration)??3e3)).subscribe(()=>{n.remove()})});var h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,m=(n,e,t,r)=>{for(var s,i=r>1?void 0:r?v(e,t):e,c=n.length-1;c>=0;c--)(s=n[c])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&h(e,t,i),i};exports.SchmancyNotification=class extends f.TailwindElement(){constructor(){super(...arguments),this.type="success"}render(){return d.html`
2
2
  <div
3
3
  aria-live="assertive"
4
4
  class="pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6"
@@ -63,4 +63,4 @@
63
63
  </div>
64
64
  </div>
65
65
  `}},m([u.property({type:String})],exports.SchmancyNotification.prototype,"type",2),exports.SchmancyNotification=m([u.customElement("schmancy-notification")],exports.SchmancyNotification);var g=Object.defineProperty,y=Object.getOwnPropertyDescriptor;exports.SchmancyNotificationOutlet=class extends f.TailwindElement(){render(){return d.html` <slot></slot> `}},exports.SchmancyNotificationOutlet=((n,e,t,r)=>{for(var s,i=r>1?void 0:r?y(e,t):e,c=n.length-1;c>=0;c--)(s=n[c])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&g(e,t,i),i})([u.customElement("schmancy-notification-outlet")],exports.SchmancyNotificationOutlet),exports.$notify=p;
66
- //# sourceMappingURL=outlet-CQ6YXEen.cjs.map
66
+ //# sourceMappingURL=outlet-BJ525TFe.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"outlet-CQ6YXEen.cjs","sources":["../src/notification/$notification.ts","../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { Subject, buffer, debounceTime, fromEvent, race, timer } from 'rxjs'\nimport { SchmancyNotification } from './notification'\n\nexport type TNotification = 'success' | 'error' | 'warning' | 'info'\nexport type TNotificationConfig = {\n action?: typeof Function\n duration?: number\n}\n\nfunction createNotificationComponent(message, type) {\n const notificationComponent = document.createElement('schmancy-notification')\n notificationComponent.setAttribute('type', type)\n notificationComponent.innerHTML = message\n return notificationComponent\n}\nconst $notifications = new Subject<{\n component: SchmancyNotification\n config?: TNotificationConfig\n}>()\nexport const $notify = {\n success: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'success')\n $notifications.next({ component, config })\n return component\n },\n error: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'error')\n $notifications.next({ component, config })\n return component\n },\n warning: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'warning')\n $notifications.next({ component, config })\n return component\n },\n info: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'info')\n $notifications.next({ component, config })\n return component\n }\n}\n\n$notifications.pipe(buffer($notifications.pipe(debounceTime(1000)))).subscribe((notifications) => {\n if (notifications.length > 1) {\n const notification = notifications[notifications.length - 1]\n $notifications.next({ component: notification.component, config: notification.config })\n }\n})\n$notifications.subscribe(({ component, config }) => {\n document.body?.appendChild(component)\n race(fromEvent(component, 'close'), timer(config?.duration ?? 3000)).subscribe(() => {\n component.remove()\n })\n})\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\taria-live=\"assertive\"\n\t\t\t\tclass=\"pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n\t\t\t>\n\t\t\t\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"p-2\">\n\t\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t\t<div class=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t${this.type === 'success'\n\t\t\t\t\t\t\t\t\t\t? html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-green-400\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`\n\t\t\t\t\t\t\t\t\t\t: html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-red-600\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t\t\t<p class=\" text-sm text-gray-500\">\n\t\t\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-4 flex shrink-0\">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass=\"inline-flex rounded-md bg-white text-gray-400 hover:text-gray-900 hover:bg-gray-100 hover:rounded-full p-2 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2\"\n\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t\t\t<svg class=\"h-5 w-5\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["createNotificationComponent","message","type","notificationComponent","document","createElement","setAttribute","innerHTML","$notifications","Subject","$notify","success","config","component","next","error","warning","info","pipe","buffer","debounceTime","subscribe","notifications","length","notification","body","appendChild","race","fromEvent","timer","duration","remove","SchmancyNotification","TailwindElement","constructor","super","arguments","this","render","html","dispatchEvent","CustomEvent","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":"oNASA,SAASA,EAA4BC,EAASC,EAAAA,CACtC,MAAAC,EAAwBC,SAASC,cAAc,uBAG9C,EAAA,OAFeF,EAAAG,aAAa,OAAQJ,CAC3CC,EAAAA,EAAsBI,UAAYN,EAC3BE,CACT,CACA,MAAMK,EAAiB,IAAIC,EAAAA,QAIdC,EAAU,CACrBC,QAAS,CAACV,EAAiBW,IACnB,CAAA,MAAAC,EAAYb,EAA4BC,EAAS,SAAA,EAEhD,OADPO,EAAeM,KAAK,CAAED,UAAWD,EAAAA,OAAAA,CAAAA,CAAAA,EAC1BC,CAAA,EAETE,MAAO,CAACd,EAAiBW,IACjB,CAAA,MAAAC,EAAYb,EAA4BC,EAAS,OAAA,EAEhD,OADPO,EAAeM,KAAK,CAAED,YAAWD,OAC1BC,CAAAA,CAAAA,EAAAA,CAAA,EAETG,QAAS,CAACf,EAAiBW,IACnB,CAAA,MAAAC,EAAYb,EAA4BC,EAAS,SAAA,EAEhD,OADPO,EAAeM,KAAK,CAAED,UAAAA,EAAWD,OAC1BC,CAAAA,CAAAA,EAAAA,CAAA,EAETI,KAAM,CAAChB,EAAiBW,IAChB,CAAA,MAAAC,EAAYb,EAA4BC,EAAS,MAAA,EAEhD,OADPO,EAAeM,KAAK,CAAED,UAAWD,EAAAA,OAAAA,CAAAA,CAAAA,EAC1BC,CAAA,CAAA,EAIXL,EAAeU,KAAKC,EAAAA,OAAOX,EAAeU,KAAKE,EAAAA,aAAa,QAASC,UAAWC,GAAAA,CAC1E,GAAAA,EAAcC,OAAS,EAAG,CAC5B,MAAMC,EAAeF,EAAcA,EAAcC,OAAS,CAC3Cf,EAAAA,EAAAM,KAAK,CAAED,UAAWW,EAAaX,UAAWD,OAAQY,EAAaZ,MAAQ,CAAA,CAAA,CAAA,CAAA,EAG1FJ,EAAea,UAAU,CAAGR,CAAAA,UAAAA,EAAWD,OAC5BR,CAAAA,IAAAA,QAAAA,EAAAA,SAAAqB,OAAArB,MAAAA,EAAMsB,YAAYb,GACtBc,EAAAA,KAAAC,EAAAA,UAAUf,EAAW,OAAA,EAAUgB,EAAAA,OAAMjB,GAAAA,YAAAA,EAAQkB,WAAY,GAAOT,CAAAA,EAAAA,UAAU,IAC7ER,CAAAA,EAAUkB,OAAO,CAAA,CAAA,CAClB,mMChDUC,QAAAA,qBAAN,cAAmCC,EAAAA,gBAAAA,CAAAA,CAAnC,aAAAC,CAAAC,MAAAC,GAAAA,SAAAA,EAE2CC,KAAAnC,KAAA,SAAA,CAEjD,QAAAoC,CACQ,OAAAC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,WAYEF,KAAKnC,OAAS,UACbqC;;;;;;;;;;;;;mBAcAA,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;;;;;;;;;;;mBAwBO,IAAA,CACRF,KAAKG,cAAc,IAAIC,YAAY,OAAQ,CAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAC3C,CAxDVC,EAAAA,EAAA,CADCC,WAAS,CAAEzC,KAAM0C,MAAAA,CAAAA,CAAAA,EADNZ,6BAEZa,UAAA,OAAA,CAFYb,EAAAA,QAANA,qBAAAU,EAAA,CADNI,EAAAA,cAAc,uBAAA,CAAA,EACFd,4FCCAe,QAAAA,2BAAN,cAAyCd,EAAAA,gBAC/C,CAAA,CAAA,SACQ,OAAAM,EAAAA,qBAAA,CAAA,EAFIQ,QAANA,6JAAA,CADND,EAAAA,cAAc,8BACFC,CAAAA,EAAAA"}
1
+ {"version":3,"file":"outlet-BJ525TFe.cjs","sources":["../src/notification/$notification.ts","../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { Subject, buffer, debounceTime, fromEvent, race, timer } from 'rxjs'\nimport { SchmancyNotification } from './notification'\n\nexport type TNotification = 'success' | 'error' | 'warning' | 'info'\nexport type TNotificationConfig = {\n action?: typeof Function\n duration?: number\n}\n\nfunction createNotificationComponent(message, type) {\n const notificationComponent = document.createElement('schmancy-notification')\n notificationComponent.setAttribute('type', type)\n notificationComponent.innerHTML = message\n return notificationComponent\n}\nconst $notifications = new Subject<{\n component: SchmancyNotification\n config?: TNotificationConfig\n}>()\nexport const $notify = {\n success: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'success')\n $notifications.next({ component, config })\n return component\n },\n error: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'error')\n $notifications.next({ component, config })\n return component\n },\n warning: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'warning')\n $notifications.next({ component, config })\n return component\n },\n info: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'info')\n $notifications.next({ component, config })\n return component\n }\n}\n\n$notifications.pipe(buffer($notifications.pipe(debounceTime(1000)))).subscribe((notifications) => {\n if (notifications.length > 1) {\n const notification = notifications[notifications.length - 1]\n $notifications.next({ component: notification.component, config: notification.config })\n }\n})\n$notifications.subscribe(({ component, config }) => {\n document.body?.appendChild(component)\n race(fromEvent(component, 'close'), timer(config?.duration ?? 3000)).subscribe(() => {\n component.remove()\n })\n})\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\taria-live=\"assertive\"\n\t\t\t\tclass=\"pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n\t\t\t>\n\t\t\t\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"p-2\">\n\t\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t\t<div class=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t${this.type === 'success'\n\t\t\t\t\t\t\t\t\t\t? html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-green-400\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`\n\t\t\t\t\t\t\t\t\t\t: html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-red-600\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t\t\t<p class=\" text-sm text-gray-500\">\n\t\t\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-4 flex shrink-0\">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass=\"inline-flex rounded-md bg-white text-gray-400 hover:text-gray-900 hover:bg-gray-100 hover:rounded-full p-2 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2\"\n\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t\t\t<svg class=\"h-5 w-5\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["createNotificationComponent","message","type","notificationComponent","document","createElement","setAttribute","innerHTML","$notifications","Subject","$notify","success","config","component","next","error","warning","info","pipe","buffer","debounceTime","subscribe","notifications","length","notification","body","appendChild","race","fromEvent","timer","duration","remove","SchmancyNotification","TailwindElement","constructor","super","arguments","this","render","html","dispatchEvent","CustomEvent","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":"oNASA,SAASA,EAA4BC,EAASC,EAAAA,CACtC,MAAAC,EAAwBC,SAASC,cAAc,uBAG9C,EAAA,OAFeF,EAAAG,aAAa,OAAQJ,CAC3CC,EAAAA,EAAsBI,UAAYN,EAC3BE,CACT,CACA,MAAMK,EAAiB,IAAIC,EAAAA,QAIdC,EAAU,CACrBC,QAAS,CAACV,EAAiBW,IACnB,CAAA,MAAAC,EAAYb,EAA4BC,EAAS,SAAA,EAEhD,OADPO,EAAeM,KAAK,CAAED,UAAWD,EAAAA,OAAAA,CAAAA,CAAAA,EAC1BC,CAAA,EAETE,MAAO,CAACd,EAAiBW,IACjB,CAAA,MAAAC,EAAYb,EAA4BC,EAAS,OAAA,EAEhD,OADPO,EAAeM,KAAK,CAAED,YAAWD,OAC1BC,CAAAA,CAAAA,EAAAA,CAAA,EAETG,QAAS,CAACf,EAAiBW,IACnB,CAAA,MAAAC,EAAYb,EAA4BC,EAAS,SAAA,EAEhD,OADPO,EAAeM,KAAK,CAAED,UAAAA,EAAWD,OAC1BC,CAAAA,CAAAA,EAAAA,CAAA,EAETI,KAAM,CAAChB,EAAiBW,IAChB,CAAA,MAAAC,EAAYb,EAA4BC,EAAS,MAAA,EAEhD,OADPO,EAAeM,KAAK,CAAED,UAAWD,EAAAA,OAAAA,CAAAA,CAAAA,EAC1BC,CAAA,CAAA,EAIXL,EAAeU,KAAKC,EAAAA,OAAOX,EAAeU,KAAKE,EAAAA,aAAa,QAASC,UAAWC,GAAAA,CAC1E,GAAAA,EAAcC,OAAS,EAAG,CAC5B,MAAMC,EAAeF,EAAcA,EAAcC,OAAS,CAC3Cf,EAAAA,EAAAM,KAAK,CAAED,UAAWW,EAAaX,UAAWD,OAAQY,EAAaZ,MAAQ,CAAA,CAAA,CAAA,CAAA,EAG1FJ,EAAea,UAAU,CAAGR,CAAAA,UAAAA,EAAWD,OAC5BR,CAAAA,IAAAA,QAAAA,EAAAA,SAAAqB,OAAArB,MAAAA,EAAMsB,YAAYb,GACtBc,EAAAA,KAAAC,EAAAA,UAAUf,EAAW,OAAA,EAAUgB,EAAAA,OAAMjB,GAAAA,YAAAA,EAAQkB,WAAY,GAAOT,CAAAA,EAAAA,UAAU,IAC7ER,CAAAA,EAAUkB,OAAO,CAAA,CAAA,CAClB,mMChDUC,QAAAA,qBAAN,cAAmCC,EAAAA,gBAAAA,CAAAA,CAAnC,aAAAC,CAAAC,MAAAC,GAAAA,SAAAA,EAE2CC,KAAAnC,KAAA,SAAA,CAEjD,QAAAoC,CACQ,OAAAC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,WAYEF,KAAKnC,OAAS,UACbqC;;;;;;;;;;;;;mBAcAA,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;;;;;;;;;;;mBAwBO,IAAA,CACRF,KAAKG,cAAc,IAAIC,YAAY,OAAQ,CAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAC3C,CAxDVC,EAAAA,EAAA,CADCC,WAAS,CAAEzC,KAAM0C,MAAAA,CAAAA,CAAAA,EADNZ,6BAEZa,UAAA,OAAA,CAFYb,EAAAA,QAANA,qBAAAU,EAAA,CADNI,EAAAA,cAAc,uBAAA,CAAA,EACFd,4FCCAe,QAAAA,2BAAN,cAAyCd,EAAAA,gBAC/C,CAAA,CAAA,SACQ,OAAAM,EAAAA,qBAAA,CAAA,EAFIQ,QAANA,6JAAA,CADND,EAAAA,cAAc,8BACFC,CAAAA,EAAAA"}
@@ -1,7 +1,7 @@
1
1
  import { Subject as v, buffer as g, debounceTime as h, race as x, fromEvent as y, timer as w } from "rxjs";
2
2
  import "lit/directives/class-map.js";
3
3
  import "lit/directives/style-map.js";
4
- import { T as m } from "./tailwind.mixin-DZctuRzi.js";
4
+ import { T as m } from "./tailwind.mixin-DTfnCU8A.js";
5
5
  import { html as l } from "lit";
6
6
  import { property as b, customElement as f } from "lit/decorators.js";
7
7
  function a(n, e) {
@@ -126,4 +126,4 @@ export {
126
126
  d as S,
127
127
  u as a
128
128
  };
129
- //# sourceMappingURL=outlet-CXxpQ37y.js.map
129
+ //# sourceMappingURL=outlet-ENTF9Aj-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"outlet-CXxpQ37y.js","sources":["../src/notification/$notification.ts","../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { Subject, buffer, debounceTime, fromEvent, race, timer } from 'rxjs'\nimport { SchmancyNotification } from './notification'\n\nexport type TNotification = 'success' | 'error' | 'warning' | 'info'\nexport type TNotificationConfig = {\n action?: typeof Function\n duration?: number\n}\n\nfunction createNotificationComponent(message, type) {\n const notificationComponent = document.createElement('schmancy-notification')\n notificationComponent.setAttribute('type', type)\n notificationComponent.innerHTML = message\n return notificationComponent\n}\nconst $notifications = new Subject<{\n component: SchmancyNotification\n config?: TNotificationConfig\n}>()\nexport const $notify = {\n success: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'success')\n $notifications.next({ component, config })\n return component\n },\n error: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'error')\n $notifications.next({ component, config })\n return component\n },\n warning: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'warning')\n $notifications.next({ component, config })\n return component\n },\n info: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'info')\n $notifications.next({ component, config })\n return component\n }\n}\n\n$notifications.pipe(buffer($notifications.pipe(debounceTime(1000)))).subscribe((notifications) => {\n if (notifications.length > 1) {\n const notification = notifications[notifications.length - 1]\n $notifications.next({ component: notification.component, config: notification.config })\n }\n})\n$notifications.subscribe(({ component, config }) => {\n document.body?.appendChild(component)\n race(fromEvent(component, 'close'), timer(config?.duration ?? 3000)).subscribe(() => {\n component.remove()\n })\n})\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\taria-live=\"assertive\"\n\t\t\t\tclass=\"pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n\t\t\t>\n\t\t\t\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"p-2\">\n\t\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t\t<div class=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t${this.type === 'success'\n\t\t\t\t\t\t\t\t\t\t? html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-green-400\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`\n\t\t\t\t\t\t\t\t\t\t: html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-red-600\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t\t\t<p class=\" text-sm text-gray-500\">\n\t\t\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-4 flex shrink-0\">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass=\"inline-flex rounded-md bg-white text-gray-400 hover:text-gray-900 hover:bg-gray-100 hover:rounded-full p-2 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2\"\n\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t\t\t<svg class=\"h-5 w-5\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["createNotificationComponent","message","type","notificationComponent","document","createElement","setAttribute","innerHTML","$notifications","Subject","$notify","success","config","component","next","error","warning","info","pipe","buffer","debounceTime","subscribe","notifications","length","notification","body","appendChild","race","fromEvent","timer","duration","remove","SchmancyNotification","TailwindElement","super","arguments","this","html","dispatchEvent","CustomEvent","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":";;;;;;AASA,SAASA,EAA4BC,GAASC,GAAAA;AACtC,QAAAC,IAAwBC,SAASC,cAAc,uBAG9C;AAAA,SAFeF,EAAAG,aAAa,QAAQJ,CAC3CC,GAAAA,EAAsBI,YAAYN,GAC3BE;AACT;AACA,MAAMK,IAAiB,IAAIC,KAIdC,IAAU,EACrBC,SAAS,CAACV,GAAiBW,MAAAA;AACnB,QAAAC,IAAYb,EAA4BC,GAAS,SAEhD;AAAA,SADPO,EAAeM,KAAK,EAAED,WAAAA,GAAWD,QAC1BC,EAAAA,CAAAA,GAAAA;AAAA,GAETE,OAAO,CAACd,GAAiBW,MAAAA;AACjB,QAAAC,IAAYb,EAA4BC,GAAS,OAAA;AAEhD,SADPO,EAAeM,KAAK,EAAED,cAAWD,QAC1BC,EAAAA,CAAAA,GAAAA;AAAA,GAETG,SAAS,CAACf,GAAiBW,MACnB;AAAA,QAAAC,IAAYb,EAA4BC,GAAS,SAAA;AAEhD,SADPO,EAAeM,KAAK,EAAED,WAAAA,GAAWD,QAC1BC,EAAAA,CAAAA,GAAAA;AAAA,GAETI,MAAM,CAAChB,GAAiBW,MAAAA;AAChB,QAAAC,IAAYb,EAA4BC,GAAS;AAEhD,SADPO,EAAeM,KAAK,EAAED,WAAWD,GAAAA,QAAAA,EAAAA,CAAAA,GAC1BC;AAAA,EAAA;AAIXL,EAAeU,KAAKC,EAAOX,EAAeU,KAAKE,EAAa,QAASC,UAAWC,CAAAA,MAAAA;AAC1E,MAAAA,EAAcC,SAAS,GAAG;AAC5B,UAAMC,IAAeF,EAAcA,EAAcC,SAAS,CAAA;AAC3Cf,IAAAA,EAAAM,KAAK,EAAED,WAAWW,EAAaX,WAAWD,QAAQY,EAAaZ,OAAAA,CAAAA;AAAAA,EAAQ;AAG1FJ,CAAAA,GAAAA,EAAea,UAAU,CAAA,EAAGR,WAAWD,GAAAA,QAAAA,EAAAA,MAAAA;;AAC5BR,GAAAA,IAAAA,SAAAqB,SAAArB,QAAAA,EAAMsB,YAAYb,IACtBc,EAAAC,EAAUf,GAAW,UAAUgB,GAAMjB,KAAAA,gBAAAA,EAAQkB,aAAY,GAAA,CAAA,EAAOT,UAAU,MAAA;AAC7ER,IAAAA,EAAUkB,OAAO;AAAA,EAAA,CAAA;AAClB;;;;;AChDU,IAAAC,IAAN,cAAmCC,EAAnC,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAE2CC,GAAAA,KAAAlC,OAAA;AAAA,EAAA;AAAA,EAEjD,SACQ;AAAA,WAAAmC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,WAYED,KAAKlC,SAAS,YACbmC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,qBAcAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;;;;;;;;;;;mBAwBO,MAAA;AACRD,WAAKE,cAAc,IAAIC,YAAY,OAAQ,CAAA;AAAA,IAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAC3C;AAAA;AAxDVC,EAAA,CADCC,EAAS,EAAEvC,MAAMwC,OAAAA,CAAAA,CAAAA,GADNV,EAEZW,WAAA,QAAA,CAFYX,GAAAA,IAANQ,EAAA,CADNI,EAAc,2BACFZ;;ACCA,IAAAa,IAAN,cAAyCZ,EAC/C,EAAA;AAAA,EAAA;AACQ,WAAAI;AAAAA,EAAA;AAAA;AAFIQ;;;GAAN,CADND,EAAc,8BACFC,CAAAA,GAAAA,CAAAA;"}
1
+ {"version":3,"file":"outlet-ENTF9Aj-.js","sources":["../src/notification/$notification.ts","../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { Subject, buffer, debounceTime, fromEvent, race, timer } from 'rxjs'\nimport { SchmancyNotification } from './notification'\n\nexport type TNotification = 'success' | 'error' | 'warning' | 'info'\nexport type TNotificationConfig = {\n action?: typeof Function\n duration?: number\n}\n\nfunction createNotificationComponent(message, type) {\n const notificationComponent = document.createElement('schmancy-notification')\n notificationComponent.setAttribute('type', type)\n notificationComponent.innerHTML = message\n return notificationComponent\n}\nconst $notifications = new Subject<{\n component: SchmancyNotification\n config?: TNotificationConfig\n}>()\nexport const $notify = {\n success: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'success')\n $notifications.next({ component, config })\n return component\n },\n error: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'error')\n $notifications.next({ component, config })\n return component\n },\n warning: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'warning')\n $notifications.next({ component, config })\n return component\n },\n info: (message: string, config?: TNotificationConfig) => {\n const component = createNotificationComponent(message, 'info')\n $notifications.next({ component, config })\n return component\n }\n}\n\n$notifications.pipe(buffer($notifications.pipe(debounceTime(1000)))).subscribe((notifications) => {\n if (notifications.length > 1) {\n const notification = notifications[notifications.length - 1]\n $notifications.next({ component: notification.component, config: notification.config })\n }\n})\n$notifications.subscribe(({ component, config }) => {\n document.body?.appendChild(component)\n race(fromEvent(component, 'close'), timer(config?.duration ?? 3000)).subscribe(() => {\n component.remove()\n })\n})\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\taria-live=\"assertive\"\n\t\t\t\tclass=\"pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n\t\t\t>\n\t\t\t\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"p-2\">\n\t\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t\t<div class=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t${this.type === 'success'\n\t\t\t\t\t\t\t\t\t\t? html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-green-400\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`\n\t\t\t\t\t\t\t\t\t\t: html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-red-600\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t\t\t<p class=\" text-sm text-gray-500\">\n\t\t\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-4 flex shrink-0\">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass=\"inline-flex rounded-md bg-white text-gray-400 hover:text-gray-900 hover:bg-gray-100 hover:rounded-full p-2 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2\"\n\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t\t\t<svg class=\"h-5 w-5\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["createNotificationComponent","message","type","notificationComponent","document","createElement","setAttribute","innerHTML","$notifications","Subject","$notify","success","config","component","next","error","warning","info","pipe","buffer","debounceTime","subscribe","notifications","length","notification","body","appendChild","race","fromEvent","timer","duration","remove","SchmancyNotification","TailwindElement","super","arguments","this","html","dispatchEvent","CustomEvent","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":";;;;;;AASA,SAASA,EAA4BC,GAASC,GAAAA;AACtC,QAAAC,IAAwBC,SAASC,cAAc,uBAG9C;AAAA,SAFeF,EAAAG,aAAa,QAAQJ,CAC3CC,GAAAA,EAAsBI,YAAYN,GAC3BE;AACT;AACA,MAAMK,IAAiB,IAAIC,KAIdC,IAAU,EACrBC,SAAS,CAACV,GAAiBW,MAAAA;AACnB,QAAAC,IAAYb,EAA4BC,GAAS,SAEhD;AAAA,SADPO,EAAeM,KAAK,EAAED,WAAAA,GAAWD,QAC1BC,EAAAA,CAAAA,GAAAA;AAAA,GAETE,OAAO,CAACd,GAAiBW,MAAAA;AACjB,QAAAC,IAAYb,EAA4BC,GAAS,OAAA;AAEhD,SADPO,EAAeM,KAAK,EAAED,cAAWD,QAC1BC,EAAAA,CAAAA,GAAAA;AAAA,GAETG,SAAS,CAACf,GAAiBW,MACnB;AAAA,QAAAC,IAAYb,EAA4BC,GAAS,SAAA;AAEhD,SADPO,EAAeM,KAAK,EAAED,WAAAA,GAAWD,QAC1BC,EAAAA,CAAAA,GAAAA;AAAA,GAETI,MAAM,CAAChB,GAAiBW,MAAAA;AAChB,QAAAC,IAAYb,EAA4BC,GAAS;AAEhD,SADPO,EAAeM,KAAK,EAAED,WAAWD,GAAAA,QAAAA,EAAAA,CAAAA,GAC1BC;AAAA,EAAA;AAIXL,EAAeU,KAAKC,EAAOX,EAAeU,KAAKE,EAAa,QAASC,UAAWC,CAAAA,MAAAA;AAC1E,MAAAA,EAAcC,SAAS,GAAG;AAC5B,UAAMC,IAAeF,EAAcA,EAAcC,SAAS,CAAA;AAC3Cf,IAAAA,EAAAM,KAAK,EAAED,WAAWW,EAAaX,WAAWD,QAAQY,EAAaZ,OAAAA,CAAAA;AAAAA,EAAQ;AAG1FJ,CAAAA,GAAAA,EAAea,UAAU,CAAA,EAAGR,WAAWD,GAAAA,QAAAA,EAAAA,MAAAA;;AAC5BR,GAAAA,IAAAA,SAAAqB,SAAArB,QAAAA,EAAMsB,YAAYb,IACtBc,EAAAC,EAAUf,GAAW,UAAUgB,GAAMjB,KAAAA,gBAAAA,EAAQkB,aAAY,GAAA,CAAA,EAAOT,UAAU,MAAA;AAC7ER,IAAAA,EAAUkB,OAAO;AAAA,EAAA,CAAA;AAClB;;;;;AChDU,IAAAC,IAAN,cAAmCC,EAAnC,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAE2CC,GAAAA,KAAAlC,OAAA;AAAA,EAAA;AAAA,EAEjD,SACQ;AAAA,WAAAmC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,WAYED,KAAKlC,SAAS,YACbmC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,qBAcAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;;;;;;;;;;;mBAwBO,MAAA;AACRD,WAAKE,cAAc,IAAIC,YAAY,OAAQ,CAAA;AAAA,IAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAC3C;AAAA;AAxDVC,EAAA,CADCC,EAAS,EAAEvC,MAAMwC,OAAAA,CAAAA,CAAAA,GADNV,EAEZW,WAAA,QAAA,CAFYX,GAAAA,IAANQ,EAAA,CADNI,EAAc,2BACFZ;;ACCA,IAAAa,IAAN,cAAyCZ,EAC/C,EAAA;AAAA,EAAA;AACQ,WAAAI;AAAAA,EAAA;AAAA;AAFIQ;;;GAAN,CADND,EAAc,8BACFC,CAAAA,GAAAA,CAAAA;"}
@@ -1,4 +1,4 @@
1
- "use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const w=require("./litElement.mixin-T2hfvva-.cjs");require("./tailwind.mixin-BXsGUMQ1.cjs");const b=require("lit"),f=require("lit/decorators.js");var x=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},y=function(e,t,r,i,n,a,o,s,d,p){var l=this;l.numeralDecimalMark=e||".",l.numeralIntegerScale=t>0?t:0,l.numeralDecimalScale=r>=0?r:2,l.numeralThousandsGroupStyle=i||y.groupStyle.thousand,l.numeralPositiveOnly=!!n,l.stripLeadingZeroes=a!==!1,l.prefix=o||o===""?o:"",l.signBeforePrefix=!!s,l.tailPrefix=!!d,l.delimiter=p||p===""?p:",",l.delimiterRE=p?new RegExp("\\"+p,"g"):""};y.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},y.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,r,i,n,a=this,o="";switch(e=e.replace(/[A-Za-z]/g,"").replace(a.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",a.numeralPositiveOnly?"":"-").replace("M",a.numeralDecimalMark),a.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),r=e.slice(0,1)==="-"?"-":"",i=a.prefix!==void 0?a.signBeforePrefix?r+a.prefix:a.prefix+r:r,n=e,e.indexOf(a.numeralDecimalMark)>=0&&(n=(t=e.split(a.numeralDecimalMark))[0],o=a.numeralDecimalMark+t[1].slice(0,a.numeralDecimalScale)),r==="-"&&(n=n.slice(1)),a.numeralIntegerScale>0&&(n=n.slice(0,a.numeralIntegerScale)),a.numeralThousandsGroupStyle){case y.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+a.delimiter);break;case y.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+a.delimiter);break;case y.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+a.delimiter)}return a.tailPrefix?r+n.toString()+(a.numeralDecimalScale>0?o.toString():"")+a.prefix:i+n.toString()+(a.numeralDecimalScale>0?o.toString():"")}};var I=y,k=function(e,t,r){var i=this;i.date=[],i.blocks=[],i.datePattern=e,i.dateMin=t.split("-").reverse().map(function(n){return parseInt(n,10)}),i.dateMin.length===2&&i.dateMin.unshift(0),i.dateMax=r.split("-").reverse().map(function(n){return parseInt(n,10)}),i.dateMax.length===2&&i.dateMax.unshift(0),i.initBlocks()};k.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){t==="Y"?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(i,n){if(e.length>0){var a=e.slice(0,i),o=a.slice(0,1),s=e.slice(i);switch(t.datePattern[n]){case"d":a==="00"?a="01":parseInt(o,10)>3?a="0"+o:parseInt(a,10)>31&&(a="31");break;case"m":a==="00"?a="01":parseInt(o,10)>1?a="0"+o:parseInt(a,10)>12&&(a="12")}r+=a,e=s}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,i,n=this,a=n.datePattern,o=[],s=0,d=0,p=0,l=0,m=0,u=0,g=!1;return e.length===4&&a[0].toLowerCase()!=="y"&&a[1].toLowerCase()!=="y"&&(m=2-(l=a[0]==="d"?0:2),t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),o=this.getFixedDate(t,r,0)),e.length===8&&(a.forEach(function(h,C){switch(h){case"d":s=C;break;case"m":d=C;break;default:p=C}}),u=2*p,l=s<=p?2*s:2*s+2,m=d<=p?2*d:2*d+2,t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+4),10),g=e.slice(u,u+4).length===4,o=this.getFixedDate(t,r,i)),e.length!==4||a[0]!=="y"&&a[1]!=="y"||(u=2-(m=a[0]==="m"?0:2),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),g=e.slice(u,u+2).length===2,o=[0,r,i]),e.length!==6||a[0]!=="Y"&&a[1]!=="Y"||(u=2-.5*(m=a[0]==="m"?0:4),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+4),10),g=e.slice(u,u+4).length===4,o=[0,r,i]),o=n.getRangeFixedDate(o),n.date=o,o.length===0?e:a.reduce(function(h,C){switch(C){case"d":return h+(o[0]===0?"":n.addLeadingZero(o[0]));case"m":return h+(o[1]===0?"":n.addLeadingZero(o[1]));case"y":return h+(g?n.addLeadingZeroForYear(o[2],!1):"");case"Y":return h+(g?n.addLeadingZeroForYear(o[2],!0):"")}},"")},getRangeFixedDate:function(e){var t=this,r=t.datePattern,i=t.dateMin||[],n=t.dateMax||[];return!e.length||i.length<3&&n.length<3||r.find(function(a){return a.toLowerCase()==="y"})&&e[2]===0?e:n.length&&(n[2]<e[2]||n[2]===e[2]&&(n[1]<e[1]||n[1]===e[1]&&n[0]<e[0]))?n:i.length&&(i[2]>e[2]||i[2]===e[2]&&(i[1]>e[1]||i[1]===e[1]&&i[0]>e[0]))?i:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(e=Math.min(e,t===2?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}};var L=k,F=function(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()};F.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return String(this.timeFormat)==="12"?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="";e=e.replace(/[^\d]/g,"");var i=t.getTimeFormatOptions();return t.blocks.forEach(function(n,a){if(e.length>0){var o=e.slice(0,n),s=o.slice(0,1),d=e.slice(n);switch(t.timePattern[a]){case"h":parseInt(s,10)>i.maxHourFirstDigit?o="0"+s:parseInt(o,10)>i.maxHours&&(o=i.maxHours+"");break;case"m":case"s":parseInt(s,10)>i.maxMinutesFirstDigit?o="0"+s:parseInt(o,10)>i.maxMinutes&&(o=i.maxMinutes+"")}r+=o,e=d}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var t,r,i,n=this,a=n.timePattern,o=[],s=0,d=0,p=0,l=0,m=0,u=0;return e.length===6&&(a.forEach(function(g,h){switch(g){case"s":s=2*h;break;case"m":d=2*h;break;case"h":p=2*h}}),u=p,m=d,l=s,t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),o=this.getFixedTime(i,r,t)),e.length===4&&n.timePattern.indexOf("s")<0&&(a.forEach(function(g,h){switch(g){case"m":d=2*h;break;case"h":p=2*h}}),u=p,m=d,t=0,r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),o=this.getFixedTime(i,r,t)),n.time=o,o.length===0?e:a.reduce(function(g,h){switch(h){case"s":return g+n.addLeadingZero(o[2]);case"m":return g+n.addLeadingZero(o[1]);case"h":return g+n.addLeadingZero(o[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}};var V=F,P=function(e,t){var r=this;r.delimiter=t||t===""?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};P.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var r,i="",n=!1,a=0,o=(e=(e=(e=e.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(t.delimiterRE,"")).length;a<o;a++)r=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return i=(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,t.delimiter)}};var M=P,D={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(r,i){return r+i},0);return e.concat(19-t)},getInfo:function(e,t){var r=D.blocks,i=D.re;for(var n in t=!!t,i)if(i[n].test(e)){var a=r[n];return{type:n,blocks:t?this.getStrictBlocks(a):a}}return{type:"unknown",blocks:t?this.getStrictBlocks(r.general):r.general}}},E=D,T={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(r.length===0)return e.slice(-t.length)===t?t:"";var i="";return r.forEach(function(n){e.slice(-n.length)===n&&(i=n)}),i},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,i,n){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,i,n)},getPositionOffset:function(e,t,r,i,n){var a,o,s;return a=this.stripDelimiters(t.slice(0,e),i,n),o=this.stripDelimiters(r.slice(0,e),i,n),(s=a.length-o.length)!==0?s/Math.abs(s):0},stripDelimiters:function(e,t,r){var i=this;if(r.length===0){var n=t?i.getDelimiterREByDelimiter(t):"";return e.replace(n,"")}return r.forEach(function(a){a.split("").forEach(function(o){e=e.replace(i.getDelimiterREByDelimiter(o),"")})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(t,r){return t+r},0)},getPrefixStrippedValue:function(e,t,r,i,n,a,o,s,d){if(r===0)return e;if(e===t&&e!=="")return"";if(d&&e.slice(0,1)=="-"){var p=i.slice(0,1)=="-"?i.slice(1):i;return"-"+this.getPrefixStrippedValue(e.slice(1),t,r,p,n,a,o,s,d)}if(i.slice(0,r)!==t&&!s||i.slice(-r)!==t&&s)return o&&!i&&e?e:"";var l=this.stripDelimiters(i,n,a);return e.slice(0,r)===t||s?e.slice(-r)!==t&&s?l.slice(0,-r-1):s?e.slice(0,-r):e.slice(r):l.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(e.charAt(r++)==="")return-1;return r},getFormattedValue:function(e,t,r,i,n,a){var o="",s=n.length>0,d="";return r===0?e:(t.forEach(function(p,l){if(e.length>0){var m=e.slice(0,p),u=e.slice(p);d=s?n[a?l-1:l]||d:i,a?(l>0&&(o+=d),o+=m):(o+=m,m.length===p&&l<r-1&&(o+=d)),e=u}}),o)},fixPrefixCursor:function(e,t,r,i){if(e){var n=e.value,a=r||i[0]||" ";if(e.setSelectionRange&&t&&!(t.length+a.length<=n.length)){var o=2*n.length;setTimeout(function(){e.setSelectionRange(o,o)},1)}}},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch{}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){var i=e.createTextRange();i.move("character",t),i.select()}else try{e.setSelectionRange(t,t)}catch{}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}},B={assign:function(e,t){return t=t||{},(e=e||{}).creditCard=!!t.creditCard,e.creditCardStrictMode=!!t.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=t.onCreditCardTypeChanged||function(){},e.phone=!!t.phone,e.phoneRegionCode=t.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!t.time,e.timePattern=t.timePattern||["h","m","s"],e.timeFormat=t.timeFormat||"24",e.timeFormatter={},e.date=!!t.date,e.datePattern=t.datePattern||["d","m","Y"],e.dateMin=t.dateMin||"",e.dateMax=t.dateMax||"",e.dateFormatter={},e.numeral=!!t.numeral,e.numeralIntegerScale=t.numeralIntegerScale>0?t.numeralIntegerScale:0,e.numeralDecimalScale=t.numeralDecimalScale>=0?t.numeralDecimalScale:2,e.numeralDecimalMark=t.numeralDecimalMark||".",e.numeralThousandsGroupStyle=t.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!t.numeralPositiveOnly,e.stripLeadingZeroes=t.stripLeadingZeroes!==!1,e.signBeforePrefix=!!t.signBeforePrefix,e.tailPrefix=!!t.tailPrefix,e.swapHiddenInput=!!t.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!t.numericOnly,e.uppercase=!!t.uppercase,e.lowercase=!!t.lowercase,e.prefix=e.creditCard||e.date?"":t.prefix||"",e.noImmediatePrefix=!!t.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!t.rawValueTrimPrefix,e.copyDelimiter=!!t.copyDelimiter,e.initValue=t.initValue!==void 0&&t.initValue!==null?t.initValue.toString():"",e.delimiter=t.delimiter||t.delimiter===""?t.delimiter:t.date?"/":t.time?":":t.numeral?",":(t.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!t.delimiterLazyShow,e.delimiters=t.delimiters||[],e.blocks=t.blocks||[],e.blocksLength=e.blocks.length,e.root=typeof x=="object"&&x?x:window,e.document=t.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=t.onValueChanged||function(){},e}},c=function(e,t){var r=this;if(typeof e=="string"?(r.element=document.querySelector(e),document.querySelectorAll(e).length>1):e.length!==void 0&&e.length>0?(r.element=e[0],e.length>1):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");t.initValue=r.element.value,r.properties=c.DefaultProperties.assign({},t),r.init()};c.prototype={init:function(){var e=this,t=e.properties;t.numeral||t.phone||t.creditCard||t.time||t.date||t.blocksLength!==0||t.prefix?(t.maxLength=c.Util.getMaxLength(t.blocks),e.isAndroid=c.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),(t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue)):e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this;if(e.properties.swapHiddenInput){var t=e.element.cloneNode(!0);e.element.parentNode.insertBefore(t,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=t,e.element.id=""}},initNumeralFormatter:function(){var e=this.properties;e.numeral&&(e.numeralFormatter=new c.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var e=this.properties;e.time&&(e.timeFormatter=new c.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=c.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var e=this.properties;e.date&&(e.dateFormatter=new c.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=c.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var e=this.properties;if(e.phone)try{e.phoneFormatter=new c.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch{throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=r===8},onChange:function(e){var t=this,r=t.properties,i=c.Util;t.isBackward=t.isBackward||e.inputType==="deleteContentBackward";var n=i.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters);t.isBackward&&n?r.postDelimiterBackspace=n:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),c.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){c.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){c.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this.properties,r=c.Util,i=this.element.value,n="";n=t.copyDelimiter?i:r.stripDelimiters(i,t.delimiter,t.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",n):window.clipboardData.setData("Text",n),e.preventDefault()}catch{}},onInput:function(e){var t=this,r=t.properties,i=c.Util,n=i.getPostDelimiter(e,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||n||(e=i.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&e.length===0?r.result="":r.result=r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=i.stripDelimiters(e,r.delimiter,r.delimiters),e=i.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?i.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,r.blocksLength===0)?(r.result=e,void t.updateValueState()):(r.creditCard&&t.updateCreditCardPropsByValue(e),e=i.headStr(e,r.maxLength),r.result=i.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this.properties,i=c.Util;i.headStr(r.result,4)!==i.headStr(e,4)&&(t=c.CreditCardDetector.getInfo(e,r.creditCardStrictMode),r.blocks=t.blocks,r.blocksLength=r.blocks.length,r.maxLength=i.getMaxLength(r.blocks),r.creditCardType!==t.type&&(r.creditCardType=t.type,r.onCreditCardTypeChanged.call(this,r.creditCardType)))},updateValueState:function(){var e=this,t=c.Util,r=e.properties;if(e.element){var i=e.element.selectionEnd,n=e.element.value,a=r.result;i=t.getNextCursorPosition(i,n,a,r.delimiter,r.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=a,t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged()},1):(e.element.value=a,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged())}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=e!=null?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this.properties,t=c.Util,r=this.element.value;return e.rawValueTrimPrefix&&(r=t.getPrefixStrippedValue(r,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),r=e.numeral?e.numeralFormatter.getRawValue(r):t.stripDelimiters(r,e.delimiter,e.delimiters)},getISOFormatDate:function(){var e=this.properties;return e.date?e.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var e=this.properties;return e.time?e.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},c.NumeralFormatter=I,c.DateFormatter=L,c.TimeFormatter=V,c.PhoneFormatter=M,c.CreditCardDetector=E,c.Util=T,c.DefaultProperties=B,(typeof x=="object"&&x?x:window).Cleave=c;var S=c,N=Object.defineProperty,R=Object.getOwnPropertyDescriptor,v=(e,t,r,i)=>{for(var n,a=i>1?void 0:i?R(t,r):t,o=e.length-1;o>=0;o--)(n=e[o])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&N(t,r,a),a};exports.SchmancyPaymentCardForm=class extends w.$LitElement(){constructor(){super(...arguments),this.value={cardName:"",cardNumber:"",expirationDate:"",cvv:""}}firstUpdated(){new S(this.cardNumberInput,{creditCard:!0,creditCardStrictMode:!0,onCreditCardTypeChanged:e=>{e==="unknown"?this.cardNumberInput.setCustomValidity("Please enter a valid card number."):this.cardNumberInput.setCustomValidity("")}}),new S(this.expirationDateInput,{date:!0,datePattern:["m","y"],onValueChanged:e=>{!e.target.value||e.target.value.length<5?this.expirationDateInput.setCustomValidity("Please enter a valid expiration date."):this.expirationDateInput.setCustomValidity("")}}),new S(this.cvvInput,{blocks:[4],numericOnly:!0,onValueChanged:e=>{e.target.value.length<3?this.cvvInput.setCustomValidity("Please enter a valid CVV."):this.cvvInput.setCustomValidity("")}}),new S(this.cardNameInput,{uppercase:!0,delimiter:" "})}reportValidity(){return this.form.reportValidity()}checkValidity(){return!!this.form.reportValidity()}emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:{...this.value}}))}render(){return b.html` <schmancy-form
1
+ "use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const w=require("./litElement.mixin-Dr3N9KpR.cjs");require("./tailwind.mixin-DXloUbDW.cjs");const b=require("lit"),f=require("lit/decorators.js");var x=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},y=function(e,t,r,i,n,a,o,s,d,p){var l=this;l.numeralDecimalMark=e||".",l.numeralIntegerScale=t>0?t:0,l.numeralDecimalScale=r>=0?r:2,l.numeralThousandsGroupStyle=i||y.groupStyle.thousand,l.numeralPositiveOnly=!!n,l.stripLeadingZeroes=a!==!1,l.prefix=o||o===""?o:"",l.signBeforePrefix=!!s,l.tailPrefix=!!d,l.delimiter=p||p===""?p:",",l.delimiterRE=p?new RegExp("\\"+p,"g"):""};y.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},y.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,r,i,n,a=this,o="";switch(e=e.replace(/[A-Za-z]/g,"").replace(a.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",a.numeralPositiveOnly?"":"-").replace("M",a.numeralDecimalMark),a.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),r=e.slice(0,1)==="-"?"-":"",i=a.prefix!==void 0?a.signBeforePrefix?r+a.prefix:a.prefix+r:r,n=e,e.indexOf(a.numeralDecimalMark)>=0&&(n=(t=e.split(a.numeralDecimalMark))[0],o=a.numeralDecimalMark+t[1].slice(0,a.numeralDecimalScale)),r==="-"&&(n=n.slice(1)),a.numeralIntegerScale>0&&(n=n.slice(0,a.numeralIntegerScale)),a.numeralThousandsGroupStyle){case y.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+a.delimiter);break;case y.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+a.delimiter);break;case y.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+a.delimiter)}return a.tailPrefix?r+n.toString()+(a.numeralDecimalScale>0?o.toString():"")+a.prefix:i+n.toString()+(a.numeralDecimalScale>0?o.toString():"")}};var I=y,k=function(e,t,r){var i=this;i.date=[],i.blocks=[],i.datePattern=e,i.dateMin=t.split("-").reverse().map(function(n){return parseInt(n,10)}),i.dateMin.length===2&&i.dateMin.unshift(0),i.dateMax=r.split("-").reverse().map(function(n){return parseInt(n,10)}),i.dateMax.length===2&&i.dateMax.unshift(0),i.initBlocks()};k.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){t==="Y"?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(i,n){if(e.length>0){var a=e.slice(0,i),o=a.slice(0,1),s=e.slice(i);switch(t.datePattern[n]){case"d":a==="00"?a="01":parseInt(o,10)>3?a="0"+o:parseInt(a,10)>31&&(a="31");break;case"m":a==="00"?a="01":parseInt(o,10)>1?a="0"+o:parseInt(a,10)>12&&(a="12")}r+=a,e=s}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,i,n=this,a=n.datePattern,o=[],s=0,d=0,p=0,l=0,m=0,u=0,g=!1;return e.length===4&&a[0].toLowerCase()!=="y"&&a[1].toLowerCase()!=="y"&&(m=2-(l=a[0]==="d"?0:2),t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),o=this.getFixedDate(t,r,0)),e.length===8&&(a.forEach(function(h,C){switch(h){case"d":s=C;break;case"m":d=C;break;default:p=C}}),u=2*p,l=s<=p?2*s:2*s+2,m=d<=p?2*d:2*d+2,t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+4),10),g=e.slice(u,u+4).length===4,o=this.getFixedDate(t,r,i)),e.length!==4||a[0]!=="y"&&a[1]!=="y"||(u=2-(m=a[0]==="m"?0:2),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),g=e.slice(u,u+2).length===2,o=[0,r,i]),e.length!==6||a[0]!=="Y"&&a[1]!=="Y"||(u=2-.5*(m=a[0]==="m"?0:4),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+4),10),g=e.slice(u,u+4).length===4,o=[0,r,i]),o=n.getRangeFixedDate(o),n.date=o,o.length===0?e:a.reduce(function(h,C){switch(C){case"d":return h+(o[0]===0?"":n.addLeadingZero(o[0]));case"m":return h+(o[1]===0?"":n.addLeadingZero(o[1]));case"y":return h+(g?n.addLeadingZeroForYear(o[2],!1):"");case"Y":return h+(g?n.addLeadingZeroForYear(o[2],!0):"")}},"")},getRangeFixedDate:function(e){var t=this,r=t.datePattern,i=t.dateMin||[],n=t.dateMax||[];return!e.length||i.length<3&&n.length<3||r.find(function(a){return a.toLowerCase()==="y"})&&e[2]===0?e:n.length&&(n[2]<e[2]||n[2]===e[2]&&(n[1]<e[1]||n[1]===e[1]&&n[0]<e[0]))?n:i.length&&(i[2]>e[2]||i[2]===e[2]&&(i[1]>e[1]||i[1]===e[1]&&i[0]>e[0]))?i:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(e=Math.min(e,t===2?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}};var L=k,F=function(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()};F.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return String(this.timeFormat)==="12"?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="";e=e.replace(/[^\d]/g,"");var i=t.getTimeFormatOptions();return t.blocks.forEach(function(n,a){if(e.length>0){var o=e.slice(0,n),s=o.slice(0,1),d=e.slice(n);switch(t.timePattern[a]){case"h":parseInt(s,10)>i.maxHourFirstDigit?o="0"+s:parseInt(o,10)>i.maxHours&&(o=i.maxHours+"");break;case"m":case"s":parseInt(s,10)>i.maxMinutesFirstDigit?o="0"+s:parseInt(o,10)>i.maxMinutes&&(o=i.maxMinutes+"")}r+=o,e=d}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var t,r,i,n=this,a=n.timePattern,o=[],s=0,d=0,p=0,l=0,m=0,u=0;return e.length===6&&(a.forEach(function(g,h){switch(g){case"s":s=2*h;break;case"m":d=2*h;break;case"h":p=2*h}}),u=p,m=d,l=s,t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),o=this.getFixedTime(i,r,t)),e.length===4&&n.timePattern.indexOf("s")<0&&(a.forEach(function(g,h){switch(g){case"m":d=2*h;break;case"h":p=2*h}}),u=p,m=d,t=0,r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),o=this.getFixedTime(i,r,t)),n.time=o,o.length===0?e:a.reduce(function(g,h){switch(h){case"s":return g+n.addLeadingZero(o[2]);case"m":return g+n.addLeadingZero(o[1]);case"h":return g+n.addLeadingZero(o[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}};var V=F,P=function(e,t){var r=this;r.delimiter=t||t===""?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};P.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var r,i="",n=!1,a=0,o=(e=(e=(e=e.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(t.delimiterRE,"")).length;a<o;a++)r=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return i=(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,t.delimiter)}};var M=P,D={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(r,i){return r+i},0);return e.concat(19-t)},getInfo:function(e,t){var r=D.blocks,i=D.re;for(var n in t=!!t,i)if(i[n].test(e)){var a=r[n];return{type:n,blocks:t?this.getStrictBlocks(a):a}}return{type:"unknown",blocks:t?this.getStrictBlocks(r.general):r.general}}},E=D,T={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(r.length===0)return e.slice(-t.length)===t?t:"";var i="";return r.forEach(function(n){e.slice(-n.length)===n&&(i=n)}),i},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,i,n){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,i,n)},getPositionOffset:function(e,t,r,i,n){var a,o,s;return a=this.stripDelimiters(t.slice(0,e),i,n),o=this.stripDelimiters(r.slice(0,e),i,n),(s=a.length-o.length)!==0?s/Math.abs(s):0},stripDelimiters:function(e,t,r){var i=this;if(r.length===0){var n=t?i.getDelimiterREByDelimiter(t):"";return e.replace(n,"")}return r.forEach(function(a){a.split("").forEach(function(o){e=e.replace(i.getDelimiterREByDelimiter(o),"")})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(t,r){return t+r},0)},getPrefixStrippedValue:function(e,t,r,i,n,a,o,s,d){if(r===0)return e;if(e===t&&e!=="")return"";if(d&&e.slice(0,1)=="-"){var p=i.slice(0,1)=="-"?i.slice(1):i;return"-"+this.getPrefixStrippedValue(e.slice(1),t,r,p,n,a,o,s,d)}if(i.slice(0,r)!==t&&!s||i.slice(-r)!==t&&s)return o&&!i&&e?e:"";var l=this.stripDelimiters(i,n,a);return e.slice(0,r)===t||s?e.slice(-r)!==t&&s?l.slice(0,-r-1):s?e.slice(0,-r):e.slice(r):l.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(e.charAt(r++)==="")return-1;return r},getFormattedValue:function(e,t,r,i,n,a){var o="",s=n.length>0,d="";return r===0?e:(t.forEach(function(p,l){if(e.length>0){var m=e.slice(0,p),u=e.slice(p);d=s?n[a?l-1:l]||d:i,a?(l>0&&(o+=d),o+=m):(o+=m,m.length===p&&l<r-1&&(o+=d)),e=u}}),o)},fixPrefixCursor:function(e,t,r,i){if(e){var n=e.value,a=r||i[0]||" ";if(e.setSelectionRange&&t&&!(t.length+a.length<=n.length)){var o=2*n.length;setTimeout(function(){e.setSelectionRange(o,o)},1)}}},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch{}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){var i=e.createTextRange();i.move("character",t),i.select()}else try{e.setSelectionRange(t,t)}catch{}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}},B={assign:function(e,t){return t=t||{},(e=e||{}).creditCard=!!t.creditCard,e.creditCardStrictMode=!!t.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=t.onCreditCardTypeChanged||function(){},e.phone=!!t.phone,e.phoneRegionCode=t.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!t.time,e.timePattern=t.timePattern||["h","m","s"],e.timeFormat=t.timeFormat||"24",e.timeFormatter={},e.date=!!t.date,e.datePattern=t.datePattern||["d","m","Y"],e.dateMin=t.dateMin||"",e.dateMax=t.dateMax||"",e.dateFormatter={},e.numeral=!!t.numeral,e.numeralIntegerScale=t.numeralIntegerScale>0?t.numeralIntegerScale:0,e.numeralDecimalScale=t.numeralDecimalScale>=0?t.numeralDecimalScale:2,e.numeralDecimalMark=t.numeralDecimalMark||".",e.numeralThousandsGroupStyle=t.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!t.numeralPositiveOnly,e.stripLeadingZeroes=t.stripLeadingZeroes!==!1,e.signBeforePrefix=!!t.signBeforePrefix,e.tailPrefix=!!t.tailPrefix,e.swapHiddenInput=!!t.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!t.numericOnly,e.uppercase=!!t.uppercase,e.lowercase=!!t.lowercase,e.prefix=e.creditCard||e.date?"":t.prefix||"",e.noImmediatePrefix=!!t.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!t.rawValueTrimPrefix,e.copyDelimiter=!!t.copyDelimiter,e.initValue=t.initValue!==void 0&&t.initValue!==null?t.initValue.toString():"",e.delimiter=t.delimiter||t.delimiter===""?t.delimiter:t.date?"/":t.time?":":t.numeral?",":(t.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!t.delimiterLazyShow,e.delimiters=t.delimiters||[],e.blocks=t.blocks||[],e.blocksLength=e.blocks.length,e.root=typeof x=="object"&&x?x:window,e.document=t.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=t.onValueChanged||function(){},e}},c=function(e,t){var r=this;if(typeof e=="string"?(r.element=document.querySelector(e),document.querySelectorAll(e).length>1):e.length!==void 0&&e.length>0?(r.element=e[0],e.length>1):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");t.initValue=r.element.value,r.properties=c.DefaultProperties.assign({},t),r.init()};c.prototype={init:function(){var e=this,t=e.properties;t.numeral||t.phone||t.creditCard||t.time||t.date||t.blocksLength!==0||t.prefix?(t.maxLength=c.Util.getMaxLength(t.blocks),e.isAndroid=c.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),(t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue)):e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this;if(e.properties.swapHiddenInput){var t=e.element.cloneNode(!0);e.element.parentNode.insertBefore(t,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=t,e.element.id=""}},initNumeralFormatter:function(){var e=this.properties;e.numeral&&(e.numeralFormatter=new c.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var e=this.properties;e.time&&(e.timeFormatter=new c.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=c.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var e=this.properties;e.date&&(e.dateFormatter=new c.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=c.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var e=this.properties;if(e.phone)try{e.phoneFormatter=new c.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch{throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=r===8},onChange:function(e){var t=this,r=t.properties,i=c.Util;t.isBackward=t.isBackward||e.inputType==="deleteContentBackward";var n=i.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters);t.isBackward&&n?r.postDelimiterBackspace=n:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),c.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){c.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){c.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this.properties,r=c.Util,i=this.element.value,n="";n=t.copyDelimiter?i:r.stripDelimiters(i,t.delimiter,t.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",n):window.clipboardData.setData("Text",n),e.preventDefault()}catch{}},onInput:function(e){var t=this,r=t.properties,i=c.Util,n=i.getPostDelimiter(e,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||n||(e=i.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&e.length===0?r.result="":r.result=r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=i.stripDelimiters(e,r.delimiter,r.delimiters),e=i.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?i.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,r.blocksLength===0)?(r.result=e,void t.updateValueState()):(r.creditCard&&t.updateCreditCardPropsByValue(e),e=i.headStr(e,r.maxLength),r.result=i.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this.properties,i=c.Util;i.headStr(r.result,4)!==i.headStr(e,4)&&(t=c.CreditCardDetector.getInfo(e,r.creditCardStrictMode),r.blocks=t.blocks,r.blocksLength=r.blocks.length,r.maxLength=i.getMaxLength(r.blocks),r.creditCardType!==t.type&&(r.creditCardType=t.type,r.onCreditCardTypeChanged.call(this,r.creditCardType)))},updateValueState:function(){var e=this,t=c.Util,r=e.properties;if(e.element){var i=e.element.selectionEnd,n=e.element.value,a=r.result;i=t.getNextCursorPosition(i,n,a,r.delimiter,r.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=a,t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged()},1):(e.element.value=a,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged())}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=e!=null?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this.properties,t=c.Util,r=this.element.value;return e.rawValueTrimPrefix&&(r=t.getPrefixStrippedValue(r,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),r=e.numeral?e.numeralFormatter.getRawValue(r):t.stripDelimiters(r,e.delimiter,e.delimiters)},getISOFormatDate:function(){var e=this.properties;return e.date?e.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var e=this.properties;return e.time?e.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},c.NumeralFormatter=I,c.DateFormatter=L,c.TimeFormatter=V,c.PhoneFormatter=M,c.CreditCardDetector=E,c.Util=T,c.DefaultProperties=B,(typeof x=="object"&&x?x:window).Cleave=c;var S=c,N=Object.defineProperty,R=Object.getOwnPropertyDescriptor,v=(e,t,r,i)=>{for(var n,a=i>1?void 0:i?R(t,r):t,o=e.length-1;o>=0;o--)(n=e[o])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&N(t,r,a),a};exports.SchmancyPaymentCardForm=class extends w.$LitElement(){constructor(){super(...arguments),this.value={cardName:"",cardNumber:"",expirationDate:"",cvv:""}}firstUpdated(){new S(this.cardNumberInput,{creditCard:!0,creditCardStrictMode:!0,onCreditCardTypeChanged:e=>{e==="unknown"?this.cardNumberInput.setCustomValidity("Please enter a valid card number."):this.cardNumberInput.setCustomValidity("")}}),new S(this.expirationDateInput,{date:!0,datePattern:["m","y"],onValueChanged:e=>{!e.target.value||e.target.value.length<5?this.expirationDateInput.setCustomValidity("Please enter a valid expiration date."):this.expirationDateInput.setCustomValidity("")}}),new S(this.cvvInput,{blocks:[4],numericOnly:!0,onValueChanged:e=>{e.target.value.length<3?this.cvvInput.setCustomValidity("Please enter a valid CVV."):this.cvvInput.setCustomValidity("")}}),new S(this.cardNameInput,{uppercase:!0,delimiter:" "})}reportValidity(){return this.form.reportValidity()}checkValidity(){return!!this.form.reportValidity()}emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:{...this.value}}))}render(){return b.html` <schmancy-form
2
2
  @change=${e=>{e.stopPropagation(),e.preventDefault()}}
3
3
  >
4
4
  <schmancy-grid gap="sm">
@@ -45,4 +45,4 @@
45
45
  </schmancy-grid>
46
46
  </schmancy-grid>
47
47
  </schmancy-form>`}},v([f.property({type:Object,reflect:!0})],exports.SchmancyPaymentCardForm.prototype,"value",2),v([f.state()],exports.SchmancyPaymentCardForm.prototype,"cardName",2),v([f.state()],exports.SchmancyPaymentCardForm.prototype,"cardNumber",2),v([f.state()],exports.SchmancyPaymentCardForm.prototype,"expirationDate",2),v([f.state()],exports.SchmancyPaymentCardForm.prototype,"cvv",2),v([f.query("#cardNumber")],exports.SchmancyPaymentCardForm.prototype,"cardNumberInput",2),v([f.query("#expirationDate")],exports.SchmancyPaymentCardForm.prototype,"expirationDateInput",2),v([f.query("#cvv")],exports.SchmancyPaymentCardForm.prototype,"cvvInput",2),v([f.query("#cardName")],exports.SchmancyPaymentCardForm.prototype,"cardNameInput",2),v([f.query("schmancy-form")],exports.SchmancyPaymentCardForm.prototype,"form",2),exports.SchmancyPaymentCardForm=v([f.customElement("schmancy-payment-card-form")],exports.SchmancyPaymentCardForm);
48
- //# sourceMappingURL=payment-card-form-DNI4IjK7.cjs.map
48
+ //# sourceMappingURL=payment-card-form-C2PD41dx.cjs.map