monobill-mintui 0.6.644 → 0.6.646

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 (162) hide show
  1. package/bin/component-dependencies.json +6 -1
  2. package/dist/back-button.css +1 -1
  3. package/dist/button.css +1 -1
  4. package/dist/components/alert/browser.js +3 -3
  5. package/dist/components/alert/index.cjs +1 -1
  6. package/dist/components/alert/index.js +3 -3
  7. package/dist/components/back-button/BackButton.d.ts.map +1 -1
  8. package/dist/components/back-button/browser.js +2 -224
  9. package/dist/components/back-button/index.cjs +1 -1
  10. package/dist/components/back-button/index.js +2 -224
  11. package/dist/components/bottom-navigation/browser.js +2 -2
  12. package/dist/components/bottom-navigation/index.cjs +1 -1
  13. package/dist/components/bottom-navigation/index.js +2 -2
  14. package/dist/components/button/Button.d.ts +3 -1
  15. package/dist/components/button/Button.d.ts.map +1 -1
  16. package/dist/components/button/browser.js +1 -1
  17. package/dist/components/button/index.cjs +1 -1
  18. package/dist/components/button/index.js +1 -1
  19. package/dist/components/checkbox/browser.js +2 -2
  20. package/dist/components/checkbox/index.cjs +1 -1
  21. package/dist/components/checkbox/index.js +2 -2
  22. package/dist/components/chip/browser.js +1 -1
  23. package/dist/components/chip/index.cjs +1 -1
  24. package/dist/components/chip/index.js +1 -1
  25. package/dist/components/chunks/back-button-CDyPYehm.js +224 -0
  26. package/dist/components/chunks/back-button-SmmB1OdQ.js +1 -0
  27. package/dist/components/chunks/{button-hmAnS0R0.js → button-BYkzR0uX.js} +14 -11
  28. package/dist/components/chunks/button-DfY2Sr3-.js +1 -0
  29. package/dist/components/chunks/caret-down-Ccvv5gwc.js +1 -0
  30. package/dist/components/chunks/{caret-down-DpiutKeA.js → caret-down-D1Qs39Av.js} +1 -1
  31. package/dist/components/chunks/{caret-right-CDPbeTEb.js → caret-right-C83pwBin.js} +1 -1
  32. package/dist/components/chunks/caret-right-IYvGg3-k.js +1 -0
  33. package/dist/components/chunks/caret-up-CqFNwOux.js +1 -0
  34. package/dist/components/chunks/{caret-up-BgQx7BXU.js → caret-up-CsT9c_xE.js} +1 -1
  35. package/dist/components/chunks/{chip-CVJdu4J8.js → chip-CLCBimJI.js} +3 -3
  36. package/dist/components/chunks/{chip-dr93YHC5.js → chip-Dfj3x__h.js} +1 -1
  37. package/dist/components/chunks/{close-3IqD6I8C.js → close-CKPCTitk.js} +1 -1
  38. package/dist/components/chunks/close-DWvh_05O.js +1 -0
  39. package/dist/components/chunks/{confirm-action-B1uUHkvF.js → confirm-action-CjXJmqh4.js} +1 -1
  40. package/dist/components/chunks/{confirm-action-Cf0A7PG_.js → confirm-action-Et6i603N.js} +2 -2
  41. package/dist/components/chunks/icon-BwaKFl4e.js +1 -0
  42. package/dist/components/chunks/icon-CkFfk0oc.js +1 -0
  43. package/dist/components/chunks/{icon-C-eV4VGF.js → icon-D9zLlMGu.js} +224 -204
  44. package/dist/components/chunks/{icon-FUJudEjA.js → icon-DgBiEDoy.js} +6 -6
  45. package/dist/components/chunks/{input--6oYmnY6.js → input-4DeekhBC.js} +4 -4
  46. package/dist/components/chunks/{input-xoRzxNGy.js → input-CF0QIi3N.js} +1 -1
  47. package/dist/components/chunks/{modal-aRP0z0wD.js → modal-CHLB5Td7.js} +1 -1
  48. package/dist/components/chunks/{modal-CAuR_w-x.js → modal-DXviLYW_.js} +3 -3
  49. package/dist/components/chunks/search-W2xBCOsc.js +1 -0
  50. package/dist/components/chunks/{search-Bb5GNX7M.js → search-oWslgsR8.js} +1 -1
  51. package/dist/components/confirm-action/browser.js +1 -1
  52. package/dist/components/confirm-action/index.cjs +1 -1
  53. package/dist/components/confirm-action/index.js +1 -1
  54. package/dist/components/date-picker/browser.js +5 -5
  55. package/dist/components/date-picker/index.cjs +1 -1
  56. package/dist/components/date-picker/index.js +5 -5
  57. package/dist/components/dropzone/browser.js +3 -3
  58. package/dist/components/dropzone/index.cjs +1 -1
  59. package/dist/components/dropzone/index.js +3 -3
  60. package/dist/components/icon/browser.js +1 -1
  61. package/dist/components/icon/icons/collapse.d.ts +3 -0
  62. package/dist/components/icon/icons/collapse.d.ts.map +1 -0
  63. package/dist/components/icon/icons/expand.d.ts +3 -0
  64. package/dist/components/icon/icons/expand.d.ts.map +1 -0
  65. package/dist/components/icon/icons/index.d.ts +2 -0
  66. package/dist/components/icon/icons/index.d.ts.map +1 -1
  67. package/dist/components/icon/index.cjs +1 -1
  68. package/dist/components/icon/index.js +1 -1
  69. package/dist/components/input/browser.js +1 -1
  70. package/dist/components/input/index.cjs +1 -1
  71. package/dist/components/input/index.js +1 -1
  72. package/dist/components/link/browser.js +1 -1
  73. package/dist/components/link/index.cjs +1 -1
  74. package/dist/components/link/index.js +1 -1
  75. package/dist/components/modal/browser.js +1 -1
  76. package/dist/components/modal/index.cjs +1 -1
  77. package/dist/components/modal/index.js +1 -1
  78. package/dist/components/navigation/browser.js +4 -4
  79. package/dist/components/navigation/index.cjs +1 -1
  80. package/dist/components/navigation/index.js +4 -4
  81. package/dist/components/off-canvas/browser.js +3 -3
  82. package/dist/components/off-canvas/index.cjs +1 -1
  83. package/dist/components/off-canvas/index.js +3 -3
  84. package/dist/components/page/Page.d.ts.map +1 -1
  85. package/dist/components/page/browser.js +8 -3
  86. package/dist/components/page/index.cjs +41 -7
  87. package/dist/components/page/index.js +8 -3
  88. package/dist/components/popover/browser.js +1 -1
  89. package/dist/components/popover/index.cjs +1 -1
  90. package/dist/components/popover/index.js +1 -1
  91. package/dist/components/resource-table/browser.js +10 -10
  92. package/dist/components/resource-table/index.cjs +1 -1
  93. package/dist/components/resource-table/index.js +10 -10
  94. package/dist/components/search/browser.js +7 -7
  95. package/dist/components/search/index.cjs +1 -1
  96. package/dist/components/search/index.js +7 -7
  97. package/dist/components/select/browser.js +4 -4
  98. package/dist/components/select/index.cjs +1 -1
  99. package/dist/components/select/index.js +4 -4
  100. package/dist/components/side-navigation/browser.js +5 -5
  101. package/dist/components/side-navigation/index.cjs +1 -1
  102. package/dist/components/side-navigation/index.js +5 -5
  103. package/dist/components/sortable/browser.js +1 -1
  104. package/dist/components/sortable/index.cjs +1 -1
  105. package/dist/components/sortable/index.js +1 -1
  106. package/dist/components/spinner/browser.js +1 -1
  107. package/dist/components/spinner/index.cjs +1 -1
  108. package/dist/components/spinner/index.js +1 -1
  109. package/dist/components/stack/browser.js +1 -1
  110. package/dist/components/stack/index.cjs +1 -1
  111. package/dist/components/stack/index.js +1 -1
  112. package/dist/components/switch/browser.js +2 -2
  113. package/dist/components/switch/index.cjs +1 -1
  114. package/dist/components/switch/index.js +2 -2
  115. package/dist/components/table/browser.js +1 -1
  116. package/dist/components/table/index.cjs +1 -1
  117. package/dist/components/table/index.js +1 -1
  118. package/dist/components/tags/browser.js +4 -4
  119. package/dist/components/tags/index.cjs +1 -1
  120. package/dist/components/tags/index.js +4 -4
  121. package/dist/components/time-picker/browser.js +3 -3
  122. package/dist/components/time-picker/index.cjs +1 -1
  123. package/dist/components/time-picker/index.js +3 -3
  124. package/dist/components/tree/Tree.d.ts +2 -0
  125. package/dist/components/tree/Tree.d.ts.map +1 -1
  126. package/dist/components/tree/browser.js +10 -8
  127. package/dist/components/tree/index.cjs +1 -1
  128. package/dist/components/tree/index.js +10 -8
  129. package/dist/confirm-action.css +1 -1
  130. package/dist/icon.css +1 -1
  131. package/dist/icons/collapse.svg +3 -0
  132. package/dist/icons/expand.svg +3 -0
  133. package/dist/index.cjs +50 -16
  134. package/dist/index.css +9 -9
  135. package/dist/index.js +639 -614
  136. package/dist/link.css +1 -1
  137. package/dist/modal.css +1 -1
  138. package/dist/navigation-search.json +14 -0
  139. package/dist/navigation.css +1 -1
  140. package/dist/page.css +1 -1
  141. package/dist/tree.css +1 -1
  142. package/package.json +1 -1
  143. package/dist/components/chunks/button-DMoaxqbf.js +0 -1
  144. package/dist/components/chunks/caret-down-ZX0Kvdb5.js +0 -1
  145. package/dist/components/chunks/caret-right-DzhujJ3u.js +0 -1
  146. package/dist/components/chunks/caret-up-bxudEL8g.js +0 -1
  147. package/dist/components/chunks/close-CwUdQlxT.js +0 -1
  148. package/dist/components/chunks/icon-DF1kvSw1.js +0 -1
  149. package/dist/components/chunks/icon-DiWej_T-.js +0 -1
  150. package/dist/components/chunks/search-Bfjmwor1.js +0 -1
  151. /package/dist/components/chunks/{link-4LblIyiP.js → link-BsC3zT_I.js} +0 -0
  152. /package/dist/components/chunks/{link-DYbrI89a.js → link-dTjSvr4E.js} +0 -0
  153. /package/dist/components/chunks/{popover-Db9ZGHd9.js → popover-CNZ5u-MA.js} +0 -0
  154. /package/dist/components/chunks/{popover-CV-QCPjW.js → popover-DB1OaYVe.js} +0 -0
  155. /package/dist/components/chunks/{sortable-CparUKN_.js → sortable-B1nMJBah.js} +0 -0
  156. /package/dist/components/chunks/{sortable-DX2PwFLN.js → sortable-CXM-7eyL.js} +0 -0
  157. /package/dist/components/chunks/{spinner-BsaFHuS6.js → spinner-BjC3nA-C.js} +0 -0
  158. /package/dist/components/chunks/{spinner-DbTohC6i.js → spinner-DfPbEa2d.js} +0 -0
  159. /package/dist/components/chunks/{stack-CpmqyaNX.js → stack-Bdl46AdO.js} +0 -0
  160. /package/dist/components/chunks/{stack-_7V0Fcu0.js → stack-nq3AmcMG.js} +0 -0
  161. /package/dist/components/chunks/{table-CI11Mff-.js → table-2-0iNQJy.js} +0 -0
  162. /package/dist/components/chunks/{table-EgbYUKL8.js → table-DRdsVUJL.js} +0 -0
