@ds-mo/ui 15.11.2 → 15.12.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.
- package/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +120 -19
- package/dist/angular/ds-card-action-center.d.ts +1 -1
- package/dist/angular/ds-card-action-center.js +3 -3
- package/dist/angular/ds-card-chart.d.ts +1 -1
- package/dist/angular/ds-card-chart.js +3 -3
- package/dist/angular/ds-card-navigation.d.ts +1 -1
- package/dist/angular/ds-card-navigation.js +3 -3
- package/dist/angular/ds-card-setting.d.ts +1 -1
- package/dist/angular/ds-card-setting.js +3 -3
- package/dist/angular/ds-card-settings-scope.d.ts +1 -1
- package/dist/angular/ds-card-settings-scope.js +3 -3
- package/dist/angular/ds-field.d.ts +1 -1
- package/dist/angular/ds-field.js +3 -3
- package/dist/angular/ds-inline-banner-settings.d.ts +1 -1
- package/dist/angular/ds-inline-banner-settings.js +3 -3
- package/dist/angular/ds-pagination.d.ts +1 -1
- package/dist/angular/ds-pagination.js +3 -3
- package/dist/angular/ds-radio.d.ts +1 -1
- package/dist/angular/ds-radio.js +3 -3
- package/dist/angular/ds-setting-row-radio.d.ts +1 -1
- package/dist/angular/ds-setting-row-radio.js +3 -3
- package/dist/angular/ds-setting-row-toggle.d.ts +1 -1
- package/dist/angular/ds-setting-row-toggle.js +3 -3
- package/dist/angular/ds-skeleton.d.ts +1 -1
- package/dist/angular/ds-skeleton.js +3 -3
- package/dist/components/ds-agent-activity.js +1 -1
- package/dist/components/ds-agent-questionnaire.js +1 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-agent-response.js.map +1 -1
- package/dist/components/ds-agent-source-list.js +1 -1
- package/dist/components/ds-agent-tool-call.js +1 -1
- package/dist/components/ds-attachment-list.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-bar-action.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-page-title.js +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-breadcrumb.js +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-inverted.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-calendar.js +1 -1
- package/dist/components/ds-card-action-center.js +1 -1
- package/dist/components/ds-card-action-center.js.map +1 -1
- package/dist/components/ds-card-chart.js +1 -1
- package/dist/components/ds-card-chart.js.map +1 -1
- package/dist/components/ds-card-navigation.js +1 -1
- package/dist/components/ds-card-navigation.js.map +1 -1
- package/dist/components/ds-card-overview.js +1 -1
- package/dist/components/ds-card-overview.js.map +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-card-setting.js.map +1 -1
- package/dist/components/ds-card-settings-scope.js +1 -1
- package/dist/components/ds-card-settings-scope.js.map +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart.js +1 -1
- package/dist/components/ds-checkbox-group.js +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-conversation-list-item.js +1 -1
- package/dist/components/ds-conversation-list-section.js +1 -1
- package/dist/components/ds-conversation-list.js +1 -1
- package/dist/components/ds-data-customize.js +1 -1
- package/dist/components/ds-data-customize.js.map +1 -1
- package/dist/components/ds-data-filter.js +1 -1
- package/dist/components/ds-data-group.js +1 -1
- package/dist/components/ds-data-preferences.js +1 -1
- package/dist/components/ds-data-saved-views.js +1 -1
- package/dist/components/ds-data-saved-views.js.map +1 -1
- package/dist/components/ds-data-search.js +1 -1
- package/dist/components/ds-data-sort.js +1 -1
- package/dist/components/ds-data-toolbar.js +1 -1
- package/dist/components/ds-divider.js +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-filter-menu.js +1 -1
- package/dist/components/ds-inline-banner-settings.js +1 -1
- package/dist/components/ds-inline-banner-settings.js.map +1 -1
- package/dist/components/ds-input-date.js +1 -1
- package/dist/components/ds-input-time.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-map-cluster-marker.js +1 -1
- package/dist/components/ds-map-entity-marker.js +1 -1
- package/dist/components/ds-map-marker.js +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-actions.js +1 -1
- package/dist/components/ds-message-bubble.js +1 -1
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-scroller.js +1 -1
- package/dist/components/ds-message.js +1 -1
- package/dist/components/ds-mobile-bar-nav.js +1 -1
- package/dist/components/ds-mobile-header.js +1 -1
- package/dist/components/ds-mobile-section-switcher.js +1 -1
- package/dist/components/ds-mobile-sheet-nav.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-navigation-tab-group.js +1 -1
- package/dist/components/ds-pagination.js +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-sub-nav.js +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-paper-texture.js +1 -1
- package/dist/components/ds-radio-tile.js +1 -1
- package/dist/components/ds-radio.js +1 -1
- package/dist/components/ds-score.js +1 -1
- package/dist/components/ds-scroll-overlay.js +1 -1
- package/dist/components/ds-select-toggle.js +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-setting-row-checkbox.js +1 -1
- package/dist/components/ds-setting-row-radio.js +1 -1
- package/dist/components/ds-setting-row-radio.js.map +1 -1
- package/dist/components/ds-setting-row-toggle.js +1 -1
- package/dist/components/ds-setting-row-toggle.js.map +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-app.js.map +1 -1
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-skeleton.js +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-switch.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-textarea.js +1 -1
- package/dist/components/ds-time-picker.js +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-tooltip-chart.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/p-3Xp9hXbL.js +2 -0
- package/dist/components/{p-BI6L3JoU.js.map → p-3Xp9hXbL.js.map} +1 -1
- package/dist/components/{p-6QYDIPd1.js → p-3dG9v5Aw.js} +2 -2
- package/dist/components/{p-C4kVTIBc.js → p-5PReYMiY.js} +2 -2
- package/dist/components/{p-CzTJAO2J.js → p-8fddX3V3.js} +2 -2
- package/dist/components/{p-Cw1ljgW1.js → p-9u2WDF0J.js} +2 -2
- package/dist/components/{p-M9pOLcyK.js → p-B-ChwMFE.js} +2 -2
- package/dist/components/{p-BvlkO__o.js → p-BAIYOobl.js} +2 -2
- package/dist/components/{p-BrJebF5t.js → p-BIMW5_Z7.js} +2 -2
- package/dist/components/{p-BkKdzYZP.js → p-BMI0F08u.js} +2 -2
- package/dist/components/{p-D0kzIzGQ.js → p-BV8sNEVP.js} +2 -2
- package/dist/components/{p-DNtwJJOC.js → p-BVUdtuog.js} +2 -2
- package/dist/components/{p-CgYDQSLW.js → p-BYo1-6b5.js} +2 -2
- package/dist/components/{p-CJ-igzsZ.js → p-BZbJkJpG.js} +2 -2
- package/dist/components/{p-D2rASHHq.js → p-BcYzHn1E.js} +2 -2
- package/dist/components/{p-0EpjqRWc.js → p-BfRAVR40.js} +2 -2
- package/dist/components/p-BhbniDw4.js +2 -0
- package/dist/components/p-BhbniDw4.js.map +1 -0
- package/dist/components/{p-BBZz2Dvg.js → p-BoWpIl_m.js} +2 -2
- package/dist/components/{p-529k8euH.js → p-BpPHCF63.js} +2 -2
- package/dist/components/{p-DXEInGEq.js → p-By_jYvHp.js} +2 -2
- package/dist/components/p-C5HGwzy9.js +2 -0
- package/dist/components/{p-CXF8wj9I.js.map → p-C5HGwzy9.js.map} +1 -1
- package/dist/components/{p-D4r6oWyQ.js → p-C860ilDn.js} +2 -2
- package/dist/components/{p-DcVK0W4X.js → p-CEHhx4VQ.js} +2 -2
- package/dist/components/p-CGtq7TnC.js +2 -0
- package/dist/components/p-CGtq7TnC.js.map +1 -0
- package/dist/components/p-CL0FpMKo.js +2 -0
- package/dist/components/{p-BjYoM1f8.js.map → p-CL0FpMKo.js.map} +1 -1
- package/dist/components/{p-CEm0AoDR.js → p-CQnjpuMX.js} +2 -2
- package/dist/components/{p-4qKHg502.js → p-CUG4EkKn.js} +2 -2
- package/dist/components/{p-CTstnsLe.js → p-CYmz92EF.js} +2 -2
- package/dist/components/{p-YE1r-XSR.js → p-CbP9ASmI.js} +2 -2
- package/dist/components/{p-C31AjGbg.js → p-CbPGO7vl.js} +2 -2
- package/dist/components/{p-DfphSI9S.js → p-CdMIA5hz.js} +2 -2
- package/dist/components/{p-Ds58qo_J.js → p-CeaIWw1Q.js} +2 -2
- package/dist/components/{p-DxVokKm8.js → p-Cfqvxxs2.js} +2 -2
- package/dist/components/{p-CsPqGA8B.js → p-CpqLGzv4.js} +2 -2
- package/dist/components/p-D538svhW.js +2 -0
- package/dist/components/p-D538svhW.js.map +1 -0
- package/dist/components/{p-DKg181YU.js → p-DFR9hqDU.js} +2 -2
- package/dist/components/{p-DEJLfD7k.js → p-DKZP3jCY.js} +2 -2
- package/dist/components/{p-CTAF7SkL.js → p-DMPn_dt7.js} +2 -2
- package/dist/components/{p-CYRTkP1A.js → p-DYruK9cb.js} +2 -2
- package/dist/components/p-DcvPY30Q.js +2 -0
- package/dist/components/p-DcvPY30Q.js.map +1 -0
- package/dist/components/{p-CqfYCn-e.js → p-DiUaIJ91.js} +2 -2
- package/dist/components/{p-Cqg9T781.js → p-DimFbKZH.js} +2 -2
- package/dist/components/{p-DHmHllUM.js → p-DuhJ49iN.js} +2 -2
- package/dist/components/{p-D_iZPukF.js → p-G6r6yYg8.js} +2 -2
- package/dist/components/{p-87FjWil8.js → p-IQdLCfJJ.js} +2 -2
- package/dist/components/{p-CAARHqjE.js → p-KTaiJztz.js} +2 -2
- package/dist/components/{p-BM-UYlIS.js → p-N-2CZze7.js} +2 -2
- package/dist/components/{p-Ch00yccW.js → p-Nx52go85.js} +2 -2
- package/dist/components/{p-DDawngok.js → p-P2-eHQJU.js} +2 -2
- package/dist/components/{p-CC4X8rpT.js → p-WEffoQQD.js} +2 -2
- package/dist/components/{p-vrRbdZAI.js → p-nakO4viw.js} +2 -2
- package/dist/components/{p-BC9xYdJD.js → p-pkJ3X3s7.js} +2 -2
- package/dist/components/{p-C6VWVB87.js → p-r_e6_0nP.js} +2 -2
- package/dist/docs/components.json +656 -7
- package/dist/lint/index.js +1 -1
- package/dist/mcp-data/registry/card-action-center.json +23 -3
- package/dist/mcp-data/registry/card-chart.json +23 -3
- package/dist/mcp-data/registry/card-navigation.json +23 -3
- package/dist/mcp-data/registry/card-overview.json +2 -2
- package/dist/mcp-data/registry/card-setting.json +23 -3
- package/dist/mcp-data/registry/card-settings-scope.json +22 -2
- package/dist/mcp-data/registry/field.json +22 -2
- package/dist/mcp-data/registry/inline-banner-settings.json +22 -2
- package/dist/mcp-data/registry/pagination.json +22 -2
- package/dist/mcp-data/registry/radio.json +22 -2
- package/dist/mcp-data/registry/registry.json +119 -18
- package/dist/mcp-data/registry/setting-row-radio.json +22 -2
- package/dist/mcp-data/registry/setting-row-toggle.json +23 -3
- package/dist/mcp-data/registry/shell-app.json +3 -2
- package/dist/mcp-data/registry/skeleton.json +120 -9
- package/dist/mcp-data/registry/table.json +7 -6
- package/dist/types/components/CardActionCenter/CardActionCenter.d.ts +2 -0
- package/dist/types/components/CardChart/CardChart.d.ts +2 -0
- package/dist/types/components/CardNavigation/CardNavigation.d.ts +2 -0
- package/dist/types/components/CardSetting/CardSetting.d.ts +2 -0
- package/dist/types/components/CardSettingsScope/CardSettingsScope.d.ts +2 -0
- package/dist/types/components/Field/Field.d.ts +3 -0
- package/dist/types/components/InlineBannerSettings/InlineBannerSettings.d.ts +2 -0
- package/dist/types/components/Pagination/Pagination.d.ts +3 -0
- package/dist/types/components/Radio/Radio.d.ts +2 -0
- package/dist/types/components/SettingRowRadio/SettingRowRadio.d.ts +2 -0
- package/dist/types/components/SettingRowToggle/SettingRowToggle.d.ts +2 -0
- package/dist/types/components/Skeleton/Skeleton.d.ts +24 -1
- package/dist/types/components/Skeleton/index.d.ts +1 -1
- package/dist/types/components/Table/Table.d.ts +1 -1
- package/dist/types/components.d.ts +180 -4
- package/dist/vue/ds-card-action-center.js +1 -0
- package/dist/vue/ds-card-chart.js +1 -0
- package/dist/vue/ds-card-navigation.js +1 -0
- package/dist/vue/ds-card-setting.js +1 -0
- package/dist/vue/ds-card-settings-scope.js +1 -0
- package/dist/vue/ds-field.js +2 -1
- package/dist/vue/ds-inline-banner-settings.js +2 -1
- package/dist/vue/ds-pagination.js +1 -0
- package/dist/vue/ds-radio.js +1 -0
- package/dist/vue/ds-setting-row-radio.js +2 -1
- package/dist/vue/ds-setting-row-toggle.js +1 -0
- package/dist/vue/ds-skeleton.js +5 -0
- package/package.json +1 -1
- package/dist/components/p-BI6L3JoU.js +0 -2
- package/dist/components/p-BjYoM1f8.js +0 -2
- package/dist/components/p-CXF8wj9I.js +0 -2
- package/dist/components/p-Cnzry0_v.js +0 -2
- package/dist/components/p-Cnzry0_v.js.map +0 -1
- package/dist/components/p-DwcAROOo.js +0 -2
- package/dist/components/p-DwcAROOo.js.map +0 -1
- package/dist/components/p-hWKa8Jn8.js +0 -2
- package/dist/components/p-hWKa8Jn8.js.map +0 -1
- package/dist/components/p-xCqqM1Rg.js +0 -2
- package/dist/components/p-xCqqM1Rg.js.map +0 -1
- /package/dist/components/{p-6QYDIPd1.js.map → p-3dG9v5Aw.js.map} +0 -0
- /package/dist/components/{p-C4kVTIBc.js.map → p-5PReYMiY.js.map} +0 -0
- /package/dist/components/{p-CzTJAO2J.js.map → p-8fddX3V3.js.map} +0 -0
- /package/dist/components/{p-Cw1ljgW1.js.map → p-9u2WDF0J.js.map} +0 -0
- /package/dist/components/{p-M9pOLcyK.js.map → p-B-ChwMFE.js.map} +0 -0
- /package/dist/components/{p-BvlkO__o.js.map → p-BAIYOobl.js.map} +0 -0
- /package/dist/components/{p-BrJebF5t.js.map → p-BIMW5_Z7.js.map} +0 -0
- /package/dist/components/{p-BkKdzYZP.js.map → p-BMI0F08u.js.map} +0 -0
- /package/dist/components/{p-D0kzIzGQ.js.map → p-BV8sNEVP.js.map} +0 -0
- /package/dist/components/{p-DNtwJJOC.js.map → p-BVUdtuog.js.map} +0 -0
- /package/dist/components/{p-CgYDQSLW.js.map → p-BYo1-6b5.js.map} +0 -0
- /package/dist/components/{p-CJ-igzsZ.js.map → p-BZbJkJpG.js.map} +0 -0
- /package/dist/components/{p-D2rASHHq.js.map → p-BcYzHn1E.js.map} +0 -0
- /package/dist/components/{p-0EpjqRWc.js.map → p-BfRAVR40.js.map} +0 -0
- /package/dist/components/{p-BBZz2Dvg.js.map → p-BoWpIl_m.js.map} +0 -0
- /package/dist/components/{p-529k8euH.js.map → p-BpPHCF63.js.map} +0 -0
- /package/dist/components/{p-DXEInGEq.js.map → p-By_jYvHp.js.map} +0 -0
- /package/dist/components/{p-D4r6oWyQ.js.map → p-C860ilDn.js.map} +0 -0
- /package/dist/components/{p-DcVK0W4X.js.map → p-CEHhx4VQ.js.map} +0 -0
- /package/dist/components/{p-CEm0AoDR.js.map → p-CQnjpuMX.js.map} +0 -0
- /package/dist/components/{p-4qKHg502.js.map → p-CUG4EkKn.js.map} +0 -0
- /package/dist/components/{p-CTstnsLe.js.map → p-CYmz92EF.js.map} +0 -0
- /package/dist/components/{p-YE1r-XSR.js.map → p-CbP9ASmI.js.map} +0 -0
- /package/dist/components/{p-C31AjGbg.js.map → p-CbPGO7vl.js.map} +0 -0
- /package/dist/components/{p-DfphSI9S.js.map → p-CdMIA5hz.js.map} +0 -0
- /package/dist/components/{p-Ds58qo_J.js.map → p-CeaIWw1Q.js.map} +0 -0
- /package/dist/components/{p-DxVokKm8.js.map → p-Cfqvxxs2.js.map} +0 -0
- /package/dist/components/{p-CsPqGA8B.js.map → p-CpqLGzv4.js.map} +0 -0
- /package/dist/components/{p-DKg181YU.js.map → p-DFR9hqDU.js.map} +0 -0
- /package/dist/components/{p-DEJLfD7k.js.map → p-DKZP3jCY.js.map} +0 -0
- /package/dist/components/{p-CTAF7SkL.js.map → p-DMPn_dt7.js.map} +0 -0
- /package/dist/components/{p-CYRTkP1A.js.map → p-DYruK9cb.js.map} +0 -0
- /package/dist/components/{p-CqfYCn-e.js.map → p-DiUaIJ91.js.map} +0 -0
- /package/dist/components/{p-Cqg9T781.js.map → p-DimFbKZH.js.map} +0 -0
- /package/dist/components/{p-DHmHllUM.js.map → p-DuhJ49iN.js.map} +0 -0
- /package/dist/components/{p-D_iZPukF.js.map → p-G6r6yYg8.js.map} +0 -0
- /package/dist/components/{p-87FjWil8.js.map → p-IQdLCfJJ.js.map} +0 -0
- /package/dist/components/{p-CAARHqjE.js.map → p-KTaiJztz.js.map} +0 -0
- /package/dist/components/{p-BM-UYlIS.js.map → p-N-2CZze7.js.map} +0 -0
- /package/dist/components/{p-Ch00yccW.js.map → p-Nx52go85.js.map} +0 -0
- /package/dist/components/{p-DDawngok.js.map → p-P2-eHQJU.js.map} +0 -0
- /package/dist/components/{p-CC4X8rpT.js.map → p-WEffoQQD.js.map} +0 -0
- /package/dist/components/{p-vrRbdZAI.js.map → p-nakO4viw.js.map} +0 -0
- /package/dist/components/{p-BC9xYdJD.js.map → p-pkJ3X3s7.js.map} +0 -0
- /package/dist/components/{p-C6VWVB87.js.map → p-r_e6_0nP.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as o,d as s}from"./p-
|
|
1
|
+
import{T as o,d as s}from"./p-B-ChwMFE.js";const t=o;const p=s;export{t as DsTag,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-tag.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as o,d as s}from"./p-
|
|
1
|
+
import{T as o,d as s}from"./p-DMPn_dt7.js";const t=o;const n=s;export{t as DsText,n as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-text.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as
|
|
1
|
+
import{T as s,d as o}from"./p-pkJ3X3s7.js";const p=s;const t=o;export{p as DsTextarea,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-textarea.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as o,d as s}from"./p-
|
|
1
|
+
import{T as o,d as s}from"./p-9u2WDF0J.js";const t=o;const p=s;export{t as DsTimePicker,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-time-picker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as s,c as i,h as e,a as o,t as n}from"./index.js";import{c as a,r,d as h}from"./p-BkKdzYZP.js";import{d as c}from"./p-CzTJAO2J.js";import{d}from"./p-CC4X8rpT.js";import{d as l}from"./p-BVsVUnAw.js";import{d as f}from"./p-0XTyQNRG.js";import{d as u}from"./p-CTAF7SkL.js";import{T as m,a as p,r as v}from"./p-mSCnWLhL.js";import{r as g}from"./p-CVYjLzYI.js";function w(t,s){const i=typeof t==="function"?t(s):t;return typeof i==="string"?{description:i}:i}class b{constructor(){this.records=[];this.listeners=new Set;this.nextId=0}add(t){const s=t.id||`ds-toast-${++this.nextId}`;const i=this.records.findIndex((t=>t.id===s));if(!t.title?.trim()&&!t.description?.trim()){console.warn(`[ds-toast] Toast "${s}" should provide a title or description.`)}if(i>=0){const e=this.records[i];const o={...e,...t,id:s,priority:t.priority??e.priority,transitionStatus:"active",closeReason:undefined,updateKey:e.updateKey+1,timerKey:e.timerKey+1};this.records=[o,...this.records.filter(((t,s)=>s!==i))];this.emit();return s}const e={...t,id:s,priority:t.priority??"low",transitionStatus:"starting",updateKey:0,timerKey:0};this.records=[e,...this.records];this.emit();return s}update(t,s){const i=this.records.findIndex((s=>s.id===t));if(i<0)return;const e=this.records[i];const o=Object.prototype.hasOwnProperty.call(s,"timeout")||e.type==="loading"&&s.type!==undefined&&s.type!=="loading";const n={...e,...s,id:t,priority:s.priority??e.priority,updateKey:e.updateKey+1,timerKey:o?e.timerKey+1:e.timerKey};this.records=this.records.map(((t,s)=>s===i?n:t));this.emit()}close(t,s="programmatic"){const i=this.records.findIndex((s=>s.id===t));if(i<0||this.records[i].transitionStatus==="ending")return;const e={...this.records[i],transitionStatus:"ending",closeReason:s};this.records=this.records.map(((t,s)=>s===i?e:t));this.emit();e.onClose?.({id:t,reason:s,toast:e})}closeAll(t="programmatic"){for(const s of[...this.records])this.close(s.id,t)}async promise(t,s){const i=w(s.loading,undefined);const e=this.add({...i,type:i.type??"loading",timeout:0});try{const i=await t;const o=w(s.success,i);this.update(e,{...o,type:o.type??"success",timeout:o.timeout});return i}catch(t){const i=w(s.error,t);this.update(e,{...i,type:i.type??"error",timeout:i.timeout});throw t}}subscribe(t){this.listeners.add(t);t(this.getSnapshot());return()=>{this.listeners.delete(t)}}getSnapshot(){return this.records.map((t=>({...t})))}activate(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="starting")return;this.records=this.records.map((s=>s.id===t?{...s,transitionStatus:"active"}:s));this.emit()}remove(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="ending")return null;const i=s.closeReason??"programmatic";this.records=this.records.filter((s=>s.id!==t));this.emit();const e={id:t,reason:i,toast:s};return e}notifyRemove(t){const{toast:s}=t;s.onRemove?.(t)}emit(){const t=this.getSnapshot();for(const s of this.listeners)s(t)}}function y(){return new b}const x=Symbol.for("@ds-mo/ui/default-toast-manager");const T=globalThis;const M=T[x];const k=M??y();if(!M)T[x]=k;const A=()=>`.ds-visually-hidden.sc-ds-toast-h,.ds-visually-hidden.sc-ds-toast{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}@media (forced-colors: active){.sc-ds-toast:root,.sc-ds-toast-h,.ds-forced-colors-scope.sc-ds-toast{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-toast-h,.sc-ds-toast:where(.ds-table),.sc-ds-toast:where(.tooltip-popup),.sc-ds-toast:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.sc-ds-toast-h{display:contents}.toast-region.sc-ds-toast{position:fixed;inset:0;z-index:var(--dimension-z-index-floating);pointer-events:none;outline:none}.toast-viewport.sc-ds-toast{position:absolute;right:var(--dimension-space-200);bottom:var(--dimension-space-200);display:grid;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)))}@media (width < 768px){[avoid-mobile-shell-bar].sc-ds-toast-h .toast-viewport.sc-ds-toast{bottom:calc( var(--dimension-space-200) + var(--dimension-space-100) + var(--dimension-size-400) + max(var(--dimension-space-100), env(safe-area-inset-bottom)) )}}.toast-positioner.sc-ds-toast{grid-area:1 / 1;align-self:end;justify-self:center;width:100%;pointer-events:auto;transform:translateY(calc(-1 * var(--toast-index) * var(--dimension-space-100)));transition:transform var(--effect-motion-short-3), width var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner.sc-ds-toast{width:calc(100% - 2 * var(--toast-index) * var(--dimension-space-100))}.toast-viewport[data-expanded].sc-ds-toast .toast-positioner.sc-ds-toast{transform:translateY(calc(-1 * var(--toast-offset-y)))}.toast-positioner[data-limited].sc-ds-toast{visibility:hidden;pointer-events:none}.toast-positioner--anchored.sc-ds-toast{position:fixed;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)));transform:none}.toast-positioner--anchored[data-positioned='false'].sc-ds-toast{visibility:hidden}.toast-surface.sc-ds-toast{position:relative;display:block;box-sizing:border-box;width:100%;height:var(--toast-height, auto);padding:var(--dimension-space-200);overflow:hidden;color:var(--color-foreground-primary);background-color:var(--color-background-primary);border-radius:var(--ds-radius-modal);box-shadow:var(--effect-elevation-elevated-floating);transform:translate(var(--toast-swipe-movement-x), var(--toast-swipe-movement-y));animation:toast-enter var(--effect-motion-short-2) both}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{animation:toast-exit var(--effect-motion-short-3) both}.toast-surface--swiping.sc-ds-toast{transition:none;user-select:none}.toast-content.sc-ds-toast{display:flex;flex-direction:column;min-width:0;padding-inline-end:var(--dimension-size-500);transition:opacity var(--effect-motion-short-3)}.toast-copy.sc-ds-toast{display:flex;flex-direction:column;min-width:0;min-height:var(--typography-lineheight-md);margin-block:calc(-1 * var(--dimension-space-025));gap:var(--dimension-space-050)}.toast-title.sc-ds-toast,.toast-description.sc-ds-toast{min-width:0}.toast-action.sc-ds-toast{align-self:start;margin-top:calc(var(--dimension-space-200) + var(--dimension-space-025))}.toast-close.sc-ds-toast{position:absolute;top:var(--dimension-space-100);right:var(--dimension-space-100);transition:opacity var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-content.sc-ds-toast,.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-close.sc-ds-toast{opacity:0}@keyframes toast-enter{from{opacity:0;transform:translateY(var(--dimension-space-100))}to{opacity:1;transform:translateY(0)}}@keyframes toast-exit{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.toast-positioner.sc-ds-toast,.toast-surface.sc-ds-toast,.toast-content.sc-ds-toast,.toast-close.sc-ds-toast,.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{transition:none;animation:none}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{opacity:0}}@media (forced-colors: active){.toast-surface.sc-ds-toast{box-shadow:none;outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}}`;const C=40;const S=10;const P="__global-stack__";const E='button,a,input,textarea,select,[role="button"],[data-ds-toast-swipe-ignore]';const F=new WeakMap;const z=new Set;let L=null;let R=0;const j=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.dsToastClose=i(this,"dsToastClose",7);this.dsToastRemove=i(this,"dsToastRemove",7);this.dsToastAction=i(this,"dsToastAction",7);this.manager=k;this.limit=3;this.timeout=m.animationDelayLong2;this.label="Notifications";this.closeLabel="Close notification";this.avoidMobileShellBar=false;this.swipeDirections=["down","right"];this.records=[];this.expanded=false;this.keyboardActive=false;this.swipe=null;this.layoutVersion=0;this.instanceId=++R;this.domIds=new Map;this.timers=new Map;this.closeWatchdogs=new Map;this.closeFrames=new Map;this.closeEvents=new Set;this.activationFrames=new Map;this.pauseReasons=new Set;this.hoveredIds=new Set;this.heights=new Map;this.measuredUpdateKeys=new Map;this.anchoredPositions=new Map;this.dismissedSwipeDirections=new Map;this.observedElements=new Set;this.pendingRemovals=[];this.unsubscribe=null;this.attachedManager=null;this.previousFocus=null;this.resizeObserver=null;this.mutationObserver=null;this.layoutFrame=null;this.activeSwipe=null;this.nextDomId=0;this.connected=false;this.pendingHoverLeave=false;this.handleWindowBlur=()=>this.pauseTimers("window");this.handleWindowFocus=()=>this.resumeTimers("window");this.handleVisibilityChange=()=>{if(document.hidden)this.pauseTimers("document");else this.resumeTimers("document")};this.handleFocusIn=()=>{const t=document.activeElement;if(!(t instanceof s)||!t.matches(":focus-visible"))return;L=this;this.keyboardActive=true;this.expanded=true;this.pauseTimers("focus")};this.handleFocusOut=t=>{const s=t.relatedTarget;if(s instanceof Node&&this.el.contains(s))return;if(!this.keyboardActive)return;this.keyboardActive=false;this.expanded=this.hoveredIds.size>0;this.resumeTimers("focus")};this.handleDocumentKeyDown=t=>{if(t.key!=="F6")return;const s=Array.from(z).filter((t=>t.activeRecords.length>0));const i=L&&L.activeRecords.length?L:s[s.length-1];if(i!==this)return;t.preventDefault();if(!this.el.contains(document.activeElement)){this.previousFocus=document.activeElement}this.keyboardActive=true;this.regionElement?.focus()};this.handleRegionKeyDown=t=>{if(t.key==="Escape"){const s=t.target;const i=s.closest(".toast-positioner");const e=i?.dataset["toastId"]??this.activeRecords[0]?.id;if(e){t.preventDefault();this.manager.close(e,"escape")}return}if(t.key==="Tab"&&t.shiftKey&&t.target===this.regionElement){t.preventDefault();this.restorePreviousFocus()}};this.handleWindowResize=()=>{this.heights.clear();this.measuredUpdateKeys.clear();this.layoutVersion+=1;this.scheduleLayout()};this.scheduleLayout=()=>{if(this.layoutFrame!==null)return;this.layoutFrame=requestAnimationFrame((()=>{this.layoutFrame=null;this.measureLayout()}))}}connectedCallback(){this.connect()}componentDidLoad(){this.connect()}connect(){if(this.connected)return;this.connected=true;this.resizeObserver??(this.resizeObserver=new ResizeObserver((()=>this.scheduleLayout())));this.mutationObserver??(this.mutationObserver=new MutationObserver((()=>this.scheduleLayout())));this.mutationObserver.observe(document.body,{childList:true,subtree:true});if(!this.unsubscribe)this.attachManager(this.manager);window.addEventListener("blur",this.handleWindowBlur);window.addEventListener("focus",this.handleWindowFocus);window.addEventListener("resize",this.handleWindowResize);window.addEventListener("scroll",this.scheduleLayout,true);document.addEventListener("keydown",this.handleDocumentKeyDown);document.addEventListener("visibilitychange",this.handleVisibilityChange);z.add(this);if(!L)L=this}componentDidRender(){this.syncObservedElements();this.flushPendingRemovals();this.scheduleLayout()}disconnectedCallback(){this.connected=false;this.flushPendingRemovals();this.detachManager();this.resetManagerState();this.resizeObserver?.disconnect();this.resizeObserver=null;this.mutationObserver?.disconnect();this.mutationObserver=null;this.observedElements.clear();if(this.layoutFrame!==null)cancelAnimationFrame(this.layoutFrame);this.layoutFrame=null;window.removeEventListener("blur",this.handleWindowBlur);window.removeEventListener("focus",this.handleWindowFocus);window.removeEventListener("resize",this.handleWindowResize);window.removeEventListener("scroll",this.scheduleLayout,true);document.removeEventListener("keydown",this.handleDocumentKeyDown);document.removeEventListener("visibilitychange",this.handleVisibilityChange);z.delete(this);if(L===this){const t=Array.from(z);L=t[t.length-1]??null}}onManagerChange(t){this.detachManager();this.resetManagerState();if(this.connected)this.attachManager(t)}onTimeoutChange(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}this.timers.clear();this.syncTimers()}attachManager(t){const s=F.get(t);if(s&&s!==this){console.warn("[ds-toast] A manager can control only one connected ds-toast instance.");return}F.set(t,this);this.attachedManager=t;this.unsubscribe=t.subscribe((t=>{this.records=t;this.syncLifecycle(t);this.scheduleLayout()}))}detachManager(){this.unsubscribe?.();this.unsubscribe=null;if(this.attachedManager&&F.get(this.attachedManager)===this){F.delete(this.attachedManager)}this.attachedManager=null}resetManagerState(){this.flushPendingRemovals();if(this.el.contains(document.activeElement))this.restorePreviousFocus();this.clearAllTimers();for(const t of this.activationFrames.values())cancelAnimationFrame(t);for(const t of this.closeFrames.values())cancelAnimationFrame(t);this.activationFrames.clear();this.closeFrames.clear();this.closeEvents.clear();this.pauseReasons.clear();this.hoveredIds.clear();this.pendingHoverLeave=false;this.heights.clear();this.measuredUpdateKeys.clear();this.anchoredPositions.clear();this.dismissedSwipeDirections.clear();this.domIds.clear();this.activeSwipe=null;this.swipe=null;this.expanded=false;this.keyboardActive=false;this.records=[];this.resizeObserver?.disconnect();this.observedElements.clear()}syncObservedElements(){const t=new Set(this.el.querySelectorAll(".toast-positioner"));for(const s of this.records){if(!s.positioner)continue;const i=this.resolveAnchor(s.positioner.anchor);if(i)t.add(i)}for(const s of this.observedElements){if(!t.has(s)){this.resizeObserver?.unobserve(s);this.observedElements.delete(s)}}for(const s of t){if(this.observedElements.has(s))continue;this.resizeObserver?.observe(s);this.observedElements.add(s)}}flushPendingRemovals(){for(const t of this.pendingRemovals.splice(0)){t.manager.notifyRemove(t.context);this.dsToastRemove.emit({id:t.context.id,toast:t.context.toast})}}syncLifecycle(t){const s=new Set(t.map((t=>t.id)));for(const t of this.hoveredIds){if(t!==P&&!s.has(t))this.hoveredIds.delete(t)}const i=t.some((t=>t.transitionStatus==="ending"));if(this.pendingHoverLeave&&!i&&!this.hoveredIds.size){this.pendingHoverLeave=false;this.expanded=false;this.resumeTimers("hover")}else if(!this.hoveredIds.size&&!this.pendingHoverLeave){this.resumeTimers("hover")}for(const[t,i]of this.timers){if(s.has(t))continue;if(i.handle)clearTimeout(i.handle);this.timers.delete(t)}for(const[t,i]of this.closeWatchdogs){if(s.has(t))continue;clearTimeout(i);this.closeWatchdogs.delete(t)}for(const[t,i]of this.activationFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.activationFrames.delete(t)}for(const[t,i]of this.closeFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.closeFrames.delete(t)}for(const t of this.domIds.keys()){if(s.has(t))continue;this.closeEvents.delete(t);this.domIds.delete(t);this.heights.delete(t);this.measuredUpdateKeys.delete(t);this.anchoredPositions.delete(t);this.dismissedSwipeDirections.delete(t)}for(const s of t){this.ensureDomId(s.id);if(s.transitionStatus==="starting"&&!this.activationFrames.has(s.id)){const t=this.attachedManager;const i=requestAnimationFrame((()=>{this.activationFrames.delete(s.id);t?.activate(s.id)}));this.activationFrames.set(s.id,i)}if(s.transitionStatus==="ending"){this.clearToastTimer(s.id);this.beginRemoval(s)}else{const t=this.closeWatchdogs.get(s.id);if(t)clearTimeout(t);this.closeWatchdogs.delete(s.id);const i=this.closeFrames.get(s.id);if(i)cancelAnimationFrame(i);this.closeFrames.delete(s.id);this.closeEvents.delete(s.id)}}this.syncTimers()}syncTimers(){const t=new Set;for(const s of this.records){if(s.transitionStatus!=="active")continue;t.add(s.id);const i=this.resolveToastTimeout(s);if(i<=0){this.clearToastTimer(s.id);continue}const e=this.timers.get(s.id);if(!e||e.timerKey!==s.timerKey){this.clearToastTimer(s.id);this.timers.set(s.id,{timerKey:s.timerKey,remaining:i,startedAt:0,handle:null})}if(!this.isPaused)this.startToastTimer(s.id)}for(const s of this.timers.keys()){if(!t.has(s))this.clearToastTimer(s)}}resolveToastTimeout(t){const s=t.timeout??this.timeout;if(typeof s==="number")return Math.max(0,s);return p(s,m.animationDelayLong2)}startToastTimer(t){const s=this.timers.get(t);if(!s||s.handle||s.remaining<=0)return;s.startedAt=Date.now();s.handle=setTimeout((()=>{s.handle=null;s.remaining=0;this.manager.close(t,"timeout")}),s.remaining)}pauseTimers(t){const s=this.isPaused;this.pauseReasons.add(t);if(s)return;const i=Date.now();for(const t of this.timers.values()){if(!t.handle)continue;clearTimeout(t.handle);t.handle=null;t.remaining=Math.max(0,t.remaining-(i-t.startedAt))}}resumeTimers(t){this.pauseReasons.delete(t);if(this.isPaused)return;for(const t of this.timers.keys())this.startToastTimer(t)}get isPaused(){return this.pauseReasons.size>0}clearToastTimer(t){const s=this.timers.get(t);if(s?.handle)clearTimeout(s.handle);this.timers.delete(t)}clearAllTimers(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}for(const t of this.closeWatchdogs.values())clearTimeout(t);this.timers.clear();this.closeWatchdogs.clear()}beginRemoval(t){if(!this.closeEvents.has(t.id)){this.closeEvents.add(t.id);this.dsToastClose.emit({id:t.id,reason:t.closeReason??"programmatic",toast:t});this.moveFocusAfterClose(t.id)}if(this.closeWatchdogs.has(t.id)||this.closeFrames.has(t.id))return;const s=v(m.motionShort3,m.animationDurationShort3);if(s<=0){queueMicrotask((()=>this.completeRemoval(t)));return}const i=requestAnimationFrame((()=>{this.closeFrames.delete(t.id);const i=this.records.find((s=>s.id===t.id));if(!i||i.transitionStatus!=="ending")return;this.closeWatchdogs.set(t.id,setTimeout((()=>this.completeRemoval(i)),s))}));this.closeFrames.set(t.id,i)}completeRemoval(t){const s=this.records.find((s=>s.id===t.id));if(!s||s.transitionStatus!=="ending")return;const i=this.closeWatchdogs.get(t.id);if(i)clearTimeout(i);this.closeWatchdogs.delete(t.id);const e=this.closeFrames.get(t.id);if(e)cancelAnimationFrame(e);this.closeFrames.delete(t.id);const o=this.attachedManager;const n=o?.remove(t.id);if(o&&n)this.pendingRemovals.push({manager:o,context:n})}handleAnimationComplete(t){if(t.transitionStatus==="ending")this.completeRemoval(t)}bindAnimationCancel(t,s){if(!t||t.dataset["cancelBound"]==="true")return;t.dataset["cancelBound"]="true";t.addEventListener("animationcancel",(()=>{const t=this.records.find((t=>t.id===s));if(t)this.handleAnimationComplete(t)}))}handlePointerEnter(t){L=this;this.pendingHoverLeave=false;this.hoveredIds.add(t);this.expanded=true;this.pauseTimers("hover")}handlePointerLeave(t){this.hoveredIds.delete(t);if(this.hoveredIds.size)return;if(this.records.some((t=>t.transitionStatus==="ending"))){this.pendingHoverLeave=true;return}this.expanded=false;this.resumeTimers("hover")}get regionElement(){return this.el.querySelector(".toast-region")}restorePreviousFocus(){this.previousFocus?.focus?.();this.previousFocus=null;this.keyboardActive=false}moveFocusAfterClose(t){const s=document.activeElement;const i=this.positionerElement(t);if(!s||!i?.contains(s))return;requestAnimationFrame((()=>{const s=this.activeRecords.find((s=>s.id!==t));const i=s?this.positionerElement(s.id)?.querySelector("ds-button-unfilled"):null;if(i?.setFocus)void i.setFocus();else if(s)this.regionElement?.focus();else this.restorePreviousFocus()}))}handleAction(t,s){const i={id:t.id,toast:t,originalEvent:s.detail};this.dsToastAction.emit(i);t.action?.onAction?.({id:t.id,data:t.data,manager:this.manager,originalEvent:s.detail})}handlePointerDown(t,s){if(s.button!==0)return;const i=s.target;if(i.closest(E))return;const e=s.currentTarget;e.setPointerCapture(s.pointerId);this.activeSwipe={id:t.id,pointerId:s.pointerId,pointerType:s.pointerType,startX:s.clientX,startY:s.clientY,maxDistance:0,cancelled:false,axis:null};this.swipe={id:t.id,x:0,y:0};if(s.pointerType==="touch")this.pauseTimers("swipe")}handlePointerMove(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId||s.cancelled)return;const i=t.clientX-s.startX;const e=t.clientY-s.startY;if(!s.axis&&Math.max(Math.abs(i),Math.abs(e))>1){s.axis=Math.abs(i)>=Math.abs(e)?"x":"y"}if(!s.axis)return;const o=s.axis==="x";const n=o?i>=0?"right":"left":e>=0?"down":"up";const a=this.swipeDirections.includes(n);const r=o?Math.abs(i):Math.abs(e);const h=a?r:Math.sqrt(r);const c=(o?i:e)<0?-h:h;const d=o?c:0;const l=o?0:c;if(s.maxDistance-h>=S){s.cancelled=true;this.cancelSwipe();return}s.maxDistance=Math.max(s.maxDistance,h);if(r>1)t.preventDefault();this.swipe={id:s.id,x:d,y:l,direction:a?n:undefined}}handlePointerUp(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId)return;const i=this.swipe;const e=i?Math.max(Math.abs(i.x),Math.abs(i.y)):0;const o=!s.cancelled&&!!i?.direction&&e>=C;const n=s.id;const a=s.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(a)this.resumeTimers("swipe");if(o&&i.direction){this.dismissedSwipeDirections.set(n,i.direction);this.manager.close(n,"swipe")}}handlePointerCancel(t){if(this.activeSwipe?.pointerId!==t.pointerId)return;this.cancelSwipe()}cancelSwipe(){const t=this.activeSwipe?.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(t)this.resumeTimers("swipe")}get touchAction(){const t=this.swipeDirections.includes("left")||this.swipeDirections.includes("right");const s=this.swipeDirections.includes("up")||this.swipeDirections.includes("down");if(t&&s)return"none";if(t)return"pan-y";if(s)return"pan-x";return"auto"}measureNaturalHeight(t,s){const i=t.querySelector(".toast-surface");if(!i)return 0;const e=t.style.width;const o=t.style.transition;const n=i.style.height;if(s){t.style.transition="none";t.style.width="100%"}i.style.height="auto";const a=i.getBoundingClientRect().height;i.style.height=n;if(s){t.style.width=e;t.getBoundingClientRect();t.style.transition=o}return a}measureLayout(){let t=false;for(const s of this.records){const i=this.positionerElement(s.id);if(!i)continue;let e=this.heights.get(s.id)??0;const o=e<=0||this.measuredUpdateKeys.get(s.id)!==s.updateKey;if(o){e=this.measureNaturalHeight(i,!s.positioner);if(e>0){if(this.heights.get(s.id)!==e)t=true;this.heights.set(s.id,e);this.measuredUpdateKeys.set(s.id,s.updateKey)}}if(!s.positioner)continue;const n=this.resolveAnchor(s.positioner.anchor);if(!n||e<=0){if(this.anchoredPositions.delete(s.id))t=true;continue}const h=i.getBoundingClientRect();const c=g(s.positioner.sideOffset,m.space050);const d=g(s.positioner.alignOffset,0);const l=a({anchorRect:n.getBoundingClientRect(),popupWidth:h.width,popupHeight:e,side:s.positioner.side??"top",align:s.positioner.align??"center",sideOffsetPx:c,alignOffsetPx:d,viewportPadPx:g(undefined,m.space200),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(n)});const f=this.anchoredPositions.get(s.id);if(!f||f.x!==l.x||f.y!==l.y||f.side!==l.resolvedSide){this.anchoredPositions.set(s.id,{x:l.x,y:l.y,side:l.resolvedSide});t=true}}if(t)this.layoutVersion+=1}resolveAnchor(t){return typeof t==="string"?document.getElementById(t):t}positionerElement(t){return Array.from(this.el.querySelectorAll(".toast-positioner")).find((s=>s.dataset["toastId"]===t))??null}ensureDomId(t){const s=this.domIds.get(t);if(s)return s;const i=++this.nextDomId;this.domIds.set(t,i);return i}get activeRecords(){return this.records.filter((t=>t.transitionStatus!=="ending"))}globalLayout(){const t=this.records.filter((t=>!t.positioner));let s=0;let i=0;const e=g(undefined,m.space200);const o=new Map;t.forEach(((t,n)=>{if(t.transitionStatus==="ending"){o.set(t.id,{index:n,offset:s,limited:false});return}const a=i>=Math.max(1,this.limit);o.set(t.id,{index:i,offset:s,limited:a});s+=(this.heights.get(t.id)??0)+e;i+=1}));return o}renderToast(t,s){const i=this.ensureDomId(t.id);const o=`ds-toast-${this.instanceId}-${i}-title`;const n=`ds-toast-${this.instanceId}-${i}-description`;const a=this.swipe?.id===t.id?this.swipe:null;const r=a?.direction??this.dismissedSwipeDirections.get(t.id);const h=!!t.positioner;const c=this.anchoredPositions.get(t.id);const d=t.priority==="high"&&!this.keyboardActive;const l=this.keyboardActive&&!s.limited?0:-1;const f=this.heights.get(t.id);return e("div",{ref:s=>this.bindAnimationCancel(s,t.id),class:{"toast-positioner":true,"toast-positioner--anchored":h,"toast-positioner--ending":t.transitionStatus==="ending"},"data-toast-id":t.id,"data-behind":!h&&s.index>0?"":undefined,"data-limited":s.limited?"":undefined,"data-positioned":h?String(!!c):undefined,"data-side":c?.side,inert:s.limited?true:undefined,"aria-hidden":s.limited?"true":undefined,style:{"--toast-index":String(s.index),"--toast-offset-y":`${s.offset}px`,"--toast-height":f?`${f}px`:undefined,zIndex:String(this.records.length-s.index),left:c?`${c.x}px`:undefined,top:c?`${c.y}px`:undefined},onAnimationEnd:()=>this.handleAnimationComplete(t)},e("div",{class:{"toast-surface":true,"toast-surface--swiping":!!a},role:t.priority==="high"?"alertdialog":"dialog","aria-modal":"false","aria-labelledby":t.title?o:t.description?n:undefined,"aria-describedby":t.title&&t.description?n:undefined,"aria-hidden":d?"true":undefined,"data-type":t.type,"data-priority":t.priority,"data-transition-status":t.transitionStatus,"data-swiping":a?"":undefined,"data-swipe-direction":r,style:{"--toast-swipe-movement-x":`${a?.x??0}px`,"--toast-swipe-movement-y":`${a?.y??0}px`,touchAction:this.touchAction},onPointerDown:s=>this.handlePointerDown(t,s),onPointerMove:t=>this.handlePointerMove(t),onPointerUp:t=>this.handlePointerUp(t),onPointerCancel:t=>this.handlePointerCancel(t),onPointerEnter:h?()=>this.handlePointerEnter(t.id):undefined,onPointerLeave:h?()=>this.handlePointerLeave(t.id):undefined},e("div",{class:"toast-content"},e("div",{class:"toast-copy"},t.title&&e("ds-text",{class:"toast-title",as:"div",variant:"text-title-small",color:"primary",textId:o},t.title),t.description&&e("ds-text",{class:"toast-description",as:"div",variant:"text-body-medium",color:"secondary",textId:n},t.description)),t.action&&e("ds-button-unfilled",{class:"toast-action",variant:"label",size:"md",type:"button",label:t.action.label,"aria-label":t.action.ariaLabel,hasBorder:true,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:s=>this.handleAction(t,s)})),e("ds-button-unfilled",{class:"toast-close",variant:"icon",size:"md",type:"button",icon:"Cross","aria-label":this.closeLabel,hasBorder:false,activeFill:false,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:()=>this.manager.close(t.id,"close-button")})))}render(){const t=this.globalLayout();const s=this.records.filter((t=>!t.positioner));const i=this.records.filter((t=>!!t.positioner));const n=this.records.filter((s=>s.priority==="high"&&s.transitionStatus!=="ending"&&!t.get(s.id)?.limited));return e(o,{key:"161fda4c02b168f0a94f3f0d57399c45e60baa3e"},e("section",{key:"c4f8088f07db4f681d92899d2f99826b7d11f643",class:"toast-region",role:"region","aria-label":this.label,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",tabIndex:-1,onFocusin:this.handleFocusIn,onFocusout:t=>this.handleFocusOut(t),onKeyDown:t=>this.handleRegionKeyDown(t)},e("div",{key:"4f406c5ac501175d377549764f252b168a11d807",class:"toast-viewport","data-expanded":this.expanded?"":undefined,onPointerEnter:()=>this.handlePointerEnter(P),onPointerLeave:()=>this.handlePointerLeave(P)},s.map((s=>this.renderToast(s,t.get(s.id)??{index:0,offset:0,limited:false})))),e("div",{key:"9c802a80a5cb20b2b6ed06865c685d99eadc803a",class:"toast-anchored-layer"},i.map((t=>this.renderToast(t,{index:0,offset:0,limited:false})))),e("div",{key:"2a85a109257e382849b7082b375dec350a642a78",class:"toast-assertive-announcer ds-visually-hidden"},n.map((t=>e("div",{role:"alert","aria-atomic":"true"},[t.title,t.description].filter(Boolean).join(". ")))))))}get el(){return this}static get watchers(){return{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}}static get style(){return A()}},[2,"ds-toast",{manager:[16],limit:[2],timeout:[8],label:[1],closeLabel:[1,"close-label"],avoidMobileShellBar:[516,"avoid-mobile-shell-bar"],swipeDirections:[16],records:[32],expanded:[32],keyboardActive:[32],swipe:[32],layoutVersion:[32]},undefined,{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}]);function D(){if(typeof customElements==="undefined"){return}const t=["ds-toast","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-toast":if(!customElements.get(n(t))){customElements.define(n(t),j)}break;case"ds-badge":if(!customElements.get(n(t))){c()}break;case"ds-button-unfilled":if(!customElements.get(n(t))){d()}break;case"ds-icon":if(!customElements.get(n(t))){l()}break;case"ds-loader":if(!customElements.get(n(t))){f()}break;case"ds-text":if(!customElements.get(n(t))){u()}break;case"ds-tooltip":if(!customElements.get(n(t))){h()}break}}))}D();const $=j;const I=D;export{$ as DsToast,I as defineCustomElement};
|
|
1
|
+
import{p as t,H as s,c as i,h as e,a as o,t as n}from"./index.js";import{c as a,r,d as h}from"./p-BMI0F08u.js";import{d as c}from"./p-8fddX3V3.js";import{d}from"./p-WEffoQQD.js";import{d as l}from"./p-BVsVUnAw.js";import{d as f}from"./p-0XTyQNRG.js";import{d as u}from"./p-DMPn_dt7.js";import{T as m,a as p,r as v}from"./p-mSCnWLhL.js";import{r as g}from"./p-CVYjLzYI.js";function w(t,s){const i=typeof t==="function"?t(s):t;return typeof i==="string"?{description:i}:i}class b{constructor(){this.records=[];this.listeners=new Set;this.nextId=0}add(t){const s=t.id||`ds-toast-${++this.nextId}`;const i=this.records.findIndex((t=>t.id===s));if(!t.title?.trim()&&!t.description?.trim()){console.warn(`[ds-toast] Toast "${s}" should provide a title or description.`)}if(i>=0){const e=this.records[i];const o={...e,...t,id:s,priority:t.priority??e.priority,transitionStatus:"active",closeReason:undefined,updateKey:e.updateKey+1,timerKey:e.timerKey+1};this.records=[o,...this.records.filter(((t,s)=>s!==i))];this.emit();return s}const e={...t,id:s,priority:t.priority??"low",transitionStatus:"starting",updateKey:0,timerKey:0};this.records=[e,...this.records];this.emit();return s}update(t,s){const i=this.records.findIndex((s=>s.id===t));if(i<0)return;const e=this.records[i];const o=Object.prototype.hasOwnProperty.call(s,"timeout")||e.type==="loading"&&s.type!==undefined&&s.type!=="loading";const n={...e,...s,id:t,priority:s.priority??e.priority,updateKey:e.updateKey+1,timerKey:o?e.timerKey+1:e.timerKey};this.records=this.records.map(((t,s)=>s===i?n:t));this.emit()}close(t,s="programmatic"){const i=this.records.findIndex((s=>s.id===t));if(i<0||this.records[i].transitionStatus==="ending")return;const e={...this.records[i],transitionStatus:"ending",closeReason:s};this.records=this.records.map(((t,s)=>s===i?e:t));this.emit();e.onClose?.({id:t,reason:s,toast:e})}closeAll(t="programmatic"){for(const s of[...this.records])this.close(s.id,t)}async promise(t,s){const i=w(s.loading,undefined);const e=this.add({...i,type:i.type??"loading",timeout:0});try{const i=await t;const o=w(s.success,i);this.update(e,{...o,type:o.type??"success",timeout:o.timeout});return i}catch(t){const i=w(s.error,t);this.update(e,{...i,type:i.type??"error",timeout:i.timeout});throw t}}subscribe(t){this.listeners.add(t);t(this.getSnapshot());return()=>{this.listeners.delete(t)}}getSnapshot(){return this.records.map((t=>({...t})))}activate(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="starting")return;this.records=this.records.map((s=>s.id===t?{...s,transitionStatus:"active"}:s));this.emit()}remove(t){const s=this.records.find((s=>s.id===t));if(!s||s.transitionStatus!=="ending")return null;const i=s.closeReason??"programmatic";this.records=this.records.filter((s=>s.id!==t));this.emit();const e={id:t,reason:i,toast:s};return e}notifyRemove(t){const{toast:s}=t;s.onRemove?.(t)}emit(){const t=this.getSnapshot();for(const s of this.listeners)s(t)}}function y(){return new b}const x=Symbol.for("@ds-mo/ui/default-toast-manager");const T=globalThis;const M=T[x];const k=M??y();if(!M)T[x]=k;const A=()=>`.ds-visually-hidden.sc-ds-toast-h,.ds-visually-hidden.sc-ds-toast{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}@media (forced-colors: active){.sc-ds-toast:root,.sc-ds-toast-h,.ds-forced-colors-scope.sc-ds-toast{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-toast-h,.sc-ds-toast:where(.ds-table),.sc-ds-toast:where(.tooltip-popup),.sc-ds-toast:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.sc-ds-toast-h{display:contents}.toast-region.sc-ds-toast{position:fixed;inset:0;z-index:var(--dimension-z-index-floating);pointer-events:none;outline:none}.toast-viewport.sc-ds-toast{position:absolute;right:var(--dimension-space-200);bottom:var(--dimension-space-200);display:grid;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)))}@media (width < 768px){[avoid-mobile-shell-bar].sc-ds-toast-h .toast-viewport.sc-ds-toast{bottom:calc( var(--dimension-space-200) + var(--dimension-space-100) + var(--dimension-size-400) + max(var(--dimension-space-100), env(safe-area-inset-bottom)) )}}.toast-positioner.sc-ds-toast{grid-area:1 / 1;align-self:end;justify-self:center;width:100%;pointer-events:auto;transform:translateY(calc(-1 * var(--toast-index) * var(--dimension-space-100)));transition:transform var(--effect-motion-short-3), width var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner.sc-ds-toast{width:calc(100% - 2 * var(--toast-index) * var(--dimension-space-100))}.toast-viewport[data-expanded].sc-ds-toast .toast-positioner.sc-ds-toast{transform:translateY(calc(-1 * var(--toast-offset-y)))}.toast-positioner[data-limited].sc-ds-toast{visibility:hidden;pointer-events:none}.toast-positioner--anchored.sc-ds-toast{position:fixed;width:min(var(--dimension-card-width-sm), calc(100vw - 2 * var(--dimension-space-200)));transform:none}.toast-positioner--anchored[data-positioned='false'].sc-ds-toast{visibility:hidden}.toast-surface.sc-ds-toast{position:relative;display:block;box-sizing:border-box;width:100%;height:var(--toast-height, auto);padding:var(--dimension-space-200);overflow:hidden;color:var(--color-foreground-primary);background-color:var(--color-background-primary);border-radius:var(--ds-radius-modal);box-shadow:var(--effect-elevation-elevated-floating);transform:translate(var(--toast-swipe-movement-x), var(--toast-swipe-movement-y));animation:toast-enter var(--effect-motion-short-2) both}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{animation:toast-exit var(--effect-motion-short-3) both}.toast-surface--swiping.sc-ds-toast{transition:none;user-select:none}.toast-content.sc-ds-toast{display:flex;flex-direction:column;min-width:0;padding-inline-end:var(--dimension-size-500);transition:opacity var(--effect-motion-short-3)}.toast-copy.sc-ds-toast{display:flex;flex-direction:column;min-width:0;min-height:var(--typography-lineheight-md);margin-block:calc(-1 * var(--dimension-space-025));gap:var(--dimension-space-050)}.toast-title.sc-ds-toast,.toast-description.sc-ds-toast{min-width:0}.toast-action.sc-ds-toast{align-self:start;margin-top:calc(var(--dimension-space-200) + var(--dimension-space-025))}.toast-close.sc-ds-toast{position:absolute;top:var(--dimension-space-100);right:var(--dimension-space-100);transition:opacity var(--effect-motion-short-3)}.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-content.sc-ds-toast,.toast-viewport.sc-ds-toast:not([data-expanded]) .toast-positioner[data-behind].sc-ds-toast .toast-close.sc-ds-toast{opacity:0}@keyframes toast-enter{from{opacity:0;transform:translateY(var(--dimension-space-100))}to{opacity:1;transform:translateY(0)}}@keyframes toast-exit{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.toast-positioner.sc-ds-toast,.toast-surface.sc-ds-toast,.toast-content.sc-ds-toast,.toast-close.sc-ds-toast,.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{transition:none;animation:none}.toast-positioner--ending.sc-ds-toast .toast-surface.sc-ds-toast{opacity:0}}@media (forced-colors: active){.toast-surface.sc-ds-toast{box-shadow:none;outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}}`;const C=40;const P=10;const S="__global-stack__";const E='button,a,input,textarea,select,[role="button"],[data-ds-toast-swipe-ignore]';const F=new WeakMap;const D=new Set;let R=null;let j=0;const z=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.dsToastClose=i(this,"dsToastClose",7);this.dsToastRemove=i(this,"dsToastRemove",7);this.dsToastAction=i(this,"dsToastAction",7);this.manager=k;this.limit=3;this.timeout=m.animationDelayLong2;this.label="Notifications";this.closeLabel="Close notification";this.avoidMobileShellBar=false;this.swipeDirections=["down","right"];this.records=[];this.expanded=false;this.keyboardActive=false;this.swipe=null;this.layoutVersion=0;this.instanceId=++j;this.domIds=new Map;this.timers=new Map;this.closeWatchdogs=new Map;this.closeFrames=new Map;this.closeEvents=new Set;this.activationFrames=new Map;this.pauseReasons=new Set;this.hoveredIds=new Set;this.heights=new Map;this.measuredUpdateKeys=new Map;this.anchoredPositions=new Map;this.dismissedSwipeDirections=new Map;this.observedElements=new Set;this.pendingRemovals=[];this.unsubscribe=null;this.attachedManager=null;this.previousFocus=null;this.resizeObserver=null;this.mutationObserver=null;this.layoutFrame=null;this.activeSwipe=null;this.nextDomId=0;this.connected=false;this.pendingHoverLeave=false;this.handleWindowBlur=()=>this.pauseTimers("window");this.handleWindowFocus=()=>this.resumeTimers("window");this.handleVisibilityChange=()=>{if(document.hidden)this.pauseTimers("document");else this.resumeTimers("document")};this.handleFocusIn=()=>{const t=document.activeElement;if(!(t instanceof s)||!t.matches(":focus-visible"))return;R=this;this.keyboardActive=true;this.expanded=true;this.pauseTimers("focus")};this.handleFocusOut=t=>{const s=t.relatedTarget;if(s instanceof Node&&this.el.contains(s))return;if(!this.keyboardActive)return;this.keyboardActive=false;this.expanded=this.hoveredIds.size>0;this.resumeTimers("focus")};this.handleDocumentKeyDown=t=>{if(t.key!=="F6")return;const s=Array.from(D).filter((t=>t.activeRecords.length>0));const i=R&&R.activeRecords.length?R:s[s.length-1];if(i!==this)return;t.preventDefault();if(!this.el.contains(document.activeElement)){this.previousFocus=document.activeElement}this.keyboardActive=true;this.regionElement?.focus()};this.handleRegionKeyDown=t=>{if(t.key==="Escape"){const s=t.target;const i=s.closest(".toast-positioner");const e=i?.dataset["toastId"]??this.activeRecords[0]?.id;if(e){t.preventDefault();this.manager.close(e,"escape")}return}if(t.key==="Tab"&&t.shiftKey&&t.target===this.regionElement){t.preventDefault();this.restorePreviousFocus()}};this.handleWindowResize=()=>{this.heights.clear();this.measuredUpdateKeys.clear();this.layoutVersion+=1;this.scheduleLayout()};this.scheduleLayout=()=>{if(this.layoutFrame!==null)return;this.layoutFrame=requestAnimationFrame((()=>{this.layoutFrame=null;this.measureLayout()}))}}connectedCallback(){this.connect()}componentDidLoad(){this.connect()}connect(){if(this.connected)return;this.connected=true;this.resizeObserver??(this.resizeObserver=new ResizeObserver((()=>this.scheduleLayout())));this.mutationObserver??(this.mutationObserver=new MutationObserver((()=>this.scheduleLayout())));this.mutationObserver.observe(document.body,{childList:true,subtree:true});if(!this.unsubscribe)this.attachManager(this.manager);window.addEventListener("blur",this.handleWindowBlur);window.addEventListener("focus",this.handleWindowFocus);window.addEventListener("resize",this.handleWindowResize);window.addEventListener("scroll",this.scheduleLayout,true);document.addEventListener("keydown",this.handleDocumentKeyDown);document.addEventListener("visibilitychange",this.handleVisibilityChange);D.add(this);if(!R)R=this}componentDidRender(){this.syncObservedElements();this.flushPendingRemovals();this.scheduleLayout()}disconnectedCallback(){this.connected=false;this.flushPendingRemovals();this.detachManager();this.resetManagerState();this.resizeObserver?.disconnect();this.resizeObserver=null;this.mutationObserver?.disconnect();this.mutationObserver=null;this.observedElements.clear();if(this.layoutFrame!==null)cancelAnimationFrame(this.layoutFrame);this.layoutFrame=null;window.removeEventListener("blur",this.handleWindowBlur);window.removeEventListener("focus",this.handleWindowFocus);window.removeEventListener("resize",this.handleWindowResize);window.removeEventListener("scroll",this.scheduleLayout,true);document.removeEventListener("keydown",this.handleDocumentKeyDown);document.removeEventListener("visibilitychange",this.handleVisibilityChange);D.delete(this);if(R===this){const t=Array.from(D);R=t[t.length-1]??null}}onManagerChange(t){this.detachManager();this.resetManagerState();if(this.connected)this.attachManager(t)}onTimeoutChange(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}this.timers.clear();this.syncTimers()}attachManager(t){const s=F.get(t);if(s&&s!==this){console.warn("[ds-toast] A manager can control only one connected ds-toast instance.");return}F.set(t,this);this.attachedManager=t;this.unsubscribe=t.subscribe((t=>{this.records=t;this.syncLifecycle(t);this.scheduleLayout()}))}detachManager(){this.unsubscribe?.();this.unsubscribe=null;if(this.attachedManager&&F.get(this.attachedManager)===this){F.delete(this.attachedManager)}this.attachedManager=null}resetManagerState(){this.flushPendingRemovals();if(this.el.contains(document.activeElement))this.restorePreviousFocus();this.clearAllTimers();for(const t of this.activationFrames.values())cancelAnimationFrame(t);for(const t of this.closeFrames.values())cancelAnimationFrame(t);this.activationFrames.clear();this.closeFrames.clear();this.closeEvents.clear();this.pauseReasons.clear();this.hoveredIds.clear();this.pendingHoverLeave=false;this.heights.clear();this.measuredUpdateKeys.clear();this.anchoredPositions.clear();this.dismissedSwipeDirections.clear();this.domIds.clear();this.activeSwipe=null;this.swipe=null;this.expanded=false;this.keyboardActive=false;this.records=[];this.resizeObserver?.disconnect();this.observedElements.clear()}syncObservedElements(){const t=new Set(this.el.querySelectorAll(".toast-positioner"));for(const s of this.records){if(!s.positioner)continue;const i=this.resolveAnchor(s.positioner.anchor);if(i)t.add(i)}for(const s of this.observedElements){if(!t.has(s)){this.resizeObserver?.unobserve(s);this.observedElements.delete(s)}}for(const s of t){if(this.observedElements.has(s))continue;this.resizeObserver?.observe(s);this.observedElements.add(s)}}flushPendingRemovals(){for(const t of this.pendingRemovals.splice(0)){t.manager.notifyRemove(t.context);this.dsToastRemove.emit({id:t.context.id,toast:t.context.toast})}}syncLifecycle(t){const s=new Set(t.map((t=>t.id)));for(const t of this.hoveredIds){if(t!==S&&!s.has(t))this.hoveredIds.delete(t)}const i=t.some((t=>t.transitionStatus==="ending"));if(this.pendingHoverLeave&&!i&&!this.hoveredIds.size){this.pendingHoverLeave=false;this.expanded=false;this.resumeTimers("hover")}else if(!this.hoveredIds.size&&!this.pendingHoverLeave){this.resumeTimers("hover")}for(const[t,i]of this.timers){if(s.has(t))continue;if(i.handle)clearTimeout(i.handle);this.timers.delete(t)}for(const[t,i]of this.closeWatchdogs){if(s.has(t))continue;clearTimeout(i);this.closeWatchdogs.delete(t)}for(const[t,i]of this.activationFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.activationFrames.delete(t)}for(const[t,i]of this.closeFrames){if(s.has(t))continue;cancelAnimationFrame(i);this.closeFrames.delete(t)}for(const t of this.domIds.keys()){if(s.has(t))continue;this.closeEvents.delete(t);this.domIds.delete(t);this.heights.delete(t);this.measuredUpdateKeys.delete(t);this.anchoredPositions.delete(t);this.dismissedSwipeDirections.delete(t)}for(const s of t){this.ensureDomId(s.id);if(s.transitionStatus==="starting"&&!this.activationFrames.has(s.id)){const t=this.attachedManager;const i=requestAnimationFrame((()=>{this.activationFrames.delete(s.id);t?.activate(s.id)}));this.activationFrames.set(s.id,i)}if(s.transitionStatus==="ending"){this.clearToastTimer(s.id);this.beginRemoval(s)}else{const t=this.closeWatchdogs.get(s.id);if(t)clearTimeout(t);this.closeWatchdogs.delete(s.id);const i=this.closeFrames.get(s.id);if(i)cancelAnimationFrame(i);this.closeFrames.delete(s.id);this.closeEvents.delete(s.id)}}this.syncTimers()}syncTimers(){const t=new Set;for(const s of this.records){if(s.transitionStatus!=="active")continue;t.add(s.id);const i=this.resolveToastTimeout(s);if(i<=0){this.clearToastTimer(s.id);continue}const e=this.timers.get(s.id);if(!e||e.timerKey!==s.timerKey){this.clearToastTimer(s.id);this.timers.set(s.id,{timerKey:s.timerKey,remaining:i,startedAt:0,handle:null})}if(!this.isPaused)this.startToastTimer(s.id)}for(const s of this.timers.keys()){if(!t.has(s))this.clearToastTimer(s)}}resolveToastTimeout(t){const s=t.timeout??this.timeout;if(typeof s==="number")return Math.max(0,s);return p(s,m.animationDelayLong2)}startToastTimer(t){const s=this.timers.get(t);if(!s||s.handle||s.remaining<=0)return;s.startedAt=Date.now();s.handle=setTimeout((()=>{s.handle=null;s.remaining=0;this.manager.close(t,"timeout")}),s.remaining)}pauseTimers(t){const s=this.isPaused;this.pauseReasons.add(t);if(s)return;const i=Date.now();for(const t of this.timers.values()){if(!t.handle)continue;clearTimeout(t.handle);t.handle=null;t.remaining=Math.max(0,t.remaining-(i-t.startedAt))}}resumeTimers(t){this.pauseReasons.delete(t);if(this.isPaused)return;for(const t of this.timers.keys())this.startToastTimer(t)}get isPaused(){return this.pauseReasons.size>0}clearToastTimer(t){const s=this.timers.get(t);if(s?.handle)clearTimeout(s.handle);this.timers.delete(t)}clearAllTimers(){for(const t of this.timers.values()){if(t.handle)clearTimeout(t.handle)}for(const t of this.closeWatchdogs.values())clearTimeout(t);this.timers.clear();this.closeWatchdogs.clear()}beginRemoval(t){if(!this.closeEvents.has(t.id)){this.closeEvents.add(t.id);this.dsToastClose.emit({id:t.id,reason:t.closeReason??"programmatic",toast:t});this.moveFocusAfterClose(t.id)}if(this.closeWatchdogs.has(t.id)||this.closeFrames.has(t.id))return;const s=v(m.motionShort3,m.animationDurationShort3);if(s<=0){queueMicrotask((()=>this.completeRemoval(t)));return}const i=requestAnimationFrame((()=>{this.closeFrames.delete(t.id);const i=this.records.find((s=>s.id===t.id));if(!i||i.transitionStatus!=="ending")return;this.closeWatchdogs.set(t.id,setTimeout((()=>this.completeRemoval(i)),s))}));this.closeFrames.set(t.id,i)}completeRemoval(t){const s=this.records.find((s=>s.id===t.id));if(!s||s.transitionStatus!=="ending")return;const i=this.closeWatchdogs.get(t.id);if(i)clearTimeout(i);this.closeWatchdogs.delete(t.id);const e=this.closeFrames.get(t.id);if(e)cancelAnimationFrame(e);this.closeFrames.delete(t.id);const o=this.attachedManager;const n=o?.remove(t.id);if(o&&n)this.pendingRemovals.push({manager:o,context:n})}handleAnimationComplete(t){if(t.transitionStatus==="ending")this.completeRemoval(t)}bindAnimationCancel(t,s){if(!t||t.dataset["cancelBound"]==="true")return;t.dataset["cancelBound"]="true";t.addEventListener("animationcancel",(()=>{const t=this.records.find((t=>t.id===s));if(t)this.handleAnimationComplete(t)}))}handlePointerEnter(t){R=this;this.pendingHoverLeave=false;this.hoveredIds.add(t);this.expanded=true;this.pauseTimers("hover")}handlePointerLeave(t){this.hoveredIds.delete(t);if(this.hoveredIds.size)return;if(this.records.some((t=>t.transitionStatus==="ending"))){this.pendingHoverLeave=true;return}this.expanded=false;this.resumeTimers("hover")}get regionElement(){return this.el.querySelector(".toast-region")}restorePreviousFocus(){this.previousFocus?.focus?.();this.previousFocus=null;this.keyboardActive=false}moveFocusAfterClose(t){const s=document.activeElement;const i=this.positionerElement(t);if(!s||!i?.contains(s))return;requestAnimationFrame((()=>{const s=this.activeRecords.find((s=>s.id!==t));const i=s?this.positionerElement(s.id)?.querySelector("ds-button-unfilled"):null;if(i?.setFocus)void i.setFocus();else if(s)this.regionElement?.focus();else this.restorePreviousFocus()}))}handleAction(t,s){const i={id:t.id,toast:t,originalEvent:s.detail};this.dsToastAction.emit(i);t.action?.onAction?.({id:t.id,data:t.data,manager:this.manager,originalEvent:s.detail})}handlePointerDown(t,s){if(s.button!==0)return;const i=s.target;if(i.closest(E))return;const e=s.currentTarget;e.setPointerCapture(s.pointerId);this.activeSwipe={id:t.id,pointerId:s.pointerId,pointerType:s.pointerType,startX:s.clientX,startY:s.clientY,maxDistance:0,cancelled:false,axis:null};this.swipe={id:t.id,x:0,y:0};if(s.pointerType==="touch")this.pauseTimers("swipe")}handlePointerMove(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId||s.cancelled)return;const i=t.clientX-s.startX;const e=t.clientY-s.startY;if(!s.axis&&Math.max(Math.abs(i),Math.abs(e))>1){s.axis=Math.abs(i)>=Math.abs(e)?"x":"y"}if(!s.axis)return;const o=s.axis==="x";const n=o?i>=0?"right":"left":e>=0?"down":"up";const a=this.swipeDirections.includes(n);const r=o?Math.abs(i):Math.abs(e);const h=a?r:Math.sqrt(r);const c=(o?i:e)<0?-h:h;const d=o?c:0;const l=o?0:c;if(s.maxDistance-h>=P){s.cancelled=true;this.cancelSwipe();return}s.maxDistance=Math.max(s.maxDistance,h);if(r>1)t.preventDefault();this.swipe={id:s.id,x:d,y:l,direction:a?n:undefined}}handlePointerUp(t){const s=this.activeSwipe;if(!s||s.pointerId!==t.pointerId)return;const i=this.swipe;const e=i?Math.max(Math.abs(i.x),Math.abs(i.y)):0;const o=!s.cancelled&&!!i?.direction&&e>=C;const n=s.id;const a=s.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(a)this.resumeTimers("swipe");if(o&&i.direction){this.dismissedSwipeDirections.set(n,i.direction);this.manager.close(n,"swipe")}}handlePointerCancel(t){if(this.activeSwipe?.pointerId!==t.pointerId)return;this.cancelSwipe()}cancelSwipe(){const t=this.activeSwipe?.pointerType==="touch";this.activeSwipe=null;this.swipe=null;if(t)this.resumeTimers("swipe")}get touchAction(){const t=this.swipeDirections.includes("left")||this.swipeDirections.includes("right");const s=this.swipeDirections.includes("up")||this.swipeDirections.includes("down");if(t&&s)return"none";if(t)return"pan-y";if(s)return"pan-x";return"auto"}measureNaturalHeight(t,s){const i=t.querySelector(".toast-surface");if(!i)return 0;const e=t.style.width;const o=t.style.transition;const n=i.style.height;if(s){t.style.transition="none";t.style.width="100%"}i.style.height="auto";const a=i.getBoundingClientRect().height;i.style.height=n;if(s){t.style.width=e;t.getBoundingClientRect();t.style.transition=o}return a}measureLayout(){let t=false;for(const s of this.records){const i=this.positionerElement(s.id);if(!i)continue;let e=this.heights.get(s.id)??0;const o=e<=0||this.measuredUpdateKeys.get(s.id)!==s.updateKey;if(o){e=this.measureNaturalHeight(i,!s.positioner);if(e>0){if(this.heights.get(s.id)!==e)t=true;this.heights.set(s.id,e);this.measuredUpdateKeys.set(s.id,s.updateKey)}}if(!s.positioner)continue;const n=this.resolveAnchor(s.positioner.anchor);if(!n||e<=0){if(this.anchoredPositions.delete(s.id))t=true;continue}const h=i.getBoundingClientRect();const c=g(s.positioner.sideOffset,m.space050);const d=g(s.positioner.alignOffset,0);const l=a({anchorRect:n.getBoundingClientRect(),popupWidth:h.width,popupHeight:e,side:s.positioner.side??"top",align:s.positioner.align??"center",sideOffsetPx:c,alignOffsetPx:d,viewportPadPx:g(undefined,m.space200),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(n)});const f=this.anchoredPositions.get(s.id);if(!f||f.x!==l.x||f.y!==l.y||f.side!==l.resolvedSide){this.anchoredPositions.set(s.id,{x:l.x,y:l.y,side:l.resolvedSide});t=true}}if(t)this.layoutVersion+=1}resolveAnchor(t){return typeof t==="string"?document.getElementById(t):t}positionerElement(t){return Array.from(this.el.querySelectorAll(".toast-positioner")).find((s=>s.dataset["toastId"]===t))??null}ensureDomId(t){const s=this.domIds.get(t);if(s)return s;const i=++this.nextDomId;this.domIds.set(t,i);return i}get activeRecords(){return this.records.filter((t=>t.transitionStatus!=="ending"))}globalLayout(){const t=this.records.filter((t=>!t.positioner));let s=0;let i=0;const e=g(undefined,m.space200);const o=new Map;t.forEach(((t,n)=>{if(t.transitionStatus==="ending"){o.set(t.id,{index:n,offset:s,limited:false});return}const a=i>=Math.max(1,this.limit);o.set(t.id,{index:i,offset:s,limited:a});s+=(this.heights.get(t.id)??0)+e;i+=1}));return o}renderToast(t,s){const i=this.ensureDomId(t.id);const o=`ds-toast-${this.instanceId}-${i}-title`;const n=`ds-toast-${this.instanceId}-${i}-description`;const a=this.swipe?.id===t.id?this.swipe:null;const r=a?.direction??this.dismissedSwipeDirections.get(t.id);const h=!!t.positioner;const c=this.anchoredPositions.get(t.id);const d=t.priority==="high"&&!this.keyboardActive;const l=this.keyboardActive&&!s.limited?0:-1;const f=this.heights.get(t.id);return e("div",{ref:s=>this.bindAnimationCancel(s,t.id),class:{"toast-positioner":true,"toast-positioner--anchored":h,"toast-positioner--ending":t.transitionStatus==="ending"},"data-toast-id":t.id,"data-behind":!h&&s.index>0?"":undefined,"data-limited":s.limited?"":undefined,"data-positioned":h?String(!!c):undefined,"data-side":c?.side,inert:s.limited?true:undefined,"aria-hidden":s.limited?"true":undefined,style:{"--toast-index":String(s.index),"--toast-offset-y":`${s.offset}px`,"--toast-height":f?`${f}px`:undefined,zIndex:String(this.records.length-s.index),left:c?`${c.x}px`:undefined,top:c?`${c.y}px`:undefined},onAnimationEnd:()=>this.handleAnimationComplete(t)},e("div",{class:{"toast-surface":true,"toast-surface--swiping":!!a},role:t.priority==="high"?"alertdialog":"dialog","aria-modal":"false","aria-labelledby":t.title?o:t.description?n:undefined,"aria-describedby":t.title&&t.description?n:undefined,"aria-hidden":d?"true":undefined,"data-type":t.type,"data-priority":t.priority,"data-transition-status":t.transitionStatus,"data-swiping":a?"":undefined,"data-swipe-direction":r,style:{"--toast-swipe-movement-x":`${a?.x??0}px`,"--toast-swipe-movement-y":`${a?.y??0}px`,touchAction:this.touchAction},onPointerDown:s=>this.handlePointerDown(t,s),onPointerMove:t=>this.handlePointerMove(t),onPointerUp:t=>this.handlePointerUp(t),onPointerCancel:t=>this.handlePointerCancel(t),onPointerEnter:h?()=>this.handlePointerEnter(t.id):undefined,onPointerLeave:h?()=>this.handlePointerLeave(t.id):undefined},e("div",{class:"toast-content"},e("div",{class:"toast-copy"},t.title&&e("ds-text",{class:"toast-title",as:"div",variant:"text-title-small",color:"primary",textId:o},t.title),t.description&&e("ds-text",{class:"toast-description",as:"div",variant:"text-body-medium",color:"secondary",textId:n},t.description)),t.action&&e("ds-button-unfilled",{class:"toast-action",variant:"label",size:"md",type:"button",label:t.action.label,"aria-label":t.action.ariaLabel,hasBorder:true,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:s=>this.handleAction(t,s)})),e("ds-button-unfilled",{class:"toast-close",variant:"icon",size:"md",type:"button",icon:"Cross","aria-label":this.closeLabel,hasBorder:false,activeFill:false,focusTabIndex:l,"aria-hidden":!this.keyboardActive?"true":undefined,onDsClick:()=>this.manager.close(t.id,"close-button")})))}render(){const t=this.globalLayout();const s=this.records.filter((t=>!t.positioner));const i=this.records.filter((t=>!!t.positioner));const n=this.records.filter((s=>s.priority==="high"&&s.transitionStatus!=="ending"&&!t.get(s.id)?.limited));return e(o,{key:"69199354c823fe4a68585a36127f731f4dd2ae87"},e("section",{key:"4773ca6be99cf5c9b0f8a5009c4f471abe854fa1",class:"toast-region",role:"region","aria-label":this.label,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",tabIndex:-1,onFocusin:this.handleFocusIn,onFocusout:t=>this.handleFocusOut(t),onKeyDown:t=>this.handleRegionKeyDown(t)},e("div",{key:"7fd43d5c98847380914b5bb73208126c32ad612d",class:"toast-viewport","data-expanded":this.expanded?"":undefined,onPointerEnter:()=>this.handlePointerEnter(S),onPointerLeave:()=>this.handlePointerLeave(S)},s.map((s=>this.renderToast(s,t.get(s.id)??{index:0,offset:0,limited:false})))),e("div",{key:"2327d1b2ae3ce345865c82a3fd2352bc93a4d428",class:"toast-anchored-layer"},i.map((t=>this.renderToast(t,{index:0,offset:0,limited:false})))),e("div",{key:"a3d4116d65e07ae02da71f35cb77ee60bf91faf9",class:"toast-assertive-announcer ds-visually-hidden"},n.map((t=>e("div",{role:"alert","aria-atomic":"true"},[t.title,t.description].filter(Boolean).join(". ")))))))}get el(){return this}static get watchers(){return{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}}static get style(){return A()}},[2,"ds-toast",{manager:[16],limit:[2],timeout:[8],label:[1],closeLabel:[1,"close-label"],avoidMobileShellBar:[516,"avoid-mobile-shell-bar"],swipeDirections:[16],records:[32],expanded:[32],keyboardActive:[32],swipe:[32],layoutVersion:[32]},undefined,{manager:[{onManagerChange:0}],timeout:[{onTimeoutChange:0}]}]);function L(){if(typeof customElements==="undefined"){return}const t=["ds-toast","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-toast":if(!customElements.get(n(t))){customElements.define(n(t),z)}break;case"ds-badge":if(!customElements.get(n(t))){c()}break;case"ds-button-unfilled":if(!customElements.get(n(t))){d()}break;case"ds-icon":if(!customElements.get(n(t))){l()}break;case"ds-loader":if(!customElements.get(n(t))){f()}break;case"ds-text":if(!customElements.get(n(t))){u()}break;case"ds-tooltip":if(!customElements.get(n(t))){h()}break}}))}L();const $=z;const I=L;export{$ as DsToast,I as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-toast.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as o,d as s}from"./p-
|
|
1
|
+
import{T as o,d as s}from"./p-BAIYOobl.js";const t=o;const p=s;export{t as DsTooltipChart,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-tooltip-chart.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as o,d as s}from"./p-
|
|
1
|
+
import{T as o,d as s}from"./p-BMI0F08u.js";const t=o;const p=s;export{t as DsTooltip,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-tooltip.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as
|
|
1
|
+
import{p as t,H as e,h as s,a as i,t as a}from"./index.js";import{d as n}from"./p-DMPn_dt7.js";const o=()=>`.sc-ds-typing-indicator-h{display:block;width:100%;min-width:0;box-sizing:border-box}`;const r=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.label="Typing…"}render(){return s(i,{key:"6a2eac4452bea7fd3016a0b5e85c582e3e0ea121",role:"status","aria-live":"polite","aria-atomic":"true"},s("ds-text",{key:"74fca7f35994a373ff2d05350288a9e6378e3fba",as:"span",variant:"text-body-medium",color:"secondary",shimmer:true},this.label))}static get style(){return o()}},[2,"ds-typing-indicator",{label:[1]}]);function c(){if(typeof customElements==="undefined"){return}const t=["ds-typing-indicator","ds-text"];t.forEach((t=>{switch(t){case"ds-typing-indicator":if(!customElements.get(a(t))){customElements.define(a(t),r)}break;case"ds-text":if(!customElements.get(a(t))){n()}break}}))}c();const d=r;const m=c;export{d as DsTypingIndicator,m as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-typing-indicator.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as t,c as i,h as s,a as n,t as a}from"./index.js";import{d as r}from"./p-8fddX3V3.js";import{d as o}from"./p-DFR9hqDU.js";import{d}from"./p-WEffoQQD.js";import{d as u}from"./p-BYo1-6b5.js";import{d as c}from"./p-BVsVUnAw.js";import{d as l}from"./p-0XTyQNRG.js";import{d as h}from"./p-CGtq7TnC.js";import{d as g}from"./p-DcvPY30Q.js";import{d as q}from"./p-DMPn_dt7.js";import{d as p}from"./p-BMI0F08u.js";function m(e,t){return e.find((e=>e.questionId===t))}function f(e,t){return Object.fromEntries(e.map((e=>{const i=m(t,e.id);const s=new Set(e.choices?.map((e=>e.value))??[]);if(e.type==="multiple"){const t=Array.isArray(i?.value)?i.value:[];const n=t.filter((e=>s.has(e)));const a=t.find((e=>!s.has(e)))??"";return[e.id,{value:n,otherSelected:Boolean(e.allowOther&&a),otherText:e.allowOther?a:"",skipped:i?.value===null}]}const n=typeof i?.value==="string"?i.value:"";const a=e.type==="single"&&s.has(n);return[e.id,{value:e.type==="single"&&!a?"":n,otherSelected:Boolean(e.type==="single"&&e.allowOther&&n&&!a),otherText:e.type==="single"&&e.allowOther&&n&&!a?n:"",skipped:i?.value===null}]})))}function b(e,t){if(t.skipped)return{questionId:e.id,value:null};if(e.type==="multiple"){const i=Array.isArray(t.value)?[...t.value]:[];if(t.otherSelected&&t.otherText.trim())i.push(t.otherText.trim());return{questionId:e.id,value:i.length||e.required?i:null}}if(t.otherSelected){const i=t.otherText.trim();return{questionId:e.id,value:i||null}}const i=typeof t.value==="string"?t.value.trim():"";return{questionId:e.id,value:i||null}}function _(e,t){if((e.type==="single"||e.type==="multiple")&&!e.choices?.length){return"This question has no available choices."}if(t.otherSelected&&!t.otherText.trim()){return"Enter a response for Other."}if(!e.required||t.skipped)return undefined;const i=b(e,t).value;const s=i===null||Array.isArray(i)&&i.length===0;if(!s)return undefined;return e.type==="text"?"Enter an answer before continuing.":"Choose an answer before continuing."}function v(e,t){if(!t||t.value===null)return"Skipped";const i=Array.isArray(t.value)?t.value:[t.value];const s=new Map(e.choices?.map((e=>[e.value,e.label]))??[]);return i.map((e=>s.get(e)??e)).join(", ")}const x=()=>`@media (forced-colors: active){.sc-ds-agent-questionnaire:root,.sc-ds-agent-questionnaire-h,.ds-forced-colors-scope.sc-ds-agent-questionnaire{--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-visually-hidden.sc-ds-agent-questionnaire-h,.ds-visually-hidden.sc-ds-agent-questionnaire{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.sc-ds-agent-questionnaire-h{display:block;width:100%;min-width:0;box-sizing:border-box;-webkit-user-select:none;user-select:none}.questionnaire.sc-ds-agent-questionnaire{display:grid;gap:var(--dimension-space-150);width:100%;padding:var(--dimension-space-200);border-radius:var(--dimension-radius-125);background:var(--color-background-primary);box-shadow:var(--effect-elevation-elevated-md);box-sizing:border-box}.questionnaire--answered.sc-ds-agent-questionnaire{gap:var(--dimension-space-100);padding:var(--dimension-space-150);background:var(--color-background-secondary);box-shadow:none}.questionnaire--preparing.sc-ds-agent-questionnaire{align-items:center;grid-template-columns:auto minmax(0, 1fr)}.questionnaire__header.sc-ds-agent-questionnaire,.questionnaire__actions.sc-ds-agent-questionnaire,.questionnaire__actions-leading.sc-ds-agent-questionnaire,.questionnaire__error.sc-ds-agent-questionnaire,.questionnaire__submission-error.sc-ds-agent-questionnaire{display:flex;align-items:center}.questionnaire__header.sc-ds-agent-questionnaire,.questionnaire__actions.sc-ds-agent-questionnaire{justify-content:space-between;gap:var(--dimension-space-100)}.questionnaire__body.sc-ds-agent-questionnaire,.questionnaire__prompt.sc-ds-agent-questionnaire,.questionnaire__choices.sc-ds-agent-questionnaire,.questionnaire__single-choice.sc-ds-agent-questionnaire,.questionnaire__multiple-choice.sc-ds-agent-questionnaire,.questionnaire__other-choice.sc-ds-agent-questionnaire,.questionnaire__summary.sc-ds-agent-questionnaire,.questionnaire__summary.sc-ds-agent-questionnaire li.sc-ds-agent-questionnaire{display:grid}.questionnaire__body.sc-ds-agent-questionnaire,.questionnaire__prompt.sc-ds-agent-questionnaire,.questionnaire__choices.sc-ds-agent-questionnaire,.questionnaire__single-choice.sc-ds-agent-questionnaire,.questionnaire__multiple-choice.sc-ds-agent-questionnaire,.questionnaire__other-choice.sc-ds-agent-questionnaire{gap:var(--dimension-space-100)}.questionnaire__choices.sc-ds-agent-questionnaire{min-width:0;margin:0;padding:0;border:0}ds-radio.sc-ds-agent-questionnaire,ds-checkbox.sc-ds-agent-questionnaire{width:100%;min-width:0}.questionnaire__other-input.sc-ds-agent-questionnaire,.questionnaire__text-input.sc-ds-agent-questionnaire{width:100%;padding:var(--dimension-space-100);border:var(--dimension-stroke-width-012) solid var(--color-border-secondary);border-radius:var(--dimension-radius-050);outline:none;background:var(--color-background-primary);color:var(--color-foreground-primary);font-family:var(--typography-font-family-ui);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half);box-sizing:border-box;-webkit-user-select:text;user-select:text}.questionnaire__other-input.sc-ds-agent-questionnaire{width:calc(100% - var(--dimension-size-500));margin-inline-start:var(--dimension-size-500)}.questionnaire__text-input.sc-ds-agent-questionnaire{min-height:calc(var(--typography-lineheight-md) * 4 + var(--dimension-space-200));resize:vertical}.questionnaire__other-input.sc-ds-agent-questionnaire:focus,.questionnaire__text-input.sc-ds-agent-questionnaire:focus{border-color:var(--color-border-bold-brand);box-shadow:inset 0 0 0 var(--dimension-stroke-width-018) var(--color-border-bold-brand)}.questionnaire__other-input[aria-invalid='true'].sc-ds-agent-questionnaire,.questionnaire__text-input[aria-invalid='true'].sc-ds-agent-questionnaire{border-color:var(--color-border-bold-negative)}.questionnaire__error.sc-ds-agent-questionnaire,.questionnaire__submission-error.sc-ds-agent-questionnaire{gap:var(--dimension-space-050);color:var(--color-foreground-bold-negative)}.questionnaire__submission-error.sc-ds-agent-questionnaire{padding:var(--dimension-space-075);border-radius:var(--dimension-radius-050);background:var(--color-background-faint-negative)}.questionnaire__actions-leading.sc-ds-agent-questionnaire{flex-wrap:wrap;gap:var(--dimension-space-075)}.questionnaire__action-item.sc-ds-agent-questionnaire{width:fit-content;max-width:100%}.questionnaire.sc-ds-agent-questionnaire textarea.sc-ds-agent-questionnaire:disabled{color:var(--color-foreground-tertiary);cursor:default;opacity:1}.questionnaire__summary.sc-ds-agent-questionnaire{gap:var(--dimension-space-100);margin:0;padding:0;list-style:none}.questionnaire__summary.sc-ds-agent-questionnaire li.sc-ds-agent-questionnaire{gap:var(--dimension-space-025)}@media (max-width: 480px){.questionnaire.sc-ds-agent-questionnaire{padding:var(--dimension-space-150)}.questionnaire__actions.sc-ds-agent-questionnaire{align-items:stretch;flex-direction:column}.questionnaire__actions-leading.sc-ds-agent-questionnaire{display:grid;grid-template-columns:minmax(0, 1fr);width:100%}.questionnaire__action-item.sc-ds-agent-questionnaire,.questionnaire__action-item--primary.sc-ds-agent-questionnaire{width:100%}}@media (forced-colors: active){.questionnaire.sc-ds-agent-questionnaire{border:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);box-shadow:none}.questionnaire__other-input[aria-invalid='true'].sc-ds-agent-questionnaire,.questionnaire__text-input[aria-invalid='true'].sc-ds-agent-questionnaire{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-content)}.questionnaire__submission-error.sc-ds-agent-questionnaire{border:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);background:var(--ds-forced-color-surface)}.questionnaire.sc-ds-agent-questionnaire input.sc-ds-agent-questionnaire:disabled,.questionnaire.sc-ds-agent-questionnaire textarea.sc-ds-agent-questionnaire:disabled{color:var(--ds-forced-color-disabled)}}`;const y={progress:"Question {current} of {total}",previous:"Previous",next:"Next",answer:"Answer",skip:"Skip",cancel:"Cancel",other:"Other",otherPlaceholder:"Enter another answer",preparing:"Preparing questions…"};let w=0;const k=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.dsAnswer=i(this,"dsAnswer",7);this.dsCancel=i(this,"dsCancel",7);this.answers=[];this.status="ready";this.allowCancel=false;this.currentStep=0;this.drafts={};this.validation={};this.instanceId=++w;this.otherValue=`__ds-agent-questionnaire-other-${this.instanceId}`;this.answerPending=false;this.resetScheduled=false;this.answersSnapshot=[];this.waitingForRequestAnswers=false}componentWillLoad(){this.draftRequestId=this.requestId;this.answersSnapshot=this.answers;this.resetDraft()}handleQuestionnaireInputChange(){this.scheduleDraftReset()}handleStatusChange(e){if(e!=="submitting")this.answerPending=false}async setFocus(){this.focusCurrentControl()}get copy(){return{...y,...this.labels}}get disabled(){return this.status==="submitting"}resetDraft(e=this.answers){this.currentStep=0;this.drafts=f(this.questions??[],e??[]);this.validation={};this.answerPending=false}scheduleDraftReset(){if(this.resetScheduled)return;this.resetScheduled=true;queueMicrotask((()=>{this.resetScheduled=false;const e=this.requestId!==this.draftRequestId;const t=this.answers!==this.answersSnapshot;if(e&&!t){this.waitingForRequestAnswers=true}else if(t){this.waitingForRequestAnswers=false}this.resetDraft(this.waitingForRequestAnswers?[]:this.answers);this.draftRequestId=this.requestId;this.answersSnapshot=this.answers}))}focusCurrentControl(e=false){const t=()=>{const t=e?this.el.querySelector('[data-question-control][aria-invalid="true"]:not([disabled])'):null;const i=t??this.el.querySelector("[data-question-control]:not([disabled]):not([is-inactive])");const s=this.el.querySelector("[data-question-action]:not([is-inactive]):not([is-loading])");const n=i??s;if(n?.setFocus)void n.setFocus();else n?.focus()};t();requestAnimationFrame(t);setTimeout(t,0)}updateDraft(e,t){const i=this.drafts[e]??{value:"",otherSelected:false,otherText:"",skipped:false};this.drafts={...this.drafts,[e]:{...i,...t,skipped:false}};if(this.validation[e]){const{[e]:t,...i}=this.validation;this.validation=i}}validate(e){const t=_(e,this.drafts[e.id]);if(!t)return true;this.validation={...this.validation,[e.id]:t};this.focusCurrentControl(true);return false}move(e){this.currentStep=Math.min(Math.max(e,0),this.questions.length-1);this.focusCurrentControl()}next(e){if(!this.validate(e))return;this.move(this.currentStep+1)}skip(e){if(e.required)return;this.drafts={...this.drafts,[e.id]:{...this.drafts[e.id]??{value:"",otherSelected:false,otherText:""},skipped:true}};if(this.currentStep<this.questions.length-1)this.move(this.currentStep+1);else this.submit()}submit(){if(this.disabled||this.answerPending)return;const e=this.questions.findIndex((e=>!this.validateWithoutFocus(e)));if(e>=0){this.currentStep=e;this.focusCurrentControl(true);return}this.answerPending=true;this.dsAnswer.emit({requestId:this.requestId,answers:this.questions.map((e=>b(e,this.drafts[e.id])))})}validateWithoutFocus(e){const t=_(e,this.drafts[e.id]);if(!t)return true;this.validation={...this.validation,[e.id]:t};return false}progressLabel(){return this.copy.progress.split("{current}").join(String(this.currentStep+1)).split("{total}").join(String(this.questions.length))}selectSingle(e,t){const i=t===this.otherValue;this.updateDraft(e.id,{value:i?"":t,otherSelected:i});if(i){requestAnimationFrame((()=>this.el.querySelector("[data-question-other-input]")?.focus()))}}renderSingleChoice(e,t,i){const n=this.drafts[e.id];const a=n.otherSelected?this.otherValue:typeof n.value==="string"?n.value:"";const r=[...e.choices??[],...e.allowOther?[{value:this.otherValue,label:this.copy.other}]:[]];return s("div",{class:"questionnaire__single-choice"},s("ds-radio",{"data-question-control":true,size:"lg",options:r,value:a,disabled:this.disabled,form:`ds-agent-questionnaire-detached-${this.instanceId}`,ariaLabelledby:t,"aria-describedby":this.validation[e.id]?i:undefined,onDsChange:t=>this.selectSingle(e,t.detail)}),n.otherSelected?this.renderOtherInput(e,i):null)}renderMultipleChoice(e,t){const i=this.drafts[e.id];const n=Array.isArray(i.value)?i.value:[];const a=`ds-agent-questionnaire-detached-${this.instanceId}`;return s("div",{class:"questionnaire__multiple-choice"},e.choices?.map((t=>s("ds-checkbox",{key:t.value,"data-question-control":true,size:"lg",label:t.label,description:t.description,value:t.value,checked:n.includes(t.value),disabled:this.disabled,form:a,onDsChange:i=>{this.updateDraft(e.id,{value:i.detail?[...n,t.value]:n.filter((e=>e!==t.value))})}}))),e.allowOther?s("div",{class:"questionnaire__other-choice"},s("ds-checkbox",{"data-question-control":true,size:"lg",label:this.copy.other,checked:i.otherSelected,disabled:this.disabled,form:a,onDsChange:t=>{this.updateDraft(e.id,{otherSelected:t.detail});if(t.detail){requestAnimationFrame((()=>this.el.querySelector("[data-question-other-input]")?.focus()))}}}),i.otherSelected?this.renderOtherInput(e,t):null):null)}renderOtherInput(e,t){const i=this.drafts[e.id];return s("input",{class:"questionnaire__other-input","data-question-control":true,"data-question-other-input":true,type:"text",form:`ds-agent-questionnaire-detached-${this.instanceId}`,value:i.otherText,placeholder:this.copy.otherPlaceholder,"aria-label":this.copy.other,"aria-invalid":this.validation[e.id]?"true":undefined,"aria-describedby":this.validation[e.id]?t:undefined,disabled:this.disabled,onInput:t=>this.updateDraft(e.id,{otherText:t.target.value})})}renderQuestion(e){const t=this.drafts[e.id];const i=`ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-error`;const n=`ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-prompt`;return s("div",{class:"questionnaire__body"},s("div",{class:"questionnaire__prompt"},s("ds-text",{as:"h2",variant:"text-title-small",textId:n},e.question),e.description?s("ds-text",{variant:"text-body-small",color:"secondary"},e.description):null),e.type==="text"?s("textarea",{class:"questionnaire__text-input","data-question-control":true,value:typeof t.value==="string"?t.value:"",form:`ds-agent-questionnaire-detached-${this.instanceId}`,placeholder:e.placeholder,"aria-label":e.question,"aria-invalid":this.validation[e.id]?"true":undefined,"aria-describedby":this.validation[e.id]?i:undefined,disabled:this.disabled,rows:4,onInput:t=>this.updateDraft(e.id,{value:t.target.value})}):s("fieldset",{class:"questionnaire__choices","aria-describedby":this.validation[e.id]?i:undefined},s("legend",{class:"ds-visually-hidden"},e.question),e.type==="single"?this.renderSingleChoice(e,n,i):this.renderMultipleChoice(e,i)),this.validation[e.id]?s("div",{id:i,class:"questionnaire__error",role:"alert"},s("ds-icon",{name:"ExclamationTriangle",size:"xs",color:"inherit"}),s("ds-text",{variant:"text-body-small",color:"negative"},this.validation[e.id])):null)}renderAnswered(){return s("div",{class:"questionnaire questionnaire--answered"},s("ol",{class:"questionnaire__summary"},this.questions.map((e=>s("li",null,s("ds-text",{variant:"text-body-small",emphasis:true},e.question),s("ds-text",{variant:"text-body-small",color:"secondary"},v(e,this.answers.find((t=>t.questionId===e.id)))))))))}render(){if(this.status==="preparing"){return s(n,null,s("div",{class:"questionnaire questionnaire--preparing",role:"status"},s("ds-loader",{size:"sm"}),s("ds-text",{variant:"text-body-medium"},this.copy.preparing)))}if(!this.questions?.length)return null;if(this.status==="answered")return s(n,null,this.renderAnswered());const e=this.questions[this.currentStep];const t=this.currentStep===this.questions.length-1;const i=Boolean(e.skippable&&!e.required);return s(n,null,s("section",{class:{questionnaire:true,"questionnaire--submitting":this.disabled,"questionnaire--error":this.status==="error"},"aria-busy":this.disabled?"true":undefined,"aria-label":e.question},s("header",{class:"questionnaire__header"},s("ds-text",{variant:"text-caption",color:"secondary"},this.progressLabel()),this.allowCancel?s("ds-tooltip",{label:this.copy.cancel,side:"top",size:"sm"},s("ds-button-unfilled",{"data-question-action":true,variant:"icon",icon:"Cross",size:"sm","aria-label":this.copy.cancel,hasBorder:false,isInactive:this.disabled,onDsClick:()=>this.dsCancel.emit({requestId:this.requestId})})):null),this.renderQuestion(e),this.status==="error"&&this.errorMessage?s("div",{class:"questionnaire__submission-error",role:"alert"},s("ds-icon",{name:"ExclamationTriangle",size:"xs",color:"inherit"}),s("ds-text",{variant:"text-body-small",color:"negative"},this.errorMessage)):null,s("footer",{class:"questionnaire__actions"},s("div",{class:"questionnaire__actions-leading"},this.currentStep>0?s("div",{class:"questionnaire__action-item"},s("ds-button-unfilled",{"data-question-action":true,label:this.copy.previous,size:"sm",width:"fill",isInactive:this.disabled,onDsClick:()=>this.move(this.currentStep-1)})):null,i?s("div",{class:"questionnaire__action-item"},s("ds-button-unfilled",{"data-question-action":true,label:this.copy.skip,size:"sm",width:"fill",hasBorder:false,isInactive:this.disabled,onDsClick:()=>this.skip(e)})):null),s("div",{class:"questionnaire__action-item questionnaire__action-item--primary"},s("ds-button-filled",{"data-question-action":true,label:t?this.copy.answer:this.copy.next,size:"sm",width:"fill",isLoading:this.disabled,onDsClick:()=>t?this.submit():this.next(e)})))))}get el(){return this}static get watchers(){return{requestId:[{handleQuestionnaireInputChange:0}],questions:[{handleQuestionnaireInputChange:0}],answers:[{handleQuestionnaireInputChange:0}],status:[{handleStatusChange:0}]}}static get style(){return x()}},[2,"ds-agent-questionnaire",{requestId:[1,"request-id"],questions:[16],answers:[16],status:[1],errorMessage:[1,"error-message"],allowCancel:[4,"allow-cancel"],labels:[16],currentStep:[32],drafts:[32],validation:[32],setFocus:[64]},undefined,{requestId:[{handleQuestionnaireInputChange:0}],questions:[{handleQuestionnaireInputChange:0}],answers:[{handleQuestionnaireInputChange:0}],status:[{handleStatusChange:0}]}]);function C(){if(typeof customElements==="undefined"){return}const e=["ds-agent-questionnaire","ds-badge","ds-button-filled","ds-button-unfilled","ds-checkbox","ds-icon","ds-loader","ds-radio","ds-skeleton","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-agent-questionnaire":if(!customElements.get(a(e))){customElements.define(a(e),k)}break;case"ds-badge":if(!customElements.get(a(e))){r()}break;case"ds-button-filled":if(!customElements.get(a(e))){o()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){d()}break;case"ds-checkbox":if(!customElements.get(a(e))){u()}break;case"ds-icon":if(!customElements.get(a(e))){c()}break;case"ds-loader":if(!customElements.get(a(e))){l()}break;case"ds-radio":if(!customElements.get(a(e))){h()}break;case"ds-skeleton":if(!customElements.get(a(e))){g()}break;case"ds-text":if(!customElements.get(a(e))){q()}break;case"ds-tooltip":if(!customElements.get(a(e))){p()}break}}))}C();export{k as A,C as d};
|
|
2
|
+
//# sourceMappingURL=p-3Xp9hXbL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["answerFor","answers","questionId","find","answer","createQuestionnaireDrafts","questions","Object","fromEntries","map","question","id","choiceValues","Set","choices","choice","value","type","values","Array","isArray","known","filter","has","other","otherSelected","Boolean","allowOther","otherText","skipped","isKnownChoice","normalizeQuestionAnswer","draft","trim","push","length","required","validateQuestionDraft","undefined","missing","formatQuestionAnswer","labels","Map","label","get","join","agentQuestionnaireCss","DEFAULT_LABELS","progress","previous","next","skip","cancel","otherPlaceholder","preparing","questionnaireId","AgentQuestionnaire","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","status","allowCancel","currentStep","drafts","validation","instanceId","otherValue","answerPending","resetScheduled","answersSnapshot","waitingForRequestAnswers","componentWillLoad","draftRequestId","requestId","resetDraft","handleQuestionnaireInputChange","scheduleDraftReset","handleStatusChange","setFocus","focusCurrentControl","copy","disabled","queueMicrotask","requestChanged","answersChanged","preferInvalid","focus","invalidControl","el","querySelector","control","action","target","requestAnimationFrame","setTimeout","updateDraft","update","_removed","rest","validate","message","move","step","Math","min","max","submit","invalidIndex","findIndex","validateWithoutFocus","dsAnswer","emit","progressLabel","split","String","selectSingle","renderSingleChoice","promptId","errorId","options","h","class","size","form","ariaLabelledby","onDsChange","event","detail","renderOtherInput","renderMultipleChoice","detachedForm","key","description","checked","includes","placeholder","onInput","renderQuestion","as","variant","textId","color","rows","role","name","renderAnswered","emphasis","render","Host","last","canSkip","skippable","questionnaire","side","icon","hasBorder","isInactive","onDsClick","dsCancel","errorMessage","width","isLoading"],"sources":["src/wc/components/AgentQuestionnaire/agent-questionnaire-model.ts","src/wc/components/AgentQuestionnaire/AgentQuestionnaire.css?tag=ds-agent-questionnaire&encapsulation=scoped","src/wc/components/AgentQuestionnaire/AgentQuestionnaire.tsx"],"sourcesContent":["import type { AgentQuestion, AgentQuestionAnswer } from '../conversation-types';\n\nexport interface AgentQuestionDraft {\n value: string | string[];\n otherSelected: boolean;\n otherText: string;\n skipped: boolean;\n}\n\nexport type AgentQuestionDrafts = Record<string, AgentQuestionDraft>;\n\nfunction answerFor(\n answers: AgentQuestionAnswer[],\n questionId: string\n): AgentQuestionAnswer | undefined {\n return answers.find(answer => answer.questionId === questionId);\n}\n\nexport function createQuestionnaireDrafts(\n questions: AgentQuestion[],\n answers: AgentQuestionAnswer[]\n): AgentQuestionDrafts {\n return Object.fromEntries(\n questions.map(question => {\n const answer = answerFor(answers, question.id);\n const choiceValues = new Set(question.choices?.map(choice => choice.value) ?? []);\n\n if (question.type === 'multiple') {\n const values = Array.isArray(answer?.value) ? answer.value : [];\n const known = values.filter(value => choiceValues.has(value));\n const other = values.find(value => !choiceValues.has(value)) ?? '';\n return [\n question.id,\n {\n value: known,\n otherSelected: Boolean(question.allowOther && other),\n otherText: question.allowOther ? other : '',\n skipped: answer?.value === null,\n },\n ];\n }\n\n const value = typeof answer?.value === 'string' ? answer.value : '';\n const isKnownChoice = question.type === 'single' && choiceValues.has(value);\n return [\n question.id,\n {\n value: question.type === 'single' && !isKnownChoice ? '' : value,\n otherSelected: Boolean(\n question.type === 'single' && question.allowOther && value && !isKnownChoice\n ),\n otherText:\n question.type === 'single' && question.allowOther && value && !isKnownChoice\n ? value\n : '',\n skipped: answer?.value === null,\n },\n ];\n })\n );\n}\n\nexport function normalizeQuestionAnswer(\n question: AgentQuestion,\n draft: AgentQuestionDraft\n): AgentQuestionAnswer {\n if (draft.skipped) return { questionId: question.id, value: null };\n\n if (question.type === 'multiple') {\n const values = Array.isArray(draft.value) ? [...draft.value] : [];\n if (draft.otherSelected && draft.otherText.trim()) values.push(draft.otherText.trim());\n return {\n questionId: question.id,\n value: values.length || question.required ? values : null,\n };\n }\n\n if (draft.otherSelected) {\n const other = draft.otherText.trim();\n return { questionId: question.id, value: other || null };\n }\n\n const value = typeof draft.value === 'string' ? draft.value.trim() : '';\n return { questionId: question.id, value: value || null };\n}\n\nexport function validateQuestionDraft(\n question: AgentQuestion,\n draft: AgentQuestionDraft\n): string | undefined {\n if ((question.type === 'single' || question.type === 'multiple') && !question.choices?.length) {\n return 'This question has no available choices.';\n }\n\n if (draft.otherSelected && !draft.otherText.trim()) {\n return 'Enter a response for Other.';\n }\n\n if (!question.required || draft.skipped) return undefined;\n const answer = normalizeQuestionAnswer(question, draft).value;\n const missing = answer === null || (Array.isArray(answer) && answer.length === 0);\n if (!missing) return undefined;\n return question.type === 'text'\n ? 'Enter an answer before continuing.'\n : 'Choose an answer before continuing.';\n}\n\nexport function formatQuestionAnswer(\n question: AgentQuestion,\n answer: AgentQuestionAnswer | undefined\n): string {\n if (!answer || answer.value === null) return 'Skipped';\n const values = Array.isArray(answer.value) ? answer.value : [answer.value];\n const labels = new Map(question.choices?.map(choice => [choice.value, choice.label]) ?? []);\n return values.map(value => labels.get(value) ?? value).join(', ');\n}\n","@import '../../utils/forced-colors.css';\n@import '../../utils/visually-hidden.css';\n\n:host {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.questionnaire {\n display: grid;\n gap: var(--dimension-space-150);\n width: 100%;\n padding: var(--dimension-space-200);\n border-radius: var(--dimension-radius-125);\n background: var(--color-background-primary);\n box-shadow: var(--effect-elevation-elevated-md);\n box-sizing: border-box;\n}\n\n.questionnaire--answered {\n gap: var(--dimension-space-100);\n padding: var(--dimension-space-150);\n background: var(--color-background-secondary);\n box-shadow: none;\n}\n\n.questionnaire--preparing {\n align-items: center;\n grid-template-columns: auto minmax(0, 1fr);\n}\n\n.questionnaire__header,\n.questionnaire__actions,\n.questionnaire__actions-leading,\n.questionnaire__error,\n.questionnaire__submission-error {\n display: flex;\n align-items: center;\n}\n\n.questionnaire__header,\n.questionnaire__actions {\n justify-content: space-between;\n gap: var(--dimension-space-100);\n}\n\n.questionnaire__body,\n.questionnaire__prompt,\n.questionnaire__choices,\n.questionnaire__single-choice,\n.questionnaire__multiple-choice,\n.questionnaire__other-choice,\n.questionnaire__summary,\n.questionnaire__summary li {\n display: grid;\n}\n\n.questionnaire__body,\n.questionnaire__prompt,\n.questionnaire__choices,\n.questionnaire__single-choice,\n.questionnaire__multiple-choice,\n.questionnaire__other-choice {\n gap: var(--dimension-space-100);\n}\n\n.questionnaire__choices {\n min-width: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\nds-radio,\nds-checkbox {\n width: 100%;\n min-width: 0;\n}\n\n.questionnaire__other-input,\n.questionnaire__text-input {\n width: 100%;\n padding: var(--dimension-space-100);\n border: var(--dimension-stroke-width-012) solid var(--color-border-secondary);\n border-radius: var(--dimension-radius-050);\n outline: none;\n background: var(--color-background-primary);\n color: var(--color-foreground-primary);\n font-family: var(--typography-font-family-ui);\n font-size: var(--typography-fontsize-md);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-md);\n letter-spacing: var(--typography-letterspacing-negative-half);\n box-sizing: border-box;\n -webkit-user-select: text;\n user-select: text;\n}\n\n.questionnaire__other-input {\n width: calc(100% - var(--dimension-size-500));\n margin-inline-start: var(--dimension-size-500);\n}\n\n.questionnaire__text-input {\n min-height: calc(var(--typography-lineheight-md) * 4 + var(--dimension-space-200));\n resize: vertical;\n}\n\n.questionnaire__other-input:focus,\n.questionnaire__text-input:focus {\n border-color: var(--color-border-bold-brand);\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-018) var(--color-border-bold-brand);\n}\n\n.questionnaire__other-input[aria-invalid='true'],\n.questionnaire__text-input[aria-invalid='true'] {\n border-color: var(--color-border-bold-negative);\n}\n\n.questionnaire__error,\n.questionnaire__submission-error {\n gap: var(--dimension-space-050);\n color: var(--color-foreground-bold-negative);\n}\n\n.questionnaire__submission-error {\n padding: var(--dimension-space-075);\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-faint-negative);\n}\n\n.questionnaire__actions-leading {\n flex-wrap: wrap;\n gap: var(--dimension-space-075);\n}\n\n.questionnaire__action-item {\n width: fit-content;\n max-width: 100%;\n}\n\n.questionnaire textarea:disabled {\n color: var(--color-foreground-tertiary);\n cursor: default;\n opacity: 1;\n}\n\n.questionnaire__summary {\n gap: var(--dimension-space-100);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.questionnaire__summary li {\n gap: var(--dimension-space-025);\n}\n\n@media (max-width: 480px) {\n .questionnaire {\n padding: var(--dimension-space-150);\n }\n\n .questionnaire__actions {\n align-items: stretch;\n flex-direction: column;\n }\n\n .questionnaire__actions-leading {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n width: 100%;\n }\n\n .questionnaire__action-item,\n .questionnaire__action-item--primary {\n width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n .questionnaire {\n border: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n box-shadow: none;\n }\n\n .questionnaire__other-input[aria-invalid='true'],\n .questionnaire__text-input[aria-invalid='true'] {\n outline: var(--dimension-stroke-width-025) dashed var(--ds-forced-color-content);\n }\n\n .questionnaire__submission-error {\n border: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n background: var(--ds-forced-color-surface);\n }\n\n .questionnaire input:disabled,\n .questionnaire textarea:disabled {\n color: var(--ds-forced-color-disabled);\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type {\n AgentQuestion,\n AgentQuestionAnswer,\n AgentQuestionnaireAnswerEventDetail,\n AgentQuestionnaireCancelEventDetail,\n AgentQuestionnaireLabels,\n AgentQuestionnaireStatus,\n} from '../conversation-types';\nimport {\n createQuestionnaireDrafts,\n formatQuestionAnswer,\n normalizeQuestionAnswer,\n validateQuestionDraft,\n} from './agent-questionnaire-model';\nimport type { AgentQuestionDraft, AgentQuestionDrafts } from './agent-questionnaire-model';\n\nconst DEFAULT_LABELS: AgentQuestionnaireLabels = {\n progress: 'Question {current} of {total}',\n previous: 'Previous',\n next: 'Next',\n answer: 'Answer',\n skip: 'Skip',\n cancel: 'Cancel',\n other: 'Other',\n otherPlaceholder: 'Enter another answer',\n preparing: 'Preparing questions…',\n};\n\nlet questionnaireId = 0;\n\n@Component({\n tag: 'ds-agent-questionnaire',\n styleUrl: 'AgentQuestionnaire.css',\n scoped: true,\n})\nexport class AgentQuestionnaire {\n @Element() el!: HTMLElement;\n\n @Prop() requestId!: string;\n @Prop() questions!: AgentQuestion[];\n @Prop() answers: AgentQuestionAnswer[] = [];\n @Prop() status: AgentQuestionnaireStatus = 'ready';\n @Prop() errorMessage?: string;\n @Prop() allowCancel: boolean = false;\n @Prop() labels?: Partial<AgentQuestionnaireLabels>;\n\n @Event() dsAnswer!: EventEmitter<AgentQuestionnaireAnswerEventDetail>;\n @Event() dsCancel!: EventEmitter<AgentQuestionnaireCancelEventDetail>;\n\n @State() private currentStep = 0;\n @State() private drafts: AgentQuestionDrafts = {};\n @State() private validation: Record<string, string> = {};\n\n private readonly instanceId = ++questionnaireId;\n private readonly otherValue = `__ds-agent-questionnaire-other-${this.instanceId}`;\n private answerPending = false;\n private resetScheduled = false;\n private draftRequestId?: string;\n private answersSnapshot: AgentQuestionAnswer[] = [];\n private waitingForRequestAnswers = false;\n\n componentWillLoad() {\n this.draftRequestId = this.requestId;\n this.answersSnapshot = this.answers;\n this.resetDraft();\n }\n\n @Watch('requestId')\n @Watch('questions')\n @Watch('answers')\n handleQuestionnaireInputChange() {\n this.scheduleDraftReset();\n }\n\n @Watch('status')\n handleStatusChange(status: AgentQuestionnaireStatus) {\n if (status !== 'submitting') this.answerPending = false;\n }\n\n @Method()\n async setFocus(): Promise<void> {\n this.focusCurrentControl();\n }\n\n private get copy(): AgentQuestionnaireLabels {\n return { ...DEFAULT_LABELS, ...this.labels };\n }\n\n private get disabled(): boolean {\n return this.status === 'submitting';\n }\n\n private resetDraft(answers = this.answers) {\n this.currentStep = 0;\n this.drafts = createQuestionnaireDrafts(this.questions ?? [], answers ?? []);\n this.validation = {};\n this.answerPending = false;\n }\n\n private scheduleDraftReset() {\n if (this.resetScheduled) return;\n this.resetScheduled = true;\n queueMicrotask(() => {\n this.resetScheduled = false;\n const requestChanged = this.requestId !== this.draftRequestId;\n const answersChanged = this.answers !== this.answersSnapshot;\n if (requestChanged && !answersChanged) {\n this.waitingForRequestAnswers = true;\n } else if (answersChanged) {\n this.waitingForRequestAnswers = false;\n }\n this.resetDraft(this.waitingForRequestAnswers ? [] : this.answers);\n this.draftRequestId = this.requestId;\n this.answersSnapshot = this.answers;\n });\n }\n\n private focusCurrentControl(preferInvalid = false) {\n const focus = () => {\n const invalidControl = preferInvalid\n ? this.el.querySelector<HTMLElement>(\n '[data-question-control][aria-invalid=\"true\"]:not([disabled])'\n )\n : null;\n const control =\n invalidControl ??\n this.el.querySelector<HTMLElement>(\n '[data-question-control]:not([disabled]):not([is-inactive])'\n );\n const action = this.el.querySelector<HTMLElement>(\n '[data-question-action]:not([is-inactive]):not([is-loading])'\n );\n const target = (control ?? action) as\n | (HTMLElement & { setFocus?: () => Promise<void> })\n | null;\n if (target?.setFocus) void target.setFocus();\n else target?.focus();\n };\n focus();\n requestAnimationFrame(focus);\n setTimeout(focus, 0);\n }\n\n private updateDraft(questionId: string, update: Partial<AgentQuestionDraft>) {\n const previous = this.drafts[questionId] ?? {\n value: '',\n otherSelected: false,\n otherText: '',\n skipped: false,\n };\n this.drafts = {\n ...this.drafts,\n [questionId]: { ...previous, ...update, skipped: false },\n };\n if (this.validation[questionId]) {\n const { [questionId]: _removed, ...rest } = this.validation;\n this.validation = rest;\n }\n }\n\n private validate(question: AgentQuestion): boolean {\n const message = validateQuestionDraft(question, this.drafts[question.id]);\n if (!message) return true;\n this.validation = { ...this.validation, [question.id]: message };\n this.focusCurrentControl(true);\n return false;\n }\n\n private move(step: number) {\n this.currentStep = Math.min(Math.max(step, 0), this.questions.length - 1);\n this.focusCurrentControl();\n }\n\n private next(question: AgentQuestion) {\n if (!this.validate(question)) return;\n this.move(this.currentStep + 1);\n }\n\n private skip(question: AgentQuestion) {\n if (question.required) return;\n this.drafts = {\n ...this.drafts,\n [question.id]: {\n ...(this.drafts[question.id] ?? {\n value: '',\n otherSelected: false,\n otherText: '',\n }),\n skipped: true,\n },\n };\n if (this.currentStep < this.questions.length - 1) this.move(this.currentStep + 1);\n else this.submit();\n }\n\n private submit() {\n if (this.disabled || this.answerPending) return;\n const invalidIndex = this.questions.findIndex(question => !this.validateWithoutFocus(question));\n if (invalidIndex >= 0) {\n this.currentStep = invalidIndex;\n this.focusCurrentControl(true);\n return;\n }\n\n this.answerPending = true;\n this.dsAnswer.emit({\n requestId: this.requestId,\n answers: this.questions.map(question =>\n normalizeQuestionAnswer(question, this.drafts[question.id])\n ),\n });\n }\n\n private validateWithoutFocus(question: AgentQuestion): boolean {\n const message = validateQuestionDraft(question, this.drafts[question.id]);\n if (!message) return true;\n this.validation = { ...this.validation, [question.id]: message };\n return false;\n }\n\n private progressLabel(): string {\n return this.copy.progress\n .split('{current}')\n .join(String(this.currentStep + 1))\n .split('{total}')\n .join(String(this.questions.length));\n }\n\n private selectSingle(question: AgentQuestion, value: string) {\n const otherSelected = value === this.otherValue;\n this.updateDraft(question.id, {\n value: otherSelected ? '' : value,\n otherSelected,\n });\n if (otherSelected) {\n requestAnimationFrame(() =>\n this.el.querySelector<HTMLInputElement>('[data-question-other-input]')?.focus()\n );\n }\n }\n\n private renderSingleChoice(question: AgentQuestion, promptId: string, errorId: string) {\n const draft = this.drafts[question.id];\n const value = draft.otherSelected\n ? this.otherValue\n : typeof draft.value === 'string'\n ? draft.value\n : '';\n const options = [\n ...(question.choices ?? []),\n ...(question.allowOther ? [{ value: this.otherValue, label: this.copy.other }] : []),\n ];\n return (\n <div class=\"questionnaire__single-choice\">\n <ds-radio\n data-question-control\n size=\"lg\"\n options={options}\n value={value}\n disabled={this.disabled}\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n ariaLabelledby={promptId}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n onDsChange={(event: CustomEvent<string>) => this.selectSingle(question, event.detail)}\n />\n {draft.otherSelected ? this.renderOtherInput(question, errorId) : null}\n </div>\n );\n }\n\n private renderMultipleChoice(question: AgentQuestion, errorId: string) {\n const draft = this.drafts[question.id];\n const values = Array.isArray(draft.value) ? draft.value : [];\n const detachedForm = `ds-agent-questionnaire-detached-${this.instanceId}`;\n return (\n <div class=\"questionnaire__multiple-choice\">\n {question.choices?.map(choice => (\n <ds-checkbox\n key={choice.value}\n data-question-control\n size=\"lg\"\n label={choice.label}\n description={choice.description}\n value={choice.value}\n checked={values.includes(choice.value)}\n disabled={this.disabled}\n form={detachedForm}\n onDsChange={(event: CustomEvent<boolean>) => {\n this.updateDraft(question.id, {\n value: event.detail\n ? [...values, choice.value]\n : values.filter(value => value !== choice.value),\n });\n }}\n />\n ))}\n {question.allowOther ? (\n <div class=\"questionnaire__other-choice\">\n <ds-checkbox\n data-question-control\n size=\"lg\"\n label={this.copy.other}\n checked={draft.otherSelected}\n disabled={this.disabled}\n form={detachedForm}\n onDsChange={(event: CustomEvent<boolean>) => {\n this.updateDraft(question.id, { otherSelected: event.detail });\n if (event.detail) {\n requestAnimationFrame(() =>\n this.el.querySelector<HTMLInputElement>('[data-question-other-input]')?.focus()\n );\n }\n }}\n />\n {draft.otherSelected ? this.renderOtherInput(question, errorId) : null}\n </div>\n ) : null}\n </div>\n );\n }\n\n private renderOtherInput(question: AgentQuestion, errorId: string) {\n const draft = this.drafts[question.id];\n return (\n <input\n class=\"questionnaire__other-input\"\n data-question-control\n data-question-other-input\n type=\"text\"\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n value={draft.otherText}\n placeholder={this.copy.otherPlaceholder}\n aria-label={this.copy.other}\n aria-invalid={this.validation[question.id] ? 'true' : undefined}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n disabled={this.disabled}\n onInput={(event: Event) =>\n this.updateDraft(question.id, {\n otherText: (event.target as HTMLInputElement).value,\n })\n }\n />\n );\n }\n\n private renderQuestion(question: AgentQuestion) {\n const draft = this.drafts[question.id];\n const errorId = `ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-error`;\n const promptId = `ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-prompt`;\n return (\n <div class=\"questionnaire__body\">\n <div class=\"questionnaire__prompt\">\n <ds-text as=\"h2\" variant=\"text-title-small\" textId={promptId}>\n {question.question}\n </ds-text>\n {question.description ? (\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {question.description}\n </ds-text>\n ) : null}\n </div>\n {question.type === 'text' ? (\n <textarea\n class=\"questionnaire__text-input\"\n data-question-control\n value={typeof draft.value === 'string' ? draft.value : ''}\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n placeholder={question.placeholder}\n aria-label={question.question}\n aria-invalid={this.validation[question.id] ? 'true' : undefined}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n disabled={this.disabled}\n rows={4}\n onInput={(event: Event) =>\n this.updateDraft(question.id, {\n value: (event.target as HTMLTextAreaElement).value,\n })\n }\n />\n ) : (\n <fieldset\n class=\"questionnaire__choices\"\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n >\n <legend class=\"ds-visually-hidden\">{question.question}</legend>\n {question.type === 'single'\n ? this.renderSingleChoice(question, promptId, errorId)\n : this.renderMultipleChoice(question, errorId)}\n </fieldset>\n )}\n {this.validation[question.id] ? (\n <div id={errorId} class=\"questionnaire__error\" role=\"alert\">\n <ds-icon name=\"ExclamationTriangle\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" color=\"negative\">\n {this.validation[question.id]}\n </ds-text>\n </div>\n ) : null}\n </div>\n );\n }\n\n private renderAnswered() {\n return (\n <div class=\"questionnaire questionnaire--answered\">\n <ol class=\"questionnaire__summary\">\n {this.questions.map(question => (\n <li>\n <ds-text variant=\"text-body-small\" emphasis>\n {question.question}\n </ds-text>\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {formatQuestionAnswer(\n question,\n this.answers.find(answer => answer.questionId === question.id)\n )}\n </ds-text>\n </li>\n ))}\n </ol>\n </div>\n );\n }\n\n render() {\n if (this.status === 'preparing') {\n return (\n <Host>\n <div class=\"questionnaire questionnaire--preparing\" role=\"status\">\n <ds-loader size=\"sm\" />\n <ds-text variant=\"text-body-medium\">{this.copy.preparing}</ds-text>\n </div>\n </Host>\n );\n }\n if (!this.questions?.length) return null;\n if (this.status === 'answered') return <Host>{this.renderAnswered()}</Host>;\n\n const question = this.questions[this.currentStep];\n const last = this.currentStep === this.questions.length - 1;\n const canSkip = Boolean(question.skippable && !question.required);\n return (\n <Host>\n <section\n class={{\n questionnaire: true,\n 'questionnaire--submitting': this.disabled,\n 'questionnaire--error': this.status === 'error',\n }}\n aria-busy={this.disabled ? 'true' : undefined}\n aria-label={question.question}\n >\n <header class=\"questionnaire__header\">\n <ds-text variant=\"text-caption\" color=\"secondary\">\n {this.progressLabel()}\n </ds-text>\n {this.allowCancel ? (\n <ds-tooltip label={this.copy.cancel} side=\"top\" size=\"sm\">\n <ds-button-unfilled\n data-question-action\n variant=\"icon\"\n icon=\"Cross\"\n size=\"sm\"\n aria-label={this.copy.cancel}\n hasBorder={false}\n isInactive={this.disabled}\n onDsClick={() => this.dsCancel.emit({ requestId: this.requestId })}\n />\n </ds-tooltip>\n ) : null}\n </header>\n {this.renderQuestion(question)}\n {this.status === 'error' && this.errorMessage ? (\n <div class=\"questionnaire__submission-error\" role=\"alert\">\n <ds-icon name=\"ExclamationTriangle\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" color=\"negative\">\n {this.errorMessage}\n </ds-text>\n </div>\n ) : null}\n <footer class=\"questionnaire__actions\">\n <div class=\"questionnaire__actions-leading\">\n {this.currentStep > 0 ? (\n <div class=\"questionnaire__action-item\">\n <ds-button-unfilled\n data-question-action\n label={this.copy.previous}\n size=\"sm\"\n width=\"fill\"\n isInactive={this.disabled}\n onDsClick={() => this.move(this.currentStep - 1)}\n />\n </div>\n ) : null}\n {canSkip ? (\n <div class=\"questionnaire__action-item\">\n <ds-button-unfilled\n data-question-action\n label={this.copy.skip}\n size=\"sm\"\n width=\"fill\"\n hasBorder={false}\n isInactive={this.disabled}\n onDsClick={() => this.skip(question)}\n />\n </div>\n ) : null}\n </div>\n <div class=\"questionnaire__action-item questionnaire__action-item--primary\">\n <ds-button-filled\n data-question-action\n label={last ? this.copy.answer : this.copy.next}\n size=\"sm\"\n width=\"fill\"\n isLoading={this.disabled}\n onDsClick={() => (last ? this.submit() : this.next(question))}\n />\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n"],"mappings":"iYAWA,SAASA,EACPC,EACAC,GAEA,OAAOD,EAAQE,MAAKC,GAAUA,EAAOF,aAAeA,GACtD,CAEM,SAAUG,EACdC,EACAL,GAEA,OAAOM,OAAOC,YACZF,EAAUG,KAAIC,IACZ,MAAMN,EAASJ,EAAUC,EAASS,EAASC,IAC3C,MAAMC,EAAe,IAAIC,IAAIH,EAASI,SAASL,KAAIM,GAAUA,EAAOC,SAAU,IAE9E,GAAIN,EAASO,OAAS,WAAY,CAChC,MAAMC,EAASC,MAAMC,Q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UAAW,IAAMlG,KAAK0C,KAAK1C,KAAKG,YAAc,MAGhD,KACHwF,EACC9B,EAAA,OAAKC,MAAM,8BACTD,EAAA,kDAEE/E,MAAOkB,KAAKqB,KAAK/B,KACjByE,KAAK,KACLsC,MAAM,OACNL,UAAW,MACXC,WAAYjG,KAAKsB,SACjB4E,UAAW,IAAMlG,KAAKV,KAAKzC,MAG7B,MAENgH,EAAA,OAAKC,MAAM,kEACTD,EAAA,gDAEE/E,MAAO4G,EAAO1F,KAAKqB,KAAK9E,OAASyD,KAAKqB,KAAKhC,KAC3C0E,KAAK,KACLsC,MAAM,OACNC,UAAWtG,KAAKsB,SAChB4E,UAAW,IAAOR,EAAO1F,KAAK+C,SAAW/C,KAAKX,KAAKxC,Q","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["answerFor","answers","questionId","find","answer","createQuestionnaireDrafts","questions","Object","fromEntries","map","question","id","choiceValues","Set","choices","choice","value","type","values","Array","isArray","known","filter","has","other","otherSelected","Boolean","allowOther","otherText","skipped","isKnownChoice","normalizeQuestionAnswer","draft","trim","push","length","required","validateQuestionDraft","undefined","missing","formatQuestionAnswer","labels","Map","label","get","join","agentQuestionnaireCss","DEFAULT_LABELS","progress","previous","next","skip","cancel","otherPlaceholder","preparing","questionnaireId","AgentQuestionnaire","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","status","allowCancel","currentStep","drafts","validation","instanceId","otherValue","answerPending","resetScheduled","answersSnapshot","waitingForRequestAnswers","componentWillLoad","draftRequestId","requestId","resetDraft","handleQuestionnaireInputChange","scheduleDraftReset","handleStatusChange","setFocus","focusCurrentControl","copy","disabled","queueMicrotask","requestChanged","answersChanged","preferInvalid","focus","invalidControl","el","querySelector","control","action","target","requestAnimationFrame","setTimeout","updateDraft","update","_removed","rest","validate","message","move","step","Math","min","max","submit","invalidIndex","findIndex","validateWithoutFocus","dsAnswer","emit","progressLabel","split","String","selectSingle","renderSingleChoice","promptId","errorId","options","h","class","size","form","ariaLabelledby","onDsChange","event","detail","renderOtherInput","renderMultipleChoice","detachedForm","key","description","checked","includes","placeholder","onInput","renderQuestion","as","variant","textId","color","rows","role","name","renderAnswered","emphasis","render","Host","last","canSkip","skippable","questionnaire","side","icon","hasBorder","isInactive","onDsClick","dsCancel","errorMessage","width","isLoading"],"sources":["src/wc/components/AgentQuestionnaire/agent-questionnaire-model.ts","src/wc/components/AgentQuestionnaire/AgentQuestionnaire.css?tag=ds-agent-questionnaire&encapsulation=scoped","src/wc/components/AgentQuestionnaire/AgentQuestionnaire.tsx"],"sourcesContent":["import type { AgentQuestion, AgentQuestionAnswer } from '../conversation-types';\n\nexport interface AgentQuestionDraft {\n value: string | string[];\n otherSelected: boolean;\n otherText: string;\n skipped: boolean;\n}\n\nexport type AgentQuestionDrafts = Record<string, AgentQuestionDraft>;\n\nfunction answerFor(\n answers: AgentQuestionAnswer[],\n questionId: string\n): AgentQuestionAnswer | undefined {\n return answers.find(answer => answer.questionId === questionId);\n}\n\nexport function createQuestionnaireDrafts(\n questions: AgentQuestion[],\n answers: AgentQuestionAnswer[]\n): AgentQuestionDrafts {\n return Object.fromEntries(\n questions.map(question => {\n const answer = answerFor(answers, question.id);\n const choiceValues = new Set(question.choices?.map(choice => choice.value) ?? []);\n\n if (question.type === 'multiple') {\n const values = Array.isArray(answer?.value) ? answer.value : [];\n const known = values.filter(value => choiceValues.has(value));\n const other = values.find(value => !choiceValues.has(value)) ?? '';\n return [\n question.id,\n {\n value: known,\n otherSelected: Boolean(question.allowOther && other),\n otherText: question.allowOther ? other : '',\n skipped: answer?.value === null,\n },\n ];\n }\n\n const value = typeof answer?.value === 'string' ? answer.value : '';\n const isKnownChoice = question.type === 'single' && choiceValues.has(value);\n return [\n question.id,\n {\n value: question.type === 'single' && !isKnownChoice ? '' : value,\n otherSelected: Boolean(\n question.type === 'single' && question.allowOther && value && !isKnownChoice\n ),\n otherText:\n question.type === 'single' && question.allowOther && value && !isKnownChoice\n ? value\n : '',\n skipped: answer?.value === null,\n },\n ];\n })\n );\n}\n\nexport function normalizeQuestionAnswer(\n question: AgentQuestion,\n draft: AgentQuestionDraft\n): AgentQuestionAnswer {\n if (draft.skipped) return { questionId: question.id, value: null };\n\n if (question.type === 'multiple') {\n const values = Array.isArray(draft.value) ? [...draft.value] : [];\n if (draft.otherSelected && draft.otherText.trim()) values.push(draft.otherText.trim());\n return {\n questionId: question.id,\n value: values.length || question.required ? values : null,\n };\n }\n\n if (draft.otherSelected) {\n const other = draft.otherText.trim();\n return { questionId: question.id, value: other || null };\n }\n\n const value = typeof draft.value === 'string' ? draft.value.trim() : '';\n return { questionId: question.id, value: value || null };\n}\n\nexport function validateQuestionDraft(\n question: AgentQuestion,\n draft: AgentQuestionDraft\n): string | undefined {\n if ((question.type === 'single' || question.type === 'multiple') && !question.choices?.length) {\n return 'This question has no available choices.';\n }\n\n if (draft.otherSelected && !draft.otherText.trim()) {\n return 'Enter a response for Other.';\n }\n\n if (!question.required || draft.skipped) return undefined;\n const answer = normalizeQuestionAnswer(question, draft).value;\n const missing = answer === null || (Array.isArray(answer) && answer.length === 0);\n if (!missing) return undefined;\n return question.type === 'text'\n ? 'Enter an answer before continuing.'\n : 'Choose an answer before continuing.';\n}\n\nexport function formatQuestionAnswer(\n question: AgentQuestion,\n answer: AgentQuestionAnswer | undefined\n): string {\n if (!answer || answer.value === null) return 'Skipped';\n const values = Array.isArray(answer.value) ? answer.value : [answer.value];\n const labels = new Map(question.choices?.map(choice => [choice.value, choice.label]) ?? []);\n return values.map(value => labels.get(value) ?? value).join(', ');\n}\n","@import '../../utils/forced-colors.css';\n@import '../../utils/visually-hidden.css';\n\n:host {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.questionnaire {\n display: grid;\n gap: var(--dimension-space-150);\n width: 100%;\n padding: var(--dimension-space-200);\n border-radius: var(--dimension-radius-125);\n background: var(--color-background-primary);\n box-shadow: var(--effect-elevation-elevated-md);\n box-sizing: border-box;\n}\n\n.questionnaire--answered {\n gap: var(--dimension-space-100);\n padding: var(--dimension-space-150);\n background: var(--color-background-secondary);\n box-shadow: none;\n}\n\n.questionnaire--preparing {\n align-items: center;\n grid-template-columns: auto minmax(0, 1fr);\n}\n\n.questionnaire__header,\n.questionnaire__actions,\n.questionnaire__actions-leading,\n.questionnaire__error,\n.questionnaire__submission-error {\n display: flex;\n align-items: center;\n}\n\n.questionnaire__header,\n.questionnaire__actions {\n justify-content: space-between;\n gap: var(--dimension-space-100);\n}\n\n.questionnaire__body,\n.questionnaire__prompt,\n.questionnaire__choices,\n.questionnaire__single-choice,\n.questionnaire__multiple-choice,\n.questionnaire__other-choice,\n.questionnaire__summary,\n.questionnaire__summary li {\n display: grid;\n}\n\n.questionnaire__body,\n.questionnaire__prompt,\n.questionnaire__choices,\n.questionnaire__single-choice,\n.questionnaire__multiple-choice,\n.questionnaire__other-choice {\n gap: var(--dimension-space-100);\n}\n\n.questionnaire__choices {\n min-width: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\nds-radio,\nds-checkbox {\n width: 100%;\n min-width: 0;\n}\n\n.questionnaire__other-input,\n.questionnaire__text-input {\n width: 100%;\n padding: var(--dimension-space-100);\n border: var(--dimension-stroke-width-012) solid var(--color-border-secondary);\n border-radius: var(--dimension-radius-050);\n outline: none;\n background: var(--color-background-primary);\n color: var(--color-foreground-primary);\n font-family: var(--typography-font-family-ui);\n font-size: var(--typography-fontsize-md);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-md);\n letter-spacing: var(--typography-letterspacing-negative-half);\n box-sizing: border-box;\n -webkit-user-select: text;\n user-select: text;\n}\n\n.questionnaire__other-input {\n width: calc(100% - var(--dimension-size-500));\n margin-inline-start: var(--dimension-size-500);\n}\n\n.questionnaire__text-input {\n min-height: calc(var(--typography-lineheight-md) * 4 + var(--dimension-space-200));\n resize: vertical;\n}\n\n.questionnaire__other-input:focus,\n.questionnaire__text-input:focus {\n border-color: var(--color-border-bold-brand);\n box-shadow: inset 0 0 0 var(--dimension-stroke-width-018) var(--color-border-bold-brand);\n}\n\n.questionnaire__other-input[aria-invalid='true'],\n.questionnaire__text-input[aria-invalid='true'] {\n border-color: var(--color-border-bold-negative);\n}\n\n.questionnaire__error,\n.questionnaire__submission-error {\n gap: var(--dimension-space-050);\n color: var(--color-foreground-bold-negative);\n}\n\n.questionnaire__submission-error {\n padding: var(--dimension-space-075);\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-faint-negative);\n}\n\n.questionnaire__actions-leading {\n flex-wrap: wrap;\n gap: var(--dimension-space-075);\n}\n\n.questionnaire__action-item {\n width: fit-content;\n max-width: 100%;\n}\n\n.questionnaire textarea:disabled {\n color: var(--color-foreground-tertiary);\n cursor: default;\n opacity: 1;\n}\n\n.questionnaire__summary {\n gap: var(--dimension-space-100);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.questionnaire__summary li {\n gap: var(--dimension-space-025);\n}\n\n@media (max-width: 480px) {\n .questionnaire {\n padding: var(--dimension-space-150);\n }\n\n .questionnaire__actions {\n align-items: stretch;\n flex-direction: column;\n }\n\n .questionnaire__actions-leading {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n width: 100%;\n }\n\n .questionnaire__action-item,\n .questionnaire__action-item--primary {\n width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n .questionnaire {\n border: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n box-shadow: none;\n }\n\n .questionnaire__other-input[aria-invalid='true'],\n .questionnaire__text-input[aria-invalid='true'] {\n outline: var(--dimension-stroke-width-025) dashed var(--ds-forced-color-content);\n }\n\n .questionnaire__submission-error {\n border: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n background: var(--ds-forced-color-surface);\n }\n\n .questionnaire input:disabled,\n .questionnaire textarea:disabled {\n color: var(--ds-forced-color-disabled);\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type {\n AgentQuestion,\n AgentQuestionAnswer,\n AgentQuestionnaireAnswerEventDetail,\n AgentQuestionnaireCancelEventDetail,\n AgentQuestionnaireLabels,\n AgentQuestionnaireStatus,\n} from '../conversation-types';\nimport {\n createQuestionnaireDrafts,\n formatQuestionAnswer,\n normalizeQuestionAnswer,\n validateQuestionDraft,\n} from './agent-questionnaire-model';\nimport type { AgentQuestionDraft, AgentQuestionDrafts } from './agent-questionnaire-model';\n\nconst DEFAULT_LABELS: AgentQuestionnaireLabels = {\n progress: 'Question {current} of {total}',\n previous: 'Previous',\n next: 'Next',\n answer: 'Answer',\n skip: 'Skip',\n cancel: 'Cancel',\n other: 'Other',\n otherPlaceholder: 'Enter another answer',\n preparing: 'Preparing questions…',\n};\n\nlet questionnaireId = 0;\n\n@Component({\n tag: 'ds-agent-questionnaire',\n styleUrl: 'AgentQuestionnaire.css',\n scoped: true,\n})\nexport class AgentQuestionnaire {\n @Element() el!: HTMLElement;\n\n @Prop() requestId!: string;\n @Prop() questions!: AgentQuestion[];\n @Prop() answers: AgentQuestionAnswer[] = [];\n @Prop() status: AgentQuestionnaireStatus = 'ready';\n @Prop() errorMessage?: string;\n @Prop() allowCancel: boolean = false;\n @Prop() labels?: Partial<AgentQuestionnaireLabels>;\n\n @Event() dsAnswer!: EventEmitter<AgentQuestionnaireAnswerEventDetail>;\n @Event() dsCancel!: EventEmitter<AgentQuestionnaireCancelEventDetail>;\n\n @State() private currentStep = 0;\n @State() private drafts: AgentQuestionDrafts = {};\n @State() private validation: Record<string, string> = {};\n\n private readonly instanceId = ++questionnaireId;\n private readonly otherValue = `__ds-agent-questionnaire-other-${this.instanceId}`;\n private answerPending = false;\n private resetScheduled = false;\n private draftRequestId?: string;\n private answersSnapshot: AgentQuestionAnswer[] = [];\n private waitingForRequestAnswers = false;\n\n componentWillLoad() {\n this.draftRequestId = this.requestId;\n this.answersSnapshot = this.answers;\n this.resetDraft();\n }\n\n @Watch('requestId')\n @Watch('questions')\n @Watch('answers')\n handleQuestionnaireInputChange() {\n this.scheduleDraftReset();\n }\n\n @Watch('status')\n handleStatusChange(status: AgentQuestionnaireStatus) {\n if (status !== 'submitting') this.answerPending = false;\n }\n\n @Method()\n async setFocus(): Promise<void> {\n this.focusCurrentControl();\n }\n\n private get copy(): AgentQuestionnaireLabels {\n return { ...DEFAULT_LABELS, ...this.labels };\n }\n\n private get disabled(): boolean {\n return this.status === 'submitting';\n }\n\n private resetDraft(answers = this.answers) {\n this.currentStep = 0;\n this.drafts = createQuestionnaireDrafts(this.questions ?? [], answers ?? []);\n this.validation = {};\n this.answerPending = false;\n }\n\n private scheduleDraftReset() {\n if (this.resetScheduled) return;\n this.resetScheduled = true;\n queueMicrotask(() => {\n this.resetScheduled = false;\n const requestChanged = this.requestId !== this.draftRequestId;\n const answersChanged = this.answers !== this.answersSnapshot;\n if (requestChanged && !answersChanged) {\n this.waitingForRequestAnswers = true;\n } else if (answersChanged) {\n this.waitingForRequestAnswers = false;\n }\n this.resetDraft(this.waitingForRequestAnswers ? [] : this.answers);\n this.draftRequestId = this.requestId;\n this.answersSnapshot = this.answers;\n });\n }\n\n private focusCurrentControl(preferInvalid = false) {\n const focus = () => {\n const invalidControl = preferInvalid\n ? this.el.querySelector<HTMLElement>(\n '[data-question-control][aria-invalid=\"true\"]:not([disabled])'\n )\n : null;\n const control =\n invalidControl ??\n this.el.querySelector<HTMLElement>(\n '[data-question-control]:not([disabled]):not([is-inactive])'\n );\n const action = this.el.querySelector<HTMLElement>(\n '[data-question-action]:not([is-inactive]):not([is-loading])'\n );\n const target = (control ?? action) as\n | (HTMLElement & { setFocus?: () => Promise<void> })\n | null;\n if (target?.setFocus) void target.setFocus();\n else target?.focus();\n };\n focus();\n requestAnimationFrame(focus);\n setTimeout(focus, 0);\n }\n\n private updateDraft(questionId: string, update: Partial<AgentQuestionDraft>) {\n const previous = this.drafts[questionId] ?? {\n value: '',\n otherSelected: false,\n otherText: '',\n skipped: false,\n };\n this.drafts = {\n ...this.drafts,\n [questionId]: { ...previous, ...update, skipped: false },\n };\n if (this.validation[questionId]) {\n const { [questionId]: _removed, ...rest } = this.validation;\n this.validation = rest;\n }\n }\n\n private validate(question: AgentQuestion): boolean {\n const message = validateQuestionDraft(question, this.drafts[question.id]);\n if (!message) return true;\n this.validation = { ...this.validation, [question.id]: message };\n this.focusCurrentControl(true);\n return false;\n }\n\n private move(step: number) {\n this.currentStep = Math.min(Math.max(step, 0), this.questions.length - 1);\n this.focusCurrentControl();\n }\n\n private next(question: AgentQuestion) {\n if (!this.validate(question)) return;\n this.move(this.currentStep + 1);\n }\n\n private skip(question: AgentQuestion) {\n if (question.required) return;\n this.drafts = {\n ...this.drafts,\n [question.id]: {\n ...(this.drafts[question.id] ?? {\n value: '',\n otherSelected: false,\n otherText: '',\n }),\n skipped: true,\n },\n };\n if (this.currentStep < this.questions.length - 1) this.move(this.currentStep + 1);\n else this.submit();\n }\n\n private submit() {\n if (this.disabled || this.answerPending) return;\n const invalidIndex = this.questions.findIndex(question => !this.validateWithoutFocus(question));\n if (invalidIndex >= 0) {\n this.currentStep = invalidIndex;\n this.focusCurrentControl(true);\n return;\n }\n\n this.answerPending = true;\n this.dsAnswer.emit({\n requestId: this.requestId,\n answers: this.questions.map(question =>\n normalizeQuestionAnswer(question, this.drafts[question.id])\n ),\n });\n }\n\n private validateWithoutFocus(question: AgentQuestion): boolean {\n const message = validateQuestionDraft(question, this.drafts[question.id]);\n if (!message) return true;\n this.validation = { ...this.validation, [question.id]: message };\n return false;\n }\n\n private progressLabel(): string {\n return this.copy.progress\n .split('{current}')\n .join(String(this.currentStep + 1))\n .split('{total}')\n .join(String(this.questions.length));\n }\n\n private selectSingle(question: AgentQuestion, value: string) {\n const otherSelected = value === this.otherValue;\n this.updateDraft(question.id, {\n value: otherSelected ? '' : value,\n otherSelected,\n });\n if (otherSelected) {\n requestAnimationFrame(() =>\n this.el.querySelector<HTMLInputElement>('[data-question-other-input]')?.focus()\n );\n }\n }\n\n private renderSingleChoice(question: AgentQuestion, promptId: string, errorId: string) {\n const draft = this.drafts[question.id];\n const value = draft.otherSelected\n ? this.otherValue\n : typeof draft.value === 'string'\n ? draft.value\n : '';\n const options = [\n ...(question.choices ?? []),\n ...(question.allowOther ? [{ value: this.otherValue, label: this.copy.other }] : []),\n ];\n return (\n <div class=\"questionnaire__single-choice\">\n <ds-radio\n data-question-control\n size=\"lg\"\n options={options}\n value={value}\n disabled={this.disabled}\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n ariaLabelledby={promptId}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n onDsChange={(event: CustomEvent<string>) => this.selectSingle(question, event.detail)}\n />\n {draft.otherSelected ? this.renderOtherInput(question, errorId) : null}\n </div>\n );\n }\n\n private renderMultipleChoice(question: AgentQuestion, errorId: string) {\n const draft = this.drafts[question.id];\n const values = Array.isArray(draft.value) ? draft.value : [];\n const detachedForm = `ds-agent-questionnaire-detached-${this.instanceId}`;\n return (\n <div class=\"questionnaire__multiple-choice\">\n {question.choices?.map(choice => (\n <ds-checkbox\n key={choice.value}\n data-question-control\n size=\"lg\"\n label={choice.label}\n description={choice.description}\n value={choice.value}\n checked={values.includes(choice.value)}\n disabled={this.disabled}\n form={detachedForm}\n onDsChange={(event: CustomEvent<boolean>) => {\n this.updateDraft(question.id, {\n value: event.detail\n ? [...values, choice.value]\n : values.filter(value => value !== choice.value),\n });\n }}\n />\n ))}\n {question.allowOther ? (\n <div class=\"questionnaire__other-choice\">\n <ds-checkbox\n data-question-control\n size=\"lg\"\n label={this.copy.other}\n checked={draft.otherSelected}\n disabled={this.disabled}\n form={detachedForm}\n onDsChange={(event: CustomEvent<boolean>) => {\n this.updateDraft(question.id, { otherSelected: event.detail });\n if (event.detail) {\n requestAnimationFrame(() =>\n this.el.querySelector<HTMLInputElement>('[data-question-other-input]')?.focus()\n );\n }\n }}\n />\n {draft.otherSelected ? this.renderOtherInput(question, errorId) : null}\n </div>\n ) : null}\n </div>\n );\n }\n\n private renderOtherInput(question: AgentQuestion, errorId: string) {\n const draft = this.drafts[question.id];\n return (\n <input\n class=\"questionnaire__other-input\"\n data-question-control\n data-question-other-input\n type=\"text\"\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n value={draft.otherText}\n placeholder={this.copy.otherPlaceholder}\n aria-label={this.copy.other}\n aria-invalid={this.validation[question.id] ? 'true' : undefined}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n disabled={this.disabled}\n onInput={(event: Event) =>\n this.updateDraft(question.id, {\n otherText: (event.target as HTMLInputElement).value,\n })\n }\n />\n );\n }\n\n private renderQuestion(question: AgentQuestion) {\n const draft = this.drafts[question.id];\n const errorId = `ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-error`;\n const promptId = `ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-prompt`;\n return (\n <div class=\"questionnaire__body\">\n <div class=\"questionnaire__prompt\">\n <ds-text as=\"h2\" variant=\"text-title-small\" textId={promptId}>\n {question.question}\n </ds-text>\n {question.description ? (\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {question.description}\n </ds-text>\n ) : null}\n </div>\n {question.type === 'text' ? (\n <textarea\n class=\"questionnaire__text-input\"\n data-question-control\n value={typeof draft.value === 'string' ? draft.value : ''}\n form={`ds-agent-questionnaire-detached-${this.instanceId}`}\n placeholder={question.placeholder}\n aria-label={question.question}\n aria-invalid={this.validation[question.id] ? 'true' : undefined}\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n disabled={this.disabled}\n rows={4}\n onInput={(event: Event) =>\n this.updateDraft(question.id, {\n value: (event.target as HTMLTextAreaElement).value,\n })\n }\n />\n ) : (\n <fieldset\n class=\"questionnaire__choices\"\n aria-describedby={this.validation[question.id] ? errorId : undefined}\n >\n <legend class=\"ds-visually-hidden\">{question.question}</legend>\n {question.type === 'single'\n ? this.renderSingleChoice(question, promptId, errorId)\n : this.renderMultipleChoice(question, errorId)}\n </fieldset>\n )}\n {this.validation[question.id] ? (\n <div id={errorId} class=\"questionnaire__error\" role=\"alert\">\n <ds-icon name=\"ExclamationTriangle\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" color=\"negative\">\n {this.validation[question.id]}\n </ds-text>\n </div>\n ) : null}\n </div>\n );\n }\n\n private renderAnswered() {\n return (\n <div class=\"questionnaire questionnaire--answered\">\n <ol class=\"questionnaire__summary\">\n {this.questions.map(question => (\n <li>\n <ds-text variant=\"text-body-small\" emphasis>\n {question.question}\n </ds-text>\n <ds-text variant=\"text-body-small\" color=\"secondary\">\n {formatQuestionAnswer(\n question,\n this.answers.find(answer => answer.questionId === question.id)\n )}\n </ds-text>\n </li>\n ))}\n </ol>\n </div>\n );\n }\n\n render() {\n if (this.status === 'preparing') {\n return (\n <Host>\n <div class=\"questionnaire questionnaire--preparing\" role=\"status\">\n <ds-loader size=\"sm\" />\n <ds-text variant=\"text-body-medium\">{this.copy.preparing}</ds-text>\n </div>\n </Host>\n );\n }\n if (!this.questions?.length) return null;\n if (this.status === 'answered') return <Host>{this.renderAnswered()}</Host>;\n\n const question = this.questions[this.currentStep];\n const last = this.currentStep === this.questions.length - 1;\n const canSkip = Boolean(question.skippable && !question.required);\n return (\n <Host>\n <section\n class={{\n questionnaire: true,\n 'questionnaire--submitting': this.disabled,\n 'questionnaire--error': this.status === 'error',\n }}\n aria-busy={this.disabled ? 'true' : undefined}\n aria-label={question.question}\n >\n <header class=\"questionnaire__header\">\n <ds-text variant=\"text-caption\" color=\"secondary\">\n {this.progressLabel()}\n </ds-text>\n {this.allowCancel ? (\n <ds-tooltip label={this.copy.cancel} side=\"top\" size=\"sm\">\n <ds-button-unfilled\n data-question-action\n variant=\"icon\"\n icon=\"Cross\"\n size=\"sm\"\n aria-label={this.copy.cancel}\n hasBorder={false}\n isInactive={this.disabled}\n onDsClick={() => this.dsCancel.emit({ requestId: this.requestId })}\n />\n </ds-tooltip>\n ) : null}\n </header>\n {this.renderQuestion(question)}\n {this.status === 'error' && this.errorMessage ? (\n <div class=\"questionnaire__submission-error\" role=\"alert\">\n <ds-icon name=\"ExclamationTriangle\" size=\"xs\" color=\"inherit\" />\n <ds-text variant=\"text-body-small\" color=\"negative\">\n {this.errorMessage}\n </ds-text>\n </div>\n ) : null}\n <footer class=\"questionnaire__actions\">\n <div class=\"questionnaire__actions-leading\">\n {this.currentStep > 0 ? (\n <div class=\"questionnaire__action-item\">\n <ds-button-unfilled\n data-question-action\n label={this.copy.previous}\n size=\"sm\"\n width=\"fill\"\n isInactive={this.disabled}\n onDsClick={() => this.move(this.currentStep - 1)}\n />\n </div>\n ) : null}\n {canSkip ? (\n <div class=\"questionnaire__action-item\">\n <ds-button-unfilled\n data-question-action\n label={this.copy.skip}\n size=\"sm\"\n width=\"fill\"\n hasBorder={false}\n isInactive={this.disabled}\n onDsClick={() => this.skip(question)}\n />\n </div>\n ) : null}\n </div>\n <div class=\"questionnaire__action-item questionnaire__action-item--primary\">\n <ds-button-filled\n data-question-action\n label={last ? this.copy.answer : this.copy.next}\n size=\"sm\"\n width=\"fill\"\n isLoading={this.disabled}\n onDsClick={() => (last ? this.submit() : this.next(question))}\n />\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n"],"mappings":"qaAWA,SAASA,EACPC,EACAC,GAEA,OAAOD,EAAQE,MAAKC,GAAUA,EAAOF,aAAeA,GACtD,CAEM,SAAUG,EACdC,EACAL,GAEA,OAAOM,OAAOC,YACZF,EAAUG,KAAIC,IACZ,MAAMN,EAASJ,EAAUC,EAASS,EAASC,IAC3C,MAAMC,EAAe,IAAIC,IAAIH,EAASI,SAASL,KAAIM,GAAUA,EAAOC,SAAU,IAE9E,GAAIN,EAASO,OAAS,WAAY,CAChC,MAAMC,EAASC,MAAMC,QAAQhB,GAAQY,OAASZ,EAAOY,MAAQ,GAC7D,MAAMK,EAAQH,EAAOI,QAAON,GAASJ,EAAaW,IAAIP,KACtD,MAAMQ,EAAQN,EAAOf,MAAKa,IAAUJ,EAAaW,IAAIP,MAAW,GAChE,MAAO,CAC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MACXC,WAAYjG,KAAKsB,SACjB4E,UAAW,IAAMlG,KAAKV,KAAKzC,MAG7B,MAENgH,EAAA,OAAKC,MAAM,kEACTD,EAAA,gDAEE/E,MAAO4G,EAAO1F,KAAKqB,KAAK9E,OAASyD,KAAKqB,KAAKhC,KAC3C0E,KAAK,KACLsC,MAAM,OACNC,UAAWtG,KAAKsB,SAChB4E,UAAW,IAAOR,EAAO1F,KAAK+C,SAAW/C,KAAKX,KAAKxC,Q","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,h as s,a,t as c}from"./index.js";import{d as i}from"./p-BVsVUnAw.js";import{d as n}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as t,H as e,h as s,a,t as c}from"./index.js";import{d as i}from"./p-BVsVUnAw.js";import{d as n}from"./p-DMPn_dt7.js";const d=()=>`.sc-ds-empty-state-h{display:block;width:100%;height:100%}.sc-ds-empty-state-h,.empty-state.sc-ds-empty-state,.empty-state__text.sc-ds-empty-state{box-sizing:border-box}.empty-state.sc-ds-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;text-align:center}.empty-state__icon.sc-ds-empty-state{margin-block-end:var(--dimension-space-100);flex:0 0 auto}.empty-state__text.sc-ds-empty-state{display:flex;flex-direction:column;align-items:center;gap:var(--dimension-space-050);width:100%}.empty-state__actions.sc-ds-empty-state{margin-block-start:var(--dimension-space-200);display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--dimension-space-100)}.empty-state__actions.sc-ds-empty-state:not(:has([slot='actions'])){display:none}.empty-state__title.sc-ds-empty-state,.empty-state__body.sc-ds-empty-state{text-wrap:balance}`;const o=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.body=""}render(){const t=Boolean(this.heading?.trim());const e=t&&Boolean(this.icon);return s(a,{key:"f5390365e603c037e8fa588581930ce90392de98"},s("div",{key:"b390f6a44812998576b052f1d6392c1c646a3241",class:"empty-state"},e&&s("ds-icon",{key:"929f2a2e18432bd51d5fbc0992ff88f2465fb091",class:"empty-state__icon",name:this.icon,size:"xl",color:"primary"}),s("div",{key:"ad348a4f5f30706f79d848c2ee3011eb25d8dbf6",class:"empty-state__text"},t&&s("ds-text",{key:"ebcc5a690db829faa62a3c4a88a3b22da2ac1149",class:"empty-state__title",as:"div",variant:"text-title-small",color:"primary",align:"center"},this.heading),this.body&&s("ds-text",{key:"5f2b4f35a80f1db3c252028871e3590ff6bca4ea",class:"empty-state__body",as:"p",variant:"text-body-medium",color:"secondary",align:"center"},this.body)),s("div",{key:"75132a9b0e4191b66ba37c5573f358f83c2c7731",class:"empty-state__actions"},s("slot",{key:"53f65bf88676768572ae6e7aeb70d8023d85cbf9",name:"actions"}))))}static get style(){return d()}},[262,"ds-empty-state",{icon:[1],heading:[1],body:[1]}]);function m(){if(typeof customElements==="undefined"){return}const t=["ds-empty-state","ds-icon","ds-text"];t.forEach((t=>{switch(t){case"ds-empty-state":if(!customElements.get(c(t))){customElements.define(c(t),o)}break;case"ds-icon":if(!customElements.get(c(t))){i()}break;case"ds-text":if(!customElements.get(c(t))){n()}break}}))}m();export{o as E,m as d};
|
|
2
|
+
//# sourceMappingURL=p-3dG9v5Aw.js.map
|