@ds-mo/ui 14.22.0 → 14.22.1

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 (92) hide show
  1. package/dist/.package-ready.json +1 -1
  2. package/dist/agent-patterns.json +1 -1
  3. package/dist/agent.json +1 -1
  4. package/dist/components/ds-agent-questionnaire.js +1 -1
  5. package/dist/components/ds-agent-response.js +1 -1
  6. package/dist/components/ds-banner.js +1 -1
  7. package/dist/components/ds-bar-nav.js +1 -1
  8. package/dist/components/ds-bar-title.js +1 -1
  9. package/dist/components/ds-bar-workflow.js +1 -1
  10. package/dist/components/ds-button-unfilled.js +1 -1
  11. package/dist/components/ds-card-chart.js +1 -1
  12. package/dist/components/ds-card-overview.js +1 -1
  13. package/dist/components/ds-card-overview.js.map +1 -1
  14. package/dist/components/ds-card-setting.js +1 -1
  15. package/dist/components/ds-code-block.js +1 -1
  16. package/dist/components/ds-filter-menu.js +1 -1
  17. package/dist/components/ds-input.js +1 -1
  18. package/dist/components/ds-markdown.js +1 -1
  19. package/dist/components/ds-menu.js +1 -1
  20. package/dist/components/ds-message-actions.js +1 -1
  21. package/dist/components/ds-message-composer.js +1 -1
  22. package/dist/components/ds-message-scroller.js +1 -1
  23. package/dist/components/ds-mobile-header.js +1 -1
  24. package/dist/components/ds-mobile-section-switcher.js +1 -1
  25. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  26. package/dist/components/ds-modal.js +1 -1
  27. package/dist/components/ds-pagination.js +1 -1
  28. package/dist/components/ds-panel-nav.js +1 -1
  29. package/dist/components/ds-panel-tool-header.js +1 -1
  30. package/dist/components/ds-panel-tool-search.js +1 -1
  31. package/dist/components/ds-panel-tools.js +1 -1
  32. package/dist/components/ds-select.js +1 -1
  33. package/dist/components/ds-shell-app.js +1 -1
  34. package/dist/components/ds-shell-tools.js +1 -1
  35. package/dist/components/ds-table-filter.js +1 -1
  36. package/dist/components/ds-table-group.js +1 -1
  37. package/dist/components/ds-table-saved-views.js +1 -1
  38. package/dist/components/ds-table-search.js +1 -1
  39. package/dist/components/ds-table-sort.js +1 -1
  40. package/dist/components/ds-table.js +1 -1
  41. package/dist/components/ds-table.js.map +1 -1
  42. package/dist/components/ds-toast.js +1 -1
  43. package/dist/components/ds-tooltip.js +1 -1
  44. package/dist/components/{p-DnZ7DNaz.js → p--68f7nIx.js} +2 -2
  45. package/dist/components/{p-CZ144LS5.js → p-0X-4KGQf.js} +2 -2
  46. package/dist/components/{p-DSy1oOnd.js → p-7MWaWl8w.js} +2 -2
  47. package/dist/components/{p-hYjmOPCI.js → p-9M0ak2q_.js} +2 -2
  48. package/dist/components/{p-pnO8tAYB.js → p-9X_p0bHr.js} +2 -2
  49. package/dist/components/{p-BFit8o0r.js → p-BIaHDBfP.js} +2 -2
  50. package/dist/components/{p-9ykZwPlI.js → p-CL0tECXf.js} +2 -2
  51. package/dist/components/{p-9ykZwPlI.js.map → p-CL0tECXf.js.map} +1 -1
  52. package/dist/components/{p-Bd8I2oXN.js → p-COFw_fcj.js} +2 -2
  53. package/dist/components/{p-D36EmETH.js → p-CilwchJH.js} +2 -2
  54. package/dist/components/{p-Cnsvgx1M.js → p-CrYJnDev.js} +2 -2
  55. package/dist/components/{p-_C-XRpCB.js → p-CvHrCyuz.js} +2 -2
  56. package/dist/components/{p-De0qjzPu.js → p-DAFR4U9P.js} +2 -2
  57. package/dist/components/{p-CeKa4VbU.js → p-DXbryJHz.js} +2 -2
  58. package/dist/components/{p-CFkZSDwI.js → p-DeK_6Uym.js} +2 -2
  59. package/dist/components/{p-Dit6JmAK.js → p-DiyO47xX.js} +2 -2
  60. package/dist/components/{p-DCbKsABt.js → p-DjF2m7bf.js} +2 -2
  61. package/dist/components/{p-DCbKsABt.js.map → p-DjF2m7bf.js.map} +1 -1
  62. package/dist/components/{p-CB3fv_Oh.js → p-DrVA5L25.js} +2 -2
  63. package/dist/components/{p-BbG7nOcz.js → p-DzVYGJJv.js} +2 -2
  64. package/dist/components/{p-B1wMpt1z.js → p-FitB53eM.js} +2 -2
  65. package/dist/components/{p-6rB0eAda.js → p-FxtgCvhA.js} +2 -2
  66. package/dist/components/{p-pxN8JGEh.js → p-nVv71P3f.js} +2 -2
  67. package/dist/docs/components.json +1 -1
  68. package/dist/mcp-data/registry/card-overview.json +1 -1
  69. package/dist/mcp-data/registry/modal.json +1 -1
  70. package/dist/mcp-data/registry/table.json +1 -1
  71. package/dist/types/components/CardOverview/CardOverview.d.ts +1 -0
  72. package/dist/types/components/Table/Table.d.ts +3 -0
  73. package/package.json +1 -1
  74. /package/dist/components/{p-DnZ7DNaz.js.map → p--68f7nIx.js.map} +0 -0
  75. /package/dist/components/{p-CZ144LS5.js.map → p-0X-4KGQf.js.map} +0 -0
  76. /package/dist/components/{p-DSy1oOnd.js.map → p-7MWaWl8w.js.map} +0 -0
  77. /package/dist/components/{p-hYjmOPCI.js.map → p-9M0ak2q_.js.map} +0 -0
  78. /package/dist/components/{p-pnO8tAYB.js.map → p-9X_p0bHr.js.map} +0 -0
  79. /package/dist/components/{p-BFit8o0r.js.map → p-BIaHDBfP.js.map} +0 -0
  80. /package/dist/components/{p-Bd8I2oXN.js.map → p-COFw_fcj.js.map} +0 -0
  81. /package/dist/components/{p-D36EmETH.js.map → p-CilwchJH.js.map} +0 -0
  82. /package/dist/components/{p-Cnsvgx1M.js.map → p-CrYJnDev.js.map} +0 -0
  83. /package/dist/components/{p-_C-XRpCB.js.map → p-CvHrCyuz.js.map} +0 -0
  84. /package/dist/components/{p-De0qjzPu.js.map → p-DAFR4U9P.js.map} +0 -0
  85. /package/dist/components/{p-CeKa4VbU.js.map → p-DXbryJHz.js.map} +0 -0
  86. /package/dist/components/{p-CFkZSDwI.js.map → p-DeK_6Uym.js.map} +0 -0
  87. /package/dist/components/{p-Dit6JmAK.js.map → p-DiyO47xX.js.map} +0 -0
  88. /package/dist/components/{p-CB3fv_Oh.js.map → p-DrVA5L25.js.map} +0 -0
  89. /package/dist/components/{p-BbG7nOcz.js.map → p-DzVYGJJv.js.map} +0 -0
  90. /package/dist/components/{p-B1wMpt1z.js.map → p-FitB53eM.js.map} +0 -0
  91. /package/dist/components/{p-6rB0eAda.js.map → p-FxtgCvhA.js.map} +0 -0
  92. /package/dist/components/{p-pxN8JGEh.js.map → p-nVv71P3f.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as i,a,t as n}from"./index.js";import{c as l,d as o}from"./p-Bd8I2oXN.js";import{C as h,c as r,a as p,b as d,r as c,d as u}from"./p-B1wMpt1z.js";import{i as b,b as m,c as f,r as g,S as v,d as _}from"./p-CgGcgMjs.js";import{d as y}from"./p-D9wZlB_N.js";import{d as w}from"./p-DzPtYdXy.js";import{d as k}from"./p-DnZ7DNaz.js";import{d as x}from"./p-BcxidW9k.js";import{d as C}from"./p-BnTPuV3x.js";import{d as S}from"./p-DSy1oOnd.js";import{d as D}from"./p-Cea7rROU.js";import{d as M}from"./p-0XTyQNRG.js";import{d as L}from"./p-CFkZSDwI.js";import{d as P}from"./p-pUOA3iDG.js";import{d as T}from"./p-6rB0eAda.js";import{d as B}from"./p-CZ144LS5.js";import{d as A}from"./p-De0qjzPu.js";import{d as N}from"./p-CB3fv_Oh.js";import{d as j}from"./p-BbG7nOcz.js";import{d as z}from"./p-5Z4oYuiK.js";import{d as E}from"./p-B0OZx3JB.js";import{d as I}from"./p-_C-XRpCB.js";import{d as $}from"./p-XaCYqck3.js";import{d as O}from"./p-DGkn8FwV.js";import{d as G}from"./p-Bjq1KP_Y.js";import{d as F}from"./p-DbLLH3hr.js";import{d as R}from"./p-Cd1JnnVK.js";import{d as V}from"./p-pnO8tAYB.js";const H={k:"search",a:"agents",s:"stacks",m:"messages",n:"activity","/":"help"};function K(e){return!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function U(e){if(!e||typeof e!=="object")return false;if(!("closest"in e)||typeof e.closest!=="function")return false;const s=e;const t=s.closest('input, textarea, select, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]');if(t)return true;const i=s.getAttribute("role");if(i==="textbox"||i==="combobox"||i==="searchbox")return true;return Boolean(s.isContentEditable)}function Z(e){if(e.key==="["||e.code==="BracketLeft")return"[";if(e.key==="]"||e.code==="BracketRight")return"]";return e.key.length===1?e.key.toLowerCase():e.key.toLowerCase()}function W(e){if(!K(e))return null;const s=Z(e);if(s==="[")return"toggle-panel-nav";if(s==="]")return"close-panel-tools";const t=H[s];if(t)return`open-tool:${t}`;return null}const q=["none","cool","neutral","warm","fresh"];const X="neutral";const Y={cool:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-blue-strong-background)",position:100}]},neutral:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-grey-strong-background)",position:100}]},warm:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-yellow-strong-background)",position:100}]},fresh:{opacity:.4,stops:[{color:"var(--color-color-intent-cyan-faint-background)",position:0},{color:"var(--color-background-transparent)",position:47},{color:"var(--color-background-transparent)",position:58},{color:"var(--color-color-intent-red-faint-background)",position:83},{color:"var(--color-color-intent-pink-faint-background)",position:100}]}};const J="100% 100% at 0% 0%";function Q(e){const s=te(e);return s==="none"?null:Y[s]}function ee(e){return String(Q(e)?.opacity??0)}function se(e){return q.includes(e)}function te(e){return e!=null&&se(e)?e:X}function ie(e){const s=te(e);if(s==="none")return"none";return ae(Y[s].stops)}function ae(e){const s=e.map((e=>`${e.color} ${e.position}%`)).join(", ");return`radial-gradient(${J}, ${s})`}const ne="--ds-shell-gradient-image";const le="--ds-shell-gradient-size";const oe="--ds-shell-gradient-position-panel";const he="--ds-shell-gradient-position-bar";const re="--ds-shell-gradient-opacity";function pe(e=X){return ie(e)}function de(e){const s=typeof globalThis.window!=="undefined"?globalThis.window:undefined;if(!s)return{width:0,height:0};const t=s.visualViewport;return{width:Math.round(t?.width??s.innerWidth),height:Math.round(t?.height??s.innerHeight)}}function ce(e){return`${Math.round(e.width)}px ${Math.round(e.height)}px`}function ue(){return"0 0"}function be(e){return`${-Math.round(e)}px 0`}function me(e,s){if(typeof document==="undefined")return 0;const t=document.createElement("div");t.style.cssText="position:absolute;visibility:hidden;pointer-events:none;height:0;width:var("+s+");";e.appendChild(t);const i=t.getBoundingClientRect().width;e.removeChild(t);return i}function fe(e){return{expandedPx:me(e,"--_nav-width"),collapsedPx:me(e,"--_nav-width-collapsed")}}function ge(e,s){if(s?.classList.contains("panel-nav--collapsed"))return true;const t=e?.collapsed;return t===true}function ve(e,s){return s?e.collapsedPx:e.expandedPx}const _e=()=>`.sc-ds-shell-app-h{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;overflow:hidden;overscroll-behavior:none;font-family:var(--typography-font-family-ui, system-ui);--ds-shell-panel-tools-width:var(--dimension-panel-width-xs);--ds-shell-gradient-context:flat}.sc-ds-shell-app-h{--_shell-chrome-bg:var(--color-background-secondary)}.shell-app--gradient.sc-ds-shell-app-h{--ds-shell-gradient-context:gradient}.shell-app__row.sc-ds-shell-app{display:flex;flex:1 1 0;min-height:0;position:relative}.shell-app__banner.sc-ds-shell-app{flex:0 0 auto;min-width:0;position:relative;z-index:5}.shell-app__banner.sc-ds-shell-app-s>ds-banner,.shell-app__banner .sc-ds-shell-app-s>ds-banner{display:grid;width:100%}.shell-app__chrome.sc-ds-shell-app{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden;background-color:var(--_shell-chrome-bg)}.shell-app--gradient.sc-ds-shell-app-h .shell-app__chrome.sc-ds-shell-app::before{content:'';position:absolute;inset:0;pointer-events:none;background-position:0 0;background-attachment:fixed;z-index:1;opacity:var(--ds-shell-gradient-opacity, 1);background-image:var(--ds-shell-gradient-image, none);background-size:var(--ds-shell-gradient-size, auto);background-repeat:no-repeat}.shell-app__paper-texture.sc-ds-shell-app{z-index:2}.shell-app__panel.sc-ds-shell-app{flex:0 0 auto;min-height:0;height:100%;position:relative;z-index:2}.shell-app__panel.sc-ds-shell-app-s>ds-panel-nav,.shell-app__panel .sc-ds-shell-app-s>ds-panel-nav{display:block;height:100%}.shell-app__panel.sc-ds-shell-app>ds-panel-nav.sc-ds-shell-app{display:block;height:100%}.shell-app__main.sc-ds-shell-app{flex:1 1 auto;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0, 1fr) auto;grid-template-rows:auto minmax(0, 1fr);grid-template-areas:'bar tools' 'content tools';position:relative;z-index:1}.shell-app__mobile-sheet-nav.sc-ds-shell-app,.shell-app__mobile-bar-nav.sc-ds-shell-app{display:none}.shell-app__bar.sc-ds-shell-app{grid-area:bar;flex:0 0 auto;min-width:0}.shell-app__bar.sc-ds-shell-app-s>ds-bar-nav,.shell-app__bar .sc-ds-shell-app-s>ds-bar-nav{display:block}.shell-app__bar.sc-ds-shell-app-s>ds-bar-title,.shell-app__bar .sc-ds-shell-app-s>ds-bar-title{display:block}.shell-app__bar.sc-ds-shell-app>ds-bar-nav.sc-ds-shell-app{display:block}.shell-app__bar.sc-ds-shell-app>ds-bar-title.sc-ds-shell-app{display:block}.shell-app__content.sc-ds-shell-app{grid-area:content;flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:none;contain:layout}.shell-app__content.sc-ds-shell-app:focus,.shell-app__content.sc-ds-shell-app:focus-visible{outline:none}.shell-app__content.sc-ds-shell-app{position:relative;z-index:1;background-color:var(--color-background-primary)}.shell-app__tools.sc-ds-shell-app{grid-area:tools;flex:0 0 auto;min-width:0;min-height:0;height:100%;display:flex;position:relative;z-index:0;overflow:hidden}.shell-app__tools.sc-ds-shell-app-s>ds-panel-tools,.shell-app__tools .sc-ds-shell-app-s>ds-panel-tools{display:block;height:100%;min-height:0}.shell-app__tools.sc-ds-shell-app-s>ds-shell-tools,.shell-app__tools .sc-ds-shell-app-s>ds-shell-tools{display:block;height:100%;min-height:0}.shell-app__tools.sc-ds-shell-app>ds-shell-tools.sc-ds-shell-app{display:block;height:100%;min-height:0}.shell-app__tool-slot-proxy.sc-ds-shell-app{display:block;width:100%;height:100%;min-width:0;min-height:0}.shell-app__content.sc-ds-shell-app>ds-shell-page.sc-ds-shell-app{display:block;min-height:100%}.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__panel.sc-ds-shell-app,.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__bar.sc-ds-shell-app,.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app{visibility:hidden}.shell-app--mobile.sc-ds-shell-app-h{--_shell-chrome-bg:var(--color-background-primary);padding-block-start:env(safe-area-inset-top)}.shell-app--mobile.shell-app--foreground-refresh.sc-ds-shell-app-h .shell-app__main.sc-ds-shell-app{transform:translateZ(0)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__chrome.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__panel.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__bar.sc-ds-shell-app{display:none}.shell-app--mobile.sc-ds-shell-app-h .shell-app__main.sc-ds-shell-app{width:100%;box-sizing:border-box;grid-template-columns:minmax(0, 1fr);grid-template-rows:minmax(0, 1fr) auto;grid-template-areas:'stage' 'mobile-bar-nav';background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-sheet-nav.sc-ds-shell-app{grid-area:stage;min-width:0;min-height:0;height:100%;position:relative}.shell-app--mobile.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app{z-index:1;overflow:auto}.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app{z-index:2;width:100%;overflow:hidden;background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-sheet-nav.sc-ds-shell-app{display:block;z-index:3;overflow:hidden;background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-bar-nav.sc-ds-shell-app{grid-area:mobile-bar-nav;display:block;min-width:0;position:relative;z-index:4}.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools[hidden].sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-sheet-nav[hidden].sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-bar-nav[hidden].sc-ds-shell-app{display:none}.shell-app--mobile-tool-active.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile-sheet-nav-open.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile-sheet-nav-open.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app{visibility:hidden}`;const ye=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsResponsiveModeChange=t(this,"dsResponsiveModeChange",7);this.dsNavSelect=t(this,"dsNavSelect",7);this.dsTabChange=t(this,"dsTabChange",7);this.dsNavChildSelect=t(this,"dsNavChildSelect",7);this.dsSubsectionChange=t(this,"dsSubsectionChange",7);this.dsPageBack=t(this,"dsPageBack",7);this.dsBreadcrumbSelect=t(this,"dsBreadcrumbSelect",7);this.dsPageAction=t(this,"dsPageAction",7);this.dsToolChange=t(this,"dsToolChange",7);this.dsHeaderBack=t(this,"dsHeaderBack",7);this.dsHeaderAction=t(this,"dsHeaderAction",7);this.dsPresentationChange=t(this,"dsPresentationChange",7);this.dsBrowseContextChange=t(this,"dsBrowseContextChange",7);this.dsNavFooterAction=t(this,"dsNavFooterAction",7);this.dsNavUserAction=t(this,"dsNavUserAction",7);this.composition="managed";this.navigation={};this.sectionNavigation="bar";this.pageChrome={};this.tools={};this.navStyle="dashboard";this.gradientPreset=X;this.shortcutsEnabled=true;this.mobileDestination="area";this.mobileSheetNavOpen=false;this.toolsFullscreen=false;this.resolvedMode="desktop";this.managedToolsOpen=false;this.managedActiveTool="";this.managedToolPresentation="drawer";this.managedMobileDestination="area";this.managedMobileSheetNavOpen=false;this.managedInboxTool="";this.managedBrowseContext="dashboard";this.resizeObserver=null;this.hasLoaded=false;this.foregroundRefreshTimer=null;this.panelNavTransition=new h;this.chromeSyncCoalescer=r((()=>this.syncChrome()));this.panelWidthTokens={expandedPx:0,collapsedPx:0};this.cachedViewportWidth=0;this.cachedViewportHeight=0;this.onWindowResize=()=>{this.updateResponsiveMode();if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()};this.onVisualViewportChange=()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()};this.onChromeTransitionStart=e=>{const s=c(e);if(s!=="panel-nav")return;this.panelNavTransition.enter();const t=de();this.cachedViewportWidth=t.width;this.cachedViewportHeight=t.height;this.syncChrome()};this.onChromeTransitionEnd=e=>{const s=c(e);if(s!=="panel-nav")return;this.panelNavTransition.exit();if(!this.panelNavTransition.isActive){this.scheduleChromeSync()}};this.onDocumentVisibilityChange=()=>{if(!document.hidden)this.refreshAfterForegroundRestore()};this.onPageShow=e=>{if(e.persisted)this.refreshAfterForegroundRestore()};this.handleManagedNavSelect=e=>{e.stopPropagation();this.dsNavSelect.emit(e.detail)};this.handleManagedNavChildSelect=e=>{e.stopPropagation();this.dsNavChildSelect.emit(e.detail)};this.handleManagedTabChange=e=>{e.stopPropagation();this.dsTabChange.emit(e.detail)};this.handleManagedPageBack=e=>{e.stopPropagation();this.dsPageBack.emit(e.detail)};this.handleManagedBreadcrumbSelect=e=>{e.stopPropagation();const s=this.dsBreadcrumbSelect.emit(e.detail);if(s.defaultPrevented)e.preventDefault()};this.handleManagedSubsectionChange=e=>{e.stopPropagation();this.dsSubsectionChange.emit(e.detail)};this.handleManagedPageAction=e=>{e.stopPropagation();this.dsPageAction.emit(e.detail)};this.handleManagedToolChange=e=>{e.stopPropagation();const{id:s,selected:t}=e.detail;this.managedActiveTool=s;this.managedToolsOpen=t;const i=this.resolvedToolItems.find((e=>e.id===s));if(i&&b(i)){this.managedInboxTool=s}this.managedMobileDestination=t?i?.mobileDestination??m(true,s):"area";this.managedMobileSheetNavOpen=false;this.dsToolChange.emit(e.detail)};this.handleManagedPresentationChange=e=>{e.stopPropagation();this.managedToolPresentation=e.detail.presentation;this.toolsFullscreen=e.detail.presentation==="fullscreen";this.dsPresentationChange.emit(e.detail)};this.handleManagedHeaderBack=e=>{e.stopPropagation();this.dsHeaderBack.emit(e.detail)};this.handleManagedHeaderAction=e=>{e.stopPropagation();this.dsHeaderAction.emit(e.detail)};this.handleManagedSheetToggle=e=>{e.stopPropagation();this.managedMobileSheetNavOpen=e.detail};this.handleManagedMobileDestination=e=>{e.stopPropagation();const s=e.detail.destination;this.managedMobileSheetNavOpen=false;this.managedMobileDestination=s;if(s==="area"){this.managedToolsOpen=false;return}this.activateManagedMobileTool(s)};this.handleManagedAreaSelect=e=>{e.stopPropagation();if(e.detail==="help"){this.managedMobileSheetNavOpen=false;this.managedMobileDestination="help";if(this.activateManagedMobileTool("help"))return}this.managedMobileSheetNavOpen=false;this.managedMobileDestination="area";this.managedToolsOpen=false;this.dsNavSelect.emit(e.detail)};this.handleManagedBrowseContext=e=>{e.stopPropagation();this.managedBrowseContext=e.detail;this.dsBrowseContextChange.emit(e.detail)};this.handleManagedSheetClose=e=>{e.stopPropagation();this.managedMobileSheetNavOpen=false};this.handleManagedNavFooterAction=e=>{e.stopPropagation();this.dsNavFooterAction.emit()};this.handleManagedNavUserAction=e=>{e.stopPropagation();this.dsNavUserAction.emit(e.detail)}}get managed(){return this.composition==="managed"}get effectiveMobileDestination(){return this.managed?this.managedMobileDestination:this.mobileDestination}get effectiveMobileSheetNavOpen(){return this.managed?this.managedMobileSheetNavOpen:this.mobileSheetNavOpen}get resolvedNavigationGroups(){if(this.navigation.groups?.length)return this.navigation.groups;return this.managedBrowseContext==="settings"?this.navigation.settingsGroups??[]:this.navigation.dashboardGroups??[]}get resolvedToolItems(){return this.tools.items??l}get resolvedPageTabs(){const e=this.currentArea.children;if(!e?.length)return this.pageChrome.tabs??[];return e.map((e=>({id:e.id,label:e.label,dot:e.dot,isInactive:e.isInactive})))}get availableInboxTools(){return this.resolvedToolItems.filter((e=>!e.isInactive&&b(e))).map((e=>e.id))}componentWillLoad(){if(typeof window!=="undefined"){this.resolvedMode=f(window.innerWidth)}this.managedBrowseContext=this.navigation.browseContext??this.navStyle;this.managedMobileDestination=this.mobileDestination;this.managedMobileSheetNavOpen=this.mobileSheetNavOpen;this.managedInboxTool=g("",this.availableInboxTools)}componentDidLoad(){this.hasLoaded=true;this.syncSlottedNavStyle();this.syncSlottedMobileState();this.connectMetricsObserver();this.connectViewportListeners();this.connectPageLifecycleListeners();this.el.addEventListener(p,this.onChromeTransitionStart);this.el.addEventListener(d,this.onChromeTransitionEnd);requestAnimationFrame((()=>{this.cachePanelWidthTokens();this.scheduleChromeSync()}));const e=this.el.querySelector("ds-shell-tools, ds-panel-tools");this.toolsFullscreen=e?.getAttribute("presentation")==="fullscreen"}handleToolsPresentation(e){this.toolsFullscreen=e.detail?.presentation==="fullscreen"}disconnectedCallback(){this.resizeObserver?.disconnect();this.resizeObserver=null;this.disconnectViewportListeners();this.disconnectPageLifecycleListeners();this.cancelForegroundRefresh();this.chromeSyncCoalescer.cancel();this.el.removeEventListener(p,this.onChromeTransitionStart);this.el.removeEventListener(d,this.onChromeTransitionEnd)}onShellPropsChange(){this.syncSlottedNavStyle();this.scheduleChromeSync()}handleNavigationChange(){this.managedBrowseContext=this.navigation.browseContext??this.navStyle}handleToolsChange(){if(this.managedActiveTool&&!this.resolvedToolItems.some((e=>e.id===this.managedActiveTool))){this.managedToolsOpen=false;this.managedActiveTool="";this.managedMobileDestination="area"}this.managedInboxTool=g(this.managedInboxTool,this.availableInboxTools)}onMobileStateChange(e,t){if(this.managed){this.managedMobileDestination=this.mobileDestination;this.managedMobileSheetNavOpen=this.mobileSheetNavOpen}this.syncSlottedMobileState();if(t===true&&!this.effectiveMobileSheetNavOpen&&this.resolvedMode==="mobile"){requestAnimationFrame((()=>{const e=this.el.querySelector("ds-mobile-bar-nav");const t=document.activeElement;if(t instanceof s&&e?.contains(t))return;void e?.focusDestination?.("sheet-nav")}))}}updateResponsiveMode(){if(typeof window==="undefined")return;const e=f(window.innerWidth);if(e===this.resolvedMode)return;this.resolvedMode=e;this.syncSlottedMobileState();this.scheduleChromeSync();if(this.hasLoaded)this.dsResponsiveModeChange.emit({mode:e})}scheduleChromeSync(){this.chromeSyncCoalescer.schedule()}syncSlottedNavStyle(){const e=this.el.querySelector("ds-panel-nav");const s=this.el.querySelector("ds-bar-nav");if(e){e.setAttribute("nav-style",this.navStyle);e.navStyle=this.navStyle}if(s){s.setAttribute("nav-style",this.navStyle);s.navStyle=this.navStyle}}syncSlottedMobileState(){const e=this.el.querySelector("ds-shell-tools");const s=this.el.querySelector("ds-mobile-bar-nav");const t=this.el.querySelector("ds-mobile-sheet-nav");if(e){e.setAttribute("responsive-mode",this.resolvedMode);e.responsiveMode=this.resolvedMode}if(s){s.activeDestination=this.effectiveMobileDestination;s.sheetNavExpanded=this.effectiveMobileSheetNavOpen}if(t){t.open=this.effectiveMobileSheetNavOpen}}connectMetricsObserver(){this.resizeObserver=new ResizeObserver((()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()}));this.resizeObserver.observe(this.el);const e=this.el.querySelector(".shell-app__panel");if(e)this.resizeObserver.observe(e)}connectViewportListeners(){if(typeof window==="undefined")return;window.addEventListener("resize",this.onWindowResize,{passive:true});const e=window.visualViewport;if(e){e.addEventListener("resize",this.onVisualViewportChange,{passive:true});e.addEventListener("scroll",this.onVisualViewportChange,{passive:true})}}disconnectViewportListeners(){if(typeof window==="undefined")return;window.removeEventListener("resize",this.onWindowResize);const e=window.visualViewport;if(e){e.removeEventListener("resize",this.onVisualViewportChange);e.removeEventListener("scroll",this.onVisualViewportChange)}}connectPageLifecycleListeners(){if(typeof window==="undefined"||typeof document==="undefined")return;document.addEventListener("visibilitychange",this.onDocumentVisibilityChange);window.addEventListener("pageshow",this.onPageShow)}disconnectPageLifecycleListeners(){if(typeof window==="undefined"||typeof document==="undefined")return;document.removeEventListener("visibilitychange",this.onDocumentVisibilityChange);window.removeEventListener("pageshow",this.onPageShow)}cancelForegroundRefresh(){if(this.foregroundRefreshTimer!==null){window.clearTimeout(this.foregroundRefreshTimer);this.foregroundRefreshTimer=null}this.el.classList.remove("shell-app--foreground-refresh")}refreshAfterForegroundRestore(){this.updateResponsiveMode();this.syncSlottedMobileState();this.scheduleChromeSync();if(this.resolvedMode!=="mobile")return;this.cancelForegroundRefresh();this.el.classList.add("shell-app--foreground-refresh");this.foregroundRefreshTimer=window.setTimeout((()=>{this.foregroundRefreshTimer=null;this.el.classList.remove("shell-app--foreground-refresh");void this.el.querySelector(".shell-app__main")?.offsetHeight}),e.FOREGROUND_REFRESH_MS)}cachePanelWidthTokens(){const e=this.el.querySelector("ds-panel-nav .panel-nav");if(!e)return;this.panelWidthTokens=fe(e)}applyGradientVars(e,s){const t=e.style;for(const[e,i]of Object.entries(s)){if(i===null)t.removeProperty(e);else t.setProperty(e,i)}}clearGradientPaintVars(e){const s=[ne,le,re];for(const t of e){for(const e of s)t.style.removeProperty(e)}}syncChromeLayoutVars(e,s,t,i){if(e){e.style.setProperty(oe,t)}if(s){s.style.setProperty(he,i)}}resolvePanelWidthPx(e){const s=e?.querySelector(".panel-nav");if(this.panelNavTransition.isActive&&this.panelWidthTokens.expandedPx>0){const t=ge(e,s);return ve(this.panelWidthTokens,t)}const t=this.el.querySelector(".shell-app__panel");const i=t?.getBoundingClientRect().width??0;if(i>0)return i;if(this.panelWidthTokens.expandedPx>0){const t=ge(e,s);return ve(this.panelWidthTokens,t)}return 0}resolveViewportDimensions(){if(this.panelNavTransition.isActive&&this.cachedViewportWidth>0){return{width:this.cachedViewportWidth,height:this.cachedViewportHeight}}return de()}chromeLayerActive(){return this.gradientLayerActive()||this.paperTextureLayerActive()}gradientLayerActive(){return this.resolvedMode!=="mobile"&&te(this.gradientPreset)!=="none"}paperTextureLayerActive(){return this.resolvedMode!=="mobile"&&this.paperTexture!=null}handleWindowKeyDown(e){if(!this.shortcutsEnabled)return;if(U(e.target))return;const s=W(e);if(!s)return;e.preventDefault();const t=this.el.querySelector("ds-panel-nav");const i=this.el.querySelector("ds-shell-tools, ds-panel-tools");if(s==="toggle-panel-nav"){void t?.toggleCollapsed();return}if(s==="close-panel-tools"){void i?.closeDrawer?.();return}if(s.startsWith("open-tool:")&&i){const e=s.slice("open-tool:".length);void i.activateTool?.(e)}}async activateTool(e){const s=this.el.querySelector("ds-shell-tools, ds-panel-tools");await(s?.activateTool?.(e))}async closeGlobalSurface(){if(this.managedMobileSheetNavOpen){this.managedMobileSheetNavOpen=false;return}const e=this.el.querySelector("ds-shell-tools, ds-panel-tools");await(e?.closeDrawer?.())}async setToolPresentation(e){this.managedToolPresentation=e;this.toolsFullscreen=e==="fullscreen"}activateManagedMobileTool(e){const s=e==="inbox"?g(this.managedInboxTool,this.availableInboxTools):e;if(!s)return false;const t=this.resolvedToolItems.find((t=>t.id===s||e!=="inbox"&&t.mobileDestination===e));if(!t||t.isInactive)return false;const i=t.id;this.managedActiveTool=i;this.managedToolsOpen=true;if(b(t))this.managedInboxTool=i;this.dsToolChange.emit({id:i,selected:true});return true}get currentArea(){const e=[...this.navigation.dashboardGroups??[],...this.navigation.settingsGroups??[],...this.resolvedNavigationGroups];const s=e.flatMap((e=>e.items));const t=this.navigation.activeId||y(this.navigation.currentUrl??this.pageChrome.currentUrl??"",s);return s.find((e=>e.id===t))??s[0]??{id:"area",icon:"MapPage",label:this.pageChrome.heading||"Area"}}toolDot(e){return this.resolvedToolItems.find((s=>s.id===e))?.dot??false}syncChrome(){const e=this.el.querySelector("ds-panel-nav");const s=this.el.querySelector('ds-bar-nav, ds-bar-title[placement="shell-bar"]');const t=[this.el,e,s].filter((e=>e!==null));const i=()=>{if(e)e.style.removeProperty(oe);if(s)s.style.removeProperty(he)};const a=te(this.gradientPreset);if(this.resolvedMode==="mobile"){this.clearGradientPaintVars(t);i();return}const n=this.resolveViewportDimensions();if(a==="none"){this.clearGradientPaintVars(t);i();this.syncPaperTextureLayout(n);return}const l=this.resolvePanelWidthPx(e);const o=ue();const h=be(l);this.syncChromeLayoutVars(e,s,o,h);const r=pe(a);const p=ce({width:n.width,height:n.height});const d=ee(a);for(const e of t){if(e===this.el){this.applyGradientVars(e,{[ne]:r,[le]:p,[oe]:o,[he]:h,[re]:d});continue}const t=e===s;this.applyGradientVars(e,{[ne]:r,[le]:p,[re]:d,[oe]:t?null:o,[he]:t?h:null})}this.syncPaperTextureLayout(n)}syncPaperTextureLayout(e){const s=this.el.querySelector(".shell-app__chrome");const t=this.el.querySelector(".shell-app__chrome > ds-paper-texture");if(!s||!t)return;const i=s.getBoundingClientRect();t.style.setProperty("width",`${Math.round(e.width)}px`);t.style.setProperty("height",`${Math.round(e.height)}px`);t.style.setProperty("left",`${-Math.round(i.left)}px`);t.style.setProperty("top",`${-Math.round(i.top)}px`)}renderPaperTexture(){if(!this.paperTextureLayerActive())return null;return i("ds-paper-texture",{class:"shell-app__paper-texture",config:this.paperTexture})}renderManagedPanelNav(){const e=this.navigation;return i("ds-panel-nav",{navStyle:this.navStyle,presentation:this.sectionNavigation==="panel"?"nested":"flat",groups:this.resolvedNavigationGroups,breakpoint:v,routerMode:e.routerMode??"event",activeId:e.activeId??"",activeChildId:this.pageChrome.value??"",currentUrl:e.currentUrl??this.pageChrome.currentUrl??"",storageKey:e.storageKey??"",userName:e.userName??"",userInitial:e.userInitial??"",accountMenuExpanded:e.accountMenuExpanded??false,dashboardLabel:e.dashboardLabel??"Dashboard",settingsLabel:e.settingsLabel??"Settings",accountLabel:e.accountLabel??"Account",dashboardNavigationLabel:e.dashboardNavigationLabel??"Dashboard navigation",settingsNavigationLabel:e.settingsNavigationLabel??"Settings navigation",navigationItemsLabel:e.navigationLabel??"Navigation items",onDsNavSelect:this.handleManagedNavSelect,onDsNavChildSelect:this.handleManagedNavChildSelect,onDsNavFooterAction:this.handleManagedNavFooterAction,onDsNavUserAction:this.handleManagedNavUserAction})}renderManagedBarNav(){return i("ds-bar-nav",{navStyle:this.navStyle,tabs:this.resolvedPageTabs,value:this.pageChrome.value??"",heading:this.pageChrome.routeHeading??this.pageChrome.heading,basePath:this.pageChrome.basePath??"",currentUrl:this.pageChrome.currentUrl??this.navigation.currentUrl??"",onDsTabChange:this.handleManagedTabChange})}renderManagedTopBar(){return this.sectionNavigation==="panel"?this.renderManagedBarTitle("shell-bar"):this.renderManagedBarNav()}renderManagedToolSlots(){const e=[...new Set(this.resolvedToolItems.map((e=>e.id)))].sort();return e.flatMap((e=>[i("div",{key:`tool:${e}`,class:"shell-app__tool-slot-proxy",slot:e},i("slot",{name:e})),i("div",{key:`tool-view:${e}`,class:"shell-app__tool-slot-proxy",slot:`${e}-view`},i("slot",{name:`${e}-view`}))]))}renderManagedTools(){const e=this.tools;return i("ds-shell-tools",{responsiveMode:this.resolvedMode,open:this.managedToolsOpen,activeTool:this.managedActiveTool,presentation:this.managedToolPresentation,fullscreenHeaderMode:e.fullscreenHeaderMode??"shared",items:this.resolvedToolItems,headers:e.headers??{},storageKey:e.storageKey??"",toolsLabel:e.toolsLabel??"Tools",toolShortcutsLabel:e.toolShortcutsLabel??"Tool shortcuts",inboxLabel:e.inboxLabel??"Inbox",inboxNavigationLabel:e.inboxNavigationLabel??"Inbox sections",onDsToolChange:this.handleManagedToolChange,onDsPresentationChange:this.handleManagedPresentationChange,onDsHeaderBack:this.handleManagedHeaderBack,onDsHeaderAction:this.handleManagedHeaderAction},this.renderManagedToolSlots())}renderManagedMobileSheetNav(){const e=this.navigation;return i("ds-mobile-sheet-nav",{open:this.managedMobileSheetNavOpen,browseContext:this.managedBrowseContext,dashboardGroups:e.dashboardGroups??e.groups??[],settingsGroups:e.settingsGroups??[],currentUrl:e.currentUrl??this.pageChrome.currentUrl??"",routeSelectionActive:this.managedMobileDestination==="area",navigationLabel:e.navigationLabel??"Application navigation",dashboardLabel:e.dashboardLabel??"Dashboard",settingsLabel:e.settingsLabel??"Settings",accountLabel:e.accountLabel??"Account",showAccount:e.showMobileAccount??true,onDsAreaSelect:this.handleManagedAreaSelect,onDsBrowseContextChange:this.handleManagedBrowseContext,onDsClose:this.handleManagedSheetClose})}renderManagedMobileBarNav(){const e=e=>this.resolvedToolItems.find((s=>s.id===e));const s=(s,t)=>e(s)?.ariaLabel??e(s)?.label??t;const t=this.resolvedToolItems.some((e=>!e.isInactive&&e.mobileDestination==="activity"));return i("ds-mobile-bar-nav",{hidden:this.tools.mobileBarHidden??false,activeDestination:this.managedMobileDestination,currentArea:this.currentArea,sheetNavExpanded:this.managedMobileSheetNavOpen,searchLabel:s("search","Search"),activityMode:t?"direct":"inbox",activityLabel:s("activity","Activity"),inboxLabel:this.tools.inboxLabel??"Inbox",messagesLabel:s("messages","Messages"),agentsLabel:s("agents","Agents"),helpLabel:s("help","Help & Support"),searchDot:this.toolDot("search"),activityDot:this.toolDot("activity"),inboxDot:this.toolDot("stacks")||this.toolDot("activity"),messagesDot:this.toolDot("messages"),agentsDot:this.toolDot("agents"),onDsSheetNavToggle:this.handleManagedSheetToggle,onDsDestinationChange:this.handleManagedMobileDestination})}renderManagedMobileLeading(){if(!this.pageChrome.showBack){return i("slot",{name:"page-header-leading",slot:"leading"})}return[i("ds-tooltip",{slot:"leading",label:this.pageChrome.backAriaLabel??"Back",side:"bottom",size:"sm"},i("ds-button-unfilled",{variant:"icon",icon:this.pageChrome.backIcon??"ChevronLeft",size:"md","aria-label":this.pageChrome.backAriaLabel??"Back",activeFill:false,hasBorder:false,onDsClick:e=>this.dsPageBack.emit(e.detail)})),i("slot",{name:"page-header-leading",slot:"leading"})]}renderManagedMobileActions(){const e=this.pageChrome.mobileActions??[];return[...e.map((e=>i("ds-tooltip",{slot:"trailing",key:e.id,label:e.ariaLabel,side:"bottom",size:"sm"},i("ds-button-unfilled",{id:e.triggerId||undefined,variant:"icon",icon:e.icon,size:"md","aria-label":e.ariaLabel,haspopup:e.haspopup,controls:e.controls,expanded:e.expanded,pressed:e.pressed,isInactive:e.isInactive,activeFill:false,hasBorder:false,onDsClick:()=>this.dsPageAction.emit(e.id)})))),i("slot",{name:"page-header-trailing",slot:"trailing"})]}get barTitleSections(){return(this.pageChrome.subsections??[]).map((e=>"type"in e?{type:"divider"}:{id:e.id,label:e.label,isInactive:e.isInactive}))}renderManagedBarTitle(e){const s=this.pageChrome;return i("ds-bar-title",{slot:e==="page"?"header":undefined,placement:e,variant:e==="shell-bar"?"compact":"expanded",heading:s.heading??"",description:s.description??"",showBack:s.showBack??false,backAriaLabel:s.backAriaLabel??"Back",backLabel:s.backLabel??"Back",breadcrumbs:s.breadcrumbs??[],breadcrumbAriaLabel:s.breadcrumbAriaLabel??"Breadcrumb",sections:this.barTitleSections,value:s.subvalue??"",sectionsAriaLabel:s.subsectionsAriaLabel??"Change page subsection",primaryAction:s.primaryAction??null,actions:s.actions??[],actionsAriaLabel:s.actionsAriaLabel??"More page actions",showDivider:s.showHeaderDivider??true,showCompactDivider:s.showCompactHeaderDivider,onDsBack:this.handleManagedPageBack,onDsBreadcrumbSelect:this.handleManagedBreadcrumbSelect,onDsSectionChange:this.handleManagedSubsectionChange,onDsAction:this.handleManagedPageAction})}renderManagedPage(){const e=this.pageChrome;const s=e.showBack?[]:this.resolvedPageTabs;return i("ds-shell-page",{responsiveMode:this.resolvedMode,headerCapacity:_(this.resolvedMode),desktopHeaderPlacement:this.sectionNavigation==="panel"?"shell-bar":"page",contentInset:e.contentInset??"default",contentInsetBlockStart:e.contentInsetBlockStart??"default",contentInsetBlockStartSize:e.contentInsetBlockStartSize,compactContentInsetBlockStartSize:e.compactContentInsetBlockStartSize,scrollCompaction:e.scrollCompaction??true,contentSurface:e.contentSurface??"primary"},this.sectionNavigation==="bar"?this.renderManagedBarTitle("page"):null,i("ds-mobile-header",{slot:"mobile-header",heading:e.heading??"",headingLevel:e.headingLevel??"h1",sections:s,value:e.showBack?"":e.value??"",sectionsAriaLabel:e.sectionsAriaLabel??"Change page section",subsections:e.subsections??[],subvalue:e.subvalue??"",subsectionsAriaLabel:e.subsectionsAriaLabel??"Change page subsection",tone:e.tone??"default",onDsSectionChange:this.handleManagedTabChange,onDsSubsectionChange:this.handleManagedSubsectionChange},this.renderManagedMobileLeading(),this.renderManagedMobileActions()),i("slot",null))}renderSlottedShell(e,s,t,n,l){return i(a,{class:e,"responsive-mode":this.resolvedMode},i("div",{class:"shell-app__banner"},i("slot",{name:"banner"})),i("div",{class:"shell-app__row"},i("div",{class:"shell-app__chrome","aria-hidden":"true"},this.renderPaperTexture()),i("div",{class:"shell-app__panel","aria-hidden":l?"true":undefined,inert:l?true:undefined},i("slot",{name:"panel"})),i("div",{class:"shell-app__main"},i("div",{class:"shell-app__bar","aria-hidden":l?"true":undefined,inert:l?true:undefined},i("slot",{name:"bar"})),i("div",{class:"shell-app__tools","data-ds-overlay-boundary":true,"aria-hidden":s&&(!t||this.mobileSheetNavOpen)?"true":undefined,inert:s&&(!t||this.mobileSheetNavOpen)?true:undefined,hidden:s&&!t},i("slot",{name:"tools"})),i("div",{class:"shell-app__content","data-ds-overlay-boundary":true,"aria-hidden":l||n?"true":undefined,inert:l||n?true:undefined,tabIndex:0},i("slot",null)),i("div",{class:"shell-app__mobile-sheet-nav",hidden:!s||!this.mobileSheetNavOpen,"aria-hidden":s&&this.mobileSheetNavOpen?undefined:"true",inert:s&&this.mobileSheetNavOpen?undefined:true},i("slot",{name:"mobile-sheet-nav"})),i("div",{class:"shell-app__mobile-bar-nav",hidden:!s},i("slot",{name:"mobile-bar-nav"})))))}render(){const e=this.chromeLayerActive();const s=this.gradientLayerActive();const t=this.paperTextureLayerActive();const n=this.resolvedMode==="mobile";const l=n&&this.effectiveMobileDestination!=="area";const o=n&&(l||this.effectiveMobileSheetNavOpen);const h=!n&&this.toolsFullscreen;const r={"shell-app":true,"shell-app--chrome":e,"shell-app--gradient":s,"shell-app--paper-texture":t,[`shell-app--${this.navStyle}`]:true,[`shell-app--${this.resolvedMode}`]:true,"shell-app--tools-fullscreen":h,"shell-app--mobile-tool-active":l,"shell-app--mobile-sheet-nav-open":n&&this.effectiveMobileSheetNavOpen,"shell-app--managed":this.managed,"shell-app--slotted":!this.managed};if(!this.managed){return this.renderSlottedShell(r,n,l,o,h)}return i(a,{class:r,"responsive-mode":this.resolvedMode},i("div",{class:"shell-app__banner"},i("slot",{name:"banner"})),i("div",{class:"shell-app__row"},i("div",{class:"shell-app__chrome","aria-hidden":"true"},this.renderPaperTexture()),i("div",{class:"shell-app__panel","aria-hidden":h?"true":undefined,inert:h?true:undefined},this.renderManagedPanelNav()),i("div",{class:"shell-app__main"},i("div",{class:"shell-app__bar","aria-hidden":h?"true":undefined,inert:h?true:undefined},this.renderManagedTopBar()),i("div",{class:"shell-app__tools","data-ds-overlay-boundary":true,"aria-hidden":n&&(!l||this.effectiveMobileSheetNavOpen)?"true":undefined,inert:n&&(!l||this.effectiveMobileSheetNavOpen)?true:undefined,hidden:n&&!l},this.renderManagedTools()),i("div",{class:"shell-app__content","data-ds-overlay-boundary":true,"aria-hidden":h||o?"true":undefined,inert:h||o?true:undefined,tabIndex:0},this.renderManagedPage()),i("div",{class:"shell-app__mobile-sheet-nav",hidden:!n||!this.effectiveMobileSheetNavOpen,"aria-hidden":n&&this.effectiveMobileSheetNavOpen?undefined:"true",inert:n&&this.effectiveMobileSheetNavOpen?undefined:true},this.renderManagedMobileSheetNav()),i("div",{class:"shell-app__mobile-bar-nav",hidden:!n},this.renderManagedMobileBarNav()))))}get el(){return this}static get watchers(){return{navStyle:[{onShellPropsChange:0}],gradientPreset:[{onShellPropsChange:0}],paperTexture:[{onShellPropsChange:0}],sectionNavigation:[{onShellPropsChange:0}],navigation:[{handleNavigationChange:0}],tools:[{handleToolsChange:0}],mobileDestination:[{onMobileStateChange:0}],mobileSheetNavOpen:[{onMobileStateChange:0}]}}static get style(){return _e()}},[262,"ds-shell-app",{composition:[513],navigation:[16],sectionNavigation:[513,"section-navigation"],pageChrome:[16],tools:[16],navStyle:[513,"nav-style"],gradientPreset:[513,"gradient-preset"],paperTexture:[16],shortcutsEnabled:[4,"shortcuts-enabled"],mobileDestination:[1,"mobile-destination"],mobileSheetNavOpen:[4,"mobile-sheet-nav-open"],toolsFullscreen:[32],resolvedMode:[32],managedToolsOpen:[32],managedActiveTool:[32],managedToolPresentation:[32],managedMobileDestination:[32],managedMobileSheetNavOpen:[32],managedInboxTool:[32],managedBrowseContext:[32],activateTool:[64],closeGlobalSurface:[64],setToolPresentation:[64]},[[0,"dsPresentationChange","handleToolsPresentation"],[10,"keydown","handleWindowKeyDown"]],{navStyle:[{onShellPropsChange:0}],gradientPreset:[{onShellPropsChange:0}],paperTexture:[{onShellPropsChange:0}],sectionNavigation:[{onShellPropsChange:0}],navigation:[{handleNavigationChange:0}],tools:[{handleToolsChange:0}],mobileDestination:[{onMobileStateChange:0}],mobileSheetNavOpen:[{onMobileStateChange:0}]}]);ye.FOREGROUND_REFRESH_MS=50;function we(){if(typeof customElements==="undefined"){return}const e=["ds-shell-app","ds-badge","ds-bar-nav","ds-bar-title","ds-breadcrumb","ds-button-filled","ds-button-unfilled","ds-icon","ds-loader","ds-menu","ds-mobile-bar-nav","ds-mobile-header","ds-mobile-section-switcher","ds-mobile-sheet-nav","ds-panel-nav","ds-panel-tool-header","ds-panel-tools","ds-paper-texture","ds-shell-page","ds-shell-tools","ds-swatch-picker","ds-switch","ds-tab-group","ds-tag","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-shell-app":if(!customElements.get(n(e))){customElements.define(n(e),ye)}break;case"ds-badge":if(!customElements.get(n(e))){w()}break;case"ds-bar-nav":if(!customElements.get(n(e))){u()}break;case"ds-bar-title":if(!customElements.get(n(e))){k()}break;case"ds-breadcrumb":if(!customElements.get(n(e))){x()}break;case"ds-button-filled":if(!customElements.get(n(e))){C()}break;case"ds-button-unfilled":if(!customElements.get(n(e))){S()}break;case"ds-icon":if(!customElements.get(n(e))){D()}break;case"ds-loader":if(!customElements.get(n(e))){M()}break;case"ds-menu":if(!customElements.get(n(e))){L()}break;case"ds-mobile-bar-nav":if(!customElements.get(n(e))){P()}break;case"ds-mobile-header":if(!customElements.get(n(e))){T()}break;case"ds-mobile-section-switcher":if(!customElements.get(n(e))){B()}break;case"ds-mobile-sheet-nav":if(!customElements.get(n(e))){A()}break;case"ds-panel-nav":if(!customElements.get(n(e))){N()}break;case"ds-panel-tool-header":if(!customElements.get(n(e))){j()}break;case"ds-panel-tools":if(!customElements.get(n(e))){o()}break;case"ds-paper-texture":if(!customElements.get(n(e))){z()}break;case"ds-shell-page":if(!customElements.get(n(e))){E()}break;case"ds-shell-tools":if(!customElements.get(n(e))){I()}break;case"ds-swatch-picker":if(!customElements.get(n(e))){$()}break;case"ds-switch":if(!customElements.get(n(e))){O()}break;case"ds-tab-group":if(!customElements.get(n(e))){G()}break;case"ds-tag":if(!customElements.get(n(e))){F()}break;case"ds-text":if(!customElements.get(n(e))){R()}break;case"ds-tooltip":if(!customElements.get(n(e))){V()}break}}))}we();const ke=ye;const xe=we;export{ke as DsShellApp,xe as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as i,a,t as n}from"./index.js";import{c as l,d as o}from"./p-COFw_fcj.js";import{C as h,c as r,a as p,b as d,r as c,d as u}from"./p-FitB53eM.js";import{i as b,b as m,c as f,r as g,S as v,d as _}from"./p-CgGcgMjs.js";import{d as y}from"./p-D9wZlB_N.js";import{d as w}from"./p-DzPtYdXy.js";import{d as k}from"./p--68f7nIx.js";import{d as x}from"./p-BcxidW9k.js";import{d as C}from"./p-BnTPuV3x.js";import{d as S}from"./p-7MWaWl8w.js";import{d as D}from"./p-Cea7rROU.js";import{d as M}from"./p-0XTyQNRG.js";import{d as L}from"./p-DeK_6Uym.js";import{d as P}from"./p-pUOA3iDG.js";import{d as T}from"./p-FxtgCvhA.js";import{d as A}from"./p-0X-4KGQf.js";import{d as B}from"./p-DAFR4U9P.js";import{d as N}from"./p-DrVA5L25.js";import{d as j}from"./p-DzVYGJJv.js";import{d as z}from"./p-5Z4oYuiK.js";import{d as E}from"./p-B0OZx3JB.js";import{d as I}from"./p-CvHrCyuz.js";import{d as $}from"./p-XaCYqck3.js";import{d as F}from"./p-DGkn8FwV.js";import{d as G}from"./p-Bjq1KP_Y.js";import{d as O}from"./p-DbLLH3hr.js";import{d as V}from"./p-Cd1JnnVK.js";import{d as H}from"./p-9X_p0bHr.js";const K={k:"search",a:"agents",s:"stacks",m:"messages",n:"activity","/":"help"};function R(e){return!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function U(e){if(!e||typeof e!=="object")return false;if(!("closest"in e)||typeof e.closest!=="function")return false;const s=e;const t=s.closest('input, textarea, select, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]');if(t)return true;const i=s.getAttribute("role");if(i==="textbox"||i==="combobox"||i==="searchbox")return true;return Boolean(s.isContentEditable)}function W(e){if(e.key==="["||e.code==="BracketLeft")return"[";if(e.key==="]"||e.code==="BracketRight")return"]";return e.key.length===1?e.key.toLowerCase():e.key.toLowerCase()}function X(e){if(!R(e))return null;const s=W(e);if(s==="[")return"toggle-panel-nav";if(s==="]")return"close-panel-tools";const t=K[s];if(t)return`open-tool:${t}`;return null}const Y=["none","cool","neutral","warm","fresh"];const q="neutral";const J={cool:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-blue-strong-background)",position:100}]},neutral:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-grey-strong-background)",position:100}]},warm:{opacity:.1,stops:[{color:"var(--color-background-transparent)",position:0},{color:"var(--color-color-intent-yellow-strong-background)",position:100}]},fresh:{opacity:.4,stops:[{color:"var(--color-color-intent-cyan-faint-background)",position:0},{color:"var(--color-background-transparent)",position:47},{color:"var(--color-background-transparent)",position:58},{color:"var(--color-color-intent-red-faint-background)",position:83},{color:"var(--color-color-intent-pink-faint-background)",position:100}]}};const Z="100% 100% at 0% 0%";function Q(e){const s=te(e);return s==="none"?null:J[s]}function ee(e){return String(Q(e)?.opacity??0)}function se(e){return Y.includes(e)}function te(e){return e!=null&&se(e)?e:q}function ie(e){const s=te(e);if(s==="none")return"none";return ae(J[s].stops)}function ae(e){const s=e.map((e=>`${e.color} ${e.position}%`)).join(", ");return`radial-gradient(${Z}, ${s})`}const ne="--ds-shell-gradient-image";const le="--ds-shell-gradient-size";const oe="--ds-shell-gradient-position-panel";const he="--ds-shell-gradient-position-bar";const re="--ds-shell-gradient-opacity";function pe(e=q){return ie(e)}function de(e){const s=typeof globalThis.window!=="undefined"?globalThis.window:undefined;if(!s)return{width:0,height:0};const t=s.visualViewport;return{width:Math.round(t?.width??s.innerWidth),height:Math.round(t?.height??s.innerHeight)}}function ce(e){return`${Math.round(e.width)}px ${Math.round(e.height)}px`}function ue(){return"0 0"}function be(e){return`${-Math.round(e)}px 0`}function me(e,s){if(typeof document==="undefined")return 0;const t=document.createElement("div");t.style.cssText="position:absolute;visibility:hidden;pointer-events:none;height:0;width:var("+s+");";e.appendChild(t);const i=t.getBoundingClientRect().width;e.removeChild(t);return i}function fe(e){return{expandedPx:me(e,"--_nav-width"),collapsedPx:me(e,"--_nav-width-collapsed")}}function ge(e,s){if(s?.classList.contains("panel-nav--collapsed"))return true;const t=e?.collapsed;return t===true}function ve(e,s){return s?e.collapsedPx:e.expandedPx}const _e=()=>`.sc-ds-shell-app-h{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;overflow:hidden;overscroll-behavior:none;font-family:var(--typography-font-family-ui, system-ui);--ds-shell-panel-tools-width:var(--dimension-panel-width-xs);--ds-shell-gradient-context:flat}.sc-ds-shell-app-h{--_shell-chrome-bg:var(--color-background-secondary)}.shell-app--gradient.sc-ds-shell-app-h{--ds-shell-gradient-context:gradient}.shell-app__row.sc-ds-shell-app{display:flex;flex:1 1 0;min-height:0;position:relative}.shell-app__banner.sc-ds-shell-app{flex:0 0 auto;min-width:0;position:relative;z-index:5}.shell-app__banner.sc-ds-shell-app-s>ds-banner,.shell-app__banner .sc-ds-shell-app-s>ds-banner{display:grid;width:100%}.shell-app__chrome.sc-ds-shell-app{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden;background-color:var(--_shell-chrome-bg)}.shell-app--gradient.sc-ds-shell-app-h .shell-app__chrome.sc-ds-shell-app::before{content:'';position:absolute;inset:0;pointer-events:none;background-position:0 0;background-attachment:fixed;z-index:1;opacity:var(--ds-shell-gradient-opacity, 1);background-image:var(--ds-shell-gradient-image, none);background-size:var(--ds-shell-gradient-size, auto);background-repeat:no-repeat}.shell-app__paper-texture.sc-ds-shell-app{z-index:2}.shell-app__panel.sc-ds-shell-app{flex:0 0 auto;min-height:0;height:100%;position:relative;z-index:2}.shell-app__panel.sc-ds-shell-app-s>ds-panel-nav,.shell-app__panel .sc-ds-shell-app-s>ds-panel-nav{display:block;height:100%}.shell-app__panel.sc-ds-shell-app>ds-panel-nav.sc-ds-shell-app{display:block;height:100%}.shell-app__main.sc-ds-shell-app{flex:1 1 auto;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0, 1fr) auto;grid-template-rows:auto minmax(0, 1fr);grid-template-areas:'bar tools' 'content tools';position:relative;z-index:1}.shell-app__mobile-sheet-nav.sc-ds-shell-app,.shell-app__mobile-bar-nav.sc-ds-shell-app{display:none}.shell-app__bar.sc-ds-shell-app{grid-area:bar;flex:0 0 auto;min-width:0}.shell-app__bar.sc-ds-shell-app-s>ds-bar-nav,.shell-app__bar .sc-ds-shell-app-s>ds-bar-nav{display:block}.shell-app__bar.sc-ds-shell-app-s>ds-bar-title,.shell-app__bar .sc-ds-shell-app-s>ds-bar-title{display:block}.shell-app__bar.sc-ds-shell-app>ds-bar-nav.sc-ds-shell-app{display:block}.shell-app__bar.sc-ds-shell-app>ds-bar-title.sc-ds-shell-app{display:block}.shell-app__content.sc-ds-shell-app{grid-area:content;flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:none;contain:layout}.shell-app__content.sc-ds-shell-app:focus,.shell-app__content.sc-ds-shell-app:focus-visible{outline:none}.shell-app__content.sc-ds-shell-app{position:relative;z-index:1;background-color:var(--color-background-primary)}.shell-app__tools.sc-ds-shell-app{grid-area:tools;flex:0 0 auto;min-width:0;min-height:0;height:100%;display:flex;position:relative;z-index:0;overflow:hidden}.shell-app__tools.sc-ds-shell-app-s>ds-panel-tools,.shell-app__tools .sc-ds-shell-app-s>ds-panel-tools{display:block;height:100%;min-height:0}.shell-app__tools.sc-ds-shell-app-s>ds-shell-tools,.shell-app__tools .sc-ds-shell-app-s>ds-shell-tools{display:block;height:100%;min-height:0}.shell-app__tools.sc-ds-shell-app>ds-shell-tools.sc-ds-shell-app{display:block;height:100%;min-height:0}.shell-app__tool-slot-proxy.sc-ds-shell-app{display:block;width:100%;height:100%;min-width:0;min-height:0}.shell-app__content.sc-ds-shell-app>ds-shell-page.sc-ds-shell-app{display:block;min-height:100%}.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__panel.sc-ds-shell-app,.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__bar.sc-ds-shell-app,.shell-app--tools-fullscreen.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app{visibility:hidden}.shell-app--mobile.sc-ds-shell-app-h{--_shell-chrome-bg:var(--color-background-primary);padding-block-start:env(safe-area-inset-top)}.shell-app--mobile.shell-app--foreground-refresh.sc-ds-shell-app-h .shell-app__main.sc-ds-shell-app{transform:translateZ(0)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__chrome.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__panel.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__bar.sc-ds-shell-app{display:none}.shell-app--mobile.sc-ds-shell-app-h .shell-app__main.sc-ds-shell-app{width:100%;box-sizing:border-box;grid-template-columns:minmax(0, 1fr);grid-template-rows:minmax(0, 1fr) auto;grid-template-areas:'stage' 'mobile-bar-nav';background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-sheet-nav.sc-ds-shell-app{grid-area:stage;min-width:0;min-height:0;height:100%;position:relative}.shell-app--mobile.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app{z-index:1;overflow:auto}.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app{z-index:2;width:100%;overflow:hidden;background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-sheet-nav.sc-ds-shell-app{display:block;z-index:3;overflow:hidden;background:var(--color-background-primary)}.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-bar-nav.sc-ds-shell-app{grid-area:mobile-bar-nav;display:block;min-width:0;position:relative;z-index:4}.shell-app--mobile.sc-ds-shell-app-h .shell-app__tools[hidden].sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-sheet-nav[hidden].sc-ds-shell-app,.shell-app--mobile.sc-ds-shell-app-h .shell-app__mobile-bar-nav[hidden].sc-ds-shell-app{display:none}.shell-app--mobile-tool-active.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile-sheet-nav-open.sc-ds-shell-app-h .shell-app__content.sc-ds-shell-app,.shell-app--mobile-sheet-nav-open.sc-ds-shell-app-h .shell-app__tools.sc-ds-shell-app{visibility:hidden}`;const ye=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsResponsiveModeChange=t(this,"dsResponsiveModeChange",7);this.dsNavSelect=t(this,"dsNavSelect",7);this.dsTabChange=t(this,"dsTabChange",7);this.dsNavChildSelect=t(this,"dsNavChildSelect",7);this.dsSubsectionChange=t(this,"dsSubsectionChange",7);this.dsPageBack=t(this,"dsPageBack",7);this.dsBreadcrumbSelect=t(this,"dsBreadcrumbSelect",7);this.dsPageAction=t(this,"dsPageAction",7);this.dsToolChange=t(this,"dsToolChange",7);this.dsHeaderBack=t(this,"dsHeaderBack",7);this.dsHeaderAction=t(this,"dsHeaderAction",7);this.dsPresentationChange=t(this,"dsPresentationChange",7);this.dsBrowseContextChange=t(this,"dsBrowseContextChange",7);this.dsNavFooterAction=t(this,"dsNavFooterAction",7);this.dsNavUserAction=t(this,"dsNavUserAction",7);this.composition="managed";this.navigation={};this.sectionNavigation="bar";this.pageChrome={};this.tools={};this.navStyle="dashboard";this.gradientPreset=q;this.shortcutsEnabled=true;this.mobileDestination="area";this.mobileSheetNavOpen=false;this.toolsFullscreen=false;this.resolvedMode="desktop";this.managedToolsOpen=false;this.managedActiveTool="";this.managedToolPresentation="drawer";this.managedMobileDestination="area";this.managedMobileSheetNavOpen=false;this.managedInboxTool="";this.managedBrowseContext="dashboard";this.resizeObserver=null;this.hasLoaded=false;this.foregroundRefreshTimer=null;this.panelNavTransition=new h;this.chromeSyncCoalescer=r((()=>this.syncChrome()));this.panelWidthTokens={expandedPx:0,collapsedPx:0};this.cachedViewportWidth=0;this.cachedViewportHeight=0;this.onWindowResize=()=>{this.updateResponsiveMode();if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()};this.onVisualViewportChange=()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()};this.onChromeTransitionStart=e=>{const s=c(e);if(s!=="panel-nav")return;this.panelNavTransition.enter();const t=de();this.cachedViewportWidth=t.width;this.cachedViewportHeight=t.height;this.syncChrome()};this.onChromeTransitionEnd=e=>{const s=c(e);if(s!=="panel-nav")return;this.panelNavTransition.exit();if(!this.panelNavTransition.isActive){this.scheduleChromeSync()}};this.onDocumentVisibilityChange=()=>{if(!document.hidden)this.refreshAfterForegroundRestore()};this.onPageShow=e=>{if(e.persisted)this.refreshAfterForegroundRestore()};this.handleManagedNavSelect=e=>{e.stopPropagation();this.dsNavSelect.emit(e.detail)};this.handleManagedNavChildSelect=e=>{e.stopPropagation();this.dsNavChildSelect.emit(e.detail)};this.handleManagedTabChange=e=>{e.stopPropagation();this.dsTabChange.emit(e.detail)};this.handleManagedPageBack=e=>{e.stopPropagation();this.dsPageBack.emit(e.detail)};this.handleManagedBreadcrumbSelect=e=>{e.stopPropagation();const s=this.dsBreadcrumbSelect.emit(e.detail);if(s.defaultPrevented)e.preventDefault()};this.handleManagedSubsectionChange=e=>{e.stopPropagation();this.dsSubsectionChange.emit(e.detail)};this.handleManagedPageAction=e=>{e.stopPropagation();this.dsPageAction.emit(e.detail)};this.handleManagedToolChange=e=>{e.stopPropagation();const{id:s,selected:t}=e.detail;this.managedActiveTool=s;this.managedToolsOpen=t;const i=this.resolvedToolItems.find((e=>e.id===s));if(i&&b(i)){this.managedInboxTool=s}this.managedMobileDestination=t?i?.mobileDestination??m(true,s):"area";this.managedMobileSheetNavOpen=false;this.dsToolChange.emit(e.detail)};this.handleManagedPresentationChange=e=>{e.stopPropagation();this.managedToolPresentation=e.detail.presentation;this.toolsFullscreen=e.detail.presentation==="fullscreen";this.dsPresentationChange.emit(e.detail)};this.handleManagedHeaderBack=e=>{e.stopPropagation();this.dsHeaderBack.emit(e.detail)};this.handleManagedHeaderAction=e=>{e.stopPropagation();this.dsHeaderAction.emit(e.detail)};this.handleManagedSheetToggle=e=>{e.stopPropagation();this.managedMobileSheetNavOpen=e.detail};this.handleManagedMobileDestination=e=>{e.stopPropagation();const s=e.detail.destination;this.managedMobileSheetNavOpen=false;this.managedMobileDestination=s;if(s==="area"){this.managedToolsOpen=false;return}this.activateManagedMobileTool(s)};this.handleManagedAreaSelect=e=>{e.stopPropagation();if(e.detail==="help"){this.managedMobileSheetNavOpen=false;this.managedMobileDestination="help";if(this.activateManagedMobileTool("help"))return}this.managedMobileSheetNavOpen=false;this.managedMobileDestination="area";this.managedToolsOpen=false;this.dsNavSelect.emit(e.detail)};this.handleManagedBrowseContext=e=>{e.stopPropagation();this.managedBrowseContext=e.detail;this.dsBrowseContextChange.emit(e.detail)};this.handleManagedSheetClose=e=>{e.stopPropagation();this.managedMobileSheetNavOpen=false};this.handleManagedNavFooterAction=e=>{e.stopPropagation();this.dsNavFooterAction.emit()};this.handleManagedNavUserAction=e=>{e.stopPropagation();this.dsNavUserAction.emit(e.detail)}}get managed(){return this.composition==="managed"}get effectiveMobileDestination(){return this.managed?this.managedMobileDestination:this.mobileDestination}get effectiveMobileSheetNavOpen(){return this.managed?this.managedMobileSheetNavOpen:this.mobileSheetNavOpen}get resolvedNavigationGroups(){if(this.navigation.groups?.length)return this.navigation.groups;return this.managedBrowseContext==="settings"?this.navigation.settingsGroups??[]:this.navigation.dashboardGroups??[]}get resolvedToolItems(){return this.tools.items??l}get resolvedPageTabs(){const e=this.currentArea.children;if(!e?.length)return this.pageChrome.tabs??[];return e.map((e=>({id:e.id,label:e.label,dot:e.dot,isInactive:e.isInactive})))}get availableInboxTools(){return this.resolvedToolItems.filter((e=>!e.isInactive&&b(e))).map((e=>e.id))}componentWillLoad(){if(typeof window!=="undefined"){this.resolvedMode=f(window.innerWidth)}this.managedBrowseContext=this.navigation.browseContext??this.navStyle;this.managedMobileDestination=this.mobileDestination;this.managedMobileSheetNavOpen=this.mobileSheetNavOpen;this.managedInboxTool=g("",this.availableInboxTools)}componentDidLoad(){this.hasLoaded=true;this.syncSlottedNavStyle();this.syncSlottedMobileState();this.connectMetricsObserver();this.connectViewportListeners();this.connectPageLifecycleListeners();this.el.addEventListener(p,this.onChromeTransitionStart);this.el.addEventListener(d,this.onChromeTransitionEnd);requestAnimationFrame((()=>{this.cachePanelWidthTokens();this.scheduleChromeSync()}));const e=this.el.querySelector("ds-shell-tools, ds-panel-tools");this.toolsFullscreen=e?.getAttribute("presentation")==="fullscreen"}handleToolsPresentation(e){this.toolsFullscreen=e.detail?.presentation==="fullscreen"}disconnectedCallback(){this.resizeObserver?.disconnect();this.resizeObserver=null;this.disconnectViewportListeners();this.disconnectPageLifecycleListeners();this.cancelForegroundRefresh();this.chromeSyncCoalescer.cancel();this.el.removeEventListener(p,this.onChromeTransitionStart);this.el.removeEventListener(d,this.onChromeTransitionEnd)}onShellPropsChange(){this.syncSlottedNavStyle();this.scheduleChromeSync()}handleNavigationChange(){this.managedBrowseContext=this.navigation.browseContext??this.navStyle}handleToolsChange(){if(this.managedActiveTool&&!this.resolvedToolItems.some((e=>e.id===this.managedActiveTool))){this.managedToolsOpen=false;this.managedActiveTool="";this.managedMobileDestination="area"}this.managedInboxTool=g(this.managedInboxTool,this.availableInboxTools)}onMobileStateChange(e,t){if(this.managed){this.managedMobileDestination=this.mobileDestination;this.managedMobileSheetNavOpen=this.mobileSheetNavOpen}this.syncSlottedMobileState();if(t===true&&!this.effectiveMobileSheetNavOpen&&this.resolvedMode==="mobile"){requestAnimationFrame((()=>{const e=this.el.querySelector("ds-mobile-bar-nav");const t=document.activeElement;if(t instanceof s&&e?.contains(t))return;void e?.focusDestination?.("sheet-nav")}))}}updateResponsiveMode(){if(typeof window==="undefined")return;const e=f(window.innerWidth);if(e===this.resolvedMode)return;this.resolvedMode=e;this.syncSlottedMobileState();this.scheduleChromeSync();if(this.hasLoaded)this.dsResponsiveModeChange.emit({mode:e})}scheduleChromeSync(){this.chromeSyncCoalescer.schedule()}syncSlottedNavStyle(){const e=this.el.querySelector("ds-panel-nav");const s=this.el.querySelector("ds-bar-nav");if(e){e.setAttribute("nav-style",this.navStyle);e.navStyle=this.navStyle}if(s){s.setAttribute("nav-style",this.navStyle);s.navStyle=this.navStyle}}syncSlottedMobileState(){const e=this.el.querySelector("ds-shell-tools");const s=this.el.querySelector("ds-mobile-bar-nav");const t=this.el.querySelector("ds-mobile-sheet-nav");if(e){e.setAttribute("responsive-mode",this.resolvedMode);e.responsiveMode=this.resolvedMode}if(s){s.activeDestination=this.effectiveMobileDestination;s.sheetNavExpanded=this.effectiveMobileSheetNavOpen}if(t){t.open=this.effectiveMobileSheetNavOpen}}connectMetricsObserver(){this.resizeObserver=new ResizeObserver((()=>{if(this.panelNavTransition.isActive)return;this.scheduleChromeSync()}));this.resizeObserver.observe(this.el);const e=this.el.querySelector(".shell-app__panel");if(e)this.resizeObserver.observe(e)}connectViewportListeners(){if(typeof window==="undefined")return;window.addEventListener("resize",this.onWindowResize,{passive:true});const e=window.visualViewport;if(e){e.addEventListener("resize",this.onVisualViewportChange,{passive:true});e.addEventListener("scroll",this.onVisualViewportChange,{passive:true})}}disconnectViewportListeners(){if(typeof window==="undefined")return;window.removeEventListener("resize",this.onWindowResize);const e=window.visualViewport;if(e){e.removeEventListener("resize",this.onVisualViewportChange);e.removeEventListener("scroll",this.onVisualViewportChange)}}connectPageLifecycleListeners(){if(typeof window==="undefined"||typeof document==="undefined")return;document.addEventListener("visibilitychange",this.onDocumentVisibilityChange);window.addEventListener("pageshow",this.onPageShow)}disconnectPageLifecycleListeners(){if(typeof window==="undefined"||typeof document==="undefined")return;document.removeEventListener("visibilitychange",this.onDocumentVisibilityChange);window.removeEventListener("pageshow",this.onPageShow)}cancelForegroundRefresh(){if(this.foregroundRefreshTimer!==null){window.clearTimeout(this.foregroundRefreshTimer);this.foregroundRefreshTimer=null}this.el.classList.remove("shell-app--foreground-refresh")}refreshAfterForegroundRestore(){this.updateResponsiveMode();this.syncSlottedMobileState();this.scheduleChromeSync();if(this.resolvedMode!=="mobile")return;this.cancelForegroundRefresh();this.el.classList.add("shell-app--foreground-refresh");this.foregroundRefreshTimer=window.setTimeout((()=>{this.foregroundRefreshTimer=null;this.el.classList.remove("shell-app--foreground-refresh");void this.el.querySelector(".shell-app__main")?.offsetHeight}),e.FOREGROUND_REFRESH_MS)}cachePanelWidthTokens(){const e=this.el.querySelector("ds-panel-nav .panel-nav");if(!e)return;this.panelWidthTokens=fe(e)}applyGradientVars(e,s){const t=e.style;for(const[e,i]of Object.entries(s)){if(i===null)t.removeProperty(e);else t.setProperty(e,i)}}clearGradientPaintVars(e){const s=[ne,le,re];for(const t of e){for(const e of s)t.style.removeProperty(e)}}syncChromeLayoutVars(e,s,t,i){if(e){e.style.setProperty(oe,t)}if(s){s.style.setProperty(he,i)}}resolvePanelWidthPx(e){const s=e?.querySelector(".panel-nav");if(this.panelNavTransition.isActive&&this.panelWidthTokens.expandedPx>0){const t=ge(e,s);return ve(this.panelWidthTokens,t)}const t=this.el.querySelector(".shell-app__panel");const i=t?.getBoundingClientRect().width??0;if(i>0)return i;if(this.panelWidthTokens.expandedPx>0){const t=ge(e,s);return ve(this.panelWidthTokens,t)}return 0}resolveViewportDimensions(){if(this.panelNavTransition.isActive&&this.cachedViewportWidth>0){return{width:this.cachedViewportWidth,height:this.cachedViewportHeight}}return de()}chromeLayerActive(){return this.gradientLayerActive()||this.paperTextureLayerActive()}gradientLayerActive(){return this.resolvedMode!=="mobile"&&te(this.gradientPreset)!=="none"}paperTextureLayerActive(){return this.resolvedMode!=="mobile"&&this.paperTexture!=null}handleWindowKeyDown(e){if(!this.shortcutsEnabled)return;if(U(e.target))return;const s=X(e);if(!s)return;e.preventDefault();const t=this.el.querySelector("ds-panel-nav");const i=this.el.querySelector("ds-shell-tools, ds-panel-tools");if(s==="toggle-panel-nav"){void t?.toggleCollapsed();return}if(s==="close-panel-tools"){void i?.closeDrawer?.();return}if(s.startsWith("open-tool:")&&i){const e=s.slice("open-tool:".length);void i.activateTool?.(e)}}async activateTool(e){const s=this.el.querySelector("ds-shell-tools, ds-panel-tools");await(s?.activateTool?.(e))}async closeGlobalSurface(){if(this.managedMobileSheetNavOpen){this.managedMobileSheetNavOpen=false;return}const e=this.el.querySelector("ds-shell-tools, ds-panel-tools");await(e?.closeDrawer?.())}async setToolPresentation(e){this.managedToolPresentation=e;this.toolsFullscreen=e==="fullscreen"}activateManagedMobileTool(e){const s=e==="inbox"?g(this.managedInboxTool,this.availableInboxTools):e;if(!s)return false;const t=this.resolvedToolItems.find((t=>t.id===s||e!=="inbox"&&t.mobileDestination===e));if(!t||t.isInactive)return false;const i=t.id;this.managedActiveTool=i;this.managedToolsOpen=true;if(b(t))this.managedInboxTool=i;this.dsToolChange.emit({id:i,selected:true});return true}get currentArea(){const e=[...this.navigation.dashboardGroups??[],...this.navigation.settingsGroups??[],...this.resolvedNavigationGroups];const s=e.flatMap((e=>e.items));const t=this.navigation.activeId||y(this.navigation.currentUrl??this.pageChrome.currentUrl??"",s);return s.find((e=>e.id===t))??s[0]??{id:"area",icon:"MapPage",label:this.pageChrome.heading||"Area"}}toolDot(e){return this.resolvedToolItems.find((s=>s.id===e))?.dot??false}syncChrome(){const e=this.el.querySelector("ds-panel-nav");const s=this.el.querySelector('ds-bar-nav, ds-bar-title[placement="shell-bar"]');const t=[this.el,e,s].filter((e=>e!==null));const i=()=>{if(e)e.style.removeProperty(oe);if(s)s.style.removeProperty(he)};const a=te(this.gradientPreset);if(this.resolvedMode==="mobile"){this.clearGradientPaintVars(t);i();return}const n=this.resolveViewportDimensions();if(a==="none"){this.clearGradientPaintVars(t);i();this.syncPaperTextureLayout(n);return}const l=this.resolvePanelWidthPx(e);const o=ue();const h=be(l);this.syncChromeLayoutVars(e,s,o,h);const r=pe(a);const p=ce({width:n.width,height:n.height});const d=ee(a);for(const e of t){if(e===this.el){this.applyGradientVars(e,{[ne]:r,[le]:p,[oe]:o,[he]:h,[re]:d});continue}const t=e===s;this.applyGradientVars(e,{[ne]:r,[le]:p,[re]:d,[oe]:t?null:o,[he]:t?h:null})}this.syncPaperTextureLayout(n)}syncPaperTextureLayout(e){const s=this.el.querySelector(".shell-app__chrome");const t=this.el.querySelector(".shell-app__chrome > ds-paper-texture");if(!s||!t)return;const i=s.getBoundingClientRect();t.style.setProperty("width",`${Math.round(e.width)}px`);t.style.setProperty("height",`${Math.round(e.height)}px`);t.style.setProperty("left",`${-Math.round(i.left)}px`);t.style.setProperty("top",`${-Math.round(i.top)}px`)}renderPaperTexture(){if(!this.paperTextureLayerActive())return null;return i("ds-paper-texture",{class:"shell-app__paper-texture",config:this.paperTexture})}renderManagedPanelNav(){const e=this.navigation;return i("ds-panel-nav",{navStyle:this.navStyle,presentation:this.sectionNavigation==="panel"?"nested":"flat",groups:this.resolvedNavigationGroups,breakpoint:v,routerMode:e.routerMode??"event",activeId:e.activeId??"",activeChildId:this.pageChrome.value??"",currentUrl:e.currentUrl??this.pageChrome.currentUrl??"",storageKey:e.storageKey??"",userName:e.userName??"",userInitial:e.userInitial??"",accountMenuExpanded:e.accountMenuExpanded??false,dashboardLabel:e.dashboardLabel??"Dashboard",settingsLabel:e.settingsLabel??"Settings",accountLabel:e.accountLabel??"Account",dashboardNavigationLabel:e.dashboardNavigationLabel??"Dashboard navigation",settingsNavigationLabel:e.settingsNavigationLabel??"Settings navigation",navigationItemsLabel:e.navigationLabel??"Navigation items",onDsNavSelect:this.handleManagedNavSelect,onDsNavChildSelect:this.handleManagedNavChildSelect,onDsNavFooterAction:this.handleManagedNavFooterAction,onDsNavUserAction:this.handleManagedNavUserAction})}renderManagedBarNav(){return i("ds-bar-nav",{navStyle:this.navStyle,tabs:this.resolvedPageTabs,value:this.pageChrome.value??"",heading:this.pageChrome.routeHeading??this.pageChrome.heading,basePath:this.pageChrome.basePath??"",currentUrl:this.pageChrome.currentUrl??this.navigation.currentUrl??"",onDsTabChange:this.handleManagedTabChange})}renderManagedTopBar(){return this.sectionNavigation==="panel"?this.renderManagedBarTitle("shell-bar"):this.renderManagedBarNav()}renderManagedToolSlots(){const e=[...new Set(this.resolvedToolItems.map((e=>e.id)))].sort();return e.flatMap((e=>[i("div",{key:`tool:${e}`,class:"shell-app__tool-slot-proxy",slot:e},i("slot",{name:e})),i("div",{key:`tool-view:${e}`,class:"shell-app__tool-slot-proxy",slot:`${e}-view`},i("slot",{name:`${e}-view`}))]))}renderManagedTools(){const e=this.tools;return i("ds-shell-tools",{responsiveMode:this.resolvedMode,open:this.managedToolsOpen,activeTool:this.managedActiveTool,presentation:this.managedToolPresentation,fullscreenHeaderMode:e.fullscreenHeaderMode??"shared",items:this.resolvedToolItems,headers:e.headers??{},storageKey:e.storageKey??"",toolsLabel:e.toolsLabel??"Tools",toolShortcutsLabel:e.toolShortcutsLabel??"Tool shortcuts",inboxLabel:e.inboxLabel??"Inbox",inboxNavigationLabel:e.inboxNavigationLabel??"Inbox sections",onDsToolChange:this.handleManagedToolChange,onDsPresentationChange:this.handleManagedPresentationChange,onDsHeaderBack:this.handleManagedHeaderBack,onDsHeaderAction:this.handleManagedHeaderAction},this.renderManagedToolSlots())}renderManagedMobileSheetNav(){const e=this.navigation;return i("ds-mobile-sheet-nav",{open:this.managedMobileSheetNavOpen,browseContext:this.managedBrowseContext,dashboardGroups:e.dashboardGroups??e.groups??[],settingsGroups:e.settingsGroups??[],currentUrl:e.currentUrl??this.pageChrome.currentUrl??"",routeSelectionActive:this.managedMobileDestination==="area",navigationLabel:e.navigationLabel??"Application navigation",dashboardLabel:e.dashboardLabel??"Dashboard",settingsLabel:e.settingsLabel??"Settings",accountLabel:e.accountLabel??"Account",showAccount:e.showMobileAccount??true,onDsAreaSelect:this.handleManagedAreaSelect,onDsBrowseContextChange:this.handleManagedBrowseContext,onDsClose:this.handleManagedSheetClose})}renderManagedMobileBarNav(){const e=e=>this.resolvedToolItems.find((s=>s.id===e));const s=(s,t)=>e(s)?.ariaLabel??e(s)?.label??t;const t=this.resolvedToolItems.some((e=>!e.isInactive&&e.mobileDestination==="activity"));return i("ds-mobile-bar-nav",{hidden:this.tools.mobileBarHidden??false,activeDestination:this.managedMobileDestination,currentArea:this.currentArea,sheetNavExpanded:this.managedMobileSheetNavOpen,searchLabel:s("search","Search"),activityMode:t?"direct":"inbox",activityLabel:s("activity","Activity"),inboxLabel:this.tools.inboxLabel??"Inbox",messagesLabel:s("messages","Messages"),agentsLabel:s("agents","Agents"),helpLabel:s("help","Help & Support"),searchDot:this.toolDot("search"),activityDot:this.toolDot("activity"),inboxDot:this.toolDot("stacks")||this.toolDot("activity"),messagesDot:this.toolDot("messages"),agentsDot:this.toolDot("agents"),onDsSheetNavToggle:this.handleManagedSheetToggle,onDsDestinationChange:this.handleManagedMobileDestination})}renderManagedMobileLeading(){if(!this.pageChrome.showBack){return i("slot",{name:"page-header-leading",slot:"leading"})}return[i("ds-tooltip",{slot:"leading",label:this.pageChrome.backAriaLabel??"Back",side:"bottom",size:"sm"},i("ds-button-unfilled",{variant:"icon",icon:this.pageChrome.backIcon??"ChevronLeft",size:"md","aria-label":this.pageChrome.backAriaLabel??"Back",activeFill:false,hasBorder:false,onDsClick:e=>this.dsPageBack.emit(e.detail)})),i("slot",{name:"page-header-leading",slot:"leading"})]}renderManagedMobileActions(){const e=this.pageChrome.mobileActions??[];return[...e.map((e=>i("ds-tooltip",{slot:"trailing",key:e.id,label:e.ariaLabel,side:"bottom",size:"sm"},i("ds-button-unfilled",{id:e.triggerId||undefined,variant:"icon",icon:e.icon,size:"md","aria-label":e.ariaLabel,haspopup:e.haspopup,controls:e.controls,expanded:e.expanded,pressed:e.pressed,isInactive:e.isInactive,activeFill:false,hasBorder:false,onDsClick:()=>this.dsPageAction.emit(e.id)})))),i("slot",{name:"page-header-trailing",slot:"trailing"})]}get barTitleSections(){return(this.pageChrome.subsections??[]).map((e=>"type"in e?{type:"divider"}:{id:e.id,label:e.label,isInactive:e.isInactive}))}renderManagedBarTitle(e){const s=this.pageChrome;return i("ds-bar-title",{slot:e==="page"?"header":undefined,placement:e,variant:e==="shell-bar"?"compact":"expanded",heading:s.heading??"",description:s.description??"",showBack:s.showBack??false,backAriaLabel:s.backAriaLabel??"Back",backLabel:s.backLabel??"Back",breadcrumbs:s.breadcrumbs??[],breadcrumbAriaLabel:s.breadcrumbAriaLabel??"Breadcrumb",sections:this.barTitleSections,value:s.subvalue??"",sectionsAriaLabel:s.subsectionsAriaLabel??"Change page subsection",primaryAction:s.primaryAction??null,actions:s.actions??[],actionsAriaLabel:s.actionsAriaLabel??"More page actions",showDivider:s.showHeaderDivider??true,showCompactDivider:s.showCompactHeaderDivider,onDsBack:this.handleManagedPageBack,onDsBreadcrumbSelect:this.handleManagedBreadcrumbSelect,onDsSectionChange:this.handleManagedSubsectionChange,onDsAction:this.handleManagedPageAction})}renderManagedPage(){const e=this.pageChrome;const s=e.showBack?[]:this.resolvedPageTabs;return i("ds-shell-page",{responsiveMode:this.resolvedMode,headerCapacity:_(this.resolvedMode),desktopHeaderPlacement:this.sectionNavigation==="panel"?"shell-bar":"page",contentInset:e.contentInset??"default",contentInsetBlockStart:e.contentInsetBlockStart??"default",contentInsetBlockStartSize:e.contentInsetBlockStartSize,compactContentInsetBlockStartSize:e.compactContentInsetBlockStartSize,scrollCompaction:e.scrollCompaction??true,contentSurface:e.contentSurface??"primary"},this.sectionNavigation==="bar"?this.renderManagedBarTitle("page"):null,i("ds-mobile-header",{slot:"mobile-header",heading:e.heading??"",headingLevel:e.headingLevel??"h1",sections:s,value:e.showBack?"":e.value??"",sectionsAriaLabel:e.sectionsAriaLabel??"Change page section",subsections:e.subsections??[],subvalue:e.subvalue??"",subsectionsAriaLabel:e.subsectionsAriaLabel??"Change page subsection",tone:e.tone??"default",onDsSectionChange:this.handleManagedTabChange,onDsSubsectionChange:this.handleManagedSubsectionChange},this.renderManagedMobileLeading(),this.renderManagedMobileActions()),i("slot",null))}renderSlottedShell(e,s,t,n,l){return i(a,{class:e,"responsive-mode":this.resolvedMode},i("div",{class:"shell-app__banner"},i("slot",{name:"banner"})),i("div",{class:"shell-app__row"},i("div",{class:"shell-app__chrome","aria-hidden":"true"},this.renderPaperTexture()),i("div",{class:"shell-app__panel","aria-hidden":l?"true":undefined,inert:l?true:undefined},i("slot",{name:"panel"})),i("div",{class:"shell-app__main"},i("div",{class:"shell-app__bar","aria-hidden":l?"true":undefined,inert:l?true:undefined},i("slot",{name:"bar"})),i("div",{class:"shell-app__tools","data-ds-overlay-boundary":true,"aria-hidden":s&&(!t||this.mobileSheetNavOpen)?"true":undefined,inert:s&&(!t||this.mobileSheetNavOpen)?true:undefined,hidden:s&&!t},i("slot",{name:"tools"})),i("div",{class:"shell-app__content","data-ds-overlay-boundary":true,"aria-hidden":l||n?"true":undefined,inert:l||n?true:undefined,tabIndex:0},i("slot",null)),i("div",{class:"shell-app__mobile-sheet-nav",hidden:!s||!this.mobileSheetNavOpen,"aria-hidden":s&&this.mobileSheetNavOpen?undefined:"true",inert:s&&this.mobileSheetNavOpen?undefined:true},i("slot",{name:"mobile-sheet-nav"})),i("div",{class:"shell-app__mobile-bar-nav",hidden:!s},i("slot",{name:"mobile-bar-nav"})))))}render(){const e=this.chromeLayerActive();const s=this.gradientLayerActive();const t=this.paperTextureLayerActive();const n=this.resolvedMode==="mobile";const l=n&&this.effectiveMobileDestination!=="area";const o=n&&(l||this.effectiveMobileSheetNavOpen);const h=!n&&this.toolsFullscreen;const r={"shell-app":true,"shell-app--chrome":e,"shell-app--gradient":s,"shell-app--paper-texture":t,[`shell-app--${this.navStyle}`]:true,[`shell-app--${this.resolvedMode}`]:true,"shell-app--tools-fullscreen":h,"shell-app--mobile-tool-active":l,"shell-app--mobile-sheet-nav-open":n&&this.effectiveMobileSheetNavOpen,"shell-app--managed":this.managed,"shell-app--slotted":!this.managed};if(!this.managed){return this.renderSlottedShell(r,n,l,o,h)}return i(a,{class:r,"responsive-mode":this.resolvedMode},i("div",{class:"shell-app__banner"},i("slot",{name:"banner"})),i("div",{class:"shell-app__row"},i("div",{class:"shell-app__chrome","aria-hidden":"true"},this.renderPaperTexture()),i("div",{class:"shell-app__panel","aria-hidden":h?"true":undefined,inert:h?true:undefined},this.renderManagedPanelNav()),i("div",{class:"shell-app__main"},i("div",{class:"shell-app__bar","aria-hidden":h?"true":undefined,inert:h?true:undefined},this.renderManagedTopBar()),i("div",{class:"shell-app__tools","data-ds-overlay-boundary":true,"aria-hidden":n&&(!l||this.effectiveMobileSheetNavOpen)?"true":undefined,inert:n&&(!l||this.effectiveMobileSheetNavOpen)?true:undefined,hidden:n&&!l},this.renderManagedTools()),i("div",{class:"shell-app__content","data-ds-overlay-boundary":true,"aria-hidden":h||o?"true":undefined,inert:h||o?true:undefined,tabIndex:0},this.renderManagedPage()),i("div",{class:"shell-app__mobile-sheet-nav",hidden:!n||!this.effectiveMobileSheetNavOpen,"aria-hidden":n&&this.effectiveMobileSheetNavOpen?undefined:"true",inert:n&&this.effectiveMobileSheetNavOpen?undefined:true},this.renderManagedMobileSheetNav()),i("div",{class:"shell-app__mobile-bar-nav",hidden:!n},this.renderManagedMobileBarNav()))))}get el(){return this}static get watchers(){return{navStyle:[{onShellPropsChange:0}],gradientPreset:[{onShellPropsChange:0}],paperTexture:[{onShellPropsChange:0}],sectionNavigation:[{onShellPropsChange:0}],navigation:[{handleNavigationChange:0}],tools:[{handleToolsChange:0}],mobileDestination:[{onMobileStateChange:0}],mobileSheetNavOpen:[{onMobileStateChange:0}]}}static get style(){return _e()}},[262,"ds-shell-app",{composition:[513],navigation:[16],sectionNavigation:[513,"section-navigation"],pageChrome:[16],tools:[16],navStyle:[513,"nav-style"],gradientPreset:[513,"gradient-preset"],paperTexture:[16],shortcutsEnabled:[4,"shortcuts-enabled"],mobileDestination:[1,"mobile-destination"],mobileSheetNavOpen:[4,"mobile-sheet-nav-open"],toolsFullscreen:[32],resolvedMode:[32],managedToolsOpen:[32],managedActiveTool:[32],managedToolPresentation:[32],managedMobileDestination:[32],managedMobileSheetNavOpen:[32],managedInboxTool:[32],managedBrowseContext:[32],activateTool:[64],closeGlobalSurface:[64],setToolPresentation:[64]},[[0,"dsPresentationChange","handleToolsPresentation"],[10,"keydown","handleWindowKeyDown"]],{navStyle:[{onShellPropsChange:0}],gradientPreset:[{onShellPropsChange:0}],paperTexture:[{onShellPropsChange:0}],sectionNavigation:[{onShellPropsChange:0}],navigation:[{handleNavigationChange:0}],tools:[{handleToolsChange:0}],mobileDestination:[{onMobileStateChange:0}],mobileSheetNavOpen:[{onMobileStateChange:0}]}]);ye.FOREGROUND_REFRESH_MS=50;function we(){if(typeof customElements==="undefined"){return}const e=["ds-shell-app","ds-badge","ds-bar-nav","ds-bar-title","ds-breadcrumb","ds-button-filled","ds-button-unfilled","ds-icon","ds-loader","ds-menu","ds-mobile-bar-nav","ds-mobile-header","ds-mobile-section-switcher","ds-mobile-sheet-nav","ds-panel-nav","ds-panel-tool-header","ds-panel-tools","ds-paper-texture","ds-shell-page","ds-shell-tools","ds-swatch-picker","ds-switch","ds-tab-group","ds-tag","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-shell-app":if(!customElements.get(n(e))){customElements.define(n(e),ye)}break;case"ds-badge":if(!customElements.get(n(e))){w()}break;case"ds-bar-nav":if(!customElements.get(n(e))){u()}break;case"ds-bar-title":if(!customElements.get(n(e))){k()}break;case"ds-breadcrumb":if(!customElements.get(n(e))){x()}break;case"ds-button-filled":if(!customElements.get(n(e))){C()}break;case"ds-button-unfilled":if(!customElements.get(n(e))){S()}break;case"ds-icon":if(!customElements.get(n(e))){D()}break;case"ds-loader":if(!customElements.get(n(e))){M()}break;case"ds-menu":if(!customElements.get(n(e))){L()}break;case"ds-mobile-bar-nav":if(!customElements.get(n(e))){P()}break;case"ds-mobile-header":if(!customElements.get(n(e))){T()}break;case"ds-mobile-section-switcher":if(!customElements.get(n(e))){A()}break;case"ds-mobile-sheet-nav":if(!customElements.get(n(e))){B()}break;case"ds-panel-nav":if(!customElements.get(n(e))){N()}break;case"ds-panel-tool-header":if(!customElements.get(n(e))){j()}break;case"ds-panel-tools":if(!customElements.get(n(e))){o()}break;case"ds-paper-texture":if(!customElements.get(n(e))){z()}break;case"ds-shell-page":if(!customElements.get(n(e))){E()}break;case"ds-shell-tools":if(!customElements.get(n(e))){I()}break;case"ds-swatch-picker":if(!customElements.get(n(e))){$()}break;case"ds-switch":if(!customElements.get(n(e))){F()}break;case"ds-tab-group":if(!customElements.get(n(e))){G()}break;case"ds-tag":if(!customElements.get(n(e))){O()}break;case"ds-text":if(!customElements.get(n(e))){V()}break;case"ds-tooltip":if(!customElements.get(n(e))){H()}break}}))}we();const ke=ye;const xe=we;export{ke as DsShellApp,xe as defineCustomElement};