@@ -3,227 +3,5 @@ import '../../button.css'
3
3
  import '../../spinner.css'
4
4
  import '../../icon.css'
5
5
  import '../../back-button.css'
6
- import { a as e } from "../chunks/icon-C-eV4VGF.js";
7
- import { t } from "../chunks/register-element-BFYmIynH.js";
8
- import "../chunks/icon-DiWej_T-.js";
9
- /* empty css */
10
- import "../chunks/spinner-BsaFHuS6.js";
11
- e({
12
- name: "arrow-left",
13
- viewBox: "0 0 24 24",
14
- path: "M19 12H5m7-7l-7 7 7 7",
15
- strokeLinecap: "round",
16
- strokeLinejoin: "round"
17
- });
18
- //#endregion
19
- //#region src/components/button/Button.js
20
- var n = class extends HTMLElement {
21
- static get observedAttributes() {
22
- return [
23
- "variant",
24
- "tone",
25
- "disabled",
26
- "loading",
27
- "button-type",
28
- "type",
29
- "full-width",
30
- "icon-position",
31
- "icon"
32
- ];
33
- }
34
- constructor() {
35
- super(), this._button = null, this._clickHandler = null, this._isHandlingClick = !1;
36
- }
37
- connectedCallback() {
38
- this.render(), this._button && this.setupEventListeners();
39
- }
40
- disconnectedCallback() {
41
- this.removeEventListeners();
42
- }
43
- attributeChangedCallback(e, t, n) {
44
- t !== n && this.render();
45
- }
46
- getVariant() {
47
- return this.getAttribute("variant") || "solid";
48
- }
49
- getTone() {
50
- return this.getAttribute("tone") || "neutral";
51
- }
52
- isDisabled() {
53
- return this.hasAttribute("disabled");
54
- }
55
- isLoading() {
56
- return this.hasAttribute("loading");
57
- }
58
- getType() {
59
- return (this.getAttribute("type") || this.getAttribute("button-type") || "default") === "submit" ? "submit" : "button";
60
- }
61
- isFullWidth() {
62
- return this.hasAttribute("full-width");
63
- }
64
- getIconPosition() {
65
- return this.getAttribute("icon-position") || "left";
66
- }
67
- getIcon() {
68
- return this.getAttribute("icon") || "";
69
- }
70
- isIconOnly() {
71
- if (!(this.getIcon() || this._button?.querySelector("[slot=\"icon\"], .mint-button-icon, mint-icon"))) return !1;
72
- let e = this._button?.querySelector(".mint-button-content");
73
- if (e && e.textContent.trim()) return !1;
74
- if (this._button) {
75
- for (let e = this._button.firstChild; e; e = e.nextSibling) if (e.nodeType === Node.TEXT_NODE && e.textContent.trim() || e.nodeType === Node.ELEMENT_NODE && e.tagName !== "MINT-ICON" && e.tagName !== "MINT-SPINNER" && !e.querySelector?.("mint-spinner") && !e.hasAttribute?.("slot") && e.className !== "mint-button-icon" && !(e.className === "mr-2" && e.querySelector("mint-spinner")) && e.textContent.trim()) return !1;
76
- }
77
- return !0;
78
- }
79
- getButtonClasses() {
80
- return [
81
- "mint-button-core",
82
- "mint-button-" + this.getVariant(),
83
- "mint-button-tone-" + this.getTone(),
84
- this.isIconOnly() ? "mint-button-icon-only" : "",
85
- this.isFullWidth() ? "mint-button-full-width" : ""
86
- ].filter(Boolean).join(" ");
87
- }
88
- render() {
89
- let e = this.isDisabled() || this.isLoading(), t = this.getType();
90
- if (!this._button) {
91
- for (this._button = document.createElement("button"); this.firstChild;) this._button.appendChild(this.firstChild);
92
- this.appendChild(this._button), this.setupEventListeners();
93
- }
94
- this._button.type = t, this._button.disabled = e;
95
- let n = this._button.querySelector("mint-spinner");
96
- if (this.isLoading()) if (n) n.setAttribute("data-button-variant", this.getVariant()), n.setAttribute("data-button-tone", this.getTone()), n.render();
97
- else {
98
- let e = document.createElement("span");
99
- e.className = "mint-spinner-wrap";
100
- let t = document.createElement("mint-spinner");
101
- t.setAttribute("size", "default"), t.setAttribute("data-button-variant", this.getVariant()), t.setAttribute("data-button-tone", this.getTone()), t.style.width = "0.875rem", t.style.height = "0.875rem", e.appendChild(t), this._button.insertBefore(e, this._button.firstChild);
102
- }
103
- else n && n.parentElement?.remove();
104
- for (; this.firstChild && this.firstChild !== this._button;) this._button.appendChild(this.firstChild);
105
- let r = this.getIcon(), i = this._button.querySelector("[slot=\"icon\"], .mint-button-icon, mint-icon");
106
- r ? (i && i.tagName !== "MINT-ICON" && (i.remove(), i = null), !i || i.tagName !== "MINT-ICON" ? (i = document.createElement("mint-icon"), i.setAttribute("name", r), i.className = "mint-button-icon") : i.setAttribute("name", r)) : i && i.tagName === "MINT-ICON" && (i.remove(), i = null), i ||= this._button.querySelector("[slot=\"icon\"], .mint-button-icon");
107
- let a = this.getIconPosition(), o = this._button.querySelector(".mint-button-content");
108
- if (o) {
109
- let e = i && i.tagName === "MINT-ICON";
110
- if (i && !i.parentElement) {
111
- let t = this._button.querySelector("mint-spinner")?.parentElement;
112
- e || a === "left" ? t ? t.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, o) : o.insertAdjacentElement("afterend", i);
113
- } else if (i && (e || a === "left") && i.nextSibling !== o) {
114
- i.remove();
115
- let e = this._button.querySelector("mint-spinner")?.parentElement;
116
- e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, o);
117
- } else i && !e && a === "right" && i.previousSibling !== o && (i.remove(), o.insertAdjacentElement("afterend", i));
118
- } else {
119
- let e = [];
120
- for (let t = this._button.firstChild; t; t = t.nextSibling) t.tagName !== "MINT-SPINNER" && !t.querySelector?.("mint-spinner") && t !== i && !t.hasAttribute?.("slot") && !(t.className === "mr-2" && t.querySelector("mint-spinner")) && e.push(t);
121
- if (e.length > 0) {
122
- o = document.createElement("span"), o.className = "mint-button-content", e.forEach((e) => {
123
- o.appendChild(e);
124
- });
125
- let t = this._button.querySelector("mint-spinner")?.parentElement;
126
- i && a === "left" ? t ? (t.insertAdjacentElement("afterend", i), i.insertAdjacentElement("afterend", o)) : (this._button.insertBefore(i, this._button.firstChild), i.insertAdjacentElement("afterend", o)) : i && a === "right" ? t ? (t.insertAdjacentElement("afterend", o), o.insertAdjacentElement("afterend", i)) : (this._button.insertBefore(o, this._button.firstChild), o.insertAdjacentElement("afterend", i)) : t ? t.insertAdjacentElement("afterend", o) : this._button.insertBefore(o, this._button.firstChild);
127
- } else if (i && i.tagName === "MINT-ICON" && !i.parentElement) {
128
- let e = this._button.querySelector("mint-spinner")?.parentElement;
129
- e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, this._button.firstChild);
130
- }
131
- }
132
- let s = this.isIconOnly();
133
- i && (i.classList.contains("mint-button-icon") || i.classList.add("mint-button-icon"), i.classList.remove("mint-icon-leading", "mint-icon-trailing"), s ? i.tagName === "MINT-ICON" ? (i.style.width = "1rem", i.style.height = "1rem", i.style.maxWidth = "1rem", i.style.maxHeight = "1rem", i.style.flexShrink = "0") : (i.style.maxWidth = "1rem", i.style.maxHeight = "1rem", i.style.flexShrink = "0", i.tagName === "svg" && (i.style.width = "1rem", i.style.height = "1rem")) : a === "left" ? i.classList.add("mint-icon-leading") : i.classList.add("mint-icon-trailing"));
134
- let c = this.getButtonClasses();
135
- this._button.className = c;
136
- }
137
- setupEventListeners() {
138
- this._button && !this._clickHandler && (this._clickHandler = this.handleClick.bind(this), this._button.addEventListener("click", this._clickHandler, !0), this._button.addEventListener("mousedown", this._handleMouseDown), this._button.addEventListener("mouseup", this._handleMouseUp), this._button.addEventListener("mouseleave", this._handleMouseLeave), this._button.addEventListener("touchstart", this._handleTouchStart), this._button.addEventListener("touchend", this._handleTouchEnd), this._button.addEventListener("touchcancel", this._handleTouchCancel));
139
- }
140
- removeEventListeners() {
141
- this._button && (this._clickHandler &&= (this._button.removeEventListener("click", this._clickHandler, !0), null), this._button.removeEventListener("mousedown", this._handleMouseDown), this._button.removeEventListener("mouseup", this._handleMouseUp), this._button.removeEventListener("mouseleave", this._handleMouseLeave), this._button.removeEventListener("touchstart", this._handleTouchStart), this._button.removeEventListener("touchend", this._handleTouchEnd), this._button.removeEventListener("touchcancel", this._handleTouchCancel));
142
- }
143
- _handleMouseDown = () => {
144
- this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
145
- };
146
- _handleMouseUp = () => {
147
- this._button && this._button.classList.remove("mint-button-active");
148
- };
149
- _handleMouseLeave = () => {
150
- this._button && this._button.classList.remove("mint-button-active");
151
- };
152
- _handleTouchStart = () => {
153
- this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
154
- };
155
- _handleTouchEnd = () => {
156
- this._button && this._button.classList.remove("mint-button-active");
157
- };
158
- _handleTouchCancel = () => {
159
- this._button && this._button.classList.remove("mint-button-active");
160
- };
161
- handleClick(e) {
162
- if (this.isDisabled() || this.isLoading()) {
163
- e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
164
- return;
165
- }
166
- if (e.stopPropagation(), e.stopImmediatePropagation(), this._isHandlingClick) {
167
- e.preventDefault();
168
- return;
169
- }
170
- this._isHandlingClick = !0, e.preventDefault(), this.dispatchEvent(new CustomEvent("click", {
171
- detail: { originalEvent: e },
172
- bubbles: !0,
173
- cancelable: !0,
174
- composed: !0
175
- })), requestAnimationFrame(() => {
176
- this._isHandlingClick = !1;
177
- });
178
- }
179
- };
180
- typeof customElements < "u" && !customElements.get("mint-button") && t("mint-button", n);
181
- //#endregion
182
- //#region src/components/back-button/BackButton.js
183
- var r = class extends HTMLElement {
184
- static get observedAttributes() {
185
- return ["href", "fallback-href"];
186
- }
187
- constructor() {
188
- super(), this._historyDepth = 0, this._maxBackAttempts = 10, this._backAttempts = 0;
189
- }
190
- connectedCallback() {
191
- this.render(), this._setupHistoryTracking();
192
- }
193
- attributeChangedCallback(e, t, n) {
194
- t !== n && this.render();
195
- }
196
- _setupHistoryTracking() {
197
- window.addEventListener("popstate", () => {
198
- this._backAttempts = 0;
199
- }), this._historyDepth = window.history.length;
200
- }
201
- getFallbackHref() {
202
- return this.getAttribute("fallback-href") || this.getAttribute("href") || "/";
203
- }
204
- handleClick(e) {
205
- if (e.preventDefault(), e.stopPropagation(), window.history.length > 1 && this._backAttempts < this._maxBackAttempts && this._backAttempts === 0) {
206
- this._backAttempts++;
207
- let e = window.location.href, t = Date.now();
208
- window.history.back(), setTimeout(() => {
209
- Date.now() - t, window.location.href === e ? this._navigateToFallback() : setTimeout(() => {
210
- this._backAttempts = 0;
211
- }, 500);
212
- }, 200);
213
- } else this._navigateToFallback();
214
- }
215
- _navigateToFallback() {
216
- let e = this.getFallbackHref();
217
- if (this._backAttempts = 0, e.startsWith("/") && !e.startsWith("//")) try {
218
- window.history.pushState({}, "", e), window.dispatchEvent(new PopStateEvent("popstate"));
219
- return;
220
- } catch {}
221
- window.location.href = e;
222
- }
223
- render() {
224
- this._button || (this._button = document.createElement("mint-button"), this._button.setAttribute("variant", "neutral"), this._button.setAttribute("icon", "arrow-left"), this._button.addEventListener("click", (e) => this.handleClick(e)), this.appendChild(this._button));
225
- }
226
- };
227
- typeof customElements < "u" && !customElements.get("mint-back-button") && t("mint-back-button", r);
228
- //#endregion
229
- export { r as default };
6
+ import { t as e } from "../chunks/back-button-CDyPYehm.js";
7
+ export { e as default };
@@ -13,9 +13,9 @@ const __mintLoadStyle = (key, url) => {
13
13
  __mintLoadStyle('theme', '../../theme.css')
14
14
  __mintLoadStyle('icon', '../../icon.css')
15
15
  __mintLoadStyle('bottom-navigation', '../../bottom-navigation.css')
16
- import "../chunks/icon-C-eV4VGF.js";
16
+ import "../chunks/icon-D9zLlMGu.js";
17
17
  import { t as e } from "../chunks/register-element-BFYmIynH.js";
18
- import "../chunks/icon-DiWej_T-.js";
18
+ import "../chunks/icon-CkFfk0oc.js";
19
19
  //#region src/components/bottom-navigation/BottomNavigation.ts
20
20
  var t = class extends HTMLElement {
21
21
  constructor(...e) {
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunks/icon-FUJudEjA.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-DF1kvSw1.js`);var t=class extends HTMLElement{constructor(...e){super(...e),this._lastScrollY=0,this._scrollHandler=null}connectedCallback(){this.classList.add(`mint-bottom-navigation`),this.setAttribute(`role`,`navigation`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Primary`),this._lastScrollY=window.scrollY,this.hasAttribute(`data-preview`)||this._attachScrollListener()}disconnectedCallback(){this._detachScrollListener()}_attachScrollListener(){this._scrollHandler||(this._scrollHandler=()=>{let e=window.scrollY;if(e<=8){this.classList.remove(`is-hidden`),this._lastScrollY=e;return}let t=e-this._lastScrollY;Math.abs(t)<4||(t>0?this.classList.add(`is-hidden`):this.classList.remove(`is-hidden`),this._lastScrollY=e)},window.addEventListener(`scroll`,this._scrollHandler,{passive:!0}))}_detachScrollListener(){this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}};customElements.get(`mint-bottom-navigation`)||e.t(`mint-bottom-navigation`,t);var n=class extends HTMLElement{constructor(...e){super(...e),this._root=null}static get observedAttributes(){return[`icon`,`label`,`href`,`active`]}connectedCallback(){this.classList.add(`mint-bottom-nav-item`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isActive(){return this.hasAttribute(`active`)&&this.getAttribute(`active`)!==`false`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}render(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=this._isActive(),i;e?(i=document.createElement(`a`),i.href=e):(i=document.createElement(`button`),i.type=`button`),i.className=`mint-bottom-nav-link`,i.setAttribute(`aria-current`,r?`page`:`false`);let a=n.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);i.setAttribute(`aria-label`,t||a||`Navigation item`);let o=document.createElement(`span`);if(o.className=`mint-bottom-nav-icon`,n){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,n),e.className=`mint-bottom-nav-icon-glyph`,o.appendChild(e)}let s=document.createElement(`span`);s.className=`mint-bottom-nav-label`,s.textContent=t,i.appendChild(o),i.appendChild(s),this.replaceChildren(i),this._root=i}};customElements.get(`mint-bottom-nav-item`)||e.t(`mint-bottom-nav-item`,n);var r=t;exports.MintBottomNavItem=n,exports.MintBottomNavigation=t,exports.default=r;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunks/icon-DgBiEDoy.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-BwaKFl4e.js`);var t=class extends HTMLElement{constructor(...e){super(...e),this._lastScrollY=0,this._scrollHandler=null}connectedCallback(){this.classList.add(`mint-bottom-navigation`),this.setAttribute(`role`,`navigation`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Primary`),this._lastScrollY=window.scrollY,this.hasAttribute(`data-preview`)||this._attachScrollListener()}disconnectedCallback(){this._detachScrollListener()}_attachScrollListener(){this._scrollHandler||(this._scrollHandler=()=>{let e=window.scrollY;if(e<=8){this.classList.remove(`is-hidden`),this._lastScrollY=e;return}let t=e-this._lastScrollY;Math.abs(t)<4||(t>0?this.classList.add(`is-hidden`):this.classList.remove(`is-hidden`),this._lastScrollY=e)},window.addEventListener(`scroll`,this._scrollHandler,{passive:!0}))}_detachScrollListener(){this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}};customElements.get(`mint-bottom-navigation`)||e.t(`mint-bottom-navigation`,t);var n=class extends HTMLElement{constructor(...e){super(...e),this._root=null}static get observedAttributes(){return[`icon`,`label`,`href`,`active`]}connectedCallback(){this.classList.add(`mint-bottom-nav-item`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isActive(){return this.hasAttribute(`active`)&&this.getAttribute(`active`)!==`false`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}render(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=this._isActive(),i;e?(i=document.createElement(`a`),i.href=e):(i=document.createElement(`button`),i.type=`button`),i.className=`mint-bottom-nav-link`,i.setAttribute(`aria-current`,r?`page`:`false`);let a=n.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);i.setAttribute(`aria-label`,t||a||`Navigation item`);let o=document.createElement(`span`);if(o.className=`mint-bottom-nav-icon`,n){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,n),e.className=`mint-bottom-nav-icon-glyph`,o.appendChild(e)}let s=document.createElement(`span`);s.className=`mint-bottom-nav-label`,s.textContent=t,i.appendChild(o),i.appendChild(s),this.replaceChildren(i),this._root=i}};customElements.get(`mint-bottom-nav-item`)||e.t(`mint-bottom-nav-item`,n);var r=t;exports.MintBottomNavItem=n,exports.MintBottomNavigation=t,exports.default=r;
@@ -1,9 +1,9 @@
1
1
  import '../../theme.css'
