@ds-mo/ui 14.25.0 → 14.27.0

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 (220) hide show
  1. package/dist/.package-ready.json +1 -1
  2. package/dist/agent-patterns.json +1 -1
  3. package/dist/agent.json +343 -16
  4. package/dist/angular/ds-score.d.ts +12 -0
  5. package/dist/angular/ds-score.js +38 -0
  6. package/dist/angular/ds-textarea.d.ts +15 -0
  7. package/dist/angular/ds-textarea.js +43 -0
  8. package/dist/angular/index.d.ts +1 -1
  9. package/dist/angular/index.js +2 -0
  10. package/dist/angular/proxies.d.ts +2 -0
  11. package/dist/angular/proxies.js +2 -0
  12. package/dist/angular/text-value-accessor.d.ts +1 -1
  13. package/dist/angular/text-value-accessor.js +2 -2
  14. package/dist/components/ds-agent-activity.js +1 -1
  15. package/dist/components/ds-agent-questionnaire.js +1 -1
  16. package/dist/components/ds-agent-response.js +1 -1
  17. package/dist/components/ds-agent-source-list.js +1 -1
  18. package/dist/components/ds-agent-tool-call.js +1 -1
  19. package/dist/components/ds-attachment-list.js +1 -1
  20. package/dist/components/ds-badge.js +1 -1
  21. package/dist/components/ds-banner.js +1 -1
  22. package/dist/components/ds-bar-action.js +1 -1
  23. package/dist/components/ds-bar-nav.js +1 -1
  24. package/dist/components/ds-bar-title.js +1 -1
  25. package/dist/components/ds-bar-workflow.js +1 -1
  26. package/dist/components/ds-breadcrumb.js +1 -1
  27. package/dist/components/ds-button-filled.js +1 -1
  28. package/dist/components/ds-button-unfilled.js +1 -1
  29. package/dist/components/ds-card-chart.js +1 -1
  30. package/dist/components/ds-card-overview.js +1 -1
  31. package/dist/components/ds-card-overview.js.map +1 -1
  32. package/dist/components/ds-card-setting.js +1 -1
  33. package/dist/components/ds-chart-legend.js +1 -1
  34. package/dist/components/ds-chart.js +1 -1
  35. package/dist/components/ds-checkbox.js +1 -1
  36. package/dist/components/ds-chip.js +1 -1
  37. package/dist/components/ds-code-block.js +1 -1
  38. package/dist/components/ds-conversation-list-item.js +1 -1
  39. package/dist/components/ds-conversation-list-section.js +1 -1
  40. package/dist/components/ds-empty-state.js +1 -1
  41. package/dist/components/ds-field.js +1 -1
  42. package/dist/components/ds-filter-menu.js +1 -1
  43. package/dist/components/ds-input.js +1 -1
  44. package/dist/components/ds-markdown.js +1 -1
  45. package/dist/components/ds-menu.js +1 -1
  46. package/dist/components/ds-message-actions.js +1 -1
  47. package/dist/components/ds-message-composer.js +1 -1
  48. package/dist/components/ds-message-scroller.js +1 -1
  49. package/dist/components/ds-message.js +1 -1
  50. package/dist/components/ds-mobile-bar-nav.js +1 -1
  51. package/dist/components/ds-mobile-header.js +1 -1
  52. package/dist/components/ds-mobile-section-switcher.js +1 -1
  53. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  54. package/dist/components/ds-modal.js +1 -1
  55. package/dist/components/ds-pagination.js +1 -1
  56. package/dist/components/ds-panel-nav.js +1 -1
  57. package/dist/components/ds-panel-sub-nav.js +1 -1
  58. package/dist/components/ds-panel-tool-header.js +1 -1
  59. package/dist/components/ds-panel-tool-search.js +1 -1
  60. package/dist/components/ds-panel-tools.js +1 -1
  61. package/dist/components/ds-paper-texture.js +1 -1
  62. package/dist/components/ds-radio.js +1 -1
  63. package/dist/components/ds-score.d.ts +11 -0
  64. package/dist/components/ds-score.js +2 -0
  65. package/dist/components/ds-score.js.map +1 -0
  66. package/dist/components/ds-select.js +1 -1
  67. package/dist/components/ds-shell-app.js +1 -1
  68. package/dist/components/ds-shell-page.js +1 -1
  69. package/dist/components/ds-shell-tools.js +1 -1
  70. package/dist/components/ds-slider.js +1 -1
  71. package/dist/components/ds-swatch-picker.js +1 -1
  72. package/dist/components/ds-tab-group.js +1 -1
  73. package/dist/components/ds-table-filter.js +1 -1
  74. package/dist/components/ds-table-group.js +1 -1
  75. package/dist/components/ds-table-group.js.map +1 -1
  76. package/dist/components/ds-table-saved-views.js +1 -1
  77. package/dist/components/ds-table-search.js +1 -1
  78. package/dist/components/ds-table-sort.js +1 -1
  79. package/dist/components/ds-table-toolbar.js +1 -1
  80. package/dist/components/ds-table.js +1 -1
  81. package/dist/components/ds-table.js.map +1 -1
  82. package/dist/components/ds-tag.js +1 -1
  83. package/dist/components/ds-text.js +1 -1
  84. package/dist/components/ds-textarea.d.ts +11 -0
  85. package/dist/components/ds-textarea.js +2 -0
  86. package/dist/components/ds-textarea.js.map +1 -0
  87. package/dist/components/ds-toast.js +1 -1
  88. package/dist/components/ds-tooltip-chart.js +1 -1
  89. package/dist/components/ds-tooltip.js +1 -1
  90. package/dist/components/ds-typing-indicator.js +1 -1
  91. package/dist/components/{p-DLaN9BPq.js → p-1604KY3B.js} +2 -2
  92. package/dist/components/{p-CYMKmJ2s.js → p-2wIPUcSL.js} +2 -2
  93. package/dist/components/{p-CEfxLsbX.js → p-537t6oRD.js} +2 -2
  94. package/dist/components/{p-kslioYhf.js → p-6_CNVbqa.js} +2 -2
  95. package/dist/components/{p-PXdvBMXB.js → p-B3Z5sQin.js} +2 -2
  96. package/dist/components/{p-CZjjDhUl.js → p-B3sRZBZk.js} +2 -2
  97. package/dist/components/{p-BZlhBJZL.js → p-B9esvbYk.js} +2 -2
  98. package/dist/components/{p-5Z4oYuiK.js → p-BEXkJ9lg.js} +2 -2
  99. package/dist/components/{p-DbLLH3hr.js → p-BIGpc__9.js} +2 -2
  100. package/dist/components/{p-DzPtYdXy.js → p-BMzn2Cmw.js} +2 -2
  101. package/dist/components/{p-BSRIF4m8.js → p-BRLDf-NK.js} +2 -2
  102. package/dist/components/{p-0X-4KGQf.js → p-BUh2GkPJ.js} +2 -2
  103. package/dist/components/{p-pUOA3iDG.js → p-BVpn_e-r.js} +2 -2
  104. package/dist/components/{p-CpeJMKJ5.js → p-BVz-r3g0.js} +2 -2
  105. package/dist/components/{p-CBymzuOO.js → p-BXDLR072.js} +2 -2
  106. package/dist/components/{p-DiS5BgLA.js → p-BZiGtBBk.js} +2 -2
  107. package/dist/components/{p-BcxidW9k.js → p-Bb9dA7sl.js} +2 -2
  108. package/dist/components/{p-BR1ayqMU.js → p-Bjt_8sLe.js} +2 -2
  109. package/dist/components/{p-BqbdABo3.js → p-BssZ4SbT.js} +2 -2
  110. package/dist/components/{p-bHnk8t5I.js → p-C68oSTb1.js} +2 -2
  111. package/dist/components/{p-C_FFU6W3.js → p-CGQnHNuW.js} +2 -2
  112. package/dist/components/{p-BqVXMEJm.js → p-CQjUOHiN.js} +2 -2
  113. package/dist/components/{p-w9fkkwL2.js → p-CaF5WCci.js} +2 -2
  114. package/dist/components/{p-Bjq1KP_Y.js → p-Cf5Ai4xx.js} +2 -2
  115. package/dist/components/{p-B0kSlcaw.js → p-Cr6pDY-e.js} +2 -2
  116. package/dist/components/{p-FxtgCvhA.js → p-Cy1oWIaV.js} +2 -2
  117. package/dist/components/{p-CTH3dSYg.js → p-DDqRCDXh.js} +2 -2
  118. package/dist/components/{p-x5u5Ueli.js → p-DIqAdmui.js} +2 -2
  119. package/dist/components/{p-Cd1JnnVK.js → p-DQQsS9Rx.js} +2 -2
  120. package/dist/components/{p-CZHIkVgj.js → p-DQsFmleZ.js} +2 -2
  121. package/dist/components/{p-CE2b5GPu.js → p-DVLghmNY.js} +2 -2
  122. package/dist/components/p-DW8ssbfI.js +2 -0
  123. package/dist/components/p-DW8ssbfI.js.map +1 -0
  124. package/dist/components/{p-BXv6RpoF.js → p-DZcIt_JJ.js} +2 -2
  125. package/dist/components/{p-CglHiyY2.js → p-DkxOEFHN.js} +2 -2
  126. package/dist/components/{p-DeK_6Uym.js → p-DlbhmXjH.js} +2 -2
  127. package/dist/components/{p-Bq8svcPs.js → p-GEi3hDJQ.js} +2 -2
  128. package/dist/components/p-LMmrjmI_.js +2 -0
  129. package/dist/components/p-LMmrjmI_.js.map +1 -0
  130. package/dist/components/{p-DI8DUozc.js → p-Q0dkeoJ6.js} +2 -2
  131. package/dist/components/{p-XaCYqck3.js → p-Q7AOgrg5.js} +2 -2
  132. package/dist/components/p-VT-5XDkB.js +2 -0
  133. package/dist/components/p-VT-5XDkB.js.map +1 -0
  134. package/dist/components/{p-B0OZx3JB.js → p-WFo1x6dN.js} +2 -2
  135. package/dist/components/{p-CEXchU5N.js → p-to8BxxgT.js} +2 -2
  136. package/dist/docs/components.json +1106 -5
  137. package/dist/mcp-data/registry/card-overview.json +8 -6
  138. package/dist/mcp-data/registry/field.json +5 -4
  139. package/dist/mcp-data/registry/panel-nav.json +2 -1
  140. package/dist/mcp-data/registry/registry.json +348 -15
  141. package/dist/mcp-data/registry/score.json +241 -0
  142. package/dist/mcp-data/registry/table-group.json +5 -5
  143. package/dist/mcp-data/registry/table.json +16 -13
  144. package/dist/mcp-data/registry/textarea.json +600 -0
  145. package/dist/mcp-data/registry/tooltip.json +5 -5
  146. package/dist/react/components.d.ts +2 -0
  147. package/dist/react/components.js +2 -0
  148. package/dist/react/ds-score.d.ts +9 -0
  149. package/dist/react/ds-score.js +12 -0
  150. package/dist/react/ds-textarea.d.ts +12 -0
  151. package/dist/react/ds-textarea.js +12 -0
  152. package/dist/styles/table.css +188 -69
  153. package/dist/types/components/CardOverview/card-overview-controller.d.ts +2 -2
  154. package/dist/types/components/CardOverview/card-overview-types.d.ts +2 -1
  155. package/dist/types/components/Score/Score.d.ts +21 -0
  156. package/dist/types/components/Score/index.d.ts +3 -0
  157. package/dist/types/components/Score/score-model.d.ts +14 -0
  158. package/dist/types/components/Score/score-types.d.ts +5 -0
  159. package/dist/types/components/Table/Table.d.ts +3 -0
  160. package/dist/types/components/Table/index.d.ts +1 -1
  161. package/dist/types/components/Table/table-cell-model.d.ts +12 -0
  162. package/dist/types/components/Table/table-model.d.ts +10 -1
  163. package/dist/types/components/Table/table-render-model.d.ts +3 -1
  164. package/dist/types/components/Table/table-types.d.ts +62 -1
  165. package/dist/types/components/Table/table-virtual-model.d.ts +6 -5
  166. package/dist/types/components/TableGroup/TableGroup.d.ts +13 -3
  167. package/dist/types/components/Textarea/Textarea.d.ts +66 -0
  168. package/dist/types/components/Textarea/index.d.ts +2 -0
  169. package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
  170. package/dist/types/components.d.ts +324 -2
  171. package/dist/vue/components.d.ts +2 -0
  172. package/dist/vue/components.js +2 -0
  173. package/dist/vue/ds-score.d.ts +3 -0
  174. package/dist/vue/ds-score.js +12 -0
  175. package/dist/vue/ds-textarea.d.ts +3 -0
  176. package/dist/vue/ds-textarea.js +36 -0
  177. package/package.json +1 -1
  178. package/dist/components/p-9X_p0bHr.js +0 -2
  179. package/dist/components/p-9X_p0bHr.js.map +0 -1
  180. package/dist/components/p-Bo6uW_8T.js +0 -2
  181. package/dist/components/p-Bo6uW_8T.js.map +0 -1
  182. /package/dist/components/{p-DLaN9BPq.js.map → p-1604KY3B.js.map} +0 -0
  183. /package/dist/components/{p-CYMKmJ2s.js.map → p-2wIPUcSL.js.map} +0 -0
  184. /package/dist/components/{p-CEfxLsbX.js.map → p-537t6oRD.js.map} +0 -0
  185. /package/dist/components/{p-kslioYhf.js.map → p-6_CNVbqa.js.map} +0 -0
  186. /package/dist/components/{p-PXdvBMXB.js.map → p-B3Z5sQin.js.map} +0 -0
  187. /package/dist/components/{p-CZjjDhUl.js.map → p-B3sRZBZk.js.map} +0 -0
  188. /package/dist/components/{p-BZlhBJZL.js.map → p-B9esvbYk.js.map} +0 -0
  189. /package/dist/components/{p-5Z4oYuiK.js.map → p-BEXkJ9lg.js.map} +0 -0
  190. /package/dist/components/{p-DbLLH3hr.js.map → p-BIGpc__9.js.map} +0 -0
  191. /package/dist/components/{p-DzPtYdXy.js.map → p-BMzn2Cmw.js.map} +0 -0
  192. /package/dist/components/{p-BSRIF4m8.js.map → p-BRLDf-NK.js.map} +0 -0
  193. /package/dist/components/{p-0X-4KGQf.js.map → p-BUh2GkPJ.js.map} +0 -0
  194. /package/dist/components/{p-pUOA3iDG.js.map → p-BVpn_e-r.js.map} +0 -0
  195. /package/dist/components/{p-CpeJMKJ5.js.map → p-BVz-r3g0.js.map} +0 -0
  196. /package/dist/components/{p-CBymzuOO.js.map → p-BXDLR072.js.map} +0 -0
  197. /package/dist/components/{p-DiS5BgLA.js.map → p-BZiGtBBk.js.map} +0 -0
  198. /package/dist/components/{p-BcxidW9k.js.map → p-Bb9dA7sl.js.map} +0 -0
  199. /package/dist/components/{p-BR1ayqMU.js.map → p-Bjt_8sLe.js.map} +0 -0
  200. /package/dist/components/{p-BqbdABo3.js.map → p-BssZ4SbT.js.map} +0 -0
  201. /package/dist/components/{p-bHnk8t5I.js.map → p-C68oSTb1.js.map} +0 -0
  202. /package/dist/components/{p-C_FFU6W3.js.map → p-CGQnHNuW.js.map} +0 -0
  203. /package/dist/components/{p-BqVXMEJm.js.map → p-CQjUOHiN.js.map} +0 -0
  204. /package/dist/components/{p-w9fkkwL2.js.map → p-CaF5WCci.js.map} +0 -0
  205. /package/dist/components/{p-Bjq1KP_Y.js.map → p-Cf5Ai4xx.js.map} +0 -0
  206. /package/dist/components/{p-B0kSlcaw.js.map → p-Cr6pDY-e.js.map} +0 -0
  207. /package/dist/components/{p-FxtgCvhA.js.map → p-Cy1oWIaV.js.map} +0 -0
  208. /package/dist/components/{p-CTH3dSYg.js.map → p-DDqRCDXh.js.map} +0 -0
  209. /package/dist/components/{p-x5u5Ueli.js.map → p-DIqAdmui.js.map} +0 -0
  210. /package/dist/components/{p-Cd1JnnVK.js.map → p-DQQsS9Rx.js.map} +0 -0
  211. /package/dist/components/{p-CZHIkVgj.js.map → p-DQsFmleZ.js.map} +0 -0
  212. /package/dist/components/{p-CE2b5GPu.js.map → p-DVLghmNY.js.map} +0 -0
  213. /package/dist/components/{p-BXv6RpoF.js.map → p-DZcIt_JJ.js.map} +0 -0
  214. /package/dist/components/{p-CglHiyY2.js.map → p-DkxOEFHN.js.map} +0 -0
  215. /package/dist/components/{p-DeK_6Uym.js.map → p-DlbhmXjH.js.map} +0 -0
  216. /package/dist/components/{p-Bq8svcPs.js.map → p-GEi3hDJQ.js.map} +0 -0
  217. /package/dist/components/{p-DI8DUozc.js.map → p-Q0dkeoJ6.js.map} +0 -0
  218. /package/dist/components/{p-XaCYqck3.js.map → p-Q7AOgrg5.js.map} +0 -0
  219. /package/dist/components/{p-B0OZx3JB.js.map → p-WFo1x6dN.js.map} +0 -0
  220. /package/dist/components/{p-CEXchU5N.js.map → p-to8BxxgT.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{T as o,d as s}from"./p-DbLLH3hr.js";const r=o;const t=s;export{r as DsTag,t as defineCustomElement};
1
+ import{T as o,d as s}from"./p-BIGpc__9.js";const p=o;const t=s;export{p as DsTag,t as defineCustomElement};
2
2
  //# sourceMappingURL=ds-tag.js.map
@@ -1,2 +1,2 @@
1
- import{T as o,d as s}from"./p-Cd1JnnVK.js";const n=o;const t=s;export{n as DsText,t as defineCustomElement};
1
+ import{T as s,d as o}from"./p-DQQsS9Rx.js";const t=s;const p=o;export{t as DsText,p as defineCustomElement};
2
2
  //# sourceMappingURL=ds-text.js.map
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface DsTextarea extends Components.DsTextarea, HTMLElement {}
4
+ export const DsTextarea: {
5
+ prototype: DsTextarea;
6
+ new (): DsTextarea;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,2 @@
1
+ import{p as t,H as e,c as r,h as s,a,t as i}from"./index.js";import{d as o}from"./p-DQQsS9Rx.js";import{D as d,s as n}from"./p-DOUk4KoT.js";import{s as c,r as l}from"./p-C0qN3PSb.js";import{C as h}from"./p-CuwopElg.js";import{c as x}from"./p-DuFm-ieS.js";const f=()=>`@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-interaction-fill.sc-ds-textarea-h,.ds-interaction-fill.sc-ds-textarea{position:var(--ds-interaction-position, relative);z-index:var(--ds-interaction-z-index, 0);cursor:default;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent;--ds-interaction-divider-width:0px;--ds-interaction-divider-color:transparent;--ds-interaction-divider-inline-start-width:0px;--ds-interaction-divider-inline-start-color:transparent;--ds-interaction-divider-inline-end-width:0px;--ds-interaction-divider-inline-end-color:transparent}.ds-interaction-fill.sc-ds-textarea-h::before,.ds-interaction-fill.sc-ds-textarea::before,.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-textarea-h::before,.ds-interaction-fill.sc-ds-textarea::before{z-index:1}.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{z-index:3;box-shadow:inset 0 calc(-1 * var(--ds-interaction-divider-width)) 0 var(--ds-interaction-divider-color), inset var(--ds-interaction-divider-inline-start-width) 0 0 var(--ds-interaction-divider-inline-start-color), inset calc(-1 * var(--ds-interaction-divider-inline-end-width)) 0 0 var(--ds-interaction-divider-inline-end-color), inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-textarea-h,.ds-interaction-fill--bordered.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-textarea-h::before,.ds-interaction-fill--selected.sc-ds-textarea::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-textarea-h,.ds-interaction-fill--selected.sc-ds-textarea{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-textarea-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-textarea:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-textarea-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-textarea:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-textarea-h::after,.ds-interaction-fill--grouped.sc-ds-textarea::after,.ds-interaction-fill--grouped.sc-ds-textarea-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-textarea:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-textarea-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-textarea:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-textarea-h,.ds-interaction-fill--grouped.sc-ds-textarea{--ds-interaction-divider-width:var(--ds-interaction-group-divider-width, 0px);--ds-interaction-divider-color:var(--ds-interaction-group-divider-color, transparent);--ds-interaction-divider-inline-start-width:var( --ds-interaction-group-divider-inline-start-width, 0px );--ds-interaction-divider-inline-start-color:var( --ds-interaction-group-divider-inline-start-color, transparent );--ds-interaction-divider-inline-end-width:var( --ds-interaction-group-divider-inline-end-width, 0px );--ds-interaction-divider-inline-end-color:var( --ds-interaction-group-divider-inline-end-color, transparent )}.ds-interaction-fill.sc-ds-textarea-h>.ds-interaction-fill__content.sc-ds-textarea,.ds-interaction-fill.sc-ds-textarea>.ds-interaction-fill__content.sc-ds-textarea,.ds-interaction-fill__content.sc-ds-textarea{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-textarea-h,.ds-interaction-fill--on-faint.sc-ds-textarea{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-textarea-h,.ds-interaction-fill--on-medium.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-textarea-h,.ds-interaction-fill--on-bold.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-textarea-h,.ds-interaction-fill--on-strong.sc-ds-textarea{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-textarea-h,.ds-interaction-fill--on-translucent.sc-ds-textarea{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active-brand);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-textarea-h,.ds-interaction-fill--on-inverted.sc-ds-textarea{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active-brand);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-textarea-h,.ds-interaction-fill--on-media.sc-ds-textarea{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-textarea-h,.ds-interaction-fill--on-always-dark.sc-ds-textarea{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active-brand);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-textarea-h,.ds-interaction-fill--on-navigation.sc-ds-textarea{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-textarea-h::after,.ds-interaction-fill.sc-ds-textarea::after{box-shadow:none;outline:var(--ds-interaction-border-width) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--ds-interaction-border-width))}.ds-interaction-fill--selected.sc-ds-textarea-h::before,.ds-interaction-fill--selected.sc-ds-textarea::before{background:transparent;outline:var(--dimension-stroke-width-025) solid var(--ds-forced-color-selected);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}}@media (forced-colors: active) and (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-textarea-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-textarea:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline-color:var(--ds-forced-color-selected);outline-width:var(--dimension-stroke-width-012)}}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-textarea-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-textarea-h,.ds-focus-ring.sc-ds-textarea,.ds-focus-ring-inset.sc-ds-textarea-h,.ds-focus-ring-inset.sc-ds-textarea{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-textarea-h:focus-visible,.ds-focus-ring.sc-ds-textarea:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-textarea-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-textarea{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-textarea-h:focus-visible,.ds-focus-ring-inset.sc-ds-textarea:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-textarea-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-textarea:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-textarea::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-textarea-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-control-inactive.sc-ds-textarea-h,.ds-control-inactive.sc-ds-textarea{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-textarea-h,.ds-control-inactive.sc-ds-textarea{color:var(--ds-forced-color-disabled);opacity:1}}.ds-control--lg.sc-ds-textarea,.ds-control--lg.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea,.ds-control--sm.sc-ds-textarea-h,.ds-control--sm.sc-ds-textarea,.ds-control--xs.sc-ds-textarea-h,.ds-control--xs.sc-ds-textarea{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-textarea-h,.ds-control--lg.sc-ds-textarea{--ds-control-height:var(--dimension-size-500);--ds-control-icon:var(--dimension-iconography-lg);--ds-control-padding-inline:var(--dimension-space-100);--ds-control-label-inset:var(--dimension-space-050);--ds-control-gap:var(--dimension-space-050)}.ds-control--md.sc-ds-textarea-h,.ds-control--md.sc-ds-textarea{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-textarea-h,.ds-control--sm.sc-ds-textarea{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-textarea-h,.ds-control--xs.sc-ds-textarea{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.ds-control-width--hug.sc-ds-textarea-h,.ds-control-width--hug.sc-ds-textarea{width:fit-content;max-width:100%;flex:0 0 auto}.ds-control-width--fill.sc-ds-textarea-h,.ds-control-width--fill.sc-ds-textarea{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.ds-field-stack.sc-ds-textarea-h,.ds-field-stack.sc-ds-textarea{display:flex;flex-direction:column;gap:var(--dimension-space-050)}.ds-text--display-medium.sc-ds-textarea-h,.ds-text--display-medium.sc-ds-textarea{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-textarea-h,.ds-text--display-small.sc-ds-textarea{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-textarea-h,.ds-text--title-large.sc-ds-textarea{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-textarea-h,.ds-text--title-medium.sc-ds-textarea{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-textarea-h,.ds-text--title-small.sc-ds-textarea{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-textarea-h,.ds-text--body-large.sc-ds-textarea{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-textarea-h,.ds-text--body-medium.sc-ds-textarea{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-textarea-h,.ds-text--body-small.sc-ds-textarea{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-textarea-h,.ds-text--caption.sc-ds-textarea{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--display-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-textarea,.ds-text--display-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--display-small.ds-text--regular.sc-ds-textarea-h,.ds-text--display-medium.ds-text--regular.sc-ds-textarea,.ds-text--display-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-large.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-textarea-h,.ds-text--title-large.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-textarea,.ds-text--title-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--title-small.ds-text--regular.sc-ds-textarea-h,.ds-text--title-medium.ds-text--regular.sc-ds-textarea,.ds-text--title-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-large.ds-text--emphasis.sc-ds-textarea,.ds-text--body-medium.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-textarea-h,.ds-text--body-medium.ds-text--regular.sc-ds-textarea-h,.ds-text--body-large.ds-text--regular.sc-ds-textarea,.ds-text--body-medium.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-textarea-h,.ds-text--body-small.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-textarea-h,.ds-text--body-small.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-textarea-h,.ds-text--caption.ds-text--emphasis.sc-ds-textarea{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-textarea-h,.ds-text--caption.ds-text--regular.sc-ds-textarea{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}@media (forced-colors: active){.sc-ds-textarea:root,.sc-ds-textarea-h,.ds-forced-colors-scope.sc-ds-textarea{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.textarea-host.sc-ds-textarea-h{display:inline-flex;--ds-textarea-fg:var(--color-foreground-primary);--ds-textarea-placeholder:var(--color-foreground-secondary);--ds-textarea-placeholder-active:var(--color-foreground-quaternary);--ds-textarea-border:var(--color-border-secondary)}.ds-control-width--fill.sc-ds-textarea-h,.ds-control-width--fill.sc-ds-textarea-h .textarea-control.sc-ds-textarea{width:100%}.textarea-control.sc-ds-textarea{display:flex;box-sizing:border-box;min-width:0;overflow:hidden;background:transparent;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));color:var(--ds-textarea-fg)}.textarea-control--resizable.sc-ds-textarea{padding-block-end:var(--dimension-space-025);padding-inline-end:var(--dimension-space-025)}.textarea-control--bordered.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--ds-textarea-border)}.textarea-control--error.sc-ds-textarea{--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-negative)}.textarea-control--bordered.sc-ds-textarea:focus-within:not(.textarea-control--error){--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-brand)}.ds-control-inactive.sc-ds-textarea-h .textarea-control.sc-ds-textarea::after{background:transparent}.native-textarea.sc-ds-textarea{position:relative;z-index:2;box-sizing:border-box;min-width:0;width:100%;padding-block:var(--ds-control-padding-inline, var(--dimension-space-075));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) );background:transparent;border:none;border-radius:inherit;outline:none;color:var(--ds-textarea-fg);font-family:inherit;-webkit-appearance:none;appearance:none}.native-textarea--resize-vertical.sc-ds-textarea{resize:vertical}.native-textarea--resize-none.sc-ds-textarea{resize:none}.native-textarea.sc-ds-textarea:disabled{cursor:not-allowed}.native-textarea.sc-ds-textarea:read-only:not(:disabled){cursor:default}.native-textarea.sc-ds-textarea::placeholder{color:var(--ds-textarea-placeholder)}.native-textarea.sc-ds-textarea:focus::placeholder{color:var(--ds-textarea-placeholder-active)}.error-text.sc-ds-textarea{width:100%}@media (forced-colors: active){.textarea-control--bordered.sc-ds-textarea:focus-within:not(.textarea-control--error)::after{outline-color:var(--ds-forced-color-selected)}.textarea-control--error.sc-ds-textarea::after{outline-style:dashed}}`;let v=0;const g=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.dsChange=r(this,"dsChange",7);this.internals=this.attachInternals();this.generatedId=`ds-textarea-${++v}`;this.errorId=`${this.generatedId}-error`;this.value="";this.disabled=false;this.readOnly=false;this.required=false;this.requiredMessage=d;this.rows=4;this.resize="vertical";this.inputMode="";this.enterKeyHint="";this.spellCheck=true;this.size="md";this.width="fill";this.hasBorder=true;this.hasInteractionFill=true;this.isInactive=false;this.autoFocus=false;this.error=false;this.ariaLabel=null;this.initialValue="";this.formDisabled=false;this.focused=false;this.touched=false;this.handleInput=t=>{this.value=t.target.value;this.dsChange.emit(this.value)};this.handleFocus=()=>{this.focused=true};this.handleBlur=()=>{this.focused=false;this.touched=true}}componentWillLoad(){this.initialValue=this.value;this.syncFormValue()}syncFormValue(){const t=this.isInactive||this.disabled||this.formDisabled;c(this.internals,this.value,{inactive:t});const e=this.required&&!t&&this.value.length===0;n(this.internals,e,this.requiredMessage)}formDisabledCallback(t){this.formDisabled=t;this.syncFormValue()}formResetCallback(){this.value=this.initialValue}formStateRestoreCallback(t){this.value=l(t)}async setFocus(){this.textareaEl?.focus()}render(){const t=this.inputId??this.generatedId;const e=this.isInactive||this.disabled||this.formDisabled;const r=this.value.length>0;const i=this.value!==this.initialValue;const o=this.error&&Boolean(this.errorMessage);const d=h[this.size];const n=Number.isFinite(this.rows)?Math.max(1,Math.floor(this.rows)):4;const c=[this.ariaDescribedby,o?this.errorId:undefined].filter(Boolean).join(" ")||undefined;return s(a,{key:"dd655ffba2d053ef58d35498153895ce38ddbef4",class:{"textarea-host":true,"ds-field-stack":true,"ds-control-inactive":e,[`ds-control--${this.size}`]:true,...x(this.width)},"data-disabled":e?"":undefined,"data-readonly":this.readOnly?"":undefined,"data-required":this.required?"":undefined,"data-invalid":this.error?"":undefined,"data-filled":r?"":undefined,"data-focused":this.focused?"":undefined,"data-dirty":i?"":undefined,"data-touched":this.touched?"":undefined},s("div",{key:"186e544aafb9571231f09bac5c3b6b84107a2b0c",class:{"textarea-control":true,"textarea-control--resizable":this.resize==="vertical","textarea-control--bordered":this.hasBorder,"textarea-control--error":this.hasBorder&&this.error,"ds-interaction-fill":this.hasInteractionFill,[`ds-control--${this.size}`]:true}},s("textarea",{key:"3c39018d2a4520893c87fd93c62d0773e2a0b9d5",ref:t=>{this.textareaEl=t},id:t,value:this.value,placeholder:this.placeholder,rows:n,disabled:e,readOnly:this.readOnly,required:this.required,autoFocus:this.autoFocus,autoComplete:this.autoComplete,inputMode:this.inputMode||undefined,enterKeyHint:this.enterKeyHint||undefined,spellcheck:this.spellCheck,class:`native-textarea native-textarea--resize-${this.resize} ds-text--${d.replace("text-","")} ds-text--regular ds-interaction-fill__content`,"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-describedby":c,"aria-invalid":this.error?"true":undefined,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur})),o&&s("ds-text",{key:"5a531d3c6b2dd2e89de05b5e1deb2a4a4a3ee89d",class:"error-text",as:"div",variant:"text-body-small",color:"negative",textId:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}]}}static get style(){return f()}},[66,"ds-textarea",{value:[1025],name:[513],form:[513],disabled:[516],readOnly:[516,"read-only"],required:[516],requiredMessage:[1,"required-message"],placeholder:[1],rows:[2],resize:[1],autoComplete:[1,"autocomplete"],inputMode:[1,"inputmode"],enterKeyHint:[1,"enterkeyhint"],spellCheck:[4,"spellcheck"],size:[1],width:[1],hasBorder:[4,"has-border"],hasInteractionFill:[4,"has-interaction-fill"],isInactive:[4,"is-inactive"],autoFocus:[4,"auto-focus"],error:[4],errorMessage:[1,"error-message"],inputId:[1,"input-id"],ariaLabel:[1,"aria-label"],ariaLabelledby:[1,"aria-labelledby"],ariaDescribedby:[1,"aria-describedby"],formDisabled:[32],focused:[32],touched:[32],setFocus:[64]},undefined,{value:[{syncFormValue:0}],disabled:[{syncFormValue:0}],isInactive:[{syncFormValue:0}],required:[{syncFormValue:0}]}]);function u(){if(typeof customElements==="undefined"){return}const t=["ds-textarea","ds-text"];t.forEach((t=>{switch(t){case"ds-textarea":if(!customElements.get(i(t))){customElements.define(i(t),g)}break;case"ds-text":if(!customElements.get(i(t))){o()}break}}))}u();const p=g;const m=u;export{p as DsTextarea,m as defineCustomElement};
2
+ //# sourceMappingURL=ds-textarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["textareaCss","idCounter","Textarea","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","generatedId","errorId","value","disabled","readOnly","required","requiredMessage","DEFAULT_REQUIRED_MESSAGE","rows","resize","inputMode","enterKeyHint","spellCheck","size","width","hasBorder","hasInteractionFill","isInactive","autoFocus","error","ariaLabel","initialValue","formDisabled","focused","touched","handleInput","event","target","dsChange","emit","handleFocus","handleBlur","componentWillLoad","syncFormValue","inactive","setFormControlValue","internals","missing","length","setRequiredValidity","formDisabledCallback","formResetCallback","formStateRestoreCallback","state","restoreStringFormState","setFocus","textareaEl","focus","render","inputId","filled","dirty","showError","Boolean","errorMessage","textVariant","CONTROL_TEXT_VARIANT","Number","isFinite","Math","max","floor","describedBy","ariaDescribedby","undefined","filter","join","h","Host","key","class","controlWidthClass","ref","element","id","placeholder","autoComplete","spellcheck","replace","ariaLabelledby","onInput","onFocus","onBlur","as","variant","color","textId","role"],"sources":["src/wc/components/Textarea/Textarea.css?tag=ds-textarea&encapsulation=scoped","src/wc/components/Textarea/Textarea.tsx"],"sourcesContent":["@import '../../utils/interaction-fill.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n@import '../../utils/control-density.css';\n@import '../../utils/control-width.css';\n@import '../../utils/field-stack.css';\n@import '../../utils/typography.css';\n@import '../../utils/forced-colors.css';\n\n:host(.textarea-host) {\n display: inline-flex;\n --ds-textarea-fg: var(--color-foreground-primary);\n --ds-textarea-placeholder: var(--color-foreground-secondary);\n --ds-textarea-placeholder-active: var(--color-foreground-quaternary);\n --ds-textarea-border: var(--color-border-secondary);\n}\n\n:host(.ds-control-width--fill),\n:host(.ds-control-width--fill) .textarea-control {\n width: 100%;\n}\n\n.textarea-control {\n display: flex;\n box-sizing: border-box;\n min-width: 0;\n overflow: hidden;\n background: transparent;\n border: none;\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n color: var(--ds-textarea-fg);\n}\n\n.textarea-control--resizable {\n padding-block-end: var(--dimension-space-025);\n padding-inline-end: var(--dimension-space-025);\n}\n\n.textarea-control--bordered {\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--ds-textarea-border);\n}\n\n.textarea-control--error {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-negative);\n}\n\n.textarea-control--bordered:focus-within:not(.textarea-control--error) {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-brand);\n}\n\n:host(.ds-control-inactive) .textarea-control::after {\n background: transparent;\n}\n\n.native-textarea {\n position: relative;\n z-index: 2;\n box-sizing: border-box;\n min-width: 0;\n width: 100%;\n padding-block: var(--ds-control-padding-inline, var(--dimension-space-075));\n padding-inline: calc(\n var(--ds-control-padding-inline, var(--dimension-space-075)) +\n var(--ds-control-label-inset, var(--dimension-space-025))\n );\n background: transparent;\n border: none;\n border-radius: inherit;\n outline: none;\n color: var(--ds-textarea-fg);\n font-family: inherit;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.native-textarea--resize-vertical {\n resize: vertical;\n}\n\n.native-textarea--resize-none {\n resize: none;\n}\n\n.native-textarea:disabled {\n cursor: not-allowed;\n}\n\n.native-textarea:read-only:not(:disabled) {\n cursor: default;\n}\n\n.native-textarea::placeholder {\n color: var(--ds-textarea-placeholder);\n}\n\n.native-textarea:focus::placeholder {\n color: var(--ds-textarea-placeholder-active);\n}\n\n.error-text {\n width: 100%;\n}\n\n@media (forced-colors: active) {\n .textarea-control--bordered:focus-within:not(.textarea-control--error)::after {\n outline-color: var(--ds-forced-color-selected);\n }\n\n .textarea-control--error::after {\n outline-style: dashed;\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Method,\n Prop,\n State,\n Watch,\n h,\n Host,\n} from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n DEFAULT_REQUIRED_MESSAGE,\n restoreStringFormState,\n setFormControlValue,\n setRequiredValidity,\n type ControlWidth,\n} from '../../utils';\n\nexport type TextareaSize = 'lg' | 'md' | 'sm' | 'xs';\nexport type TextareaWidth = ControlWidth;\nexport type TextareaResize = 'vertical' | 'none';\n\nlet idCounter = 0;\n\n@Component({\n tag: 'ds-textarea',\n styleUrl: 'Textarea.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Textarea {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n private generatedId = `ds-textarea-${++idCounter}`;\n private errorId = `${this.generatedId}-error`;\n\n @Prop({ mutable: true }) value: string = '';\n @Prop({ reflect: true }) name: string | undefined;\n @Prop({ reflect: true }) form: string | undefined;\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Keeps the value focusable and submittable while preventing edits. */\n @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() placeholder: string | undefined;\n /** Visible text rows before the field scrolls. */\n @Prop() rows: number = 4;\n /** Whether the user can resize the field vertically. */\n @Prop() resize: TextareaResize = 'vertical';\n /** Native browser autofill hint. */\n @Prop({ attribute: 'autocomplete' }) autoComplete: string | undefined;\n /** Preferred virtual keyboard without changing the value semantics. */\n @Prop({ attribute: 'inputmode' }) inputMode: string = '';\n /** Preferred virtual-keyboard action label. */\n @Prop({ attribute: 'enterkeyhint' }) enterKeyHint: string = '';\n /** Whether the browser should check spelling and grammar. */\n @Prop({ attribute: 'spellcheck' }) spellCheck: boolean = true;\n /** Control density for typography and inset spacing. */\n @Prop() size: TextareaSize = 'md';\n /** Width fit — fill the parent (default) or hug the available content. */\n @Prop() width: TextareaWidth = 'fill';\n /** Show the standard inset border, including focused and invalid strokes. */\n @Prop() hasBorder: boolean = true;\n /** Show the standard hover and pressed fill when the field is not embedded in interactive chrome. */\n @Prop() hasInteractionFill: boolean = true;\n @Prop() isInactive: boolean = false;\n @Prop() autoFocus: boolean = false;\n @Prop() error: boolean = false;\n @Prop() errorMessage: string | undefined;\n /** Associates the internal textarea with an external <label>. */\n @Prop() inputId: string | undefined;\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n @Prop({ attribute: 'aria-describedby' }) ariaDescribedby: string | undefined;\n\n @Event() dsChange!: EventEmitter<string>;\n\n private initialValue = '';\n private textareaEl?: HTMLTextAreaElement;\n @State() private formDisabled = false;\n @State() private focused = false;\n @State() private touched = false;\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n setFormControlValue(this.internals, this.value, { inactive });\n const missing = this.required && !inactive && this.value.length === 0;\n setRequiredValidity(this.internals, missing, this.requiredMessage);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = restoreStringFormState(state);\n }\n\n @Method()\n async setFocus() {\n this.textareaEl?.focus();\n }\n\n private handleInput = (event: Event) => {\n this.value = (event.target as HTMLTextAreaElement).value;\n this.dsChange.emit(this.value);\n };\n\n private handleFocus = () => {\n this.focused = true;\n };\n\n private handleBlur = () => {\n this.focused = false;\n this.touched = true;\n };\n\n render() {\n const inputId = this.inputId ?? this.generatedId;\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const filled = this.value.length > 0;\n const dirty = this.value !== this.initialValue;\n const showError = this.error && Boolean(this.errorMessage);\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const rows = Number.isFinite(this.rows) ? Math.max(1, Math.floor(this.rows)) : 4;\n const describedBy =\n [this.ariaDescribedby, showError ? this.errorId : undefined].filter(Boolean).join(' ') ||\n undefined;\n\n return (\n <Host\n class={{\n 'textarea-host': true,\n 'ds-field-stack': true,\n 'ds-control-inactive': inactive,\n [`ds-control--${this.size}`]: true,\n ...controlWidthClass(this.width),\n }}\n data-disabled={inactive ? '' : undefined}\n data-readonly={this.readOnly ? '' : undefined}\n data-required={this.required ? '' : undefined}\n data-invalid={this.error ? '' : undefined}\n data-filled={filled ? '' : undefined}\n data-focused={this.focused ? '' : undefined}\n data-dirty={dirty ? '' : undefined}\n data-touched={this.touched ? '' : undefined}\n >\n <div\n class={{\n 'textarea-control': true,\n 'textarea-control--resizable': this.resize === 'vertical',\n 'textarea-control--bordered': this.hasBorder,\n 'textarea-control--error': this.hasBorder && this.error,\n 'ds-interaction-fill': this.hasInteractionFill,\n [`ds-control--${this.size}`]: true,\n }}\n >\n <textarea\n ref={element => {\n this.textareaEl = element;\n }}\n id={inputId}\n value={this.value}\n placeholder={this.placeholder}\n rows={rows}\n disabled={inactive}\n readOnly={this.readOnly}\n required={this.required}\n autoFocus={this.autoFocus}\n autoComplete={this.autoComplete}\n inputMode={this.inputMode || undefined}\n enterKeyHint={this.enterKeyHint || undefined}\n spellcheck={this.spellCheck}\n class={`native-textarea native-textarea--resize-${this.resize} ds-text--${textVariant.replace('text-', '')} ds-text--regular ds-interaction-fill__content`}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.error ? 'true' : undefined}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </div>\n {showError && (\n <ds-text\n class=\"error-text\"\n as=\"div\"\n variant=\"text-body-small\"\n color=\"negative\"\n textId={this.errorId}\n role=\"alert\"\n >\n {this.errorMessage}\n </ds-text>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"+PAAA,MAAMA,EAAc,IAAM,o2oBC2B1B,IAAIC,EAAY,E,MAQHC,EAAQC,EAAA,MAAAD,UAAAE,EANrB,WAAAC,CAAAC,G,qHAUUC,KAAAC,YAAc,iBAAiBP,IAC/BM,KAAAE,QAAU,GAAGF,KAAKC,oBAEDD,KAAAG,MAAgB,GAGhBH,KAAAI,SAAoB,MAEpBJ,KAAAK,SAAoB,MACpBL,KAAAM,SAAoB,MACrCN,KAAAO,gBAA0BC,EAG1BR,KAAAS,KAAe,EAEfT,KAAAU,OAAyB,WAICV,KAAAW,UAAoB,GAEjBX,KAAAY,aAAuB,GAEzBZ,KAAAa,WAAsB,KAEjDb,KAAAc,KAAqB,KAErBd,KAAAe,MAAuB,OAEvBf,KAAAgB,UAAqB,KAErBhB,KAAAiB,mBAA8B,KAC9BjB,KAAAkB,WAAsB,MACtBlB,KAAAmB,UAAqB,MACrBnB,KAAAoB,MAAiB,MAIUpB,KAAAqB,UAA2B,KAMtDrB,KAAAsB,aAAe,GAENtB,KAAAuB,aAAe,MACfvB,KAAAwB,QAAU,MACVxB,KAAAyB,QAAU,MAoCnBzB,KAAA0B,YAAeC,IACrB3B,KAAKG,MAASwB,EAAMC,OAA+BzB,MACnDH,KAAK6B,SAASC,KAAK9B,KAAKG,MAAM,EAGxBH,KAAA+B,YAAc,KACpB/B,KAAKwB,QAAU,IAAI,EAGbxB,KAAAgC,WAAa,KACnBhC,KAAKwB,QAAU,MACfxB,KAAKyB,QAAU,IAAI,CAoFtB,CAjIC,iBAAAQ,GACEjC,KAAKsB,aAAetB,KAAKG,MACzBH,KAAKkC,e,CAOP,aAAAA,GACE,MAAMC,EAAWnC,KAAKkB,YAAclB,KAAKI,UAAYJ,KAAKuB,aAC1Da,EAAoBpC,KAAKqC,UAAWrC,KAAKG,MAAO,CAAEgC,aAClD,MAAMG,EAAUtC,KAAKM,WAAa6B,GAAYnC,KAAKG,MAAMoC,SAAW,EACpEC,EAAoBxC,KAAKqC,UAAWC,EAAStC,KAAKO,gB,CAGpD,oBAAAkC,CAAqBrC,GACnBJ,KAAKuB,aAAenB,EACpBJ,KAAKkC,e,CAGP,iBAAAQ,GACE1C,KAAKG,MAAQH,KAAKsB,Y,CAGpB,wBAAAqB,CAAyBC,GACvB5C,KAAKG,MAAQ0C,EAAuBD,E,CAItC,cAAME,GACJ9C,KAAK+C,YAAYC,O,CAiBnB,MAAAC,GACE,MAAMC,EAAUlD,KAAKkD,SAAWlD,KAAKC,YACrC,MAAMkC,EAAWnC,KAAKkB,YAAclB,KAAKI,UAAYJ,KAAKuB,aAC1D,MAAM4B,EAASnD,KAAKG,MAAMoC,OAAS,EACnC,MAAMa,EAAQpD,KAAKG,QAAUH,KAAKsB,aAClC,MAAM+B,EAAYrD,KAAKoB,OAASkC,QAAQtD,KAAKuD,cAC7C,MAAMC,EAAcC,EAAqBzD,KAAKc,MAC9C,MAAML,EAAOiD,OAAOC,SAAS3D,KAAKS,MAAQmD,KAAKC,IAAI,EAAGD,KAAKE,MAAM9D,KAAKS,OAAS,EAC/E,MAAMsD,EACJ,CAAC/D,KAAKgE,gBAAiBX,EAAYrD,KAAKE,QAAU+D,WAAWC,OAAOZ,SAASa,KAAK,MAClFF,UAEF,OACEG,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,CACL,gBAAiB,KACjB,iBAAkB,KAClB,sBAAuBpC,EACvB,CAAC,eAAenC,KAAKc,QAAS,QAC3B0D,EAAkBxE,KAAKe,QAC3B,gBACcoB,EAAW,GAAK8B,UAAS,gBACzBjE,KAAKK,SAAW,GAAK4D,UAAS,gBAC9BjE,KAAKM,SAAW,GAAK2D,UAAS,eAC/BjE,KAAKoB,MAAQ,GAAK6C,UAAS,cAC5Bd,EAAS,GAAKc,UAAS,eACtBjE,KAAKwB,QAAU,GAAKyC,UAAS,aAC/Bb,EAAQ,GAAKa,UAAS,eACpBjE,KAAKyB,QAAU,GAAKwC,WAElCG,EAAA,OAAAE,IAAA,2CACEC,MAAO,CACL,mBAAoB,KACpB,8BAA+BvE,KAAKU,SAAW,WAC/C,6BAA8BV,KAAKgB,UACnC,0BAA2BhB,KAAKgB,WAAahB,KAAKoB,MAClD,sBAAuBpB,KAAKiB,mBAC5B,CAAC,eAAejB,KAAKc,QAAS,OAGhCsD,EAAA,YAAAE,IAAA,2CACEG,IAAKC,IACH1E,KAAK+C,WAAa2B,CAAO,EAE3BC,GAAIzB,EACJ/C,MAAOH,KAAKG,MACZyE,YAAa5E,KAAK4E,YAClBnE,KAAMA,EACNL,SAAU+B,EACV9B,SAAUL,KAAKK,SACfC,SAAUN,KAAKM,SACfa,UAAWnB,KAAKmB,UAChB0D,aAAc7E,KAAK6E,aACnBlE,UAAWX,KAAKW,WAAasD,UAC7BrD,aAAcZ,KAAKY,cAAgBqD,UACnCa,WAAY9E,KAAKa,WACjB0D,MAAO,2CAA2CvE,KAAKU,mBAAmB8C,EAAYuB,QAAQ,QAAS,oDAAmD,aAC9I/E,KAAKqB,UAAS,kBACTrB,KAAKgF,eAAc,mBAClBjB,EAAW,eACf/D,KAAKoB,MAAQ,OAAS6C,UACpCgB,QAASjF,KAAK0B,YACdwD,QAASlF,KAAK+B,YACdoD,OAAQnF,KAAKgC,cAGhBqB,GACCe,EAAA,WAAAE,IAAA,2CACEC,MAAM,aACNa,GAAG,MACHC,QAAQ,kBACRC,MAAM,WACNC,OAAQvF,KAAKE,QACbsF,KAAK,SAEJxF,KAAKuD,c","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,c as i,h as e,a as o,t as n}from"./index.js";import{c as a,r}from"./p-DjF2m7bf.js";import{d as h}from"./p-DzPtYdXy.js";import{d as c}from"./p-kslioYhf.js";import{d}from"./p-Cea7rROU.js";import{d as l}from"./p-0XTyQNRG.js";import{d as f}from"./p-Cd1JnnVK.js";import{d as u}from"./p-9X_p0bHr.js";import{T as m,r as p,a as v}from"./p-CUL5_8JM.js";import{r as g}from"./p-CochmPyg.js";function w(t,s){const i=typeof t==="function"?t(s):t;return typeof i==="string"?{description:i}:i}class b{constructor(){this.records=[];this.listeners=new Set;this.nextId=0}add(t){const s=t.id||`ds-toast-${++this.nextId}`;const i=this.records.findIndex((t=>t.id===s));if(!t.title?.trim()&&!t.description?.trim()){console.warn(`[ds-toast] Toast "${s}" should provide a title or description.`)}if(i>=0){const e=this.records[i];const o={...e,...t,id:s,priority:t.priority??e.priority,transitionStatus:"active",closeReason:undefined,updateKey:e.updateKey+1,timerKey:e.timerKey+1};this.records=[o,...this.records.filter(((t,s)=>s!==i))];this.emit();return s}const e={...t,id:s,priority:t.priority??"low",transitionStatus:"starting",updateKey:0,timerKey:0};this.records=[e,...this.records];this.emit();return s}update(t,s){const i=this.records.findIndex((s=>s.id===t));if(i<0)return;const e=this.records[i];const o=Object.prototype.hasOwnProperty.call(s,"timeout")||e.type==="loading"&&s.type!==undefined&&s.type!=="loading";const n={...e,...s,id:t,priority:s.priority??e.priority,updateKey:e.updateKey+1,timerKey:o?e.timerKey+1:e.timerKey};this.records=this.records.map(((t,s)=>s===i?n:t));this.emit()}close(t,s="programmatic"){const i=this.records.findIndex((s=>s.id===t));if(i<0||this.records[i].transitionStatus==="ending")return;const e={...this.records[i],transitionStatus:"ending",closeReason:s};this.records=this.records.map(((t,s)=>s===i?e:t));this.emit();e.onClose?.({id:t,reason:s,toast:e})}closeAll(t="programmatic"){for(const s of[...this.records])this.close(s.id,t)}async promise(t,s){const i=w(s.loading,undefined);const e=this.add({...i,type:i.type??"loading",timeout:0});try{const i=await t;const o=w(s.success,i);this.update(e,{...o,type:o.type??"success",timeout:o.timeout});return i}catch(t){const i=w(s.error,t);this.update(e,{...i,type:i.type??"error",timeout:i.timeout});throw t}}subscribe(t){this.listeners.add(t);t(this.getSnapshot());return()=>{this.listeners.delete(t)}}getSnapshot(){return this.records.map((t=>({...t})))}activate(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="starting")return;this.records=this.records.map((s=>s.id===t?{...s,transitionStatus:"active"}:s));this.emit()}remove(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="ending")return null;const i=s.closeReason??"programmatic";this.records=this.records.filter((s=>s.id!==t));this.emit();const e={id:t,reason:i,toast:s};return e}notifyRemove(t){const{toast:s}=t;s.onRemove?.(t)}emit(){const t=this.getSnapshot();for(const s of this.listeners)s(t)}}function y(){return new b}const x=Symbol.for("@ds-mo/ui/default-toast-manager");const T=globalThis;const M=T[x];const k=M??y();if(!M)T[x]=k;const A=()=>`.ds-visually-hidden.sc-ds-toast-h,.ds-visually-hidden.sc-ds-toast{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}@media (forced-colors: active){.sc-ds-toast:root,.sc-ds-toast-h,.ds-forced-colors-scope.sc-ds-toast{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-toast-h{display:contents}.toast-region.sc-ds-toast{position:fixed;inset:0;z-index:var(--dimension-z-index-floating);pointer-events:none;outline:none}.toast-viewport.sc-ds-toast{position:absolute;right:var(--dimension-space-200);bottom:var(--dimension-space-200);display:grid;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)))}@media (max-width: 767px){[avoid-mobile-shell-bar].sc-ds-toast-h .toast-viewport.sc-ds-toast{bottom:calc( var(--dimension-space-200) + var(--dimension-stroke-width-012) + var(--dimension-space-100) + var(--dimension-size-500) + max(var(--dimension-space-100), env(safe-area-inset-bottom)) )}}.toast-positioner.sc-ds-toast{grid-area:1 / 1;align-self:end;justify-self:center;width:100%;pointer-events:auto;transform:translateY(calc(-1 * var(--toast-index) * var(--dimension-space-100)));transition:transform var(--effect-motion-short-3), width var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner.sc-ds-toast{width:calc(100% - 2 * var(--toast-index) * var(--dimension-space-100))}.toast-viewport[data-expanded].sc-ds-toast .toast-positioner.sc-ds-toast{transform:translateY(calc(-1 * var(--toast-offset-y)))}.toast-positioner[data-limited].sc-ds-toast{visibility:hidden;pointer-events:none}.toast-positioner--anchored.sc-ds-toast{position:fixed;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)));transform:none}.toast-positioner--anchored[data-positioned='false'].sc-ds-toast{visibility:hidden}.toast-surface.sc-ds-toast{position:relative;display:block;box-sizing:border-box;width:100%;height:var(--toast-height, auto);padding:var(--dimension-space-200);overflow:hidden;color:var(--color-foreground-primary);background-color:var(--color-background-primary);border-radius:var(--dimension-radius-050);box-shadow:var(--effect-elevation-elevated-floating);transform:translate(var(--toast-swipe-movement-x), var(--toast-swipe-movement-y));animation:toast-enter var(--effect-motion-short-2) both}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{animation:toast-exit var(--effect-motion-short-3) both}.toast-surface--swiping.sc-ds-toast{transition:none;user-select:none}.toast-content.sc-ds-toast{display:flex;flex-direction:column;min-width:0;padding-inline-end:var(--dimension-size-500);transition:opacity var(--effect-motion-short-3)}.toast-copy.sc-ds-toast{display:flex;flex-direction:column;min-width:0;min-height:var(--typography-lineheight-md);margin-block:calc(-1 * var(--dimension-space-025));gap:var(--dimension-space-050)}.toast-title.sc-ds-toast,.toast-description.sc-ds-toast{min-width:0}.toast-action.sc-ds-toast{align-self:start;margin-top:calc(var(--dimension-space-200) + var(--dimension-space-025))}.toast-close.sc-ds-toast{position:absolute;top:var(--dimension-space-100);right:var(--dimension-space-100);transition:opacity var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-content.sc-ds-toast,.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-close.sc-ds-toast{opacity:0}@keyframes toast-enter{from{opacity:0;transform:translateY(var(--dimension-space-100))}to{opacity:1;transform:translateY(0)}}@keyframes toast-exit{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.toast-positioner.sc-ds-toast,.toast-surface.sc-ds-toast,.toast-content.sc-ds-toast,.toast-close.sc-ds-toast,.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{transition:none;animation:none}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{opacity:0}}@media (forced-colors: active){.toast-surface.sc-ds-toast{box-shadow:none;outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}}`;const C=40;const P=10;const S="__global-stack__";const E='button,a,input,textarea,select,[role="button"],[data-ds-toast-swipe-ignore]';const F=new WeakMap;const D=new Set;let R=null;let j=0;const z=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.dsToastClose=i(this,"dsToastClose",7);this.dsToastRemove=i(this,"dsToastRemove",7);this.dsToastAction=i(this,"dsToastAction",7);this.manager=k;this.limit=3;this.timeout=m.animationDelayLong2;this.label="Notifications";this.closeLabel="Close notification";this.avoidMobileShellBar=false;this.swipeDirections=["down","right"];this.records=[];this.expanded=false;this.keyboardActive=false;this.swipe=null;this.layoutVersion=0;this.instanceId=++j;this.domIds=new Map;this.timers=new Map;this.closeWatchdogs=new Map;this.closeFrames=new Map;this.closeEvents=new Set;this.activationFrames=new Map;this.pauseReasons=new Set;this.hoveredIds=new Set;this.heights=new Map;this.measuredUpdateKeys=new Map;this.anchoredPositions=new Map;this.dismissedSwipeDirections=new Map;this.observedElements=new Set;this.pendingRemovals=[];this.unsubscribe=null;this.attachedManager=null;this.previousFocus=null;this.resizeObserver=null;this.mutationObserver=null;this.layoutFrame=null;this.activeSwipe=null;this.nextDomId=0;this.connected=false;this.pendingHoverLeave=false;this.handleWindowBlur=()=>this.pauseTimers("window");this.handleWindowFocus=()=>this.resumeTimers("window");this.handleVisibilityChange=()=>{if(document.hidden)this.pauseTimers("document");else this.resumeTimers("document")};this.handleFocusIn=()=>{const t=document.activeElement;if(!(t instanceof s)||!t.matches(":focus-visible"))return;R=this;this.keyboardActive=true;this.expanded=true;this.pauseTimers("focus")};this.handleFocusOut=t=>{const s=t.relatedTarget;if(s instanceof Node&&this.el.contains(s))return;if(!this.keyboardActive)return;this.keyboardActive=false;this.expanded=this.hoveredIds.size>0;this.resumeTimers("focus")};this.handleDocumentKeyDown=t=>{if(t.key!=="F6")return;const s=Array.from(D).filter((t=>t.activeRecords.length>0));const i=R&&R.activeRecords.length?R:s[s.length-1];if(i!==this)return;t.preventDefault();if(!this.el.contains(document.activeElement)){this.previousFocus=document.activeElement}this.keyboardActive=true;this.regionElement?.focus()};this.handleRegionKeyDown=t=>{if(t.key==="Escape"){const s=t.target;const i=s.closest(".toast-positioner");const e=i?.dataset["toastId"]??this.activeRecords[0]?.id;if(e){t.preventDefault();this.manager.close(e,"escape")}return}if(t.key==="Tab"&&t.shiftKey&&t.target===this.regionElement){t.preventDefault();this.restorePreviousFocus()}};this.handleWindowResize=()=>{this.heights.clear();this.measuredUpdateKeys.clear();this.layoutVersion+=1;this.scheduleLayout()};this.scheduleLayout=()=>{if(this.layoutFrame!==null)return;this.layoutFrame=requestAnimationFrame((()=>{this.layoutFrame=null;this.measureLayout()}))}}connectedCallback(){this.connect()}componentDidLoad(){this.connect()}connect(){if(this.connected)return;this.connected=true;this.resizeObserver??(this.resizeObserver=new ResizeObserver((()=>this.scheduleLayout())));this.mutationObserver??(this.mutationObserver=new MutationObserver((()=>this.scheduleLayout())));this.mutationObserver.observe(document.body,{childList:true,subtree:true});if(!this.unsubscribe)this.attachManager(this.manager);window.addEventListener("blur",this.handleWindowBlur);window.addEventListener("focus",this.handleWindowFocus);window.addEventListener("resize",this.handleWindowResize);window.addEventListener("scroll",this.scheduleLayout,true);document.addEventListener("keydown",this.handleDocumentKeyDown);document.addEventListener("visibilitychange",this.handleVisibilityChange);D.add(this);if(!R)R=this}componentDidRender(){this.syncObservedElements();this.flushPendingRemovals();this.scheduleLayout()}disconnectedCallback(){this.connected=false;this.flushPendingRemovals();this.detachManager();this.resetManagerState();this.resizeObserver?.disconnect();this.resizeObserver=null;this.mutationObserver?.disconnect();this.mutationObserver=null;this.observedElements.clear();if(this.layoutFrame!==null)cancelAnimationFrame(this.layoutFrame);this.layoutFrame=null;window.removeEventListener("blur",this.handleWindowBlur);window.removeEventListener("focus",this.handleWindowFocus);window.removeEventListener("resize",this.handleWindowResize);window.removeEventListener("scroll",this.scheduleLayout,true);document.removeEventListener("keydown",this.handleDocumentKeyDown);document.removeEventListener("visibilitychange",this.handleVisibilityChange);D.delete(this);if(R===this){const t=Array.from(D);R=t[t.length-1]??null}}onManagerChange(t){this.detachManager();this.resetManagerState();if(this.connected)this.attachManager(t)}onTimeoutChange(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}this.timers.clear();this.syncTimers()}attachManager(t){const s=F.get(t);if(s&&s!==this){console.warn("[ds-toast] A manager can control only one connected ds-toast instance.");return}F.set(t,this);this.attachedManager=t;this.unsubscribe=t.subscribe((t=>{this.records=t;this.syncLifecycle(t);this.scheduleLayout()}))}detachManager(){this.unsubscribe?.();this.unsubscribe=null;if(this.attachedManager&&F.get(this.attachedManager)===this){F.delete(this.attachedManager)}this.attachedManager=null}resetManagerState(){this.flushPendingRemovals();if(this.el.contains(document.activeElement))this.restorePreviousFocus();this.clearAllTimers();for(const t of this.activationFrames.values())cancelAnimationFrame(t);for(const t of this.closeFrames.values())cancelAnimationFrame(t);this.activationFrames.clear();this.closeFrames.clear();this.closeEvents.clear();this.pauseReasons.clear();this.hoveredIds.clear();this.pendingHoverLeave=false;this.heights.clear();this.measuredUpdateKeys.clear();this.anchoredPositions.clear();this.dismissedSwipeDirections.clear();this.domIds.clear();this.activeSwipe=null;this.swipe=null;this.expanded=false;this.keyboardActive=false;this.records=[];this.resizeObserver?.disconnect();this.observedElements.clear()}syncObservedElements(){const t=new Set(this.el.querySelectorAll(".toast-positioner"));for(const s of this.records){if(!s.positioner)continue;const i=this.resolveAnchor(s.positioner.anchor);if(i)t.add(i)}for(const s of this.observedElements){if(!t.has(s)){this.resizeObserver?.unobserve(s);this.observedElements.delete(s)}}for(const s of t){if(this.observedElements.has(s))continue;this.resizeObserver?.observe(s);this.observedElements.add(s)}}flushPendingRemovals(){for(const t of this.pendingRemovals.splice(0)){t.manager.notifyRemove(t.context);this.dsToastRemove.emit({id:t.context.id,toast:t.context.toast})}}syncLifecycle(t){const s=new Set(t.map((t=>t.id)));for(const t of this.hoveredIds){if(t!==S&&!s.has(t))this.hoveredIds.delete(t)}const i=t.some((t=>t.transitionStatus==="ending"));if(this.pendingHoverLeave&&!i&&!this.hoveredIds.size){this.pendingHoverLeave=false;this.expanded=false;this.resumeTimers("hover")}else if(!this.hoveredIds.size&&!this.pendingHoverLeave){this.resumeTimers("hover")}for(const[t,i]of this.timers){if(s.has(t))continue;if(i.handle)clearTimeout(i.handle);this.timers.delete(t)}for(const[t,i]of this.closeWatchdogs){if(s.has(t))continue;clearTimeout(i);this.closeWatchdogs.delete(t)}for(const[t,i]of this.activationFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.activationFrames.delete(t)}for(const[t,i]of this.closeFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.closeFrames.delete(t)}for(const t of this.domIds.keys()){if(s.has(t))continue;this.closeEvents.delete(t);this.domIds.delete(t);this.heights.delete(t);this.measuredUpdateKeys.delete(t);this.anchoredPositions.delete(t);this.dismissedSwipeDirections.delete(t)}for(const s of t){this.ensureDomId(s.id);if(s.transitionStatus==="starting"&&!this.activationFrames.has(s.id)){const t=this.attachedManager;const i=requestAnimationFrame((()=>{this.activationFrames.delete(s.id);t?.activate(s.id)}));this.activationFrames.set(s.id,i)}if(s.transitionStatus==="ending"){this.clearToastTimer(s.id);this.beginRemoval(s)}else{const t=this.closeWatchdogs.get(s.id);if(t)clearTimeout(t);this.closeWatchdogs.delete(s.id);const i=this.closeFrames.get(s.id);if(i)cancelAnimationFrame(i);this.closeFrames.delete(s.id);this.closeEvents.delete(s.id)}}this.syncTimers()}syncTimers(){const t=new Set;for(const s of this.records){if(s.transitionStatus!=="active")continue;t.add(s.id);const i=this.resolveToastTimeout(s);if(i<=0){this.clearToastTimer(s.id);continue}const e=this.timers.get(s.id);if(!e||e.timerKey!==s.timerKey){this.clearToastTimer(s.id);this.timers.set(s.id,{timerKey:s.timerKey,remaining:i,startedAt:0,handle:null})}if(!this.isPaused)this.startToastTimer(s.id)}for(const s of this.timers.keys()){if(!t.has(s))this.clearToastTimer(s)}}resolveToastTimeout(t){const s=t.timeout??this.timeout;if(typeof s==="number")return Math.max(0,s);return p(s,m.animationDelayLong2)}startToastTimer(t){const s=this.timers.get(t);if(!s||s.handle||s.remaining<=0)return;s.startedAt=Date.now();s.handle=setTimeout((()=>{s.handle=null;s.remaining=0;this.manager.close(t,"timeout")}),s.remaining)}pauseTimers(t){const s=this.isPaused;this.pauseReasons.add(t);if(s)return;const i=Date.now();for(const t of this.timers.values()){if(!t.handle)continue;clearTimeout(t.handle);t.handle=null;t.remaining=Math.max(0,t.remaining-(i-t.startedAt))}}resumeTimers(t){this.pauseReasons.delete(t);if(this.isPaused)return;for(const t of this.timers.keys())this.startToastTimer(t)}get isPaused(){return this.pauseReasons.size>0}clearToastTimer(t){const s=this.timers.get(t);if(s?.handle)clearTimeout(s.handle);this.timers.delete(t)}clearAllTimers(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}for(const t of this.closeWatchdogs.values())clearTimeout(t);this.timers.clear();this.closeWatchdogs.clear()}beginRemoval(t){if(!this.closeEvents.has(t.id)){this.closeEvents.add(t.id);this.dsToastClose.emit({id:t.id,reason:t.closeReason??"programmatic",toast:t});this.moveFocusAfterClose(t.id)}if(this.closeWatchdogs.has(t.id)||this.closeFrames.has(t.id))return;const s=v(m.motionShort3,m.animationDurationShort3);if(s<=0){queueMicrotask((()=>this.completeRemoval(t)));return}const i=requestAnimationFrame((()=>{this.closeFrames.delete(t.id);const i=this.records.find((s=>s.id===t.id));if(!i||i.transitionStatus!=="ending")return;this.closeWatchdogs.set(t.id,setTimeout((()=>this.completeRemoval(i)),s))}));this.closeFrames.set(t.id,i)}completeRemoval(t){const s=this.records.find((s=>s.id===t.id));if(!s||s.transitionStatus!=="ending")return;const i=this.closeWatchdogs.get(t.id);if(i)clearTimeout(i);this.closeWatchdogs.delete(t.id);const e=this.closeFrames.get(t.id);if(e)cancelAnimationFrame(e);this.closeFrames.delete(t.id);const o=this.attachedManager;const n=o?.remove(t.id);if(o&&n)this.pendingRemovals.push({manager:o,context:n})}handleAnimationComplete(t){if(t.transitionStatus==="ending")this.completeRemoval(t)}bindAnimationCancel(t,s){if(!t||t.dataset["cancelBound"]==="true")return;t.dataset["cancelBound"]="true";t.addEventListener("animationcancel",(()=>{const t=this.records.find((t=>t.id===s));if(t)this.handleAnimationComplete(t)}))}handlePointerEnter(t){R=this;this.pendingHoverLeave=false;this.hoveredIds.add(t);this.expanded=true;this.pauseTimers("hover")}handlePointerLeave(t){this.hoveredIds.delete(t);if(this.hoveredIds.size)return;if(this.records.some((t=>t.transitionStatus==="ending"))){this.pendingHoverLeave=true;return}this.expanded=false;this.resumeTimers("hover")}get regionElement(){return this.el.querySelector(".toast-region")}restorePreviousFocus(){this.previousFocus?.focus?.();this.previousFocus=null;this.keyboardActive=false}moveFocusAfterClose(t){const s=document.activeElement;const i=this.positionerElement(t);if(!s||!i?.contains(s))return;requestAnimationFrame((()=>{const s=this.activeRecords.find((s=>s.id!==t));const i=s?this.positionerElement(s.id)?.querySelector("ds-button-unfilled"):null;if(i?.setFocus)void i.setFocus();else if(s)this.regionElement?.focus();else this.restorePreviousFocus()}))}handleAction(t,s){const i={id:t.id,toast:t,originalEvent:s.detail};this.dsToastAction.emit(i);t.action?.onAction?.({id:t.id,data:t.data,manager:this.manager,originalEvent:s.detail})}handlePointerDown(t,s){if(s.button!==0)return;const i=s.target;if(i.closest(E))return;const e=s.currentTarget;e.setPointerCapture(s.pointerId);this.activeSwipe={id:t.id,pointerId:s.pointerId,pointerType:s.pointerType,startX:s.clientX,startY:s.clientY,maxDistance:0,cancelled:false,axis:null};this.swipe={id:t.id,x:0,y:0};if(s.pointerType==="touch")this.pauseTimers("swipe")}handlePointerMove(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId||s.cancelled)return;const i=t.clientX-s.startX;const e=t.clientY-s.startY;if(!s.axis&&Math.max(Math.abs(i),Math.abs(e))>1){s.axis=Math.abs(i)>=Math.abs(e)?"x":"y"}if(!s.axis)return;const o=s.axis==="x";const n=o?i>=0?"right":"left":e>=0?"down":"up";const a=this.swipeDirections.includes(n);const r=o?Math.abs(i):Math.abs(e);const h=a?r:Math.sqrt(r);const c=(o?i:e)<0?-h:h;const d=o?c:0;const l=o?0:c;if(s.maxDistance-h>=P){s.cancelled=true;this.cancelSwipe();return}s.maxDistance=Math.max(s.maxDistance,h);if(r>1)t.preventDefault();this.swipe={id:s.id,x:d,y:l,direction:a?n:undefined}}handlePointerUp(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId)return;const i=this.swipe;const e=i?Math.max(Math.abs(i.x),Math.abs(i.y)):0;const o=!s.cancelled&&!!i?.direction&&e>=C;const n=s.id;const a=s.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(a)this.resumeTimers("swipe");if(o&&i.direction){this.dismissedSwipeDirections.set(n,i.direction);this.manager.close(n,"swipe")}}handlePointerCancel(t){if(this.activeSwipe?.pointerId!==t.pointerId)return;this.cancelSwipe()}cancelSwipe(){const t=this.activeSwipe?.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(t)this.resumeTimers("swipe")}get touchAction(){const t=this.swipeDirections.includes("left")||this.swipeDirections.includes("right");const s=this.swipeDirections.includes("up")||this.swipeDirections.includes("down");if(t&&s)return"none";if(t)return"pan-y";if(s)return"pan-x";return"auto"}measureNaturalHeight(t,s){const i=t.querySelector(".toast-surface");if(!i)return 0;const e=t.style.width;const o=t.style.transition;const n=i.style.height;if(s){t.style.transition="none";t.style.width="100%"}i.style.height="auto";const a=i.getBoundingClientRect().height;i.style.height=n;if(s){t.style.width=e;t.getBoundingClientRect();t.style.transition=o}return a}measureLayout(){let t=false;for(const s of this.records){const i=this.positionerElement(s.id);if(!i)continue;let e=this.heights.get(s.id)??0;const o=e<=0||this.measuredUpdateKeys.get(s.id)!==s.updateKey;if(o){e=this.measureNaturalHeight(i,!s.positioner);if(e>0){if(this.heights.get(s.id)!==e)t=true;this.heights.set(s.id,e);this.measuredUpdateKeys.set(s.id,s.updateKey)}}if(!s.positioner)continue;const n=this.resolveAnchor(s.positioner.anchor);if(!n||e<=0){if(this.anchoredPositions.delete(s.id))t=true;continue}const h=i.getBoundingClientRect();const c=g(s.positioner.sideOffset,m.space050);const d=g(s.positioner.alignOffset,0);const l=a({anchorRect:n.getBoundingClientRect(),popupWidth:h.width,popupHeight:e,side:s.positioner.side??"top",align:s.positioner.align??"center",sideOffsetPx:c,alignOffsetPx:d,viewportPadPx:g(undefined,m.space200),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(n)});const f=this.anchoredPositions.get(s.id);if(!f||f.x!==l.x||f.y!==l.y||f.side!==l.resolvedSide){this.anchoredPositions.set(s.id,{x:l.x,y:l.y,side:l.resolvedSide});t=true}}if(t)this.layoutVersion+=1}resolveAnchor(t){return typeof t==="string"?document.getElementById(t):t}positionerElement(t){return Array.from(this.el.querySelectorAll(".toast-positioner")).find((s=>s.dataset["toastId"]===t))??null}ensureDomId(t){const s=this.domIds.get(t);if(s)return s;const i=++this.nextDomId;this.domIds.set(t,i);return i}get activeRecords(){return this.records.filter((t=>t.transitionStatus!=="ending"))}globalLayout(){const t=this.records.filter((t=>!t.positioner));let s=0;let i=0;const e=g(undefined,m.space200);const o=new Map;t.forEach(((t,n)=>{if(t.transitionStatus==="ending"){o.set(t.id,{index:n,offset:s,limited:false});return}const a=i>=Math.max(1,this.limit);o.set(t.id,{index:i,offset:s,limited:a});s+=(this.heights.get(t.id)??0)+e;i+=1}));return o}renderToast(t,s){const i=this.ensureDomId(t.id);const o=`ds-toast-${this.instanceId}-${i}-title`;const n=`ds-toast-${this.instanceId}-${i}-description`;const a=this.swipe?.id===t.id?this.swipe:null;const r=a?.direction??this.dismissedSwipeDirections.get(t.id);const h=!!t.positioner;const c=this.anchoredPositions.get(t.id);const d=t.priority==="high"&&!this.keyboardActive;const l=this.keyboardActive&&!s.limited?0:-1;const f=this.heights.get(t.id);return e("div",{ref:s=>this.bindAnimationCancel(s,t.id),class:{"toast-positioner":true,"toast-positioner--anchored":h,"toast-positioner--ending":t.transitionStatus==="ending"},"data-toast-id":t.id,"data-behind":!h&&s.index>0?"":undefined,"data-limited":s.limited?"":undefined,"data-positioned":h?String(!!c):undefined,"data-side":c?.side,inert:s.limited?true:undefined,"aria-hidden":s.limited?"true":undefined,style:{"--toast-index":String(s.index),"--toast-offset-y":`${s.offset}px`,"--toast-height":f?`${f}px`:undefined,zIndex:String(this.records.length-s.index),left:c?`${c.x}px`:undefined,top:c?`${c.y}px`:undefined},onAnimationEnd:()=>this.handleAnimationComplete(t)},e("div",{class:{"toast-surface":true,"toast-surface--swiping":!!a},role:t.priority==="high"?"alertdialog":"dialog","aria-modal":"false","aria-labelledby":t.title?o:t.description?n:undefined,"aria-describedby":t.title&&t.description?n:undefined,"aria-hidden":d?"true":undefined,"data-type":t.type,"data-priority":t.priority,"data-transition-status":t.transitionStatus,"data-swiping":a?"":undefined,"data-swipe-direction":r,style:{"--toast-swipe-movement-x":`${a?.x??0}px`,"--toast-swipe-movement-y":`${a?.y??0}px`,touchAction:this.touchAction},onPointerDown:s=>this.handlePointerDown(t,s),onPointerMove:t=>this.handlePointerMove(t),onPointerUp:t=>this.handlePointerUp(t),onPointerCancel:t=>this.handlePointerCancel(t),onPointerEnter:h?()=>this.handlePointerEnter(t.id):undefined,onPointerLeave:h?()=>this.handlePointerLeave(t.id):undefined},e("div",{class:"toast-content"},e("div",{class:"toast-copy"},t.title&&e("ds-text",{class:"toast-title",as:"div",variant:"text-title-small",color:"primary",textId:o},t.title),t.description&&e("ds-text",{class:"toast-description",as:"div",variant:"text-body-medium",color:"secondary",textId:n},t.description)),t.action&&e("ds-button-unfilled",{class:"toast-action",variant:"label",size:"md",type:"button",label:t.action.label,"aria-label":t.action.ariaLabel,hasBorder:true,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:s=>this.handleAction(t,s)})),e("ds-button-unfilled",{class:"toast-close",variant:"icon",size:"md",type:"button",icon:"Cross","aria-label":this.closeLabel,hasBorder:false,activeFill:false,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:()=>this.manager.close(t.id,"close-button")})))}render(){const t=this.globalLayout();const s=this.records.filter((t=>!t.positioner));const i=this.records.filter((t=>!!t.positioner));const n=this.records.filter((s=>s.priority==="high"&&s.transitionStatus!=="ending"&&!t.get(s.id)?.limited));return e(o,{key:"69186c1b9b5f6a5b8cebe8b0c21452ebbb430c35"},e("section",{key:"6c92e4d07f2adba0c13d7f68bab82c7e8ef8da42",class:"toast-region",role:"region","aria-label":this.label,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",tabIndex:-1,onFocusin:this.handleFocusIn,onFocusout:t=>this.handleFocusOut(t),onKeyDown:t=>this.handleRegionKeyDown(t)},e("div",{key:"0ca9142cde70f4dac9197a8aa05353540ee3b419",class:"toast-viewport","data-expanded":this.expanded?"":undefined,onPointerEnter:()=>this.handlePointerEnter(S),onPointerLeave:()=>this.handlePointerLeave(S)},s.map((s=>this.renderToast(s,t.get(s.id)??{index:0,offset:0,limited:false})))),e("div",{key:"fbdc19f1370cea72a5621466a98fb911faca304e",class:"toast-anchored-layer"},i.map((t=>this.renderToast(t,{index:0,offset:0,limited:false})))),e("div",{key:"3c4e3f71bfb0dd19d74ffa35e480f8003293c841",class:"toast-assertive-announcer ds-visually-hidden"},n.map((t=>e("div",{role:"alert","aria-atomic":"true"},[t.title,t.description].filter(Boolean).join(". ")))))))}get el(){return this}static get watchers(){return{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}}static get style(){return A()}},[2,"ds-toast",{manager:[16],limit:[2],timeout:[8],label:[1],closeLabel:[1,"close-label"],avoidMobileShellBar:[516,"avoid-mobile-shell-bar"],swipeDirections:[16],records:[32],expanded:[32],keyboardActive:[32],swipe:[32],layoutVersion:[32]},undefined,{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}]);function $(){if(typeof customElements==="undefined"){return}const t=["ds-toast","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-toast":if(!customElements.get(n(t))){customElements.define(n(t),z)}break;case"ds-badge":if(!customElements.get(n(t))){h()}break;case"ds-button-unfilled":if(!customElements.get(n(t))){c()}break;case"ds-icon":if(!customElements.get(n(t))){d()}break;case"ds-loader":if(!customElements.get(n(t))){l()}break;case"ds-text":if(!customElements.get(n(t))){f()}break;case"ds-tooltip":if(!customElements.get(n(t))){u()}break}}))}$();const L=z;const K=$;export{L as DsToast,K as defineCustomElement};
1
+ import{p as t,H as s,c as i,h as e,a as o,t as n}from"./index.js";import{c as a,r}from"./p-DjF2m7bf.js";import{d as h}from"./p-BMzn2Cmw.js";import{d as c}from"./p-6_CNVbqa.js";import{d}from"./p-Cea7rROU.js";import{d as l}from"./p-0XTyQNRG.js";import{d as f}from"./p-DQQsS9Rx.js";import{d as u}from"./p-DW8ssbfI.js";import{T as m,r as p,a as v}from"./p-CUL5_8JM.js";import{r as g}from"./p-CochmPyg.js";function w(t,s){const i=typeof t==="function"?t(s):t;return typeof i==="string"?{description:i}:i}class b{constructor(){this.records=[];this.listeners=new Set;this.nextId=0}add(t){const s=t.id||`ds-toast-${++this.nextId}`;const i=this.records.findIndex((t=>t.id===s));if(!t.title?.trim()&&!t.description?.trim()){console.warn(`[ds-toast] Toast "${s}" should provide a title or description.`)}if(i>=0){const e=this.records[i];const o={...e,...t,id:s,priority:t.priority??e.priority,transitionStatus:"active",closeReason:undefined,updateKey:e.updateKey+1,timerKey:e.timerKey+1};this.records=[o,...this.records.filter(((t,s)=>s!==i))];this.emit();return s}const e={...t,id:s,priority:t.priority??"low",transitionStatus:"starting",updateKey:0,timerKey:0};this.records=[e,...this.records];this.emit();return s}update(t,s){const i=this.records.findIndex((s=>s.id===t));if(i<0)return;const e=this.records[i];const o=Object.prototype.hasOwnProperty.call(s,"timeout")||e.type==="loading"&&s.type!==undefined&&s.type!=="loading";const n={...e,...s,id:t,priority:s.priority??e.priority,updateKey:e.updateKey+1,timerKey:o?e.timerKey+1:e.timerKey};this.records=this.records.map(((t,s)=>s===i?n:t));this.emit()}close(t,s="programmatic"){const i=this.records.findIndex((s=>s.id===t));if(i<0||this.records[i].transitionStatus==="ending")return;const e={...this.records[i],transitionStatus:"ending",closeReason:s};this.records=this.records.map(((t,s)=>s===i?e:t));this.emit();e.onClose?.({id:t,reason:s,toast:e})}closeAll(t="programmatic"){for(const s of[...this.records])this.close(s.id,t)}async promise(t,s){const i=w(s.loading,undefined);const e=this.add({...i,type:i.type??"loading",timeout:0});try{const i=await t;const o=w(s.success,i);this.update(e,{...o,type:o.type??"success",timeout:o.timeout});return i}catch(t){const i=w(s.error,t);this.update(e,{...i,type:i.type??"error",timeout:i.timeout});throw t}}subscribe(t){this.listeners.add(t);t(this.getSnapshot());return()=>{this.listeners.delete(t)}}getSnapshot(){return this.records.map((t=>({...t})))}activate(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="starting")return;this.records=this.records.map((s=>s.id===t?{...s,transitionStatus:"active"}:s));this.emit()}remove(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="ending")return null;const i=s.closeReason??"programmatic";this.records=this.records.filter((s=>s.id!==t));this.emit();const e={id:t,reason:i,toast:s};return e}notifyRemove(t){const{toast:s}=t;s.onRemove?.(t)}emit(){const t=this.getSnapshot();for(const s of this.listeners)s(t)}}function y(){return new b}const x=Symbol.for("@ds-mo/ui/default-toast-manager");const T=globalThis;const M=T[x];const k=M??y();if(!M)T[x]=k;const A=()=>`.ds-visually-hidden.sc-ds-toast-h,.ds-visually-hidden.sc-ds-toast{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}@media (forced-colors: active){.sc-ds-toast:root,.sc-ds-toast-h,.ds-forced-colors-scope.sc-ds-toast{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-toast-h{display:contents}.toast-region.sc-ds-toast{position:fixed;inset:0;z-index:var(--dimension-z-index-floating);pointer-events:none;outline:none}.toast-viewport.sc-ds-toast{position:absolute;right:var(--dimension-space-200);bottom:var(--dimension-space-200);display:grid;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)))}@media (max-width: 767px){[avoid-mobile-shell-bar].sc-ds-toast-h .toast-viewport.sc-ds-toast{bottom:calc( var(--dimension-space-200) + var(--dimension-stroke-width-012) + var(--dimension-space-100) + var(--dimension-size-500) + max(var(--dimension-space-100), env(safe-area-inset-bottom)) )}}.toast-positioner.sc-ds-toast{grid-area:1 / 1;align-self:end;justify-self:center;width:100%;pointer-events:auto;transform:translateY(calc(-1 * var(--toast-index) * var(--dimension-space-100)));transition:transform var(--effect-motion-short-3), width var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner.sc-ds-toast{width:calc(100% - 2 * var(--toast-index) * var(--dimension-space-100))}.toast-viewport[data-expanded].sc-ds-toast .toast-positioner.sc-ds-toast{transform:translateY(calc(-1 * var(--toast-offset-y)))}.toast-positioner[data-limited].sc-ds-toast{visibility:hidden;pointer-events:none}.toast-positioner--anchored.sc-ds-toast{position:fixed;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)));transform:none}.toast-positioner--anchored[data-positioned='false'].sc-ds-toast{visibility:hidden}.toast-surface.sc-ds-toast{position:relative;display:block;box-sizing:border-box;width:100%;height:var(--toast-height, auto);padding:var(--dimension-space-200);overflow:hidden;color:var(--color-foreground-primary);background-color:var(--color-background-primary);border-radius:var(--dimension-radius-050);box-shadow:var(--effect-elevation-elevated-floating);transform:translate(var(--toast-swipe-movement-x), var(--toast-swipe-movement-y));animation:toast-enter var(--effect-motion-short-2) both}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{animation:toast-exit var(--effect-motion-short-3) both}.toast-surface--swiping.sc-ds-toast{transition:none;user-select:none}.toast-content.sc-ds-toast{display:flex;flex-direction:column;min-width:0;padding-inline-end:var(--dimension-size-500);transition:opacity var(--effect-motion-short-3)}.toast-copy.sc-ds-toast{display:flex;flex-direction:column;min-width:0;min-height:var(--typography-lineheight-md);margin-block:calc(-1 * var(--dimension-space-025));gap:var(--dimension-space-050)}.toast-title.sc-ds-toast,.toast-description.sc-ds-toast{min-width:0}.toast-action.sc-ds-toast{align-self:start;margin-top:calc(var(--dimension-space-200) + var(--dimension-space-025))}.toast-close.sc-ds-toast{position:absolute;top:var(--dimension-space-100);right:var(--dimension-space-100);transition:opacity var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-content.sc-ds-toast,.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-close.sc-ds-toast{opacity:0}@keyframes toast-enter{from{opacity:0;transform:translateY(var(--dimension-space-100))}to{opacity:1;transform:translateY(0)}}@keyframes toast-exit{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.toast-positioner.sc-ds-toast,.toast-surface.sc-ds-toast,.toast-content.sc-ds-toast,.toast-close.sc-ds-toast,.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{transition:none;animation:none}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{opacity:0}}@media (forced-colors: active){.toast-surface.sc-ds-toast{box-shadow:none;outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}}`;const C=40;const P=10;const S="__global-stack__";const E='button,a,input,textarea,select,[role="button"],[data-ds-toast-swipe-ignore]';const F=new WeakMap;const D=new Set;let R=null;let j=0;const z=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.dsToastClose=i(this,"dsToastClose",7);this.dsToastRemove=i(this,"dsToastRemove",7);this.dsToastAction=i(this,"dsToastAction",7);this.manager=k;this.limit=3;this.timeout=m.animationDelayLong2;this.label="Notifications";this.closeLabel="Close notification";this.avoidMobileShellBar=false;this.swipeDirections=["down","right"];this.records=[];this.expanded=false;this.keyboardActive=false;this.swipe=null;this.layoutVersion=0;this.instanceId=++j;this.domIds=new Map;this.timers=new Map;this.closeWatchdogs=new Map;this.closeFrames=new Map;this.closeEvents=new Set;this.activationFrames=new Map;this.pauseReasons=new Set;this.hoveredIds=new Set;this.heights=new Map;this.measuredUpdateKeys=new Map;this.anchoredPositions=new Map;this.dismissedSwipeDirections=new Map;this.observedElements=new Set;this.pendingRemovals=[];this.unsubscribe=null;this.attachedManager=null;this.previousFocus=null;this.resizeObserver=null;this.mutationObserver=null;this.layoutFrame=null;this.activeSwipe=null;this.nextDomId=0;this.connected=false;this.pendingHoverLeave=false;this.handleWindowBlur=()=>this.pauseTimers("window");this.handleWindowFocus=()=>this.resumeTimers("window");this.handleVisibilityChange=()=>{if(document.hidden)this.pauseTimers("document");else this.resumeTimers("document")};this.handleFocusIn=()=>{const t=document.activeElement;if(!(t instanceof s)||!t.matches(":focus-visible"))return;R=this;this.keyboardActive=true;this.expanded=true;this.pauseTimers("focus")};this.handleFocusOut=t=>{const s=t.relatedTarget;if(s instanceof Node&&this.el.contains(s))return;if(!this.keyboardActive)return;this.keyboardActive=false;this.expanded=this.hoveredIds.size>0;this.resumeTimers("focus")};this.handleDocumentKeyDown=t=>{if(t.key!=="F6")return;const s=Array.from(D).filter((t=>t.activeRecords.length>0));const i=R&&R.activeRecords.length?R:s[s.length-1];if(i!==this)return;t.preventDefault();if(!this.el.contains(document.activeElement)){this.previousFocus=document.activeElement}this.keyboardActive=true;this.regionElement?.focus()};this.handleRegionKeyDown=t=>{if(t.key==="Escape"){const s=t.target;const i=s.closest(".toast-positioner");const e=i?.dataset["toastId"]??this.activeRecords[0]?.id;if(e){t.preventDefault();this.manager.close(e,"escape")}return}if(t.key==="Tab"&&t.shiftKey&&t.target===this.regionElement){t.preventDefault();this.restorePreviousFocus()}};this.handleWindowResize=()=>{this.heights.clear();this.measuredUpdateKeys.clear();this.layoutVersion+=1;this.scheduleLayout()};this.scheduleLayout=()=>{if(this.layoutFrame!==null)return;this.layoutFrame=requestAnimationFrame((()=>{this.layoutFrame=null;this.measureLayout()}))}}connectedCallback(){this.connect()}componentDidLoad(){this.connect()}connect(){if(this.connected)return;this.connected=true;this.resizeObserver??(this.resizeObserver=new ResizeObserver((()=>this.scheduleLayout())));this.mutationObserver??(this.mutationObserver=new MutationObserver((()=>this.scheduleLayout())));this.mutationObserver.observe(document.body,{childList:true,subtree:true});if(!this.unsubscribe)this.attachManager(this.manager);window.addEventListener("blur",this.handleWindowBlur);window.addEventListener("focus",this.handleWindowFocus);window.addEventListener("resize",this.handleWindowResize);window.addEventListener("scroll",this.scheduleLayout,true);document.addEventListener("keydown",this.handleDocumentKeyDown);document.addEventListener("visibilitychange",this.handleVisibilityChange);D.add(this);if(!R)R=this}componentDidRender(){this.syncObservedElements();this.flushPendingRemovals();this.scheduleLayout()}disconnectedCallback(){this.connected=false;this.flushPendingRemovals();this.detachManager();this.resetManagerState();this.resizeObserver?.disconnect();this.resizeObserver=null;this.mutationObserver?.disconnect();this.mutationObserver=null;this.observedElements.clear();if(this.layoutFrame!==null)cancelAnimationFrame(this.layoutFrame);this.layoutFrame=null;window.removeEventListener("blur",this.handleWindowBlur);window.removeEventListener("focus",this.handleWindowFocus);window.removeEventListener("resize",this.handleWindowResize);window.removeEventListener("scroll",this.scheduleLayout,true);document.removeEventListener("keydown",this.handleDocumentKeyDown);document.removeEventListener("visibilitychange",this.handleVisibilityChange);D.delete(this);if(R===this){const t=Array.from(D);R=t[t.length-1]??null}}onManagerChange(t){this.detachManager();this.resetManagerState();if(this.connected)this.attachManager(t)}onTimeoutChange(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}this.timers.clear();this.syncTimers()}attachManager(t){const s=F.get(t);if(s&&s!==this){console.warn("[ds-toast] A manager can control only one connected ds-toast instance.");return}F.set(t,this);this.attachedManager=t;this.unsubscribe=t.subscribe((t=>{this.records=t;this.syncLifecycle(t);this.scheduleLayout()}))}detachManager(){this.unsubscribe?.();this.unsubscribe=null;if(this.attachedManager&&F.get(this.attachedManager)===this){F.delete(this.attachedManager)}this.attachedManager=null}resetManagerState(){this.flushPendingRemovals();if(this.el.contains(document.activeElement))this.restorePreviousFocus();this.clearAllTimers();for(const t of this.activationFrames.values())cancelAnimationFrame(t);for(const t of this.closeFrames.values())cancelAnimationFrame(t);this.activationFrames.clear();this.closeFrames.clear();this.closeEvents.clear();this.pauseReasons.clear();this.hoveredIds.clear();this.pendingHoverLeave=false;this.heights.clear();this.measuredUpdateKeys.clear();this.anchoredPositions.clear();this.dismissedSwipeDirections.clear();this.domIds.clear();this.activeSwipe=null;this.swipe=null;this.expanded=false;this.keyboardActive=false;this.records=[];this.resizeObserver?.disconnect();this.observedElements.clear()}syncObservedElements(){const t=new Set(this.el.querySelectorAll(".toast-positioner"));for(const s of this.records){if(!s.positioner)continue;const i=this.resolveAnchor(s.positioner.anchor);if(i)t.add(i)}for(const s of this.observedElements){if(!t.has(s)){this.resizeObserver?.unobserve(s);this.observedElements.delete(s)}}for(const s of t){if(this.observedElements.has(s))continue;this.resizeObserver?.observe(s);this.observedElements.add(s)}}flushPendingRemovals(){for(const t of this.pendingRemovals.splice(0)){t.manager.notifyRemove(t.context);this.dsToastRemove.emit({id:t.context.id,toast:t.context.toast})}}syncLifecycle(t){const s=new Set(t.map((t=>t.id)));for(const t of this.hoveredIds){if(t!==S&&!s.has(t))this.hoveredIds.delete(t)}const i=t.some((t=>t.transitionStatus==="ending"));if(this.pendingHoverLeave&&!i&&!this.hoveredIds.size){this.pendingHoverLeave=false;this.expanded=false;this.resumeTimers("hover")}else if(!this.hoveredIds.size&&!this.pendingHoverLeave){this.resumeTimers("hover")}for(const[t,i]of this.timers){if(s.has(t))continue;if(i.handle)clearTimeout(i.handle);this.timers.delete(t)}for(const[t,i]of this.closeWatchdogs){if(s.has(t))continue;clearTimeout(i);this.closeWatchdogs.delete(t)}for(const[t,i]of this.activationFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.activationFrames.delete(t)}for(const[t,i]of this.closeFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.closeFrames.delete(t)}for(const t of this.domIds.keys()){if(s.has(t))continue;this.closeEvents.delete(t);this.domIds.delete(t);this.heights.delete(t);this.measuredUpdateKeys.delete(t);this.anchoredPositions.delete(t);this.dismissedSwipeDirections.delete(t)}for(const s of t){this.ensureDomId(s.id);if(s.transitionStatus==="starting"&&!this.activationFrames.has(s.id)){const t=this.attachedManager;const i=requestAnimationFrame((()=>{this.activationFrames.delete(s.id);t?.activate(s.id)}));this.activationFrames.set(s.id,i)}if(s.transitionStatus==="ending"){this.clearToastTimer(s.id);this.beginRemoval(s)}else{const t=this.closeWatchdogs.get(s.id);if(t)clearTimeout(t);this.closeWatchdogs.delete(s.id);const i=this.closeFrames.get(s.id);if(i)cancelAnimationFrame(i);this.closeFrames.delete(s.id);this.closeEvents.delete(s.id)}}this.syncTimers()}syncTimers(){const t=new Set;for(const s of this.records){if(s.transitionStatus!=="active")continue;t.add(s.id);const i=this.resolveToastTimeout(s);if(i<=0){this.clearToastTimer(s.id);continue}const e=this.timers.get(s.id);if(!e||e.timerKey!==s.timerKey){this.clearToastTimer(s.id);this.timers.set(s.id,{timerKey:s.timerKey,remaining:i,startedAt:0,handle:null})}if(!this.isPaused)this.startToastTimer(s.id)}for(const s of this.timers.keys()){if(!t.has(s))this.clearToastTimer(s)}}resolveToastTimeout(t){const s=t.timeout??this.timeout;if(typeof s==="number")return Math.max(0,s);return p(s,m.animationDelayLong2)}startToastTimer(t){const s=this.timers.get(t);if(!s||s.handle||s.remaining<=0)return;s.startedAt=Date.now();s.handle=setTimeout((()=>{s.handle=null;s.remaining=0;this.manager.close(t,"timeout")}),s.remaining)}pauseTimers(t){const s=this.isPaused;this.pauseReasons.add(t);if(s)return;const i=Date.now();for(const t of this.timers.values()){if(!t.handle)continue;clearTimeout(t.handle);t.handle=null;t.remaining=Math.max(0,t.remaining-(i-t.startedAt))}}resumeTimers(t){this.pauseReasons.delete(t);if(this.isPaused)return;for(const t of this.timers.keys())this.startToastTimer(t)}get isPaused(){return this.pauseReasons.size>0}clearToastTimer(t){const s=this.timers.get(t);if(s?.handle)clearTimeout(s.handle);this.timers.delete(t)}clearAllTimers(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}for(const t of this.closeWatchdogs.values())clearTimeout(t);this.timers.clear();this.closeWatchdogs.clear()}beginRemoval(t){if(!this.closeEvents.has(t.id)){this.closeEvents.add(t.id);this.dsToastClose.emit({id:t.id,reason:t.closeReason??"programmatic",toast:t});this.moveFocusAfterClose(t.id)}if(this.closeWatchdogs.has(t.id)||this.closeFrames.has(t.id))return;const s=v(m.motionShort3,m.animationDurationShort3);if(s<=0){queueMicrotask((()=>this.completeRemoval(t)));return}const i=requestAnimationFrame((()=>{this.closeFrames.delete(t.id);const i=this.records.find((s=>s.id===t.id));if(!i||i.transitionStatus!=="ending")return;this.closeWatchdogs.set(t.id,setTimeout((()=>this.completeRemoval(i)),s))}));this.closeFrames.set(t.id,i)}completeRemoval(t){const s=this.records.find((s=>s.id===t.id));if(!s||s.transitionStatus!=="ending")return;const i=this.closeWatchdogs.get(t.id);if(i)clearTimeout(i);this.closeWatchdogs.delete(t.id);const e=this.closeFrames.get(t.id);if(e)cancelAnimationFrame(e);this.closeFrames.delete(t.id);const o=this.attachedManager;const n=o?.remove(t.id);if(o&&n)this.pendingRemovals.push({manager:o,context:n})}handleAnimationComplete(t){if(t.transitionStatus==="ending")this.completeRemoval(t)}bindAnimationCancel(t,s){if(!t||t.dataset["cancelBound"]==="true")return;t.dataset["cancelBound"]="true";t.addEventListener("animationcancel",(()=>{const t=this.records.find((t=>t.id===s));if(t)this.handleAnimationComplete(t)}))}handlePointerEnter(t){R=this;this.pendingHoverLeave=false;this.hoveredIds.add(t);this.expanded=true;this.pauseTimers("hover")}handlePointerLeave(t){this.hoveredIds.delete(t);if(this.hoveredIds.size)return;if(this.records.some((t=>t.transitionStatus==="ending"))){this.pendingHoverLeave=true;return}this.expanded=false;this.resumeTimers("hover")}get regionElement(){return this.el.querySelector(".toast-region")}restorePreviousFocus(){this.previousFocus?.focus?.();this.previousFocus=null;this.keyboardActive=false}moveFocusAfterClose(t){const s=document.activeElement;const i=this.positionerElement(t);if(!s||!i?.contains(s))return;requestAnimationFrame((()=>{const s=this.activeRecords.find((s=>s.id!==t));const i=s?this.positionerElement(s.id)?.querySelector("ds-button-unfilled"):null;if(i?.setFocus)void i.setFocus();else if(s)this.regionElement?.focus();else this.restorePreviousFocus()}))}handleAction(t,s){const i={id:t.id,toast:t,originalEvent:s.detail};this.dsToastAction.emit(i);t.action?.onAction?.({id:t.id,data:t.data,manager:this.manager,originalEvent:s.detail})}handlePointerDown(t,s){if(s.button!==0)return;const i=s.target;if(i.closest(E))return;const e=s.currentTarget;e.setPointerCapture(s.pointerId);this.activeSwipe={id:t.id,pointerId:s.pointerId,pointerType:s.pointerType,startX:s.clientX,startY:s.clientY,maxDistance:0,cancelled:false,axis:null};this.swipe={id:t.id,x:0,y:0};if(s.pointerType==="touch")this.pauseTimers("swipe")}handlePointerMove(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId||s.cancelled)return;const i=t.clientX-s.startX;const e=t.clientY-s.startY;if(!s.axis&&Math.max(Math.abs(i),Math.abs(e))>1){s.axis=Math.abs(i)>=Math.abs(e)?"x":"y"}if(!s.axis)return;const o=s.axis==="x";const n=o?i>=0?"right":"left":e>=0?"down":"up";const a=this.swipeDirections.includes(n);const r=o?Math.abs(i):Math.abs(e);const h=a?r:Math.sqrt(r);const c=(o?i:e)<0?-h:h;const d=o?c:0;const l=o?0:c;if(s.maxDistance-h>=P){s.cancelled=true;this.cancelSwipe();return}s.maxDistance=Math.max(s.maxDistance,h);if(r>1)t.preventDefault();this.swipe={id:s.id,x:d,y:l,direction:a?n:undefined}}handlePointerUp(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId)return;const i=this.swipe;const e=i?Math.max(Math.abs(i.x),Math.abs(i.y)):0;const o=!s.cancelled&&!!i?.direction&&e>=C;const n=s.id;const a=s.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(a)this.resumeTimers("swipe");if(o&&i.direction){this.dismissedSwipeDirections.set(n,i.direction);this.manager.close(n,"swipe")}}handlePointerCancel(t){if(this.activeSwipe?.pointerId!==t.pointerId)return;this.cancelSwipe()}cancelSwipe(){const t=this.activeSwipe?.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(t)this.resumeTimers("swipe")}get touchAction(){const t=this.swipeDirections.includes("left")||this.swipeDirections.includes("right");const s=this.swipeDirections.includes("up")||this.swipeDirections.includes("down");if(t&&s)return"none";if(t)return"pan-y";if(s)return"pan-x";return"auto"}measureNaturalHeight(t,s){const i=t.querySelector(".toast-surface");if(!i)return 0;const e=t.style.width;const o=t.style.transition;const n=i.style.height;if(s){t.style.transition="none";t.style.width="100%"}i.style.height="auto";const a=i.getBoundingClientRect().height;i.style.height=n;if(s){t.style.width=e;t.getBoundingClientRect();t.style.transition=o}return a}measureLayout(){let t=false;for(const s of this.records){const i=this.positionerElement(s.id);if(!i)continue;let e=this.heights.get(s.id)??0;const o=e<=0||this.measuredUpdateKeys.get(s.id)!==s.updateKey;if(o){e=this.measureNaturalHeight(i,!s.positioner);if(e>0){if(this.heights.get(s.id)!==e)t=true;this.heights.set(s.id,e);this.measuredUpdateKeys.set(s.id,s.updateKey)}}if(!s.positioner)continue;const n=this.resolveAnchor(s.positioner.anchor);if(!n||e<=0){if(this.anchoredPositions.delete(s.id))t=true;continue}const h=i.getBoundingClientRect();const c=g(s.positioner.sideOffset,m.space050);const d=g(s.positioner.alignOffset,0);const l=a({anchorRect:n.getBoundingClientRect(),popupWidth:h.width,popupHeight:e,side:s.positioner.side??"top",align:s.positioner.align??"center",sideOffsetPx:c,alignOffsetPx:d,viewportPadPx:g(undefined,m.space200),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(n)});const f=this.anchoredPositions.get(s.id);if(!f||f.x!==l.x||f.y!==l.y||f.side!==l.resolvedSide){this.anchoredPositions.set(s.id,{x:l.x,y:l.y,side:l.resolvedSide});t=true}}if(t)this.layoutVersion+=1}resolveAnchor(t){return typeof t==="string"?document.getElementById(t):t}positionerElement(t){return Array.from(this.el.querySelectorAll(".toast-positioner")).find((s=>s.dataset["toastId"]===t))??null}ensureDomId(t){const s=this.domIds.get(t);if(s)return s;const i=++this.nextDomId;this.domIds.set(t,i);return i}get activeRecords(){return this.records.filter((t=>t.transitionStatus!=="ending"))}globalLayout(){const t=this.records.filter((t=>!t.positioner));let s=0;let i=0;const e=g(undefined,m.space200);const o=new Map;t.forEach(((t,n)=>{if(t.transitionStatus==="ending"){o.set(t.id,{index:n,offset:s,limited:false});return}const a=i>=Math.max(1,this.limit);o.set(t.id,{index:i,offset:s,limited:a});s+=(this.heights.get(t.id)??0)+e;i+=1}));return o}renderToast(t,s){const i=this.ensureDomId(t.id);const o=`ds-toast-${this.instanceId}-${i}-title`;const n=`ds-toast-${this.instanceId}-${i}-description`;const a=this.swipe?.id===t.id?this.swipe:null;const r=a?.direction??this.dismissedSwipeDirections.get(t.id);const h=!!t.positioner;const c=this.anchoredPositions.get(t.id);const d=t.priority==="high"&&!this.keyboardActive;const l=this.keyboardActive&&!s.limited?0:-1;const f=this.heights.get(t.id);return e("div",{ref:s=>this.bindAnimationCancel(s,t.id),class:{"toast-positioner":true,"toast-positioner--anchored":h,"toast-positioner--ending":t.transitionStatus==="ending"},"data-toast-id":t.id,"data-behind":!h&&s.index>0?"":undefined,"data-limited":s.limited?"":undefined,"data-positioned":h?String(!!c):undefined,"data-side":c?.side,inert:s.limited?true:undefined,"aria-hidden":s.limited?"true":undefined,style:{"--toast-index":String(s.index),"--toast-offset-y":`${s.offset}px`,"--toast-height":f?`${f}px`:undefined,zIndex:String(this.records.length-s.index),left:c?`${c.x}px`:undefined,top:c?`${c.y}px`:undefined},onAnimationEnd:()=>this.handleAnimationComplete(t)},e("div",{class:{"toast-surface":true,"toast-surface--swiping":!!a},role:t.priority==="high"?"alertdialog":"dialog","aria-modal":"false","aria-labelledby":t.title?o:t.description?n:undefined,"aria-describedby":t.title&&t.description?n:undefined,"aria-hidden":d?"true":undefined,"data-type":t.type,"data-priority":t.priority,"data-transition-status":t.transitionStatus,"data-swiping":a?"":undefined,"data-swipe-direction":r,style:{"--toast-swipe-movement-x":`${a?.x??0}px`,"--toast-swipe-movement-y":`${a?.y??0}px`,touchAction:this.touchAction},onPointerDown:s=>this.handlePointerDown(t,s),onPointerMove:t=>this.handlePointerMove(t),onPointerUp:t=>this.handlePointerUp(t),onPointerCancel:t=>this.handlePointerCancel(t),onPointerEnter:h?()=>this.handlePointerEnter(t.id):undefined,onPointerLeave:h?()=>this.handlePointerLeave(t.id):undefined},e("div",{class:"toast-content"},e("div",{class:"toast-copy"},t.title&&e("ds-text",{class:"toast-title",as:"div",variant:"text-title-small",color:"primary",textId:o},t.title),t.description&&e("ds-text",{class:"toast-description",as:"div",variant:"text-body-medium",color:"secondary",textId:n},t.description)),t.action&&e("ds-button-unfilled",{class:"toast-action",variant:"label",size:"md",type:"button",label:t.action.label,"aria-label":t.action.ariaLabel,hasBorder:true,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:s=>this.handleAction(t,s)})),e("ds-button-unfilled",{class:"toast-close",variant:"icon",size:"md",type:"button",icon:"Cross","aria-label":this.closeLabel,hasBorder:false,activeFill:false,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:()=>this.manager.close(t.id,"close-button")})))}render(){const t=this.globalLayout();const s=this.records.filter((t=>!t.positioner));const i=this.records.filter((t=>!!t.positioner));const n=this.records.filter((s=>s.priority==="high"&&s.transitionStatus!=="ending"&&!t.get(s.id)?.limited));return e(o,{key:"9f6a1c86e9ed9d501e0ca543b8567ceb7ca99566"},e("section",{key:"c499d97771ee57f1485cee6deb57b9bbc827a17c",class:"toast-region",role:"region","aria-label":this.label,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",tabIndex:-1,onFocusin:this.handleFocusIn,onFocusout:t=>this.handleFocusOut(t),onKeyDown:t=>this.handleRegionKeyDown(t)},e("div",{key:"057ddfbdc64d768a193bc381025f1f611db87efb",class:"toast-viewport","data-expanded":this.expanded?"":undefined,onPointerEnter:()=>this.handlePointerEnter(S),onPointerLeave:()=>this.handlePointerLeave(S)},s.map((s=>this.renderToast(s,t.get(s.id)??{index:0,offset:0,limited:false})))),e("div",{key:"7fad8be2595b3450785f4b63fdc6d2c4af30405b",class:"toast-anchored-layer"},i.map((t=>this.renderToast(t,{index:0,offset:0,limited:false})))),e("div",{key:"fc20ed42889a3212d6d36b582457d91eaf92aa87",class:"toast-assertive-announcer ds-visually-hidden"},n.map((t=>e("div",{role:"alert","aria-atomic":"true"},[t.title,t.description].filter(Boolean).join(". ")))))))}get el(){return this}static get watchers(){return{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}}static get style(){return A()}},[2,"ds-toast",{manager:[16],limit:[2],timeout:[8],label:[1],closeLabel:[1,"close-label"],avoidMobileShellBar:[516,"avoid-mobile-shell-bar"],swipeDirections:[16],records:[32],expanded:[32],keyboardActive:[32],swipe:[32],layoutVersion:[32]},undefined,{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}]);function $(){if(typeof customElements==="undefined"){return}const t=["ds-toast","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-toast":if(!customElements.get(n(t))){customElements.define(n(t),z)}break;case"ds-badge":if(!customElements.get(n(t))){h()}break;case"ds-button-unfilled":if(!customElements.get(n(t))){c()}break;case"ds-icon":if(!customElements.get(n(t))){d()}break;case"ds-loader":if(!customElements.get(n(t))){l()}break;case"ds-text":if(!customElements.get(n(t))){f()}break;case"ds-tooltip":if(!customElements.get(n(t))){u()}break}}))}$();const L=z;const I=$;export{L as DsToast,I as defineCustomElement};
2
2
  //# sourceMappingURL=ds-toast.js.map
@@ -1,2 +1,2 @@
1
- import{T as o,d as s}from"./p-bHnk8t5I.js";const t=o;const n=s;export{t as DsTooltipChart,n as defineCustomElement};
1
+ import{T as o,d as s}from"./p-C68oSTb1.js";const t=o;const p=s;export{t as DsTooltipChart,p as defineCustomElement};
2
2
  //# sourceMappingURL=ds-tooltip-chart.js.map
@@ -1,2 +1,2 @@
1
- import{T as o,d as s}from"./p-9X_p0bHr.js";const p=o;const r=s;export{p as DsTooltip,r as defineCustomElement};
1
+ import{T as s,d as o}from"./p-DW8ssbfI.js";const t=s;const p=o;export{t as DsTooltip,p as defineCustomElement};
2
2
  //# sourceMappingURL=ds-tooltip.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,h as e,a as i,t as n}from"./index.js";import{d as a}from"./p-Cd1JnnVK.js";const c=()=>`.sc-ds-typing-indicator-h{display:block;width:100%;min-width:0;box-sizing:border-box}`;const o=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.label="Typing…"}render(){return e(i,{key:"9a4a550379b4e9b748c4dc40c3dfd980ce56152d",role:"status","aria-live":"polite","aria-atomic":"true"},e("ds-text",{key:"fc5b38ab02baa0e220ca99c46db73548b4fff984",as:"span",variant:"text-body-medium",color:"secondary",shimmer:true},this.label))}static get style(){return c()}},[2,"ds-typing-indicator",{label:[1]}]);function r(){if(typeof customElements==="undefined"){return}const t=["ds-typing-indicator","ds-text"];t.forEach((t=>{switch(t){case"ds-typing-indicator":if(!customElements.get(n(t))){customElements.define(n(t),o)}break;case"ds-text":if(!customElements.get(n(t))){a()}break}}))}r();const d=o;const m=r;export{d as DsTypingIndicator,m as defineCustomElement};
1
+ import{p as t,H as s,h as e,a as i,t as n}from"./index.js";import{d as o}from"./p-DQQsS9Rx.js";const r=()=>`.sc-ds-typing-indicator-h{display:block;width:100%;min-width:0;box-sizing:border-box}`;const a=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.label="Typing…"}render(){return e(i,{key:"d887b9cf3000d5096b60d4181f2bb4c385c0ac85",role:"status","aria-live":"polite","aria-atomic":"true"},e("ds-text",{key:"3d7bf41fb3788107b354a7113eeb429d9bb45ebe",as:"span",variant:"text-body-medium",color:"secondary",shimmer:true},this.label))}static get style(){return r()}},[2,"ds-typing-indicator",{label:[1]}]);function c(){if(typeof customElements==="undefined"){return}const t=["ds-typing-indicator","ds-text"];t.forEach((t=>{switch(t){case"ds-typing-indicator":if(!customElements.get(n(t))){customElements.define(n(t),a)}break;case"ds-text":if(!customElements.get(n(t))){o()}break}}))}c();const d=a;const b=c;export{d as DsTypingIndicator,b as defineCustomElement};
2
2
  //# sourceMappingURL=ds-typing-indicator.js.map