2
2
  //# sourceMappingURL=ds-shell-app.js.map
@@ -1,2 +1,2 @@
1
- import{S as o,d as s}from"./p-_C-XRpCB.js";const p=o;const t=s;export{p as DsShellTools,t as defineCustomElement};
1
+ import{S as o,d as s}from"./p-CvHrCyuz.js";const r=o;const t=s;export{r as DsShellTools,t as defineCustomElement};
2
2
  //# sourceMappingURL=ds-shell-tools.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as i,a,t as l}from"./index.js";import{d as r}from"./p-DzPtYdXy.js";import{d as o}from"./p-DSy1oOnd.js";import{d as n}from"./p-CBymzuOO.js";import{d}from"./p-CpeJMKJ5.js";import{d as c}from"./p-hYjmOPCI.js";import{d as h}from"./p-Cea7rROU.js";import{d as m}from"./p-pxN8JGEh.js";import{d as f}from"./p-0XTyQNRG.js";import{d as u}from"./p-Bjq1KP_Y.js";import{d as p}from"./p-DbLLH3hr.js";import{d as b}from"./p-Cd1JnnVK.js";import{d as g}from"./p-pnO8tAYB.js";const C=()=>`.sc-ds-table-filter-h{display:inline-flex;min-inline-size:0;max-inline-size:var(--dimension-menu-width-xs)}ds-filter-menu.sc-ds-table-filter{min-inline-size:0;max-inline-size:100%;--ds-choice-popup-min-inline-size:var(--dimension-menu-width-xs)}`;const k=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsChange=t(this,"dsChange",7);this.dsClear=t(this,"dsClear",7);this.dsMatchModeChange=t(this,"dsMatchModeChange",7);this.dsActiveFilterChange=t(this,"dsActiveFilterChange",7);this.dsClose=t(this,"dsClose",7);this.dsOpenChange=t(this,"dsOpenChange",7);this.dsAfterClose=t(this,"dsAfterClose",7);this.open=false;this.filters=[];this.values={};this.matchModes={};this.label="Filter";this.ariaLabel=null;this.menuLabel=null;this.categoriesLabel="Filter categories";this.clearLabel="Clear";this.searchPlaceholder="Search";this.noResultsText="No results"}render(){const e=this.ariaLabel?.trim()||"Filter table";const s=this.menuLabel?.trim()||e;return i(a,{key:"062df29e361ed3de5700e6f24a3cf99ce215b432"},i("ds-filter-menu",{key:"a70431fc7a1006e65b762b7ddedf5c2b58132417",open:this.open,triggerLabel:this.label,showSelectedCount:false,icon:"Filters",size:"md",width:"hug",hasBorder:true,activeFill:false,collapseLabel:true,align:"start","aria-label":e,filters:this.filters,values:this.values,matchModes:this.matchModes,activeFilterId:this.activeFilterId,menuLabel:s,categoriesLabel:this.categoriesLabel,clearLabel:this.clearLabel,searchPlaceholder:this.searchPlaceholder,noResultsText:this.noResultsText,footerLayout:"categories-clear",onDsChange:e=>this.forward(e,this.dsChange),onDsClear:e=>this.forward(e,this.dsClear),onDsMatchModeChange:e=>this.forward(e,this.dsMatchModeChange),onDsActiveFilterChange:e=>this.forward(e,this.dsActiveFilterChange),onDsClose:e=>this.forward(e,this.dsClose),onDsOpenChange:e=>{e.stopPropagation();this.open=e.detail;this.dsOpenChange.emit(e.detail)},onDsAfterClose:e=>this.forward(e,this.dsAfterClose)}))}forward(e,s){e.stopPropagation();s.emit(e.detail)}static get style(){return C()}},[2,"ds-table-filter",{open:[1028],filters:[16],values:[16],matchModes:[16],activeFilterId:[1,"active-filter-id"],label:[1],ariaLabel:[1,"aria-label"],menuLabel:[1,"menu-label"],categoriesLabel:[1,"categories-label"],clearLabel:[1,"clear-label"],searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"]}]);function x(){if(typeof customElements==="undefined"){return}const e=["ds-table-filter","ds-badge","ds-button-unfilled","ds-checkbox","ds-empty-state","ds-filter-menu","ds-icon","ds-input","ds-loader","ds-tab-group","ds-tag","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-table-filter":if(!customElements.get(l(e))){customElements.define(l(e),k)}break;case"ds-badge":if(!customElements.get(l(e))){r()}break;case"ds-button-unfilled":if(!customElements.get(l(e))){o()}break;case"ds-checkbox":if(!customElements.get(l(e))){n()}break;case"ds-empty-state":if(!customElements.get(l(e))){d()}break;case"ds-filter-menu":if(!customElements.get(l(e))){c()}break;case"ds-icon":if(!customElements.get(l(e))){h()}break;case"ds-input":if(!customElements.get(l(e))){m()}break;case"ds-loader":if(!customElements.get(l(e))){f()}break;case"ds-tab-group":if(!customElements.get(l(e))){u()}break;case"ds-tag":if(!customElements.get(l(e))){p()}break;case"ds-text":if(!customElements.get(l(e))){b()}break;case"ds-tooltip":if(!customElements.get(l(e))){g()}break}}))}x();const E=k;const j=x;export{E as DsTableFilter,j as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as i,a,t as l}from"./index.js";import{d as r}from"./p-DzPtYdXy.js";import{d as o}from"./p-7MWaWl8w.js";import{d as n}from"./p-CBymzuOO.js";import{d}from"./p-CpeJMKJ5.js";import{d as c}from"./p-9M0ak2q_.js";import{d as h}from"./p-Cea7rROU.js";import{d as m}from"./p-nVv71P3f.js";import{d as f}from"./p-0XTyQNRG.js";import{d as u}from"./p-Bjq1KP_Y.js";import{d as p}from"./p-DbLLH3hr.js";import{d as b}from"./p-Cd1JnnVK.js";import{d as g}from"./p-9X_p0bHr.js";const C=()=>`.sc-ds-table-filter-h{display:inline-flex;min-inline-size:0;max-inline-size:var(--dimension-menu-width-xs)}ds-filter-menu.sc-ds-table-filter{min-inline-size:0;max-inline-size:100%;--ds-choice-popup-min-inline-size:var(--dimension-menu-width-xs)}`;const k=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsChange=t(this,"dsChange",7);this.dsClear=t(this,"dsClear",7);this.dsMatchModeChange=t(this,"dsMatchModeChange",7);this.dsActiveFilterChange=t(this,"dsActiveFilterChange",7);this.dsClose=t(this,"dsClose",7);this.dsOpenChange=t(this,"dsOpenChange",7);this.dsAfterClose=t(this,"dsAfterClose",7);this.open=false;this.filters=[];this.values={};this.matchModes={};this.label="Filter";this.ariaLabel=null;this.menuLabel=null;this.categoriesLabel="Filter categories";this.clearLabel="Clear";this.searchPlaceholder="Search";this.noResultsText="No results"}render(){const e=this.ariaLabel?.trim()||"Filter table";const s=this.menuLabel?.trim()||e;return i(a,{key:"062df29e361ed3de5700e6f24a3cf99ce215b432"},i("ds-filter-menu",{key:"a70431fc7a1006e65b762b7ddedf5c2b58132417",open:this.open,triggerLabel:this.label,showSelectedCount:false,icon:"Filters",size:"md",width:"hug",hasBorder:true,activeFill:false,collapseLabel:true,align:"start","aria-label":e,filters:this.filters,values:this.values,matchModes:this.matchModes,activeFilterId:this.activeFilterId,menuLabel:s,categoriesLabel:this.categoriesLabel,clearLabel:this.clearLabel,searchPlaceholder:this.searchPlaceholder,noResultsText:this.noResultsText,footerLayout:"categories-clear",onDsChange:e=>this.forward(e,this.dsChange),onDsClear:e=>this.forward(e,this.dsClear),onDsMatchModeChange:e=>this.forward(e,this.dsMatchModeChange),onDsActiveFilterChange:e=>this.forward(e,this.dsActiveFilterChange),onDsClose:e=>this.forward(e,this.dsClose),onDsOpenChange:e=>{e.stopPropagation();this.open=e.detail;this.dsOpenChange.emit(e.detail)},onDsAfterClose:e=>this.forward(e,this.dsAfterClose)}))}forward(e,s){e.stopPropagation();s.emit(e.detail)}static get style(){return C()}},[2,"ds-table-filter",{open:[1028],filters:[16],values:[16],matchModes:[16],activeFilterId:[1,"active-filter-id"],label:[1],ariaLabel:[1,"aria-label"],menuLabel:[1,"menu-label"],categoriesLabel:[1,"categories-label"],clearLabel:[1,"clear-label"],searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"]}]);function x(){if(typeof customElements==="undefined"){return}const e=["ds-table-filter","ds-badge","ds-button-unfilled","ds-checkbox","ds-empty-state","ds-filter-menu","ds-icon","ds-input","ds-loader","ds-tab-group","ds-tag","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-table-filter":if(!customElements.get(l(e))){customElements.define(l(e),k)}break;case"ds-badge":if(!customElements.get(l(e))){r()}break;case"ds-button-unfilled":if(!customElements.get(l(e))){o()}break;case"ds-checkbox":if(!customElements.get(l(e))){n()}break;case"ds-empty-state":if(!customElements.get(l(e))){d()}break;case"ds-filter-menu":if(!customElements.get(l(e))){c()}break;case"ds-icon":if(!customElements.get(l(e))){h()}break;case"ds-input":if(!customElements.get(l(e))){m()}break;case"ds-loader":if(!customElements.get(l(e))){f()}break;case"ds-tab-group":if(!customElements.get(l(e))){u()}break;case"ds-tag":if(!customElements.get(l(e))){p()}break;case"ds-text":if(!customElements.get(l(e))){b()}break;case"ds-tooltip":if(!customElements.get(l(e))){g()}break}}))}x();const E=k;const j=x;export{E as DsTableFilter,j as defineCustomElement};