2
2
  import '../../icon.css'
3
3
  import '../../bottom-navigation.css'
4
- import "../chunks/icon-C-eV4VGF.js";
4
+ import "../chunks/icon-D9zLlMGu.js";
5
5
  import { t as e } from "../chunks/register-element-BFYmIynH.js";
6
- import "../chunks/icon-DiWej_T-.js";
6
+ import "../chunks/icon-CkFfk0oc.js";
7
7
  //#region src/components/bottom-navigation/BottomNavigation.ts
8
8
  var t = class extends HTMLElement {
9
9
  constructor(...e) {
@@ -9,6 +9,7 @@ declare class MintButton extends HTMLElement {
9
9
  private _button;
10
10
  private _clickHandler;
11
11
  private _isHandlingClick;
12
+ private _mousePressed;
12
13
  /** Re-sync when frameworks (Vue, React, etc.) patch light DOM after we moved children into `<button>`. */
13
14
  private _hostChildObserver;
14
15
  private _hostRenderFromObserverRaf;
@@ -46,7 +47,8 @@ declare class MintButton extends HTMLElement {
46
47
  removeEventListeners(): void;
47
48
  private _handleMouseDown;
48
49
  private _handleMouseUp;
49
- private _handleMouseLeave;
50
+ private _handleMouseCancel;
51
+ private _clearMousePressedState;
50
52
  private _handleTouchStart;
51
53
  private _handleTouchEnd;
52
54
  private _handleTouchCancel;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,CAAA;AACzB,OAAO,eAAe,CAAA;AAEtB,KAAK,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAClD,KAAK,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAA;AACtE,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AACrC,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,CAAA;AAEpC,cAAM,UAAW,SAAQ,WAAW;IAClC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,aAAa,CAAwC;IAC7D,OAAO,CAAC,gBAAgB,CAAiB;IACzC,0GAA0G;IAC1G,OAAO,CAAC,kBAAkB,CAAgC;IAC1D,OAAO,CAAC,0BAA0B,CAAsB;;IAOxD,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,uBAAuB;IAI/B,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAS5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,UAAU,IAAI,aAAa;IAK3B,OAAO,IAAI,UAAU;IAIrB,UAAU,IAAI,OAAO;IAMrB,SAAS,IAAI,OAAO;IAMpB,OAAO,IAAI,UAAU;IAgBrB,WAAW,IAAI,OAAO;IAKtB,QAAQ,IAAI,OAAO;IAMnB,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAMxB;IAED,eAAe,IAAI,YAAY;IAI/B,OAAO,IAAI,MAAM;IAIjB,YAAY,IAAI,MAAM,GAAG,QAAQ,GAAG,OAAO;IAQ3C,UAAU,IAAI,OAAO;IAiCrB,qBAAqB,IAAI,MAAM,EAAE;IA+HjC,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,yBAAyB;IAejC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,+BAA+B;IASvC,OAAO,CAAC,gBAAgB;IAWxB,MAAM,IAAI,IAAI;IAsSd,mBAAmB,IAAI,IAAI;IAmB3B,oBAAoB,IAAI,IAAI;IAgB5B,OAAO,CAAC,gBAAgB,CAIvB;IAED,OAAO,CAAC,cAAc,CAOrB;IAED,OAAO,CAAC,iBAAiB,CAOxB;IAED,OAAO,CAAC,iBAAiB,CAIxB;IAED,OAAO,CAAC,eAAe,CAOtB;IAED,OAAO,CAAC,kBAAkB,CAOzB;IAED,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;CA2DhC;AAOD,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,CAAA;AACzB,OAAO,eAAe,CAAA;AAEtB,KAAK,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAClD,KAAK,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAA;AACtE,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AACrC,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,CAAA;AAEpC,cAAM,UAAW,SAAQ,WAAW;IAClC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,aAAa,CAAwC;IAC7D,OAAO,CAAC,gBAAgB,CAAiB;IACzC,OAAO,CAAC,aAAa,CAAiB;IACtC,0GAA0G;IAC1G,OAAO,CAAC,kBAAkB,CAAgC;IAC1D,OAAO,CAAC,0BAA0B,CAAsB;;IAOxD,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,uBAAuB;IAI/B,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAU5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,UAAU,IAAI,aAAa;IAK3B,OAAO,IAAI,UAAU;IAIrB,UAAU,IAAI,OAAO;IAMrB,SAAS,IAAI,OAAO;IAMpB,OAAO,IAAI,UAAU;IAgBrB,WAAW,IAAI,OAAO;IAKtB,QAAQ,IAAI,OAAO;IAMnB,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAMxB;IAED,eAAe,IAAI,YAAY;IAI/B,OAAO,IAAI,MAAM;IAIjB,YAAY,IAAI,MAAM,GAAG,QAAQ,GAAG,OAAO;IAQ3C,UAAU,IAAI,OAAO;IAiCrB,qBAAqB,IAAI,MAAM,EAAE;IA+HjC,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,yBAAyB;IAejC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,+BAA+B;IASvC,OAAO,CAAC,gBAAgB;IAWxB,MAAM,IAAI,IAAI;IAsSd,mBAAmB,IAAI,IAAI;IAiB3B,oBAAoB,IAAI,IAAI;IAc5B,OAAO,CAAC,gBAAgB,CASvB;IAED,OAAO,CAAC,cAAc,CAErB;IAED,OAAO,CAAC,kBAAkB,CAEzB;IAED,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,iBAAiB,CAIxB;IAED,OAAO,CAAC,eAAe,CAOtB;IAED,OAAO,CAAC,kBAAkB,CAOzB;IAED,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;CA2DhC;AAOD,eAAe,UAAU,CAAA"}
@@ -14,5 +14,5 @@ __mintLoadStyle('theme', '../../theme.css')
14
14
  __mintLoadStyle('spinner', '../../spinner.css')
15
15
  __mintLoadStyle('icon', '../../icon.css')
16
16
  __mintLoadStyle('button', '../../button.css')
17
- import { t as e } from "../chunks/button-hmAnS0R0.js";
17
+ import { t as e } from "../chunks/button-BYkzR0uX.js";
18
18
  export { e as default };
@@ -1 +1 @@
1
- const e=require(`../chunks/button-DMoaxqbf.js`);module.exports=e.t;
1
+ const e=require(`../chunks/button-DfY2Sr3-.js`);module.exports=e.t;
@@ -2,5 +2,5 @@ import '../../theme.css'
2
2
  import '../../spinner.css'
3
3
  import '../../icon.css'
4
4
  import '../../button.css'
5
- import { t as e } from "../chunks/button-hmAnS0R0.js";
5
+ import { t as e } from "../chunks/button-BYkzR0uX.js";
6
6
  export { e as default };
@@ -13,9 +13,9 @@ const __mintLoadStyle = (key, url) => {
13
13
  __mintLoadStyle('theme', '../../theme.css')
14
14
  __mintLoadStyle('icon', '../../icon.css')
15
15
  __mintLoadStyle('checkbox', '../../checkbox.css')
16
- import { a as e } from "../chunks/icon-C-eV4VGF.js";
16
+ import { a as e } from "../chunks/icon-D9zLlMGu.js";
17
17
  import { t } from "../chunks/register-element-BFYmIynH.js";
18
- import "../chunks/icon-DiWej_T-.js";
18
+ import "../chunks/icon-CkFfk0oc.js";
19
19
  e({
20
20
  name: "check",
21
21
  viewBox: "0 0 24 24",
@@ -1 +1 @@
1
- const e=require(`../chunks/icon-FUJudEjA.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-DF1kvSw1.js`),e.a({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var n=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._checkbox&&(this._checkbox.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this.getAttribute(`value`)||``}getCheckboxClasses(){return`mint-checkbox-control`}render(){let e=this.getLabel(),t=this.getInfo(),n=this.isDisabled(),r=this.querySelector(`.mint-checkbox-wrapper`);r||(r=document.createElement(`div`),r.className=`mint-checkbox-wrapper`,this.insertBefore(r,this.firstChild)),this._checkbox?this._checkbox.parentElement!==r&&r.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,r.appendChild(this._checkbox),this.setupEventListeners()),this._checkbox.className=`mint-input-overlay`,this._checkbox.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._checkbox.checked=this._checked,this._checkbox.disabled=n,this._changeHandler||this.setupEventListeners();let i=this.getId();i?this._checkbox.id=i:this._checkbox.removeAttribute(`id`);let a=this.getName();a?this._checkbox.name=a:this._checkbox.removeAttribute(`name`);let o=this.getValue();o?this._checkbox.value=o:this._checkbox.removeAttribute(`value`),e?this._checkbox.setAttribute(`aria-label`,e):this._checkbox.removeAttribute(`aria-label`),r.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,r.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let s=r.querySelector(`mint-icon`);s||(s=document.createElement(`mint-icon`),s.setAttribute(`name`,`check`),s.className=`mint-checkbox-check`,s.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,s.style.zIndex=`1`,r.appendChild(s)),this.updateVisualState();let c=this.querySelector(`.mint-checkbox-label-container`);if(e||t){c||(c=document.createElement(`div`),c.className=`mint-checkbox-label-container`,this.appendChild(c));let r=c.querySelector(`.mint-checkbox-label`);e?(r||(r=document.createElement(`span`),r.className=`mint-checkbox-label`,c.insertBefore(r,c.firstChild)),r.textContent=e,n?r.style.opacity=`0.5`:r.style.opacity=``):r&&r.remove();let i=c.querySelector(`.mint-checkbox-info`);if(t?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,c.appendChild(i)),i.textContent=t,n?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),n)c.style.cursor=`default`,c._clickHandler&&(c.removeEventListener(`click`,c._clickHandler),c._clickHandler=null);else{c.style.cursor=`pointer`;let e=c._clickHandler;e&&c.removeEventListener(`click`,e),c._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},c.addEventListener(`click`,c._clickHandler)}}else c&&c.remove()}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)},this._checkbox.addEventListener(`change`,this._changeHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`mousedown`,this._mousedownHandler),this._checkbox.addEventListener(`mouseup`,this._mouseupHandler),this._checkbox.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`touchstart`,this._touchstartHandler),this._checkbox.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._checkbox&&(this._changeHandler&&=(this._checkbox.removeEventListener(`change`,this._changeHandler),null),this._mousedownHandler&&=(this._checkbox.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._checkbox.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._checkbox.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._checkbox.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._checkbox.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-checkbox-wrapper`),t=e?.querySelector(`mint-icon`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let e=new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}}};typeof customElements<`u`&&!customElements.get(`mint-checkbox`)&&t.t(`mint-checkbox`,n),module.exports=n;
1
+ const e=require(`../chunks/icon-DgBiEDoy.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-BwaKFl4e.js`),e.a({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var n=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._checkbox&&(this._checkbox.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this.getAttribute(`value`)||``}getCheckboxClasses(){return`mint-checkbox-control`}render(){let e=this.getLabel(),t=this.getInfo(),n=this.isDisabled(),r=this.querySelector(`.mint-checkbox-wrapper`);r||(r=document.createElement(`div`),r.className=`mint-checkbox-wrapper`,this.insertBefore(r,this.firstChild)),this._checkbox?this._checkbox.parentElement!==r&&r.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,r.appendChild(this._checkbox),this.setupEventListeners()),this._checkbox.className=`mint-input-overlay`,this._checkbox.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._checkbox.checked=this._checked,this._checkbox.disabled=n,this._changeHandler||this.setupEventListeners();let i=this.getId();i?this._checkbox.id=i:this._checkbox.removeAttribute(`id`);let a=this.getName();a?this._checkbox.name=a:this._checkbox.removeAttribute(`name`);let o=this.getValue();o?this._checkbox.value=o:this._checkbox.removeAttribute(`value`),e?this._checkbox.setAttribute(`aria-label`,e):this._checkbox.removeAttribute(`aria-label`),r.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,r.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let s=r.querySelector(`mint-icon`);s||(s=document.createElement(`mint-icon`),s.setAttribute(`name`,`check`),s.className=`mint-checkbox-check`,s.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,s.style.zIndex=`1`,r.appendChild(s)),this.updateVisualState();let c=this.querySelector(`.mint-checkbox-label-container`);if(e||t){c||(c=document.createElement(`div`),c.className=`mint-checkbox-label-container`,this.appendChild(c));let r=c.querySelector(`.mint-checkbox-label`);e?(r||(r=document.createElement(`span`),r.className=`mint-checkbox-label`,c.insertBefore(r,c.firstChild)),r.textContent=e,n?r.style.opacity=`0.5`:r.style.opacity=``):r&&r.remove();let i=c.querySelector(`.mint-checkbox-info`);if(t?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,c.appendChild(i)),i.textContent=t,n?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),n)c.style.cursor=`default`,c._clickHandler&&(c.removeEventListener(`click`,c._clickHandler),c._clickHandler=null);else{c.style.cursor=`pointer`;let e=c._clickHandler;e&&c.removeEventListener(`click`,e),c._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},c.addEventListener(`click`,c._clickHandler)}}else c&&c.remove()}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)},this._checkbox.addEventListener(`change`,this._changeHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`mousedown`,this._mousedownHandler),this._checkbox.addEventListener(`mouseup`,this._mouseupHandler),this._checkbox.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`touchstart`,this._touchstartHandler),this._checkbox.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._checkbox&&(this._changeHandler&&=(this._checkbox.removeEventListener(`change`,this._changeHandler),null),this._mousedownHandler&&=(this._checkbox.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._checkbox.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._checkbox.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._checkbox.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._checkbox.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-checkbox-wrapper`),t=e?.querySelector(`mint-icon`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let e=new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}}};typeof customElements<`u`&&!customElements.get(`mint-checkbox`)&&t.t(`mint-checkbox`,n),module.exports=n;
@@ -1,9 +1,9 @@
1
1
  import '../../theme.css'
2
2
  import '../../icon.css'
3
3
  import '../../checkbox.css'
4
- import { a as e } from "../chunks/icon-C-eV4VGF.js";
4
+ import { a as e } from "../chunks/icon-D9zLlMGu.js";
5
5
  import { t } from "../chunks/register-element-BFYmIynH.js";
6
- import "../chunks/icon-DiWej_T-.js";
6
+ import "../chunks/icon-CkFfk0oc.js";
7
7
  e({
8
8
  name: "check",
9
9
  viewBox: "0 0 24 24",
@@ -13,5 +13,5 @@ const __mintLoadStyle = (key, url) => {
13
13
  __mintLoadStyle('theme', '../../theme.css')
14
14
  __mintLoadStyle('icon', '../../icon.css')
15
15
  __mintLoadStyle('chip', '../../chip.css')
16
- import { t as e } from "../chunks/chip-CVJdu4J8.js";
16
+ import { t as e } from "../chunks/chip-CLCBimJI.js";
17
17
  export { e as default };
@@ -1 +1 @@
1
- const e=require(`../chunks/chip-dr93YHC5.js`);module.exports=e.t;
1
+ const e=require(`../chunks/chip-Dfj3x__h.js`);module.exports=e.t;
@@ -1,5 +1,5 @@
1
1
  import '../../theme.css'
2
2
  import '../../icon.css'
3
3
  import '../../chip.css'
4
- import { t as e } from "../chunks/chip-CVJdu4J8.js";
4
+ import { t as e } from "../chunks/chip-CLCBimJI.js";
5
5
  export { e as default };
@@ -0,0 +1,224 @@
1
+ import { a as e } from "./icon-D9zLlMGu.js";
2
+ import { t } from "./register-element-BFYmIynH.js";
3
+ import "./icon-CkFfk0oc.js";
4
+ /* empty css */
5
+ import "./spinner-BjC3nA-C.js";
6
+ e({
7
+ name: "arrow-left",
8
+ viewBox: "0 0 24 24",
9
+ path: "M19 12H5m7-7l-7 7 7 7",
10
+ strokeLinecap: "round",
11
+ strokeLinejoin: "round"
12
+ });
13
+ //#endregion
14
+ //#region src/components/button/Button.js
15
+ var n = class extends HTMLElement {
16
+ static get observedAttributes() {
17
+ return [
18
+ "variant",
19
+ "tone",
20
+ "disabled",
21
+ "loading",
22
+ "button-type",
23
+ "type",
24
+ "full-width",
25
+ "icon-position",
26
+ "icon"
27
+ ];
28
+ }
29
+ constructor() {
30
+ super(), this._button = null, this._clickHandler = null, this._isHandlingClick = !1;
31
+ }
32
+ connectedCallback() {
33
+ this.render(), this._button && this.setupEventListeners();
34
+ }
35
+ disconnectedCallback() {
36
+ this.removeEventListeners();
37
+ }
38
+ attributeChangedCallback(e, t, n) {
39
+ t !== n && this.render();
40
+ }
41
+ getVariant() {
42
+ return this.getAttribute("variant") || "solid";
43
+ }
44
+ getTone() {
45
+ return this.getAttribute("tone") || "neutral";
46
+ }
47
+ isDisabled() {
48
+ return this.hasAttribute("disabled");
49
+ }
50
+ isLoading() {
51
+ return this.hasAttribute("loading");
52
+ }
53
+ getType() {
54
+ return (this.getAttribute("type") || this.getAttribute("button-type") || "default") === "submit" ? "submit" : "button";
55
+ }
56
+ isFullWidth() {
57
+ return this.hasAttribute("full-width");
58
+ }
59
+ getIconPosition() {
60
+ return this.getAttribute("icon-position") || "left";
61
+ }
62
+ getIcon() {
63
+ return this.getAttribute("icon") || "";
64
+ }
65
+ isIconOnly() {
66
+ if (!(this.getIcon() || this._button?.querySelector("[slot=\"icon\"], .mint-button-icon, mint-icon"))) return !1;
67
+ let e = this._button?.querySelector(".mint-button-content");
68
+ if (e && e.textContent.trim()) return !1;
69
+ if (this._button) {
70
+ for (let e = this._button.firstChild; e; e = e.nextSibling) if (e.nodeType === Node.TEXT_NODE && e.textContent.trim() || e.nodeType === Node.ELEMENT_NODE && e.tagName !== "MINT-ICON" && e.tagName !== "MINT-SPINNER" && !e.querySelector?.("mint-spinner") && !e.hasAttribute?.("slot") && e.className !== "mint-button-icon" && !(e.className === "mr-2" && e.querySelector("mint-spinner")) && e.textContent.trim()) return !1;
71
+ }
72
+ return !0;
73
+ }
74
+ getButtonClasses() {
75
+ return [
76
+ "mint-button-core",
77
+ "mint-button-" + this.getVariant(),
78
+ "mint-button-tone-" + this.getTone(),
79
+ this.isIconOnly() ? "mint-button-icon-only" : "",
80
+ this.isFullWidth() ? "mint-button-full-width" : ""
81
+ ].filter(Boolean).join(" ");
82
+ }
83
+ render() {
84
+ let e = this.isDisabled() || this.isLoading(), t = this.getType();
85
+ if (!this._button) {
86
+ for (this._button = document.createElement("button"); this.firstChild;) this._button.appendChild(this.firstChild);
87
+ this.appendChild(this._button), this.setupEventListeners();
88
+ }
89
+ this._button.type = t, this._button.disabled = e;
90
+ let n = this._button.querySelector("mint-spinner");
91
+ if (this.isLoading()) if (n) n.setAttribute("data-button-variant", this.getVariant()), n.setAttribute("data-button-tone", this.getTone()), n.render();
92
+ else {
93
+ let e = document.createElement("span");
94
+ e.className = "mint-spinner-wrap";
95
+ let t = document.createElement("mint-spinner");
96
+ t.setAttribute("size", "default"), t.setAttribute("data-button-variant", this.getVariant()), t.setAttribute("data-button-tone", this.getTone()), t.style.width = "0.875rem", t.style.height = "0.875rem", e.appendChild(t), this._button.insertBefore(e, this._button.firstChild);
97
+ }
98
+ else n && n.parentElement?.remove();
99
+ for (; this.firstChild && this.firstChild !== this._button;) this._button.appendChild(this.firstChild);
100
+ let r = this.getIcon(), i = this._button.querySelector("[slot=\"icon\"], .mint-button-icon, mint-icon");
101
+ r ? (i && i.tagName !== "MINT-ICON" && (i.remove(), i = null), !i || i.tagName !== "MINT-ICON" ? (i = document.createElement("mint-icon"), i.setAttribute("name", r), i.className = "mint-button-icon") : i.setAttribute("name", r)) : i && i.tagName === "MINT-ICON" && (i.remove(), i = null), i ||= this._button.querySelector("[slot=\"icon\"], .mint-button-icon");
102
+ let a = this.getIconPosition(), o = this._button.querySelector(".mint-button-content");
103
+ if (o) {
104
+ let e = i && i.tagName === "MINT-ICON";
105
+ if (i && !i.parentElement) {
106
+ let t = this._button.querySelector("mint-spinner")?.parentElement;
107
+ e || a === "left" ? t ? t.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, o) : o.insertAdjacentElement("afterend", i);
108
+ } else if (i && (e || a === "left") && i.nextSibling !== o) {
109
+ i.remove();
110
+ let e = this._button.querySelector("mint-spinner")?.parentElement;
111
+ e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, o);
112
+ } else i && !e && a === "right" && i.previousSibling !== o && (i.remove(), o.insertAdjacentElement("afterend", i));
113
+ } else {
114
+ let e = [];
115
+ for (let t = this._button.firstChild; t; t = t.nextSibling) t.tagName !== "MINT-SPINNER" && !t.querySelector?.("mint-spinner") && t !== i && !t.hasAttribute?.("slot") && !(t.className === "mr-2" && t.querySelector("mint-spinner")) && e.push(t);
116
+ if (e.length > 0) {
117
+ o = document.createElement("span"), o.className = "mint-button-content", e.forEach((e) => {
118
+ o.appendChild(e);
119
+ });
120
+ let t = this._button.querySelector("mint-spinner")?.parentElement;
121
+ i && a === "left" ? t ? (t.insertAdjacentElement("afterend", i), i.insertAdjacentElement("afterend", o)) : (this._button.insertBefore(i, this._button.firstChild), i.insertAdjacentElement("afterend", o)) : i && a === "right" ? t ? (t.insertAdjacentElement("afterend", o), o.insertAdjacentElement("afterend", i)) : (this._button.insertBefore(o, this._button.firstChild), o.insertAdjacentElement("afterend", i)) : t ? t.insertAdjacentElement("afterend", o) : this._button.insertBefore(o, this._button.firstChild);
122
+ } else if (i && i.tagName === "MINT-ICON" && !i.parentElement) {
123
+ let e = this._button.querySelector("mint-spinner")?.parentElement;
124
+ e ? e.insertAdjacentElement("afterend", i) : this._button.insertBefore(i, this._button.firstChild);
125
+ }
126
+ }
127
+ let s = this.isIconOnly();
128
+ i && (i.classList.contains("mint-button-icon") || i.classList.add("mint-button-icon"), i.classList.remove("mint-icon-leading", "mint-icon-trailing"), s ? i.tagName === "MINT-ICON" ? (i.style.width = "1rem", i.style.height = "1rem", i.style.maxWidth = "1rem", i.style.maxHeight = "1rem", i.style.flexShrink = "0") : (i.style.maxWidth = "1rem", i.style.maxHeight = "1rem", i.style.flexShrink = "0", i.tagName === "svg" && (i.style.width = "1rem", i.style.height = "1rem")) : a === "left" ? i.classList.add("mint-icon-leading") : i.classList.add("mint-icon-trailing"));
129
+ let c = this.getButtonClasses();
130
+ this._button.className = c;
131
+ }
132
+ setupEventListeners() {
133
+ this._button && !this._clickHandler && (this._clickHandler = this.handleClick.bind(this), this._button.addEventListener("click", this._clickHandler, !0), this._button.addEventListener("mousedown", this._handleMouseDown), this._button.addEventListener("mouseup", this._handleMouseUp), this._button.addEventListener("mouseleave", this._handleMouseLeave), this._button.addEventListener("touchstart", this._handleTouchStart), this._button.addEventListener("touchend", this._handleTouchEnd), this._button.addEventListener("touchcancel", this._handleTouchCancel));
134
+ }
135
+ removeEventListeners() {
136
+ this._button && (this._clickHandler &&= (this._button.removeEventListener("click", this._clickHandler, !0), null), this._button.removeEventListener("mousedown", this._handleMouseDown), this._button.removeEventListener("mouseup", this._handleMouseUp), this._button.removeEventListener("mouseleave", this._handleMouseLeave), this._button.removeEventListener("touchstart", this._handleTouchStart), this._button.removeEventListener("touchend", this._handleTouchEnd), this._button.removeEventListener("touchcancel", this._handleTouchCancel));
137
+ }
138
+ _handleMouseDown = () => {
139
+ this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
140
+ };
141
+ _handleMouseUp = () => {
142
+ this._button && this._button.classList.remove("mint-button-active");
143
+ };
144
+ _handleMouseLeave = () => {
145
+ this._button && this._button.classList.remove("mint-button-active");
146
+ };
147
+ _handleTouchStart = () => {
148
+ this._button && !this.isDisabled() && !this.isLoading() && this._button.classList.add("mint-button-active");
149
+ };
150
+ _handleTouchEnd = () => {
151
+ this._button && this._button.classList.remove("mint-button-active");
152
+ };
153
+ _handleTouchCancel = () => {
154
+ this._button && this._button.classList.remove("mint-button-active");
155
+ };
156
+ handleClick(e) {
157
+ if (this.isDisabled() || this.isLoading()) {
158
+ e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
159
+ return;
160
+ }
161
+ if (e.stopPropagation(), e.stopImmediatePropagation(), this._isHandlingClick) {
162
+ e.preventDefault();
163
+ return;
164
+ }
165
+ this._isHandlingClick = !0, e.preventDefault(), this.dispatchEvent(new CustomEvent("click", {
166
+ detail: { originalEvent: e },
167
+ bubbles: !0,
168
+ cancelable: !0,
169
+ composed: !0
170
+ })), requestAnimationFrame(() => {
171
+ this._isHandlingClick = !1;
172
+ });
173
+ }
174
+ };
175
+ typeof customElements < "u" && !customElements.get("mint-button") && t("mint-button", n);
176
+ //#endregion
177
+ //#region src/components/back-button/BackButton.js
178
+ var r = class extends HTMLElement {
179
+ static get observedAttributes() {
180
+ return ["href", "fallback-href"];
181
+ }
182
+ constructor() {
183
+ super(), this._historyDepth = 0, this._maxBackAttempts = 10, this._backAttempts = 0;
184
+ }
185
+ connectedCallback() {
186
+ this.render(), this._setupHistoryTracking();
187
+ }
188
+ attributeChangedCallback(e, t, n) {
189
+ t !== n && this.render();
190
+ }
191
+ _setupHistoryTracking() {
192
+ window.addEventListener("popstate", () => {
193
+ this._backAttempts = 0;
194
+ }), this._historyDepth = window.history.length;
195
+ }
196
+ getFallbackHref() {
197
+ return this.getAttribute("fallback-href") || this.getAttribute("href") || "/";
198
+ }
199
+ handleClick(e) {
200
+ if (e.preventDefault(), e.stopPropagation(), window.history.length > 1 && this._backAttempts < this._maxBackAttempts && this._backAttempts === 0) {
201
+ this._backAttempts++;
202
+ let e = window.location.href, t = Date.now();
203
+ window.history.back(), setTimeout(() => {
204
+ Date.now() - t, window.location.href === e ? this._navigateToFallback() : setTimeout(() => {
205
+ this._backAttempts = 0;
206
+ }, 500);
207
+ }, 200);
208
+ } else this._navigateToFallback();
209
+ }
210
+ _navigateToFallback() {
211
+ let e = this.getFallbackHref();
212
+ if (this._backAttempts = 0, e.startsWith("/") && !e.startsWith("//")) try {
213
+ window.history.pushState({}, "", e), window.dispatchEvent(new PopStateEvent("popstate"));
214
+ return;
215
+ } catch {}
216
+ window.location.href = e;
217
+ }
218
+ render() {
219
+ this._button || (this._button = document.createElement("mint-button"), this._button.setAttribute("variant", "solid"), this._button.setAttribute("tone", "neutral"), this._button.setAttribute("icon", "arrow-left"), this._button.setAttribute("aria-label", this.getAttribute("aria-label") || "Go back"), this._button.addEventListener("click", (e) => this.handleClick(e)), this.appendChild(this._button));
220
+ }
221
+ };
222
+ typeof customElements < "u" && !customElements.get("mint-back-button") && t("mint-back-button", r);
223
+ //#endregion
224
+ export { r as t };