2
2
  //# sourceMappingURL=ds-table-filter.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as o,c as i,h as t,a as s,t as r}from"./index.js";import{A as n,r as a}from"./p-DCbKsABt.js";import{r as d,A as c}from"./p-etg-Uk1u.js";import{d as l,C as p}from"./p-BEttT0UB.js";import{d as u}from"./p-DzPtYdXy.js";import{d as g}from"./p-DSy1oOnd.js";import{d as h}from"./p-CpeJMKJ5.js";import{d as b}from"./p-Cea7rROU.js";import{d as f}from"./p-pxN8JGEh.js";import{d as v}from"./p-0XTyQNRG.js";import{d as m}from"./p-Cd1JnnVK.js";import{d as x}from"./p-pnO8tAYB.js";import{r as y}from"./p-CochmPyg.js";import{a as w,T as _,b as k}from"./p-CUL5_8JM.js";const z=()=>`@media (forced-colors: active){.sc-ds-table-group:root,.sc-ds-table-group-h,.ds-forced-colors-scope.sc-ds-table-group{--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-table-group-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-table-group-h,.ds-focus-ring.sc-ds-table-group,.ds-focus-ring-inset.sc-ds-table-group-h,.ds-focus-ring-inset.sc-ds-table-group{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-table-group-h:focus-visible,.ds-focus-ring.sc-ds-table-group: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-table-group-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-table-group{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-table-group-h:focus-visible,.ds-focus-ring-inset.sc-ds-table-group:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-table-group-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-table-group: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-table-group-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-table-group{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-table-group-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-table-group::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-table-group-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-table-group:root,.sc-ds-table-group-h,.ds-forced-colors-scope.sc-ds-table-group{--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}}@media (forced-colors: active){.sc-ds-table-group:root,.sc-ds-table-group-h,.ds-forced-colors-scope.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill.sc-ds-table-group{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-table-group-h::before,.ds-interaction-fill.sc-ds-table-group::before,.ds-interaction-fill.sc-ds-table-group-h::after,.ds-interaction-fill.sc-ds-table-group::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-table-group-h::before,.ds-interaction-fill.sc-ds-table-group::before{z-index:1}.ds-interaction-fill.sc-ds-table-group-h::after,.ds-interaction-fill.sc-ds-table-group::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-table-group-h,.ds-interaction-fill--bordered.sc-ds-table-group{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-table-group-h::before,.ds-interaction-fill--selected.sc-ds-table-group::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-table-group-h,.ds-interaction-fill--selected.sc-ds-table-group{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-table-group-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-table-group:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-table-group-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-table-group:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-table-group-h::after,.ds-interaction-fill--grouped.sc-ds-table-group::after,.ds-interaction-fill--grouped.sc-ds-table-group-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-table-group:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-table-group-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-table-group:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-table-group-h,.ds-interaction-fill--grouped.sc-ds-table-group{--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-table-group-h>.ds-interaction-fill__content.sc-ds-table-group,.ds-interaction-fill.sc-ds-table-group>.ds-interaction-fill__content.sc-ds-table-group,.ds-interaction-fill__content.sc-ds-table-group{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-table-group-h,.ds-interaction-fill--on-faint.sc-ds-table-group{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-table-group-h,.ds-interaction-fill--on-medium.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-bold.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-strong.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-translucent.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-inverted.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-media.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-always-dark.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-navigation.sc-ds-table-group{--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-table-group-h::after,.ds-interaction-fill.sc-ds-table-group::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-table-group-h::before,.ds-interaction-fill--selected.sc-ds-table-group::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-table-group-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-table-group: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-table-group:root,.sc-ds-table-group-h,.ds-forced-colors-scope.sc-ds-table-group{--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-table-group-h,.ds-control-inactive.sc-ds-table-group{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-table-group-h,.ds-control-inactive.sc-ds-table-group{color:var(--ds-forced-color-disabled);opacity:1}}.ds-control--lg.sc-ds-table-group,.ds-control--lg.sc-ds-table-group-h,.ds-control--md.sc-ds-table-group-h,.ds-control--md.sc-ds-table-group,.ds-control--sm.sc-ds-table-group-h,.ds-control--sm.sc-ds-table-group,.ds-control--xs.sc-ds-table-group-h,.ds-control--xs.sc-ds-table-group{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-table-group-h,.ds-control--lg.sc-ds-table-group{--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-table-group-h,.ds-control--md.sc-ds-table-group{--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-table-group-h,.ds-control--sm.sc-ds-table-group{--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-table-group-h,.ds-control--xs.sc-ds-table-group{--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-chrome-space--sm.sc-ds-table-group-h,.ds-chrome-space--sm.sc-ds-table-group{--ds-chrome-padding:var(--dimension-space-050);--ds-chrome-gap:var(--dimension-space-050)}.ds-chrome-space--md.sc-ds-table-group-h,.ds-chrome-space--md.sc-ds-table-group{--ds-chrome-padding:var(--dimension-space-100);--ds-chrome-gap:var(--dimension-space-100)}.ds-chrome-space--lg.sc-ds-table-group-h,.ds-chrome-space--lg.sc-ds-table-group{--ds-chrome-padding:var(--dimension-space-200);--ds-chrome-gap:var(--dimension-space-200)}.ds-chrome-row.sc-ds-table-group-h,.ds-chrome-row.sc-ds-table-group,.ds-chrome-column.sc-ds-table-group-h,.ds-chrome-column.sc-ds-table-group,.ds-chrome-grid.sc-ds-table-group-h,.ds-chrome-grid.sc-ds-table-group{display:flex;box-sizing:border-box;gap:var(--ds-chrome-gap, var(--dimension-space-100));padding:var(--ds-chrome-padding, var(--dimension-space-100))}.ds-chrome-row.sc-ds-table-group-h,.ds-chrome-row.sc-ds-table-group{flex-direction:row;align-items:center}.ds-chrome-column.sc-ds-table-group-h,.ds-chrome-column.sc-ds-table-group{flex-direction:column}.ds-chrome-grid.sc-ds-table-group-h,.ds-chrome-grid.sc-ds-table-group{display:grid;align-items:center}.ds-control-frame.sc-ds-table-group{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.ds-control-section-heading.sc-ds-table-group{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-control-icon-box.sc-ds-table-group{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md))}.ds-control-label-box.sc-ds-table-group{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-table-group{position:relative;padding-inline-end:calc( var(--ds-control-label-inset, var(--dimension-space-025)) + var(--ds-control-gap, var(--dimension-space-050)) )}.ds-control-label-dot__badge.sc-ds-table-group{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}.ds-empty-region.sc-ds-table-group{display:flex;flex:1 1 auto;align-items:center;justify-content:center;box-sizing:border-box;min-width:0;min-height:0}.ds-empty-region--padded.sc-ds-table-group{padding:var(--dimension-space-200)}.sc-ds-table-group:where(.ds-text-decoration,.ds-text-action).sc-ds-table-group{text-decoration-color:var(--ds-text-decoration-color, var(--color-foreground-tertiary));text-decoration-thickness:var(--ds-text-decoration-thickness, var(--dimension-stroke-width-012));text-underline-offset:var(--ds-text-decoration-offset, var(--dimension-space-025))}.ds-text-action.sc-ds-table-group{--ds-text-action-foreground:var(--color-foreground-bold-brand);--ds-text-decoration-color:var(--ds-text-action-foreground);color:var(--ds-text-action-foreground);text-decoration-line:none}.ds-text-action--on-medium.sc-ds-table-group{--ds-text-action-foreground:var(--color-foreground-on-medium-background-primary);--ds-text-decoration-color:var(--color-foreground-on-medium-background-secondary);text-decoration-line:underline}.ds-text-action--on-strong.sc-ds-table-group{--ds-text-action-foreground:var(--color-foreground-on-strong-background-primary);--ds-text-decoration-color:var(--color-foreground-on-strong-background-secondary);text-decoration-line:underline}.ds-text-action--on-bold.sc-ds-table-group{--ds-text-action-foreground:var(--color-foreground-on-bold-background-primary);--ds-text-decoration-color:var(--color-foreground-on-bold-background-secondary);text-decoration-line:underline}@media (hover: hover) and (pointer: fine){.ds-text-action.sc-ds-table-group:hover{text-decoration-line:underline}}@media (forced-colors: active){.ds-text-action.sc-ds-table-group{text-decoration-line:underline;text-decoration-color:currentcolor}}.ds-choice-popup.sc-ds-table-group{box-sizing:border-box;display:flex;flex-direction:column;min-width:var(--ds-choice-popup-min-inline-size, var(--dimension-menu-width-xs));max-width:min(var(--dimension-panel-width-lg), calc(100vw - var(--dimension-space-200)));max-height:calc(100vh - var(--dimension-space-200));overflow:hidden;inset:auto;margin:0;padding:0;border:0;background-color:var(--color-background-primary);border-radius:var(--dimension-radius-075);box-shadow:var(--effect-shadow-elevated-floating);color:var(--color-foreground-secondary);animation:dsChoiceFadeIn var(--effect-motion-short-2) forwards;backface-visibility:hidden;will-change:transform;text-align:start}.ds-choice-popup.sc-ds-table-group::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:var(--effect-highlight-elevated-floating)}.ds-choice-popup--closing.sc-ds-table-group{animation:dsChoiceFadeOut var(--effect-motion-short-2) forwards}@keyframes dsChoiceFadeIn{from{opacity:0;transform:inherit scale(0.97)}to{opacity:1}}@keyframes dsChoiceFadeOut{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.ds-choice-popup.sc-ds-table-group{animation:none;opacity:1}.ds-choice-popup--closing.sc-ds-table-group{opacity:0}}.ds-choice-list.sc-ds-table-group{display:flex;flex-direction:column;min-height:0;overflow-y:auto;overscroll-behavior:contain}.ds-choice-section--divided.sc-ds-table-group{border-bottom:var(--dimension-stroke-width-015) solid var(--color-border-tertiary)}ds-text.ds-choice-section__header.sc-ds-table-group{text-align:start;-webkit-user-select:none;user-select:none}.ds-choice-section--headed-after-first.sc-ds-table-group{margin-block-start:var(--dimension-space-050)}.ds-choice-item.sc-ds-table-group{width:100%;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));background:transparent;cursor:default;-webkit-user-select:none;user-select:none;text-align:left;color:inherit}.ds-choice-item.sc-ds-table-group:has(.ds-choice-item__subtext){height:auto;min-height:var(--ds-control-height, var(--dimension-size-400));padding-block:var(--ds-control-padding-inline, var(--dimension-space-075));align-items:flex-start}.ds-choice-item__content.sc-ds-table-group{display:flex;flex:1;flex-direction:column;gap:var(--dimension-space-025);min-width:0}ds-text.ds-choice-item__label.sc-ds-table-group{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ds-text.ds-choice-item__subtext.sc-ds-table-group{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.ds-choice-item__icon.sc-ds-table-group,.ds-choice-item__suffix.sc-ds-table-group{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));pointer-events:none}.ds-choice-item.ds-interaction-fill--selected.sc-ds-table-group .ds-choice-item__icon.sc-ds-table-group{color:var(--color-foreground-primary)}.ds-choice-item__tag.sc-ds-table-group{flex-shrink:0;pointer-events:none}.ds-choice-empty.sc-ds-table-group,.ds-choice-loading.sc-ds-table-group{min-height:var(--dimension-size-600);padding:var(--dimension-space-100)}.ds-choice-footer.sc-ds-table-group{position:relative;box-sizing:border-box;padding-block:var(--dimension-space-050)}.ds-choice-footer.sc-ds-table-group::before{content:'';position:absolute;inset:0 0 auto;height:var(--dimension-stroke-width-012);background-color:var(--color-border-tertiary);pointer-events:none}.ds-choice-footer__content.sc-ds-table-group{display:flex;align-items:center;justify-content:space-between;column-gap:var(--dimension-space-050);box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400))}.ds-choice-footer__summary.sc-ds-table-group,.ds-choice-footer__summary-measure.sc-ds-table-group,.ds-choice-footer__clear.sc-ds-table-group ds-text.sc-ds-table-group,.ds-choice-footer__action.sc-ds-table-group ds-text.sc-ds-table-group{padding-inline:calc( var(--dimension-space-050) + var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-choice-footer__summary.sc-ds-table-group,.ds-choice-footer__summary-measure.sc-ds-table-group,.ds-choice-footer__clear.sc-ds-table-group,.ds-choice-footer__action.sc-ds-table-group{white-space:nowrap}.ds-choice-footer__summary-measure.sc-ds-table-group{position:absolute;visibility:hidden;pointer-events:none}.ds-choice-footer__clear.sc-ds-table-group,.ds-choice-footer__action.sc-ds-table-group{appearance:none;display:inline-flex;align-items:center;padding:0;border:0;border-radius:var(--dimension-radius-025);background:transparent;cursor:default}@media (forced-colors: active){.ds-choice-popup.sc-ds-table-group{outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}.ds-choice-popup.sc-ds-table-group::after{box-shadow:none}.ds-choice-section--divided.sc-ds-table-group{border-bottom-color:var(--ds-forced-color-content)}.ds-choice-footer.sc-ds-table-group::before{background-color:var(--ds-forced-color-content)}}.ds-control-frame.sc-ds-table-group{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.ds-control-section-heading.sc-ds-table-group{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-control-icon-box.sc-ds-table-group{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md))}.ds-control-label-box.sc-ds-table-group{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-table-group{position:relative;padding-inline-end:calc( var(--ds-control-label-inset, var(--dimension-space-025)) + var(--ds-control-gap, var(--dimension-space-050)) )}.ds-control-label-dot__badge.sc-ds-table-group{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}.ds-table-caption-control.sc-ds-table-group-h{--ds-choice-popup-min-inline-size:var(--dimension-menu-width-xs)}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-table-group-h{flex:0 0 auto;width:var(--ds-control-height, var(--dimension-size-400));height:var(--ds-control-height, var(--dimension-size-400));min-width:var(--ds-control-height, var(--dimension-size-400));min-height:var(--ds-control-height, var(--dimension-size-400));max-width:var(--ds-control-height, var(--dimension-size-400));inline-size:var(--ds-control-height, var(--dimension-size-400));min-inline-size:var(--ds-control-height, var(--dimension-size-400));max-inline-size:var(--ds-control-height, var(--dimension-size-400))}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-table-group-h .trigger.sc-ds-table-group{justify-content:center;inline-size:100%;min-inline-size:100%;height:100%;padding-inline:0}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-table-group-h .trigger--has-value.sc-ds-table-group{--ds-select-prefix-fg:var(--ds-select-fg-active)}@container ds-table (max-width: 899px){.sc-ds-table-group-h.ds-table-caption-control{flex:0 0 auto;inline-size:var(--ds-control-height, var(--dimension-size-400));min-inline-size:var(--ds-control-height, var(--dimension-size-400));max-inline-size:var(--ds-control-height, var(--dimension-size-400))}.sc-ds-table-group-h.ds-table-caption-control .trigger{justify-content:center;inline-size:100%;min-inline-size:100%;padding-inline:0}.sc-ds-table-group-h.ds-table-caption-control .trigger--has-value{--ds-select-prefix-fg:var(--ds-select-fg-active)}}.sc-ds-table-group-h{display:inline-flex;min-inline-size:0;max-inline-size:var(--dimension-menu-width-xs)}[hidden].sc-ds-table-group-h{display:none}.table-group__body.sc-ds-table-group{display:grid;grid-template-columns:var(--dimension-menu-width-xs) var(--dimension-menu-width-sm);min-height:calc(var(--dimension-size-800) * 4 + var(--dimension-space-150));max-height:calc(100vh - var(--dimension-size-800) - var(--dimension-size-600))}.table-group__data-pane.sc-ds-table-group,.table-group__order-pane.sc-ds-table-group{display:flex;min-width:0;min-height:0;flex-direction:column}.table-group__data-pane.sc-ds-table-group{border-inline-end:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.table-group__list.sc-ds-table-group{flex:1 1 auto}.table-group__empty.sc-ds-table-group{flex:1 1 auto}.table-group__footer.sc-ds-table-group{flex:0 0 auto}.table-group__footer.sc-ds-table-group .ds-choice-footer__content.sc-ds-table-group{justify-content:flex-start}.table-group__footer[aria-hidden='true'].sc-ds-table-group::before{visibility:hidden}.table-group__footer[aria-hidden='true'].sc-ds-table-group .ds-choice-footer__content.sc-ds-table-group{visibility:hidden}@media (forced-colors: active){.table-group__data-pane.sc-ds-table-group{border-inline-end-color:var(--ds-forced-color-content)}}`;let C=0;const T=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.dsGroupChange=i(this,"dsGroupChange",7);this.dsClear=i(this,"dsClear",7);this.dsOpenChange=i(this,"dsOpenChange",7);this.options=[];this.grouping=null;this.ariaLabel=null;this.open=false;this.emptyMessage="Select a group to choose its order.";this.clearLabel="Clear";this.shouldRender=false;this.closing=false;this.positionReady=false;this.pos={x:0,y:0};this.focusRingVisible=false;this.componentId=`ds-table-group-${++C}`;this.triggerId=`${this.componentId}-trigger`;this.popupId=`${this.componentId}-popup`;this.triggerElement=null;this.pendingInitialFocusVisible=false;this.closeTimer=null;this.position=new n({getAnchor:()=>this.triggerElement,getPopup:()=>this.el.querySelector(".table-group-popup"),getOwnerDocument:()=>this.el.ownerDocument,measure:(e,o)=>{if(!this.open)return null;const i=y(_.space050,_.space050);return{anchorRect:e.getBoundingClientRect(),popupWidth:o.offsetWidth||this.popupFallbackWidth,popupHeight:o.offsetHeight||this.popupFallbackHeight,side:"bottom",align:"end",sideOffsetPx:y(k.space050,_.space050),alignOffsetPx:d({align:"end",alignOffsetPx:0,sectionInsetPx:i}),viewportPadPx:y(_.space050,_.space050),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:a(e)}},apply:({x:e,y:o})=>{this.pos={x:e,y:o}},onReady:()=>{this.positionReady=true},liveUpdate:"double-frame",observeResize:true,topLayer:true});this.interaction=new c({getAnchor:()=>this.triggerElement,getPopup:()=>this.el.querySelector(".table-group-popup"),getOwnerDocument:()=>this.el.ownerDocument,onOutsideActivation:()=>this.close()})}componentDidLoad(){if(this.open)this.onOpenChange(true)}disconnectedCallback(){this.position.unobserve();this.interaction.disconnect();if(this.closeTimer)clearTimeout(this.closeTimer)}onOpenChange(e){if(e){this.teardown();this.shouldRender=true;this.closing=false;this.positionReady=false;this.focusRingVisible=this.pendingInitialFocusVisible;this.interaction.connect();this.position.observe();this.position.schedule((()=>this.focusInitialDataPoint()));return}if(!this.shouldRender)return;this.position.cancel();this.closing=true;this.interaction.disconnect();this.position.unobserve();const o=w(_.motionShort2,_.animationDurationShort3);if(o<=0)this.finishClose();else this.closeTimer=setTimeout((()=>this.finishClose()),o)}handleKeyDown(e){if(!this.shouldRender||this.closing)return;if(e.key==="Escape"){e.preventDefault();this.close();return}if(e.key!=="Tab"||!this.interaction.tabLeavesPopup(e))return;e.preventDefault();this.close(false);this.interaction.moveFocusAfterTab(e.shiftKey)}get popupFallbackWidth(){return y(_.menuWidthLg,_.menuWidthLg)}get popupFallbackHeight(){return y(_.menuFallbackHeight,_.menuFallbackHeight)}teardown(){this.position.unobserve();this.interaction.disconnect();if(this.closeTimer){clearTimeout(this.closeTimer);this.closeTimer=null}}toggle(e=false){if(this.open){this.close();return}this.pendingInitialFocusVisible=e;this.open=true;this.dsOpenChange.emit(true);this.onOpenChange(true)}close(e=true){if(e)this.interaction.focusAnchor();this.open=false;this.dsOpenChange.emit(false);this.onOpenChange(false)}finishClose(){const e=this.el.querySelector(".table-group-popup");if(e?.matches(":popover-open"))e.hidePopover();this.shouldRender=false;this.closing=false;this.closeTimer=null}focusInitialDataPoint(){requestAnimationFrame((()=>{const e=this.grouping?this.el.querySelector(`[data-group-value="${CSS.escape(this.grouping.columnId)}"] [role="option"]`):null;const o=e??this.el.querySelector('[data-group-value] [role="option"]:not([aria-disabled="true"])');o?.focus();this.pendingInitialFocusVisible=false}))}selectData(e){if(e.isInactive)return;this.dsGroupChange.emit({columnId:e.value,direction:this.grouping?.columnId===e.value?this.grouping.direction:"asc"})}selectDirection(e){if(!this.grouping||this.grouping.direction===e)return;this.dsGroupChange.emit({...this.grouping,direction:e})}moveFocus(e,o,i,t){if(t&&(e.key==="ArrowLeft"||e.key==="ArrowRight")){e.preventDefault();this.focusRingVisible=true;this.el.querySelector(t)?.focus();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;e.preventDefault();const s=Array.from(this.el.querySelectorAll(o)).filter((e=>e.getAttribute("aria-disabled")!=="true"));if(!s.length)return;let r;if(e.key==="Home")r=0;else if(e.key==="End")r=s.length-1;else r=(i+(e.key==="ArrowDown"?1:-1)+s.length)%s.length;this.focusRingVisible=true;s[r]?.focus()}renderDataOption(e,o){const i=e.value===this.grouping?.columnId;return t(p,{id:`${this.componentId}-data-${o}`,option:{...e},selected:i,active:i,focusRingVisible:this.focusRingVisible,usesSubtext:Boolean(e.description),tabIndex:i||!this.grouping&&o===0?0:-1,onHover:()=>{this.focusRingVisible=false},onSelect:()=>this.selectData(e),onKeyDown:o=>{if(o.key==="Enter"||o.key===" "){o.preventDefault();this.selectData(e);return}this.moveFocus(o,'[data-group-value] [role="option"]',this.options.filter((e=>!e.isInactive)).findIndex((o=>o.value===e.value)),this.grouping?`[data-group-direction="${this.grouping.direction}"] [role="option"]`:undefined)}})}renderDirection(e,o,i){const s=e===this.grouping?.direction;return t(p,{id:`${this.componentId}-direction-${e}`,option:{label:o,value:e},selected:s,active:s,focusRingVisible:this.focusRingVisible,usesSubtext:false,tabIndex:s?0:-1,onHover:()=>{this.focusRingVisible=false},onSelect:()=>this.selectDirection(e),onKeyDown:o=>{if(o.key==="Enter"||o.key===" "){o.preventDefault();this.selectDirection(e);return}this.moveFocus(o,'[data-group-direction] [role="option"]',i,`[data-group-value="${CSS.escape(this.grouping?.columnId??"")}"] [role="option"]`)}})}render(){const e=this.ariaLabel?.trim()||"Group table";const o={position:"fixed",left:"0",top:"0",transform:`translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,zIndex:"9998",visibility:this.positionReady?"visible":"hidden"};return t(s,{key:"01e2cd1b5f6877d5a8fc4c8468ebbaf39bb11df9",hidden:this.options.length===0?true:undefined},this.options.length?t("ds-button-unfilled",{ref:e=>{this.triggerElement=e??null},id:this.triggerId,variant:"icon-label",size:"md",icon:"SectionList",label:"Group",labelEmphasis:false,pressScale:false,"aria-label":e,hasMenu:true,collapseLabel:true,expanded:this.open,controls:this.popupId,onDsClick:e=>this.toggle(e.detail.detail===0)}):null,this.shouldRender?t("div",{id:this.popupId,popover:"manual",class:{"table-group-popup":true,"ds-choice-popup":true,"ds-choice-popup--closing":this.closing},style:o,role:"dialog","aria-label":e},t("div",{class:"table-group__body"},t("div",{class:"table-group__data-pane"},t(l,{heading:"Data",ariaLabel:"Group data",className:"table-group__list"},this.options.map(((e,o)=>t("div",{"data-group-value":e.value},this.renderDataOption(e,o))))),t("div",{class:"table-group__footer ds-choice-footer","aria-hidden":!this.grouping?"true":undefined},t("div",{class:"ds-choice-footer__content ds-control--md"},this.grouping?t("button",{class:"ds-choice-footer__clear ds-text-action ds-focus-ring",type:"button",onClick:()=>this.dsClear.emit()},t("ds-text",{as:"span",variant:"text-body-medium",color:"inherit"},this.clearLabel)):null))),t("div",{class:"table-group__order-pane"},this.grouping?t(l,{heading:"Order",ariaLabel:"Group order",className:"table-group__list"},t("div",{"data-group-direction":"asc"},this.renderDirection("asc","Ascending",0)),t("div",{"data-group-direction":"desc"},this.renderDirection("desc","Descending",1))):t("div",{class:"table-group__empty ds-choice-empty ds-empty-region"},t("ds-empty-state",{body:this.emptyMessage}))))):null)}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return z()}},[2,"ds-table-group",{options:[16],grouping:[16],ariaLabel:[1,"aria-label"],open:[1028],emptyMessage:[1,"empty-message"],clearLabel:[1,"clear-label"],shouldRender:[32],closing:[32],positionReady:[32],pos:[32],focusRingVisible:[32]},[[0,"keydown","handleKeyDown"]],{open:[{onOpenChange:0}]}]);function j(){if(typeof customElements==="undefined"){return}const e=["ds-table-group","ds-badge","ds-button-unfilled","ds-empty-state","ds-icon","ds-input","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-table-group":if(!customElements.get(r(e))){customElements.define(r(e),T)}break;case"ds-badge":if(!customElements.get(r(e))){u()}break;case"ds-button-unfilled":if(!customElements.get(r(e))){g()}break;case"ds-empty-state":if(!customElements.get(r(e))){h()}break;case"ds-icon":if(!customElements.get(r(e))){b()}break;case"ds-input":if(!customElements.get(r(e))){f()}break;case"ds-loader":if(!customElements.get(r(e))){v()}break;case"ds-text":if(!customElements.get(r(e))){m()}break;case"ds-tooltip":if(!customElements.get(r(e))){x()}break}}))}j();const D=T;const E=j;export{D as DsTableGroup,E as defineCustomElement};
1
+ import{p as e,H as o,c as i,h as t,a as s,t as r}from"./index.js";import{A as n,r as a}from"./p-DjF2m7bf.js";import{r as d,A as c}from"./p-etg-Uk1u.js";import{d as l,C as p}from"./p-BEttT0UB.js";import{d as u}from"./p-DzPtYdXy.js";import{d as g}from"./p-7MWaWl8w.js";import{d as h}from"./p-CpeJMKJ5.js";import{d as b}from"./p-Cea7rROU.js";import{d as f}from"./p-nVv71P3f.js";import{d as v}from"./p-0XTyQNRG.js";import{d as m}from"./p-Cd1JnnVK.js";import{d as x}from"./p-9X_p0bHr.js";import{r as w}from"./p-CochmPyg.js";import{a as y,T as _,b as k}from"./p-CUL5_8JM.js";const z=()=>`@media (forced-colors: active){.sc-ds-table-group:root,.sc-ds-table-group-h,.ds-forced-colors-scope.sc-ds-table-group{--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-table-group-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-table-group-h,.ds-focus-ring.sc-ds-table-group,.ds-focus-ring-inset.sc-ds-table-group-h,.ds-focus-ring-inset.sc-ds-table-group{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-table-group-h:focus-visible,.ds-focus-ring.sc-ds-table-group: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-table-group-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-table-group{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-table-group-h:focus-visible,.ds-focus-ring-inset.sc-ds-table-group:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-table-group-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-table-group: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-table-group-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-table-group{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-table-group-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-table-group::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-table-group-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-table-group:root,.sc-ds-table-group-h,.ds-forced-colors-scope.sc-ds-table-group{--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}}@media (forced-colors: active){.sc-ds-table-group:root,.sc-ds-table-group-h,.ds-forced-colors-scope.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill.sc-ds-table-group{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-table-group-h::before,.ds-interaction-fill.sc-ds-table-group::before,.ds-interaction-fill.sc-ds-table-group-h::after,.ds-interaction-fill.sc-ds-table-group::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-table-group-h::before,.ds-interaction-fill.sc-ds-table-group::before{z-index:1}.ds-interaction-fill.sc-ds-table-group-h::after,.ds-interaction-fill.sc-ds-table-group::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-table-group-h,.ds-interaction-fill--bordered.sc-ds-table-group{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-table-group-h::before,.ds-interaction-fill--selected.sc-ds-table-group::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-table-group-h,.ds-interaction-fill--selected.sc-ds-table-group{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-table-group-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-table-group:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-table-group-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-table-group:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-table-group-h::after,.ds-interaction-fill--grouped.sc-ds-table-group::after,.ds-interaction-fill--grouped.sc-ds-table-group-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-table-group:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-table-group-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-table-group:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-table-group-h,.ds-interaction-fill--grouped.sc-ds-table-group{--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-table-group-h>.ds-interaction-fill__content.sc-ds-table-group,.ds-interaction-fill.sc-ds-table-group>.ds-interaction-fill__content.sc-ds-table-group,.ds-interaction-fill__content.sc-ds-table-group{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-table-group-h,.ds-interaction-fill--on-faint.sc-ds-table-group{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-table-group-h,.ds-interaction-fill--on-medium.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-bold.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-strong.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-translucent.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-inverted.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-media.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-always-dark.sc-ds-table-group{--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-table-group-h,.ds-interaction-fill--on-navigation.sc-ds-table-group{--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-table-group-h::after,.ds-interaction-fill.sc-ds-table-group::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-table-group-h::before,.ds-interaction-fill--selected.sc-ds-table-group::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-table-group-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-table-group: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-table-group:root,.sc-ds-table-group-h,.ds-forced-colors-scope.sc-ds-table-group{--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-table-group-h,.ds-control-inactive.sc-ds-table-group{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-table-group-h,.ds-control-inactive.sc-ds-table-group{color:var(--ds-forced-color-disabled);opacity:1}}.ds-control--lg.sc-ds-table-group,.ds-control--lg.sc-ds-table-group-h,.ds-control--md.sc-ds-table-group-h,.ds-control--md.sc-ds-table-group,.ds-control--sm.sc-ds-table-group-h,.ds-control--sm.sc-ds-table-group,.ds-control--xs.sc-ds-table-group-h,.ds-control--xs.sc-ds-table-group{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-table-group-h,.ds-control--lg.sc-ds-table-group{--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-table-group-h,.ds-control--md.sc-ds-table-group{--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-table-group-h,.ds-control--sm.sc-ds-table-group{--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-table-group-h,.ds-control--xs.sc-ds-table-group{--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-chrome-space--sm.sc-ds-table-group-h,.ds-chrome-space--sm.sc-ds-table-group{--ds-chrome-padding:var(--dimension-space-050);--ds-chrome-gap:var(--dimension-space-050)}.ds-chrome-space--md.sc-ds-table-group-h,.ds-chrome-space--md.sc-ds-table-group{--ds-chrome-padding:var(--dimension-space-100);--ds-chrome-gap:var(--dimension-space-100)}.ds-chrome-space--lg.sc-ds-table-group-h,.ds-chrome-space--lg.sc-ds-table-group{--ds-chrome-padding:var(--dimension-space-200);--ds-chrome-gap:var(--dimension-space-200)}.ds-chrome-row.sc-ds-table-group-h,.ds-chrome-row.sc-ds-table-group,.ds-chrome-column.sc-ds-table-group-h,.ds-chrome-column.sc-ds-table-group,.ds-chrome-grid.sc-ds-table-group-h,.ds-chrome-grid.sc-ds-table-group{display:flex;box-sizing:border-box;gap:var(--ds-chrome-gap, var(--dimension-space-100));padding:var(--ds-chrome-padding, var(--dimension-space-100))}.ds-chrome-row.sc-ds-table-group-h,.ds-chrome-row.sc-ds-table-group{flex-direction:row;align-items:center}.ds-chrome-column.sc-ds-table-group-h,.ds-chrome-column.sc-ds-table-group{flex-direction:column}.ds-chrome-grid.sc-ds-table-group-h,.ds-chrome-grid.sc-ds-table-group{display:grid;align-items:center}.ds-control-frame.sc-ds-table-group{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.ds-control-section-heading.sc-ds-table-group{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-control-icon-box.sc-ds-table-group{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md))}.ds-control-label-box.sc-ds-table-group{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-table-group{position:relative;padding-inline-end:calc( var(--ds-control-label-inset, var(--dimension-space-025)) + var(--ds-control-gap, var(--dimension-space-050)) )}.ds-control-label-dot__badge.sc-ds-table-group{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}.ds-empty-region.sc-ds-table-group{display:flex;flex:1 1 auto;align-items:center;justify-content:center;box-sizing:border-box;min-width:0;min-height:0}.ds-empty-region--padded.sc-ds-table-group{padding:var(--dimension-space-200)}.sc-ds-table-group:where(.ds-text-decoration,.ds-text-action).sc-ds-table-group{text-decoration-color:var(--ds-text-decoration-color, var(--color-foreground-tertiary));text-decoration-thickness:var(--ds-text-decoration-thickness, var(--dimension-stroke-width-012));text-underline-offset:var(--ds-text-decoration-offset, var(--dimension-space-025))}.ds-text-action.sc-ds-table-group{--ds-text-action-foreground:var(--color-foreground-bold-brand);--ds-text-decoration-color:var(--ds-text-action-foreground);color:var(--ds-text-action-foreground);text-decoration-line:none}.ds-text-action--on-medium.sc-ds-table-group{--ds-text-action-foreground:var(--color-foreground-on-medium-background-primary);--ds-text-decoration-color:var(--color-foreground-on-medium-background-secondary);text-decoration-line:underline}.ds-text-action--on-strong.sc-ds-table-group{--ds-text-action-foreground:var(--color-foreground-on-strong-background-primary);--ds-text-decoration-color:var(--color-foreground-on-strong-background-secondary);text-decoration-line:underline}.ds-text-action--on-bold.sc-ds-table-group{--ds-text-action-foreground:var(--color-foreground-on-bold-background-primary);--ds-text-decoration-color:var(--color-foreground-on-bold-background-secondary);text-decoration-line:underline}@media (hover: hover) and (pointer: fine){.ds-text-action.sc-ds-table-group:hover{text-decoration-line:underline}}@media (forced-colors: active){.ds-text-action.sc-ds-table-group{text-decoration-line:underline;text-decoration-color:currentcolor}}.ds-choice-popup.sc-ds-table-group{box-sizing:border-box;display:flex;flex-direction:column;min-width:var(--ds-choice-popup-min-inline-size, var(--dimension-menu-width-xs));max-width:min(var(--dimension-panel-width-lg), calc(100vw - var(--dimension-space-200)));max-height:calc(100vh - var(--dimension-space-200));overflow:hidden;inset:auto;margin:0;padding:0;border:0;background-color:var(--color-background-primary);border-radius:var(--dimension-radius-075);box-shadow:var(--effect-shadow-elevated-floating);color:var(--color-foreground-secondary);animation:dsChoiceFadeIn var(--effect-motion-short-2) forwards;backface-visibility:hidden;will-change:transform;text-align:start}.ds-choice-popup.sc-ds-table-group::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:var(--effect-highlight-elevated-floating)}.ds-choice-popup--closing.sc-ds-table-group{animation:dsChoiceFadeOut var(--effect-motion-short-2) forwards}@keyframes dsChoiceFadeIn{from{opacity:0;transform:inherit scale(0.97)}to{opacity:1}}@keyframes dsChoiceFadeOut{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.ds-choice-popup.sc-ds-table-group{animation:none;opacity:1}.ds-choice-popup--closing.sc-ds-table-group{opacity:0}}.ds-choice-list.sc-ds-table-group{display:flex;flex-direction:column;min-height:0;overflow-y:auto;overscroll-behavior:contain}.ds-choice-section--divided.sc-ds-table-group{border-bottom:var(--dimension-stroke-width-015) solid var(--color-border-tertiary)}ds-text.ds-choice-section__header.sc-ds-table-group{text-align:start;-webkit-user-select:none;user-select:none}.ds-choice-section--headed-after-first.sc-ds-table-group{margin-block-start:var(--dimension-space-050)}.ds-choice-item.sc-ds-table-group{width:100%;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));background:transparent;cursor:default;-webkit-user-select:none;user-select:none;text-align:left;color:inherit}.ds-choice-item.sc-ds-table-group:has(.ds-choice-item__subtext){height:auto;min-height:var(--ds-control-height, var(--dimension-size-400));padding-block:var(--ds-control-padding-inline, var(--dimension-space-075));align-items:flex-start}.ds-choice-item__content.sc-ds-table-group{display:flex;flex:1;flex-direction:column;gap:var(--dimension-space-025);min-width:0}ds-text.ds-choice-item__label.sc-ds-table-group{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ds-text.ds-choice-item__subtext.sc-ds-table-group{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.ds-choice-item__icon.sc-ds-table-group,.ds-choice-item__suffix.sc-ds-table-group{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md));pointer-events:none}.ds-choice-item.ds-interaction-fill--selected.sc-ds-table-group .ds-choice-item__icon.sc-ds-table-group{color:var(--color-foreground-primary)}.ds-choice-item__tag.sc-ds-table-group{flex-shrink:0;pointer-events:none}.ds-choice-empty.sc-ds-table-group,.ds-choice-loading.sc-ds-table-group{min-height:var(--dimension-size-600);padding:var(--dimension-space-100)}.ds-choice-footer.sc-ds-table-group{position:relative;box-sizing:border-box;padding-block:var(--dimension-space-050)}.ds-choice-footer.sc-ds-table-group::before{content:'';position:absolute;inset:0 0 auto;height:var(--dimension-stroke-width-012);background-color:var(--color-border-tertiary);pointer-events:none}.ds-choice-footer__content.sc-ds-table-group{display:flex;align-items:center;justify-content:space-between;column-gap:var(--dimension-space-050);box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400))}.ds-choice-footer__summary.sc-ds-table-group,.ds-choice-footer__summary-measure.sc-ds-table-group,.ds-choice-footer__clear.sc-ds-table-group ds-text.sc-ds-table-group,.ds-choice-footer__action.sc-ds-table-group ds-text.sc-ds-table-group{padding-inline:calc( var(--dimension-space-050) + var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-choice-footer__summary.sc-ds-table-group,.ds-choice-footer__summary-measure.sc-ds-table-group,.ds-choice-footer__clear.sc-ds-table-group,.ds-choice-footer__action.sc-ds-table-group{white-space:nowrap}.ds-choice-footer__summary-measure.sc-ds-table-group{position:absolute;visibility:hidden;pointer-events:none}.ds-choice-footer__clear.sc-ds-table-group,.ds-choice-footer__action.sc-ds-table-group{appearance:none;display:inline-flex;align-items:center;padding:0;border:0;border-radius:var(--dimension-radius-025);background:transparent;cursor:default}@media (forced-colors: active){.ds-choice-popup.sc-ds-table-group{outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}.ds-choice-popup.sc-ds-table-group::after{box-shadow:none}.ds-choice-section--divided.sc-ds-table-group{border-bottom-color:var(--ds-forced-color-content)}.ds-choice-footer.sc-ds-table-group::before{background-color:var(--ds-forced-color-content)}}.ds-control-frame.sc-ds-table-group{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.ds-control-section-heading.sc-ds-table-group{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-control-icon-box.sc-ds-table-group{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md))}.ds-control-label-box.sc-ds-table-group{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-table-group{position:relative;padding-inline-end:calc( var(--ds-control-label-inset, var(--dimension-space-025)) + var(--ds-control-gap, var(--dimension-space-050)) )}.ds-control-label-dot__badge.sc-ds-table-group{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}.ds-table-caption-control.sc-ds-table-group-h{--ds-choice-popup-min-inline-size:var(--dimension-menu-width-xs)}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-table-group-h{flex:0 0 auto;width:var(--ds-control-height, var(--dimension-size-400));height:var(--ds-control-height, var(--dimension-size-400));min-width:var(--ds-control-height, var(--dimension-size-400));min-height:var(--ds-control-height, var(--dimension-size-400));max-width:var(--ds-control-height, var(--dimension-size-400));inline-size:var(--ds-control-height, var(--dimension-size-400));min-inline-size:var(--ds-control-height, var(--dimension-size-400));max-inline-size:var(--ds-control-height, var(--dimension-size-400))}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-table-group-h .trigger.sc-ds-table-group{justify-content:center;inline-size:100%;min-inline-size:100%;height:100%;padding-inline:0}.ds-table-caption-control.ds-table-caption-control--compact.sc-ds-table-group-h .trigger--has-value.sc-ds-table-group{--ds-select-prefix-fg:var(--ds-select-fg-active)}@container ds-table (max-width: 899px){.sc-ds-table-group-h.ds-table-caption-control{flex:0 0 auto;inline-size:var(--ds-control-height, var(--dimension-size-400));min-inline-size:var(--ds-control-height, var(--dimension-size-400));max-inline-size:var(--ds-control-height, var(--dimension-size-400))}.sc-ds-table-group-h.ds-table-caption-control .trigger{justify-content:center;inline-size:100%;min-inline-size:100%;padding-inline:0}.sc-ds-table-group-h.ds-table-caption-control .trigger--has-value{--ds-select-prefix-fg:var(--ds-select-fg-active)}}.sc-ds-table-group-h{display:inline-flex;min-inline-size:0;max-inline-size:var(--dimension-menu-width-xs)}[hidden].sc-ds-table-group-h{display:none}.table-group__body.sc-ds-table-group{display:grid;grid-template-columns:var(--dimension-menu-width-xs) var(--dimension-menu-width-sm);min-height:calc(var(--dimension-size-800) * 4 + var(--dimension-space-150));max-height:calc(100vh - var(--dimension-size-800) - var(--dimension-size-600))}.table-group__data-pane.sc-ds-table-group,.table-group__order-pane.sc-ds-table-group{display:flex;min-width:0;min-height:0;flex-direction:column}.table-group__data-pane.sc-ds-table-group{border-inline-end:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.table-group__list.sc-ds-table-group{flex:1 1 auto}.table-group__empty.sc-ds-table-group{flex:1 1 auto}.table-group__footer.sc-ds-table-group{flex:0 0 auto}.table-group__footer.sc-ds-table-group .ds-choice-footer__content.sc-ds-table-group{justify-content:flex-start}.table-group__footer[aria-hidden='true'].sc-ds-table-group::before{visibility:hidden}.table-group__footer[aria-hidden='true'].sc-ds-table-group .ds-choice-footer__content.sc-ds-table-group{visibility:hidden}@media (forced-colors: active){.table-group__data-pane.sc-ds-table-group{border-inline-end-color:var(--ds-forced-color-content)}}`;let C=0;const j=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.dsGroupChange=i(this,"dsGroupChange",7);this.dsClear=i(this,"dsClear",7);this.dsOpenChange=i(this,"dsOpenChange",7);this.options=[];this.grouping=null;this.ariaLabel=null;this.open=false;this.emptyMessage="Select a group to choose its order.";this.clearLabel="Clear";this.shouldRender=false;this.closing=false;this.positionReady=false;this.pos={x:0,y:0};this.focusRingVisible=false;this.componentId=`ds-table-group-${++C}`;this.triggerId=`${this.componentId}-trigger`;this.popupId=`${this.componentId}-popup`;this.triggerElement=null;this.pendingInitialFocusVisible=false;this.closeTimer=null;this.position=new n({getAnchor:()=>this.triggerElement,getPopup:()=>this.el.querySelector(".table-group-popup"),getOwnerDocument:()=>this.el.ownerDocument,measure:(e,o)=>{if(!this.open)return null;const i=w(_.space050,_.space050);return{anchorRect:e.getBoundingClientRect(),popupWidth:o.offsetWidth||this.popupFallbackWidth,popupHeight:o.offsetHeight||this.popupFallbackHeight,side:"bottom",align:"end",sideOffsetPx:w(k.space050,_.space050),alignOffsetPx:d({align:"end",alignOffsetPx:0,sectionInsetPx:i}),viewportPadPx:w(_.space050,_.space050),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:a(e)}},apply:({x:e,y:o})=>{this.pos={x:e,y:o}},onReady:()=>{this.positionReady=true},liveUpdate:"double-frame",observeResize:true,topLayer:true});this.interaction=new c({getAnchor:()=>this.triggerElement,getPopup:()=>this.el.querySelector(".table-group-popup"),getOwnerDocument:()=>this.el.ownerDocument,onOutsideActivation:()=>this.close()})}componentDidLoad(){if(this.open)this.onOpenChange(true)}disconnectedCallback(){this.position.unobserve();this.interaction.disconnect();if(this.closeTimer)clearTimeout(this.closeTimer)}onOpenChange(e){if(e){this.teardown();this.shouldRender=true;this.closing=false;this.positionReady=false;this.focusRingVisible=this.pendingInitialFocusVisible;this.interaction.connect();this.position.observe();this.position.schedule((()=>this.focusInitialDataPoint()));return}if(!this.shouldRender)return;this.position.cancel();this.closing=true;this.interaction.disconnect();this.position.unobserve();const o=y(_.motionShort2,_.animationDurationShort3);if(o<=0)this.finishClose();else this.closeTimer=setTimeout((()=>this.finishClose()),o)}handleKeyDown(e){if(!this.shouldRender||this.closing)return;if(e.key==="Escape"){e.preventDefault();this.close();return}if(e.key!=="Tab"||!this.interaction.tabLeavesPopup(e))return;e.preventDefault();this.close(false);this.interaction.moveFocusAfterTab(e.shiftKey)}get popupFallbackWidth(){return w(_.menuWidthLg,_.menuWidthLg)}get popupFallbackHeight(){return w(_.menuFallbackHeight,_.menuFallbackHeight)}teardown(){this.position.unobserve();this.interaction.disconnect();if(this.closeTimer){clearTimeout(this.closeTimer);this.closeTimer=null}}toggle(e=false){if(this.open){this.close();return}this.pendingInitialFocusVisible=e;this.open=true;this.dsOpenChange.emit(true);this.onOpenChange(true)}close(e=true){if(e)this.interaction.focusAnchor();this.open=false;this.dsOpenChange.emit(false);this.onOpenChange(false)}finishClose(){const e=this.el.querySelector(".table-group-popup");if(e?.matches(":popover-open"))e.hidePopover();this.shouldRender=false;this.closing=false;this.closeTimer=null}focusInitialDataPoint(){requestAnimationFrame((()=>{const e=this.grouping?this.el.querySelector(`[data-group-value="${CSS.escape(this.grouping.columnId)}"] [role="option"]`):null;const o=e??this.el.querySelector('[data-group-value] [role="option"]:not([aria-disabled="true"])');o?.focus();this.pendingInitialFocusVisible=false}))}selectData(e){if(e.isInactive)return;this.dsGroupChange.emit({columnId:e.value,direction:this.grouping?.columnId===e.value?this.grouping.direction:"asc"})}selectDirection(e){if(!this.grouping||this.grouping.direction===e)return;this.dsGroupChange.emit({...this.grouping,direction:e})}moveFocus(e,o,i,t){if(t&&(e.key==="ArrowLeft"||e.key==="ArrowRight")){e.preventDefault();this.focusRingVisible=true;this.el.querySelector(t)?.focus();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;e.preventDefault();const s=Array.from(this.el.querySelectorAll(o)).filter((e=>e.getAttribute("aria-disabled")!=="true"));if(!s.length)return;let r;if(e.key==="Home")r=0;else if(e.key==="End")r=s.length-1;else r=(i+(e.key==="ArrowDown"?1:-1)+s.length)%s.length;this.focusRingVisible=true;s[r]?.focus()}renderDataOption(e,o){const i=e.value===this.grouping?.columnId;return t(p,{id:`${this.componentId}-data-${o}`,option:{...e},selected:i,active:i,focusRingVisible:this.focusRingVisible,usesSubtext:Boolean(e.description),tabIndex:i||!this.grouping&&o===0?0:-1,onHover:()=>{this.focusRingVisible=false},onSelect:()=>this.selectData(e),onKeyDown:o=>{if(o.key==="Enter"||o.key===" "){o.preventDefault();this.selectData(e);return}this.moveFocus(o,'[data-group-value] [role="option"]',this.options.filter((e=>!e.isInactive)).findIndex((o=>o.value===e.value)),this.grouping?`[data-group-direction="${this.grouping.direction}"] [role="option"]`:undefined)}})}renderDirection(e,o,i){const s=e===this.grouping?.direction;return t(p,{id:`${this.componentId}-direction-${e}`,option:{label:o,value:e},selected:s,active:s,focusRingVisible:this.focusRingVisible,usesSubtext:false,tabIndex:s?0:-1,onHover:()=>{this.focusRingVisible=false},onSelect:()=>this.selectDirection(e),onKeyDown:o=>{if(o.key==="Enter"||o.key===" "){o.preventDefault();this.selectDirection(e);return}this.moveFocus(o,'[data-group-direction] [role="option"]',i,`[data-group-value="${CSS.escape(this.grouping?.columnId??"")}"] [role="option"]`)}})}render(){const e=this.ariaLabel?.trim()||"Group table";const o={position:"fixed",left:"0",top:"0",transform:`translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,zIndex:"9998",visibility:this.positionReady?"visible":"hidden"};return t(s,{key:"01e2cd1b5f6877d5a8fc4c8468ebbaf39bb11df9",hidden:this.options.length===0?true:undefined},this.options.length?t("ds-button-unfilled",{ref:e=>{this.triggerElement=e??null},id:this.triggerId,variant:"icon-label",size:"md",icon:"SectionList",label:"Group",labelEmphasis:false,pressScale:false,"aria-label":e,hasMenu:true,collapseLabel:true,expanded:this.open,controls:this.popupId,onDsClick:e=>this.toggle(e.detail.detail===0)}):null,this.shouldRender?t("div",{id:this.popupId,popover:"manual",class:{"table-group-popup":true,"ds-choice-popup":true,"ds-choice-popup--closing":this.closing},style:o,role:"dialog","aria-label":e},t("div",{class:"table-group__body"},t("div",{class:"table-group__data-pane"},t(l,{heading:"Data",ariaLabel:"Group data",className:"table-group__list"},this.options.map(((e,o)=>t("div",{"data-group-value":e.value},this.renderDataOption(e,o))))),t("div",{class:"table-group__footer ds-choice-footer","aria-hidden":!this.grouping?"true":undefined},t("div",{class:"ds-choice-footer__content ds-control--md"},this.grouping?t("button",{class:"ds-choice-footer__clear ds-text-action ds-focus-ring",type:"button",onClick:()=>this.dsClear.emit()},t("ds-text",{as:"span",variant:"text-body-medium",color:"inherit"},this.clearLabel)):null))),t("div",{class:"table-group__order-pane"},this.grouping?t(l,{heading:"Order",ariaLabel:"Group order",className:"table-group__list"},t("div",{"data-group-direction":"asc"},this.renderDirection("asc","Ascending",0)),t("div",{"data-group-direction":"desc"},this.renderDirection("desc","Descending",1))):t("div",{class:"table-group__empty ds-choice-empty ds-empty-region"},t("ds-empty-state",{body:this.emptyMessage}))))):null)}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return z()}},[2,"ds-table-group",{options:[16],grouping:[16],ariaLabel:[1,"aria-label"],open:[1028],emptyMessage:[1,"empty-message"],clearLabel:[1,"clear-label"],shouldRender:[32],closing:[32],positionReady:[32],pos:[32],focusRingVisible:[32]},[[0,"keydown","handleKeyDown"]],{open:[{onOpenChange:0}]}]);function T(){if(typeof customElements==="undefined"){return}const e=["ds-table-group","ds-badge","ds-button-unfilled","ds-empty-state","ds-icon","ds-input","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-table-group":if(!customElements.get(r(e))){customElements.define(r(e),j)}break;case"ds-badge":if(!customElements.get(r(e))){u()}break;case"ds-button-unfilled":if(!customElements.get(r(e))){g()}break;case"ds-empty-state":if(!customElements.get(r(e))){h()}break;case"ds-icon":if(!customElements.get(r(e))){b()}break;case"ds-input":if(!customElements.get(r(e))){f()}break;case"ds-loader":if(!customElements.get(r(e))){v()}break;case"ds-text":if(!customElements.get(r(e))){m()}break;case"ds-tooltip":if(!customElements.get(r(e))){x()}break}}))}T();const D=j;const E=T;export{D as DsTableGroup,E as defineCustomElement};
2
2
  //# sourceMappingURL=ds-table-group.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as i,a,t as n}from"./index.js";import{d}from"./p-DzPtYdXy.js";import{d as o}from"./p-BnTPuV3x.js";import{d as l}from"./p-DSy1oOnd.js";import{d as r}from"./p-CBymzuOO.js";import{d as h}from"./p-CpeJMKJ5.js";import{d as c}from"./p-CE2b5GPu.js";import{d as m}from"./p-Cea7rROU.js";import{d as f}from"./p-pxN8JGEh.js";import{d as u}from"./p-0XTyQNRG.js";import{d as b}from"./p-CFkZSDwI.js";import{d as p}from"./p-9ykZwPlI.js";import{d as v}from"./p-BFit8o0r.js";import{d as w}from"./p-XaCYqck3.js";import{d as k}from"./p-DGkn8FwV.js";import{d as g}from"./p-DbLLH3hr.js";import{d as y}from"./p-Cd1JnnVK.js";import{d as D}from"./p-pnO8tAYB.js";const E=()=>`.sc-ds-table-saved-views-h{--ds-choice-popup-min-inline-size:var(--dimension-menu-width-xs);display:inline-block;min-inline-size:0;max-inline-size:var(--dimension-menu-width-xs)}ds-select.sc-ds-table-saved-views{display:block;min-inline-size:0;max-inline-size:100%}.table-saved-views__dialog-actions.sc-ds-table-saved-views{display:flex;align-items:center;justify-content:flex-start;gap:var(--dimension-space-100)}`;let C=0;const x=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsViewChange=t(this,"dsViewChange",7);this.dsViewCreate=t(this,"dsViewCreate",7);this.dsViewRename=t(this,"dsViewRename",7);this.dsViewRemove=t(this,"dsViewRemove",7);this.dsViewSave=t(this,"dsViewSave",7);this.dsViewDiscard=t(this,"dsViewDiscard",7);this.views=[];this.value="__default__";this.dirty=false;this.defaultViewId="__default__";this.defaultViewLabel="Default";this.label="Saved views";this.triggerLabel="Views";this.createLabel="New view";this.actionViewId=null;this.actionMenuOpen=false;this.actionMenuInitialFocusVisible=false;this.dialogOpen=false;this.dialogMode="create";this.dialogViewId=null;this.nameDraft="";this.nameError="";this.componentId=`ds-table-saved-views-${++C}`;this.selectId=`${this.componentId}-select`;this.actionMenuId=`${this.componentId}-actions`;this.fieldId=`${this.componentId}-name-field`;this.inputId=`${this.componentId}-name-input`;this.actionItems=[{label:"Rename",value:"rename"},{label:"Remove",value:"remove",isDestructive:true}]}get selectedCustomView(){return this.views.find((e=>e.id===this.value))}get dialogView(){return this.views.find((e=>e.id===this.dialogViewId))}get sections(){const e=this.views.map((e=>({label:e.label,value:e.id,subtextActions:this.dirty&&e.id===this.selectedCustomView?.id?[{label:"Save",value:"save"},{label:"Discard",value:"discard",tone:"negative"}]:undefined,action:{label:`Options for ${e.label}`,controls:this.actionMenuId,expanded:this.actionViewId===e.id&&this.actionMenuOpen}})));const s={header:"Templates",options:[{label:this.defaultViewLabel,value:this.defaultViewId}],divider:e.length>0};return e.length>0?[s,{header:"Custom",options:e}]:[s]}handleViewChange(e){if(typeof e==="string")this.dsViewChange.emit({viewId:e})}handleSubtextAction(e){const s=this.selectedCustomView;if(!s||!this.dirty||e.value!==s.id)return;if(e.actionValue==="save")this.dsViewSave.emit({viewId:s.id});if(e.actionValue==="discard")this.dsViewDiscard.emit({viewId:s.id})}handleOptionAction(e){if(!this.views.some((s=>s.id===e.value)))return;this.actionMenuInitialFocusVisible=e.originalEvent.detail===0;if(this.actionViewId===e.value&&this.actionMenuOpen){this.actionMenuOpen=false;return}this.actionViewId=e.value;this.actionAnchorId=e.anchorId;this.actionMenuOpen=true}handleActionSelect(e){const s=this.actionViewId;this.actionMenuOpen=false;if(!s)return;if(e.detail.value==="rename")this.openDialog("rename",s);if(e.detail.value==="remove")this.dsViewRemove.emit({viewId:s})}openDialog(e,s=null){const t=e==="rename"?this.views.find((e=>e.id===s)):undefined;if(e==="rename"&&!t)return;this.dialogMode=e;this.dialogViewId=t?.id??null;this.nameDraft=t?.label??"";this.nameError="";this.dialogOpen=true;requestAnimationFrame((()=>{requestAnimationFrame((()=>{const e=this.el.querySelector(`#${this.inputId}`);void e?.setFocus?.()}))}))}validateName(){const e=this.nameDraft.trim();if(!e)return"View name is required.";const s=this.views.some((s=>s.id!==this.dialogViewId&&s.label.trim().toLocaleLowerCase()===e.toLocaleLowerCase()));if(s||this.defaultViewLabel.trim().toLocaleLowerCase()===e.toLocaleLowerCase()){return"A view with this name already exists."}return""}submitDialog(){const e=this.validateName();if(e){this.nameError=e;return}const s=this.nameDraft.trim();if(this.dialogMode==="rename"&&this.dialogView){this.dsViewRename.emit({viewId:this.dialogView.id,name:s})}else{this.dsViewCreate.emit({name:s})}this.dialogOpen=false}finishDialogClose(){if(this.dialogOpen)return;this.dialogViewId=null;this.nameDraft="";this.nameError="";const e=this.el.querySelector(`#${this.selectId}`);void e?.setFocus?.()}render(){return i(a,{key:"660dccb55413ffa14e33e25067d31a1bfccb5b2b"},i("ds-select",{key:"38fb9959ad7369f73bbf90f47d37a6871dbcf874",id:this.selectId,size:"md",width:"fill",placeholder:this.label,"aria-label":this.label,sections:this.sections,value:this.value,triggerLabel:this.selectedCustomView?undefined:this.triggerLabel,triggerLabelPlaceholder:!this.selectedCustomView,dot:this.dirty&&Boolean(this.selectedCustomView),footerActionLabel:this.createLabel,activeFill:false,allowClear:false,onDsChange:e=>this.handleViewChange(e.detail),onDsFooterAction:()=>this.openDialog("create"),onDsOptionSubtextAction:e=>this.handleSubtextAction(e.detail),onDsOptionAction:e=>this.handleOptionAction(e.detail)}),i("ds-menu",{key:"6bade45a5732688bdb21acded0a260627079cc52",id:this.actionMenuId,anchorId:this.actionAnchorId,menuLabel:"Saved view options",side:"bottom",align:"end",menuWidth:"max-content",minWidth:"0",items:this.actionItems,open:this.actionMenuOpen,initialFocusVisible:this.actionMenuInitialFocusVisible,onDsClose:()=>this.actionMenuOpen=false,onDsAfterClose:()=>{if(this.actionMenuOpen)return;this.actionViewId=null;this.actionAnchorId=undefined},onDsSelect:e=>this.handleActionSelect(e)}),i("ds-modal",{key:"c64efde87cc8391c52869d0e96d10e0e307b7c05",open:this.dialogOpen,heading:this.dialogMode==="rename"?"Rename view":"Save as new view",modalWidth:"sm",onDsClose:()=>this.dialogOpen=false,onDsAfterClose:()=>this.finishDialogClose()},i("ds-field",{key:"93ccfe6cb5f099ddce0902d1562121e561e550e4",label:"Name",fieldId:this.fieldId,error:this.nameError.length>0,errorMessage:this.nameError},i("ds-input",{key:"886e6c697be7266f4f2f71168e7b9a8ffea17177",id:this.inputId,size:"md",placeholder:"Enter a unique name",value:this.nameDraft,autoFocus:true,onDsChange:e=>{this.nameDraft=e.detail;if(this.nameError)this.nameError=""},onKeyDown:e=>{if(e.key==="Enter")this.submitDialog()}})),i("div",{key:"e06359cb65025c604d4dacaa385aed61f18ce597",slot:"footer",class:"table-saved-views__dialog-actions"},i("ds-button-filled",{key:"9ff1488729275f47d160cc116ce9a3e4718d8d8f",label:this.dialogMode==="rename"?"Rename":"Save",size:"md",onDsClick:()=>this.submitDialog()}),i("ds-button-unfilled",{key:"151ae0dfe6841850c1a28aff2f3ac9613ea99db2",label:"Cancel",size:"md",onDsClick:()=>this.dialogOpen=false}))))}get el(){return this}static get style(){return E()}},[2,"ds-table-saved-views",{views:[16],value:[1],dirty:[4],defaultViewId:[1,"default-view-id"],defaultViewLabel:[1,"default-view-label"],label:[1],triggerLabel:[1,"trigger-label"],createLabel:[1,"create-label"],actionViewId:[32],actionAnchorId:[32],actionMenuOpen:[32],actionMenuInitialFocusVisible:[32],dialogOpen:[32],dialogMode:[32],dialogViewId:[32],nameDraft:[32],nameError:[32]}]);function V(){if(typeof customElements==="undefined"){return}const e=["ds-table-saved-views","ds-badge","ds-button-filled","ds-button-unfilled","ds-checkbox","ds-empty-state","ds-field","ds-icon","ds-input","ds-loader","ds-menu","ds-modal","ds-select","ds-swatch-picker","ds-switch","ds-tag","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-table-saved-views":if(!customElements.get(n(e))){customElements.define(n(e),x)}break;case"ds-badge":if(!customElements.get(n(e))){d()}break;case"ds-button-filled":if(!customElements.get(n(e))){o()}break;case"ds-button-unfilled":if(!customElements.get(n(e))){l()}break;case"ds-checkbox":if(!customElements.get(n(e))){r()}break;case"ds-empty-state":if(!customElements.get(n(e))){h()}break;case"ds-field":if(!customElements.get(n(e))){c()}break;case"ds-icon":if(!customElements.get(n(e))){m()}break;case"ds-input":if(!customElements.get(n(e))){f()}break;case"ds-loader":if(!customElements.get(n(e))){u()}break;case"ds-menu":if(!customElements.get(n(e))){b()}break;case"ds-modal":if(!customElements.get(n(e))){p()}break;case"ds-select":if(!customElements.get(n(e))){v()}break;case"ds-swatch-picker":if(!customElements.get(n(e))){w()}break;case"ds-switch":if(!customElements.get(n(e))){k()}break;case"ds-tag":if(!customElements.get(n(e))){g()}break;case"ds-text":if(!customElements.get(n(e))){y()}break;case"ds-tooltip":if(!customElements.get(n(e))){D()}break}}))}V();const j=x;const A=V;export{j as DsTableSavedViews,A as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as i,a,t as n}from"./index.js";import{d}from"./p-DzPtYdXy.js";import{d as l}from"./p-BnTPuV3x.js";import{d as o}from"./p-7MWaWl8w.js";import{d as r}from"./p-CBymzuOO.js";import{d as h}from"./p-CpeJMKJ5.js";import{d as c}from"./p-CE2b5GPu.js";import{d as m}from"./p-Cea7rROU.js";import{d as f}from"./p-nVv71P3f.js";import{d as u}from"./p-0XTyQNRG.js";import{d as b}from"./p-DeK_6Uym.js";import{d as p}from"./p-CL0tECXf.js";import{d as v}from"./p-BIaHDBfP.js";import{d as w}from"./p-XaCYqck3.js";import{d as g}from"./p-DGkn8FwV.js";import{d as k}from"./p-DbLLH3hr.js";import{d as D}from"./p-Cd1JnnVK.js";import{d as y}from"./p-9X_p0bHr.js";const E=()=>`.sc-ds-table-saved-views-h{--ds-choice-popup-min-inline-size:var(--dimension-menu-width-xs);display:inline-block;min-inline-size:0;max-inline-size:var(--dimension-menu-width-xs)}ds-select.sc-ds-table-saved-views{display:block;min-inline-size:0;max-inline-size:100%}.table-saved-views__dialog-actions.sc-ds-table-saved-views{display:flex;align-items:center;justify-content:flex-start;gap:var(--dimension-space-100)}`;let C=0;const V=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsViewChange=t(this,"dsViewChange",7);this.dsViewCreate=t(this,"dsViewCreate",7);this.dsViewRename=t(this,"dsViewRename",7);this.dsViewRemove=t(this,"dsViewRemove",7);this.dsViewSave=t(this,"dsViewSave",7);this.dsViewDiscard=t(this,"dsViewDiscard",7);this.views=[];this.value="__default__";this.dirty=false;this.defaultViewId="__default__";this.defaultViewLabel="Default";this.label="Saved views";this.triggerLabel="Views";this.createLabel="New view";this.actionViewId=null;this.actionMenuOpen=false;this.actionMenuInitialFocusVisible=false;this.dialogOpen=false;this.dialogMode="create";this.dialogViewId=null;this.nameDraft="";this.nameError="";this.componentId=`ds-table-saved-views-${++C}`;this.selectId=`${this.componentId}-select`;this.actionMenuId=`${this.componentId}-actions`;this.fieldId=`${this.componentId}-name-field`;this.inputId=`${this.componentId}-name-input`;this.actionItems=[{label:"Rename",value:"rename"},{label:"Remove",value:"remove",isDestructive:true}]}get selectedCustomView(){return this.views.find((e=>e.id===this.value))}get dialogView(){return this.views.find((e=>e.id===this.dialogViewId))}get sections(){const e=this.views.map((e=>({label:e.label,value:e.id,subtextActions:this.dirty&&e.id===this.selectedCustomView?.id?[{label:"Save",value:"save"},{label:"Discard",value:"discard",tone:"negative"}]:undefined,action:{label:`Options for ${e.label}`,controls:this.actionMenuId,expanded:this.actionViewId===e.id&&this.actionMenuOpen}})));const s={header:"Templates",options:[{label:this.defaultViewLabel,value:this.defaultViewId}],divider:e.length>0};return e.length>0?[s,{header:"Custom",options:e}]:[s]}handleViewChange(e){if(typeof e==="string")this.dsViewChange.emit({viewId:e})}handleSubtextAction(e){const s=this.selectedCustomView;if(!s||!this.dirty||e.value!==s.id)return;if(e.actionValue==="save")this.dsViewSave.emit({viewId:s.id});if(e.actionValue==="discard")this.dsViewDiscard.emit({viewId:s.id})}handleOptionAction(e){if(!this.views.some((s=>s.id===e.value)))return;this.actionMenuInitialFocusVisible=e.originalEvent.detail===0;if(this.actionViewId===e.value&&this.actionMenuOpen){this.actionMenuOpen=false;return}this.actionViewId=e.value;this.actionAnchorId=e.anchorId;this.actionMenuOpen=true}handleActionSelect(e){const s=this.actionViewId;this.actionMenuOpen=false;if(!s)return;if(e.detail.value==="rename")this.openDialog("rename",s);if(e.detail.value==="remove")this.dsViewRemove.emit({viewId:s})}openDialog(e,s=null){const t=e==="rename"?this.views.find((e=>e.id===s)):undefined;if(e==="rename"&&!t)return;this.dialogMode=e;this.dialogViewId=t?.id??null;this.nameDraft=t?.label??"";this.nameError="";this.dialogOpen=true;requestAnimationFrame((()=>{requestAnimationFrame((()=>{const e=this.el.querySelector(`#${this.inputId}`);void e?.setFocus?.()}))}))}validateName(){const e=this.nameDraft.trim();if(!e)return"View name is required.";const s=this.views.some((s=>s.id!==this.dialogViewId&&s.label.trim().toLocaleLowerCase()===e.toLocaleLowerCase()));if(s||this.defaultViewLabel.trim().toLocaleLowerCase()===e.toLocaleLowerCase()){return"A view with this name already exists."}return""}submitDialog(){const e=this.validateName();if(e){this.nameError=e;return}const s=this.nameDraft.trim();if(this.dialogMode==="rename"&&this.dialogView){this.dsViewRename.emit({viewId:this.dialogView.id,name:s})}else{this.dsViewCreate.emit({name:s})}this.dialogOpen=false}finishDialogClose(){if(this.dialogOpen)return;this.dialogViewId=null;this.nameDraft="";this.nameError="";const e=this.el.querySelector(`#${this.selectId}`);void e?.setFocus?.()}render(){return i(a,{key:"660dccb55413ffa14e33e25067d31a1bfccb5b2b"},i("ds-select",{key:"38fb9959ad7369f73bbf90f47d37a6871dbcf874",id:this.selectId,size:"md",width:"fill",placeholder:this.label,"aria-label":this.label,sections:this.sections,value:this.value,triggerLabel:this.selectedCustomView?undefined:this.triggerLabel,triggerLabelPlaceholder:!this.selectedCustomView,dot:this.dirty&&Boolean(this.selectedCustomView),footerActionLabel:this.createLabel,activeFill:false,allowClear:false,onDsChange:e=>this.handleViewChange(e.detail),onDsFooterAction:()=>this.openDialog("create"),onDsOptionSubtextAction:e=>this.handleSubtextAction(e.detail),onDsOptionAction:e=>this.handleOptionAction(e.detail)}),i("ds-menu",{key:"6bade45a5732688bdb21acded0a260627079cc52",id:this.actionMenuId,anchorId:this.actionAnchorId,menuLabel:"Saved view options",side:"bottom",align:"end",menuWidth:"max-content",minWidth:"0",items:this.actionItems,open:this.actionMenuOpen,initialFocusVisible:this.actionMenuInitialFocusVisible,onDsClose:()=>this.actionMenuOpen=false,onDsAfterClose:()=>{if(this.actionMenuOpen)return;this.actionViewId=null;this.actionAnchorId=undefined},onDsSelect:e=>this.handleActionSelect(e)}),i("ds-modal",{key:"c64efde87cc8391c52869d0e96d10e0e307b7c05",open:this.dialogOpen,heading:this.dialogMode==="rename"?"Rename view":"Save as new view",modalWidth:"sm",onDsClose:()=>this.dialogOpen=false,onDsAfterClose:()=>this.finishDialogClose()},i("ds-field",{key:"93ccfe6cb5f099ddce0902d1562121e561e550e4",label:"Name",fieldId:this.fieldId,error:this.nameError.length>0,errorMessage:this.nameError},i("ds-input",{key:"886e6c697be7266f4f2f71168e7b9a8ffea17177",id:this.inputId,size:"md",placeholder:"Enter a unique name",value:this.nameDraft,autoFocus:true,onDsChange:e=>{this.nameDraft=e.detail;if(this.nameError)this.nameError=""},onKeyDown:e=>{if(e.key==="Enter")this.submitDialog()}})),i("div",{key:"e06359cb65025c604d4dacaa385aed61f18ce597",slot:"footer",class:"table-saved-views__dialog-actions"},i("ds-button-filled",{key:"9ff1488729275f47d160cc116ce9a3e4718d8d8f",label:this.dialogMode==="rename"?"Rename":"Save",size:"md",onDsClick:()=>this.submitDialog()}),i("ds-button-unfilled",{key:"151ae0dfe6841850c1a28aff2f3ac9613ea99db2",label:"Cancel",size:"md",onDsClick:()=>this.dialogOpen=false}))))}get el(){return this}static get style(){return E()}},[2,"ds-table-saved-views",{views:[16],value:[1],dirty:[4],defaultViewId:[1,"default-view-id"],defaultViewLabel:[1,"default-view-label"],label:[1],triggerLabel:[1,"trigger-label"],createLabel:[1,"create-label"],actionViewId:[32],actionAnchorId:[32],actionMenuOpen:[32],actionMenuInitialFocusVisible:[32],dialogOpen:[32],dialogMode:[32],dialogViewId:[32],nameDraft:[32],nameError:[32]}]);function x(){if(typeof customElements==="undefined"){return}const e=["ds-table-saved-views","ds-badge","ds-button-filled","ds-button-unfilled","ds-checkbox","ds-empty-state","ds-field","ds-icon","ds-input","ds-loader","ds-menu","ds-modal","ds-select","ds-swatch-picker","ds-switch","ds-tag","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-table-saved-views":if(!customElements.get(n(e))){customElements.define(n(e),V)}break;case"ds-badge":if(!customElements.get(n(e))){d()}break;case"ds-button-filled":if(!customElements.get(n(e))){l()}break;case"ds-button-unfilled":if(!customElements.get(n(e))){o()}break;case"ds-checkbox":if(!customElements.get(n(e))){r()}break;case"ds-empty-state":if(!customElements.get(n(e))){h()}break;case"ds-field":if(!customElements.get(n(e))){c()}break;case"ds-icon":if(!customElements.get(n(e))){m()}break;case"ds-input":if(!customElements.get(n(e))){f()}break;case"ds-loader":if(!customElements.get(n(e))){u()}break;case"ds-menu":if(!customElements.get(n(e))){b()}break;case"ds-modal":if(!customElements.get(n(e))){p()}break;case"ds-select":if(!customElements.get(n(e))){v()}break;case"ds-swatch-picker":if(!customElements.get(n(e))){w()}break;case"ds-switch":if(!customElements.get(n(e))){g()}break;case"ds-tag":if(!customElements.get(n(e))){k()}break;case"ds-text":if(!customElements.get(n(e))){D()}break;case"ds-tooltip":if(!customElements.get(n(e))){y()}break}}))}x();const j=V;const A=x;export{j as DsTableSavedViews,A as defineCustomElement};
2
2
  //# sourceMappingURL=ds-table-saved-views.js.map