@genesislcap/foundation-events 10.3.1 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/eventEmitter/eventEmitterDI.js +0 -1
- package/dist/esm/eventEmitter/eventEmitterMixin.js +0 -1
- package/dist/esm/eventEmitter/index.js +0 -1
- package/dist/esm/index.federated.js +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/types.js +0 -1
- package/package.json +3 -4
- package/dist/1.0.0.remoteEntry.js +0 -1
- package/dist/573.573.6e60854155addcc72467.js +0 -2
- package/dist/573.650390e975bc6c8376d3ff8eda7e52f4.js.map +0 -1
- package/dist/755.537dff5a23d468b98824bdef43b0cda0.js.map +0 -1
- package/dist/755.755.e981769af6aec9db513d.js +0 -2
- package/dist/856.3e4045c8104c25006236673f533997ff.js.map +0 -1
- package/dist/856.856.72fdef7363783c3bf498.js +0 -3
- package/dist/856.856.72fdef7363783c3bf498.js.LICENSE.txt +0 -4
- package/dist/dashboard.json +0 -1
- package/dist/esm/eventEmitter/eventEmitterDI.js.map +0 -1
- package/dist/esm/eventEmitter/eventEmitterMixin.js.map +0 -1
- package/dist/esm/eventEmitter/index.js.map +0 -1
- package/dist/esm/index.federated.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types.js.map +0 -1
- package/dist/favicon.ico +0 -0
- package/dist/foundation-events.iife.min.js +0 -1
- package/dist/foundation-events.js +0 -2728
- package/dist/foundation-events.min.js +0 -1
- package/dist/foundationEvents.8f5b3182da29e4d9304d1d4c151e3e58.js.map +0 -1
- package/dist/index.ejs +0 -23
- package/dist/index.html +0 -13
- package/dist/info.ejs +0 -13
- package/dist/main.50811a618c5e054436cd.js +0 -2
- package/dist/main.db9310a7c29193d4ad3bbbeeb42b7729.js.map +0 -1
- package/dist/npm.microsoft.127.08b9ac45e34e116d147c.js +0 -1469
- package/dist/npm.microsoft.127.08b9ac45e34e116d147c.js.LICENSE.txt +0 -14
- package/dist/npm.microsoft.c693b5fe4306901c8d3cdd3b3c894944.js.map +0 -1
- package/dist/remoteEntry.js +0 -2
- package/dist/serve.json +0 -3
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/platform.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/dom.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/observation/observable.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/binding.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/view.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/components/attributes.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/components/controller.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/styles/css.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/ref.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/when.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-element/dist/esm/templating/children.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/di/di.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-web-utilities/dist/key-codes.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-web-utilities/dist/numbers.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-web-utilities/dist/localization.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-web-utilities/dist/events.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/button/button.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/card/card.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-web-utilities/dist/strings.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-web-utilities/dist/dom.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-web-utilities/dist/array.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/directives/reflect-attributes.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-web-utilities/dist/aria.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/search/search.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/select/select.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js","webpack://@genesislcap/foundation-events/../node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js"],"names":["$global","globalThis","global","self","window","Function","_a","trustedTypes","createPolicy","n","r","propConfig","configurable","enumerable","writable","FAST","Reflect","defineProperty","Object","assign","value","create","getById","storage","id","initialize","found","emptyArray","freeze","createMetadataLocator","metadataLookup","WeakMap","target","metadata","get","currentTarget","getPrototypeOf","slice","set","updateQueue","tasks","pendingErrors","throwFirstError","length","shift","tryRunTask","task","call","error","push","setTimeout","process","index","scan","newLength","enqueue","callable","requestAnimationFrame","fastHTMLPolicy","createHTML","html","htmlPolicy","marker","Math","random","toString","substring","_interpolationStart","_interpolationEnd","DOM","supportsAdoptedStyleSheets","Array","isArray","document","adoptedStyleSheets","CSSStyleSheet","prototype","setHTMLPolicy","policy","Error","isMarker","node","nodeType","data","startsWith","extractDirectiveIndexFromMarker","parseInt","replace","createInterpolationPlaceholder","createCustomAttributePlaceholder","attributeName","this","createBlockPlaceholder","queueUpdate","processUpdates","nextUpdate","Promise","setAttribute","element","removeAttribute","setBooleanAttribute","removeChildNodes","parent","child","firstChild","removeChild","createTemplateWalker","fragment","createTreeWalker","SubscriberSet","constructor","source","initialSubscriber","sub1","sub2","spillover","has","subscriber","indexOf","subscribe","unsubscribe","splice","notify","args","handleChange","i","ii","PropertyChangeNotifier","subscribers","sourceSubscribers","propertyName","propertyToWatch","propertyToUnwatch","Observable","volatileRegex","notifierLookup","watcher","createArrayObserver","array","getNotifier","$fastController","getAccessors","DefaultObservableAccessor","name","field","callback","getValue","watch","setValue","newValue","oldValue","BindingObserverImplementation","binding","isVolatileBinding","super","needsRefresh","needsQueue","first","last","propertySource","notifier","next","observe","context","disconnect","previousWatcher","result","current","prev","prevValue","records","undefined","done","Symbol","iterator","setArrayObserverFactory","factory","track","trackVolatile","nameOrAccessor","test","observable","descriptor","apply","contextEvent","event","ExecutionContext","parentContext","isEven","isOdd","isFirst","isInMiddle","isLast","static","defaultExecutionContext","seal","HTMLDirective","targetIndex","TargetedHTMLDirective","arguments","createPlaceholder","AttachedBehaviorHTMLDirective","behavior","options","createBehavior","normalBind","bindingObserver","isBindingVolatile","updateTarget","triggerBind","addEventListener","targetName","normalUnbind","contentUnbind","view","$fastView","isComposed","unbind","needsBindOnly","triggerUnbind","removeEventListener","updateAttributeTarget","updateBooleanAttributeTarget","updateContentTarget","textContent","$fastTemplate","remove","bind","insertBefore","updatePropertyTarget","updateClassTarget","classVersions","version","names","split","currentName","classList","add","HTMLBindingDirective","originalTargetName","cleanedTargetName","substr","s","c","targetAtContent","BindingBehavior","handleEvent","setEvent","preventDefault","sharedContext","CompilationContext","addFactory","behaviorFactories","captureContentBinding","directive","reset","release","directives","shareable","createAggregateBinding","parts","partCount","finalParts","map","x","scope","output","interpolationEndLength","parseContent","valueParts","bindingParts","literal","directiveIndex","compileAttributes","includeBasicValues","attributes","attr","attrValue","parseResult","removeAttributeNode","compileContent","walker","lastNode","currentPart","currentNode","parentNode","createTextNode","nextSibling","nextNode","compileTemplate","template","content","adoptNode","borrow","hostBehaviorFactories","targetOffset","childNodes","createComment","viewBehaviorFactories","range","createRange","HTMLView","behaviors","lastChild","appendTo","appendChild","hasChildNodes","end","previousSibling","dispose","oldSource","views","setStartBefore","setEndAfter","deleteContents","j","jj","ViewTemplate","behaviorCount","hasHostBehaviors","hostBindingTarget","createElement","innerHTML","fec","firstElementChild","tagName","cloneNode","viewFactories","behaviorIndex","factoryIndex","hostFactories","render","host","getElementById","lastAttributeNameRegex","strings","values","currentString","match","exec","ElementStyles","targets","WeakSet","addStylesTo","removeStylesFrom","delete","isAttachedTo","withBehaviors","concat","reduceStyles","styles","reduce","curr","reduceBehaviors","styleSheetCache","Map","AdoptedStyleSheetsStyles","StyleElementStyles","_styleSheets","styleSheets","sheet","replaceSync","sourceSheets","filter","styleClassId","styleClass","normalizeTarget","className","append","querySelectorAll","body","AttributeConfiguration","locate","booleanConverter","toView","fromView","nullableNumberConverter","number","isNaN","AttributeDefinition","Owner","attribute","toLowerCase","mode","converter","guards","Set","fieldName","callbackName","hasCallback","tryReflectToAttribute","onAttributeChangedCallback","latestValue","attributeLists","list","config","property","configOrTarget","prop","decorator","$target","$prop","defaultShadowOptions","defaultElementOptions","fastRegistry","typeToDefinition","register","definition","type","getByType","key","FASTElementDefinition","nameOrConfig","collect","observedAttributes","propertyLookup","attributeLookup","shadowOptions","elementOptions","isDefined","define","registry","customElements","proto","forType","shadowRoots","defaultEventOptions","bubbles","composed","cancelable","getShadowRoot","shadowRoot","Controller","boundObservables","needsInitialization","_template","_styles","_isConnected","attachShadow","accessors","isConnected","setIsConnected","renderTemplate","removeStyles","addStyles","getRootNode","HTMLStyleElement","sourceBehaviors","addBehaviors","removeBehaviors","targetBehaviors","behaviorsToBind","force","behaviorsToUnbind","count","onConnectedCallback","finishInitialization","onDisconnectedCallback","attrDef","emit","detail","dispatchEvent","CustomEvent","propertyNames","keys","resolveTemplate","resolveStyles","controller","createFASTElement","BaseType","forCustomElement","$emit","connectedCallback","disconnectedCallback","attributeChangedCallback","FASTElement","HTMLElement","from","nameOrDef","customElement","CSSDirective","createCSS","collectStyles","cssString","trim","css","elementStyles","CSSPartial","stylesheets","accumulated","el","cssPartial","newSplice","removed","addedCount","EDIT_LEAVE","EDIT_UPDATE","EDIT_ADD","EDIT_DELETE","calcSplices","currentStart","currentEnd","old","oldStart","oldEnd","prefixCount","suffixCount","minLength","min","searchLength","sharedPrefix","index1","index2","sharedSuffix","ops","distances","edits","northWest","west","north","reverse","spliceOperationsFromEditDistances","rowCount","columnCount","calcEditDistances","splices","oldIndex","$push","mergeSplice","inserted","insertionOffset","intersectCount","start1","end1","start2","end2","deleteCount","currentRemoved","prepend","offset","projectArraySplices","changeRecords","initialSplices","record","createInitialSplices","arrayObservationEnabled","adjustIndex","changeRecord","arrayLength","ArrayObserver","oldCollection","flush","addSplice","finalSplices","enableArrayObservation","collection","$fastPatch","pop","sort","unshift","notEmpty","methodCallResult","o","oldArray","RefBehavior","ref","when","templateOrTemplateBinding","getTemplate","defaultRepeatOptions","positioning","recycle","bindWithoutPositioning","items","bindWithPositioning","childContext","RepeatBehavior","location","itemsBinding","isItemsBindingVolatile","templateBinding","isTemplateBindingVolatile","itemsObserver","originalContext","bindView","itemsBindingObserver","templateBindingObserver","observeItems","refreshAllViews","unbindAllViews","updateViews","oldObserver","newObserver","hasNewObserver","leftoverViews","leftoverIndex","availableViews","removeIndex","addIndex","removedViews","totalAvailableViews","neighbor","currentContext","templateChanged","itemsLength","viewsLength","disposeContiguousBatch","RepeatDirective","repeat","selector","matches","NodeObservationBehavior","shouldUpdate","some","computeNodes","nodes","getNodes","SlottedBehavior","assignedNodes","slotted","propertyOrOptions","ChildrenBehavior","observer","childList","MutationObserver","children","StartEnd","handleStartContentChange","startContainer","toggle","start","handleEndContentChange","endContainer","endSlotTemplate","startSlotTemplate","endTemplate","startTemplate","accordionItemTemplate","expanded","headinglevel","clickHandler","expandedIcon","collapsedIcon","metadataByTarget","defineMetadata","getOwnMetadata","ResolverBuilder","container","instance","registerResolver","singleton","transient","cachedCallback","cacheCallbackResult","aliasTo","destinationKey","strategy","state","ResolverImpl","cloneArrayWithPossibleProps","clone","len","isArrayIndex","DefaultResolver","none","ContainerConfiguration","default","parentLocator","responsibleForOwnerRequests","defaultResolver","dependencyLookup","getParamTypes","Type","rootDOMContainer","DI","createContainer","ContainerImpl","findResponsibleContainer","owned","$$container$$","findParentContainer","DILocateParentEventType","getOrCreateDOMContainer","getDesignParamtypes","getAnnotationParamtypes","getOrCreateAnnotationParamTypes","annotationParamtypes","getDependencies","dependencies","inject","designParamtypes","Proto","auAnnotationParamtype","respectConnection","diPropertyKey","createInterface","nameConfigOrCallback","configuror","configure","friendlyName","defaultFriendlyName","Interface","$isInterface","dep","Registration","registerInRequestor","defaultSingletonOptions","scoped","Container","ServiceLocator","createResolver","getter","resolver","$isResolver","resolve","handler","requestor","transientDecorator","targetOrOptions","searchAncestors","getAll","lazy","optional","ignore","newInstanceForScope","createNewInstance","newInstanceOf","_requestor","getFactory","construct","resolving","String","_b","_c","getResolver","containerGetKey","d","transformInstance","inst","transform","FactoryImpl","transformers","dynamicDependencies","registerTransformer","transformer","containerResolver","isRegistry","obj","isRegisterInRequester","isSelfRegistry","InstrinsicTypeNames","factories","owner","_parent","registerDepth","resolvers","Node","e","composedPath","stopImmediatePropagation","depth","registerWithContext","params","isObject","validateKey","autoRegister","jitRegister","resolutions","buildAllResponse","isNativeFunction","registerFactory","createChild","keyAsValue","registrationResolver","newResolver","cache","fun","t","originalKey","aliasKey","results","lookup","isNative","sourceText","fn","charCodeAt","isNumericLookup","ch","presentationKeyFromTag","presentationRegistry","ComponentPresentation","presentation","forTag","existing","DefaultComponentPresentation","applyTo","FoundationElement","_presentation","$presentation","stylesChanged","elementDefinition","overrideDefinition","FoundationElementRegistry","resolveOption","option","__decorate","prefix","elementPrefix","baseName","tryDefineElement","baseClass","definePresentation","shadowRootMode","defineElement","applyMixins","derivedCtor","baseCtors","derivedAttributes","forEach","baseCtor","getOwnPropertyNames","getOwnPropertyDescriptor","AccordionItem","change","accordionTemplate","elements","KeyCodes","keyArrowDown","keyArrowLeft","keyArrowRight","keyArrowUp","keyEnter","keyEscape","keyHome","keyEnd","keySpace","keyTab","ArrowKeys","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","wrapInBounds","max","limit","inRange","a","b","AccordionExpandMode","single","multi","Accordion","expandmode","activeItemIndex","activeid","setItems","accordionItems","accordionIds","getItemIds","item","activeItemChange","isSingleExpandMode","itemId","handleItemKeyDown","handleItemFocus","findExpandedItem","removeItemListeners","defaultPrevented","selectedItem","getAttribute","resetItems","hasAttribute","adjust","focusItem","focusedItem","focusedIndex","accordionItemsChanged","accordionItem","adjustment","expandbutton","focus","anchorTemplate","download","href","hreflang","ping","referrerpolicy","rel","ariaAtomic","ariaBusy","ariaControls","ariaCurrent","ariaDescribedby","ariaDetails","ariaDisabled","ariaErrormessage","ariaExpanded","ariaFlowto","ariaHaspopup","ariaHidden","ariaInvalid","ariaKeyshortcuts","ariaLabel","ariaLabelledby","ariaLive","ariaOwns","ariaRelevant","ariaRoledescription","ARIAGlobalStatesAndProperties","Anchor","handleUnsupportedDelegatesFocus","ShadowRoot","hasOwnProperty","delegatesFocus","control","DelegatesARIALink","anchoredRegionTemplate","initialLayoutComplete","Direction","eventFocus","eventFocusIn","eventFocusOut","eventKeyDown","eventResize","eventScroll","getDirection","rootNode","dirNode","closest","dir","rtl","ltr","AnchoredRegion","anchor","viewport","horizontalPositioningMode","horizontalDefaultPosition","horizontalViewportLock","horizontalInset","horizontalScaling","verticalPositioningMode","verticalDefaultPosition","verticalViewportLock","verticalInset","verticalScaling","fixedPlacement","autoUpdateMode","anchorElement","viewportElement","resizeDetector","baseHorizontalOffset","baseVerticalOffset","pendingPositioningUpdate","pendingReset","currentDirection","regionVisible","forceUpdate","updateThreshold","update","requestPositionUpdates","startObservers","stopObservers","intersectionService","requestPosition","handleIntersection","cancelRequestPosition","getViewport","documentElement","getAnchor","entries","applyIntersectionEntries","updateLayout","regionEntry","find","anchorEntry","viewportEntry","regionRect","anchorRect","viewportRect","isRectDifferent","boundingClientRect","DOMRectReadOnly","scrollLeft","y","scrollTop","width","height","updateRegionOffset","left","translateX","top","translateY","rectA","rectB","abs","right","bottom","handleResize","desiredVerticalPosition","desiredHorizontalPosition","horizontalOptions","getPositioningOptions","dirCorrectedHorizontalDefaultPosition","newDirection","horizontalThreshold","anchorLeft","anchorRight","anchorWidth","viewportLeft","viewportRight","getAvailableSpace","verticalOptions","verticalThreshold","anchorTop","anchorBottom","anchorHeight","viewportTop","viewportBottom","nextPositionerDimension","getNextRegionDimension","positionChanged","horizontalPosition","verticalPosition","setHorizontalPosition","setVerticalPosition","updateRegionStyle","style","removeProperty","updatePositionClasses","regionWidth","regionHeight","nextRegionWidth","sizeDelta","regionLeft","regionRight","nextRegionHeight","regionTop","regionBottom","inset","positionOption","anchorStart","anchorEnd","anchorSpan","viewportStart","viewportEnd","spaceStart","spaceEnd","newRegionDimension","startAutoUpdateEventListeners","passive","capture","stopAutoUpdateEventListeners","unobserve","anchorChanged","viewportChanged","horizontalPositioningModeChanged","requestReset","horizontalDefaultPositionChanged","updateForAttributeChange","horizontalViewportLockChanged","horizontalInsetChanged","horizontalThresholdChanged","horizontalScalingChanged","verticalPositioningModeChanged","verticalDefaultPositionChanged","verticalViewportLockChanged","verticalInsetChanged","verticalThresholdChanged","verticalScalingChanged","fixedPlacementChanged","autoUpdateModeChanged","prevMode","newMode","anchorElementChanged","viewportElementChanged","disconnectResizeDetector","adoptedCallback","initializeResizeDetector","ResizeObserver","setInitialState","opacity","pointerEvents","position","intersectionDetector","observedElements","callbacks","callBackIndex","initializeIntersectionDetector","IntersectionObserver","root","rootMargin","threshold","pendingCallbacks","pendingCallbackParams","entry","thisElementCallbacks","targetCallbackIndex","horizontalAnchorOverlay","FlyoutPosTop","FlyoutPosBottom","FlyoutPosTallest","FlyoutPosTopFill","FlyoutPosBottomFill","FlyoutPosTallestFill","avatarTemplate","shape","fill","link","color","media","Avatar","badgeTemplate","circular","generateBadgeStyle","Badge","breadcrumbItemTemplate","separator","BreadcrumbItem","breadcrumbTemplate","Breadcrumb","slottedBreadcrumbItemsChanged","slottedBreadcrumbItems","itemIsLastNode","setItemSeparator","setAriaCurrent","isLastNode","findChildWithHref","childElementCount","querySelector","childNodeWithHref","buttonTemplate","autofocus","disabled","formId","formaction","formenctype","formmethod","formnovalidate","formtarget","ariaPressed","proxySlotName","ElementInternalsKey","supportsElementInternals","InternalsMap","FormAssociated","BaseCtor","C","dirtyValue","proxyEventsToBlock","proxyInitialized","required","initialValue","elementInternals","formResetCallback","formAssociated","validity","proxy","form","validationMessage","willValidate","labels","ownerDocument","parentLabels","forLabels","valueChanged","previous","currentValue","setFormValue","validate","currentValueChanged","initialValueChanged","disabledChanged","nameChanged","requiredChanged","internals","attachInternals","_keypressHandler","attachProxy","stopPropagation","checkValidity","reportValidity","setValidity","flags","message","setCustomValidity","formDisabledCallback","display","proxySlot","detachProxy","HTMLFormElement","defaultButton","click","CheckableFormAssociated","D","dirtyChecked","checkedAttribute","checked","checkedAttributeChanged","defaultChecked","defaultCheckedChanged","checkedChanged","currentChecked","updateForm","HTMLInputElement","currentCheckedChanged","_Button","FormAssociatedButton","Button","handleClick","defaultSlottedContent","handleSubmission","attached","requestSubmit","handleFormReset","formactionChanged","formAction","formenctypeChanged","formEnctype","formmethodChanged","formMethod","formnovalidateChanged","formNoValidate","formtargetChanged","formTarget","typeChanged","span","DelegatesARIAButton","DateFormatter","dayFormat","weekdayFormat","monthFormat","yearFormat","date","Date","getDateObject","dates","day","month","year","getDate","format","weekday","locale","dateObj","optionsWithTimeZone","timeZone","Intl","DateTimeFormat","getDay","getMonth","getYear","getFullYear","getWeekday","getWeekdays","_","Calendar","dateFormatter","readonly","minWeeks","disabledDates","selectedDates","oneDayInMs","localeChanged","dayFormatChanged","weekdayFormatChanged","monthFormatChanged","yearFormatChanged","getMonthInfo","getFirstDay","getLength","nextMonth","getTime","thisMonth","previousMonth","getDays","info","days","dayCount","dateString","dateInString","selected","datesString","str","getDayClassNames","todayString","Boolean","join","getWeekdayText","weekdayText","text","longText","abbr","handleDateSelect","handleKeydown","GenerateHeaderOptions","sticky","DataGridCellTypes","columnHeader","rowHeader","DataGridRowTypes","header","stickyHeader","defaultCellContentsTemplate","rowData","columnDefinition","columnDataKey","defaultHeaderCellContentsTemplate","title","DataGridCell","cellType","isActiveCell","customCellView","updateCellStyle","gridColumn","cellTypeChanged","updateCellView","gridColumnChanged","columnDefinitionChanged","handleFocusin","handleFocusout","disconnectCellView","headerCellInternalFocusQueue","headerCellFocusTargetCallback","focusTarget","cellInternalFocusQueue","cellFocusTargetCallback","activeElement","contains","headerCellTemplate","cellTemplate","DataGridRow","rowType","columnDefinitions","isActiveRow","cellsRepeatBehavior","cellsPlaceholder","focusColumnIndex","refocusOnLoad","updateRowStyle","gridTemplateColumns","gridTemplateColumnsChanged","rowTypeChanged","updateItemTemplate","rowDataChanged","cellItemTemplateChanged","headerCellItemTemplateChanged","activeCellItemTemplate","handleCellFocus","cellElements","newFocusColumnIndex","ctrlKey","cellItemTemplate","defaultCellItemTemplate","headerCellItemTemplate","defaultHeaderCellItemTemplate","DataGrid","noTabbing","generateHeader","rowsData","focusRowIndex","rowsPlaceholder","generatedHeader","isUpdatingFocus","pendingFocusUpdate","rowindexUpdateQueued","columnDefinitionsStale","generatedGridTemplateColumns","focusOnCell","rowIndex","columnIndex","scrollIntoView","rowElements","cells","scrollHeight","clientHeight","block","inline","onChildListChange","mutations","mutation","addedNodes","newNode","queueRowIndexUpdate","updateRowIndexes","newGridTemplateColumns","firstRow","thisRow","templateColumns","column","noTabbingChanged","generateHeaderChanged","toggleGeneratedHeader","rowsDataChanged","generateColumns","columnDefinitionsChanged","generateTemplateColumns","focusRowIndexChanged","queueFocusUpdate","focusColumnIndexChanged","rowItemTemplate","defaultRowItemTemplate","rowsRepeatBehavior","handleRowFocus","handleFocus","handleFocusOut","focusRow","relatedTarget","newFocusRowIndex","maxIndex","currentGridBottom","offsetHeight","lastRow","offsetTop","stickyHeaderOffset","updateFocus","generatedHeaderElement","rowElementTag","row","CalendarTitleTemplate","calendarWeekdayTemplate","cellTag","tagFor","calendarCellTemplate","calendarRowTemplate","rowTag","interactiveCalendarGridTemplate","gridTag","noninteractiveCalendarTemplate","calendarTemplate","today","cardTemplate","Card","checkboxTemplate","readOnly","keypressHandler","indeterminate","checkedIndicator","indeterminateIndicator","defaultSlottedNodes","_Checkbox","FormAssociatedCheckbox","Checkbox","readOnlyChanged","uniqueIdCounter","uniqueId","isHTMLElement","every","arg","_canUseFocusVisible","isListboxOption","HTMLOptionElement","ListboxOption","defaultSelected","dirtySelected","Option","ariaChecked","contentChanged","defaultSelectedChanged","selectedAttributeChanged","selectedAttribute","selectedChanged","ariaSelected","label","_value","DelegatesARIAListboxOption","Listbox","_options","selectedIndex","selectedOptions","shouldSkipFocus","typeaheadBuffer","typeaheadExpired","typeaheadTimeout","firstSelectedOption","hasSelectableOptions","typeAheadExpired","captured","focusAndScrollOptionIntoView","optionToFocus","focusinHandler","setSelectedOptions","getTypeaheadMatches","pattern","re","RegExp","getSelectableIndex","direction","potentialDirection","nextSelectableOption","reduceRight","thisOption","slottedOptionFilter","handleTypeAhead","clearTimeout","TYPE_AHEAD_TIMEOUT_MS","keydownHandler","shiftKey","selectFirstOption","selectNextOption","selectPreviousOption","selectLastOption","mousedownHandler","multipleChanged","ariaMultiSelectable","selectedIndexChanged","selectableIndex","newNext","selectedOptionsChanged","filteredNext","includes","findIndex","predicate","k","findLastIndex","setDefaultSelectedOption","ariaActiveDescendant","slottedOptionsChanged","setSize","ariaPosInSet","ariaSetSize","typeaheadBufferChanged","typeaheadMatches","hidden","DelegatesARIAListbox","SelectPosition","above","below","_Combobox","FormAssociatedCombobox","ComboboxAutocomplete","both","Combobox","filteredOptions","forcedPosition","listboxId","maxHeight","open","updateValue","isAutocompleteInline","autocomplete","isAutocompleteBoth","isAutocompleteList","openChanged","setPositioning","placeholderChanged","placeholder","positionAttribute","prevSelectedValue","nextSelectedValue","clearSelectionRange","filterOptions","focusoutHandler","syncValue","isSameNode","inputHandler","inputType","setInlineSelection","setInputToSelection","keyupHandler","setSelectionRange","currentBox","getBoundingClientRect","availableBottom","innerHeight","shouldEmit","controlValueLength","DelegatesARIACombobox","comboboxTemplate","ariaAutoComplete","indicator","flatten","dataGridTemplate","createRowItemTemplate","dataGridRowTemplate","isRowHeader","createCellItemTemplate","createHeaderCellItemTemplate","dataGridCellTemplate","composedParent","parentElement","composedContains","reference","defaultElement","QueuedStyleSheetTarget","setProperty","DocumentStyleSheetTarget","cssRules","insertRule","HeadStyleElementStyleSheetTarget","head","StyleElementStyleSheetTarget","store","targetChanged","ElementStyleSheetTarget","RootStyleSheetTarget","properties","roots","PropertyTargetManager","getOrCreate","normalizeRoot","propertyTargetCache","propertyTargetCtor","Document","DesignTokenImpl","configuration","_appliedTo","cssCustomPropertyName","cssCustomProperty","cssVar","tokensById","appliedTo","token","getOrCreateSubscriberSet","getValueFor","DesignTokenNode","setValueFor","alias","deleteValueFor","existsFor","withDefault","subscriberSet","sub","DesignTokenBindingObserver","Store","all","nodeCache","childToParent","assignedValues","reflecting","bindingObservers","tokenValueChangeHandler","getTokenById","isCSSDesignToken","isReflecting","parentValue","sourceValue","stopReflectToCSS","reflectToCSS","raw","getRaw","hydrate","findClosestAssignedNode","isDerivedDesignTokenValue","tearDownBindingObserver","setupBindingObserver","upstream","findParent","reParent","childIndex","cssCustomPropertyReflector","startReflection","stopReflection","resolveCSSValue","DesignToken","notifyConnection","notifyDisconnection","registerRoot","unregisterRoot","ElementDisambiguation","definitionCallbackOnly","ignoreDuplicate","elementTypesByTag","elementTagsByType","rootDesignSystem","designSystemKey","DefaultDesignSystem","DesignSystem","responsibleFor","$$designSystem$$","system","designTokensInitialized","disambiguate","withPrefix","withShadowRootMode","withElementDisambiguation","withDesignTokenRoot","designTokenRoot","registrations","elementDefinitionEntries","elementDefinitionType","elementDefinitionCallback","extractedParams","extractTryDefineElementParams","elementName","typeFoundByName","needsDefine","ElementDefinitionEntry","willDefine","dialogTemplate","modal","dismiss","Dialog","trapFocus","trapFocusChanged","updateTrapFocus","isTrappingFocus","handleDocumentKeydown","handleTabKeyDown","handleDocumentFocus","shouldForceFocus","focusFirstElement","bounds","getTabQueueBounds","reduceTabbableItems","dialog","currentFocusElement","shouldTrapFocus","shouldTrapFocusOverride","show","hide","isFocusableFastElement","hasTabbableShadow","AttributeReflectionSubscriptionSet","getOrCreateFor","watchedAttributes","subscriberCache","attributeFilter","ReflectAttrBehavior","hasAttributes","reflectAttributes","disclosureTemplate","Disclosure","setup","details","onToggle","dividerTemplate","role","orientation","Orientation","DividerRole","Divider","FlipperDirection","flipperTemplate","hiddenFromAT","Flipper","blur","listboxOptionTemplate","ListboxElement","activeIndex","rangeStartIndex","activeOption","checkedOptions","firstSelectedOptionIndex","activeIndexChanged","checkActiveIndex","multiple","activeItem","checkFirstOption","preserveChecked","uncheckAllOptions","checkLastOption","checkNextOption","checkPreviousOption","toggleSelectedForAllCheckedOptions","offsetX","scrollWidth","sizeChanged","size","toFixed","enabledCheckedOptions","listboxTemplate","PickerMenu","optionElements","menuElementsChanged","updateOptions","headerElementsChanged","footerElementsChanged","addSlottedListItems","headerElements","menuElements","footerElements","slotChildren","defaultContentsTemplate","PickerMenuOption","contentsTemplateChanged","updateView","disconnectView","handleInvoked","customView","contentsTemplate","PickerList","PickerListItem","handleKeyDown","handleInvoke","pickerTemplate","anchoredRegionTag","pickerMenuTag","pickerListTag","progressRingTag","defaultListItemTemplate","pickerListItemTag","listItemContentsTemplate","createDefaultListItemTemplate","defaultMenuOptionTemplate","pickerMenuOptionTag","menuOptionContentsTemplate","createDefaultMenuOptionTemplate","handleFocusIn","handleItemInvoke","handleOptionInvoke","flyoutOpen","menuConfig","handleRegionLoaded","showNoOptions","showLoading","noSuggestionsText","loadingText","_Picker","FormAssociatedPicker","pickerInputTemplate","labelledBy","Picker","selection","filterSelected","filterQuery","suggestionsAvailableText","menuPlacement","optionsList","filteredOptionsList","menuFocusIndex","selectedItems","inputElementView","handleTextInput","query","inputElement","handleInputClick","toggleFlyout","setRegionProps","region","configLookup","tallest","selectionChanged","handleSelectionChange","optionsChanged","opt","menuPlacementChanged","updateMenuConfig","showLoadingChanged","setFocusedOption","listItemTemplateChanged","updateListItemTemplate","defaultListItemTemplateChanged","menuOptionTemplateChanged","updateOptionTemplate","defaultMenuOptionTemplateChanged","optionsListChanged","updateFilteredOptions","queryChanged","filteredOptionsListChanged","menuElement","flyoutOpenChanged","showNoOptionsChanged","listElement","selectedListTag","itemsPlaceholderElement","menuTag","toUpperCase","menuId","optionsPlaceholder","itemsRepeatBehavior","activeListItemTemplate","handleMenuOptionsUpdated","optionsRepeatBehavior","activeMenuOptionTemplate","disableMenu","nextFocusOptionIndex","previousFocusOptionIndex","incrementFocusedItem","selectionStart","currentFocusedItemIndex","checkMaxItems","maxSelected","selectedItemInstances","itemIndex","newSelection","increment","selectedItemsAsElements","newFocusedItemIndex","menuFocusOptionId","optionIndex","focusedOption","scrollTo","listItemTemplate","menuOptionTemplate","newConfig","pickerMenuTemplate","pickerMenuOptionTemplate","pickerListTemplate","pickerListItemTemplate","MenuItemRole","menuitem","menuitemcheckbox","menuitemradio","roleForMenuItem","menuItemTemplate","hasSubmenu","handleMenuItemKeyDown","handleMenuItemClick","handleMouseOver","handleMouseOut","startColumnCount","checkboxIndicator","radioIndicator","expandCollapseGlyph","submenuLoaded","MenuItem","focusSubmenuOnLoad","invoke","expandAndFocus","submenu","updateSubmenu","domChildren","expandedChanged","collapseExpandedItem","menuTemplate","slot","isNestedMenu","handleMenuKeyDown","Menu","expandedItem","focusIndex","menuItems","isFocusableElement","targetItem","handleExpandedChanged","changedItem","newItems","isMenuItemElement","indent","accum","elementValue","startSlot","elementIndent","changeHandler","changedMenuItem","changeItemIndex","focusableElementRoles","itemsChanged","setFocus","numberFieldTemplate","handleBlur","maxlength","minlength","step","hideStep","stepUp","stepUpGlyph","stepDown","stepDownGlyph","_TextField","FormAssociatedTextField","TextFieldType","email","password","tel","url","TextField","autofocusChanged","listChanged","maxlengthChanged","maxLength","minlengthChanged","patternChanged","spellcheckChanged","spellcheck","select","DelegatesARIATextbox","_NumberField","FormAssociatedNumberField","NumberField","isUserInput","maxChanged","getValidValue","minChanged","valueAsNumber","parseFloat","validValue","toPrecision","stepUpValue","stepDownValue","progressRingTemplate","paused","percentComplete","BaseProgress","updatePercentComplete","fround","progressTemplate","defintion","indeterminateIndicator1","indeterminateIndicator2","radioGroupTemplate","focusOutHandler","RadioGroup","radioChangeHandler","changedRadio","slottedRadioButtons","radio","isInsideFoundationToolbar","selectedRadio","focusedRadio","moveToRadioByIndex","group","isInsideToolbar","nextRadio","moveRightOffGroup","nextElementSibling","moveLeftOffGroup","previousElementSibling","shouldMoveOffGroupToTheRight","shouldMoveOffGroupToTheLeft","checkFocusedRadio","moveRight","moveLeft","slottedRadioButtonsChanged","setupRadioButtons","parentToolbar","checkedRadios","numberOfCheckedRadios","foundMatchingVal","lastCheckedRadio","radioTemplate","_Radio","FormAssociatedRadio","Radio","isInsideRadioGroup","HorizontalScroll","framesPerSecond","updatingItems","speed","easing","flippersHiddenFromAT","scrolling","frameTime","scrollingChanged","scrollContainer","isRtl","scrollItems","offsetLeft","scrollItemsChanged","setStops","resized","updateScrollStops","updatedItems","scrollItem","HTMLSlotElement","assignedElements","containerWidth","containerLeft","lastStop","stops","leftPosition","round","fixScrollMisalign","scrollStops","setFlippers","stop","previousFlipperContainer","nextFlipperContainer","scrollInView","padding","rightPadding","itemStart","itemEnd","isBefore","scrollToPosition","scrollToPrevious","scrollToNext","scrollPosition","nextIndex","outOfView","newPosition","seconds","duration","computedDuration","getComputedStyle","getPropertyValue","transitionendHandler","maxScrollValue","clientWidth","transitionStop","resizeTimeout","offsetWidth","scrolled","scrollTimeout","horizontalScrollTemplate","previousFlipper","nextFlipper","whitespaceFilter","TEXT_NODE","nodeValue","searchTemplate","handleClearInput","_Search","FormAssociatedSearch","Search","DelegatesARIASearch","_Select","FormAssociatedSelect","Select","collapsible","indexWhenOpened","_d","_e","_f","_g","updateDisplayValue","displayValue","setProxyOptions","listbox","proxyOption","HTMLSelectElement","volatile","DelegatesARIASelect","selectTemplate","skeletonTemplate","shimmer","Skeleton","sliderLabelTemplate","sliderOrientation","positionStyle","hideMark","convertPixelToPercent","pixelPos","minPosition","maxPosition","pct","defaultConfig","SliderLabel","sliderDirection","getSliderConfiguration","isSliderConfig","parentSlider","sliderMaxPosition","sliderMinPosition","positionAsStyle","Number","rightNum","leftNum","sliderOrientationChanged","sliderTemplate","valueTextFormatter","thumb","_Slider","FormAssociatedSlider","SliderMode","singleValue","Slider","isDragging","trackWidth","trackMinWidth","trackHeight","trackLeft","trackMinHeight","decrement","setupTrackConstraints","clientRect","clientLeft","setupListeners","eventAction","handleMouseDown","handleThumbMouseDown","handleWindowMouseUp","handleMouseMove","sourceEvent","TouchEvent","touches","eventValue","pageX","pageY","calculateNewValue","rawValue","convertToConstrainedValue","stopDragging","controlValue","constrainedValue","remainderValue","stepMultiplier","setThumbPositionForOrientation","stepChanged","updateStepMultiplier","orientationChanged","setupDefaultValue","newVal","incrementedVal","incrementedValString","decrementedVal","decrementedValString","percentage","stepString","decimalPlacesOfStep","pow","midpoint","switchTemplate","switch","_Switch","FormAssociatedSwitch","Switch","tabPanelTemplate","TabPanel","tabTemplate","Tab","tabsTemplate","showActiveIndicator","TabsOrientation","vertical","horizontal","Tabs","activeindicator","prevActiveTabIndex","activeTabIndex","ticking","activetab","isDisabledElement","setTabs","gridHorizontalProperty","gridVerticalProperty","gridProperty","isHorizontal","getActiveIndex","tabs","tab","isActiveTab","tabId","tabIds","tabpanelId","tabpanelIds","handleTabClick","setTabPanels","tabpanels","tabpanel","selectedTab","setComponent","adjustBackward","adjustForward","moveToTabByIndex","handleActiveIndicatorPosition","activeidChanged","tabsChanged","getTabIds","getTabPanelIds","tabpanelsChanged","tabPanel","focusTab","animateActiveIndicator","translateProperty","offsetProperty","activeIndicatorRef","dif","TextAreaResize","textAreaTemplate","resize","cols","rows","_TextArea","FormAssociatedTextArea","TextArea","HTMLTextAreaElement","textFieldTemplate","toolbarTemplate","subtree","ToolbarArrowKeyMap","Toolbar","_activeIndex","focusableElements","slottedItemsChanged","reduceFocusableElements","setFocusedElement","childItemsChanged","getDirectionalIncrementer","incrementer","allSlottedItems","slottedItems","previousFocusedElement","reduceFocusableItems","adjustedActiveIndex","setFocusableElements","isRoleRadio","hasFocusableShadow","tabIndex","DelegatesARIAToolbar","tooltipTemplate","tooltipVisible","TooltipPosition","topLeft","topRight","bottomLeft","bottomRight","topStart","topEnd","bottomStart","bottomEnd","Tooltip","delay","showDelayTimer","hideDelayTimer","isAnchorHoveredFocused","isRegionHovered","handlePositionChange","ev","handleRegionMouseOver","handleRegionMouseOut","startHideDelayTimer","handleAnchorMouseOver","startShowDelayTimer","handleAnchorMouseOut","clearShowDelayTimer","handleAnchorFocusIn","handleAnchorFocusOut","clearHideDelayTimer","updateTooltipVisibility","startHover","visible","hideTooltip","showTooltip","visibleChanged","anchorId","treeItemTemplate","isNestedItem","nested","childItems","childItemLength","handleExpandCollapseButtonClick","renderCollapsedChildren","isTreeItemElement","TreeItem","focusable","treeChildren","treeViewTemplate","handleSelectedChange","TreeView","currentFocused","slottedTreeItems","getValidFocusableItem","treeItems","getVisibleNodes","focusNextNode","Element","currentSelected","treeView","checkForNestedItems","isSelectedElement","slottedTreeItemsChanged","delta","visibleNodes","offsetParent","getDisplayedNodes","MatchMediaBehavior","listenerCache","listener","constructListener","addListener","removeListener","MatchMediaStyleSheetBehavior","forcedColorsStylesheetBehavior","with","matchMedia","darkModeStylesheetBehavior","lightModeStylesheetBehavior","PropertyStyleSheetBehavior","elementInstance","disabledCursor","focusVisible","styleElement","styleNonce","getNonce","canUseFocusVisible","extendStatics","setPrototypeOf","__proto__","p","__extends","__","__assign","__rest","getOwnPropertySymbols","propertyIsEnumerable","decorators","desc","decorate","__param","paramIndex","__metadata","metadataKey","metadataValue","__awaiter","thisArg","_arguments","P","generator","reject","fulfilled","rejected","then","__generator","f","g","sent","trys","verb","v","op","TypeError","__createBinding","m","k2","__exportStar","exports","__values","__read","ar","__spread","__spreadArrays","il","jl","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","__importStar","mod","__esModule","__importDefault","__classP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ADb+B,CAAO1qD,EAAS2oD,GAA7BU,EAAI7yD,EAAEziB,GAAGs1E,IAA8BnrE,KAAMmrE,EAAE30E,MAAQ,GAAI,CAAG,CAEnK,CAEO,SAASm2E,EAAqBC,EAAQlxB,GAEzC,OADIplD,OAAOD,eAAkBC,OAAOD,eAAeu2E,EAAQ,MAAO,CAAEp2E,MAAOklD,IAAiBkxB,EAAOlxB,IAAMA,EAClGkxB,CACX,CAEO,SAASC,EAAaC,GACzB,GAAIA,GAAOA,EAAIC,WAAY,OAAOD,EAClC,IAAIptE,EAAS,CAAC,EACd,GAAW,MAAPotE,EAAa,IAAK,IAAIl5B,KAAKk5B,EAASx2E,OAAO83B,eAAej2B,KAAK20E,EAAKl5B,KAAIl0C,EAAOk0C,GAAKk5B,EAAIl5B,IAE5F,OADAl0C,EAAOof,QAAUguD,EACVptE,CACX,CAEO,SAASstE,EAAgBF,GAC5B,OAAQA,GAAOA,EAAIC,WAAcD,EAAM,CAAEhuD,QAASguD,EACtD,CAEO,SAASG,EAAuBC,EAAUC,GAC7C,IAAKA,EAAW3wE,IAAI0wE,GAChB,MAAM,IAAI7B,UAAU,kDAExB,OAAO8B,EAAW71E,IAAI41E,EAC1B,CAEO,SAASE,EAAuBF,EAAUC,EAAY32E,GACzD,IAAK22E,EAAW3wE,IAAI0wE,GAChB,MAAM,IAAI7B,UAAU,kDAGxB,OADA8B,EAAWz1E,IAAIw1E,EAAU12E,GAClBA,CACX,C","file":"npm.microsoft.127.xxxxxxxxxxxxxxxxxxxx.js","sourcesContent":["/**\n * A reference to globalThis, with support\n * for browsers that don't yet support the spec.\n * @public\n */\nexport const $global = (function () {\n if (typeof globalThis !== \"undefined\") {\n // We're running in a modern environment.\n return globalThis;\n }\n if (typeof global !== \"undefined\") {\n // We're running in NodeJS\n return global;\n }\n if (typeof self !== \"undefined\") {\n // We're running in a worker.\n return self;\n }\n if (typeof window !== \"undefined\") {\n // We're running in the browser's main thread.\n return window;\n }\n try {\n // Hopefully we never get here...\n // Not all environments allow eval and Function. Use only as a last resort:\n // eslint-disable-next-line no-new-func\n return new Function(\"return this\")();\n }\n catch (_a) {\n // If all fails, give up and create an object.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n return {};\n }\n})();\n// API-only Polyfill for trustedTypes\nif ($global.trustedTypes === void 0) {\n $global.trustedTypes = { createPolicy: (n, r) => r };\n}\nconst propConfig = {\n configurable: false,\n enumerable: false,\n writable: false,\n};\nif ($global.FAST === void 0) {\n Reflect.defineProperty($global, \"FAST\", Object.assign({ value: Object.create(null) }, propConfig));\n}\n/**\n * The FAST global.\n * @internal\n */\nexport const FAST = $global.FAST;\nif (FAST.getById === void 0) {\n const storage = Object.create(null);\n Reflect.defineProperty(FAST, \"getById\", Object.assign({ value(id, initialize) {\n let found = storage[id];\n if (found === void 0) {\n found = initialize ? (storage[id] = initialize()) : null;\n }\n return found;\n } }, propConfig));\n}\n/**\n * A readonly, empty array.\n * @remarks\n * Typically returned by APIs that return arrays when there are\n * no actual items to return.\n * @internal\n */\nexport const emptyArray = Object.freeze([]);\n/**\n * Creates a function capable of locating metadata associated with a type.\n * @returns A metadata locator function.\n * @internal\n */\nexport function createMetadataLocator() {\n const metadataLookup = new WeakMap();\n return function (target) {\n let metadata = metadataLookup.get(target);\n if (metadata === void 0) {\n let currentTarget = Reflect.getPrototypeOf(target);\n while (metadata === void 0 && currentTarget !== null) {\n metadata = metadataLookup.get(currentTarget);\n currentTarget = Reflect.getPrototypeOf(currentTarget);\n }\n metadata = metadata === void 0 ? [] : metadata.slice(0);\n metadataLookup.set(target, metadata);\n }\n return metadata;\n };\n}\n","import { $global } from \"./platform.js\";\nconst updateQueue = $global.FAST.getById(1 /* updateQueue */, () => {\n const tasks = [];\n const pendingErrors = [];\n function throwFirstError() {\n if (pendingErrors.length) {\n throw pendingErrors.shift();\n }\n }\n function tryRunTask(task) {\n try {\n task.call();\n }\n catch (error) {\n pendingErrors.push(error);\n setTimeout(throwFirstError, 0);\n }\n }\n function process() {\n const capacity = 1024;\n let index = 0;\n while (index < tasks.length) {\n tryRunTask(tasks[index]);\n index++;\n // Prevent leaking memory for long chains of recursive calls to `DOM.queueUpdate`.\n // If we call `DOM.queueUpdate` within a task scheduled by `DOM.queueUpdate`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) {\n tasks[scan] = tasks[scan + index];\n }\n tasks.length -= index;\n index = 0;\n }\n }\n tasks.length = 0;\n }\n function enqueue(callable) {\n if (tasks.length < 1) {\n $global.requestAnimationFrame(process);\n }\n tasks.push(callable);\n }\n return Object.freeze({\n enqueue,\n process,\n });\n});\n/* eslint-disable */\nconst fastHTMLPolicy = $global.trustedTypes.createPolicy(\"fast-html\", {\n createHTML: html => html,\n});\n/* eslint-enable */\nlet htmlPolicy = fastHTMLPolicy;\nconst marker = `fast-${Math.random().toString(36).substring(2, 8)}`;\n/** @internal */\nexport const _interpolationStart = `${marker}{`;\n/** @internal */\nexport const _interpolationEnd = `}${marker}`;\n/**\n * Common DOM APIs.\n * @public\n */\nexport const DOM = Object.freeze({\n /**\n * Indicates whether the DOM supports the adoptedStyleSheets feature.\n */\n supportsAdoptedStyleSheets: Array.isArray(document.adoptedStyleSheets) &&\n \"replace\" in CSSStyleSheet.prototype,\n /**\n * Sets the HTML trusted types policy used by the templating engine.\n * @param policy - The policy to set for HTML.\n * @remarks\n * This API can only be called once, for security reasons. It should be\n * called by the application developer at the start of their program.\n */\n setHTMLPolicy(policy) {\n if (htmlPolicy !== fastHTMLPolicy) {\n throw new Error(\"The HTML policy can only be set once.\");\n }\n htmlPolicy = policy;\n },\n /**\n * Turns a string into trusted HTML using the configured trusted types policy.\n * @param html - The string to turn into trusted HTML.\n * @remarks\n * Used internally by the template engine when creating templates\n * and setting innerHTML.\n */\n createHTML(html) {\n return htmlPolicy.createHTML(html);\n },\n /**\n * Determines if the provided node is a template marker used by the runtime.\n * @param node - The node to test.\n */\n isMarker(node) {\n return node && node.nodeType === 8 && node.data.startsWith(marker);\n },\n /**\n * Given a marker node, extract the {@link HTMLDirective} index from the placeholder.\n * @param node - The marker node to extract the index from.\n */\n extractDirectiveIndexFromMarker(node) {\n return parseInt(node.data.replace(`${marker}:`, \"\"));\n },\n /**\n * Creates a placeholder string suitable for marking out a location *within*\n * an attribute value or HTML content.\n * @param index - The directive index to create the placeholder for.\n * @remarks\n * Used internally by binding directives.\n */\n createInterpolationPlaceholder(index) {\n return `${_interpolationStart}${index}${_interpolationEnd}`;\n },\n /**\n * Creates a placeholder that manifests itself as an attribute on an\n * element.\n * @param attributeName - The name of the custom attribute.\n * @param index - The directive index to create the placeholder for.\n * @remarks\n * Used internally by attribute directives such as `ref`, `slotted`, and `children`.\n */\n createCustomAttributePlaceholder(attributeName, index) {\n return `${attributeName}=\"${this.createInterpolationPlaceholder(index)}\"`;\n },\n /**\n * Creates a placeholder that manifests itself as a marker within the DOM structure.\n * @param index - The directive index to create the placeholder for.\n * @remarks\n * Used internally by structural directives such as `repeat`.\n */\n createBlockPlaceholder(index) {\n return `<!--${marker}:${index}-->`;\n },\n /**\n * Schedules DOM update work in the next async batch.\n * @param callable - The callable function or object to queue.\n */\n queueUpdate: updateQueue.enqueue,\n /**\n * Immediately processes all work previously scheduled\n * through queueUpdate.\n * @remarks\n * This also forces nextUpdate promises\n * to resolve.\n */\n processUpdates: updateQueue.process,\n /**\n * Resolves with the next DOM update.\n */\n nextUpdate() {\n return new Promise(updateQueue.enqueue);\n },\n /**\n * Sets an attribute value on an element.\n * @param element - The element to set the attribute value on.\n * @param attributeName - The attribute name to set.\n * @param value - The value of the attribute to set.\n * @remarks\n * If the value is `null` or `undefined`, the attribute is removed, otherwise\n * it is set to the provided value using the standard `setAttribute` API.\n */\n setAttribute(element, attributeName, value) {\n if (value === null || value === undefined) {\n element.removeAttribute(attributeName);\n }\n else {\n element.setAttribute(attributeName, value);\n }\n },\n /**\n * Sets a boolean attribute value.\n * @param element - The element to set the boolean attribute value on.\n * @param attributeName - The attribute name to set.\n * @param value - The value of the attribute to set.\n * @remarks\n * If the value is true, the attribute is added; otherwise it is removed.\n */\n setBooleanAttribute(element, attributeName, value) {\n value\n ? element.setAttribute(attributeName, \"\")\n : element.removeAttribute(attributeName);\n },\n /**\n * Removes all the child nodes of the provided parent node.\n * @param parent - The node to remove the children from.\n */\n removeChildNodes(parent) {\n for (let child = parent.firstChild; child !== null; child = parent.firstChild) {\n parent.removeChild(child);\n }\n },\n /**\n * Creates a TreeWalker configured to walk a template fragment.\n * @param fragment - The fragment to walk.\n */\n createTemplateWalker(fragment) {\n return document.createTreeWalker(fragment, 133, // element, text, comment\n null, false);\n },\n});\n","/**\n * An implementation of {@link Notifier} that efficiently keeps track of\n * subscribers interested in a specific change notification on an\n * observable source.\n *\n * @remarks\n * This set is optimized for the most common scenario of 1 or 2 subscribers.\n * With this in mind, it can store a subscriber in an internal field, allowing it to avoid Array#push operations.\n * If the set ever exceeds two subscribers, it upgrades to an array automatically.\n * @public\n */\nexport class SubscriberSet {\n /**\n * Creates an instance of SubscriberSet for the specified source.\n * @param source - The object source that subscribers will receive notifications from.\n * @param initialSubscriber - An initial subscriber to changes.\n */\n constructor(source, initialSubscriber) {\n this.sub1 = void 0;\n this.sub2 = void 0;\n this.spillover = void 0;\n this.source = source;\n this.sub1 = initialSubscriber;\n }\n /**\n * Checks whether the provided subscriber has been added to this set.\n * @param subscriber - The subscriber to test for inclusion in this set.\n */\n has(subscriber) {\n return this.spillover === void 0\n ? this.sub1 === subscriber || this.sub2 === subscriber\n : this.spillover.indexOf(subscriber) !== -1;\n }\n /**\n * Subscribes to notification of changes in an object's state.\n * @param subscriber - The object that is subscribing for change notification.\n */\n subscribe(subscriber) {\n const spillover = this.spillover;\n if (spillover === void 0) {\n if (this.has(subscriber)) {\n return;\n }\n if (this.sub1 === void 0) {\n this.sub1 = subscriber;\n return;\n }\n if (this.sub2 === void 0) {\n this.sub2 = subscriber;\n return;\n }\n this.spillover = [this.sub1, this.sub2, subscriber];\n this.sub1 = void 0;\n this.sub2 = void 0;\n }\n else {\n const index = spillover.indexOf(subscriber);\n if (index === -1) {\n spillover.push(subscriber);\n }\n }\n }\n /**\n * Unsubscribes from notification of changes in an object's state.\n * @param subscriber - The object that is unsubscribing from change notification.\n */\n unsubscribe(subscriber) {\n const spillover = this.spillover;\n if (spillover === void 0) {\n if (this.sub1 === subscriber) {\n this.sub1 = void 0;\n }\n else if (this.sub2 === subscriber) {\n this.sub2 = void 0;\n }\n }\n else {\n const index = spillover.indexOf(subscriber);\n if (index !== -1) {\n spillover.splice(index, 1);\n }\n }\n }\n /**\n * Notifies all subscribers.\n * @param args - Data passed along to subscribers during notification.\n */\n notify(args) {\n const spillover = this.spillover;\n const source = this.source;\n if (spillover === void 0) {\n const sub1 = this.sub1;\n const sub2 = this.sub2;\n if (sub1 !== void 0) {\n sub1.handleChange(source, args);\n }\n if (sub2 !== void 0) {\n sub2.handleChange(source, args);\n }\n }\n else {\n for (let i = 0, ii = spillover.length; i < ii; ++i) {\n spillover[i].handleChange(source, args);\n }\n }\n }\n}\n/**\n * An implementation of Notifier that allows subscribers to be notified\n * of individual property changes on an object.\n * @public\n */\nexport class PropertyChangeNotifier {\n /**\n * Creates an instance of PropertyChangeNotifier for the specified source.\n * @param source - The object source that subscribers will receive notifications from.\n */\n constructor(source) {\n this.subscribers = {};\n this.sourceSubscribers = null;\n this.source = source;\n }\n /**\n * Notifies all subscribers, based on the specified property.\n * @param propertyName - The property name, passed along to subscribers during notification.\n */\n notify(propertyName) {\n var _a;\n const subscribers = this.subscribers[propertyName];\n if (subscribers !== void 0) {\n subscribers.notify(propertyName);\n }\n (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName);\n }\n /**\n * Subscribes to notification of changes in an object's state.\n * @param subscriber - The object that is subscribing for change notification.\n * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes.\n */\n subscribe(subscriber, propertyToWatch) {\n var _a;\n if (propertyToWatch) {\n let subscribers = this.subscribers[propertyToWatch];\n if (subscribers === void 0) {\n this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source);\n }\n subscribers.subscribe(subscriber);\n }\n else {\n this.sourceSubscribers =\n (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source);\n this.sourceSubscribers.subscribe(subscriber);\n }\n }\n /**\n * Unsubscribes from notification of changes in an object's state.\n * @param subscriber - The object that is unsubscribing from change notification.\n * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching.\n */\n unsubscribe(subscriber, propertyToUnwatch) {\n var _a;\n if (propertyToUnwatch) {\n const subscribers = this.subscribers[propertyToUnwatch];\n if (subscribers !== void 0) {\n subscribers.unsubscribe(subscriber);\n }\n }\n else {\n (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber);\n }\n }\n}\n","import { DOM } from \"../dom.js\";\nimport { createMetadataLocator, FAST } from \"../platform.js\";\nimport { PropertyChangeNotifier, SubscriberSet } from \"./notifier.js\";\n/**\n * Common Observable APIs.\n * @public\n */\nexport const Observable = FAST.getById(2 /* observable */, () => {\n const volatileRegex = /(:|&&|\\|\\||if)/;\n const notifierLookup = new WeakMap();\n const queueUpdate = DOM.queueUpdate;\n let watcher = void 0;\n let createArrayObserver = (array) => {\n throw new Error(\"Must call enableArrayObservation before observing arrays.\");\n };\n function getNotifier(source) {\n let found = source.$fastController || notifierLookup.get(source);\n if (found === void 0) {\n if (Array.isArray(source)) {\n found = createArrayObserver(source);\n }\n else {\n notifierLookup.set(source, (found = new PropertyChangeNotifier(source)));\n }\n }\n return found;\n }\n const getAccessors = createMetadataLocator();\n class DefaultObservableAccessor {\n constructor(name) {\n this.name = name;\n this.field = `_${name}`;\n this.callback = `${name}Changed`;\n }\n getValue(source) {\n if (watcher !== void 0) {\n watcher.watch(source, this.name);\n }\n return source[this.field];\n }\n setValue(source, newValue) {\n const field = this.field;\n const oldValue = source[field];\n if (oldValue !== newValue) {\n source[field] = newValue;\n const callback = source[this.callback];\n if (typeof callback === \"function\") {\n callback.call(source, oldValue, newValue);\n }\n getNotifier(source).notify(this.name);\n }\n }\n }\n class BindingObserverImplementation extends SubscriberSet {\n constructor(binding, initialSubscriber, isVolatileBinding = false) {\n super(binding, initialSubscriber);\n this.binding = binding;\n this.isVolatileBinding = isVolatileBinding;\n this.needsRefresh = true;\n this.needsQueue = true;\n this.first = this;\n this.last = null;\n this.propertySource = void 0;\n this.propertyName = void 0;\n this.notifier = void 0;\n this.next = void 0;\n }\n observe(source, context) {\n if (this.needsRefresh && this.last !== null) {\n this.disconnect();\n }\n const previousWatcher = watcher;\n watcher = this.needsRefresh ? this : void 0;\n this.needsRefresh = this.isVolatileBinding;\n const result = this.binding(source, context);\n watcher = previousWatcher;\n return result;\n }\n disconnect() {\n if (this.last !== null) {\n let current = this.first;\n while (current !== void 0) {\n current.notifier.unsubscribe(this, current.propertyName);\n current = current.next;\n }\n this.last = null;\n this.needsRefresh = this.needsQueue = true;\n }\n }\n watch(propertySource, propertyName) {\n const prev = this.last;\n const notifier = getNotifier(propertySource);\n const current = prev === null ? this.first : {};\n current.propertySource = propertySource;\n current.propertyName = propertyName;\n current.notifier = notifier;\n notifier.subscribe(this, propertyName);\n if (prev !== null) {\n if (!this.needsRefresh) {\n // Declaring the variable prior to assignment below circumvents\n // a bug in Angular's optimization process causing infinite recursion\n // of this watch() method. Details https://github.com/microsoft/fast/issues/4969\n let prevValue;\n watcher = void 0;\n /* eslint-disable-next-line */\n prevValue = prev.propertySource[prev.propertyName];\n /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n watcher = this;\n if (propertySource === prevValue) {\n this.needsRefresh = true;\n }\n }\n prev.next = current;\n }\n this.last = current;\n }\n handleChange() {\n if (this.needsQueue) {\n this.needsQueue = false;\n queueUpdate(this);\n }\n }\n call() {\n if (this.last !== null) {\n this.needsQueue = true;\n this.notify(this);\n }\n }\n records() {\n let next = this.first;\n return {\n next: () => {\n const current = next;\n if (current === undefined) {\n return { value: void 0, done: true };\n }\n else {\n next = next.next;\n return {\n value: current,\n done: false,\n };\n }\n },\n [Symbol.iterator]: function () {\n return this;\n },\n };\n }\n }\n return Object.freeze({\n /**\n * @internal\n * @param factory - The factory used to create array observers.\n */\n setArrayObserverFactory(factory) {\n createArrayObserver = factory;\n },\n /**\n * Gets a notifier for an object or Array.\n * @param source - The object or Array to get the notifier for.\n */\n getNotifier,\n /**\n * Records a property change for a source object.\n * @param source - The object to record the change against.\n * @param propertyName - The property to track as changed.\n */\n track(source, propertyName) {\n if (watcher !== void 0) {\n watcher.watch(source, propertyName);\n }\n },\n /**\n * Notifies watchers that the currently executing property getter or function is volatile\n * with respect to its observable dependencies.\n */\n trackVolatile() {\n if (watcher !== void 0) {\n watcher.needsRefresh = true;\n }\n },\n /**\n * Notifies subscribers of a source object of changes.\n * @param source - the object to notify of changes.\n * @param args - The change args to pass to subscribers.\n */\n notify(source, args) {\n getNotifier(source).notify(args);\n },\n /**\n * Defines an observable property on an object or prototype.\n * @param target - The target object to define the observable on.\n * @param nameOrAccessor - The name of the property to define as observable;\n * or a custom accessor that specifies the property name and accessor implementation.\n */\n defineProperty(target, nameOrAccessor) {\n if (typeof nameOrAccessor === \"string\") {\n nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor);\n }\n getAccessors(target).push(nameOrAccessor);\n Reflect.defineProperty(target, nameOrAccessor.name, {\n enumerable: true,\n get: function () {\n return nameOrAccessor.getValue(this);\n },\n set: function (newValue) {\n nameOrAccessor.setValue(this, newValue);\n },\n });\n },\n /**\n * Finds all the observable accessors defined on the target,\n * including its prototype chain.\n * @param target - The target object to search for accessor on.\n */\n getAccessors,\n /**\n * Creates a {@link BindingObserver} that can watch the\n * provided {@link Binding} for changes.\n * @param binding - The binding to observe.\n * @param initialSubscriber - An initial subscriber to changes in the binding value.\n * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation.\n */\n binding(binding, initialSubscriber, isVolatileBinding = this.isVolatileBinding(binding)) {\n return new BindingObserverImplementation(binding, initialSubscriber, isVolatileBinding);\n },\n /**\n * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated\n * on every evaluation of the value.\n * @param binding - The binding to inspect.\n */\n isVolatileBinding(binding) {\n return volatileRegex.test(binding.toString());\n },\n });\n});\n/**\n * Decorator: Defines an observable property on the target.\n * @param target - The target to define the observable on.\n * @param nameOrAccessor - The property name or accessor to define the observable as.\n * @public\n */\nexport function observable(target, nameOrAccessor) {\n Observable.defineProperty(target, nameOrAccessor);\n}\n/**\n * Decorator: Marks a property getter as having volatile observable dependencies.\n * @param target - The target that the property is defined on.\n * @param name - The property name.\n * @param name - The existing descriptor.\n * @public\n */\nexport function volatile(target, name, descriptor) {\n return Object.assign({}, descriptor, {\n get: function () {\n Observable.trackVolatile();\n return descriptor.get.apply(this);\n },\n });\n}\nconst contextEvent = FAST.getById(3 /* contextEvent */, () => {\n let current = null;\n return {\n get() {\n return current;\n },\n set(event) {\n current = event;\n },\n };\n});\n/**\n * Provides additional contextual information available to behaviors and expressions.\n * @public\n */\nexport class ExecutionContext {\n constructor() {\n /**\n * The index of the current item within a repeat context.\n */\n this.index = 0;\n /**\n * The length of the current collection within a repeat context.\n */\n this.length = 0;\n /**\n * The parent data object within a repeat context.\n */\n this.parent = null;\n /**\n * The parent execution context when in nested context scenarios.\n */\n this.parentContext = null;\n }\n /**\n * The current event within an event handler.\n */\n get event() {\n return contextEvent.get();\n }\n /**\n * Indicates whether the current item within a repeat context\n * has an even index.\n */\n get isEven() {\n return this.index % 2 === 0;\n }\n /**\n * Indicates whether the current item within a repeat context\n * has an odd index.\n */\n get isOdd() {\n return this.index % 2 !== 0;\n }\n /**\n * Indicates whether the current item within a repeat context\n * is the first item in the collection.\n */\n get isFirst() {\n return this.index === 0;\n }\n /**\n * Indicates whether the current item within a repeat context\n * is somewhere in the middle of the collection.\n */\n get isInMiddle() {\n return !this.isFirst && !this.isLast;\n }\n /**\n * Indicates whether the current item within a repeat context\n * is the last item in the collection.\n */\n get isLast() {\n return this.index === this.length - 1;\n }\n /**\n * Sets the event for the current execution context.\n * @param event - The event to set.\n * @internal\n */\n static setEvent(event) {\n contextEvent.set(event);\n }\n}\nObservable.defineProperty(ExecutionContext.prototype, \"index\");\nObservable.defineProperty(ExecutionContext.prototype, \"length\");\n/**\n * The default execution context used in binding expressions.\n * @public\n */\nexport const defaultExecutionContext = Object.seal(new ExecutionContext());\n","import { DOM } from \"../dom.js\";\n/**\n * Instructs the template engine to apply behavior to a node.\n * @public\n */\nexport class HTMLDirective {\n constructor() {\n /**\n * The index of the DOM node to which the created behavior will apply.\n */\n this.targetIndex = 0;\n }\n}\n/**\n * A {@link HTMLDirective} that targets a named attribute or property on a node.\n * @public\n */\nexport class TargetedHTMLDirective extends HTMLDirective {\n constructor() {\n super(...arguments);\n /**\n * Creates a placeholder string based on the directive's index within the template.\n * @param index - The index of the directive within the template.\n */\n this.createPlaceholder = DOM.createInterpolationPlaceholder;\n }\n}\n/**\n * A directive that attaches special behavior to an element via a custom attribute.\n * @public\n */\nexport class AttachedBehaviorHTMLDirective extends HTMLDirective {\n /**\n *\n * @param name - The name of the behavior; used as a custom attribute on the element.\n * @param behavior - The behavior to instantiate and attach to the element.\n * @param options - Options to pass to the behavior during creation.\n */\n constructor(name, behavior, options) {\n super();\n this.name = name;\n this.behavior = behavior;\n this.options = options;\n }\n /**\n * Creates a placeholder string based on the directive's index within the template.\n * @param index - The index of the directive within the template.\n * @remarks\n * Creates a custom attribute placeholder.\n */\n createPlaceholder(index) {\n return DOM.createCustomAttributePlaceholder(this.name, index);\n }\n /**\n * Creates a behavior for the provided target node.\n * @param target - The node instance to create the behavior for.\n * @remarks\n * Creates an instance of the `behavior` type this directive was constructed with\n * and passes the target and options to that `behavior`'s constructor.\n */\n createBehavior(target) {\n return new this.behavior(target, this.options);\n }\n}\n","import { DOM } from \"../dom.js\";\nimport { ExecutionContext, Observable, } from \"../observation/observable.js\";\nimport { TargetedHTMLDirective } from \"./html-directive.js\";\nfunction normalBind(source, context) {\n this.source = source;\n this.context = context;\n if (this.bindingObserver === null) {\n this.bindingObserver = Observable.binding(this.binding, this, this.isBindingVolatile);\n }\n this.updateTarget(this.bindingObserver.observe(source, context));\n}\nfunction triggerBind(source, context) {\n this.source = source;\n this.context = context;\n this.target.addEventListener(this.targetName, this);\n}\nfunction normalUnbind() {\n this.bindingObserver.disconnect();\n this.source = null;\n this.context = null;\n}\nfunction contentUnbind() {\n this.bindingObserver.disconnect();\n this.source = null;\n this.context = null;\n const view = this.target.$fastView;\n if (view !== void 0 && view.isComposed) {\n view.unbind();\n view.needsBindOnly = true;\n }\n}\nfunction triggerUnbind() {\n this.target.removeEventListener(this.targetName, this);\n this.source = null;\n this.context = null;\n}\nfunction updateAttributeTarget(value) {\n DOM.setAttribute(this.target, this.targetName, value);\n}\nfunction updateBooleanAttributeTarget(value) {\n DOM.setBooleanAttribute(this.target, this.targetName, value);\n}\nfunction updateContentTarget(value) {\n // If there's no actual value, then this equates to the\n // empty string for the purposes of content bindings.\n if (value === null || value === undefined) {\n value = \"\";\n }\n // If the value has a \"create\" method, then it's a template-like.\n if (value.create) {\n this.target.textContent = \"\";\n let view = this.target.$fastView;\n // If there's no previous view that we might be able to\n // reuse then create a new view from the template.\n if (view === void 0) {\n view = value.create();\n }\n else {\n // If there is a previous view, but it wasn't created\n // from the same template as the new value, then we\n // need to remove the old view if it's still in the DOM\n // and create a new view from the template.\n if (this.target.$fastTemplate !== value) {\n if (view.isComposed) {\n view.remove();\n view.unbind();\n }\n view = value.create();\n }\n }\n // It's possible that the value is the same as the previous template\n // and that there's actually no need to compose it.\n if (!view.isComposed) {\n view.isComposed = true;\n view.bind(this.source, this.context);\n view.insertBefore(this.target);\n this.target.$fastView = view;\n this.target.$fastTemplate = value;\n }\n else if (view.needsBindOnly) {\n view.needsBindOnly = false;\n view.bind(this.source, this.context);\n }\n }\n else {\n const view = this.target.$fastView;\n // If there is a view and it's currently composed into\n // the DOM, then we need to remove it.\n if (view !== void 0 && view.isComposed) {\n view.isComposed = false;\n view.remove();\n if (view.needsBindOnly) {\n view.needsBindOnly = false;\n }\n else {\n view.unbind();\n }\n }\n this.target.textContent = value;\n }\n}\nfunction updatePropertyTarget(value) {\n this.target[this.targetName] = value;\n}\nfunction updateClassTarget(value) {\n const classVersions = this.classVersions || Object.create(null);\n const target = this.target;\n let version = this.version || 0;\n // Add the classes, tracking the version at which they were added.\n if (value !== null && value !== undefined && value.length) {\n const names = value.split(/\\s+/);\n for (let i = 0, ii = names.length; i < ii; ++i) {\n const currentName = names[i];\n if (currentName === \"\") {\n continue;\n }\n classVersions[currentName] = version;\n target.classList.add(currentName);\n }\n }\n this.classVersions = classVersions;\n this.version = version + 1;\n // If this is the first call to add classes, there's no need to remove old ones.\n if (version === 0) {\n return;\n }\n // Remove classes from the previous version.\n version -= 1;\n for (const name in classVersions) {\n if (classVersions[name] === version) {\n target.classList.remove(name);\n }\n }\n}\n/**\n * A directive that configures data binding to element content and attributes.\n * @public\n */\nexport class HTMLBindingDirective extends TargetedHTMLDirective {\n /**\n * Creates an instance of BindingDirective.\n * @param binding - A binding that returns the data used to update the DOM.\n */\n constructor(binding) {\n super();\n this.binding = binding;\n this.bind = normalBind;\n this.unbind = normalUnbind;\n this.updateTarget = updateAttributeTarget;\n this.isBindingVolatile = Observable.isVolatileBinding(this.binding);\n }\n /**\n * Gets/sets the name of the attribute or property that this\n * binding is targeting.\n */\n get targetName() {\n return this.originalTargetName;\n }\n set targetName(value) {\n this.originalTargetName = value;\n if (value === void 0) {\n return;\n }\n switch (value[0]) {\n case \":\":\n this.cleanedTargetName = value.substr(1);\n this.updateTarget = updatePropertyTarget;\n if (this.cleanedTargetName === \"innerHTML\") {\n const binding = this.binding;\n this.binding = (s, c) => DOM.createHTML(binding(s, c));\n }\n break;\n case \"?\":\n this.cleanedTargetName = value.substr(1);\n this.updateTarget = updateBooleanAttributeTarget;\n break;\n case \"@\":\n this.cleanedTargetName = value.substr(1);\n this.bind = triggerBind;\n this.unbind = triggerUnbind;\n break;\n default:\n this.cleanedTargetName = value;\n if (value === \"class\") {\n this.updateTarget = updateClassTarget;\n }\n break;\n }\n }\n /**\n * Makes this binding target the content of an element rather than\n * a particular attribute or property.\n */\n targetAtContent() {\n this.updateTarget = updateContentTarget;\n this.unbind = contentUnbind;\n }\n /**\n * Creates the runtime BindingBehavior instance based on the configuration\n * information stored in the BindingDirective.\n * @param target - The target node that the binding behavior should attach to.\n */\n createBehavior(target) {\n /* eslint-disable-next-line @typescript-eslint/no-use-before-define */\n return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName);\n }\n}\n/**\n * A behavior that updates content and attributes based on a configured\n * BindingDirective.\n * @public\n */\nexport class BindingBehavior {\n /**\n * Creates an instance of BindingBehavior.\n * @param target - The target of the data updates.\n * @param binding - The binding that returns the latest value for an update.\n * @param isBindingVolatile - Indicates whether the binding has volatile dependencies.\n * @param bind - The operation to perform during binding.\n * @param unbind - The operation to perform during unbinding.\n * @param updateTarget - The operation to perform when updating.\n * @param targetName - The name of the target attribute or property to update.\n */\n constructor(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) {\n /** @internal */\n this.source = null;\n /** @internal */\n this.context = null;\n /** @internal */\n this.bindingObserver = null;\n this.target = target;\n this.binding = binding;\n this.isBindingVolatile = isBindingVolatile;\n this.bind = bind;\n this.unbind = unbind;\n this.updateTarget = updateTarget;\n this.targetName = targetName;\n }\n /** @internal */\n handleChange() {\n this.updateTarget(this.bindingObserver.observe(this.source, this.context));\n }\n /** @internal */\n handleEvent(event) {\n ExecutionContext.setEvent(event);\n const result = this.binding(this.source, this.context);\n ExecutionContext.setEvent(null);\n if (result !== true) {\n event.preventDefault();\n }\n }\n}\n","import { _interpolationEnd, _interpolationStart, DOM } from \"../dom.js\";\nimport { HTMLBindingDirective } from \"./binding.js\";\nlet sharedContext = null;\nclass CompilationContext {\n addFactory(factory) {\n factory.targetIndex = this.targetIndex;\n this.behaviorFactories.push(factory);\n }\n captureContentBinding(directive) {\n directive.targetAtContent();\n this.addFactory(directive);\n }\n reset() {\n this.behaviorFactories = [];\n this.targetIndex = -1;\n }\n release() {\n /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n sharedContext = this;\n }\n static borrow(directives) {\n const shareable = sharedContext || new CompilationContext();\n shareable.directives = directives;\n shareable.reset();\n sharedContext = null;\n return shareable;\n }\n}\nfunction createAggregateBinding(parts) {\n if (parts.length === 1) {\n return parts[0];\n }\n let targetName;\n const partCount = parts.length;\n const finalParts = parts.map((x) => {\n if (typeof x === \"string\") {\n return () => x;\n }\n targetName = x.targetName || targetName;\n return x.binding;\n });\n const binding = (scope, context) => {\n let output = \"\";\n for (let i = 0; i < partCount; ++i) {\n output += finalParts[i](scope, context);\n }\n return output;\n };\n const directive = new HTMLBindingDirective(binding);\n directive.targetName = targetName;\n return directive;\n}\nconst interpolationEndLength = _interpolationEnd.length;\nfunction parseContent(context, value) {\n const valueParts = value.split(_interpolationStart);\n if (valueParts.length === 1) {\n return null;\n }\n const bindingParts = [];\n for (let i = 0, ii = valueParts.length; i < ii; ++i) {\n const current = valueParts[i];\n const index = current.indexOf(_interpolationEnd);\n let literal;\n if (index === -1) {\n literal = current;\n }\n else {\n const directiveIndex = parseInt(current.substring(0, index));\n bindingParts.push(context.directives[directiveIndex]);\n literal = current.substring(index + interpolationEndLength);\n }\n if (literal !== \"\") {\n bindingParts.push(literal);\n }\n }\n return bindingParts;\n}\nfunction compileAttributes(context, node, includeBasicValues = false) {\n const attributes = node.attributes;\n for (let i = 0, ii = attributes.length; i < ii; ++i) {\n const attr = attributes[i];\n const attrValue = attr.value;\n const parseResult = parseContent(context, attrValue);\n let result = null;\n if (parseResult === null) {\n if (includeBasicValues) {\n result = new HTMLBindingDirective(() => attrValue);\n result.targetName = attr.name;\n }\n }\n else {\n result = createAggregateBinding(parseResult);\n }\n if (result !== null) {\n node.removeAttributeNode(attr);\n i--;\n ii--;\n context.addFactory(result);\n }\n }\n}\nfunction compileContent(context, node, walker) {\n const parseResult = parseContent(context, node.textContent);\n if (parseResult !== null) {\n let lastNode = node;\n for (let i = 0, ii = parseResult.length; i < ii; ++i) {\n const currentPart = parseResult[i];\n const currentNode = i === 0\n ? node\n : lastNode.parentNode.insertBefore(document.createTextNode(\"\"), lastNode.nextSibling);\n if (typeof currentPart === \"string\") {\n currentNode.textContent = currentPart;\n }\n else {\n currentNode.textContent = \" \";\n context.captureContentBinding(currentPart);\n }\n lastNode = currentNode;\n context.targetIndex++;\n if (currentNode !== node) {\n walker.nextNode();\n }\n }\n context.targetIndex--;\n }\n}\n/**\n * Compiles a template and associated directives into a raw compilation\n * result which include a cloneable DocumentFragment and factories capable\n * of attaching runtime behavior to nodes within the fragment.\n * @param template - The template to compile.\n * @param directives - The directives referenced by the template.\n * @remarks\n * The template that is provided for compilation is altered in-place\n * and cannot be compiled again. If the original template must be preserved,\n * it is recommended that you clone the original and pass the clone to this API.\n * @public\n */\nexport function compileTemplate(template, directives) {\n const fragment = template.content;\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1111864\n document.adoptNode(fragment);\n const context = CompilationContext.borrow(directives);\n compileAttributes(context, template, true);\n const hostBehaviorFactories = context.behaviorFactories;\n context.reset();\n const walker = DOM.createTemplateWalker(fragment);\n let node;\n while ((node = walker.nextNode())) {\n context.targetIndex++;\n switch (node.nodeType) {\n case 1: // element node\n compileAttributes(context, node);\n break;\n case 3: // text node\n compileContent(context, node, walker);\n break;\n case 8: // comment\n if (DOM.isMarker(node)) {\n context.addFactory(directives[DOM.extractDirectiveIndexFromMarker(node)]);\n }\n }\n }\n let targetOffset = 0;\n if (\n // If the first node in a fragment is a marker, that means it's an unstable first node,\n // because something like a when, repeat, etc. could add nodes before the marker.\n // To mitigate this, we insert a stable first node. However, if we insert a node,\n // that will alter the result of the TreeWalker. So, we also need to offset the target index.\n DOM.isMarker(fragment.firstChild) ||\n // Or if there is only one node and a directive, it means the template's content\n // is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by\n // the directive. Inserting a new node ensures proper disposal of nodes added by the directive.\n (fragment.childNodes.length === 1 && directives.length)) {\n fragment.insertBefore(document.createComment(\"\"), fragment.firstChild);\n targetOffset = -1;\n }\n const viewBehaviorFactories = context.behaviorFactories;\n context.release();\n return {\n fragment,\n viewBehaviorFactories,\n hostBehaviorFactories,\n targetOffset,\n };\n}\n","// A singleton Range instance used to efficiently remove ranges of DOM nodes.\n// See the implementation of HTMLView below for further details.\nconst range = document.createRange();\n/**\n * The standard View implementation, which also implements ElementView and SyntheticView.\n * @public\n */\nexport class HTMLView {\n /**\n * Constructs an instance of HTMLView.\n * @param fragment - The html fragment that contains the nodes for this view.\n * @param behaviors - The behaviors to be applied to this view.\n */\n constructor(fragment, behaviors) {\n this.fragment = fragment;\n this.behaviors = behaviors;\n /**\n * The data that the view is bound to.\n */\n this.source = null;\n /**\n * The execution context the view is running within.\n */\n this.context = null;\n this.firstChild = fragment.firstChild;\n this.lastChild = fragment.lastChild;\n }\n /**\n * Appends the view's DOM nodes to the referenced node.\n * @param node - The parent node to append the view's DOM nodes to.\n */\n appendTo(node) {\n node.appendChild(this.fragment);\n }\n /**\n * Inserts the view's DOM nodes before the referenced node.\n * @param node - The node to insert the view's DOM before.\n */\n insertBefore(node) {\n if (this.fragment.hasChildNodes()) {\n node.parentNode.insertBefore(this.fragment, node);\n }\n else {\n const end = this.lastChild;\n if (node.previousSibling === end)\n return;\n const parentNode = node.parentNode;\n let current = this.firstChild;\n let next;\n while (current !== end) {\n next = current.nextSibling;\n parentNode.insertBefore(current, node);\n current = next;\n }\n parentNode.insertBefore(end, node);\n }\n }\n /**\n * Removes the view's DOM nodes.\n * The nodes are not disposed and the view can later be re-inserted.\n */\n remove() {\n const fragment = this.fragment;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n while (current !== end) {\n next = current.nextSibling;\n fragment.appendChild(current);\n current = next;\n }\n fragment.appendChild(end);\n }\n /**\n * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward.\n * Once a view has been disposed, it cannot be inserted or bound again.\n */\n dispose() {\n const parent = this.firstChild.parentNode;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n while (current !== end) {\n next = current.nextSibling;\n parent.removeChild(current);\n current = next;\n }\n parent.removeChild(end);\n const behaviors = this.behaviors;\n const oldSource = this.source;\n for (let i = 0, ii = behaviors.length; i < ii; ++i) {\n behaviors[i].unbind(oldSource);\n }\n }\n /**\n * Binds a view's behaviors to its binding source.\n * @param source - The binding source for the view's binding behaviors.\n * @param context - The execution context to run the behaviors within.\n */\n bind(source, context) {\n const behaviors = this.behaviors;\n if (this.source === source) {\n return;\n }\n else if (this.source !== null) {\n const oldSource = this.source;\n this.source = source;\n this.context = context;\n for (let i = 0, ii = behaviors.length; i < ii; ++i) {\n const current = behaviors[i];\n current.unbind(oldSource);\n current.bind(source, context);\n }\n }\n else {\n this.source = source;\n this.context = context;\n for (let i = 0, ii = behaviors.length; i < ii; ++i) {\n behaviors[i].bind(source, context);\n }\n }\n }\n /**\n * Unbinds a view's behaviors from its binding source.\n */\n unbind() {\n if (this.source === null) {\n return;\n }\n const behaviors = this.behaviors;\n const oldSource = this.source;\n for (let i = 0, ii = behaviors.length; i < ii; ++i) {\n behaviors[i].unbind(oldSource);\n }\n this.source = null;\n }\n /**\n * Efficiently disposes of a contiguous range of synthetic view instances.\n * @param views - A contiguous range of views to be disposed.\n */\n static disposeContiguousBatch(views) {\n if (views.length === 0) {\n return;\n }\n range.setStartBefore(views[0].firstChild);\n range.setEndAfter(views[views.length - 1].lastChild);\n range.deleteContents();\n for (let i = 0, ii = views.length; i < ii; ++i) {\n const view = views[i];\n const behaviors = view.behaviors;\n const oldSource = view.source;\n for (let j = 0, jj = behaviors.length; j < jj; ++j) {\n behaviors[j].unbind(oldSource);\n }\n }\n }\n}\n","import { DOM } from \"../dom.js\";\nimport { defaultExecutionContext } from \"../observation/observable.js\";\nimport { compileTemplate } from \"./compiler.js\";\nimport { HTMLView } from \"./view.js\";\nimport { HTMLDirective, TargetedHTMLDirective, } from \"./html-directive.js\";\nimport { HTMLBindingDirective } from \"./binding.js\";\n/**\n * A template capable of creating HTMLView instances or rendering directly to DOM.\n * @public\n */\n/* eslint-disable-next-line @typescript-eslint/no-unused-vars */\nexport class ViewTemplate {\n /**\n * Creates an instance of ViewTemplate.\n * @param html - The html representing what this template will instantiate, including placeholders for directives.\n * @param directives - The directives that will be connected to placeholders in the html.\n */\n constructor(html, directives) {\n this.behaviorCount = 0;\n this.hasHostBehaviors = false;\n this.fragment = null;\n this.targetOffset = 0;\n this.viewBehaviorFactories = null;\n this.hostBehaviorFactories = null;\n this.html = html;\n this.directives = directives;\n }\n /**\n * Creates an HTMLView instance based on this template definition.\n * @param hostBindingTarget - The element that host behaviors will be bound to.\n */\n create(hostBindingTarget) {\n if (this.fragment === null) {\n let template;\n const html = this.html;\n if (typeof html === \"string\") {\n template = document.createElement(\"template\");\n template.innerHTML = DOM.createHTML(html);\n const fec = template.content.firstElementChild;\n if (fec !== null && fec.tagName === \"TEMPLATE\") {\n template = fec;\n }\n }\n else {\n template = html;\n }\n const result = compileTemplate(template, this.directives);\n this.fragment = result.fragment;\n this.viewBehaviorFactories = result.viewBehaviorFactories;\n this.hostBehaviorFactories = result.hostBehaviorFactories;\n this.targetOffset = result.targetOffset;\n this.behaviorCount =\n this.viewBehaviorFactories.length + this.hostBehaviorFactories.length;\n this.hasHostBehaviors = this.hostBehaviorFactories.length > 0;\n }\n const fragment = this.fragment.cloneNode(true);\n const viewFactories = this.viewBehaviorFactories;\n const behaviors = new Array(this.behaviorCount);\n const walker = DOM.createTemplateWalker(fragment);\n let behaviorIndex = 0;\n let targetIndex = this.targetOffset;\n let node = walker.nextNode();\n for (let ii = viewFactories.length; behaviorIndex < ii; ++behaviorIndex) {\n const factory = viewFactories[behaviorIndex];\n const factoryIndex = factory.targetIndex;\n while (node !== null) {\n if (targetIndex === factoryIndex) {\n behaviors[behaviorIndex] = factory.createBehavior(node);\n break;\n }\n else {\n node = walker.nextNode();\n targetIndex++;\n }\n }\n }\n if (this.hasHostBehaviors) {\n const hostFactories = this.hostBehaviorFactories;\n for (let i = 0, ii = hostFactories.length; i < ii; ++i, ++behaviorIndex) {\n behaviors[behaviorIndex] = hostFactories[i].createBehavior(hostBindingTarget);\n }\n }\n return new HTMLView(fragment, behaviors);\n }\n /**\n * Creates an HTMLView from this template, binds it to the source, and then appends it to the host.\n * @param source - The data source to bind the template to.\n * @param host - The Element where the template will be rendered.\n * @param hostBindingTarget - An HTML element to target the host bindings at if different from the\n * host that the template is being attached to.\n */\n render(source, host, hostBindingTarget) {\n if (typeof host === \"string\") {\n host = document.getElementById(host);\n }\n if (hostBindingTarget === void 0) {\n hostBindingTarget = host;\n }\n const view = this.create(hostBindingTarget);\n view.bind(source, defaultExecutionContext);\n view.appendTo(host);\n return view;\n }\n}\n// Much thanks to LitHTML for working this out!\nconst lastAttributeNameRegex = \n/* eslint-disable-next-line no-control-regex */\n/([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n/**\n * Transforms a template literal string into a renderable ViewTemplate.\n * @param strings - The string fragments that are interpolated with the values.\n * @param values - The values that are interpolated with the string fragments.\n * @remarks\n * The html helper supports interpolation of strings, numbers, binding expressions,\n * other template instances, and Directive instances.\n * @public\n */\nexport function html(strings, ...values) {\n const directives = [];\n let html = \"\";\n for (let i = 0, ii = strings.length - 1; i < ii; ++i) {\n const currentString = strings[i];\n let value = values[i];\n html += currentString;\n if (value instanceof ViewTemplate) {\n const template = value;\n value = () => template;\n }\n if (typeof value === \"function\") {\n value = new HTMLBindingDirective(value);\n }\n if (value instanceof TargetedHTMLDirective) {\n const match = lastAttributeNameRegex.exec(currentString);\n if (match !== null) {\n value.targetName = match[2];\n }\n }\n if (value instanceof HTMLDirective) {\n // Since not all values are directives, we can't use i\n // as the index for the placeholder. Instead, we need to\n // use directives.length to get the next index.\n html += value.createPlaceholder(directives.length);\n directives.push(value);\n }\n else {\n html += value;\n }\n }\n html += strings[strings.length - 1];\n return new ViewTemplate(html, directives);\n}\n","import { DOM } from \"../dom.js\";\n/**\n * Represents styles that can be applied to a custom element.\n * @public\n */\nexport class ElementStyles {\n constructor() {\n this.targets = new WeakSet();\n }\n /** @internal */\n addStylesTo(target) {\n this.targets.add(target);\n }\n /** @internal */\n removeStylesFrom(target) {\n this.targets.delete(target);\n }\n /** @internal */\n isAttachedTo(target) {\n return this.targets.has(target);\n }\n /**\n * Associates behaviors with this set of styles.\n * @param behaviors - The behaviors to associate.\n */\n withBehaviors(...behaviors) {\n this.behaviors =\n this.behaviors === null ? behaviors : this.behaviors.concat(behaviors);\n return this;\n }\n}\n/**\n * Create ElementStyles from ComposableStyles.\n */\nElementStyles.create = (() => {\n if (DOM.supportsAdoptedStyleSheets) {\n const styleSheetCache = new Map();\n return (styles) => \n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n new AdoptedStyleSheetsStyles(styles, styleSheetCache);\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return (styles) => new StyleElementStyles(styles);\n})();\nfunction reduceStyles(styles) {\n return styles\n .map((x) => x instanceof ElementStyles ? reduceStyles(x.styles) : [x])\n .reduce((prev, curr) => prev.concat(curr), []);\n}\nfunction reduceBehaviors(styles) {\n return styles\n .map((x) => (x instanceof ElementStyles ? x.behaviors : null))\n .reduce((prev, curr) => {\n if (curr === null) {\n return prev;\n }\n if (prev === null) {\n prev = [];\n }\n return prev.concat(curr);\n }, null);\n}\n/**\n * https://wicg.github.io/construct-stylesheets/\n * https://developers.google.com/web/updates/2019/02/constructable-stylesheets\n *\n * @internal\n */\nexport class AdoptedStyleSheetsStyles extends ElementStyles {\n constructor(styles, styleSheetCache) {\n super();\n this.styles = styles;\n this.styleSheetCache = styleSheetCache;\n this._styleSheets = void 0;\n this.behaviors = reduceBehaviors(styles);\n }\n get styleSheets() {\n if (this._styleSheets === void 0) {\n const styles = this.styles;\n const styleSheetCache = this.styleSheetCache;\n this._styleSheets = reduceStyles(styles).map((x) => {\n if (x instanceof CSSStyleSheet) {\n return x;\n }\n let sheet = styleSheetCache.get(x);\n if (sheet === void 0) {\n sheet = new CSSStyleSheet();\n sheet.replaceSync(x);\n styleSheetCache.set(x, sheet);\n }\n return sheet;\n });\n }\n return this._styleSheets;\n }\n addStylesTo(target) {\n target.adoptedStyleSheets = [...target.adoptedStyleSheets, ...this.styleSheets];\n super.addStylesTo(target);\n }\n removeStylesFrom(target) {\n const sourceSheets = this.styleSheets;\n target.adoptedStyleSheets = target.adoptedStyleSheets.filter((x) => sourceSheets.indexOf(x) === -1);\n super.removeStylesFrom(target);\n }\n}\nlet styleClassId = 0;\nfunction getNextStyleClass() {\n return `fast-style-class-${++styleClassId}`;\n}\n/**\n * @internal\n */\nexport class StyleElementStyles extends ElementStyles {\n constructor(styles) {\n super();\n this.styles = styles;\n this.behaviors = null;\n this.behaviors = reduceBehaviors(styles);\n this.styleSheets = reduceStyles(styles);\n this.styleClass = getNextStyleClass();\n }\n addStylesTo(target) {\n const styleSheets = this.styleSheets;\n const styleClass = this.styleClass;\n target = this.normalizeTarget(target);\n for (let i = 0; i < styleSheets.length; i++) {\n const element = document.createElement(\"style\");\n element.innerHTML = styleSheets[i];\n element.className = styleClass;\n target.append(element);\n }\n super.addStylesTo(target);\n }\n removeStylesFrom(target) {\n target = this.normalizeTarget(target);\n const styles = target.querySelectorAll(`.${this.styleClass}`);\n for (let i = 0, ii = styles.length; i < ii; ++i) {\n target.removeChild(styles[i]);\n }\n super.removeStylesFrom(target);\n }\n isAttachedTo(target) {\n return super.isAttachedTo(this.normalizeTarget(target));\n }\n normalizeTarget(target) {\n return target === document ? document.body : target;\n }\n}\n","import { Observable } from \"../observation/observable.js\";\nimport { DOM } from \"../dom.js\";\nimport { createMetadataLocator } from \"../platform.js\";\n/**\n * Metadata used to configure a custom attribute's behavior.\n * @public\n */\nexport const AttributeConfiguration = Object.freeze({\n /**\n * Locates all attribute configurations associated with a type.\n */\n locate: createMetadataLocator(),\n});\n/**\n * A {@link ValueConverter} that converts to and from `boolean` values.\n * @remarks\n * Used automatically when the `boolean` {@link AttributeMode} is selected.\n * @public\n */\nexport const booleanConverter = {\n toView(value) {\n return value ? \"true\" : \"false\";\n },\n fromView(value) {\n if (value === null ||\n value === void 0 ||\n value === \"false\" ||\n value === false ||\n value === 0) {\n return false;\n }\n return true;\n },\n};\n/**\n * A {@link ValueConverter} that converts to and from `number` values.\n * @remarks\n * This converter allows for nullable numbers, returning `null` if the\n * input was `null`, `undefined`, or `NaN`.\n * @public\n */\nexport const nullableNumberConverter = {\n toView(value) {\n if (value === null || value === undefined) {\n return null;\n }\n const number = value * 1;\n return isNaN(number) ? null : number.toString();\n },\n fromView(value) {\n if (value === null || value === undefined) {\n return null;\n }\n const number = value * 1;\n return isNaN(number) ? null : number;\n },\n};\n/**\n * An implementation of {@link Accessor} that supports reactivity,\n * change callbacks, attribute reflection, and type conversion for\n * custom elements.\n * @public\n */\nexport class AttributeDefinition {\n /**\n * Creates an instance of AttributeDefinition.\n * @param Owner - The class constructor that owns this attribute.\n * @param name - The name of the property associated with the attribute.\n * @param attribute - The name of the attribute in HTML.\n * @param mode - The {@link AttributeMode} that describes the behavior of this attribute.\n * @param converter - A {@link ValueConverter} that integrates with the property getter/setter\n * to convert values to and from a DOM string.\n */\n constructor(Owner, name, attribute = name.toLowerCase(), mode = \"reflect\", converter) {\n this.guards = new Set();\n this.Owner = Owner;\n this.name = name;\n this.attribute = attribute;\n this.mode = mode;\n this.converter = converter;\n this.fieldName = `_${name}`;\n this.callbackName = `${name}Changed`;\n this.hasCallback = this.callbackName in Owner.prototype;\n if (mode === \"boolean\" && converter === void 0) {\n this.converter = booleanConverter;\n }\n }\n /**\n * Sets the value of the attribute/property on the source element.\n * @param source - The source element to access.\n * @param value - The value to set the attribute/property to.\n */\n setValue(source, newValue) {\n const oldValue = source[this.fieldName];\n const converter = this.converter;\n if (converter !== void 0) {\n newValue = converter.fromView(newValue);\n }\n if (oldValue !== newValue) {\n source[this.fieldName] = newValue;\n this.tryReflectToAttribute(source);\n if (this.hasCallback) {\n source[this.callbackName](oldValue, newValue);\n }\n source.$fastController.notify(this.name);\n }\n }\n /**\n * Gets the value of the attribute/property on the source element.\n * @param source - The source element to access.\n */\n getValue(source) {\n Observable.track(source, this.name);\n return source[this.fieldName];\n }\n /** @internal */\n onAttributeChangedCallback(element, value) {\n if (this.guards.has(element)) {\n return;\n }\n this.guards.add(element);\n this.setValue(element, value);\n this.guards.delete(element);\n }\n tryReflectToAttribute(element) {\n const mode = this.mode;\n const guards = this.guards;\n if (guards.has(element) || mode === \"fromView\") {\n return;\n }\n DOM.queueUpdate(() => {\n guards.add(element);\n const latestValue = element[this.fieldName];\n switch (mode) {\n case \"reflect\":\n const converter = this.converter;\n DOM.setAttribute(element, this.attribute, converter !== void 0 ? converter.toView(latestValue) : latestValue);\n break;\n case \"boolean\":\n DOM.setBooleanAttribute(element, this.attribute, latestValue);\n break;\n }\n guards.delete(element);\n });\n }\n /**\n * Collects all attribute definitions associated with the owner.\n * @param Owner - The class constructor to collect attribute for.\n * @param attributeLists - Any existing attributes to collect and merge with those associated with the owner.\n * @internal\n */\n static collect(Owner, ...attributeLists) {\n const attributes = [];\n attributeLists.push(AttributeConfiguration.locate(Owner));\n for (let i = 0, ii = attributeLists.length; i < ii; ++i) {\n const list = attributeLists[i];\n if (list === void 0) {\n continue;\n }\n for (let j = 0, jj = list.length; j < jj; ++j) {\n const config = list[j];\n if (typeof config === \"string\") {\n attributes.push(new AttributeDefinition(Owner, config));\n }\n else {\n attributes.push(new AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter));\n }\n }\n }\n return attributes;\n }\n}\nexport function attr(configOrTarget, prop) {\n let config;\n function decorator($target, $prop) {\n if (arguments.length > 1) {\n // Non invocation:\n // - @attr\n // Invocation with or w/o opts:\n // - @attr()\n // - @attr({...opts})\n config.property = $prop;\n }\n AttributeConfiguration.locate($target.constructor).push(config);\n }\n if (arguments.length > 1) {\n // Non invocation:\n // - @attr\n config = {};\n decorator(configOrTarget, prop);\n return;\n }\n // Invocation with or w/o opts:\n // - @attr()\n // - @attr({...opts})\n config = configOrTarget === void 0 ? {} : configOrTarget;\n return decorator;\n}\n","import { FAST } from \"../platform.js\";\nimport { Observable } from \"../observation/observable.js\";\nimport { ElementStyles } from \"../styles/element-styles.js\";\nimport { AttributeDefinition } from \"./attributes.js\";\nconst defaultShadowOptions = { mode: \"open\" };\nconst defaultElementOptions = {};\nconst fastRegistry = FAST.getById(4 /* elementRegistry */, () => {\n const typeToDefinition = new Map();\n return Object.freeze({\n register(definition) {\n if (typeToDefinition.has(definition.type)) {\n return false;\n }\n typeToDefinition.set(definition.type, definition);\n return true;\n },\n getByType(key) {\n return typeToDefinition.get(key);\n },\n });\n});\n/**\n * Defines metadata for a FASTElement.\n * @public\n */\nexport class FASTElementDefinition {\n /**\n * Creates an instance of FASTElementDefinition.\n * @param type - The type this definition is being created for.\n * @param nameOrConfig - The name of the element to define or a config object\n * that describes the element to define.\n */\n constructor(type, nameOrConfig = type.definition) {\n if (typeof nameOrConfig === \"string\") {\n nameOrConfig = { name: nameOrConfig };\n }\n this.type = type;\n this.name = nameOrConfig.name;\n this.template = nameOrConfig.template;\n const attributes = AttributeDefinition.collect(type, nameOrConfig.attributes);\n const observedAttributes = new Array(attributes.length);\n const propertyLookup = {};\n const attributeLookup = {};\n for (let i = 0, ii = attributes.length; i < ii; ++i) {\n const current = attributes[i];\n observedAttributes[i] = current.attribute;\n propertyLookup[current.name] = current;\n attributeLookup[current.attribute] = current;\n }\n this.attributes = attributes;\n this.observedAttributes = observedAttributes;\n this.propertyLookup = propertyLookup;\n this.attributeLookup = attributeLookup;\n this.shadowOptions =\n nameOrConfig.shadowOptions === void 0\n ? defaultShadowOptions\n : nameOrConfig.shadowOptions === null\n ? void 0\n : Object.assign(Object.assign({}, defaultShadowOptions), nameOrConfig.shadowOptions);\n this.elementOptions =\n nameOrConfig.elementOptions === void 0\n ? defaultElementOptions\n : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions);\n this.styles =\n nameOrConfig.styles === void 0\n ? void 0\n : Array.isArray(nameOrConfig.styles)\n ? ElementStyles.create(nameOrConfig.styles)\n : nameOrConfig.styles instanceof ElementStyles\n ? nameOrConfig.styles\n : ElementStyles.create([nameOrConfig.styles]);\n }\n /**\n * Indicates if this element has been defined in at least one registry.\n */\n get isDefined() {\n return !!fastRegistry.getByType(this.type);\n }\n /**\n * Defines a custom element based on this definition.\n * @param registry - The element registry to define the element in.\n */\n define(registry = customElements) {\n const type = this.type;\n if (fastRegistry.register(this)) {\n const attributes = this.attributes;\n const proto = type.prototype;\n for (let i = 0, ii = attributes.length; i < ii; ++i) {\n Observable.defineProperty(proto, attributes[i]);\n }\n Reflect.defineProperty(type, \"observedAttributes\", {\n value: this.observedAttributes,\n enumerable: true,\n });\n }\n if (!registry.get(this.name)) {\n registry.define(this.name, type, this.elementOptions);\n }\n return this;\n }\n}\n/**\n * Gets the element definition associated with the specified type.\n * @param type - The custom element type to retrieve the definition for.\n */\nFASTElementDefinition.forType = fastRegistry.getByType;\n","import { DOM } from \"../dom.js\";\nimport { PropertyChangeNotifier } from \"../observation/notifier.js\";\nimport { defaultExecutionContext, Observable } from \"../observation/observable.js\";\nimport { FASTElementDefinition } from \"./fast-definitions.js\";\nconst shadowRoots = new WeakMap();\nconst defaultEventOptions = {\n bubbles: true,\n composed: true,\n cancelable: true,\n};\nfunction getShadowRoot(element) {\n return element.shadowRoot || shadowRoots.get(element) || null;\n}\n/**\n * Controls the lifecycle and rendering of a `FASTElement`.\n * @public\n */\nexport class Controller extends PropertyChangeNotifier {\n /**\n * Creates a Controller to control the specified element.\n * @param element - The element to be controlled by this controller.\n * @param definition - The element definition metadata that instructs this\n * controller in how to handle rendering and other platform integrations.\n * @internal\n */\n constructor(element, definition) {\n super(element);\n this.boundObservables = null;\n this.behaviors = null;\n this.needsInitialization = true;\n this._template = null;\n this._styles = null;\n this._isConnected = false;\n /**\n * This allows Observable.getNotifier(...) to return the Controller\n * when the notifier for the Controller itself is being requested. The\n * result is that the Observable system does not need to create a separate\n * instance of Notifier for observables on the Controller. The component and\n * the controller will now share the same notifier, removing one-object construct\n * per web component instance.\n */\n this.$fastController = this;\n /**\n * The view associated with the custom element.\n * @remarks\n * If `null` then the element is managing its own rendering.\n */\n this.view = null;\n this.element = element;\n this.definition = definition;\n const shadowOptions = definition.shadowOptions;\n if (shadowOptions !== void 0) {\n const shadowRoot = element.attachShadow(shadowOptions);\n if (shadowOptions.mode === \"closed\") {\n shadowRoots.set(element, shadowRoot);\n }\n }\n // Capture any observable values that were set by the binding engine before\n // the browser upgraded the element. Then delete the property since it will\n // shadow the getter/setter that is required to make the observable operate.\n // Later, in the connect callback, we'll re-apply the values.\n const accessors = Observable.getAccessors(element);\n if (accessors.length > 0) {\n const boundObservables = (this.boundObservables = Object.create(null));\n for (let i = 0, ii = accessors.length; i < ii; ++i) {\n const propertyName = accessors[i].name;\n const value = element[propertyName];\n if (value !== void 0) {\n delete element[propertyName];\n boundObservables[propertyName] = value;\n }\n }\n }\n }\n /**\n * Indicates whether or not the custom element has been\n * connected to the document.\n */\n get isConnected() {\n Observable.track(this, \"isConnected\");\n return this._isConnected;\n }\n setIsConnected(value) {\n this._isConnected = value;\n Observable.notify(this, \"isConnected\");\n }\n /**\n * Gets/sets the template used to render the component.\n * @remarks\n * This value can only be accurately read after connect but can be set at any time.\n */\n get template() {\n return this._template;\n }\n set template(value) {\n if (this._template === value) {\n return;\n }\n this._template = value;\n if (!this.needsInitialization) {\n this.renderTemplate(value);\n }\n }\n /**\n * Gets/sets the primary styles used for the component.\n * @remarks\n * This value can only be accurately read after connect but can be set at any time.\n */\n get styles() {\n return this._styles;\n }\n set styles(value) {\n if (this._styles === value) {\n return;\n }\n if (this._styles !== null) {\n this.removeStyles(this._styles);\n }\n this._styles = value;\n if (!this.needsInitialization && value !== null) {\n this.addStyles(value);\n }\n }\n /**\n * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot.\n * @param styles - The styles to add.\n */\n addStyles(styles) {\n const target = getShadowRoot(this.element) ||\n this.element.getRootNode();\n if (styles instanceof HTMLStyleElement) {\n target.append(styles);\n }\n else if (!styles.isAttachedTo(target)) {\n const sourceBehaviors = styles.behaviors;\n styles.addStylesTo(target);\n if (sourceBehaviors !== null) {\n this.addBehaviors(sourceBehaviors);\n }\n }\n }\n /**\n * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot.\n * @param styles - the styles to remove.\n */\n removeStyles(styles) {\n const target = getShadowRoot(this.element) ||\n this.element.getRootNode();\n if (styles instanceof HTMLStyleElement) {\n target.removeChild(styles);\n }\n else if (styles.isAttachedTo(target)) {\n const sourceBehaviors = styles.behaviors;\n styles.removeStylesFrom(target);\n if (sourceBehaviors !== null) {\n this.removeBehaviors(sourceBehaviors);\n }\n }\n }\n /**\n * Adds behaviors to this element.\n * @param behaviors - The behaviors to add.\n */\n addBehaviors(behaviors) {\n const targetBehaviors = this.behaviors || (this.behaviors = new Map());\n const length = behaviors.length;\n const behaviorsToBind = [];\n for (let i = 0; i < length; ++i) {\n const behavior = behaviors[i];\n if (targetBehaviors.has(behavior)) {\n targetBehaviors.set(behavior, targetBehaviors.get(behavior) + 1);\n }\n else {\n targetBehaviors.set(behavior, 1);\n behaviorsToBind.push(behavior);\n }\n }\n if (this._isConnected) {\n const element = this.element;\n for (let i = 0; i < behaviorsToBind.length; ++i) {\n behaviorsToBind[i].bind(element, defaultExecutionContext);\n }\n }\n }\n /**\n * Removes behaviors from this element.\n * @param behaviors - The behaviors to remove.\n * @param force - Forces unbinding of behaviors.\n */\n removeBehaviors(behaviors, force = false) {\n const targetBehaviors = this.behaviors;\n if (targetBehaviors === null) {\n return;\n }\n const length = behaviors.length;\n const behaviorsToUnbind = [];\n for (let i = 0; i < length; ++i) {\n const behavior = behaviors[i];\n if (targetBehaviors.has(behavior)) {\n const count = targetBehaviors.get(behavior) - 1;\n count === 0 || force\n ? targetBehaviors.delete(behavior) && behaviorsToUnbind.push(behavior)\n : targetBehaviors.set(behavior, count);\n }\n }\n if (this._isConnected) {\n const element = this.element;\n for (let i = 0; i < behaviorsToUnbind.length; ++i) {\n behaviorsToUnbind[i].unbind(element);\n }\n }\n }\n /**\n * Runs connected lifecycle behavior on the associated element.\n */\n onConnectedCallback() {\n if (this._isConnected) {\n return;\n }\n const element = this.element;\n if (this.needsInitialization) {\n this.finishInitialization();\n }\n else if (this.view !== null) {\n this.view.bind(element, defaultExecutionContext);\n }\n const behaviors = this.behaviors;\n if (behaviors !== null) {\n for (const [behavior] of behaviors) {\n behavior.bind(element, defaultExecutionContext);\n }\n }\n this.setIsConnected(true);\n }\n /**\n * Runs disconnected lifecycle behavior on the associated element.\n */\n onDisconnectedCallback() {\n if (!this._isConnected) {\n return;\n }\n this.setIsConnected(false);\n const view = this.view;\n if (view !== null) {\n view.unbind();\n }\n const behaviors = this.behaviors;\n if (behaviors !== null) {\n const element = this.element;\n for (const [behavior] of behaviors) {\n behavior.unbind(element);\n }\n }\n }\n /**\n * Runs the attribute changed callback for the associated element.\n * @param name - The name of the attribute that changed.\n * @param oldValue - The previous value of the attribute.\n * @param newValue - The new value of the attribute.\n */\n onAttributeChangedCallback(name, oldValue, newValue) {\n const attrDef = this.definition.attributeLookup[name];\n if (attrDef !== void 0) {\n attrDef.onAttributeChangedCallback(this.element, newValue);\n }\n }\n /**\n * Emits a custom HTML event.\n * @param type - The type name of the event.\n * @param detail - The event detail object to send with the event.\n * @param options - The event options. By default bubbles and composed.\n * @remarks\n * Only emits events if connected.\n */\n emit(type, detail, options) {\n if (this._isConnected) {\n return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ detail }, defaultEventOptions), options)));\n }\n return false;\n }\n finishInitialization() {\n const element = this.element;\n const boundObservables = this.boundObservables;\n // If we have any observables that were bound, re-apply their values.\n if (boundObservables !== null) {\n const propertyNames = Object.keys(boundObservables);\n for (let i = 0, ii = propertyNames.length; i < ii; ++i) {\n const propertyName = propertyNames[i];\n element[propertyName] = boundObservables[propertyName];\n }\n this.boundObservables = null;\n }\n const definition = this.definition;\n // 1. Template overrides take top precedence.\n if (this._template === null) {\n if (this.element.resolveTemplate) {\n // 2. Allow for element instance overrides next.\n this._template = this.element.resolveTemplate();\n }\n else if (definition.template) {\n // 3. Default to the static definition.\n this._template = definition.template || null;\n }\n }\n // If we have a template after the above process, render it.\n // If there's no template, then the element author has opted into\n // custom rendering and they will managed the shadow root's content themselves.\n if (this._template !== null) {\n this.renderTemplate(this._template);\n }\n // 1. Styles overrides take top precedence.\n if (this._styles === null) {\n if (this.element.resolveStyles) {\n // 2. Allow for element instance overrides next.\n this._styles = this.element.resolveStyles();\n }\n else if (definition.styles) {\n // 3. Default to the static definition.\n this._styles = definition.styles || null;\n }\n }\n // If we have styles after the above process, add them.\n if (this._styles !== null) {\n this.addStyles(this._styles);\n }\n this.needsInitialization = false;\n }\n renderTemplate(template) {\n const element = this.element;\n // When getting the host to render to, we start by looking\n // up the shadow root. If there isn't one, then that means\n // we're doing a Light DOM render to the element's direct children.\n const host = getShadowRoot(element) || element;\n if (this.view !== null) {\n // If there's already a view, we need to unbind and remove through dispose.\n this.view.dispose();\n this.view = null;\n }\n else if (!this.needsInitialization) {\n // If there was previous custom rendering, we need to clear out the host.\n DOM.removeChildNodes(host);\n }\n if (template) {\n // If a new template was provided, render it.\n this.view = template.render(element, host, element);\n }\n }\n /**\n * Locates or creates a controller for the specified element.\n * @param element - The element to return the controller for.\n * @remarks\n * The specified element must have a {@link FASTElementDefinition}\n * registered either through the use of the {@link customElement}\n * decorator or a call to `FASTElement.define`.\n */\n static forCustomElement(element) {\n const controller = element.$fastController;\n if (controller !== void 0) {\n return controller;\n }\n const definition = FASTElementDefinition.forType(element.constructor);\n if (definition === void 0) {\n throw new Error(\"Missing FASTElement definition.\");\n }\n return (element.$fastController = new Controller(element, definition));\n }\n}\n","import { Controller } from \"./controller.js\";\nimport { FASTElementDefinition, } from \"./fast-definitions.js\";\n/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */\nfunction createFASTElement(BaseType) {\n return class extends BaseType {\n constructor() {\n /* eslint-disable-next-line */\n super();\n Controller.forCustomElement(this);\n }\n $emit(type, detail, options) {\n return this.$fastController.emit(type, detail, options);\n }\n connectedCallback() {\n this.$fastController.onConnectedCallback();\n }\n disconnectedCallback() {\n this.$fastController.onDisconnectedCallback();\n }\n attributeChangedCallback(name, oldValue, newValue) {\n this.$fastController.onAttributeChangedCallback(name, oldValue, newValue);\n }\n };\n}\n/**\n * A minimal base class for FASTElements that also provides\n * static helpers for working with FASTElements.\n * @public\n */\nexport const FASTElement = Object.assign(createFASTElement(HTMLElement), {\n /**\n * Creates a new FASTElement base class inherited from the\n * provided base type.\n * @param BaseType - The base element type to inherit from.\n */\n from(BaseType) {\n return createFASTElement(BaseType);\n },\n /**\n * Defines a platform custom element based on the provided type and definition.\n * @param type - The custom element type to define.\n * @param nameOrDef - The name of the element to define or a definition object\n * that describes the element to define.\n */\n define(type, nameOrDef) {\n return new FASTElementDefinition(type, nameOrDef).define().type;\n },\n});\n/**\n * Decorator: Defines a platform custom element based on `FASTElement`.\n * @param nameOrDef - The name of the element to define or a definition object\n * that describes the element to define.\n * @public\n */\nexport function customElement(nameOrDef) {\n /* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */\n return function (type) {\n new FASTElementDefinition(type, nameOrDef).define();\n };\n}\n","/**\n * Directive for use in {@link css}.\n *\n * @public\n */\nexport class CSSDirective {\n /**\n * Creates a CSS fragment to interpolate into the CSS document.\n * @returns - the string to interpolate into CSS\n */\n createCSS() {\n return \"\";\n }\n /**\n * Creates a behavior to bind to the host element.\n * @returns - the behavior to bind to the host element, or undefined.\n */\n createBehavior() {\n return undefined;\n }\n}\n","import { CSSDirective } from \"./css-directive.js\";\nimport { ElementStyles } from \"./element-styles.js\";\nfunction collectStyles(strings, values) {\n const styles = [];\n let cssString = \"\";\n const behaviors = [];\n for (let i = 0, ii = strings.length - 1; i < ii; ++i) {\n cssString += strings[i];\n let value = values[i];\n if (value instanceof CSSDirective) {\n const behavior = value.createBehavior();\n value = value.createCSS();\n if (behavior) {\n behaviors.push(behavior);\n }\n }\n if (value instanceof ElementStyles || value instanceof CSSStyleSheet) {\n if (cssString.trim() !== \"\") {\n styles.push(cssString);\n cssString = \"\";\n }\n styles.push(value);\n }\n else {\n cssString += value;\n }\n }\n cssString += strings[strings.length - 1];\n if (cssString.trim() !== \"\") {\n styles.push(cssString);\n }\n return {\n styles,\n behaviors,\n };\n}\n/**\n * Transforms a template literal string into styles.\n * @param strings - The string fragments that are interpolated with the values.\n * @param values - The values that are interpolated with the string fragments.\n * @remarks\n * The css helper supports interpolation of strings and ElementStyle instances.\n * @public\n */\nexport function css(strings, ...values) {\n const { styles, behaviors } = collectStyles(strings, values);\n const elementStyles = ElementStyles.create(styles);\n if (behaviors.length) {\n elementStyles.withBehaviors(...behaviors);\n }\n return elementStyles;\n}\nclass CSSPartial extends CSSDirective {\n constructor(styles, behaviors) {\n super();\n this.behaviors = behaviors;\n this.css = \"\";\n const stylesheets = styles.reduce((accumulated, current) => {\n if (typeof current === \"string\") {\n this.css += current;\n }\n else {\n accumulated.push(current);\n }\n return accumulated;\n }, []);\n if (stylesheets.length) {\n this.styles = ElementStyles.create(stylesheets);\n }\n }\n createBehavior() {\n return this;\n }\n createCSS() {\n return this.css;\n }\n bind(el) {\n if (this.styles) {\n el.$fastController.addStyles(this.styles);\n }\n if (this.behaviors.length) {\n el.$fastController.addBehaviors(this.behaviors);\n }\n }\n unbind(el) {\n if (this.styles) {\n el.$fastController.removeStyles(this.styles);\n }\n if (this.behaviors.length) {\n el.$fastController.removeBehaviors(this.behaviors);\n }\n }\n}\n/**\n * Transforms a template literal string into partial CSS.\n * @param strings - The string fragments that are interpolated with the values.\n * @param values - The values that are interpolated with the string fragments.\n * @public\n */\nexport function cssPartial(strings, ...values) {\n const { styles, behaviors } = collectStyles(strings, values);\n return new CSSPartial(styles, behaviors);\n}\n","import { emptyArray } from \"../platform.js\";\n/** @internal */\nexport function newSplice(index, removed, addedCount) {\n return {\n index: index,\n removed: removed,\n addedCount: addedCount,\n };\n}\nconst EDIT_LEAVE = 0;\nconst EDIT_UPDATE = 1;\nconst EDIT_ADD = 2;\nconst EDIT_DELETE = 3;\n// Note: This function is *based* on the computation of the Levenshtein\n// \"edit\" distance. The one change is that \"updates\" are treated as two\n// edits - not one. With Array splices, an update is really a delete\n// followed by an add. By retaining this, we optimize for \"keeping\" the\n// maximum array items in the original array. For example:\n//\n// 'xxxx123' -> '123yyyy'\n//\n// With 1-edit updates, the shortest path would be just to update all seven\n// characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n// leaves the substring '123' intact.\nfunction calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) {\n // \"Deletion\" columns\n const rowCount = oldEnd - oldStart + 1;\n const columnCount = currentEnd - currentStart + 1;\n const distances = new Array(rowCount);\n let north;\n let west;\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; ++i) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n // Initialize null row\n for (let j = 0; j < columnCount; ++j) {\n distances[0][j] = j;\n }\n for (let i = 1; i < rowCount; ++i) {\n for (let j = 1; j < columnCount; ++j) {\n if (current[currentStart + j - 1] === old[oldStart + i - 1]) {\n distances[i][j] = distances[i - 1][j - 1];\n }\n else {\n north = distances[i - 1][j] + 1;\n west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n return distances;\n}\n// This starts at the final weight, and walks \"backward\" by finding\n// the minimum previous weight recursively until the origin of the weight\n// matrix.\nfunction spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n const edits = [];\n while (i > 0 || j > 0) {\n if (i === 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j === 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n const northWest = distances[i - 1][j - 1];\n const west = distances[i - 1][j];\n const north = distances[i][j - 1];\n let min;\n if (west < north) {\n min = west < northWest ? west : northWest;\n }\n else {\n min = north < northWest ? north : northWest;\n }\n if (min === northWest) {\n if (northWest === current) {\n edits.push(EDIT_LEAVE);\n }\n else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n }\n else if (min === west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n }\n else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n edits.reverse();\n return edits;\n}\nfunction sharedPrefix(current, old, searchLength) {\n for (let i = 0; i < searchLength; ++i) {\n if (current[i] !== old[i]) {\n return i;\n }\n }\n return searchLength;\n}\nfunction sharedSuffix(current, old, searchLength) {\n let index1 = current.length;\n let index2 = old.length;\n let count = 0;\n while (count < searchLength && current[--index1] === old[--index2]) {\n count++;\n }\n return count;\n}\nfunction intersect(start1, end1, start2, end2) {\n // Disjoint\n if (end1 < start2 || end2 < start1) {\n return -1;\n }\n // Adjacent\n if (end1 === start2 || end2 === start1) {\n return 0;\n }\n // Non-zero intersect, span1 first\n if (start1 < start2) {\n if (end1 < end2) {\n return end1 - start2; // Overlap\n }\n return end2 - start2; // Contained\n }\n // Non-zero intersect, span2 first\n if (end2 < end1) {\n return end2 - start1; // Overlap\n }\n return end1 - start1; // Contained\n}\n/**\n * Splice Projection functions:\n *\n * A splice map is a representation of how a previous array of items\n * was transformed into a new array of items. Conceptually it is a list of\n * tuples of\n *\n * <index, removed, addedCount>\n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items were removed, and counting forward\n * from |index|, |addedCount| items were added.\n */\n/**\n * @internal\n * @remarks\n * Lacking individual splice mutation information, the minimal set of\n * splices can be synthesized given the previous state and final state of an\n * array. The basic approach is to calculate the edit distance matrix and\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n */\nexport function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) {\n let prefixCount = 0;\n let suffixCount = 0;\n const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);\n if (currentStart === 0 && oldStart === 0) {\n prefixCount = sharedPrefix(current, old, minLength);\n }\n if (currentEnd === current.length && oldEnd === old.length) {\n suffixCount = sharedSuffix(current, old, minLength - prefixCount);\n }\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) {\n return emptyArray;\n }\n if (currentStart === currentEnd) {\n const splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd) {\n splice.removed.push(old[oldStart++]);\n }\n return [splice];\n }\n else if (oldStart === oldEnd) {\n return [newSplice(currentStart, [], currentEnd - currentStart)];\n }\n const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));\n const splices = [];\n let splice = void 0;\n let index = currentStart;\n let oldIndex = oldStart;\n for (let i = 0; i < ops.length; ++i) {\n switch (ops[i]) {\n case EDIT_LEAVE:\n if (splice !== void 0) {\n splices.push(splice);\n splice = void 0;\n }\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (splice === void 0) {\n splice = newSplice(index, [], 0);\n }\n splice.addedCount++;\n index++;\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (splice === void 0) {\n splice = newSplice(index, [], 0);\n }\n splice.addedCount++;\n index++;\n break;\n case EDIT_DELETE:\n if (splice === void 0) {\n splice = newSplice(index, [], 0);\n }\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n // no default\n }\n }\n if (splice !== void 0) {\n splices.push(splice);\n }\n return splices;\n}\nconst $push = Array.prototype.push;\nfunction mergeSplice(splices, index, removed, addedCount) {\n const splice = newSplice(index, removed, addedCount);\n let inserted = false;\n let insertionOffset = 0;\n for (let i = 0; i < splices.length; i++) {\n const current = splices[i];\n current.index += insertionOffset;\n if (inserted) {\n continue;\n }\n const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount);\n if (intersectCount >= 0) {\n // Merge the two splices\n splices.splice(i, 1);\n i--;\n insertionOffset -= current.addedCount - current.removed.length;\n splice.addedCount += current.addedCount - intersectCount;\n const deleteCount = splice.removed.length + current.removed.length - intersectCount;\n if (!splice.addedCount && !deleteCount) {\n // merged splice is a noop. discard.\n inserted = true;\n }\n else {\n let currentRemoved = current.removed;\n if (splice.index < current.index) {\n // some prefix of splice.removed is prepended to current.removed.\n const prepend = splice.removed.slice(0, current.index - splice.index);\n $push.apply(prepend, currentRemoved);\n currentRemoved = prepend;\n }\n if (splice.index + splice.removed.length >\n current.index + current.addedCount) {\n // some suffix of splice.removed is appended to current.removed.\n const append = splice.removed.slice(current.index + current.addedCount - splice.index);\n $push.apply(currentRemoved, append);\n }\n splice.removed = currentRemoved;\n if (current.index < splice.index) {\n splice.index = current.index;\n }\n }\n }\n else if (splice.index < current.index) {\n // Insert splice here.\n inserted = true;\n splices.splice(i, 0, splice);\n i++;\n const offset = splice.addedCount - splice.removed.length;\n current.index += offset;\n insertionOffset += offset;\n }\n }\n if (!inserted) {\n splices.push(splice);\n }\n}\nfunction createInitialSplices(changeRecords) {\n const splices = [];\n for (let i = 0, ii = changeRecords.length; i < ii; i++) {\n const record = changeRecords[i];\n mergeSplice(splices, record.index, record.removed, record.addedCount);\n }\n return splices;\n}\n/** @internal */\nexport function projectArraySplices(array, changeRecords) {\n let splices = [];\n const initialSplices = createInitialSplices(changeRecords);\n for (let i = 0, ii = initialSplices.length; i < ii; ++i) {\n const splice = initialSplices[i];\n if (splice.addedCount === 1 && splice.removed.length === 1) {\n if (splice.removed[0] !== array[splice.index]) {\n splices.push(splice);\n }\n continue;\n }\n splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length));\n }\n return splices;\n}\n","import { DOM } from \"../dom.js\";\nimport { calcSplices, newSplice, projectArraySplices } from \"./array-change-records.js\";\nimport { SubscriberSet } from \"./notifier.js\";\nimport { Observable } from \"./observable.js\";\nlet arrayObservationEnabled = false;\nfunction adjustIndex(changeRecord, array) {\n let index = changeRecord.index;\n const arrayLength = array.length;\n if (index > arrayLength) {\n index = arrayLength - changeRecord.addedCount;\n }\n else if (index < 0) {\n index =\n arrayLength + changeRecord.removed.length + index - changeRecord.addedCount;\n }\n if (index < 0) {\n index = 0;\n }\n changeRecord.index = index;\n return changeRecord;\n}\nclass ArrayObserver extends SubscriberSet {\n constructor(source) {\n super(source);\n this.oldCollection = void 0;\n this.splices = void 0;\n this.needsQueue = true;\n this.call = this.flush;\n Reflect.defineProperty(source, \"$fastController\", {\n value: this,\n enumerable: false,\n });\n }\n subscribe(subscriber) {\n this.flush();\n super.subscribe(subscriber);\n }\n addSplice(splice) {\n if (this.splices === void 0) {\n this.splices = [splice];\n }\n else {\n this.splices.push(splice);\n }\n if (this.needsQueue) {\n this.needsQueue = false;\n DOM.queueUpdate(this);\n }\n }\n reset(oldCollection) {\n this.oldCollection = oldCollection;\n if (this.needsQueue) {\n this.needsQueue = false;\n DOM.queueUpdate(this);\n }\n }\n flush() {\n const splices = this.splices;\n const oldCollection = this.oldCollection;\n if (splices === void 0 && oldCollection === void 0) {\n return;\n }\n this.needsQueue = true;\n this.splices = void 0;\n this.oldCollection = void 0;\n const finalSplices = oldCollection === void 0\n ? projectArraySplices(this.source, splices)\n : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length);\n this.notify(finalSplices);\n }\n}\n/* eslint-disable prefer-rest-params */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/**\n * Enables the array observation mechanism.\n * @remarks\n * Array observation is enabled automatically when using the\n * {@link RepeatDirective}, so calling this API manually is\n * not typically necessary.\n * @public\n */\nexport function enableArrayObservation() {\n if (arrayObservationEnabled) {\n return;\n }\n arrayObservationEnabled = true;\n Observable.setArrayObserverFactory((collection) => {\n return new ArrayObserver(collection);\n });\n const proto = Array.prototype;\n // Don't patch Array if it has already been patched\n // by another copy of fast-element.\n if (proto.$fastPatch) {\n return;\n }\n Reflect.defineProperty(proto, \"$fastPatch\", {\n value: 1,\n enumerable: false,\n });\n const pop = proto.pop;\n const push = proto.push;\n const reverse = proto.reverse;\n const shift = proto.shift;\n const sort = proto.sort;\n const splice = proto.splice;\n const unshift = proto.unshift;\n proto.pop = function () {\n const notEmpty = this.length > 0;\n const methodCallResult = pop.apply(this, arguments);\n const o = this.$fastController;\n if (o !== void 0 && notEmpty) {\n o.addSplice(newSplice(this.length, [methodCallResult], 0));\n }\n return methodCallResult;\n };\n proto.push = function () {\n const methodCallResult = push.apply(this, arguments);\n const o = this.$fastController;\n if (o !== void 0) {\n o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this));\n }\n return methodCallResult;\n };\n proto.reverse = function () {\n let oldArray;\n const o = this.$fastController;\n if (o !== void 0) {\n o.flush();\n oldArray = this.slice();\n }\n const methodCallResult = reverse.apply(this, arguments);\n if (o !== void 0) {\n o.reset(oldArray);\n }\n return methodCallResult;\n };\n proto.shift = function () {\n const notEmpty = this.length > 0;\n const methodCallResult = shift.apply(this, arguments);\n const o = this.$fastController;\n if (o !== void 0 && notEmpty) {\n o.addSplice(newSplice(0, [methodCallResult], 0));\n }\n return methodCallResult;\n };\n proto.sort = function () {\n let oldArray;\n const o = this.$fastController;\n if (o !== void 0) {\n o.flush();\n oldArray = this.slice();\n }\n const methodCallResult = sort.apply(this, arguments);\n if (o !== void 0) {\n o.reset(oldArray);\n }\n return methodCallResult;\n };\n proto.splice = function () {\n const methodCallResult = splice.apply(this, arguments);\n const o = this.$fastController;\n if (o !== void 0) {\n o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this));\n }\n return methodCallResult;\n };\n proto.unshift = function () {\n const methodCallResult = unshift.apply(this, arguments);\n const o = this.$fastController;\n if (o !== void 0) {\n o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this));\n }\n return methodCallResult;\n };\n}\n/* eslint-enable prefer-rest-params */\n/* eslint-enable @typescript-eslint/explicit-function-return-type */\n","import { AttachedBehaviorHTMLDirective } from \"./html-directive.js\";\n/**\n * The runtime behavior for template references.\n * @public\n */\nexport class RefBehavior {\n /**\n * Creates an instance of RefBehavior.\n * @param target - The element to reference.\n * @param propertyName - The name of the property to assign the reference to.\n */\n constructor(target, propertyName) {\n this.target = target;\n this.propertyName = propertyName;\n }\n /**\n * Bind this behavior to the source.\n * @param source - The source to bind to.\n * @param context - The execution context that the binding is operating within.\n */\n bind(source) {\n source[this.propertyName] = this.target;\n }\n /**\n * Unbinds this behavior from the source.\n * @param source - The source to unbind from.\n */\n /* eslint-disable-next-line @typescript-eslint/no-empty-function */\n unbind() { }\n}\n/**\n * A directive that observes the updates a property with a reference to the element.\n * @param propertyName - The name of the property to assign the reference to.\n * @public\n */\nexport function ref(propertyName) {\n return new AttachedBehaviorHTMLDirective(\"fast-ref\", RefBehavior, propertyName);\n}\n","/**\n * A directive that enables basic conditional rendering in a template.\n * @param binding - The condition to test for rendering.\n * @param templateOrTemplateBinding - The template or a binding that gets\n * the template to render when the condition is true.\n * @public\n */\nexport function when(binding, templateOrTemplateBinding) {\n const getTemplate = typeof templateOrTemplateBinding === \"function\"\n ? templateOrTemplateBinding\n : () => templateOrTemplateBinding;\n return (source, context) => binding(source, context) ? getTemplate(source, context) : null;\n}\n","import { DOM } from \"../dom.js\";\nimport { Observable, } from \"../observation/observable.js\";\nimport { enableArrayObservation } from \"../observation/array-observer.js\";\nimport { emptyArray } from \"../platform.js\";\nimport { HTMLDirective } from \"./html-directive.js\";\nimport { HTMLView } from \"./view.js\";\nconst defaultRepeatOptions = Object.freeze({\n positioning: false,\n recycle: true,\n});\nfunction bindWithoutPositioning(view, items, index, context) {\n view.bind(items[index], context);\n}\nfunction bindWithPositioning(view, items, index, context) {\n const childContext = Object.create(context);\n childContext.index = index;\n childContext.length = items.length;\n view.bind(items[index], childContext);\n}\n/**\n * A behavior that renders a template for each item in an array.\n * @public\n */\nexport class RepeatBehavior {\n /**\n * Creates an instance of RepeatBehavior.\n * @param location - The location in the DOM to render the repeat.\n * @param itemsBinding - The array to render.\n * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies.\n * @param templateBinding - The template to render for each item.\n * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies.\n * @param options - Options used to turn on special repeat features.\n */\n constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) {\n this.location = location;\n this.itemsBinding = itemsBinding;\n this.templateBinding = templateBinding;\n this.options = options;\n this.source = null;\n this.views = [];\n this.items = null;\n this.itemsObserver = null;\n this.originalContext = void 0;\n this.childContext = void 0;\n this.bindView = bindWithoutPositioning;\n this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile);\n this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile);\n if (options.positioning) {\n this.bindView = bindWithPositioning;\n }\n }\n /**\n * Bind this behavior to the source.\n * @param source - The source to bind to.\n * @param context - The execution context that the binding is operating within.\n */\n bind(source, context) {\n this.source = source;\n this.originalContext = context;\n this.childContext = Object.create(context);\n this.childContext.parent = source;\n this.childContext.parentContext = this.originalContext;\n this.items = this.itemsBindingObserver.observe(source, this.originalContext);\n this.template = this.templateBindingObserver.observe(source, this.originalContext);\n this.observeItems(true);\n this.refreshAllViews();\n }\n /**\n * Unbinds this behavior from the source.\n * @param source - The source to unbind from.\n */\n unbind() {\n this.source = null;\n this.items = null;\n if (this.itemsObserver !== null) {\n this.itemsObserver.unsubscribe(this);\n }\n this.unbindAllViews();\n this.itemsBindingObserver.disconnect();\n this.templateBindingObserver.disconnect();\n }\n /** @internal */\n handleChange(source, args) {\n if (source === this.itemsBinding) {\n this.items = this.itemsBindingObserver.observe(this.source, this.originalContext);\n this.observeItems();\n this.refreshAllViews();\n }\n else if (source === this.templateBinding) {\n this.template = this.templateBindingObserver.observe(this.source, this.originalContext);\n this.refreshAllViews(true);\n }\n else {\n this.updateViews(args);\n }\n }\n observeItems(force = false) {\n if (!this.items) {\n this.items = emptyArray;\n return;\n }\n const oldObserver = this.itemsObserver;\n const newObserver = (this.itemsObserver = Observable.getNotifier(this.items));\n const hasNewObserver = oldObserver !== newObserver;\n if (hasNewObserver && oldObserver !== null) {\n oldObserver.unsubscribe(this);\n }\n if (hasNewObserver || force) {\n newObserver.subscribe(this);\n }\n }\n updateViews(splices) {\n const childContext = this.childContext;\n const views = this.views;\n const bindView = this.bindView;\n const items = this.items;\n const template = this.template;\n const recycle = this.options.recycle;\n const leftoverViews = [];\n let leftoverIndex = 0;\n let availableViews = 0;\n for (let i = 0, ii = splices.length; i < ii; ++i) {\n const splice = splices[i];\n const removed = splice.removed;\n let removeIndex = 0;\n let addIndex = splice.index;\n const end = addIndex + splice.addedCount;\n const removedViews = views.splice(splice.index, removed.length);\n const totalAvailableViews = (availableViews =\n leftoverViews.length + removedViews.length);\n for (; addIndex < end; ++addIndex) {\n const neighbor = views[addIndex];\n const location = neighbor ? neighbor.firstChild : this.location;\n let view;\n if (recycle && availableViews > 0) {\n if (removeIndex <= totalAvailableViews && removedViews.length > 0) {\n view = removedViews[removeIndex];\n removeIndex++;\n }\n else {\n view = leftoverViews[leftoverIndex];\n leftoverIndex++;\n }\n availableViews--;\n }\n else {\n view = template.create();\n }\n views.splice(addIndex, 0, view);\n bindView(view, items, addIndex, childContext);\n view.insertBefore(location);\n }\n if (removedViews[removeIndex]) {\n leftoverViews.push(...removedViews.slice(removeIndex));\n }\n }\n for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) {\n leftoverViews[i].dispose();\n }\n if (this.options.positioning) {\n for (let i = 0, ii = views.length; i < ii; ++i) {\n const currentContext = views[i].context;\n currentContext.length = ii;\n currentContext.index = i;\n }\n }\n }\n refreshAllViews(templateChanged = false) {\n const items = this.items;\n const childContext = this.childContext;\n const template = this.template;\n const location = this.location;\n const bindView = this.bindView;\n let itemsLength = items.length;\n let views = this.views;\n let viewsLength = views.length;\n if (itemsLength === 0 || templateChanged || !this.options.recycle) {\n // all views need to be removed\n HTMLView.disposeContiguousBatch(views);\n viewsLength = 0;\n }\n if (viewsLength === 0) {\n // all views need to be created\n this.views = views = new Array(itemsLength);\n for (let i = 0; i < itemsLength; ++i) {\n const view = template.create();\n bindView(view, items, i, childContext);\n views[i] = view;\n view.insertBefore(location);\n }\n }\n else {\n // attempt to reuse existing views with new data\n let i = 0;\n for (; i < itemsLength; ++i) {\n if (i < viewsLength) {\n const view = views[i];\n bindView(view, items, i, childContext);\n }\n else {\n const view = template.create();\n bindView(view, items, i, childContext);\n views.push(view);\n view.insertBefore(location);\n }\n }\n const removed = views.splice(i, viewsLength - i);\n for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) {\n removed[i].dispose();\n }\n }\n }\n unbindAllViews() {\n const views = this.views;\n for (let i = 0, ii = views.length; i < ii; ++i) {\n views[i].unbind();\n }\n }\n}\n/**\n * A directive that configures list rendering.\n * @public\n */\nexport class RepeatDirective extends HTMLDirective {\n /**\n * Creates an instance of RepeatDirective.\n * @param itemsBinding - The binding that provides the array to render.\n * @param templateBinding - The template binding used to obtain a template to render for each item in the array.\n * @param options - Options used to turn on special repeat features.\n */\n constructor(itemsBinding, templateBinding, options) {\n super();\n this.itemsBinding = itemsBinding;\n this.templateBinding = templateBinding;\n this.options = options;\n /**\n * Creates a placeholder string based on the directive's index within the template.\n * @param index - The index of the directive within the template.\n */\n this.createPlaceholder = DOM.createBlockPlaceholder;\n enableArrayObservation();\n this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding);\n this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding);\n }\n /**\n * Creates a behavior for the provided target node.\n * @param target - The node instance to create the behavior for.\n */\n createBehavior(target) {\n return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options);\n }\n}\n/**\n * A directive that enables list rendering.\n * @param itemsBinding - The array to render.\n * @param templateOrTemplateBinding - The template or a template binding used obtain a template\n * to render for each item in the array.\n * @param options - Options used to turn on special repeat features.\n * @public\n */\nexport function repeat(itemsBinding, templateOrTemplateBinding, options = defaultRepeatOptions) {\n const templateBinding = typeof templateOrTemplateBinding === \"function\"\n ? templateOrTemplateBinding\n : () => templateOrTemplateBinding;\n return new RepeatDirective(itemsBinding, templateBinding, Object.assign(Object.assign({}, defaultRepeatOptions), options));\n}\n","import { Observable } from \"../observation/observable.js\";\nimport { emptyArray } from \"../platform.js\";\n/**\n * Creates a function that can be used to filter a Node array, selecting only elements.\n * @param selector - An optional selector to restrict the filter to.\n * @public\n */\nexport function elements(selector) {\n if (selector) {\n return function (value, index, array) {\n return value.nodeType === 1 && value.matches(selector);\n };\n }\n return function (value, index, array) {\n return value.nodeType === 1;\n };\n}\n/**\n * A base class for node observation.\n * @internal\n */\nexport class NodeObservationBehavior {\n /**\n * Creates an instance of NodeObservationBehavior.\n * @param target - The target to assign the nodes property on.\n * @param options - The options to use in configuring node observation.\n */\n constructor(target, options) {\n this.target = target;\n this.options = options;\n this.source = null;\n }\n /**\n * Bind this behavior to the source.\n * @param source - The source to bind to.\n * @param context - The execution context that the binding is operating within.\n */\n bind(source) {\n const name = this.options.property;\n this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name);\n this.source = source;\n this.updateTarget(this.computeNodes());\n if (this.shouldUpdate) {\n this.observe();\n }\n }\n /**\n * Unbinds this behavior from the source.\n * @param source - The source to unbind from.\n */\n unbind() {\n this.updateTarget(emptyArray);\n this.source = null;\n if (this.shouldUpdate) {\n this.disconnect();\n }\n }\n /** @internal */\n handleEvent() {\n this.updateTarget(this.computeNodes());\n }\n computeNodes() {\n let nodes = this.getNodes();\n if (this.options.filter !== void 0) {\n nodes = nodes.filter(this.options.filter);\n }\n return nodes;\n }\n updateTarget(value) {\n this.source[this.options.property] = value;\n }\n}\n","import { AttachedBehaviorHTMLDirective } from \"./html-directive.js\";\nimport { NodeObservationBehavior } from \"./node-observation.js\";\n/**\n * The runtime behavior for slotted node observation.\n * @public\n */\nexport class SlottedBehavior extends NodeObservationBehavior {\n /**\n * Creates an instance of SlottedBehavior.\n * @param target - The slot element target to observe.\n * @param options - The options to use when observing the slot.\n */\n constructor(target, options) {\n super(target, options);\n }\n /**\n * Begins observation of the nodes.\n */\n observe() {\n this.target.addEventListener(\"slotchange\", this);\n }\n /**\n * Disconnects observation of the nodes.\n */\n disconnect() {\n this.target.removeEventListener(\"slotchange\", this);\n }\n /**\n * Retrieves the nodes that should be assigned to the target.\n */\n getNodes() {\n return this.target.assignedNodes(this.options);\n }\n}\n/**\n * A directive that observes the `assignedNodes()` of a slot and updates a property\n * whenever they change.\n * @param propertyOrOptions - The options used to configure slotted node observation.\n * @public\n */\nexport function slotted(propertyOrOptions) {\n if (typeof propertyOrOptions === \"string\") {\n propertyOrOptions = { property: propertyOrOptions };\n }\n return new AttachedBehaviorHTMLDirective(\"fast-slotted\", SlottedBehavior, propertyOrOptions);\n}\n","import { AttachedBehaviorHTMLDirective } from \"./html-directive.js\";\nimport { NodeObservationBehavior } from \"./node-observation.js\";\n/**\n * The runtime behavior for child node observation.\n * @public\n */\nexport class ChildrenBehavior extends NodeObservationBehavior {\n /**\n * Creates an instance of ChildrenBehavior.\n * @param target - The element target to observe children on.\n * @param options - The options to use when observing the element children.\n */\n constructor(target, options) {\n super(target, options);\n this.observer = null;\n options.childList = true;\n }\n /**\n * Begins observation of the nodes.\n */\n observe() {\n if (this.observer === null) {\n this.observer = new MutationObserver(this.handleEvent.bind(this));\n }\n this.observer.observe(this.target, this.options);\n }\n /**\n * Disconnects observation of the nodes.\n */\n disconnect() {\n this.observer.disconnect();\n }\n /**\n * Retrieves the nodes that should be assigned to the target.\n */\n getNodes() {\n if (\"subtree\" in this.options) {\n return Array.from(this.target.querySelectorAll(this.options.selector));\n }\n return Array.from(this.target.childNodes);\n }\n}\n/**\n * A directive that observes the `childNodes` of an element and updates a property\n * whenever they change.\n * @param propertyOrOptions - The options used to configure child node observation.\n * @public\n */\nexport function children(propertyOrOptions) {\n if (typeof propertyOrOptions === \"string\") {\n propertyOrOptions = {\n property: propertyOrOptions,\n };\n }\n return new AttachedBehaviorHTMLDirective(\"fast-children\", ChildrenBehavior, propertyOrOptions);\n}\n","import { html, ref } from \"@microsoft/fast-element\";\n/**\n * A mixin class implementing start and end elements.\n * These are generally used to decorate text elements with icons or other visual indicators.\n * @public\n */\nexport class StartEnd {\n handleStartContentChange() {\n this.startContainer.classList.toggle(\"start\", this.start.assignedNodes().length > 0);\n }\n handleEndContentChange() {\n this.endContainer.classList.toggle(\"end\", this.end.assignedNodes().length > 0);\n }\n}\n/**\n * The template for the end element.\n * For use with {@link StartEnd}\n *\n * @public\n */\nexport const endSlotTemplate = (context, definition) => html `\n <span\n part=\"end\"\n ${ref(\"endContainer\")}\n class=${x => (definition.end ? \"end\" : void 0)}\n >\n <slot name=\"end\" ${ref(\"end\")} @slotchange=\"${x => x.handleEndContentChange()}\">\n ${definition.end || \"\"}\n </slot>\n </span>\n`;\n/**\n * The template for the start element.\n * For use with {@link StartEnd}\n *\n * @public\n */\nexport const startSlotTemplate = (context, definition) => html `\n <span\n part=\"start\"\n ${ref(\"startContainer\")}\n class=\"${x => (definition.start ? \"start\" : void 0)}\"\n >\n <slot\n name=\"start\"\n ${ref(\"start\")}\n @slotchange=\"${x => x.handleStartContentChange()}\"\n >\n ${definition.start || \"\"}\n </slot>\n </span>\n`;\n/**\n * The template for the end element.\n * For use with {@link StartEnd}\n *\n * @public\n * @deprecated - use endSlotTemplate\n */\nexport const endTemplate = html `\n <span part=\"end\" ${ref(\"endContainer\")}>\n <slot\n name=\"end\"\n ${ref(\"end\")}\n @slotchange=\"${x => x.handleEndContentChange()}\"\n ></slot>\n </span>\n`;\n/**\n * The template for the start element.\n * For use with {@link StartEnd}\n *\n * @public\n * @deprecated - use startSlotTemplate\n */\nexport const startTemplate = html `\n <span part=\"start\" ${ref(\"startContainer\")}>\n <slot\n name=\"start\"\n ${ref(\"start\")}\n @slotchange=\"${x => x.handleStartContentChange()}\"\n ></slot>\n </span>\n`;\n","import { html, ref } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(AccordionItem:class)} component.\n * @public\n */\nexport const accordionItemTemplate = (context, definition) => html `\n <template class=\"${x => (x.expanded ? \"expanded\" : \"\")}\">\n <div\n class=\"heading\"\n part=\"heading\"\n role=\"heading\"\n aria-level=\"${x => x.headinglevel}\"\n >\n <button\n class=\"button\"\n part=\"button\"\n ${ref(\"expandbutton\")}\n aria-expanded=\"${x => x.expanded}\"\n aria-controls=\"${x => x.id}-panel\"\n id=\"${x => x.id}\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n >\n <span class=\"heading-content\" part=\"heading-content\">\n <slot name=\"heading\"></slot>\n </span>\n </button>\n ${startSlotTemplate(context, definition)}\n ${endSlotTemplate(context, definition)}\n <span class=\"icon\" part=\"icon\" aria-hidden=\"true\">\n <slot name=\"expanded-icon\" part=\"expanded-icon\">\n ${definition.expandedIcon || \"\"}\n </slot>\n <slot name=\"collapsed-icon\" part=\"collapsed-icon\">\n ${definition.collapsedIcon || \"\"}\n </slot>\n <span>\n </div>\n <div\n class=\"region\"\n part=\"region\"\n id=\"${x => x.id}-panel\"\n role=\"region\"\n aria-labelledby=\"${x => x.id}\"\n >\n <slot></slot>\n </div>\n </template>\n`;\n","/**\n * Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project\n * for the bulk of this code and many of the associated tests.\n */\nimport { emptyArray, FASTElement } from \"@microsoft/fast-element\";\n// Tiny polyfill for TypeScript's Reflect metadata API.\nconst metadataByTarget = new Map();\nif (!(\"metadata\" in Reflect)) {\n Reflect.metadata = function (key, value) {\n return function (target) {\n Reflect.defineMetadata(key, value, target);\n };\n };\n Reflect.defineMetadata = function (key, value, target) {\n let metadata = metadataByTarget.get(target);\n if (metadata === void 0) {\n metadataByTarget.set(target, (metadata = new Map()));\n }\n metadata.set(key, value);\n };\n Reflect.getOwnMetadata = function (key, target) {\n const metadata = metadataByTarget.get(target);\n if (metadata !== void 0) {\n return metadata.get(key);\n }\n return void 0;\n };\n}\n/**\n * A utility class used that constructs and registers resolvers for a dependency\n * injection container. Supports a standard set of object lifetimes.\n * @public\n */\nexport class ResolverBuilder {\n /**\n *\n * @param container - The container to create resolvers for.\n * @param key - The key to register resolvers under.\n */\n constructor(container, key) {\n this.container = container;\n this.key = key;\n }\n /**\n * Creates a resolver for an existing object instance.\n * @param value - The instance to resolve.\n * @returns The resolver.\n */\n instance(value) {\n return this.registerResolver(0 /* instance */, value);\n }\n /**\n * Creates a resolver that enforces a singleton lifetime.\n * @param value - The type to create and cache the singleton for.\n * @returns The resolver.\n */\n singleton(value) {\n return this.registerResolver(1 /* singleton */, value);\n }\n /**\n * Creates a resolver that creates a new instance for every dependency request.\n * @param value - The type to create instances of.\n * @returns - The resolver.\n */\n transient(value) {\n return this.registerResolver(2 /* transient */, value);\n }\n /**\n * Creates a resolver that invokes a callback function for every dependency resolution\n * request, allowing custom logic to return the dependency.\n * @param value - The callback to call during resolution.\n * @returns The resolver.\n */\n callback(value) {\n return this.registerResolver(3 /* callback */, value);\n }\n /**\n * Creates a resolver that invokes a callback function the first time that a dependency\n * resolution is requested. The returned value is then cached and provided for all\n * subsequent requests.\n * @param value - The callback to call during the first resolution.\n * @returns The resolver.\n */\n cachedCallback(value) {\n return this.registerResolver(3 /* callback */, cacheCallbackResult(value));\n }\n /**\n * Aliases the current key to a different key.\n * @param destinationKey - The key to point the alias to.\n * @returns The resolver.\n */\n aliasTo(destinationKey) {\n return this.registerResolver(5 /* alias */, destinationKey);\n }\n registerResolver(strategy, state) {\n const { container, key } = this;\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n this.container = this.key = (void 0);\n return container.registerResolver(key, new ResolverImpl(key, strategy, state));\n }\n}\nfunction cloneArrayWithPossibleProps(source) {\n const clone = source.slice();\n const keys = Object.keys(source);\n const len = keys.length;\n let key;\n for (let i = 0; i < len; ++i) {\n key = keys[i];\n if (!isArrayIndex(key)) {\n clone[key] = source[key];\n }\n }\n return clone;\n}\n/**\n * A set of default resolvers useful in configuring a container.\n * @public\n */\nexport const DefaultResolver = Object.freeze({\n /**\n * Disables auto-registration and throws for all un-registered dependencies.\n * @param key - The key to create the resolver for.\n */\n none(key) {\n throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`);\n },\n /**\n * Provides default singleton resolution behavior during auto-registration.\n * @param key - The key to create the resolver for.\n * @returns The resolver.\n */\n singleton(key) {\n return new ResolverImpl(key, 1 /* singleton */, key);\n },\n /**\n * Provides default transient resolution behavior during auto-registration.\n * @param key - The key to create the resolver for.\n * @returns The resolver.\n */\n transient(key) {\n return new ResolverImpl(key, 2 /* transient */, key);\n },\n});\n/**\n * Configuration for a dependency injection container.\n * @public\n */\nexport const ContainerConfiguration = Object.freeze({\n /**\n * The default configuration used when creating a DOM-disconnected container.\n * @remarks\n * The default creates a root container, with no parent container. It does not handle\n * owner requests and it uses singleton resolution behavior for auto-registration.\n */\n default: Object.freeze({\n parentLocator: () => null,\n responsibleForOwnerRequests: false,\n defaultResolver: DefaultResolver.singleton,\n }),\n});\nconst dependencyLookup = new Map();\nfunction getParamTypes(key) {\n return (Type) => {\n return Reflect.getOwnMetadata(key, Type);\n };\n}\nlet rootDOMContainer = null;\n/**\n * The gateway to dependency injection APIs.\n * @public\n */\nexport const DI = Object.freeze({\n /**\n * Creates a new dependency injection container.\n * @param config - The configuration for the container.\n * @returns A newly created dependency injection container.\n */\n createContainer(config) {\n return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config));\n },\n /**\n * Finds the dependency injection container responsible for providing dependencies\n * to the specified node.\n * @param node - The node to find the responsible container for.\n * @returns The container responsible for providing dependencies to the node.\n * @remarks\n * This will be the same as the parent container if the specified node\n * does not itself host a container configured with responsibleForOwnerRequests.\n */\n findResponsibleContainer(node) {\n const owned = node.$$container$$;\n if (owned && owned.responsibleForOwnerRequests) {\n return owned;\n }\n return DI.findParentContainer(node);\n },\n /**\n * Find the dependency injection container up the DOM tree from this node.\n * @param node - The node to find the parent container for.\n * @returns The parent container of this node.\n * @remarks\n * This will be the same as the responsible container if the specified node\n * does not itself host a container configured with responsibleForOwnerRequests.\n */\n findParentContainer(node) {\n const event = new CustomEvent(DILocateParentEventType, {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: { container: void 0 },\n });\n node.dispatchEvent(event);\n return event.detail.container || DI.getOrCreateDOMContainer();\n },\n /**\n * Returns a dependency injection container if one is explicitly owned by the specified\n * node. If one is not owned, then a new container is created and assigned to the node.\n * @param node - The node to find or create the container for.\n * @param config - The configuration for the container if one needs to be created.\n * @returns The located or created container.\n * @remarks\n * This API does not search for a responsible or parent container. It looks only for a container\n * directly defined on the specified node and creates one at that location if one does not\n * already exist.\n */\n getOrCreateDOMContainer(node, config) {\n if (!node) {\n return (rootDOMContainer ||\n (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, {\n parentLocator: () => null,\n }))));\n }\n return (node.$$container$$ ||\n new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, {\n parentLocator: DI.findParentContainer,\n })));\n },\n /**\n * Gets the \"design:paramtypes\" metadata for the specified type.\n * @param Type - The type to get the metadata for.\n * @returns The metadata array or undefined if no metadata is found.\n */\n getDesignParamtypes: getParamTypes(\"design:paramtypes\"),\n /**\n * Gets the \"di:paramtypes\" metadata for the specified type.\n * @param Type - The type to get the metadata for.\n * @returns The metadata array or undefined if no metadata is found.\n */\n getAnnotationParamtypes: getParamTypes(\"di:paramtypes\"),\n /**\n *\n * @param Type - Gets the \"di:paramtypes\" metadata for the specified type. If none is found,\n * an empty metadata array is created and added.\n * @returns The metadata array.\n */\n getOrCreateAnnotationParamTypes(Type) {\n let annotationParamtypes = this.getAnnotationParamtypes(Type);\n if (annotationParamtypes === void 0) {\n Reflect.defineMetadata(\"di:paramtypes\", (annotationParamtypes = []), Type);\n }\n return annotationParamtypes;\n },\n /**\n * Gets the dependency keys representing what is needed to instantiate the specified type.\n * @param Type - The type to get the dependencies for.\n * @returns An array of dependency keys.\n */\n getDependencies(Type) {\n // Note: Every detail of this getDependencies method is pretty deliberate at the moment, and probably not yet 100% tested from every possible angle,\n // so be careful with making changes here as it can have a huge impact on complex end user apps.\n // Preferably, only make changes to the dependency resolution process via a RFC.\n let dependencies = dependencyLookup.get(Type);\n if (dependencies === void 0) {\n // Type.length is the number of constructor parameters. If this is 0, it could mean the class has an empty constructor\n // but it could also mean the class has no constructor at all (in which case it inherits the constructor from the prototype).\n // Non-zero constructor length + no paramtypes means emitDecoratorMetadata is off, or the class has no decorator.\n // We're not doing anything with the above right now, but it's good to keep in mind for any future issues.\n const inject = Type.inject;\n if (inject === void 0) {\n // design:paramtypes is set by tsc when emitDecoratorMetadata is enabled.\n const designParamtypes = DI.getDesignParamtypes(Type);\n // di:paramtypes is set by the parameter decorator from DI.createInterface or by @inject\n const annotationParamtypes = DI.getAnnotationParamtypes(Type);\n if (designParamtypes === void 0) {\n if (annotationParamtypes === void 0) {\n // Only go up the prototype if neither static inject nor any of the paramtypes is defined, as\n // there is no sound way to merge a type's deps with its prototype's deps\n const Proto = Object.getPrototypeOf(Type);\n if (typeof Proto === \"function\" && Proto !== Function.prototype) {\n dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto));\n }\n else {\n dependencies = [];\n }\n }\n else {\n // No design:paramtypes so just use the di:paramtypes\n dependencies = cloneArrayWithPossibleProps(annotationParamtypes);\n }\n }\n else if (annotationParamtypes === void 0) {\n // No di:paramtypes so just use the design:paramtypes\n dependencies = cloneArrayWithPossibleProps(designParamtypes);\n }\n else {\n // We've got both, so merge them (in case of conflict on same index, di:paramtypes take precedence)\n dependencies = cloneArrayWithPossibleProps(designParamtypes);\n let len = annotationParamtypes.length;\n let auAnnotationParamtype;\n for (let i = 0; i < len; ++i) {\n auAnnotationParamtype = annotationParamtypes[i];\n if (auAnnotationParamtype !== void 0) {\n dependencies[i] = auAnnotationParamtype;\n }\n }\n const keys = Object.keys(annotationParamtypes);\n len = keys.length;\n let key;\n for (let i = 0; i < len; ++i) {\n key = keys[i];\n if (!isArrayIndex(key)) {\n dependencies[key] = annotationParamtypes[key];\n }\n }\n }\n }\n else {\n // Ignore paramtypes if we have static inject\n dependencies = cloneArrayWithPossibleProps(inject);\n }\n dependencyLookup.set(Type, dependencies);\n }\n return dependencies;\n },\n /**\n * Defines a property on a web component class. The value of this property will\n * be resolved from the dependency injection container responsible for the element\n * instance, based on where it is connected in the DOM.\n * @param target - The target to define the property on.\n * @param propertyName - The name of the property to define.\n * @param key - The dependency injection key.\n * @param respectConnection - Indicates whether or not to update the property value if the\n * hosting component is disconnected and then re-connected at a different location in the DOM.\n * @remarks\n * The respectConnection option is only applicable to elements that descend from FASTElement.\n */\n defineProperty(target, propertyName, key, respectConnection = false) {\n const diPropertyKey = `$di_${propertyName}`;\n Reflect.defineProperty(target, propertyName, {\n get: function () {\n let value = this[diPropertyKey];\n if (value === void 0) {\n const container = this instanceof HTMLElement\n ? DI.findResponsibleContainer(this)\n : DI.getOrCreateDOMContainer();\n value = container.get(key);\n this[diPropertyKey] = value;\n if (respectConnection && this instanceof FASTElement) {\n const notifier = this.$fastController;\n const handleChange = () => {\n const newContainer = DI.findResponsibleContainer(this);\n const newValue = newContainer.get(key);\n const oldValue = this[diPropertyKey];\n if (newValue !== oldValue) {\n this[diPropertyKey] = value;\n notifier.notify(propertyName);\n }\n };\n notifier.subscribe({ handleChange }, \"isConnected\");\n }\n }\n return value;\n },\n });\n },\n /**\n * Creates a dependency injection key.\n * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a\n * default resolution for the dependency.\n * @param configuror - If a friendly name was provided for the first parameter, then an optional\n * lambda that configures a default resolution for the dependency can be provided second.\n * @returns The created key.\n * @remarks\n * The created key can be used as a property decorator or constructor parameter decorator,\n * in addition to its standard use in an inject array or through direct container APIs.\n */\n createInterface(nameConfigOrCallback, configuror) {\n const configure = typeof nameConfigOrCallback === \"function\"\n ? nameConfigOrCallback\n : configuror;\n const friendlyName = typeof nameConfigOrCallback === \"string\"\n ? nameConfigOrCallback\n : nameConfigOrCallback && \"friendlyName\" in nameConfigOrCallback\n ? nameConfigOrCallback.friendlyName || defaultFriendlyName\n : defaultFriendlyName;\n const respectConnection = typeof nameConfigOrCallback === \"string\"\n ? false\n : nameConfigOrCallback && \"respectConnection\" in nameConfigOrCallback\n ? nameConfigOrCallback.respectConnection || false\n : false;\n const Interface = function (target, property, index) {\n if (target == null || new.target !== undefined) {\n throw new Error(`No registration for interface: '${Interface.friendlyName}'`);\n }\n if (property) {\n DI.defineProperty(target, property, Interface, respectConnection);\n }\n else {\n const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target);\n annotationParamtypes[index] = Interface;\n }\n };\n Interface.$isInterface = true;\n Interface.friendlyName = friendlyName == null ? \"(anonymous)\" : friendlyName;\n if (configure != null) {\n Interface.register = function (container, key) {\n return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface));\n };\n }\n Interface.toString = function toString() {\n return `InterfaceSymbol<${Interface.friendlyName}>`;\n };\n return Interface;\n },\n /**\n * A decorator that specifies what to inject into its target.\n * @param dependencies - The dependencies to inject.\n * @returns The decorator to be applied to the target class.\n * @remarks\n * The decorator can be used to decorate a class, listing all of the classes dependencies.\n * Or it can be used to decorate a constructor paramter, indicating what to inject for that\n * parameter.\n * Or it can be used for a web component property, indicating what that property should resolve to.\n */\n inject(...dependencies) {\n return function (target, key, descriptor) {\n if (typeof descriptor === \"number\") {\n // It's a parameter decorator.\n const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target);\n const dep = dependencies[0];\n if (dep !== void 0) {\n annotationParamtypes[descriptor] = dep;\n }\n }\n else if (key) {\n DI.defineProperty(target, key, dependencies[0]);\n }\n else {\n const annotationParamtypes = descriptor\n ? DI.getOrCreateAnnotationParamTypes(descriptor.value)\n : DI.getOrCreateAnnotationParamTypes(target);\n let dep;\n for (let i = 0; i < dependencies.length; ++i) {\n dep = dependencies[i];\n if (dep !== void 0) {\n annotationParamtypes[i] = dep;\n }\n }\n }\n };\n },\n /**\n * Registers the `target` class as a transient dependency; each time the dependency is resolved\n * a new instance will be created.\n *\n * @param target - The class / constructor function to register as transient.\n * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver.\n *\n * @example\n * On an existing class\n * ```ts\n * class Foo { }\n * DI.transient(Foo);\n * ```\n *\n * @example\n * Inline declaration\n *\n * ```ts\n * const Foo = DI.transient(class { });\n * // Foo is now strongly typed with register\n * Foo.register(container);\n * ```\n *\n * @public\n */\n transient(target) {\n target.register = function register(container) {\n const registration = Registration.transient(target, target);\n return registration.register(container);\n };\n target.registerInRequestor = false;\n return target;\n },\n /**\n * Registers the `target` class as a singleton dependency; the class will only be created once. Each\n * consecutive time the dependency is resolved, the same instance will be returned.\n *\n * @param target - The class / constructor function to register as a singleton.\n * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver.\n * @example\n * On an existing class\n * ```ts\n * class Foo { }\n * DI.singleton(Foo);\n * ```\n *\n * @example\n * Inline declaration\n * ```ts\n * const Foo = DI.singleton(class { });\n * // Foo is now strongly typed with register\n * Foo.register(container);\n * ```\n *\n * @public\n */\n singleton(target, options = defaultSingletonOptions) {\n target.register = function register(container) {\n const registration = Registration.singleton(target, target);\n return registration.register(container);\n };\n target.registerInRequestor = options.scoped;\n return target;\n },\n});\n/**\n * The interface key that resolves the dependency injection container itself.\n * @public\n */\nexport const Container = DI.createInterface(\"Container\");\n/**\n * The interface key that resolves the service locator itself.\n * @public\n */\nexport const ServiceLocator = Container;\nfunction createResolver(getter) {\n return function (key) {\n const resolver = function (target, property, descriptor) {\n DI.inject(resolver)(target, property, descriptor);\n };\n resolver.$isResolver = true;\n resolver.resolve = function (handler, requestor) {\n return getter(key, handler, requestor);\n };\n return resolver;\n };\n}\n/**\n * A decorator that specifies what to inject into its target.\n * @param dependencies - The dependencies to inject.\n * @returns The decorator to be applied to the target class.\n * @remarks\n * The decorator can be used to decorate a class, listing all of the classes dependencies.\n * Or it can be used to decorate a constructor paramter, indicating what to inject for that\n * parameter.\n * Or it can be used for a web component property, indicating what that property should resolve to.\n *\n * @public\n */\nexport const inject = DI.inject;\nfunction transientDecorator(target) {\n return DI.transient(target);\n}\nexport function transient(target) {\n return target == null ? transientDecorator : transientDecorator(target);\n}\nconst defaultSingletonOptions = { scoped: false };\nfunction singletonDecorator(target) {\n return DI.singleton(target);\n}\n/**\n * @public\n */\nexport function singleton(targetOrOptions) {\n if (typeof targetOrOptions === \"function\") {\n return DI.singleton(targetOrOptions);\n }\n return function ($target) {\n return DI.singleton($target, targetOrOptions);\n };\n}\nfunction createAllResolver(getter) {\n return function (key, searchAncestors) {\n searchAncestors = !!searchAncestors;\n const resolver = function (target, property, descriptor) {\n DI.inject(resolver)(target, property, descriptor);\n };\n resolver.$isResolver = true;\n resolver.resolve = function (handler, requestor) {\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n return getter(key, handler, requestor, searchAncestors);\n };\n return resolver;\n };\n}\n/**\n * A decorator and DI resolver that will resolve an array of all dependencies\n * registered with the specified key.\n * @param key - The key to resolve all dependencies for.\n * @param searchAncestors - [optional] Indicates whether to search ancestor containers.\n * @public\n */\nexport const all = createAllResolver((key, handler, requestor, searchAncestors) => requestor.getAll(key, searchAncestors));\n/**\n * A decorator that lazily injects a dependency depending on whether the `Key` is present at the time of function call.\n *\n * @example\n * You need to make your argument a function that returns the type, for example\n * ```ts\n * class Foo {\n * constructor( @lazy('random') public random: () => number )\n * }\n * const foo = container.get(Foo); // instanceof Foo\n * foo.random(); // throws\n * ```\n * would throw an exception because you haven't registered `'random'` before calling the method.\n * @example\n * This, would give you a new 'Math.random()' number each time.\n * ```ts\n * class Foo {\n * constructor( @lazy('random') public random: () => random )\n * }\n * container.register(Registration.callback('random', Math.random ));\n * container.get(Foo).random(); // some random number\n * container.get(Foo).random(); // another random number\n * ```\n *\n * `@lazy` does not manage the lifecycle of the underlying key. If you want a singleton, you have to register as a\n * `singleton`, `transient` would also behave as you would expect, providing you a new instance each time.\n *\n * @param key - The key to lazily resolve.\n * see {@link DI.createInterface} on interactions with interfaces\n *\n * @public\n */\nexport const lazy = createResolver((key, handler, requestor) => {\n return () => requestor.get(key);\n});\n/**\n * A decorator that allows you to optionally inject a dependency depending on whether the [[`Key`]] is present, for example:\n * @example\n * ```ts\n * class Foo {\n * constructor( @inject('mystring') public str: string = 'somestring' )\n * }\n * container.get(Foo); // throws\n * ```\n * would fail\n *\n * @example\n * ```ts\n * class Foo {\n * constructor( @optional('mystring') public str: string = 'somestring' )\n * }\n * container.get(Foo).str // somestring\n * ```\n * if you use it without a default it will inject `undefined`, so remember to mark your input type as\n * possibly `undefined`!\n *\n * @param key - The key to optionally resolve.\n * see {@link DI.createInterface} on interactions with interfaces\n *\n * @public\n */\nexport const optional = createResolver((key, handler, requestor) => {\n if (requestor.has(key, true)) {\n return requestor.get(key);\n }\n else {\n return undefined;\n }\n});\n/**\n * A decorator that tells the container not to try to inject a dependency.\n *\n * @public\n */\nexport function ignore(target, property, descriptor) {\n DI.inject(ignore)(target, property, descriptor);\n}\n// Hack: casting below used to prevent TS from generate a namespace which can't be commented\n// and results in documentation validation errors.\nignore.$isResolver = true;\nignore.resolve = () => undefined;\n/**\n * A decorator that indicates that a new instance should be injected scoped to the\n * container that requested the instance.\n * @param key - The dependency key for the new instance.\n * @remarks\n * This creates a resolver with an instance strategy pointing to the new instance, effectively\n * making this a singleton, scoped to the container or DOM's subtree.\n *\n * @public\n */\nexport const newInstanceForScope = createResolver((key, handler, requestor) => {\n const instance = createNewInstance(key, handler);\n const resolver = new ResolverImpl(key, 0 /* instance */, instance);\n requestor.registerResolver(key, resolver);\n return instance;\n});\n/**\n * A decorator that indicates that a new instance should be injected.\n * @param key - The dependency key for the new instance.\n * @remarks\n * The instance is not internally cached with a resolver as newInstanceForScope does.\n *\n * @public\n */\nexport const newInstanceOf = createResolver((key, handler, _requestor) => createNewInstance(key, handler));\nfunction createNewInstance(key, handler) {\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n return handler.getFactory(key).construct(handler);\n}\n/** @internal */\nexport class ResolverImpl {\n constructor(key, strategy, state) {\n this.key = key;\n this.strategy = strategy;\n this.state = state;\n this.resolving = false;\n }\n get $isResolver() {\n return true;\n }\n register(container) {\n return container.registerResolver(this.key, this);\n }\n resolve(handler, requestor) {\n switch (this.strategy) {\n case 0 /* instance */:\n return this.state;\n case 1 /* singleton */: {\n if (this.resolving) {\n throw new Error(`Cyclic dependency found: ${this.state.name}`);\n }\n this.resolving = true;\n this.state = handler\n .getFactory(this.state)\n .construct(requestor);\n this.strategy = 0 /* instance */;\n this.resolving = false;\n return this.state;\n }\n case 2 /* transient */: {\n // Always create transients from the requesting container\n const factory = handler.getFactory(this.state);\n if (factory === null) {\n throw new Error(`Resolver for ${String(this.key)} returned a null factory`);\n }\n return factory.construct(requestor);\n }\n case 3 /* callback */:\n return this.state(handler, requestor, this);\n case 4 /* array */:\n return this.state[0].resolve(handler, requestor);\n case 5 /* alias */:\n return requestor.get(this.state);\n default:\n throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`);\n }\n }\n getFactory(container) {\n var _a, _b, _c;\n switch (this.strategy) {\n case 1 /* singleton */:\n case 2 /* transient */:\n return container.getFactory(this.state);\n case 5 /* alias */:\n return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null;\n default:\n return null;\n }\n }\n}\nfunction containerGetKey(d) {\n return this.get(d);\n}\nfunction transformInstance(inst, transform) {\n return transform(inst);\n}\n/** @internal */\nexport class FactoryImpl {\n constructor(Type, dependencies) {\n this.Type = Type;\n this.dependencies = dependencies;\n this.transformers = null;\n }\n construct(container, dynamicDependencies) {\n let instance;\n if (dynamicDependencies === void 0) {\n instance = new this.Type(...this.dependencies.map(containerGetKey, container));\n }\n else {\n instance = new this.Type(...this.dependencies.map(containerGetKey, container), ...dynamicDependencies);\n }\n if (this.transformers == null) {\n return instance;\n }\n return this.transformers.reduce(transformInstance, instance);\n }\n registerTransformer(transformer) {\n (this.transformers || (this.transformers = [])).push(transformer);\n }\n}\nconst containerResolver = {\n $isResolver: true,\n resolve(handler, requestor) {\n return requestor;\n },\n};\nfunction isRegistry(obj) {\n return typeof obj.register === \"function\";\n}\nfunction isSelfRegistry(obj) {\n return isRegistry(obj) && typeof obj.registerInRequestor === \"boolean\";\n}\nfunction isRegisterInRequester(obj) {\n return isSelfRegistry(obj) && obj.registerInRequestor;\n}\nfunction isClass(obj) {\n return obj.prototype !== void 0;\n}\nconst InstrinsicTypeNames = new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"Error\",\n \"EvalError\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Int8Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Map\",\n \"Number\",\n \"Object\",\n \"Promise\",\n \"RangeError\",\n \"ReferenceError\",\n \"RegExp\",\n \"Set\",\n \"SharedArrayBuffer\",\n \"String\",\n \"SyntaxError\",\n \"TypeError\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"URIError\",\n \"WeakMap\",\n \"WeakSet\",\n]);\nconst DILocateParentEventType = \"__DI_LOCATE_PARENT__\";\nconst factories = new Map();\n/**\n * @internal\n */\nexport class ContainerImpl {\n constructor(owner, config) {\n this.owner = owner;\n this.config = config;\n this._parent = void 0;\n this.registerDepth = 0;\n this.context = null;\n if (owner !== null) {\n owner.$$container$$ = this;\n }\n this.resolvers = new Map();\n this.resolvers.set(Container, containerResolver);\n if (owner instanceof Node) {\n owner.addEventListener(DILocateParentEventType, (e) => {\n if (e.composedPath()[0] !== this.owner) {\n e.detail.container = this;\n e.stopImmediatePropagation();\n }\n });\n }\n }\n get parent() {\n if (this._parent === void 0) {\n this._parent = this.config.parentLocator(this.owner);\n }\n return this._parent;\n }\n get depth() {\n return this.parent === null ? 0 : this.parent.depth + 1;\n }\n get responsibleForOwnerRequests() {\n return this.config.responsibleForOwnerRequests;\n }\n registerWithContext(context, ...params) {\n this.context = context;\n this.register(...params);\n this.context = null;\n return this;\n }\n register(...params) {\n if (++this.registerDepth === 100) {\n throw new Error(\"Unable to autoregister dependency\");\n // Most likely cause is trying to register a plain object that does not have a\n // register method and is not a class constructor\n }\n let current;\n let keys;\n let value;\n let j;\n let jj;\n const context = this.context;\n for (let i = 0, ii = params.length; i < ii; ++i) {\n current = params[i];\n if (!isObject(current)) {\n continue;\n }\n if (isRegistry(current)) {\n current.register(this, context);\n }\n else if (isClass(current)) {\n Registration.singleton(current, current).register(this);\n }\n else {\n keys = Object.keys(current);\n j = 0;\n jj = keys.length;\n for (; j < jj; ++j) {\n value = current[keys[j]];\n if (!isObject(value)) {\n continue;\n }\n // note: we could remove this if-branch and call this.register directly\n // - the extra check is just a perf tweak to create fewer unnecessary arrays by the spread operator\n if (isRegistry(value)) {\n value.register(this, context);\n }\n else {\n this.register(value);\n }\n }\n }\n }\n --this.registerDepth;\n return this;\n }\n registerResolver(key, resolver) {\n validateKey(key);\n const resolvers = this.resolvers;\n const result = resolvers.get(key);\n if (result == null) {\n resolvers.set(key, resolver);\n }\n else if (result instanceof ResolverImpl &&\n result.strategy === 4 /* array */) {\n result.state.push(resolver);\n }\n else {\n resolvers.set(key, new ResolverImpl(key, 4 /* array */, [result, resolver]));\n }\n return resolver;\n }\n registerTransformer(key, transformer) {\n const resolver = this.getResolver(key);\n if (resolver == null) {\n return false;\n }\n if (resolver.getFactory) {\n const factory = resolver.getFactory(this);\n if (factory == null) {\n return false;\n }\n // This type cast is a bit of a hacky one, necessary due to the duplicity of IResolverLike.\n // Problem is that that interface's type arg can be of type Key, but the getFactory method only works on\n // type Constructable. So the return type of that optional method has this additional constraint, which\n // seems to confuse the type checker.\n factory.registerTransformer(transformer);\n return true;\n }\n return false;\n }\n getResolver(key, autoRegister = true) {\n validateKey(key);\n if (key.resolve !== void 0) {\n return key;\n }\n /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n let current = this;\n let resolver;\n while (current != null) {\n resolver = current.resolvers.get(key);\n if (resolver == null) {\n if (current.parent == null) {\n const handler = isRegisterInRequester(key)\n ? this\n : current;\n return autoRegister ? this.jitRegister(key, handler) : null;\n }\n current = current.parent;\n }\n else {\n return resolver;\n }\n }\n return null;\n }\n has(key, searchAncestors = false) {\n return this.resolvers.has(key)\n ? true\n : searchAncestors && this.parent != null\n ? this.parent.has(key, true)\n : false;\n }\n get(key) {\n validateKey(key);\n if (key.$isResolver) {\n return key.resolve(this, this);\n }\n /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n let current = this;\n let resolver;\n while (current != null) {\n resolver = current.resolvers.get(key);\n if (resolver == null) {\n if (current.parent == null) {\n const handler = isRegisterInRequester(key)\n ? this\n : current;\n resolver = this.jitRegister(key, handler);\n return resolver.resolve(current, this);\n }\n current = current.parent;\n }\n else {\n return resolver.resolve(current, this);\n }\n }\n throw new Error(`Unable to resolve key: ${key}`);\n }\n getAll(key, searchAncestors = false) {\n validateKey(key);\n /* eslint-disable-next-line @typescript-eslint/no-this-alias */\n const requestor = this;\n let current = requestor;\n let resolver;\n if (searchAncestors) {\n let resolutions = emptyArray;\n while (current != null) {\n resolver = current.resolvers.get(key);\n if (resolver != null) {\n resolutions = resolutions.concat(\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n buildAllResponse(resolver, current, requestor));\n }\n current = current.parent;\n }\n return resolutions;\n }\n else {\n while (current != null) {\n resolver = current.resolvers.get(key);\n if (resolver == null) {\n current = current.parent;\n if (current == null) {\n return emptyArray;\n }\n }\n else {\n return buildAllResponse(resolver, current, requestor);\n }\n }\n }\n return emptyArray;\n }\n getFactory(Type) {\n let factory = factories.get(Type);\n if (factory === void 0) {\n if (isNativeFunction(Type)) {\n throw new Error(`${Type.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`);\n }\n factories.set(Type, (factory = new FactoryImpl(Type, DI.getDependencies(Type))));\n }\n return factory;\n }\n registerFactory(key, factory) {\n factories.set(key, factory);\n }\n createChild(config) {\n return new ContainerImpl(null, Object.assign({}, this.config, config, { parentLocator: () => this }));\n }\n jitRegister(keyAsValue, handler) {\n if (typeof keyAsValue !== \"function\") {\n throw new Error(`Attempted to jitRegister something that is not a constructor: '${keyAsValue}'. Did you forget to register this dependency?`);\n }\n if (InstrinsicTypeNames.has(keyAsValue.name)) {\n throw new Error(`Attempted to jitRegister an intrinsic type: ${keyAsValue.name}. Did you forget to add @inject(Key)`);\n }\n if (isRegistry(keyAsValue)) {\n const registrationResolver = keyAsValue.register(handler);\n if (!(registrationResolver instanceof Object) ||\n registrationResolver.resolve == null) {\n const newResolver = handler.resolvers.get(keyAsValue);\n if (newResolver != void 0) {\n return newResolver;\n }\n throw new Error(\"A valid resolver was not returned from the static register method\");\n }\n return registrationResolver;\n }\n else if (keyAsValue.$isInterface) {\n throw new Error(`Attempted to jitRegister an interface: ${keyAsValue.friendlyName}`);\n }\n else {\n const resolver = this.config.defaultResolver(keyAsValue, handler);\n handler.resolvers.set(keyAsValue, resolver);\n return resolver;\n }\n }\n}\nconst cache = new WeakMap();\nfunction cacheCallbackResult(fun) {\n return function (handler, requestor, resolver) {\n if (cache.has(resolver)) {\n return cache.get(resolver);\n }\n const t = fun(handler, requestor, resolver);\n cache.set(resolver, t);\n return t;\n };\n}\n/**\n * You can use the resulting Registration of any of the factory methods\n * to register with the container.\n *\n * @example\n * ```\n * class Foo {}\n * const container = DI.createContainer();\n * container.register(Registration.instance(Foo, new Foo()));\n * container.get(Foo);\n * ```\n *\n * @public\n */\nexport const Registration = Object.freeze({\n /**\n * Allows you to pass an instance.\n * Every time you request this {@link Key} you will get this instance back.\n *\n * @example\n * ```\n * Registration.instance(Foo, new Foo()));\n * ```\n *\n * @param key - The key to register the instance under.\n * @param value - The instance to return when the key is requested.\n */\n instance(key, value) {\n return new ResolverImpl(key, 0 /* instance */, value);\n },\n /**\n * Creates an instance from the class.\n * Every time you request this {@link Key} you will get the same one back.\n *\n * @example\n * ```\n * Registration.singleton(Foo, Foo);\n * ```\n *\n * @param key - The key to register the singleton under.\n * @param value - The class to instantiate as a singleton when first requested.\n */\n singleton(key, value) {\n return new ResolverImpl(key, 1 /* singleton */, value);\n },\n /**\n * Creates an instance from a class.\n * Every time you request this {@link Key} you will get a new instance.\n *\n * @example\n * ```\n * Registration.instance(Foo, Foo);\n * ```\n *\n * @param key - The key to register the instance type under.\n * @param value - The class to instantiate each time the key is requested.\n */\n transient(key, value) {\n return new ResolverImpl(key, 2 /* transient */, value);\n },\n /**\n * Delegates to a callback function to provide the dependency.\n * Every time you request this {@link Key} the callback will be invoked to provide\n * the dependency.\n *\n * @example\n * ```\n * Registration.callback(Foo, () => new Foo());\n * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo)));\n * ```\n *\n * @param key - The key to register the callback for.\n * @param callback - The function that is expected to return the dependency.\n */\n callback(key, callback) {\n return new ResolverImpl(key, 3 /* callback */, callback);\n },\n /**\n * Delegates to a callback function to provide the dependency and then caches the\n * dependency for future requests.\n *\n * @example\n * ```\n * Registration.cachedCallback(Foo, () => new Foo());\n * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo)));\n * ```\n *\n * @param key - The key to register the callback for.\n * @param callback - The function that is expected to return the dependency.\n * @remarks\n * If you pass the same Registration to another container, the same cached value will be used.\n * Should all references to the resolver returned be removed, the cache will expire.\n */\n cachedCallback(key, callback) {\n return new ResolverImpl(key, 3 /* callback */, cacheCallbackResult(callback));\n },\n /**\n * Creates an alternate {@link Key} to retrieve an instance by.\n *\n * @example\n * ```\n * Register.singleton(Foo, Foo)\n * Register.aliasTo(Foo, MyFoos);\n *\n * container.getAll(MyFoos) // contains an instance of Foo\n * ```\n *\n * @param originalKey - The original key that has been registered.\n * @param aliasKey - The alias to the original key.\n */\n aliasTo(originalKey, aliasKey) {\n return new ResolverImpl(aliasKey, 5 /* alias */, originalKey);\n },\n});\n/** @internal */\nexport function validateKey(key) {\n if (key === null || key === void 0) {\n throw new Error(\"key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?\");\n }\n}\nfunction buildAllResponse(resolver, handler, requestor) {\n if (resolver instanceof ResolverImpl &&\n resolver.strategy === 4 /* array */) {\n const state = resolver.state;\n let i = state.length;\n const results = new Array(i);\n while (i--) {\n results[i] = state[i].resolve(handler, requestor);\n }\n return results;\n }\n return [resolver.resolve(handler, requestor)];\n}\nconst defaultFriendlyName = \"(anonymous)\";\nfunction isObject(value) {\n return (typeof value === \"object\" && value !== null) || typeof value === \"function\";\n}\n/**\n * Determine whether the value is a native function.\n *\n * @param fn - The function to check.\n * @returns `true` is the function is a native function, otherwise `false`\n */\nconst isNativeFunction = (function () {\n const lookup = new WeakMap();\n let isNative = false;\n let sourceText = \"\";\n let i = 0;\n return function (fn) {\n isNative = lookup.get(fn);\n if (isNative === void 0) {\n sourceText = fn.toString();\n i = sourceText.length;\n // http://www.ecma-international.org/ecma-262/#prod-NativeFunction\n isNative =\n // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string\n i >= 29 &&\n // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61.\n i <= 100 &&\n // This whole heuristic *could* be tricked by a comment. Do we need to care about that?\n sourceText.charCodeAt(i - 1) === 0x7d && // }\n // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption.\n sourceText.charCodeAt(i - 2) <= 0x20 && // whitespace\n sourceText.charCodeAt(i - 3) === 0x5d && // ]\n sourceText.charCodeAt(i - 4) === 0x65 && // e\n sourceText.charCodeAt(i - 5) === 0x64 && // d\n sourceText.charCodeAt(i - 6) === 0x6f && // o\n sourceText.charCodeAt(i - 7) === 0x63 && // c\n sourceText.charCodeAt(i - 8) === 0x20 && //\n sourceText.charCodeAt(i - 9) === 0x65 && // e\n sourceText.charCodeAt(i - 10) === 0x76 && // v\n sourceText.charCodeAt(i - 11) === 0x69 && // i\n sourceText.charCodeAt(i - 12) === 0x74 && // t\n sourceText.charCodeAt(i - 13) === 0x61 && // a\n sourceText.charCodeAt(i - 14) === 0x6e && // n\n sourceText.charCodeAt(i - 15) === 0x58; // [\n lookup.set(fn, isNative);\n }\n return isNative;\n };\n})();\nconst isNumericLookup = {};\nfunction isArrayIndex(value) {\n switch (typeof value) {\n case \"number\":\n return value >= 0 && (value | 0) === value;\n case \"string\": {\n const result = isNumericLookup[value];\n if (result !== void 0) {\n return result;\n }\n const length = value.length;\n if (length === 0) {\n return (isNumericLookup[value] = false);\n }\n let ch = 0;\n for (let i = 0; i < length; ++i) {\n ch = value.charCodeAt(i);\n if ((i === 0 && ch === 0x30 && length > 1) /* must not start with 0 */ ||\n ch < 0x30 /* 0 */ ||\n ch > 0x39 /* 9 */) {\n return (isNumericLookup[value] = false);\n }\n }\n return (isNumericLookup[value] = true);\n }\n default:\n return false;\n }\n}\n","import { ElementStyles, } from \"@microsoft/fast-element\";\nimport { DI, Registration } from \"../di/di.js\";\nfunction presentationKeyFromTag(tagName) {\n return `${tagName.toLowerCase()}:presentation`;\n}\nconst presentationRegistry = new Map();\n/**\n * An API gateway to component presentation features.\n * @public\n */\nexport const ComponentPresentation = Object.freeze({\n /**\n * Defines a component presentation for an element.\n * @param tagName - The element name to define the presentation for.\n * @param presentation - The presentation that will be applied to matching elements.\n * @param container - The dependency injection container to register the configuration in.\n * @public\n */\n define(tagName, presentation, container) {\n const key = presentationKeyFromTag(tagName);\n const existing = presentationRegistry.get(key);\n if (existing === void 0) {\n presentationRegistry.set(key, presentation);\n }\n else {\n // false indicates that we have more than one presentation\n // registered for a tagName and we must resolve through DI\n presentationRegistry.set(key, false);\n }\n container.register(Registration.instance(key, presentation));\n },\n /**\n * Finds a component presentation for the specified element name,\n * searching the DOM hierarchy starting from the provided element.\n * @param tagName - The name of the element to locate the presentation for.\n * @param element - The element to begin the search from.\n * @returns The component presentation or null if none is found.\n * @public\n */\n forTag(tagName, element) {\n const key = presentationKeyFromTag(tagName);\n const existing = presentationRegistry.get(key);\n if (existing === false) {\n const container = DI.findResponsibleContainer(element);\n return container.get(key);\n }\n return existing || null;\n },\n});\n/**\n * The default implementation of ComponentPresentation, used by FoundationElement.\n * @public\n */\nexport class DefaultComponentPresentation {\n /**\n * Creates an instance of DefaultComponentPresentation.\n * @param template - The template to apply to the element.\n * @param styles - The styles to apply to the element.\n * @public\n */\n constructor(template, styles) {\n this.template = template || null;\n this.styles =\n styles === void 0\n ? null\n : Array.isArray(styles)\n ? ElementStyles.create(styles)\n : styles instanceof ElementStyles\n ? styles\n : ElementStyles.create([styles]);\n }\n /**\n * Applies the presentation details to the specified element.\n * @param element - The element to apply the presentation details to.\n * @public\n */\n applyTo(element) {\n const controller = element.$fastController;\n if (controller.template === null) {\n controller.template = this.template;\n }\n if (controller.styles === null) {\n controller.styles = this.styles;\n }\n }\n}\n","import { __decorate } from \"tslib\";\nimport { FASTElement, observable } from \"@microsoft/fast-element\";\nimport { ComponentPresentation, DefaultComponentPresentation, } from \"../design-system/component-presentation.js\";\n/**\n * Defines a foundation element class that:\n * 1. Connects the element to its ComponentPresentation\n * 2. Allows resolving the element template from the instance or ComponentPresentation\n * 3. Allows resolving the element styles from the instance or ComponentPresentation\n *\n * @public\n */\nexport class FoundationElement extends FASTElement {\n constructor() {\n super(...arguments);\n this._presentation = void 0;\n }\n /**\n * A property which resolves the ComponentPresentation instance\n * for the current component.\n * @public\n */\n get $presentation() {\n if (this._presentation === void 0) {\n this._presentation = ComponentPresentation.forTag(this.tagName, this);\n }\n return this._presentation;\n }\n templateChanged() {\n if (this.template !== undefined) {\n this.$fastController.template = this.template;\n }\n }\n stylesChanged() {\n if (this.styles !== undefined) {\n this.$fastController.styles = this.styles;\n }\n }\n /**\n * The connected callback for this FASTElement.\n * @remarks\n * This method is invoked by the platform whenever this FoundationElement\n * becomes connected to the document.\n * @public\n */\n connectedCallback() {\n if (this.$presentation !== null) {\n this.$presentation.applyTo(this);\n }\n super.connectedCallback();\n }\n /**\n * Defines an element registry function with a set of element definition defaults.\n * @param elementDefinition - The definition of the element to create the registry\n * function for.\n * @public\n */\n static compose(elementDefinition) {\n return (overrideDefinition = {}) => new FoundationElementRegistry(this === FoundationElement\n ? class extends FoundationElement {\n }\n : this, elementDefinition, overrideDefinition);\n }\n}\n__decorate([\n observable\n], FoundationElement.prototype, \"template\", void 0);\n__decorate([\n observable\n], FoundationElement.prototype, \"styles\", void 0);\nfunction resolveOption(option, context, definition) {\n if (typeof option === \"function\") {\n return option(context, definition);\n }\n return option;\n}\n/**\n * Registry capable of defining presentation properties for a DOM Container hierarchy.\n *\n * @internal\n */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport class FoundationElementRegistry {\n constructor(type, elementDefinition, overrideDefinition) {\n this.type = type;\n this.elementDefinition = elementDefinition;\n this.overrideDefinition = overrideDefinition;\n this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition);\n }\n register(container, context) {\n const definition = this.definition;\n const overrideDefinition = this.overrideDefinition;\n const prefix = definition.prefix || context.elementPrefix;\n const name = `${prefix}-${definition.baseName}`;\n context.tryDefineElement({\n name,\n type: this.type,\n baseClass: this.elementDefinition.baseClass,\n callback: x => {\n const presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition));\n x.definePresentation(presentation);\n let shadowOptions = resolveOption(definition.shadowOptions, x, definition);\n if (x.shadowRootMode) {\n // If the design system has overridden the shadow root mode, we need special handling.\n if (shadowOptions) {\n // If there are shadow options present in the definition, then\n // either the component itself has specified an option or the\n // registry function has overridden it.\n if (!overrideDefinition.shadowOptions) {\n // There were shadow options provided by the component and not overridden by\n // the registry.\n shadowOptions.mode = x.shadowRootMode;\n }\n }\n else if (shadowOptions !== null) {\n // If the component author did not provide shadow options,\n // and did not null them out (light dom opt-in) then they\n // were relying on the FASTElement default. So, if the\n // design system provides a mode, we need to create the options\n // to override the default.\n shadowOptions = { mode: x.shadowRootMode };\n }\n }\n x.defineElement({\n elementOptions: resolveOption(definition.elementOptions, x, definition),\n shadowOptions,\n attributes: resolveOption(definition.attributes, x, definition),\n });\n },\n });\n }\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n","import { AttributeConfiguration } from \"@microsoft/fast-element\";\n/**\n * Apply mixins to a constructor.\n * Sourced from {@link https://www.typescriptlang.org/docs/handbook/mixins.html | TypeScript Documentation }.\n * @public\n */\nexport function applyMixins(derivedCtor, ...baseCtors) {\n const derivedAttributes = AttributeConfiguration.locate(derivedCtor);\n baseCtors.forEach(baseCtor => {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {\n if (name !== \"constructor\") {\n Object.defineProperty(derivedCtor.prototype, name, \n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n Object.getOwnPropertyDescriptor(baseCtor.prototype, name));\n }\n });\n const baseAttributes = AttributeConfiguration.locate(baseCtor);\n baseAttributes.forEach(x => derivedAttributes.push(x));\n });\n}\n","import { __decorate } from \"tslib\";\nimport { attr, nullableNumberConverter, } from \"@microsoft/fast-element\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\n/**\n * An individual item in an {@link @microsoft/fast-foundation#(Accordion:class) }.\n *\n * @slot start - Content which can be provided between the heading and the icon\n * @slot end - Content which can be provided between the start slot and icon\n * @slot heading - Content which serves as the accordion item heading and text of the expand button\n * @slot - The default slot for accordion item content\n * @slot expanded-icon - The expanded icon\n * @slot collapsed-icon - The collapsed icon\n * @fires change - Fires a custom 'change' event when the button is invoked\n * @csspart heading - Wraps the button\n * @csspart button - The button which serves to invoke the item\n * @csspart heading-content - Wraps the slot for the heading content within the button\n * @csspart icon - The icon container\n * @csspart expanded-icon - The expanded icon slot\n * @csspart collapsed-icon - The collapsed icon\n * @csspart region - The wrapper for the accordion item content\n *\n * @public\n */\nexport class AccordionItem extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Configures the {@link https://www.w3.org/TR/wai-aria-1.1/#aria-level | level} of the\n * heading element.\n *\n * @defaultValue 2\n * @public\n * @remarks\n * HTML attribute: heading-level\n */\n this.headinglevel = 2;\n /**\n * Expands or collapses the item.\n *\n * @public\n * @remarks\n * HTML attribute: expanded\n */\n this.expanded = false;\n /**\n * @internal\n */\n this.clickHandler = (e) => {\n this.expanded = !this.expanded;\n this.change();\n };\n this.change = () => {\n this.$emit(\"change\");\n };\n }\n}\n__decorate([\n attr({\n attribute: \"heading-level\",\n mode: \"fromView\",\n converter: nullableNumberConverter,\n })\n], AccordionItem.prototype, \"headinglevel\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], AccordionItem.prototype, \"expanded\", void 0);\n__decorate([\n attr\n], AccordionItem.prototype, \"id\", void 0);\napplyMixins(AccordionItem, StartEnd);\n","import { elements, html, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Accordion} component.\n * @public\n */\nexport const accordionTemplate = (context, definition) => /* TODO: deprecate slot name `item` to only support default slot https://github.com/microsoft/fast/issues/5515 */ html `\n <template>\n <slot ${slotted({ property: \"accordionItems\", filter: elements() })}></slot>\n <slot name=\"item\" part=\"item\" ${slotted(\"accordionItems\")}></slot>\n </template>\n`;\n","/**\n * Key Code values\n * @deprecated - KeyCodes are deprecated, use individual string key exports\n */\nexport var KeyCodes;\n(function (KeyCodes) {\n KeyCodes[KeyCodes[\"alt\"] = 18] = \"alt\";\n KeyCodes[KeyCodes[\"arrowDown\"] = 40] = \"arrowDown\";\n KeyCodes[KeyCodes[\"arrowLeft\"] = 37] = \"arrowLeft\";\n KeyCodes[KeyCodes[\"arrowRight\"] = 39] = \"arrowRight\";\n KeyCodes[KeyCodes[\"arrowUp\"] = 38] = \"arrowUp\";\n KeyCodes[KeyCodes[\"back\"] = 8] = \"back\";\n KeyCodes[KeyCodes[\"backSlash\"] = 220] = \"backSlash\";\n KeyCodes[KeyCodes[\"break\"] = 19] = \"break\";\n KeyCodes[KeyCodes[\"capsLock\"] = 20] = \"capsLock\";\n KeyCodes[KeyCodes[\"closeBracket\"] = 221] = \"closeBracket\";\n KeyCodes[KeyCodes[\"colon\"] = 186] = \"colon\";\n KeyCodes[KeyCodes[\"colon2\"] = 59] = \"colon2\";\n KeyCodes[KeyCodes[\"comma\"] = 188] = \"comma\";\n KeyCodes[KeyCodes[\"ctrl\"] = 17] = \"ctrl\";\n KeyCodes[KeyCodes[\"delete\"] = 46] = \"delete\";\n KeyCodes[KeyCodes[\"end\"] = 35] = \"end\";\n KeyCodes[KeyCodes[\"enter\"] = 13] = \"enter\";\n KeyCodes[KeyCodes[\"equals\"] = 187] = \"equals\";\n KeyCodes[KeyCodes[\"equals2\"] = 61] = \"equals2\";\n KeyCodes[KeyCodes[\"equals3\"] = 107] = \"equals3\";\n KeyCodes[KeyCodes[\"escape\"] = 27] = \"escape\";\n KeyCodes[KeyCodes[\"forwardSlash\"] = 191] = \"forwardSlash\";\n KeyCodes[KeyCodes[\"function1\"] = 112] = \"function1\";\n KeyCodes[KeyCodes[\"function10\"] = 121] = \"function10\";\n KeyCodes[KeyCodes[\"function11\"] = 122] = \"function11\";\n KeyCodes[KeyCodes[\"function12\"] = 123] = \"function12\";\n KeyCodes[KeyCodes[\"function2\"] = 113] = \"function2\";\n KeyCodes[KeyCodes[\"function3\"] = 114] = \"function3\";\n KeyCodes[KeyCodes[\"function4\"] = 115] = \"function4\";\n KeyCodes[KeyCodes[\"function5\"] = 116] = \"function5\";\n KeyCodes[KeyCodes[\"function6\"] = 117] = \"function6\";\n KeyCodes[KeyCodes[\"function7\"] = 118] = \"function7\";\n KeyCodes[KeyCodes[\"function8\"] = 119] = \"function8\";\n KeyCodes[KeyCodes[\"function9\"] = 120] = \"function9\";\n KeyCodes[KeyCodes[\"home\"] = 36] = \"home\";\n KeyCodes[KeyCodes[\"insert\"] = 45] = \"insert\";\n KeyCodes[KeyCodes[\"menu\"] = 93] = \"menu\";\n KeyCodes[KeyCodes[\"minus\"] = 189] = \"minus\";\n KeyCodes[KeyCodes[\"minus2\"] = 109] = \"minus2\";\n KeyCodes[KeyCodes[\"numLock\"] = 144] = \"numLock\";\n KeyCodes[KeyCodes[\"numPad0\"] = 96] = \"numPad0\";\n KeyCodes[KeyCodes[\"numPad1\"] = 97] = \"numPad1\";\n KeyCodes[KeyCodes[\"numPad2\"] = 98] = \"numPad2\";\n KeyCodes[KeyCodes[\"numPad3\"] = 99] = \"numPad3\";\n KeyCodes[KeyCodes[\"numPad4\"] = 100] = \"numPad4\";\n KeyCodes[KeyCodes[\"numPad5\"] = 101] = \"numPad5\";\n KeyCodes[KeyCodes[\"numPad6\"] = 102] = \"numPad6\";\n KeyCodes[KeyCodes[\"numPad7\"] = 103] = \"numPad7\";\n KeyCodes[KeyCodes[\"numPad8\"] = 104] = \"numPad8\";\n KeyCodes[KeyCodes[\"numPad9\"] = 105] = \"numPad9\";\n KeyCodes[KeyCodes[\"numPadDivide\"] = 111] = \"numPadDivide\";\n KeyCodes[KeyCodes[\"numPadDot\"] = 110] = \"numPadDot\";\n KeyCodes[KeyCodes[\"numPadMinus\"] = 109] = \"numPadMinus\";\n KeyCodes[KeyCodes[\"numPadMultiply\"] = 106] = \"numPadMultiply\";\n KeyCodes[KeyCodes[\"numPadPlus\"] = 107] = \"numPadPlus\";\n KeyCodes[KeyCodes[\"openBracket\"] = 219] = \"openBracket\";\n KeyCodes[KeyCodes[\"pageDown\"] = 34] = \"pageDown\";\n KeyCodes[KeyCodes[\"pageUp\"] = 33] = \"pageUp\";\n KeyCodes[KeyCodes[\"period\"] = 190] = \"period\";\n KeyCodes[KeyCodes[\"print\"] = 44] = \"print\";\n KeyCodes[KeyCodes[\"quote\"] = 222] = \"quote\";\n KeyCodes[KeyCodes[\"scrollLock\"] = 145] = \"scrollLock\";\n KeyCodes[KeyCodes[\"shift\"] = 16] = \"shift\";\n KeyCodes[KeyCodes[\"space\"] = 32] = \"space\";\n KeyCodes[KeyCodes[\"tab\"] = 9] = \"tab\";\n KeyCodes[KeyCodes[\"tilde\"] = 192] = \"tilde\";\n KeyCodes[KeyCodes[\"windowsLeft\"] = 91] = \"windowsLeft\";\n KeyCodes[KeyCodes[\"windowsOpera\"] = 219] = \"windowsOpera\";\n KeyCodes[KeyCodes[\"windowsRight\"] = 92] = \"windowsRight\";\n})(KeyCodes || (KeyCodes = {}));\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeAlt = 18;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeArrowDown = 40;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeArrowLeft = 37;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeArrowRight = 39;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeArrowUp = 38;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeBack = 8;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeBackSlash = 220;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeBreak = 19;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeCapsLock = 20;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeCloseBracket = 221;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeColon = 186;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeColon2 = 59; // Opera and Firefox\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeComma = 188;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeCtrl = 17;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeDelete = 46;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeEnd = 35;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeEnter = 13;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeEquals = 187;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeEquals2 = 61; // Opera\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeEquals3 = 107; // Firefox\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeEscape = 27;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeForwardSlash = 191;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction1 = 112;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction10 = 121;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction11 = 122;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction12 = 123;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction2 = 113;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction3 = 114;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction4 = 115;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction5 = 116;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction6 = 117;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction7 = 118;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction8 = 119;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeFunction9 = 120;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeHome = 36;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeInsert = 45;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeMenu = 93;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeMinus = 189;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeMinus2 = 109; // Opera and Firefox\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumLock = 144;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad0 = 96;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad1 = 97;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad2 = 98;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad3 = 99;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad4 = 100;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad5 = 101;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad6 = 102;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad7 = 103;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad8 = 104;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPad9 = 105;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPadDivide = 111;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPadDot = 110;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPadMinus = 109;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPadMultiply = 106;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeNumPadPlus = 107;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeOpenBracket = 219;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodePageDown = 34;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodePageUp = 33;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodePeriod = 190;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodePrint = 44;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeQuote = 222;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeScrollLock = 145;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeShift = 16;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeSpace = 32;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeTab = 9;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeTilde = 192;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeWindowsLeft = 91;\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeWindowsOpera = 219; // Opera\n/**\n * @deprecated - KeyCodes are deprecated, use string key exports\n */\nexport const keyCodeWindowsRight = 92;\n/**\n * String values for use with KeyboardEvent.key\n */\nexport const keyArrowDown = \"ArrowDown\";\nexport const keyArrowLeft = \"ArrowLeft\";\nexport const keyArrowRight = \"ArrowRight\";\nexport const keyArrowUp = \"ArrowUp\";\nexport const keyEnter = \"Enter\";\nexport const keyEscape = \"Escape\";\nexport const keyHome = \"Home\";\nexport const keyEnd = \"End\";\nexport const keyFunction2 = \"F2\";\nexport const keyPageDown = \"PageDown\";\nexport const keyPageUp = \"PageUp\";\nexport const keySpace = \" \";\nexport const keyTab = \"Tab\";\nexport const keyBackspace = \"Backspace\";\nexport const keyDelete = \"Delete\";\nexport const ArrowKeys = {\n ArrowDown: keyArrowDown,\n ArrowLeft: keyArrowLeft,\n ArrowRight: keyArrowRight,\n ArrowUp: keyArrowUp,\n};\n","/**\n * This method keeps a given value within the bounds of a min and max value. If the value\n * is larger than the max, the minimum value will be returned. If the value is smaller than the minimum,\n * the maximum will be returned. Otherwise, the value is returned un-changed.\n */\nexport function wrapInBounds(min, max, value) {\n if (value < min) {\n return max;\n }\n else if (value > max) {\n return min;\n }\n return value;\n}\n/**\n * Ensures that a value is between a min and max value. If value is lower than min, min will be returned.\n * If value is greater than max, max will be returned.\n */\nexport function limit(min, max, value) {\n return Math.min(Math.max(value, min), max);\n}\n/**\n * Determines if a number value is within a specified range.\n *\n * @param value - the value to check\n * @param min - the range start\n * @param max - the range end\n */\nexport function inRange(value, min, max = 0) {\n [min, max] = [min, max].sort((a, b) => a - b);\n return min <= value && value < max;\n}\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { keyArrowDown, keyArrowUp, keyEnd, keyHome, wrapInBounds, } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { AccordionItem } from \"../accordion-item/accordion-item.js\";\n/**\n * Expand mode for {@link Accordion}\n * @public\n */\nexport const AccordionExpandMode = {\n /**\n * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time.\n */\n single: \"single\",\n /**\n * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously.\n */\n multi: \"multi\",\n};\n/**\n * An Accordion Custom HTML Element\n * Implements {@link https://www.w3.org/TR/wai-aria-practices-1.1/#accordion | ARIA Accordion}.\n *\n * @fires change - Fires a custom 'change' event when the active item changes\n * @csspart item - The slot for the accordion items\n * @public\n *\n * @remarks\n * Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate} and {@link @microsoft/fast-foundation#(AccordionItem:class)}.\n */\nexport class Accordion extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Controls the expand mode of the Accordion, either allowing\n * single or multiple item expansion.\n * @public\n *\n * @remarks\n * HTML attribute: expand-mode\n */\n this.expandmode = AccordionExpandMode.multi;\n this.activeItemIndex = 0;\n this.change = () => {\n this.$emit(\"change\", this.activeid);\n };\n this.setItems = () => {\n var _a;\n if (this.accordionItems.length === 0) {\n return;\n }\n this.accordionIds = this.getItemIds();\n this.accordionItems.forEach((item, index) => {\n if (item instanceof AccordionItem) {\n item.addEventListener(\"change\", this.activeItemChange);\n if (this.isSingleExpandMode()) {\n this.activeItemIndex !== index\n ? (item.expanded = false)\n : (item.expanded = true);\n }\n }\n const itemId = this.accordionIds[index];\n item.setAttribute(\"id\", typeof itemId !== \"string\" ? `accordion-${index + 1}` : itemId);\n this.activeid = this.accordionIds[this.activeItemIndex];\n item.addEventListener(\"keydown\", this.handleItemKeyDown);\n item.addEventListener(\"focus\", this.handleItemFocus);\n });\n if (this.isSingleExpandMode()) {\n const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0];\n expandedItem.setAttribute(\"aria-disabled\", \"true\");\n }\n };\n this.removeItemListeners = (oldValue) => {\n oldValue.forEach((item, index) => {\n item.removeEventListener(\"change\", this.activeItemChange);\n item.removeEventListener(\"keydown\", this.handleItemKeyDown);\n item.removeEventListener(\"focus\", this.handleItemFocus);\n });\n };\n this.activeItemChange = (event) => {\n if (event.defaultPrevented || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n const selectedItem = event.target;\n this.activeid = selectedItem.getAttribute(\"id\");\n if (this.isSingleExpandMode()) {\n this.resetItems();\n selectedItem.expanded = true;\n selectedItem.setAttribute(\"aria-disabled\", \"true\");\n this.accordionItems.forEach((item) => {\n if (!item.hasAttribute(\"disabled\") && item.id !== this.activeid) {\n item.removeAttribute(\"aria-disabled\");\n }\n });\n }\n this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem);\n this.change();\n };\n this.handleItemKeyDown = (event) => {\n // only handle the keydown if the event target is the accordion item\n // prevents arrow keys from moving focus to accordion headers when focus is on accordion item panel content\n if (event.target !== event.currentTarget) {\n return;\n }\n this.accordionIds = this.getItemIds();\n switch (event.key) {\n case keyArrowUp:\n event.preventDefault();\n this.adjust(-1);\n break;\n case keyArrowDown:\n event.preventDefault();\n this.adjust(1);\n break;\n case keyHome:\n this.activeItemIndex = 0;\n this.focusItem();\n break;\n case keyEnd:\n this.activeItemIndex = this.accordionItems.length - 1;\n this.focusItem();\n break;\n }\n };\n this.handleItemFocus = (event) => {\n // update the active item index if the focus moves to an accordion item via a different method other than the up and down arrow key actions\n // only do so if the focus is actually on the accordion item and not on any of its children\n if (event.target === event.currentTarget) {\n const focusedItem = event.target;\n const focusedIndex = (this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem));\n if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) {\n this.activeItemIndex = focusedIndex;\n this.activeid = this.accordionIds[this.activeItemIndex];\n }\n }\n };\n }\n /**\n * @internal\n */\n accordionItemsChanged(oldValue, newValue) {\n if (this.$fastController.isConnected) {\n this.removeItemListeners(oldValue);\n this.setItems();\n }\n }\n findExpandedItem() {\n for (let item = 0; item < this.accordionItems.length; item++) {\n if (this.accordionItems[item].getAttribute(\"expanded\") === \"true\") {\n return this.accordionItems[item];\n }\n }\n return null;\n }\n resetItems() {\n this.accordionItems.forEach((item, index) => {\n item.expanded = false;\n });\n }\n getItemIds() {\n return this.accordionItems.map((accordionItem) => {\n return accordionItem.getAttribute(\"id\");\n });\n }\n isSingleExpandMode() {\n return this.expandmode === AccordionExpandMode.single;\n }\n adjust(adjustment) {\n this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment);\n this.focusItem();\n }\n focusItem() {\n const element = this.accordionItems[this.activeItemIndex];\n if (element instanceof AccordionItem) {\n element.expandbutton.focus();\n }\n }\n}\n__decorate([\n attr({ attribute: \"expand-mode\" })\n], Accordion.prototype, \"expandmode\", void 0);\n__decorate([\n observable\n], Accordion.prototype, \"accordionItems\", void 0);\n","import { html, ref, slotted } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Anchor:class)} component.\n * @public\n */\nexport const anchorTemplate = (context, definition) => html `\n <a\n class=\"control\"\n part=\"control\"\n download=\"${x => x.download}\"\n href=\"${x => x.href}\"\n hreflang=\"${x => x.hreflang}\"\n ping=\"${x => x.ping}\"\n referrerpolicy=\"${x => x.referrerpolicy}\"\n rel=\"${x => x.rel}\"\n target=\"${x => x.target}\"\n type=\"${x => x.type}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref(\"control\")}\n >\n ${startSlotTemplate(context, definition)}\n <span class=\"content\" part=\"content\">\n <slot ${slotted(\"defaultSlottedContent\")}></slot>\n </span>\n ${endSlotTemplate(context, definition)}\n </a>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr } from \"@microsoft/fast-element\";\n/**\n * Some states and properties are applicable to all host language elements regardless of whether a role is applied.\n * The following global states and properties are supported by all roles and by all base markup elements.\n * {@link https://www.w3.org/TR/wai-aria-1.1/#global_states}\n *\n * This is intended to be used as a mixin. Be sure you extend FASTElement.\n *\n * @public\n */\nexport class ARIAGlobalStatesAndProperties {\n}\n__decorate([\n attr({ attribute: \"aria-atomic\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaAtomic\", void 0);\n__decorate([\n attr({ attribute: \"aria-busy\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaBusy\", void 0);\n__decorate([\n attr({ attribute: \"aria-controls\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaControls\", void 0);\n__decorate([\n attr({ attribute: \"aria-current\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaCurrent\", void 0);\n__decorate([\n attr({ attribute: \"aria-describedby\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaDescribedby\", void 0);\n__decorate([\n attr({ attribute: \"aria-details\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaDetails\", void 0);\n__decorate([\n attr({ attribute: \"aria-disabled\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaDisabled\", void 0);\n__decorate([\n attr({ attribute: \"aria-errormessage\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaErrormessage\", void 0);\n__decorate([\n attr({ attribute: \"aria-flowto\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaFlowto\", void 0);\n__decorate([\n attr({ attribute: \"aria-haspopup\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaHaspopup\", void 0);\n__decorate([\n attr({ attribute: \"aria-hidden\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaHidden\", void 0);\n__decorate([\n attr({ attribute: \"aria-invalid\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaInvalid\", void 0);\n__decorate([\n attr({ attribute: \"aria-keyshortcuts\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaKeyshortcuts\", void 0);\n__decorate([\n attr({ attribute: \"aria-label\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaLabel\", void 0);\n__decorate([\n attr({ attribute: \"aria-labelledby\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaLabelledby\", void 0);\n__decorate([\n attr({ attribute: \"aria-live\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaLive\", void 0);\n__decorate([\n attr({ attribute: \"aria-owns\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaOwns\", void 0);\n__decorate([\n attr({ attribute: \"aria-relevant\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaRelevant\", void 0);\n__decorate([\n attr({ attribute: \"aria-roledescription\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaRoledescription\", void 0);\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\nimport { ARIAGlobalStatesAndProperties, StartEnd, } from \"../patterns/index.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\n/**\n * An Anchor Custom HTML Element.\n * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.\n *\n * @slot start - Content which can be provided before the anchor content\n * @slot end - Content which can be provided after the anchor content\n * @slot - The default slot for anchor content\n * @csspart control - The anchor element\n * @csspart content - The element wrapping anchor content\n *\n * @public\n */\nexport class Anchor extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Overrides the focus call for where delegatesFocus is unsupported.\n * This check works for Chrome, Edge Chromium, FireFox, and Safari\n * Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858\n */\n this.handleUnsupportedDelegatesFocus = () => {\n var _a;\n // Check to see if delegatesFocus is supported\n if (window.ShadowRoot &&\n !window.ShadowRoot.prototype.hasOwnProperty(\"delegatesFocus\") &&\n ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {\n this.focus = () => {\n this.control.focus();\n };\n }\n };\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.handleUnsupportedDelegatesFocus();\n }\n}\n__decorate([\n attr\n], Anchor.prototype, \"download\", void 0);\n__decorate([\n attr\n], Anchor.prototype, \"href\", void 0);\n__decorate([\n attr\n], Anchor.prototype, \"hreflang\", void 0);\n__decorate([\n attr\n], Anchor.prototype, \"ping\", void 0);\n__decorate([\n attr\n], Anchor.prototype, \"referrerpolicy\", void 0);\n__decorate([\n attr\n], Anchor.prototype, \"rel\", void 0);\n__decorate([\n attr\n], Anchor.prototype, \"target\", void 0);\n__decorate([\n attr\n], Anchor.prototype, \"type\", void 0);\n__decorate([\n observable\n], Anchor.prototype, \"defaultSlottedContent\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA link role\n *\n * @public\n */\nexport class DelegatesARIALink {\n}\n__decorate([\n attr({ attribute: \"aria-expanded\" })\n], DelegatesARIALink.prototype, \"ariaExpanded\", void 0);\napplyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties);\napplyMixins(Anchor, StartEnd, DelegatesARIALink);\n","import { html, when } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(AnchoredRegion:class)} component.\n * @public\n */\nexport const anchoredRegionTemplate = (context, definition) => html `\n <template class=\"${x => (x.initialLayoutComplete ? \"loaded\" : \"\")}\">\n ${when(x => x.initialLayoutComplete, html `\n <slot></slot>\n `)}\n </template>\n`;\n","/**\n * Expose ltr and rtl strings\n */\nexport var Direction;\n(function (Direction) {\n Direction[\"ltr\"] = \"ltr\";\n Direction[\"rtl\"] = \"rtl\";\n})(Direction || (Direction = {}));\n","/**\n * This set of exported strings reference https://developer.mozilla.org/en-US/docs/Web/Events\n * and should include all non-deprecated and non-experimental Standard events\n */\nexport const eventAbort = \"abort\";\nexport const eventAfterPrint = \"afterprint\";\nexport const eventAnimationCancel = \"animationcancel\";\nexport const eventAnimationEnd = \"animationend\";\nexport const eventAnimationIteration = \"animationiteration\";\nexport const eventAnimationStart = \"animationstart\";\nexport const eventAppInstalled = \"appinstalled\";\nexport const eventBeforePrint = \"beforeprint\";\nexport const eventBeforeUnload = \"beforeunload\";\nexport const eventBeginEvent = \"beginEvent\";\nexport const eventBlocked = \"blocked\";\nexport const eventBlur = \"blur\";\nexport const eventCanPlay = \"canplay\";\nexport const eventCanPlayThrough = \"canplaythrough\";\nexport const eventChange = \"change\";\nexport const eventChargingChange = \"chargingchange\";\nexport const eventChargingTimeChange = \"chargingtimechange\";\nexport const eventClick = \"click\";\nexport const eventClose = \"close\";\nexport const eventComplete = \"complete\";\nexport const eventCompositionEnd = \"compositionend\";\nexport const eventCompositionStart = \"compositionstart\";\nexport const eventCompositionUpdate = \"compositionupdate\";\nexport const eventContextMenu = \"contextmenu\";\nexport const eventCopy = \"copy\";\nexport const eventCut = \"cut\";\nexport const eventDblClick = \"dblclick\";\nexport const eventDeviceChange = \"devicechange\";\nexport const eventDeviceMotion = \"devicemotion\";\nexport const eventDeviceOrientation = \"deviceorientation\";\nexport const eventDischargingTimeChange = \"dischargingtimechange\";\nexport const eventDrag = \"drag\";\nexport const eventDragEnd = \"dragend\";\nexport const eventDragEnter = \"dragenter\";\nexport const eventDragLeave = \"dragleave\";\nexport const eventDragOver = \"dragover\";\nexport const eventDragStart = \"dragstart\";\nexport const eventDrop = \"drop\";\nexport const eventDurationChange = \"durationchange\";\nexport const eventEmptied = \"emptied\";\nexport const eventEnded = \"ended\";\nexport const eventEndEvent = \"endevent\";\nexport const eventError = \"error\";\nexport const eventFocus = \"focus\";\nexport const eventFocusIn = \"focusin\";\nexport const eventFocusOut = \"focusout\";\nexport const eventFullScreenChange = \"fullscreenchange\";\nexport const eventFullScreenError = \"fullscreenerror\";\nexport const eventGamePadConnected = \"gamepadconnected\";\nexport const eventGamePadDisconnected = \"gamepaddisconnected\";\nexport const eventGotPointerCapture = \"gotpointercapture\";\nexport const eventHashChange = \"hashchange\";\nexport const eventLostPointerCapture = \"lostpointercapture\";\nexport const eventInput = \"input\";\nexport const eventInvalid = \"invalid\";\nexport const eventKeyDown = \"keydown\";\nexport const eventKeyUp = \"keyup\";\nexport const eventLevelChange = \"levelchange\";\nexport const eventLoad = \"load\";\nexport const eventLoadedData = \"loadeddata\";\nexport const eventLoadedMetaData = \"loadedmetadata\";\nexport const eventLoadEnd = \"loadend\";\nexport const eventLoadStart = \"loadstart\";\nexport const eventMessage = \"message\";\nexport const eventMessageError = \"messageerror\";\nexport const eventMouseDown = \"mousedown\";\nexport const eventMouseEnter = \"mouseenter\";\nexport const eventMouseLeave = \"mouseleave\";\nexport const eventMouseMove = \"mousemove\";\nexport const eventMouseOut = \"mouseout\";\nexport const eventMouseOver = \"mouseover\";\nexport const eventMouseUp = \"mouseup\";\nexport const eventNotificationClick = \"notificationclick\";\nexport const eventOffline = \"offline\";\nexport const eventOnline = \"online\";\nexport const eventOpen = \"open\";\nexport const eventOrientationChange = \"orientationchange\";\nexport const eventPageHide = \"pagehide\";\nexport const eventPageShow = \"pageshow\";\nexport const eventPaste = \"paste\";\nexport const eventPause = \"pause\";\nexport const eventPointerCancel = \"pointercancel\";\nexport const eventPointerDown = \"pointerdown\";\nexport const eventPointerEnter = \"pointerenter\";\nexport const eventPointerLeave = \"pointerleave\";\nexport const eventPointerLockChange = \"pointerlockchange\";\nexport const eventPointerLockError = \"pointerlockerror\";\nexport const eventPointerMove = \"pointermove\";\nexport const eventPointerOut = \"pointerout\";\nexport const eventPointerOver = \"pointerover\";\nexport const eventPointerUp = \"pointerup\";\nexport const eventPlay = \"play\";\nexport const eventPlaying = \"playing\";\nexport const eventPopState = \"popstate\";\nexport const eventProgress = \"progress\";\nexport const eventPush = \"push\";\nexport const eventPushSubscriptionChange = \"pushsubscriptionchange\";\nexport const eventRateChange = \"ratechange\";\nexport const eventReadyStateChange = \"readystatechange\";\nexport const eventRepeatEvent = \"repeatevent\";\nexport const eventReset = \"reset\";\nexport const eventResize = \"resize\";\nexport const eventResourceTimingBufferFull = \"resourcetimingbufferfull\";\nexport const eventScroll = \"scroll\";\nexport const eventSeeked = \"seeked\";\nexport const eventSeeking = \"seeking\";\nexport const eventSelect = \"select\";\nexport const eventShow = \"show\";\nexport const eventSlotChange = \"slotchange\";\nexport const eventStalled = \"stalled\";\nexport const eventStart = \"start\";\nexport const eventStorage = \"storage\";\nexport const eventSubmit = \"submit\";\nexport const eventSuccess = \"success\";\nexport const eventSuspend = \"suspend\";\nexport const eventSVGAbort = \"SVGAbort\";\nexport const eventSVGError = \"SVGError\";\nexport const eventSVGLoad = \"SVGLoad\";\nexport const eventSVGResize = \"SVGResize\";\nexport const eventSVGScroll = \"SVGScroll\";\nexport const eventSVGUnload = \"SVGUnload\";\nexport const eventSVGZoom = \"SVGZoom\";\nexport const eventTimeOut = \"timeout\";\nexport const eventTimeUpdate = \"timeupdate\";\nexport const eventTouchCancel = \"touchcancel\";\nexport const eventTouchEnd = \"touchend\";\nexport const eventTouchMove = \"touchmove\";\nexport const eventTouchStart = \"touchstart\";\nexport const eventTransitionEnd = \"transitionend\";\nexport const eventUnload = \"unload\";\nexport const eventUpgradeNeeded = \"upgradeneeded\";\nexport const eventUserProximity = \"userproximity\";\nexport const eventVersionChange = \"versionchange\";\nexport const eventVisibilityChange = \"visibilitychange\";\nexport const eventVolumeChange = \"volumechange\";\nexport const eventWaiting = \"waiting\";\nexport const eventWheel = \"wheel\";\n","import { Direction } from \"@microsoft/fast-web-utilities\";\n/**\n * a method to determine the current localization direction of the view\n * @param rootNode - the HTMLElement to begin the query from, usually \"this\" when used in a component controller\n * @public\n */\nexport const getDirection = (rootNode) => {\n const dirNode = rootNode.closest(\"[dir]\");\n return dirNode !== null && dirNode.dir === \"rtl\" ? Direction.rtl : Direction.ltr;\n};\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, observable } from \"@microsoft/fast-element\";\nimport { Direction, eventResize, eventScroll } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { getDirection } from \"../utilities/direction.js\";\nimport { IntersectionService } from \"../utilities/intersection-service.js\";\n/**\n * An anchored region Custom HTML Element.\n *\n * @slot - The default slot for the content\n * @fires loaded - Fires a custom 'loaded' event when the region is loaded and visible\n * @fires positionchange - Fires a custom 'positionchange' event when the position has changed\n *\n * @public\n */\nexport class AnchoredRegion extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The HTML ID of the anchor element this region is positioned relative to\n *\n * @public\n * @remarks\n * HTML Attribute: anchor\n */\n this.anchor = \"\";\n /**\n * The HTML ID of the viewport element this region is positioned relative to\n *\n * @public\n * @remarks\n * HTML Attribute: anchor\n */\n this.viewport = \"\";\n /**\n * Sets what logic the component uses to determine horizontal placement.\n * 'locktodefault' forces the default position\n * 'dynamic' decides placement based on available space\n * 'uncontrolled' does not control placement on the horizontal axis\n *\n * @public\n * @remarks\n * HTML Attribute: horizontal-positioning-mode\n */\n this.horizontalPositioningMode = \"uncontrolled\";\n /**\n * The default horizontal position of the region relative to the anchor element\n *\n * @public\n * @remarks\n * HTML Attribute: horizontal-default-position\n */\n this.horizontalDefaultPosition = \"unset\";\n /**\n * Whether the region remains in the viewport (ie. detaches from the anchor) on the horizontal axis\n *\n * @public\n * @remarks\n * HTML Attribute: horizontal-viewport-lock\n */\n this.horizontalViewportLock = false;\n /**\n * Whether the region overlaps the anchor on the horizontal axis\n *\n * @public\n * @remarks\n * HTML Attribute: horizontal-inset\n */\n this.horizontalInset = false;\n /**\n * Defines how the width of the region is calculated\n *\n * @public\n * @remarks\n * HTML Attribute: horizontal-scaling\n */\n this.horizontalScaling = \"content\";\n /**\n * Sets what logic the component uses to determine vertical placement.\n * 'locktodefault' forces the default position\n * 'dynamic' decides placement based on available space\n * 'uncontrolled' does not control placement on the vertical axis\n *\n * @public\n * @remarks\n * HTML Attribute: vertical-positioning-mode\n */\n this.verticalPositioningMode = \"uncontrolled\";\n /**\n * The default vertical position of the region relative to the anchor element\n *\n * @public\n * @remarks\n * HTML Attribute: vertical-default-position\n */\n this.verticalDefaultPosition = \"unset\";\n /**\n * Whether the region remains in the viewport (ie. detaches from the anchor) on the vertical axis\n *\n * @public\n * @remarks\n * HTML Attribute: vertical-viewport-lock\n */\n this.verticalViewportLock = false;\n /**\n * Whether the region overlaps the anchor on the vertical axis\n *\n * @public\n * @remarks\n * HTML Attribute: vertical-inset\n */\n this.verticalInset = false;\n /**\n * Defines how the height of the region is calculated\n *\n * @public\n * @remarks\n * HTML Attribute: vertical-scaling\n */\n this.verticalScaling = \"content\";\n /**\n * Whether the region is positioned using css \"position: fixed\".\n * Otherwise the region uses \"position: absolute\".\n * Fixed placement allows the region to break out of parent containers,\n *\n * @public\n * @remarks\n * HTML Attribute: fixed-placement\n */\n this.fixedPlacement = false;\n /**\n * Defines what triggers the anchored region to revaluate positioning\n *\n * @public\n * @remarks\n * HTML Attribute: auto-update-mode\n */\n this.autoUpdateMode = \"anchor\";\n /**\n * The HTML element being used as the anchor\n *\n * @public\n */\n this.anchorElement = null;\n /**\n * The HTML element being used as the viewport\n *\n * @public\n */\n this.viewportElement = null;\n /**\n * indicates that an initial positioning pass on layout has completed\n *\n * @internal\n */\n this.initialLayoutComplete = false;\n this.resizeDetector = null;\n /**\n * base offsets between the positioner's base position and the anchor's\n */\n this.baseHorizontalOffset = 0;\n this.baseVerticalOffset = 0;\n this.pendingPositioningUpdate = false;\n this.pendingReset = false;\n this.currentDirection = Direction.ltr;\n this.regionVisible = false;\n // indicates that a layout update should occur even if geometry has not changed\n // used to ensure some attribute changes are applied\n this.forceUpdate = false;\n // defines how big a difference in pixels there must be between states to\n // justify a layout update that affects the dom (prevents repeated sub-pixel corrections)\n this.updateThreshold = 0.5;\n /**\n * update position\n */\n this.update = () => {\n if (!this.pendingPositioningUpdate) {\n this.requestPositionUpdates();\n }\n };\n /**\n * starts observers\n */\n this.startObservers = () => {\n this.stopObservers();\n if (this.anchorElement === null) {\n return;\n }\n this.requestPositionUpdates();\n if (this.resizeDetector !== null) {\n this.resizeDetector.observe(this.anchorElement);\n this.resizeDetector.observe(this);\n }\n };\n /**\n * get position updates\n */\n this.requestPositionUpdates = () => {\n if (this.anchorElement === null || this.pendingPositioningUpdate) {\n return;\n }\n AnchoredRegion.intersectionService.requestPosition(this, this.handleIntersection);\n AnchoredRegion.intersectionService.requestPosition(this.anchorElement, this.handleIntersection);\n if (this.viewportElement !== null) {\n AnchoredRegion.intersectionService.requestPosition(this.viewportElement, this.handleIntersection);\n }\n this.pendingPositioningUpdate = true;\n };\n /**\n * stops observers\n */\n this.stopObservers = () => {\n if (this.pendingPositioningUpdate) {\n this.pendingPositioningUpdate = false;\n AnchoredRegion.intersectionService.cancelRequestPosition(this, this.handleIntersection);\n if (this.anchorElement !== null) {\n AnchoredRegion.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection);\n }\n if (this.viewportElement !== null) {\n AnchoredRegion.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection);\n }\n }\n if (this.resizeDetector !== null) {\n this.resizeDetector.disconnect();\n }\n };\n /**\n * Gets the viewport element by id, or defaults to document root\n */\n this.getViewport = () => {\n if (typeof this.viewport !== \"string\" || this.viewport === \"\") {\n return document.documentElement;\n }\n return document.getElementById(this.viewport);\n };\n /**\n * Gets the anchor element by id\n */\n this.getAnchor = () => {\n return document.getElementById(this.anchor);\n };\n /**\n * Handle intersections\n */\n this.handleIntersection = (entries) => {\n if (!this.pendingPositioningUpdate) {\n return;\n }\n this.pendingPositioningUpdate = false;\n if (!this.applyIntersectionEntries(entries)) {\n return;\n }\n this.updateLayout();\n };\n /**\n * iterate through intersection entries and apply data\n */\n this.applyIntersectionEntries = (entries) => {\n const regionEntry = entries.find(x => x.target === this);\n const anchorEntry = entries.find(x => x.target === this.anchorElement);\n const viewportEntry = entries.find(x => x.target === this.viewportElement);\n if (regionEntry === undefined ||\n viewportEntry === undefined ||\n anchorEntry === undefined) {\n return false;\n }\n // don't update the dom unless there is a significant difference in rect positions\n if (!this.regionVisible ||\n this.forceUpdate ||\n this.regionRect === undefined ||\n this.anchorRect === undefined ||\n this.viewportRect === undefined ||\n this.isRectDifferent(this.anchorRect, anchorEntry.boundingClientRect) ||\n this.isRectDifferent(this.viewportRect, viewportEntry.boundingClientRect) ||\n this.isRectDifferent(this.regionRect, regionEntry.boundingClientRect)) {\n this.regionRect = regionEntry.boundingClientRect;\n this.anchorRect = anchorEntry.boundingClientRect;\n if (this.viewportElement === document.documentElement) {\n this.viewportRect = new DOMRectReadOnly(viewportEntry.boundingClientRect.x +\n document.documentElement.scrollLeft, viewportEntry.boundingClientRect.y +\n document.documentElement.scrollTop, viewportEntry.boundingClientRect.width, viewportEntry.boundingClientRect.height);\n }\n else {\n this.viewportRect = viewportEntry.boundingClientRect;\n }\n this.updateRegionOffset();\n this.forceUpdate = false;\n return true;\n }\n return false;\n };\n /**\n * Update the offset values\n */\n this.updateRegionOffset = () => {\n if (this.anchorRect && this.regionRect) {\n this.baseHorizontalOffset =\n this.baseHorizontalOffset +\n (this.anchorRect.left - this.regionRect.left) +\n (this.translateX - this.baseHorizontalOffset);\n this.baseVerticalOffset =\n this.baseVerticalOffset +\n (this.anchorRect.top - this.regionRect.top) +\n (this.translateY - this.baseVerticalOffset);\n }\n };\n /**\n * compare rects to see if there is enough change to justify a DOM update\n */\n this.isRectDifferent = (rectA, rectB) => {\n if (Math.abs(rectA.top - rectB.top) > this.updateThreshold ||\n Math.abs(rectA.right - rectB.right) > this.updateThreshold ||\n Math.abs(rectA.bottom - rectB.bottom) > this.updateThreshold ||\n Math.abs(rectA.left - rectB.left) > this.updateThreshold) {\n return true;\n }\n return false;\n };\n /**\n * Handle resize events\n */\n this.handleResize = (entries) => {\n this.update();\n };\n /**\n * resets the component\n */\n this.reset = () => {\n if (!this.pendingReset) {\n return;\n }\n this.pendingReset = false;\n if (this.anchorElement === null) {\n this.anchorElement = this.getAnchor();\n }\n if (this.viewportElement === null) {\n this.viewportElement = this.getViewport();\n }\n this.currentDirection = getDirection(this);\n this.startObservers();\n };\n /**\n * Recalculate layout related state values\n */\n this.updateLayout = () => {\n let desiredVerticalPosition = undefined;\n let desiredHorizontalPosition = undefined;\n if (this.horizontalPositioningMode !== \"uncontrolled\") {\n const horizontalOptions = this.getPositioningOptions(this.horizontalInset);\n if (this.horizontalDefaultPosition === \"center\") {\n desiredHorizontalPosition = \"center\";\n }\n else if (this.horizontalDefaultPosition !== \"unset\") {\n let dirCorrectedHorizontalDefaultPosition = this\n .horizontalDefaultPosition;\n if (dirCorrectedHorizontalDefaultPosition === \"start\" ||\n dirCorrectedHorizontalDefaultPosition === \"end\") {\n // if direction changes we reset the layout\n const newDirection = getDirection(this);\n if (newDirection !== this.currentDirection) {\n this.currentDirection = newDirection;\n this.initialize();\n return;\n }\n if (this.currentDirection === Direction.ltr) {\n dirCorrectedHorizontalDefaultPosition =\n dirCorrectedHorizontalDefaultPosition === \"start\"\n ? \"left\"\n : \"right\";\n }\n else {\n dirCorrectedHorizontalDefaultPosition =\n dirCorrectedHorizontalDefaultPosition === \"start\"\n ? \"right\"\n : \"left\";\n }\n }\n switch (dirCorrectedHorizontalDefaultPosition) {\n case \"left\":\n desiredHorizontalPosition = this.horizontalInset\n ? \"insetStart\"\n : \"start\";\n break;\n case \"right\":\n desiredHorizontalPosition = this.horizontalInset\n ? \"insetEnd\"\n : \"end\";\n break;\n }\n }\n const horizontalThreshold = this.horizontalThreshold !== undefined\n ? this.horizontalThreshold\n : this.regionRect !== undefined\n ? this.regionRect.width\n : 0;\n const anchorLeft = this.anchorRect !== undefined ? this.anchorRect.left : 0;\n const anchorRight = this.anchorRect !== undefined ? this.anchorRect.right : 0;\n const anchorWidth = this.anchorRect !== undefined ? this.anchorRect.width : 0;\n const viewportLeft = this.viewportRect !== undefined ? this.viewportRect.left : 0;\n const viewportRight = this.viewportRect !== undefined ? this.viewportRect.right : 0;\n if (desiredHorizontalPosition === undefined ||\n (!(this.horizontalPositioningMode === \"locktodefault\") &&\n this.getAvailableSpace(desiredHorizontalPosition, anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) < horizontalThreshold)) {\n desiredHorizontalPosition =\n this.getAvailableSpace(horizontalOptions[0], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) >\n this.getAvailableSpace(horizontalOptions[1], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight)\n ? horizontalOptions[0]\n : horizontalOptions[1];\n }\n }\n if (this.verticalPositioningMode !== \"uncontrolled\") {\n const verticalOptions = this.getPositioningOptions(this.verticalInset);\n if (this.verticalDefaultPosition === \"center\") {\n desiredVerticalPosition = \"center\";\n }\n else if (this.verticalDefaultPosition !== \"unset\") {\n switch (this.verticalDefaultPosition) {\n case \"top\":\n desiredVerticalPosition = this.verticalInset\n ? \"insetStart\"\n : \"start\";\n break;\n case \"bottom\":\n desiredVerticalPosition = this.verticalInset ? \"insetEnd\" : \"end\";\n break;\n }\n }\n const verticalThreshold = this.verticalThreshold !== undefined\n ? this.verticalThreshold\n : this.regionRect !== undefined\n ? this.regionRect.height\n : 0;\n const anchorTop = this.anchorRect !== undefined ? this.anchorRect.top : 0;\n const anchorBottom = this.anchorRect !== undefined ? this.anchorRect.bottom : 0;\n const anchorHeight = this.anchorRect !== undefined ? this.anchorRect.height : 0;\n const viewportTop = this.viewportRect !== undefined ? this.viewportRect.top : 0;\n const viewportBottom = this.viewportRect !== undefined ? this.viewportRect.bottom : 0;\n if (desiredVerticalPosition === undefined ||\n (!(this.verticalPositioningMode === \"locktodefault\") &&\n this.getAvailableSpace(desiredVerticalPosition, anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) < verticalThreshold)) {\n desiredVerticalPosition =\n this.getAvailableSpace(verticalOptions[0], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) >\n this.getAvailableSpace(verticalOptions[1], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom)\n ? verticalOptions[0]\n : verticalOptions[1];\n }\n }\n const nextPositionerDimension = this.getNextRegionDimension(desiredHorizontalPosition, desiredVerticalPosition);\n const positionChanged = this.horizontalPosition !== desiredHorizontalPosition ||\n this.verticalPosition !== desiredVerticalPosition;\n this.setHorizontalPosition(desiredHorizontalPosition, nextPositionerDimension);\n this.setVerticalPosition(desiredVerticalPosition, nextPositionerDimension);\n this.updateRegionStyle();\n if (!this.initialLayoutComplete) {\n this.initialLayoutComplete = true;\n this.requestPositionUpdates();\n return;\n }\n if (!this.regionVisible) {\n this.regionVisible = true;\n this.style.removeProperty(\"pointer-events\");\n this.style.removeProperty(\"opacity\");\n this.classList.toggle(\"loaded\", true);\n this.$emit(\"loaded\", this, { bubbles: false });\n }\n this.updatePositionClasses();\n if (positionChanged) {\n // emit change event\n this.$emit(\"positionchange\", this, { bubbles: false });\n }\n };\n /**\n * Updates the style string applied to the region element as well as the css classes attached\n * to the root element\n */\n this.updateRegionStyle = () => {\n this.style.width = this.regionWidth;\n this.style.height = this.regionHeight;\n this.style.transform = `translate(${this.translateX}px, ${this.translateY}px)`;\n };\n /**\n * Updates the css classes that reflect the current position of the element\n */\n this.updatePositionClasses = () => {\n this.classList.toggle(\"top\", this.verticalPosition === \"start\");\n this.classList.toggle(\"bottom\", this.verticalPosition === \"end\");\n this.classList.toggle(\"inset-top\", this.verticalPosition === \"insetStart\");\n this.classList.toggle(\"inset-bottom\", this.verticalPosition === \"insetEnd\");\n this.classList.toggle(\"vertical-center\", this.verticalPosition === \"center\");\n this.classList.toggle(\"left\", this.horizontalPosition === \"start\");\n this.classList.toggle(\"right\", this.horizontalPosition === \"end\");\n this.classList.toggle(\"inset-left\", this.horizontalPosition === \"insetStart\");\n this.classList.toggle(\"inset-right\", this.horizontalPosition === \"insetEnd\");\n this.classList.toggle(\"horizontal-center\", this.horizontalPosition === \"center\");\n };\n /**\n * Get horizontal positioning state based on desired position\n */\n this.setHorizontalPosition = (desiredHorizontalPosition, nextPositionerDimension) => {\n if (desiredHorizontalPosition === undefined ||\n this.regionRect === undefined ||\n this.anchorRect === undefined ||\n this.viewportRect === undefined) {\n return;\n }\n let nextRegionWidth = 0;\n switch (this.horizontalScaling) {\n case \"anchor\":\n case \"fill\":\n nextRegionWidth = this.horizontalViewportLock\n ? this.viewportRect.width\n : nextPositionerDimension.width;\n this.regionWidth = `${nextRegionWidth}px`;\n break;\n case \"content\":\n nextRegionWidth = this.regionRect.width;\n this.regionWidth = \"unset\";\n break;\n }\n let sizeDelta = 0;\n switch (desiredHorizontalPosition) {\n case \"start\":\n this.translateX = this.baseHorizontalOffset - nextRegionWidth;\n if (this.horizontalViewportLock &&\n this.anchorRect.left > this.viewportRect.right) {\n this.translateX =\n this.translateX -\n (this.anchorRect.left - this.viewportRect.right);\n }\n break;\n case \"insetStart\":\n this.translateX =\n this.baseHorizontalOffset - nextRegionWidth + this.anchorRect.width;\n if (this.horizontalViewportLock &&\n this.anchorRect.right > this.viewportRect.right) {\n this.translateX =\n this.translateX -\n (this.anchorRect.right - this.viewportRect.right);\n }\n break;\n case \"insetEnd\":\n this.translateX = this.baseHorizontalOffset;\n if (this.horizontalViewportLock &&\n this.anchorRect.left < this.viewportRect.left) {\n this.translateX =\n this.translateX - (this.anchorRect.left - this.viewportRect.left);\n }\n break;\n case \"end\":\n this.translateX = this.baseHorizontalOffset + this.anchorRect.width;\n if (this.horizontalViewportLock &&\n this.anchorRect.right < this.viewportRect.left) {\n this.translateX =\n this.translateX -\n (this.anchorRect.right - this.viewportRect.left);\n }\n break;\n case \"center\":\n sizeDelta = (this.anchorRect.width - nextRegionWidth) / 2;\n this.translateX = this.baseHorizontalOffset + sizeDelta;\n if (this.horizontalViewportLock) {\n const regionLeft = this.anchorRect.left + sizeDelta;\n const regionRight = this.anchorRect.right - sizeDelta;\n if (regionLeft < this.viewportRect.left &&\n !(regionRight > this.viewportRect.right)) {\n this.translateX =\n this.translateX - (regionLeft - this.viewportRect.left);\n }\n else if (regionRight > this.viewportRect.right &&\n !(regionLeft < this.viewportRect.left)) {\n this.translateX =\n this.translateX - (regionRight - this.viewportRect.right);\n }\n }\n break;\n }\n this.horizontalPosition = desiredHorizontalPosition;\n };\n /**\n * Set vertical positioning state based on desired position\n */\n this.setVerticalPosition = (desiredVerticalPosition, nextPositionerDimension) => {\n if (desiredVerticalPosition === undefined ||\n this.regionRect === undefined ||\n this.anchorRect === undefined ||\n this.viewportRect === undefined) {\n return;\n }\n let nextRegionHeight = 0;\n switch (this.verticalScaling) {\n case \"anchor\":\n case \"fill\":\n nextRegionHeight = this.verticalViewportLock\n ? this.viewportRect.height\n : nextPositionerDimension.height;\n this.regionHeight = `${nextRegionHeight}px`;\n break;\n case \"content\":\n nextRegionHeight = this.regionRect.height;\n this.regionHeight = \"unset\";\n break;\n }\n let sizeDelta = 0;\n switch (desiredVerticalPosition) {\n case \"start\":\n this.translateY = this.baseVerticalOffset - nextRegionHeight;\n if (this.verticalViewportLock &&\n this.anchorRect.top > this.viewportRect.bottom) {\n this.translateY =\n this.translateY -\n (this.anchorRect.top - this.viewportRect.bottom);\n }\n break;\n case \"insetStart\":\n this.translateY =\n this.baseVerticalOffset - nextRegionHeight + this.anchorRect.height;\n if (this.verticalViewportLock &&\n this.anchorRect.bottom > this.viewportRect.bottom) {\n this.translateY =\n this.translateY -\n (this.anchorRect.bottom - this.viewportRect.bottom);\n }\n break;\n case \"insetEnd\":\n this.translateY = this.baseVerticalOffset;\n if (this.verticalViewportLock &&\n this.anchorRect.top < this.viewportRect.top) {\n this.translateY =\n this.translateY - (this.anchorRect.top - this.viewportRect.top);\n }\n break;\n case \"end\":\n this.translateY = this.baseVerticalOffset + this.anchorRect.height;\n if (this.verticalViewportLock &&\n this.anchorRect.bottom < this.viewportRect.top) {\n this.translateY =\n this.translateY -\n (this.anchorRect.bottom - this.viewportRect.top);\n }\n break;\n case \"center\":\n sizeDelta = (this.anchorRect.height - nextRegionHeight) / 2;\n this.translateY = this.baseVerticalOffset + sizeDelta;\n if (this.verticalViewportLock) {\n const regionTop = this.anchorRect.top + sizeDelta;\n const regionBottom = this.anchorRect.bottom - sizeDelta;\n if (regionTop < this.viewportRect.top &&\n !(regionBottom > this.viewportRect.bottom)) {\n this.translateY =\n this.translateY - (regionTop - this.viewportRect.top);\n }\n else if (regionBottom > this.viewportRect.bottom &&\n !(regionTop < this.viewportRect.top)) {\n this.translateY =\n this.translateY - (regionBottom - this.viewportRect.bottom);\n }\n }\n }\n this.verticalPosition = desiredVerticalPosition;\n };\n /**\n * Get available positions based on positioning mode\n */\n this.getPositioningOptions = (inset) => {\n if (inset) {\n return [\"insetStart\", \"insetEnd\"];\n }\n return [\"start\", \"end\"];\n };\n /**\n * Get the space available for a particular relative position\n */\n this.getAvailableSpace = (positionOption, anchorStart, anchorEnd, anchorSpan, viewportStart, viewportEnd) => {\n const spaceStart = anchorStart - viewportStart;\n const spaceEnd = viewportEnd - (anchorStart + anchorSpan);\n switch (positionOption) {\n case \"start\":\n return spaceStart;\n case \"insetStart\":\n return spaceStart + anchorSpan;\n case \"insetEnd\":\n return spaceEnd + anchorSpan;\n case \"end\":\n return spaceEnd;\n case \"center\":\n return Math.min(spaceStart, spaceEnd) * 2 + anchorSpan;\n }\n };\n /**\n * Get region dimensions\n */\n this.getNextRegionDimension = (desiredHorizontalPosition, desiredVerticalPosition) => {\n const newRegionDimension = {\n height: this.regionRect !== undefined ? this.regionRect.height : 0,\n width: this.regionRect !== undefined ? this.regionRect.width : 0,\n };\n if (desiredHorizontalPosition !== undefined &&\n this.horizontalScaling === \"fill\") {\n newRegionDimension.width = this.getAvailableSpace(desiredHorizontalPosition, this.anchorRect !== undefined ? this.anchorRect.left : 0, this.anchorRect !== undefined ? this.anchorRect.right : 0, this.anchorRect !== undefined ? this.anchorRect.width : 0, this.viewportRect !== undefined ? this.viewportRect.left : 0, this.viewportRect !== undefined ? this.viewportRect.right : 0);\n }\n else if (this.horizontalScaling === \"anchor\") {\n newRegionDimension.width =\n this.anchorRect !== undefined ? this.anchorRect.width : 0;\n }\n if (desiredVerticalPosition !== undefined && this.verticalScaling === \"fill\") {\n newRegionDimension.height = this.getAvailableSpace(desiredVerticalPosition, this.anchorRect !== undefined ? this.anchorRect.top : 0, this.anchorRect !== undefined ? this.anchorRect.bottom : 0, this.anchorRect !== undefined ? this.anchorRect.height : 0, this.viewportRect !== undefined ? this.viewportRect.top : 0, this.viewportRect !== undefined ? this.viewportRect.bottom : 0);\n }\n else if (this.verticalScaling === \"anchor\") {\n newRegionDimension.height =\n this.anchorRect !== undefined ? this.anchorRect.height : 0;\n }\n return newRegionDimension;\n };\n /**\n * starts event listeners that can trigger auto updating\n */\n this.startAutoUpdateEventListeners = () => {\n window.addEventListener(eventResize, this.update, { passive: true });\n window.addEventListener(eventScroll, this.update, {\n passive: true,\n capture: true,\n });\n if (this.resizeDetector !== null && this.viewportElement !== null) {\n this.resizeDetector.observe(this.viewportElement);\n }\n };\n /**\n * stops event listeners that can trigger auto updating\n */\n this.stopAutoUpdateEventListeners = () => {\n window.removeEventListener(eventResize, this.update);\n window.removeEventListener(eventScroll, this.update);\n if (this.resizeDetector !== null && this.viewportElement !== null) {\n this.resizeDetector.unobserve(this.viewportElement);\n }\n };\n }\n anchorChanged() {\n if (this.initialLayoutComplete) {\n this.anchorElement = this.getAnchor();\n }\n }\n viewportChanged() {\n if (this.initialLayoutComplete) {\n this.viewportElement = this.getViewport();\n }\n }\n horizontalPositioningModeChanged() {\n this.requestReset();\n }\n horizontalDefaultPositionChanged() {\n this.updateForAttributeChange();\n }\n horizontalViewportLockChanged() {\n this.updateForAttributeChange();\n }\n horizontalInsetChanged() {\n this.updateForAttributeChange();\n }\n horizontalThresholdChanged() {\n this.updateForAttributeChange();\n }\n horizontalScalingChanged() {\n this.updateForAttributeChange();\n }\n verticalPositioningModeChanged() {\n this.requestReset();\n }\n verticalDefaultPositionChanged() {\n this.updateForAttributeChange();\n }\n verticalViewportLockChanged() {\n this.updateForAttributeChange();\n }\n verticalInsetChanged() {\n this.updateForAttributeChange();\n }\n verticalThresholdChanged() {\n this.updateForAttributeChange();\n }\n verticalScalingChanged() {\n this.updateForAttributeChange();\n }\n fixedPlacementChanged() {\n if (this.$fastController.isConnected &&\n this.initialLayoutComplete) {\n this.initialize();\n }\n }\n autoUpdateModeChanged(prevMode, newMode) {\n if (this.$fastController.isConnected &&\n this.initialLayoutComplete) {\n if (prevMode === \"auto\") {\n this.stopAutoUpdateEventListeners();\n }\n if (newMode === \"auto\") {\n this.startAutoUpdateEventListeners();\n }\n }\n }\n anchorElementChanged() {\n this.requestReset();\n }\n viewportElementChanged() {\n if (this.$fastController.isConnected &&\n this.initialLayoutComplete) {\n this.initialize();\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n if (this.autoUpdateMode === \"auto\") {\n this.startAutoUpdateEventListeners();\n }\n this.initialize();\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.autoUpdateMode === \"auto\") {\n this.stopAutoUpdateEventListeners();\n }\n this.stopObservers();\n this.disconnectResizeDetector();\n }\n /**\n * @internal\n */\n adoptedCallback() {\n this.initialize();\n }\n /**\n * destroys the instance's resize observer\n */\n disconnectResizeDetector() {\n if (this.resizeDetector !== null) {\n this.resizeDetector.disconnect();\n this.resizeDetector = null;\n }\n }\n /**\n * initializes the instance's resize observer\n */\n initializeResizeDetector() {\n this.disconnectResizeDetector();\n this.resizeDetector = new window.ResizeObserver(this.handleResize);\n }\n /**\n * react to attribute changes that don't require a reset\n */\n updateForAttributeChange() {\n if (this.$fastController.isConnected &&\n this.initialLayoutComplete) {\n this.forceUpdate = true;\n this.update();\n }\n }\n /**\n * fully initializes the component\n */\n initialize() {\n this.initializeResizeDetector();\n if (this.anchorElement === null) {\n this.anchorElement = this.getAnchor();\n }\n this.requestReset();\n }\n /**\n * Request a reset if there are currently no open requests\n */\n requestReset() {\n if (this.$fastController.isConnected &&\n this.pendingReset === false) {\n this.setInitialState();\n DOM.queueUpdate(() => this.reset());\n this.pendingReset = true;\n }\n }\n /**\n * sets the starting configuration for component internal values\n */\n setInitialState() {\n this.initialLayoutComplete = false;\n this.regionVisible = false;\n this.translateX = 0;\n this.translateY = 0;\n this.baseHorizontalOffset = 0;\n this.baseVerticalOffset = 0;\n this.viewportRect = undefined;\n this.regionRect = undefined;\n this.anchorRect = undefined;\n this.verticalPosition = undefined;\n this.horizontalPosition = undefined;\n this.style.opacity = \"0\";\n this.style.pointerEvents = \"none\";\n this.forceUpdate = false;\n this.style.position = this.fixedPlacement ? \"fixed\" : \"absolute\";\n this.updatePositionClasses();\n this.updateRegionStyle();\n }\n}\nAnchoredRegion.intersectionService = new IntersectionService();\n__decorate([\n attr\n], AnchoredRegion.prototype, \"anchor\", void 0);\n__decorate([\n attr\n], AnchoredRegion.prototype, \"viewport\", void 0);\n__decorate([\n attr({ attribute: \"horizontal-positioning-mode\" })\n], AnchoredRegion.prototype, \"horizontalPositioningMode\", void 0);\n__decorate([\n attr({ attribute: \"horizontal-default-position\" })\n], AnchoredRegion.prototype, \"horizontalDefaultPosition\", void 0);\n__decorate([\n attr({ attribute: \"horizontal-viewport-lock\", mode: \"boolean\" })\n], AnchoredRegion.prototype, \"horizontalViewportLock\", void 0);\n__decorate([\n attr({ attribute: \"horizontal-inset\", mode: \"boolean\" })\n], AnchoredRegion.prototype, \"horizontalInset\", void 0);\n__decorate([\n attr({ attribute: \"horizontal-threshold\" })\n], AnchoredRegion.prototype, \"horizontalThreshold\", void 0);\n__decorate([\n attr({ attribute: \"horizontal-scaling\" })\n], AnchoredRegion.prototype, \"horizontalScaling\", void 0);\n__decorate([\n attr({ attribute: \"vertical-positioning-mode\" })\n], AnchoredRegion.prototype, \"verticalPositioningMode\", void 0);\n__decorate([\n attr({ attribute: \"vertical-default-position\" })\n], AnchoredRegion.prototype, \"verticalDefaultPosition\", void 0);\n__decorate([\n attr({ attribute: \"vertical-viewport-lock\", mode: \"boolean\" })\n], AnchoredRegion.prototype, \"verticalViewportLock\", void 0);\n__decorate([\n attr({ attribute: \"vertical-inset\", mode: \"boolean\" })\n], AnchoredRegion.prototype, \"verticalInset\", void 0);\n__decorate([\n attr({ attribute: \"vertical-threshold\" })\n], AnchoredRegion.prototype, \"verticalThreshold\", void 0);\n__decorate([\n attr({ attribute: \"vertical-scaling\" })\n], AnchoredRegion.prototype, \"verticalScaling\", void 0);\n__decorate([\n attr({ attribute: \"fixed-placement\", mode: \"boolean\" })\n], AnchoredRegion.prototype, \"fixedPlacement\", void 0);\n__decorate([\n attr({ attribute: \"auto-update-mode\" })\n], AnchoredRegion.prototype, \"autoUpdateMode\", void 0);\n__decorate([\n observable\n], AnchoredRegion.prototype, \"anchorElement\", void 0);\n__decorate([\n observable\n], AnchoredRegion.prototype, \"viewportElement\", void 0);\n__decorate([\n observable\n], AnchoredRegion.prototype, \"initialLayoutComplete\", void 0);\n","import { $global } from \"@microsoft/fast-element\";\n/**\n * A service to batch intersection event callbacks so multiple elements can share a single observer\n *\n * @public\n */\nexport class IntersectionService {\n constructor() {\n this.intersectionDetector = null;\n this.observedElements = new Map();\n /**\n * Request the position of a target element\n *\n * @internal\n */\n this.requestPosition = (target, callback) => {\n var _a;\n if (this.intersectionDetector === null) {\n return;\n }\n if (this.observedElements.has(target)) {\n (_a = this.observedElements.get(target)) === null || _a === void 0 ? void 0 : _a.push(callback);\n return;\n }\n this.observedElements.set(target, [callback]);\n this.intersectionDetector.observe(target);\n };\n /**\n * Cancel a position request\n *\n * @internal\n */\n this.cancelRequestPosition = (target, callback) => {\n const callbacks = this.observedElements.get(target);\n if (callbacks !== undefined) {\n const callBackIndex = callbacks.indexOf(callback);\n if (callBackIndex !== -1) {\n callbacks.splice(callBackIndex, 1);\n }\n }\n };\n /**\n * initialize intersection detector\n */\n this.initializeIntersectionDetector = () => {\n if (!$global.IntersectionObserver) {\n //intersection observer not supported\n return;\n }\n this.intersectionDetector = new IntersectionObserver(this.handleIntersection, {\n root: null,\n rootMargin: \"0px\",\n threshold: [0, 1],\n });\n };\n /**\n * Handle intersections\n */\n this.handleIntersection = (entries) => {\n if (this.intersectionDetector === null) {\n return;\n }\n const pendingCallbacks = [];\n const pendingCallbackParams = [];\n // go through the entries to build a list of callbacks and params for each\n entries.forEach((entry) => {\n var _a;\n // stop watching this element until we get new update requests for it\n (_a = this.intersectionDetector) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target);\n const thisElementCallbacks = this.observedElements.get(entry.target);\n if (thisElementCallbacks !== undefined) {\n thisElementCallbacks.forEach((callback) => {\n let targetCallbackIndex = pendingCallbacks.indexOf(callback);\n if (targetCallbackIndex === -1) {\n targetCallbackIndex = pendingCallbacks.length;\n pendingCallbacks.push(callback);\n pendingCallbackParams.push([]);\n }\n pendingCallbackParams[targetCallbackIndex].push(entry);\n });\n this.observedElements.delete(entry.target);\n }\n });\n // execute callbacks\n pendingCallbacks.forEach((callback, index) => {\n callback(pendingCallbackParams[index]);\n });\n };\n this.initializeIntersectionDetector();\n }\n}\n","/**\n * Building blocks - partial configs\n */\n/**\n * A region that matches the size and position of the anchor horizontally\n */\nconst horizontalAnchorOverlay = {\n horizontalDefaultPosition: \"center\",\n horizontalPositioningMode: \"locktodefault\",\n horizontalInset: false,\n horizontalScaling: \"anchor\",\n};\n/**\n * Exported configs\n */\n/**\n * A region that always places itself above the anchor, has\n * a width to match the anchor, and is sized vertically by content\n *\n * @public\n */\nexport const FlyoutPosTop = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: \"top\", verticalPositioningMode: \"locktodefault\", verticalInset: false, verticalScaling: \"content\" });\n/**\n * A region that always places itself below the anchor, has\n * a width to match the anchor, and is sized vertically by content\n *\n * @public\n */\nexport const FlyoutPosBottom = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: \"bottom\", verticalPositioningMode: \"locktodefault\", verticalInset: false, verticalScaling: \"content\" });\n/**\n * A region that places itself above or below the anchor\n * based on available space, has a width to match the anchor,\n * and is sized vertically by content\n *\n * @public\n */\nexport const FlyoutPosTallest = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalPositioningMode: \"dynamic\", verticalInset: false, verticalScaling: \"content\" });\n/**\n * A region that always places itself above the anchor, has\n * a width to match the anchor, and is sized vertically by available space\n *\n * @public\n */\nexport const FlyoutPosTopFill = Object.assign(Object.assign({}, FlyoutPosTop), { verticalScaling: \"fill\" });\n/**\n * A region that always places itself below the anchor, has\n * a width to match the anchor, and is sized vertically by available space\n *\n * @public\n */\nexport const FlyoutPosBottomFill = Object.assign(Object.assign({}, FlyoutPosBottom), { verticalScaling: \"fill\" });\n/**\n * A region that places itself above or below the anchor\n * based on available space, has a width to match the anchor,\n * and is sized vertically by available space\n *\n * @public\n */\nexport const FlyoutPosTallestFill = Object.assign(Object.assign({}, FlyoutPosTallest), { verticalScaling: \"fill\" });\n","import { html } from \"@microsoft/fast-element\";\n/**\n * The template for {@link @microsoft/fast-foundation#Avatar} component.\n * @public\n */\nexport const avatarTemplate = (context, definition) => html `\n <div\n class=\"backplate ${x => x.shape}\"\n part=\"backplate\"\n style=\"${x => x.fill ? `background-color: var(--avatar-fill-${x.fill});` : void 0}\"\n >\n <a\n class=\"link\"\n part=\"link\"\n href=\"${x => (x.link ? x.link : void 0)}\"\n style=\"${x => (x.color ? `color: var(--avatar-color-${x.color});` : void 0)}\"\n >\n <slot name=\"media\" part=\"media\">${definition.media || \"\"}</slot>\n <slot class=\"content\" part=\"content\"><slot>\n </a>\n </div>\n <slot name=\"badge\" part=\"badge\"></slot>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr } from \"@microsoft/fast-element\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\n/**\n * An Avatar Custom HTML Element\n *\n * @slot media - Used for media such as an image\n * @slot - The default slot for avatar text, commonly a name or initials\n * @slot badge - Used to provide a badge, such as a status badge\n * @csspart backplate - The wrapping container for the avatar\n * @csspart link - The avatar link\n * @csspart media - The media slot\n * @csspart content - The default slot\n *\n * @public\n */\nexport class Avatar extends FoundationElement {\n /**\n * Internal\n */\n connectedCallback() {\n super.connectedCallback();\n if (!this.shape) {\n this.shape = \"circle\";\n }\n }\n}\n__decorate([\n attr\n], Avatar.prototype, \"fill\", void 0);\n__decorate([\n attr\n], Avatar.prototype, \"color\", void 0);\n__decorate([\n attr\n], Avatar.prototype, \"link\", void 0);\n__decorate([\n attr\n], Avatar.prototype, \"shape\", void 0);\n","import { html } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Badge} component.\n * @public\n */\nexport const badgeTemplate = (context, definition) => html `\n <template class=\"${x => (x.circular ? \"circular\" : \"\")}\">\n <div class=\"control\" part=\"control\" style=\"${x => x.generateBadgeStyle()}\">\n <slot></slot>\n </div>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A Badge Custom HTML Element.\n * @slot - The default slot for the badge\n * @csspart control - The element representing the badge, which wraps the default slot\n *\n * @public\n */\nexport class Badge extends FoundationElement {\n constructor() {\n super(...arguments);\n this.generateBadgeStyle = () => {\n if (!this.fill && !this.color) {\n return;\n }\n const fill = `background-color: var(--badge-fill-${this.fill});`;\n const color = `color: var(--badge-color-${this.color});`;\n if (this.fill && !this.color) {\n return fill;\n }\n else if (this.color && !this.fill) {\n return color;\n }\n else {\n return `${color} ${fill}`;\n }\n };\n }\n}\n__decorate([\n attr({ attribute: \"fill\" })\n], Badge.prototype, \"fill\", void 0);\n__decorate([\n attr({ attribute: \"color\" })\n], Badge.prototype, \"color\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], Badge.prototype, \"circular\", void 0);\n","import { html, when } from \"@microsoft/fast-element\";\nimport { anchorTemplate } from \"../anchor/anchor.template.js\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(BreadcrumbItem:class)} component.\n * @public\n */\nexport const breadcrumbItemTemplate = (context, definition) => html `\n <div role=\"listitem\" class=\"listitem\" part=\"listitem\">\n ${when(x => x.href && x.href.length > 0, html `\n ${anchorTemplate(context, definition)}\n `)}\n ${when(x => !x.href, html `\n ${startSlotTemplate(context, definition)}\n <slot></slot>\n ${endSlotTemplate(context, definition)}\n `)}\n ${when(x => x.separator, html `\n <span class=\"separator\" part=\"separator\" aria-hidden=\"true\">\n <slot name=\"separator\">${definition.separator || \"\"}</slot>\n </span>\n `)}\n </div>\n`;\n","import { __decorate } from \"tslib\";\nimport { observable } from \"@microsoft/fast-element\";\nimport { Anchor, DelegatesARIALink } from \"../anchor/anchor.js\";\nimport { StartEnd } from \"../patterns/index.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\n/**\n * A Breadcrumb Item Custom HTML Element.\n *\n * @public\n */\nexport class BreadcrumbItem extends Anchor {\n constructor() {\n super(...arguments);\n /**\n * @internal\n */\n this.separator = true;\n }\n}\n__decorate([\n observable\n], BreadcrumbItem.prototype, \"separator\", void 0);\napplyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink);\n","import { elements, html, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Breadcrumb} component.\n * @public\n */\nexport const breadcrumbTemplate = (context, definition) => html `\n <template role=\"navigation\">\n <div role=\"list\" class=\"list\" part=\"list\">\n <slot\n ${slotted({ property: \"slottedBreadcrumbItems\", filter: elements() })}\n ></slot>\n </div>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { observable } from \"@microsoft/fast-element\";\nimport { BreadcrumbItem } from \"../breadcrumb-item/breadcrumb-item.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A Breadcrumb Custom HTML Element.\n * @slot - The default slot for the breadcrumb items\n * @csspart list - The element wrapping the slotted items\n *\n * @public\n */\nexport class Breadcrumb extends FoundationElement {\n slottedBreadcrumbItemsChanged() {\n if (this.$fastController.isConnected) {\n if (this.slottedBreadcrumbItems === undefined ||\n this.slottedBreadcrumbItems.length === 0) {\n return;\n }\n const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1];\n this.slottedBreadcrumbItems.forEach((item) => {\n const itemIsLastNode = item === lastNode;\n this.setItemSeparator(item, itemIsLastNode);\n this.setAriaCurrent(item, itemIsLastNode);\n });\n }\n }\n setItemSeparator(item, isLastNode) {\n if (item instanceof BreadcrumbItem) {\n item.separator = !isLastNode;\n }\n }\n /**\n * Finds href on childnodes in the light DOM or shadow DOM.\n * We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href.\n */\n findChildWithHref(node) {\n var _a, _b;\n if (node.childElementCount > 0) {\n return node.querySelector(\"a[href]\");\n }\n else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) {\n return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(\"a[href]\");\n }\n else\n return null;\n }\n /**\n * Sets ARIA Current for the current node\n * If child node with an anchor tag and with href is found then set aria-current to correct value for the child node,\n * otherwise apply aria-current to the host element, with an href\n */\n setAriaCurrent(item, isLastNode) {\n const childNodeWithHref = this.findChildWithHref(item);\n if (childNodeWithHref === null &&\n item.hasAttribute(\"href\") &&\n item instanceof BreadcrumbItem) {\n isLastNode\n ? item.setAttribute(\"aria-current\", \"page\")\n : item.removeAttribute(\"aria-current\");\n }\n else if (childNodeWithHref !== null) {\n isLastNode\n ? childNodeWithHref.setAttribute(\"aria-current\", \"page\")\n : childNodeWithHref.removeAttribute(\"aria-current\");\n }\n }\n}\n__decorate([\n observable\n], Breadcrumb.prototype, \"slottedBreadcrumbItems\", void 0);\n","import { html, ref, slotted } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Button:class)} component.\n * @public\n */\nexport const buttonTemplate = (context, definition) => html `\n <button\n class=\"control\"\n part=\"control\"\n ?autofocus=\"${x => x.autofocus}\"\n ?disabled=\"${x => x.disabled}\"\n form=\"${x => x.formId}\"\n formaction=\"${x => x.formaction}\"\n formenctype=\"${x => x.formenctype}\"\n formmethod=\"${x => x.formmethod}\"\n formnovalidate=\"${x => x.formnovalidate}\"\n formtarget=\"${x => x.formtarget}\"\n name=\"${x => x.name}\"\n type=\"${x => x.type}\"\n value=\"${x => x.value}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-pressed=\"${x => x.ariaPressed}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref(\"control\")}\n >\n ${startSlotTemplate(context, definition)}\n <span class=\"content\" part=\"content\">\n <slot ${slotted(\"defaultSlottedContent\")}></slot>\n </span>\n ${endSlotTemplate(context, definition)}\n </button>\n`;\n","import { attr, booleanConverter, DOM, emptyArray, observable, } from \"@microsoft/fast-element\";\nimport { keyEnter } from \"@microsoft/fast-web-utilities\";\nconst proxySlotName = \"form-associated-proxy\";\nconst ElementInternalsKey = \"ElementInternals\";\n/**\n * @alpha\n */\nexport const supportsElementInternals = ElementInternalsKey in window &&\n \"setFormValue\" in window[ElementInternalsKey].prototype;\nconst InternalsMap = new WeakMap();\n/**\n * Base function for providing Custom Element Form Association.\n *\n * @alpha\n */\nexport function FormAssociated(BaseCtor) {\n const C = class extends BaseCtor {\n constructor(...args) {\n super(...args);\n /**\n * Track whether the value has been changed from the initial value\n */\n this.dirtyValue = false;\n /**\n * Sets the element's disabled state. A disabled element will not be included during form submission.\n *\n * @remarks\n * HTML Attribute: disabled\n */\n this.disabled = false;\n /**\n * These are events that are still fired by the proxy\n * element based on user / programmatic interaction.\n *\n * The proxy implementation should be transparent to\n * the app author, so block these events from emitting.\n */\n this.proxyEventsToBlock = [\"change\", \"click\"];\n this.proxyInitialized = false;\n this.required = false;\n this.initialValue = this.initialValue || \"\";\n if (!this.elementInternals) {\n // When elementInternals is not supported, formResetCallback is\n // bound to an event listener, so ensure the handler's `this`\n // context is correct.\n this.formResetCallback = this.formResetCallback.bind(this);\n }\n }\n /**\n * Must evaluate to true to enable elementInternals.\n * Feature detects API support and resolve respectively\n *\n * @internal\n */\n static get formAssociated() {\n return supportsElementInternals;\n }\n /**\n * Returns the validity state of the element\n *\n * @alpha\n */\n get validity() {\n return this.elementInternals\n ? this.elementInternals.validity\n : this.proxy.validity;\n }\n /**\n * Retrieve a reference to the associated form.\n * Returns null if not associated to any form.\n *\n * @alpha\n */\n get form() {\n return this.elementInternals ? this.elementInternals.form : this.proxy.form;\n }\n /**\n * Retrieve the localized validation message,\n * or custom validation message if set.\n *\n * @alpha\n */\n get validationMessage() {\n return this.elementInternals\n ? this.elementInternals.validationMessage\n : this.proxy.validationMessage;\n }\n /**\n * Whether the element will be validated when the\n * form is submitted\n */\n get willValidate() {\n return this.elementInternals\n ? this.elementInternals.willValidate\n : this.proxy.willValidate;\n }\n /**\n * A reference to all associated label elements\n */\n get labels() {\n if (this.elementInternals) {\n return Object.freeze(Array.from(this.elementInternals.labels));\n }\n else if (this.proxy instanceof HTMLElement &&\n this.proxy.ownerDocument &&\n this.id) {\n // Labels associated by wrapping the element: <label><custom-element></custom-element></label>\n const parentLabels = this.proxy.labels;\n // Labels associated using the `for` attribute\n const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));\n const labels = parentLabels\n ? forLabels.concat(Array.from(parentLabels))\n : forLabels;\n return Object.freeze(labels);\n }\n else {\n return emptyArray;\n }\n }\n /**\n * Invoked when the `value` property changes\n * @param previous - the previous value\n * @param next - the new value\n *\n * @remarks\n * If elements extending `FormAssociated` implement a `valueChanged` method\n * They must be sure to invoke `super.valueChanged(previous, next)` to ensure\n * proper functioning of `FormAssociated`\n */\n valueChanged(previous, next) {\n this.dirtyValue = true;\n if (this.proxy instanceof HTMLElement) {\n this.proxy.value = this.value;\n }\n this.currentValue = this.value;\n this.setFormValue(this.value);\n this.validate();\n }\n currentValueChanged() {\n this.value = this.currentValue;\n }\n /**\n * Invoked when the `initialValue` property changes\n *\n * @param previous - the previous value\n * @param next - the new value\n *\n * @remarks\n * If elements extending `FormAssociated` implement a `initialValueChanged` method\n * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure\n * proper functioning of `FormAssociated`\n */\n initialValueChanged(previous, next) {\n // If the value is clean and the component is connected to the DOM\n // then set value equal to the attribute value.\n if (!this.dirtyValue) {\n this.value = this.initialValue;\n this.dirtyValue = false;\n }\n }\n /**\n * Invoked when the `disabled` property changes\n *\n * @param previous - the previous value\n * @param next - the new value\n *\n * @remarks\n * If elements extending `FormAssociated` implement a `disabledChanged` method\n * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure\n * proper functioning of `FormAssociated`\n */\n disabledChanged(previous, next) {\n if (this.proxy instanceof HTMLElement) {\n this.proxy.disabled = this.disabled;\n }\n DOM.queueUpdate(() => this.classList.toggle(\"disabled\", this.disabled));\n }\n /**\n * Invoked when the `name` property changes\n *\n * @param previous - the previous value\n * @param next - the new value\n *\n * @remarks\n * If elements extending `FormAssociated` implement a `nameChanged` method\n * They must be sure to invoke `super.nameChanged(previous, next)` to ensure\n * proper functioning of `FormAssociated`\n */\n nameChanged(previous, next) {\n if (this.proxy instanceof HTMLElement) {\n this.proxy.name = this.name;\n }\n }\n /**\n * Invoked when the `required` property changes\n *\n * @param previous - the previous value\n * @param next - the new value\n *\n * @remarks\n * If elements extending `FormAssociated` implement a `requiredChanged` method\n * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure\n * proper functioning of `FormAssociated`\n */\n requiredChanged(prev, next) {\n if (this.proxy instanceof HTMLElement) {\n this.proxy.required = this.required;\n }\n DOM.queueUpdate(() => this.classList.toggle(\"required\", this.required));\n this.validate();\n }\n /**\n * The element internals object. Will only exist\n * in browsers supporting the attachInternals API\n */\n get elementInternals() {\n if (!supportsElementInternals) {\n return null;\n }\n let internals = InternalsMap.get(this);\n if (!internals) {\n internals = this.attachInternals();\n InternalsMap.set(this, internals);\n }\n return internals;\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"keypress\", this._keypressHandler);\n if (!this.value) {\n this.value = this.initialValue;\n this.dirtyValue = false;\n }\n if (!this.elementInternals) {\n this.attachProxy();\n if (this.form) {\n this.form.addEventListener(\"reset\", this.formResetCallback);\n }\n }\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n this.proxyEventsToBlock.forEach(name => this.proxy.removeEventListener(name, this.stopPropagation));\n if (!this.elementInternals && this.form) {\n this.form.removeEventListener(\"reset\", this.formResetCallback);\n }\n }\n /**\n * Return the current validity of the element.\n */\n checkValidity() {\n return this.elementInternals\n ? this.elementInternals.checkValidity()\n : this.proxy.checkValidity();\n }\n /**\n * Return the current validity of the element.\n * If false, fires an invalid event at the element.\n */\n reportValidity() {\n return this.elementInternals\n ? this.elementInternals.reportValidity()\n : this.proxy.reportValidity();\n }\n /**\n * Set the validity of the control. In cases when the elementInternals object is not\n * available (and the proxy element is used to report validity), this function will\n * do nothing unless a message is provided, at which point the setCustomValidity method\n * of the proxy element will be invoked with the provided message.\n * @param flags - Validity flags\n * @param message - Optional message to supply\n * @param anchor - Optional element used by UA to display an interactive validation UI\n */\n setValidity(flags, message, anchor) {\n if (this.elementInternals) {\n this.elementInternals.setValidity(flags, message, anchor);\n }\n else if (typeof message === \"string\") {\n this.proxy.setCustomValidity(message);\n }\n }\n /**\n * Invoked when a connected component's form or fieldset has its disabled\n * state changed.\n * @param disabled - the disabled value of the form / fieldset\n */\n formDisabledCallback(disabled) {\n this.disabled = disabled;\n }\n formResetCallback() {\n this.value = this.initialValue;\n this.dirtyValue = false;\n }\n /**\n * Attach the proxy element to the DOM\n */\n attachProxy() {\n var _a;\n if (!this.proxyInitialized) {\n this.proxyInitialized = true;\n this.proxy.style.display = \"none\";\n this.proxyEventsToBlock.forEach(name => this.proxy.addEventListener(name, this.stopPropagation));\n // These are typically mapped to the proxy during\n // property change callbacks, but during initialization\n // on the initial call of the callback, the proxy is\n // still undefined. We should find a better way to address this.\n this.proxy.disabled = this.disabled;\n this.proxy.required = this.required;\n if (typeof this.name === \"string\") {\n this.proxy.name = this.name;\n }\n if (typeof this.value === \"string\") {\n this.proxy.value = this.value;\n }\n this.proxy.setAttribute(\"slot\", proxySlotName);\n this.proxySlot = document.createElement(\"slot\");\n this.proxySlot.setAttribute(\"name\", proxySlotName);\n }\n (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot);\n this.appendChild(this.proxy);\n }\n /**\n * Detach the proxy element from the DOM\n */\n detachProxy() {\n var _a;\n this.removeChild(this.proxy);\n (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot);\n }\n /** {@inheritDoc (FormAssociated:interface).validate} */\n validate(anchor) {\n if (this.proxy instanceof HTMLElement) {\n this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor);\n }\n }\n /**\n * Associates the provided value (and optional state) with the parent form.\n * @param value - The value to set\n * @param state - The state object provided to during session restores and when autofilling.\n */\n setFormValue(value, state) {\n if (this.elementInternals) {\n this.elementInternals.setFormValue(value, state || value);\n }\n }\n _keypressHandler(e) {\n switch (e.key) {\n case keyEnter:\n if (this.form instanceof HTMLFormElement) {\n // Implicit submission\n const defaultButton = this.form.querySelector(\"[type=submit]\");\n defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click();\n }\n break;\n }\n }\n /**\n * Used to stop propagation of proxy element events\n * @param e - Event object\n */\n stopPropagation(e) {\n e.stopPropagation();\n }\n };\n attr({ mode: \"boolean\" })(C.prototype, \"disabled\");\n attr({ mode: \"fromView\", attribute: \"value\" })(C.prototype, \"initialValue\");\n attr({ attribute: \"current-value\" })(C.prototype, \"currentValue\");\n attr(C.prototype, \"name\");\n attr({ mode: \"boolean\" })(C.prototype, \"required\");\n observable(C.prototype, \"value\");\n return C;\n}\n/**\n * @alpha\n */\nexport function CheckableFormAssociated(BaseCtor) {\n class C extends FormAssociated(BaseCtor) {\n }\n class D extends C {\n constructor(...args) {\n super(args);\n /**\n * Tracks whether the \"checked\" property has been changed.\n * This is necessary to provide consistent behavior with\n * normal input checkboxes\n */\n this.dirtyChecked = false;\n /**\n * Provides the default checkedness of the input element\n * Passed down to proxy\n *\n * @public\n * @remarks\n * HTML Attribute: checked\n */\n this.checkedAttribute = false;\n /**\n * The checked state of the control.\n *\n * @public\n */\n this.checked = false;\n // Re-initialize dirtyChecked because initialization of other values\n // causes it to become true\n this.dirtyChecked = false;\n }\n checkedAttributeChanged() {\n this.defaultChecked = this.checkedAttribute;\n }\n /**\n * @internal\n */\n defaultCheckedChanged() {\n if (!this.dirtyChecked) {\n // Setting this.checked will cause us to enter a dirty state,\n // but if we are clean when defaultChecked is changed, we want to stay\n // in a clean state, so reset this.dirtyChecked\n this.checked = this.defaultChecked;\n this.dirtyChecked = false;\n }\n }\n checkedChanged(prev, next) {\n if (!this.dirtyChecked) {\n this.dirtyChecked = true;\n }\n this.currentChecked = this.checked;\n this.updateForm();\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.checked = this.checked;\n }\n if (prev !== undefined) {\n this.$emit(\"change\");\n }\n this.validate();\n }\n currentCheckedChanged(prev, next) {\n this.checked = this.currentChecked;\n }\n updateForm() {\n const value = this.checked ? this.value : null;\n this.setFormValue(value, value);\n }\n connectedCallback() {\n super.connectedCallback();\n this.updateForm();\n }\n formResetCallback() {\n super.formResetCallback();\n this.checked = !!this.checkedAttribute;\n this.dirtyChecked = false;\n }\n }\n attr({ attribute: \"checked\", mode: \"boolean\" })(D.prototype, \"checkedAttribute\");\n attr({ attribute: \"current-checked\", converter: booleanConverter })(D.prototype, \"currentChecked\");\n observable(D.prototype, \"defaultChecked\");\n observable(D.prototype, \"checked\");\n return D;\n}\n","import { FormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _Button extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedButton extends FormAssociated(_Button) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { ARIAGlobalStatesAndProperties, StartEnd, } from \"../patterns/index.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { FormAssociatedButton } from \"./button.form-associated.js\";\n/**\n * A Button Custom HTML Element.\n * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.\n *\n * @slot start - Content which can be provided before the button content\n * @slot end - Content which can be provided after the button content\n * @slot - The default slot for button content\n * @csspart control - The button element\n * @csspart content - The element wrapping button content\n *\n * @public\n */\nexport class Button extends FormAssociatedButton {\n constructor() {\n super(...arguments);\n /**\n * Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements\n * @internal\n */\n this.handleClick = (e) => {\n var _a;\n if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {\n e.stopPropagation();\n }\n };\n /**\n * Submits the parent form\n */\n this.handleSubmission = () => {\n if (!this.form) {\n return;\n }\n const attached = this.proxy.isConnected;\n if (!attached) {\n this.attachProxy();\n }\n // Browser support for requestSubmit is not comprehensive\n // so click the proxy if it isn't supported\n typeof this.form.requestSubmit === \"function\"\n ? this.form.requestSubmit(this.proxy)\n : this.proxy.click();\n if (!attached) {\n this.detachProxy();\n }\n };\n /**\n * Resets the parent form\n */\n this.handleFormReset = () => {\n var _a;\n (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();\n };\n /**\n * Overrides the focus call for where delegatesFocus is unsupported.\n * This check works for Chrome, Edge Chromium, FireFox, and Safari\n * Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858\n */\n this.handleUnsupportedDelegatesFocus = () => {\n var _a;\n // Check to see if delegatesFocus is supported\n if (window.ShadowRoot &&\n !window.ShadowRoot.prototype.hasOwnProperty(\"delegatesFocus\") &&\n ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {\n this.focus = () => {\n this.control.focus();\n };\n }\n };\n }\n formactionChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.formAction = this.formaction;\n }\n }\n formenctypeChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.formEnctype = this.formenctype;\n }\n }\n formmethodChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.formMethod = this.formmethod;\n }\n }\n formnovalidateChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.formNoValidate = this.formnovalidate;\n }\n }\n formtargetChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.formTarget = this.formtarget;\n }\n }\n typeChanged(previous, next) {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.type = this.type;\n }\n next === \"submit\" && this.addEventListener(\"click\", this.handleSubmission);\n previous === \"submit\" && this.removeEventListener(\"click\", this.handleSubmission);\n next === \"reset\" && this.addEventListener(\"click\", this.handleFormReset);\n previous === \"reset\" && this.removeEventListener(\"click\", this.handleFormReset);\n }\n /** {@inheritDoc (FormAssociated:interface).validate} */\n validate() {\n super.validate(this.control);\n }\n /**\n * @internal\n */\n connectedCallback() {\n var _a;\n super.connectedCallback();\n this.proxy.setAttribute(\"type\", this.type);\n this.handleUnsupportedDelegatesFocus();\n const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);\n if (elements) {\n elements.forEach((span) => {\n span.addEventListener(\"click\", this.handleClick);\n });\n }\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n var _a;\n super.disconnectedCallback();\n const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);\n if (elements) {\n elements.forEach((span) => {\n span.removeEventListener(\"click\", this.handleClick);\n });\n }\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], Button.prototype, \"autofocus\", void 0);\n__decorate([\n attr({ attribute: \"form\" })\n], Button.prototype, \"formId\", void 0);\n__decorate([\n attr\n], Button.prototype, \"formaction\", void 0);\n__decorate([\n attr\n], Button.prototype, \"formenctype\", void 0);\n__decorate([\n attr\n], Button.prototype, \"formmethod\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], Button.prototype, \"formnovalidate\", void 0);\n__decorate([\n attr\n], Button.prototype, \"formtarget\", void 0);\n__decorate([\n attr\n], Button.prototype, \"type\", void 0);\n__decorate([\n observable\n], Button.prototype, \"defaultSlottedContent\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA button role\n *\n * @public\n */\nexport class DelegatesARIAButton {\n}\n__decorate([\n attr({ attribute: \"aria-expanded\" })\n], DelegatesARIAButton.prototype, \"ariaExpanded\", void 0);\n__decorate([\n attr({ attribute: \"aria-pressed\" })\n], DelegatesARIAButton.prototype, \"ariaPressed\", void 0);\napplyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);\napplyMixins(Button, StartEnd, DelegatesARIAButton);\n","/**\n * Date formatting utility\n * @public\n */\nexport class DateFormatter {\n constructor(config) {\n /**\n * Formatting for the day\n * @public\n */\n this.dayFormat = \"numeric\";\n /**\n * Formatting for the weekday labels\n * @public\n */\n this.weekdayFormat = \"long\";\n /**\n * Formatting for the month\n * @public\n */\n this.monthFormat = \"long\";\n /**\n * Formatting for the year\n * @public\n */\n this.yearFormat = \"numeric\";\n /**\n * Date used for formatting\n */\n this.date = new Date();\n /**\n * Add properties on construction\n */\n if (config) {\n for (const key in config) {\n const value = config[key];\n if (key === \"date\") {\n this.date = this.getDateObject(value);\n }\n else {\n this[key] = value;\n }\n }\n }\n }\n /**\n * Helper function to make sure that the DateFormatter is working with an instance of Date\n * @param date - The date as an object, string or Date insance\n * @returns - A Date instance\n * @public\n */\n getDateObject(date) {\n if (typeof date === \"string\") {\n const dates = date.split(/[/-]/);\n if (dates.length < 3) {\n return new Date();\n }\n return new Date(parseInt(dates[2], 10), parseInt(dates[0], 10) - 1, parseInt(dates[1], 10));\n }\n else if (\"day\" in date && \"month\" in date && \"year\" in date) {\n const { day, month, year } = date;\n return new Date(year, month - 1, day);\n }\n return date;\n }\n /**\n *\n * @param date - a valide date as either a Date, string, objec or a DateFormatter\n * @param format - The formatting for the string\n * @param locale - locale data used for formatting\n * @returns A localized string of the date provided\n * @public\n */\n getDate(date = this.date, format = {\n weekday: this.weekdayFormat,\n month: this.monthFormat,\n day: this.dayFormat,\n year: this.yearFormat,\n }, locale = this.locale) {\n const dateObj = this.getDateObject(date);\n const optionsWithTimeZone = Object.assign({ timeZone: \"utc\" }, format);\n return new Intl.DateTimeFormat(locale, optionsWithTimeZone).format(dateObj);\n }\n /**\n *\n * @param day - Day to localize\n * @param format - The formatting for the day\n * @param locale - The locale data used for formatting\n * @returns - A localized number for the day\n * @public\n */\n getDay(day = this.date.getDate(), format = this.dayFormat, locale = this.locale) {\n return this.getDate({ month: 1, day, year: 2020 }, { day: format }, locale);\n }\n /**\n *\n * @param month - The month to localize\n * @param format - The formatting for the month\n * @param locale - The locale data used for formatting\n * @returns - A localized name of the month\n * @public\n */\n getMonth(month = this.date.getMonth() + 1, format = this.monthFormat, locale = this.locale) {\n return this.getDate({ month, day: 2, year: 2020 }, { month: format }, locale);\n }\n /**\n *\n * @param year - The year to localize\n * @param format - The formatting for the year\n * @param locale - The locale data used for formatting\n * @returns - A localized string for the year\n * @public\n */\n getYear(year = this.date.getFullYear(), format = this.yearFormat, locale = this.locale) {\n return this.getDate({ month: 2, day: 2, year }, { year: format }, locale);\n }\n /**\n *\n * @param weekday - The number of the weekday, defaults to Sunday\n * @param format - The formatting for the weekday label\n * @param locale - The locale data used for formatting\n * @returns - A formatted weekday label\n * @public\n */\n getWeekday(weekday = 0, format = this.weekdayFormat, locale = this.locale) {\n const date = `1-${weekday + 1}-2017`;\n return this.getDate(date, { weekday: format }, locale);\n }\n /**\n *\n * @param format - The formatting for the weekdays\n * @param locale - The locale data used for formatting\n * @returns - An array of the weekday labels\n * @public\n */\n getWeekdays(format = this.weekdayFormat, locale = this.locale) {\n return Array(7)\n .fill(null)\n .map((_, day) => this.getWeekday(day, format, locale));\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, nullableNumberConverter, } from \"@microsoft/fast-element\";\nimport { keyEnter } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { DateFormatter } from \"./date-formatter.js\";\n/**\n * Calendar component\n *\n * @slot - The default slot for calendar content\n * @fires dateselected - Fires a custom 'dateselected' event when Enter is invoked via keyboard on a date\n *\n * @public\n */\nexport class Calendar extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * date formatter utitlity for getting localized strings\n * @public\n */\n this.dateFormatter = new DateFormatter();\n /**\n * Readonly attribute for turning off data-grid\n * @public\n */\n this.readonly = false;\n /**\n * String repesentation of the full locale including market, calendar type and numbering system\n * @public\n */\n this.locale = \"en-US\";\n /**\n * Month to display\n * @public\n */\n this.month = new Date().getMonth() + 1;\n /**\n * Year of the month to display\n * @public\n */\n this.year = new Date().getFullYear();\n /**\n * Format style for the day\n * @public\n */\n this.dayFormat = \"numeric\";\n /**\n * Format style for the week day labels\n * @public\n */\n this.weekdayFormat = \"short\";\n /**\n * Format style for the month label\n * @public\n */\n this.monthFormat = \"long\";\n /**\n * Format style for the year used in the title\n * @public\n */\n this.yearFormat = \"numeric\";\n /**\n * Minimum number of weeks to show for the month\n * This can be used to normalize the calendar view\n * when changing or across multiple calendars\n * @public\n */\n this.minWeeks = 0;\n /**\n * A list of dates that should be shown as disabled\n * @public\n */\n this.disabledDates = \"\";\n /**\n * A list of dates that should be shown as highlighted\n * @public\n */\n this.selectedDates = \"\";\n /**\n * The number of miliseconds in a day\n * @internal\n */\n this.oneDayInMs = 86400000;\n }\n localeChanged() {\n this.dateFormatter.locale = this.locale;\n }\n dayFormatChanged() {\n this.dateFormatter.dayFormat = this.dayFormat;\n }\n weekdayFormatChanged() {\n this.dateFormatter.weekdayFormat = this.weekdayFormat;\n }\n monthFormatChanged() {\n this.dateFormatter.monthFormat = this.monthFormat;\n }\n yearFormatChanged() {\n this.dateFormatter.yearFormat = this.yearFormat;\n }\n /**\n * Gets data needed to render about a calendar month as well as the previous and next months\n * @param year - year of the calendar\n * @param month - month of the calendar\n * @returns - an object with data about the current and 2 surrounding months\n * @public\n */\n getMonthInfo(month = this.month, year = this.year) {\n const getFirstDay = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay();\n const getLength = (date) => {\n const nextMonth = new Date(date.getFullYear(), date.getMonth() + 1, 1);\n return new Date(nextMonth.getTime() - this.oneDayInMs).getDate();\n };\n const thisMonth = new Date(year, month - 1);\n const nextMonth = new Date(year, month);\n const previousMonth = new Date(year, month - 2);\n return {\n length: getLength(thisMonth),\n month,\n start: getFirstDay(thisMonth),\n year,\n previous: {\n length: getLength(previousMonth),\n month: previousMonth.getMonth() + 1,\n start: getFirstDay(previousMonth),\n year: previousMonth.getFullYear(),\n },\n next: {\n length: getLength(nextMonth),\n month: nextMonth.getMonth() + 1,\n start: getFirstDay(nextMonth),\n year: nextMonth.getFullYear(),\n },\n };\n }\n /**\n * A list of calendar days\n * @param info - an object containing the information needed to render a calendar month\n * @param minWeeks - minimum number of weeks to show\n * @returns a list of days in a calendar month\n * @public\n */\n getDays(info = this.getMonthInfo(), minWeeks = this.minWeeks) {\n minWeeks = minWeeks > 10 ? 10 : minWeeks;\n const { start, length, previous, next } = info;\n const days = [];\n let dayCount = 1 - start;\n while (dayCount < length + 1 ||\n days.length < minWeeks ||\n days[days.length - 1].length % 7 !== 0) {\n const { month, year } = dayCount < 1 ? previous : dayCount > length ? next : info;\n const day = dayCount < 1\n ? previous.length + dayCount\n : dayCount > length\n ? dayCount - length\n : dayCount;\n const dateString = `${month}-${day}-${year}`;\n const disabled = this.dateInString(dateString, this.disabledDates);\n const selected = this.dateInString(dateString, this.selectedDates);\n const date = {\n day,\n month,\n year,\n disabled,\n selected,\n };\n const target = days[days.length - 1];\n if (days.length === 0 || target.length % 7 === 0) {\n days.push([date]);\n }\n else {\n target.push(date);\n }\n dayCount++;\n }\n return days;\n }\n /**\n * A helper function that checks if a date exists in a list of dates\n * @param date - A date objec that includes the day, month and year\n * @param datesString - a comma separated list of dates\n * @returns - Returns true if it found the date in the list of dates\n * @public\n */\n dateInString(date, datesString) {\n const dates = datesString.split(\",\").map(str => str.trim());\n date =\n typeof date === \"string\"\n ? date\n : `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`;\n return dates.some(d => d === date);\n }\n /**\n * Creates a class string for the day container\n * @param date - date of the calendar cell\n * @returns - string of class names\n * @public\n */\n getDayClassNames(date, todayString) {\n const { day, month, year, disabled, selected } = date;\n const today = todayString === `${month}-${day}-${year}`;\n const inactive = this.month !== month;\n return [\n \"day\",\n today && \"today\",\n inactive && \"inactive\",\n disabled && \"disabled\",\n selected && \"selected\",\n ]\n .filter(Boolean)\n .join(\" \");\n }\n /**\n * Returns a list of weekday labels\n * @returns An array of weekday text and full text if abbreviated\n * @public\n */\n getWeekdayText() {\n const weekdayText = this.dateFormatter.getWeekdays().map(text => ({ text }));\n if (this.weekdayFormat !== \"long\") {\n const longText = this.dateFormatter.getWeekdays(\"long\");\n weekdayText.forEach((weekday, index) => {\n weekday.abbr = longText[index];\n });\n }\n return weekdayText;\n }\n /**\n * Emits the \"date-select\" event with the day, month and year.\n * @param date - Date cell\n * @public\n */\n handleDateSelect(event, day) {\n event.preventDefault;\n this.$emit(\"dateselected\", day);\n }\n /**\n * Handles keyboard events on a cell\n * @param event - Keyboard event\n * @param date - Date of the cell selected\n */\n handleKeydown(event, date) {\n if (event.key === keyEnter) {\n this.handleDateSelect(event, date);\n }\n return true;\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], Calendar.prototype, \"readonly\", void 0);\n__decorate([\n attr\n], Calendar.prototype, \"locale\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], Calendar.prototype, \"month\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], Calendar.prototype, \"year\", void 0);\n__decorate([\n attr({ attribute: \"day-format\", mode: \"fromView\" })\n], Calendar.prototype, \"dayFormat\", void 0);\n__decorate([\n attr({ attribute: \"weekday-format\", mode: \"fromView\" })\n], Calendar.prototype, \"weekdayFormat\", void 0);\n__decorate([\n attr({ attribute: \"month-format\", mode: \"fromView\" })\n], Calendar.prototype, \"monthFormat\", void 0);\n__decorate([\n attr({ attribute: \"year-format\", mode: \"fromView\" })\n], Calendar.prototype, \"yearFormat\", void 0);\n__decorate([\n attr({ attribute: \"min-weeks\", converter: nullableNumberConverter })\n], Calendar.prototype, \"minWeeks\", void 0);\n__decorate([\n attr({ attribute: \"disabled-dates\" })\n], Calendar.prototype, \"disabledDates\", void 0);\n__decorate([\n attr({ attribute: \"selected-dates\" })\n], Calendar.prototype, \"selectedDates\", void 0);\n","/**\n * Enumerates the data grid auto generated header options\n * default option generates a non-sticky header row\n *\n * @public\n */\nexport const GenerateHeaderOptions = {\n none: \"none\",\n default: \"default\",\n sticky: \"sticky\",\n};\n/**\n * Enumerates possible data grid cell types.\n *\n * @public\n */\nexport const DataGridCellTypes = {\n default: \"default\",\n columnHeader: \"columnheader\",\n rowHeader: \"rowheader\",\n};\n/**\n * Enumerates possible data grid row types\n *\n * @public\n */\nexport const DataGridRowTypes = {\n default: \"default\",\n header: \"header\",\n stickyHeader: \"sticky-header\",\n};\n","import { __decorate } from \"tslib\";\nimport { attr, html, observable } from \"@microsoft/fast-element\";\nimport { eventFocusIn, eventFocusOut, eventKeyDown, keyEnter, keyEscape, keyFunction2, } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { DataGridCellTypes } from \"./data-grid.options.js\";\nexport { DataGridCellTypes };\nconst defaultCellContentsTemplate = html `\n <template>\n ${x => x.rowData === null ||\n x.columnDefinition === null ||\n x.columnDefinition.columnDataKey === null\n ? null\n : x.rowData[x.columnDefinition.columnDataKey]}\n </template>\n`;\nconst defaultHeaderCellContentsTemplate = html `\n <template>\n ${x => x.columnDefinition === null\n ? null\n : x.columnDefinition.title === undefined\n ? x.columnDefinition.columnDataKey\n : x.columnDefinition.title}\n </template>\n`;\n/**\n * A Data Grid Cell Custom HTML Element.\n *\n * @fires cell-focused - Fires a custom 'cell-focused' event when focus is on the cell or its contents\n * @slot - The default slot for cell contents. The \"cell contents template\" renders here.\n * @public\n */\nexport class DataGridCell extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The type of cell\n *\n * @public\n * @remarks\n * HTML Attribute: cell-type\n */\n this.cellType = DataGridCellTypes.default;\n /**\n * The base data for the parent row\n *\n * @public\n */\n this.rowData = null;\n /**\n * The base data for the column\n *\n * @public\n */\n this.columnDefinition = null;\n this.isActiveCell = false;\n this.customCellView = null;\n this.updateCellStyle = () => {\n this.style.gridColumn = this.gridColumn;\n };\n }\n cellTypeChanged() {\n if (this.$fastController.isConnected) {\n this.updateCellView();\n }\n }\n gridColumnChanged() {\n if (this.$fastController.isConnected) {\n this.updateCellStyle();\n }\n }\n columnDefinitionChanged(oldValue, newValue) {\n if (this.$fastController.isConnected) {\n this.updateCellView();\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n var _a;\n super.connectedCallback();\n this.addEventListener(eventFocusIn, this.handleFocusin);\n this.addEventListener(eventFocusOut, this.handleFocusout);\n this.addEventListener(eventKeyDown, this.handleKeydown);\n this.style.gridColumn = `${((_a = this.columnDefinition) === null || _a === void 0 ? void 0 : _a.gridColumn) === undefined\n ? 0\n : this.columnDefinition.gridColumn}`;\n this.updateCellView();\n this.updateCellStyle();\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(eventFocusIn, this.handleFocusin);\n this.removeEventListener(eventFocusOut, this.handleFocusout);\n this.removeEventListener(eventKeyDown, this.handleKeydown);\n this.disconnectCellView();\n }\n handleFocusin(e) {\n if (this.isActiveCell) {\n return;\n }\n this.isActiveCell = true;\n switch (this.cellType) {\n case DataGridCellTypes.columnHeader:\n if (this.columnDefinition !== null &&\n this.columnDefinition.headerCellInternalFocusQueue !== true &&\n typeof this.columnDefinition.headerCellFocusTargetCallback ===\n \"function\") {\n // move focus to the focus target\n const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this);\n if (focusTarget !== null) {\n focusTarget.focus();\n }\n }\n break;\n default:\n if (this.columnDefinition !== null &&\n this.columnDefinition.cellInternalFocusQueue !== true &&\n typeof this.columnDefinition.cellFocusTargetCallback === \"function\") {\n // move focus to the focus target\n const focusTarget = this.columnDefinition.cellFocusTargetCallback(this);\n if (focusTarget !== null) {\n focusTarget.focus();\n }\n }\n break;\n }\n this.$emit(\"cell-focused\", this);\n }\n handleFocusout(e) {\n if (this !== document.activeElement && !this.contains(document.activeElement)) {\n this.isActiveCell = false;\n }\n }\n handleKeydown(e) {\n if (e.defaultPrevented ||\n this.columnDefinition === null ||\n (this.cellType === DataGridCellTypes.default &&\n this.columnDefinition.cellInternalFocusQueue !== true) ||\n (this.cellType === DataGridCellTypes.columnHeader &&\n this.columnDefinition.headerCellInternalFocusQueue !== true)) {\n return;\n }\n switch (e.key) {\n case keyEnter:\n case keyFunction2:\n if (this.contains(document.activeElement) &&\n document.activeElement !== this) {\n return;\n }\n switch (this.cellType) {\n case DataGridCellTypes.columnHeader:\n if (this.columnDefinition.headerCellFocusTargetCallback !==\n undefined) {\n const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this);\n if (focusTarget !== null) {\n focusTarget.focus();\n }\n e.preventDefault();\n }\n break;\n default:\n if (this.columnDefinition.cellFocusTargetCallback !== undefined) {\n const focusTarget = this.columnDefinition.cellFocusTargetCallback(this);\n if (focusTarget !== null) {\n focusTarget.focus();\n }\n e.preventDefault();\n }\n break;\n }\n break;\n case keyEscape:\n if (this.contains(document.activeElement) &&\n document.activeElement !== this) {\n this.focus();\n e.preventDefault();\n }\n break;\n }\n }\n updateCellView() {\n this.disconnectCellView();\n if (this.columnDefinition === null) {\n return;\n }\n switch (this.cellType) {\n case DataGridCellTypes.columnHeader:\n if (this.columnDefinition.headerCellTemplate !== undefined) {\n this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this);\n }\n else {\n this.customCellView = defaultHeaderCellContentsTemplate.render(this, this);\n }\n break;\n case undefined:\n case DataGridCellTypes.rowHeader:\n case DataGridCellTypes.default:\n if (this.columnDefinition.cellTemplate !== undefined) {\n this.customCellView = this.columnDefinition.cellTemplate.render(this, this);\n }\n else {\n this.customCellView = defaultCellContentsTemplate.render(this, this);\n }\n break;\n }\n }\n disconnectCellView() {\n if (this.customCellView !== null) {\n this.customCellView.dispose();\n this.customCellView = null;\n }\n }\n}\n__decorate([\n attr({ attribute: \"cell-type\" })\n], DataGridCell.prototype, \"cellType\", void 0);\n__decorate([\n attr({ attribute: \"grid-column\" })\n], DataGridCell.prototype, \"gridColumn\", void 0);\n__decorate([\n observable\n], DataGridCell.prototype, \"rowData\", void 0);\n__decorate([\n observable\n], DataGridCell.prototype, \"columnDefinition\", void 0);\n","import { __decorate } from \"tslib\";\nimport { attr, observable, RepeatDirective, } from \"@microsoft/fast-element\";\nimport { eventFocusOut, eventKeyDown, keyArrowLeft, keyArrowRight, keyEnd, keyHome, } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { DataGridRowTypes } from \"./data-grid.options.js\";\n/**\n * A Data Grid Row Custom HTML Element.\n *\n * @fires row-focused - Fires a custom 'row-focused' event when focus is on an element (usually a cell or its contents) in the row\n * @slot - The default slot for custom cell elements\n * @public\n */\nexport class DataGridRow extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The type of row\n *\n * @public\n * @remarks\n * HTML Attribute: row-type\n */\n this.rowType = DataGridRowTypes.default;\n /**\n * The base data for this row\n *\n * @public\n */\n this.rowData = null;\n /**\n * The column definitions of the row\n *\n * @public\n */\n this.columnDefinitions = null;\n /**\n * Whether focus is on/in a cell within this row.\n *\n * @internal\n */\n this.isActiveRow = false;\n this.cellsRepeatBehavior = null;\n this.cellsPlaceholder = null;\n /**\n * @internal\n */\n this.focusColumnIndex = 0;\n this.refocusOnLoad = false;\n this.updateRowStyle = () => {\n this.style.gridTemplateColumns = this.gridTemplateColumns;\n };\n }\n gridTemplateColumnsChanged() {\n if (this.$fastController.isConnected) {\n this.updateRowStyle();\n }\n }\n rowTypeChanged() {\n if (this.$fastController.isConnected) {\n this.updateItemTemplate();\n }\n }\n rowDataChanged() {\n if (this.rowData !== null && this.isActiveRow) {\n this.refocusOnLoad = true;\n return;\n }\n }\n cellItemTemplateChanged() {\n this.updateItemTemplate();\n }\n headerCellItemTemplateChanged() {\n this.updateItemTemplate();\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n // note that row elements can be reused with a different data object\n // as the parent grid's repeat behavior reacts to changes in the data set.\n if (this.cellsRepeatBehavior === null) {\n this.cellsPlaceholder = document.createComment(\"\");\n this.appendChild(this.cellsPlaceholder);\n this.updateItemTemplate();\n this.cellsRepeatBehavior = new RepeatDirective(x => x.columnDefinitions, x => x.activeCellItemTemplate, { positioning: true }).createBehavior(this.cellsPlaceholder);\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n this.$fastController.addBehaviors([this.cellsRepeatBehavior]);\n }\n this.addEventListener(\"cell-focused\", this.handleCellFocus);\n this.addEventListener(eventFocusOut, this.handleFocusout);\n this.addEventListener(eventKeyDown, this.handleKeydown);\n this.updateRowStyle();\n if (this.refocusOnLoad) {\n // if focus was on the row when data changed try to refocus on same cell\n this.refocusOnLoad = false;\n if (this.cellElements.length > this.focusColumnIndex) {\n this.cellElements[this.focusColumnIndex].focus();\n }\n }\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"cell-focused\", this.handleCellFocus);\n this.removeEventListener(eventFocusOut, this.handleFocusout);\n this.removeEventListener(eventKeyDown, this.handleKeydown);\n }\n handleFocusout(e) {\n if (!this.contains(e.target)) {\n this.isActiveRow = false;\n this.focusColumnIndex = 0;\n }\n }\n handleCellFocus(e) {\n this.isActiveRow = true;\n this.focusColumnIndex = this.cellElements.indexOf(e.target);\n this.$emit(\"row-focused\", this);\n }\n handleKeydown(e) {\n if (e.defaultPrevented) {\n return;\n }\n let newFocusColumnIndex = 0;\n switch (e.key) {\n case keyArrowLeft:\n // focus left one cell\n newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1);\n this.cellElements[newFocusColumnIndex].focus();\n e.preventDefault();\n break;\n case keyArrowRight:\n // focus right one cell\n newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1);\n this.cellElements[newFocusColumnIndex].focus();\n e.preventDefault();\n break;\n case keyHome:\n if (!e.ctrlKey) {\n this.cellElements[0].focus();\n e.preventDefault();\n }\n break;\n case keyEnd:\n if (!e.ctrlKey) {\n // focus last cell of the row\n this.cellElements[this.cellElements.length - 1].focus();\n e.preventDefault();\n }\n break;\n }\n }\n updateItemTemplate() {\n this.activeCellItemTemplate =\n this.rowType === DataGridRowTypes.default &&\n this.cellItemTemplate !== undefined\n ? this.cellItemTemplate\n : this.rowType === DataGridRowTypes.default &&\n this.cellItemTemplate === undefined\n ? this.defaultCellItemTemplate\n : this.headerCellItemTemplate !== undefined\n ? this.headerCellItemTemplate\n : this.defaultHeaderCellItemTemplate;\n }\n}\n__decorate([\n attr({ attribute: \"grid-template-columns\" })\n], DataGridRow.prototype, \"gridTemplateColumns\", void 0);\n__decorate([\n attr({ attribute: \"row-type\" })\n], DataGridRow.prototype, \"rowType\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"rowData\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"columnDefinitions\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"cellItemTemplate\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"headerCellItemTemplate\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"rowIndex\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"isActiveRow\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"activeCellItemTemplate\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"defaultCellItemTemplate\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"defaultHeaderCellItemTemplate\", void 0);\n__decorate([\n observable\n], DataGridRow.prototype, \"cellElements\", void 0);\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, observable, RepeatDirective, } from \"@microsoft/fast-element\";\nimport { eventFocus, eventFocusOut, eventKeyDown, keyArrowDown, keyArrowUp, keyEnd, keyHome, keyPageDown, keyPageUp, } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { DataGridRowTypes, GenerateHeaderOptions } from \"./data-grid.options.js\";\nexport { DataGridRowTypes, GenerateHeaderOptions };\n/**\n * A Data Grid Custom HTML Element.\n *\n * @slot - The default slot for custom row elements\n * @public\n */\nexport class DataGrid extends FoundationElement {\n constructor() {\n super();\n /**\n * When true the component will not add itself to the tab queue.\n * Default is false.\n *\n * @public\n * @remarks\n * HTML Attribute: no-tabbing\n */\n this.noTabbing = false;\n /**\n * Whether the grid should automatically generate a header row and its type\n *\n * @public\n * @remarks\n * HTML Attribute: generate-header\n */\n this.generateHeader = GenerateHeaderOptions.default;\n /**\n * The data being displayed in the grid\n *\n * @public\n */\n this.rowsData = [];\n /**\n * The column definitions of the grid\n *\n * @public\n */\n this.columnDefinitions = null;\n /**\n * The index of the row that will receive focus the next time the\n * grid is focused. This value changes as focus moves to different\n * rows within the grid. Changing this value when focus is already\n * within the grid moves focus to the specified row.\n *\n * @public\n */\n this.focusRowIndex = 0;\n /**\n * The index of the column that will receive focus the next time the\n * grid is focused. This value changes as focus moves to different rows\n * within the grid. Changing this value when focus is already within\n * the grid moves focus to the specified column.\n *\n * @public\n */\n this.focusColumnIndex = 0;\n this.rowsPlaceholder = null;\n this.generatedHeader = null;\n this.isUpdatingFocus = false;\n this.pendingFocusUpdate = false;\n this.rowindexUpdateQueued = false;\n this.columnDefinitionsStale = true;\n this.generatedGridTemplateColumns = \"\";\n this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => {\n if (this.rowElements.length === 0) {\n this.focusRowIndex = 0;\n this.focusColumnIndex = 0;\n return;\n }\n const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex));\n const focusRow = this.rowElements[focusRowIndex];\n const cells = focusRow.querySelectorAll('[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [role=\"rowheader\"]');\n const focusColumnIndex = Math.max(0, Math.min(cells.length - 1, columnIndex));\n const focusTarget = cells[focusColumnIndex];\n if (scrollIntoView &&\n this.scrollHeight !== this.clientHeight &&\n ((focusRowIndex < this.focusRowIndex && this.scrollTop > 0) ||\n (focusRowIndex > this.focusRowIndex &&\n this.scrollTop < this.scrollHeight - this.clientHeight))) {\n focusTarget.scrollIntoView({ block: \"center\", inline: \"center\" });\n }\n focusTarget.focus();\n };\n this.onChildListChange = (mutations, \n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n observer) => {\n if (mutations && mutations.length) {\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((newNode) => {\n if (newNode.nodeType === 1 &&\n newNode.getAttribute(\"role\") === \"row\") {\n newNode.columnDefinitions = this.columnDefinitions;\n }\n });\n });\n this.queueRowIndexUpdate();\n }\n };\n this.queueRowIndexUpdate = () => {\n if (!this.rowindexUpdateQueued) {\n this.rowindexUpdateQueued = true;\n DOM.queueUpdate(this.updateRowIndexes);\n }\n };\n this.updateRowIndexes = () => {\n let newGridTemplateColumns = this.gridTemplateColumns;\n if (newGridTemplateColumns === undefined) {\n // try to generate columns based on manual rows\n if (this.generatedGridTemplateColumns === \"\" && this.rowElements.length > 0) {\n const firstRow = this.rowElements[0];\n this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length)\n .fill(\"1fr\")\n .join(\" \");\n }\n newGridTemplateColumns = this.generatedGridTemplateColumns;\n }\n this.rowElements.forEach((element, index) => {\n const thisRow = element;\n thisRow.rowIndex = index;\n thisRow.gridTemplateColumns = newGridTemplateColumns;\n if (this.columnDefinitionsStale) {\n thisRow.columnDefinitions = this.columnDefinitions;\n }\n });\n this.rowindexUpdateQueued = false;\n this.columnDefinitionsStale = false;\n };\n }\n /**\n * generates a gridTemplateColumns based on columndata array\n */\n static generateTemplateColumns(columnDefinitions) {\n let templateColumns = \"\";\n columnDefinitions.forEach((column) => {\n templateColumns = `${templateColumns}${templateColumns === \"\" ? \"\" : \" \"}${\"1fr\"}`;\n });\n return templateColumns;\n }\n noTabbingChanged() {\n if (this.$fastController.isConnected) {\n if (this.noTabbing) {\n this.setAttribute(\"tabIndex\", \"-1\");\n }\n else {\n this.setAttribute(\"tabIndex\", this.contains(document.activeElement) ||\n this === document.activeElement\n ? \"-1\"\n : \"0\");\n }\n }\n }\n generateHeaderChanged() {\n if (this.$fastController.isConnected) {\n this.toggleGeneratedHeader();\n }\n }\n gridTemplateColumnsChanged() {\n if (this.$fastController.isConnected) {\n this.updateRowIndexes();\n }\n }\n rowsDataChanged() {\n if (this.columnDefinitions === null && this.rowsData.length > 0) {\n this.columnDefinitions = DataGrid.generateColumns(this.rowsData[0]);\n }\n if (this.$fastController.isConnected) {\n this.toggleGeneratedHeader();\n }\n }\n columnDefinitionsChanged() {\n if (this.columnDefinitions === null) {\n this.generatedGridTemplateColumns = \"\";\n return;\n }\n this.generatedGridTemplateColumns = DataGrid.generateTemplateColumns(this.columnDefinitions);\n if (this.$fastController.isConnected) {\n this.columnDefinitionsStale = true;\n this.queueRowIndexUpdate();\n }\n }\n headerCellItemTemplateChanged() {\n if (this.$fastController.isConnected) {\n if (this.generatedHeader !== null) {\n this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate;\n }\n }\n }\n focusRowIndexChanged() {\n if (this.$fastController.isConnected) {\n this.queueFocusUpdate();\n }\n }\n focusColumnIndexChanged() {\n if (this.$fastController.isConnected) {\n this.queueFocusUpdate();\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n if (this.rowItemTemplate === undefined) {\n this.rowItemTemplate = this.defaultRowItemTemplate;\n }\n this.rowsPlaceholder = document.createComment(\"\");\n this.appendChild(this.rowsPlaceholder);\n this.toggleGeneratedHeader();\n this.rowsRepeatBehavior = new RepeatDirective(x => x.rowsData, x => x.rowItemTemplate, { positioning: true }).createBehavior(this.rowsPlaceholder);\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n this.$fastController.addBehaviors([this.rowsRepeatBehavior]);\n this.addEventListener(\"row-focused\", this.handleRowFocus);\n this.addEventListener(eventFocus, this.handleFocus);\n this.addEventListener(eventKeyDown, this.handleKeydown);\n this.addEventListener(eventFocusOut, this.handleFocusOut);\n this.observer = new MutationObserver(this.onChildListChange);\n // only observe if nodes are added or removed\n this.observer.observe(this, { childList: true });\n if (this.noTabbing) {\n this.setAttribute(\"tabindex\", \"-1\");\n }\n DOM.queueUpdate(this.queueRowIndexUpdate);\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"row-focused\", this.handleRowFocus);\n this.removeEventListener(eventFocus, this.handleFocus);\n this.removeEventListener(eventKeyDown, this.handleKeydown);\n this.removeEventListener(eventFocusOut, this.handleFocusOut);\n // disconnect observer\n this.observer.disconnect();\n this.rowsPlaceholder = null;\n this.generatedHeader = null;\n }\n /**\n * @internal\n */\n handleRowFocus(e) {\n this.isUpdatingFocus = true;\n const focusRow = e.target;\n this.focusRowIndex = this.rowElements.indexOf(focusRow);\n this.focusColumnIndex = focusRow.focusColumnIndex;\n this.setAttribute(\"tabIndex\", \"-1\");\n this.isUpdatingFocus = false;\n }\n /**\n * @internal\n */\n handleFocus(e) {\n this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true);\n }\n /**\n * @internal\n */\n handleFocusOut(e) {\n if (e.relatedTarget === null || !this.contains(e.relatedTarget)) {\n this.setAttribute(\"tabIndex\", this.noTabbing ? \"-1\" : \"0\");\n }\n }\n /**\n * @internal\n */\n handleKeydown(e) {\n if (e.defaultPrevented) {\n return;\n }\n let newFocusRowIndex;\n const maxIndex = this.rowElements.length - 1;\n const currentGridBottom = this.offsetHeight + this.scrollTop;\n const lastRow = this.rowElements[maxIndex];\n switch (e.key) {\n case keyArrowUp:\n e.preventDefault();\n // focus up one row\n this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true);\n break;\n case keyArrowDown:\n e.preventDefault();\n // focus down one row\n this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true);\n break;\n case keyPageUp:\n e.preventDefault();\n if (this.rowElements.length === 0) {\n this.focusOnCell(0, 0, false);\n break;\n }\n if (this.focusRowIndex === 0) {\n this.focusOnCell(0, this.focusColumnIndex, false);\n return;\n }\n newFocusRowIndex = this.focusRowIndex - 1;\n for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) {\n const thisRow = this.rowElements[newFocusRowIndex];\n if (thisRow.offsetTop < this.scrollTop) {\n this.scrollTop =\n thisRow.offsetTop + thisRow.clientHeight - this.clientHeight;\n break;\n }\n }\n this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false);\n break;\n case keyPageDown:\n e.preventDefault();\n if (this.rowElements.length === 0) {\n this.focusOnCell(0, 0, false);\n break;\n }\n // focus down one \"page\"\n if (this.focusRowIndex >= maxIndex ||\n lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) {\n this.focusOnCell(maxIndex, this.focusColumnIndex, false);\n return;\n }\n newFocusRowIndex = this.focusRowIndex + 1;\n for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) {\n const thisRow = this.rowElements[newFocusRowIndex];\n if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) {\n let stickyHeaderOffset = 0;\n if (this.generateHeader === GenerateHeaderOptions.sticky &&\n this.generatedHeader !== null) {\n stickyHeaderOffset = this.generatedHeader.clientHeight;\n }\n this.scrollTop = thisRow.offsetTop - stickyHeaderOffset;\n break;\n }\n }\n this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false);\n break;\n case keyHome:\n if (e.ctrlKey) {\n e.preventDefault();\n // focus first cell of first row\n this.focusOnCell(0, 0, true);\n }\n break;\n case keyEnd:\n if (e.ctrlKey && this.columnDefinitions !== null) {\n e.preventDefault();\n // focus last cell of last row\n this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true);\n }\n break;\n }\n }\n queueFocusUpdate() {\n if (this.isUpdatingFocus &&\n (this.contains(document.activeElement) || this === document.activeElement)) {\n return;\n }\n if (this.pendingFocusUpdate === false) {\n this.pendingFocusUpdate = true;\n DOM.queueUpdate(() => this.updateFocus());\n }\n }\n updateFocus() {\n this.pendingFocusUpdate = false;\n this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true);\n }\n toggleGeneratedHeader() {\n if (this.generatedHeader !== null) {\n this.removeChild(this.generatedHeader);\n this.generatedHeader = null;\n }\n if (this.generateHeader !== GenerateHeaderOptions.none &&\n this.rowsData.length > 0) {\n const generatedHeaderElement = document.createElement(this.rowElementTag);\n this.generatedHeader = generatedHeaderElement;\n this.generatedHeader.columnDefinitions = this.columnDefinitions;\n this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns;\n this.generatedHeader.rowType =\n this.generateHeader === GenerateHeaderOptions.sticky\n ? DataGridRowTypes.stickyHeader\n : DataGridRowTypes.header;\n if (this.firstChild !== null || this.rowsPlaceholder !== null) {\n this.insertBefore(generatedHeaderElement, this.firstChild !== null ? this.firstChild : this.rowsPlaceholder);\n }\n return;\n }\n }\n}\n/**\n * generates a basic column definition by examining sample row data\n */\nDataGrid.generateColumns = (row) => {\n return Object.getOwnPropertyNames(row).map((property, index) => {\n return {\n columnDataKey: property,\n gridColumn: `${index}`,\n };\n });\n};\n__decorate([\n attr({ attribute: \"no-tabbing\", mode: \"boolean\" })\n], DataGrid.prototype, \"noTabbing\", void 0);\n__decorate([\n attr({ attribute: \"generate-header\" })\n], DataGrid.prototype, \"generateHeader\", void 0);\n__decorate([\n attr({ attribute: \"grid-template-columns\" })\n], DataGrid.prototype, \"gridTemplateColumns\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"rowsData\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"columnDefinitions\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"rowItemTemplate\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"cellItemTemplate\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"headerCellItemTemplate\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"focusRowIndex\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"focusColumnIndex\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"defaultRowItemTemplate\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"rowElementTag\", void 0);\n__decorate([\n observable\n], DataGrid.prototype, \"rowElements\", void 0);\n","import { html, repeat, when } from \"@microsoft/fast-element\";\nimport { endTemplate, startTemplate } from \"../patterns/start-end.js\";\nimport { DataGrid, DataGridCell, DataGridRow } from \"../data-grid/index.js\";\n/**\n * A basic Calendar title template that includes the month and year\n * @returns - A calendar title template\n * @public\n */\nexport const CalendarTitleTemplate = html `\n <div\n class=\"title\"\n part=\"title\"\n aria-label=\"${(x) => x.dateFormatter.getDate(`${x.month}-2-${x.year}`, {\n month: \"long\",\n year: \"numeric\",\n})}\"\n >\n <span part=\"month\">\n ${(x) => x.dateFormatter.getMonth(x.month)}\n </span>\n <span part=\"year\">${(x) => x.dateFormatter.getYear(x.year)}</span>\n </div>\n`;\n/**\n * Calendar weekday label template\n * @returns - The weekday labels template\n * @public\n */\nexport const calendarWeekdayTemplate = context => {\n const cellTag = context.tagFor(DataGridCell);\n return html `\n <${cellTag}\n class=\"week-day\"\n part=\"week-day\"\n tabindex=\"-1\"\n grid-column=\"${(x, c) => c.index + 1}\"\n abbr=\"${x => x.abbr}\"\n >\n ${x => x.text}\n </${cellTag}>\n `;\n};\n/**\n * A calendar day template\n * @param context - Element definition context for getting the cell tag for calendar-cell\n * @param todayString - A string representation for todays date\n * @returns - A calendar cell template for a given date\n * @public\n */\nexport const calendarCellTemplate = (context, todayString) => {\n const cellTag = context.tagFor(DataGridCell);\n return html `\n <${cellTag}\n class=\"${(x, c) => c.parentContext.parent.getDayClassNames(x, todayString)}\"\n part=\"day\"\n tabindex=\"-1\"\n role=\"gridcell\"\n grid-column=\"${(x, c) => c.index + 1}\"\n @click=\"${(x, c) => c.parentContext.parent.handleDateSelect(c.event, x)}\"\n @keydown=\"${(x, c) => c.parentContext.parent.handleKeydown(c.event, x)}\"\n aria-label=\"${(x, c) => c.parentContext.parent.dateFormatter.getDate(`${x.month}-${x.day}-${x.year}`, { month: \"long\", day: \"numeric\" })}\"\n >\n <div\n class=\"date\"\n part=\"${x => todayString === `${x.month}-${x.day}-${x.year}` ? \"today\" : \"date\"}\"\n >\n ${(x, c) => c.parentContext.parent.dateFormatter.getDay(x.day)}\n </div>\n <slot name=\"${x => x.month}-${x => x.day}-${x => x.year}\"></slot>\n </${cellTag}>\n `;\n};\n/**\n *\n * @param context - Element definition context for getting the cell tag for calendar-cell\n * @param todayString - A string representation for todays date\n * @returns - A template for a week of days\n * @public\n */\nexport const calendarRowTemplate = (context, todayString) => {\n const rowTag = context.tagFor(DataGridRow);\n return html `\n <${rowTag}\n class=\"week\"\n part=\"week\"\n role=\"row\"\n role-type=\"default\"\n grid-template-columns=\"1fr 1fr 1fr 1fr 1fr 1fr 1fr\"\n >\n ${repeat(x => x, calendarCellTemplate(context, todayString), {\n positioning: true,\n })}\n </${rowTag}>\n `;\n};\n/**\n * Interactive template using DataGrid\n * @param context - The templates context\n * @param todayString - string representation of todays date\n * @returns - interactive calendar template\n *\n * @internal\n */\nexport const interactiveCalendarGridTemplate = (context, todayString) => {\n const gridTag = context.tagFor(DataGrid);\n const rowTag = context.tagFor(DataGridRow);\n return html `\n <${gridTag} class=\"days interact\" part=\"days\" generate-header=\"none\">\n <${rowTag}\n class=\"week-days\"\n part=\"week-days\"\n role=\"row\"\n row-type=\"header\"\n grid-template-columns=\"1fr 1fr 1fr 1fr 1fr 1fr 1fr\"\n >\n ${repeat(x => x.getWeekdayText(), calendarWeekdayTemplate(context), {\n positioning: true,\n })}\n </${rowTag}>\n ${repeat(x => x.getDays(), calendarRowTemplate(context, todayString))}\n </${gridTag}>\n`;\n};\n/**\n * Non-interactive calendar template used for a readonly calendar\n * @param todayString - string representation of todays date\n * @returns - non-interactive calendar template\n *\n * @internal\n */\nexport const noninteractiveCalendarTemplate = (todayString) => {\n return html `\n <div class=\"days\" part=\"days\">\n <div class=\"week-days\" part=\"week-days\">\n ${repeat(x => x.getWeekdayText(), html `\n <div class=\"week-day\" part=\"week-day\" abbr=\"${x => x.abbr}\">\n ${x => x.text}\n </div>\n `)}\n </div>\n ${repeat(x => x.getDays(), html `\n <div class=\"week\">\n ${repeat(x => x, html `\n <div\n class=\"${(x, c) => c.parentContext.parent.getDayClassNames(x, todayString)}\"\n part=\"day\"\n aria-label=\"${(x, c) => c.parentContext.parent.dateFormatter.getDate(`${x.month}-${x.day}-${x.year}`, { month: \"long\", day: \"numeric\" })}\"\n >\n <div\n class=\"date\"\n part=\"${x => todayString ===\n `${x.month}-${x.day}-${x.year}`\n ? \"today\"\n : \"date\"}\"\n >\n ${(x, c) => c.parentContext.parent.dateFormatter.getDay(x.day)}\n </div>\n <slot\n name=\"${x => x.month}-${x => x.day}-${x => x.year}\"\n ></slot>\n </div>\n `)}\n </div>\n `)}\n </div>\n `;\n};\n/**\n * The template for the {@link @microsoft/fast-foundation#(Calendar:class)} component.\n *\n * @param context - Element definition context for getting the cell tag for calendar-cell\n * @param definition - Foundation element definition\n * @returns - a template for a calendar month\n * @public\n */\nexport const calendarTemplate = (context, definition) => {\n var _a;\n const today = new Date();\n const todayString = `${today.getMonth() + 1}-${today.getDate()}-${today.getFullYear()}`;\n return html `\n <template>\n ${startTemplate}\n ${definition.title instanceof Function\n ? definition.title(context, definition)\n : (_a = definition.title) !== null && _a !== void 0 ? _a : \"\"}\n <slot></slot>\n ${when(x => x.readonly === false, interactiveCalendarGridTemplate(context, todayString))}\n ${when(x => x.readonly === true, noninteractiveCalendarTemplate(todayString))}\n ${endTemplate}\n </template>\n `;\n};\n","import { html } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Card} component.\n * @public\n */\nexport const cardTemplate = (context, definition) => html `\n <slot></slot>\n`;\n","import { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * An Card Custom HTML Element.\n *\n * @slot - The default slot for the card content\n *\n * @public\n */\nexport class Card extends FoundationElement {\n}\n","import { html, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.\n * @public\n */\nexport const checkboxTemplate = (context, definition) => html `\n <template\n role=\"checkbox\"\n aria-checked=\"${x => x.checked}\"\n aria-required=\"${x => x.required}\"\n aria-disabled=\"${x => x.disabled}\"\n aria-readonly=\"${x => x.readOnly}\"\n tabindex=\"${x => (x.disabled ? null : 0)}\"\n @keypress=\"${(x, c) => x.keypressHandler(c.event)}\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n class=\"${x => (x.readOnly ? \"readonly\" : \"\")} ${x => x.checked ? \"checked\" : \"\"} ${x => (x.indeterminate ? \"indeterminate\" : \"\")}\"\n >\n <div part=\"control\" class=\"control\">\n <slot name=\"checked-indicator\">\n ${definition.checkedIndicator || \"\"}\n </slot>\n <slot name=\"indeterminate-indicator\">\n ${definition.indeterminateIndicator || \"\"}\n </slot>\n </div>\n <label\n part=\"label\"\n class=\"${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length\n ? \"label\"\n : \"label label__hidden\"}\"\n >\n <slot ${slotted(\"defaultSlottedNodes\")}></slot>\n </label>\n </template>\n`;\n","import { CheckableFormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _Checkbox extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { keySpace } from \"@microsoft/fast-web-utilities\";\nimport { FormAssociatedCheckbox } from \"./checkbox.form-associated.js\";\n/**\n * A Checkbox Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.\n *\n * @slot checked-indicator - The checked indicator\n * @slot indeterminate-indicator - The indeterminate indicator\n * @slot - The default slot for the label\n * @csspart control - The element representing the visual checkbox control\n * @csspart label - The label\n * @fires change - Emits a custom change event when the checked state changes\n *\n * @public\n */\nexport class Checkbox extends FormAssociatedCheckbox {\n constructor() {\n super();\n /**\n * The element's value to be included in form submission when checked.\n * Default to \"on\" to reach parity with input[type=\"checkbox\"]\n *\n * @internal\n */\n this.initialValue = \"on\";\n /**\n * The indeterminate state of the control\n */\n this.indeterminate = false;\n /**\n * @internal\n */\n this.keypressHandler = (e) => {\n if (this.readOnly) {\n return;\n }\n switch (e.key) {\n case keySpace:\n if (this.indeterminate) {\n this.indeterminate = false;\n }\n this.checked = !this.checked;\n break;\n }\n };\n /**\n * @internal\n */\n this.clickHandler = (e) => {\n if (!this.disabled && !this.readOnly) {\n if (this.indeterminate) {\n this.indeterminate = false;\n }\n this.checked = !this.checked;\n }\n };\n this.proxy.setAttribute(\"type\", \"checkbox\");\n }\n readOnlyChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.readOnly = this.readOnly;\n }\n }\n}\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], Checkbox.prototype, \"readOnly\", void 0);\n__decorate([\n observable\n], Checkbox.prototype, \"defaultSlottedNodes\", void 0);\n__decorate([\n observable\n], Checkbox.prototype, \"indeterminate\", void 0);\n","let uniqueIdCounter = 0;\n/**\n * Generates a unique ID based on incrementing a counter.\n */\nexport function uniqueId(prefix = \"\") {\n return `${prefix}${uniqueIdCounter++}`;\n}\n/**\n * Builds a string from a format specifier and replacement parameters.\n */\nexport function format(formatSpecifier, ...parameters) {\n return formatSpecifier.replace(/{(\\d+)}/g, function (match, index) {\n if (index >= parameters.length) {\n return match;\n }\n const value = parameters[index];\n if (typeof value !== \"number\" && !value) {\n return \"\";\n }\n return value;\n });\n}\n/**\n * Check to see if one string starts with another\n */\nexport function startsWith(stringToSearch, searchFor, position = 0) {\n if (!stringToSearch || !searchFor) {\n return false;\n }\n return stringToSearch.substr(position, searchFor.length) === searchFor;\n}\n/**\n * Determines if the specified string is undefined, null, empty, or whitespace.\n * True if the value is undefined, null, empty, or whitespace, otherwise false.\n */\nexport function isNullOrWhiteSpace(value) {\n return !value || !value.trim();\n}\n/**\n * Converts a string to Pascal Case\n * where the first letter of each compound word is capitalized.\n */\nexport function pascalCase(value) {\n let newValue = `${value}`\n .replace(new RegExp(/[-_]+/, \"g\"), \" \")\n .replace(new RegExp(/[^\\w\\s]/, \"g\"), \"\")\n .replace(/^\\s+|\\s+$|\\s+(?=\\s)/g, \"\")\n .replace(new RegExp(/\\s+(.)(\\w*)/, \"g\"), ($1, $2, $3) => `${$2.toUpperCase() + $3.toLowerCase()}`)\n .replace(new RegExp(/\\w/), s => s.toUpperCase());\n let firstLowerIdx = 0;\n for (let i = 0; i < newValue.length; i++) {\n const currChar = newValue.charAt(i);\n if (currChar == currChar.toLowerCase()) {\n firstLowerIdx = i;\n break;\n }\n }\n if (firstLowerIdx > 1) {\n newValue =\n `${newValue.charAt(0).toUpperCase()}${newValue\n .slice(1, firstLowerIdx - 1)\n .toLowerCase()}` + newValue.slice(firstLowerIdx - 1);\n }\n return newValue;\n}\n/**\n * converts a string from camelCase or pascalCase to spinal-case\n * which is an lowercase dash separated naming style.\n *\n * An example of spinal case: foo-bar-bat\n */\nexport function spinalCase(value) {\n const valueWithLowerCaseFirstLetter = `${value\n .charAt(0)\n .toLowerCase()}${value.slice(1)}`;\n return valueWithLowerCaseFirstLetter.replace(/([A-Z]|[0-9])/g, function (match, group1) {\n return `-${group1.toLowerCase()}`;\n });\n}\n","import { canUseDOM } from \"exenv-es6\";\n/**\n * A test that ensures that all arguments are HTML Elements\n */\nexport function isHTMLElement(...args) {\n return args.every((arg) => arg instanceof HTMLElement);\n}\n/**\n * Returns all displayed elements inside of a root node that match a provided selector\n */\nexport function getDisplayedNodes(rootNode, selector) {\n if (!rootNode || !selector || !isHTMLElement(rootNode)) {\n return;\n }\n const nodes = Array.from(rootNode.querySelectorAll(selector));\n // offsetParent will be null if the element isn't currently displayed,\n // so this will allow us to operate only on visible nodes\n return nodes.filter((node) => node.offsetParent !== null);\n}\n/**\n * Gets the numeric key code associated with a keyboard event. This method is for use with DOM level 3 events\n * that still use the deprecated keyCode property.\n */\nexport function getKeyCode(event) {\n return event === null ? null : event.which || event.keyCode || event.charCode;\n}\n/**\n * Returns the nonce used in the page, if any.\n *\n * Based on https://github.com/cssinjs/jss/blob/master/packages/jss/src/DomRenderer.js\n */\nfunction getNonce() {\n const node = document.querySelector('meta[property=\"csp-nonce\"]');\n if (node) {\n return node.getAttribute(\"content\");\n }\n else {\n return null;\n }\n}\n/**\n * Test if the document supports :focus-visible\n */\nlet _canUseFocusVisible;\nexport function canUseFocusVisible() {\n if (typeof _canUseFocusVisible === \"boolean\") {\n return _canUseFocusVisible;\n }\n if (!canUseDOM()) {\n _canUseFocusVisible = false;\n return _canUseFocusVisible;\n }\n // Check to see if the document supports the focus-visible element\n const styleElement = document.createElement(\"style\");\n // If nonces are present on the page, use it when creating the style element\n // to test focus-visible support.\n const styleNonce = getNonce();\n if (styleNonce !== null) {\n styleElement.setAttribute(\"nonce\", styleNonce);\n }\n document.head.appendChild(styleElement);\n try {\n styleElement.sheet.insertRule(\"foo:focus-visible {color:inherit}\", 0);\n _canUseFocusVisible = true;\n }\n catch (e) {\n _canUseFocusVisible = false;\n }\n finally {\n document.head.removeChild(styleElement);\n }\n return _canUseFocusVisible;\n}\nlet _canUseCssGrid;\nexport function canUseCssGrid() {\n if (typeof _canUseCssGrid === \"boolean\") {\n return _canUseCssGrid;\n }\n try {\n _canUseCssGrid = CSS.supports(\"display\", \"grid\");\n }\n catch (_a) {\n _canUseCssGrid = false;\n }\n return _canUseCssGrid;\n}\nexport function canUseForcedColors() {\n return (canUseDOM() &&\n (window.matchMedia(\"(forced-colors: none)\").matches ||\n window.matchMedia(\"(forced-colors: active)\").matches));\n}\nexport function resetDocumentCache() {\n _canUseCssGrid = undefined;\n _canUseFocusVisible = undefined;\n}\n/**\n * @deprecated Use 'canUseForcedColors' instead\n */\nexport const canUsedForcedColors = canUseForcedColors;\n","import { __decorate } from \"tslib\";\nimport { attr, observable, Observable } from \"@microsoft/fast-element\";\nimport { isHTMLElement } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { ARIAGlobalStatesAndProperties } from \"../patterns/aria-global.js\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\n/**\n * Determines if the element is a {@link (ListboxOption:class)}\n *\n * @param element - the element to test.\n * @public\n */\nexport function isListboxOption(el) {\n return (isHTMLElement(el) &&\n (el.getAttribute(\"role\") === \"option\" ||\n el instanceof HTMLOptionElement));\n}\n/**\n * An Option Custom HTML Element.\n * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.\n *\n * @slot start - Content which can be provided before the listbox option content\n * @slot end - Content which can be provided after the listbox option content\n * @slot - The default slot for listbox option content\n * @csspart content - Wraps the listbox option content\n *\n * @public\n */\nexport class ListboxOption extends FoundationElement {\n constructor(text, value, defaultSelected, selected) {\n super();\n /**\n * The defaultSelected state of the option.\n * @public\n */\n this.defaultSelected = false;\n /**\n * Tracks whether the \"selected\" property has been changed.\n * @internal\n */\n this.dirtySelected = false;\n /**\n * The checked state of the control.\n *\n * @public\n */\n this.selected = this.defaultSelected;\n /**\n * Track whether the value has been changed from the initial value\n */\n this.dirtyValue = false;\n if (text) {\n this.textContent = text;\n }\n if (value) {\n this.initialValue = value;\n }\n if (defaultSelected) {\n this.defaultSelected = defaultSelected;\n }\n if (selected) {\n this.selected = selected;\n }\n this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected);\n this.proxy.disabled = this.disabled;\n }\n /**\n * Updates the ariaChecked property when the checked property changes.\n *\n * @param prev - the previous checked value\n * @param next - the current checked value\n *\n * @public\n */\n checkedChanged(prev, next) {\n if (typeof next === \"boolean\") {\n this.ariaChecked = next ? \"true\" : \"false\";\n return;\n }\n this.ariaChecked = null;\n }\n /**\n * Updates the proxy's text content when the default slot changes.\n * @param prev - the previous content value\n * @param next - the current content value\n *\n * @internal\n */\n contentChanged(prev, next) {\n if (this.proxy instanceof HTMLOptionElement) {\n this.proxy.textContent = this.textContent;\n }\n this.$emit(\"contentchange\", null, { bubbles: true });\n }\n defaultSelectedChanged() {\n if (!this.dirtySelected) {\n this.selected = this.defaultSelected;\n if (this.proxy instanceof HTMLOptionElement) {\n this.proxy.selected = this.defaultSelected;\n }\n }\n }\n disabledChanged(prev, next) {\n this.ariaDisabled = this.disabled ? \"true\" : \"false\";\n if (this.proxy instanceof HTMLOptionElement) {\n this.proxy.disabled = this.disabled;\n }\n }\n selectedAttributeChanged() {\n this.defaultSelected = this.selectedAttribute;\n if (this.proxy instanceof HTMLOptionElement) {\n this.proxy.defaultSelected = this.defaultSelected;\n }\n }\n selectedChanged() {\n this.ariaSelected = this.selected ? \"true\" : \"false\";\n if (!this.dirtySelected) {\n this.dirtySelected = true;\n }\n if (this.proxy instanceof HTMLOptionElement) {\n this.proxy.selected = this.selected;\n }\n }\n initialValueChanged(previous, next) {\n // If the value is clean and the component is connected to the DOM\n // then set value equal to the attribute value.\n if (!this.dirtyValue) {\n this.value = this.initialValue;\n this.dirtyValue = false;\n }\n }\n get label() {\n var _a;\n return (_a = this.value) !== null && _a !== void 0 ? _a : this.text;\n }\n get text() {\n var _a, _b;\n return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\\s+/g, \" \").trim()) !== null && _b !== void 0 ? _b : \"\";\n }\n set value(next) {\n const newValue = `${next !== null && next !== void 0 ? next : \"\"}`;\n this._value = newValue;\n this.dirtyValue = true;\n if (this.proxy instanceof HTMLOptionElement) {\n this.proxy.value = newValue;\n }\n Observable.notify(this, \"value\");\n }\n get value() {\n var _a;\n Observable.track(this, \"value\");\n return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;\n }\n get form() {\n return this.proxy ? this.proxy.form : null;\n }\n}\n__decorate([\n observable\n], ListboxOption.prototype, \"checked\", void 0);\n__decorate([\n observable\n], ListboxOption.prototype, \"content\", void 0);\n__decorate([\n observable\n], ListboxOption.prototype, \"defaultSelected\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], ListboxOption.prototype, \"disabled\", void 0);\n__decorate([\n attr({ attribute: \"selected\", mode: \"boolean\" })\n], ListboxOption.prototype, \"selectedAttribute\", void 0);\n__decorate([\n observable\n], ListboxOption.prototype, \"selected\", void 0);\n__decorate([\n attr({ attribute: \"value\", mode: \"fromView\" })\n], ListboxOption.prototype, \"initialValue\", void 0);\n/**\n * States and properties relating to the ARIA `option` role.\n *\n * @public\n */\nexport class DelegatesARIAListboxOption {\n}\n__decorate([\n observable\n], DelegatesARIAListboxOption.prototype, \"ariaChecked\", void 0);\n__decorate([\n observable\n], DelegatesARIAListboxOption.prototype, \"ariaPosInSet\", void 0);\n__decorate([\n observable\n], DelegatesARIAListboxOption.prototype, \"ariaSelected\", void 0);\n__decorate([\n observable\n], DelegatesARIAListboxOption.prototype, \"ariaSetSize\", void 0);\napplyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties);\napplyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption);\n","import { __decorate } from \"tslib\";\nimport { attr, observable, Observable } from \"@microsoft/fast-element\";\nimport { findLastIndex, keyArrowDown, keyArrowUp, keyEnd, keyEnter, keyEscape, keyHome, keySpace, keyTab, uniqueId, } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { isListboxOption } from \"../listbox-option/listbox-option.js\";\nimport { ARIAGlobalStatesAndProperties } from \"../patterns/aria-global.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\n/**\n * A Listbox Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#listbox | ARIA listbox }.\n *\n * @slot - The default slot for the listbox options\n *\n * @public\n */\nexport class Listbox extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The internal unfiltered list of selectable options.\n *\n * @internal\n */\n this._options = [];\n /**\n * The index of the selected option.\n *\n * @public\n */\n this.selectedIndex = -1;\n /**\n * A collection of the selected options.\n *\n * @public\n */\n this.selectedOptions = [];\n /**\n * A standard `click` event creates a `focus` event before firing, so a\n * `mousedown` event is used to skip that initial focus.\n *\n * @internal\n */\n this.shouldSkipFocus = false;\n /**\n * The current typeahead buffer string.\n *\n * @internal\n */\n this.typeaheadBuffer = \"\";\n /**\n * Flag for the typeahead timeout expiration.\n *\n * @internal\n */\n this.typeaheadExpired = true;\n /**\n * The timeout ID for the typeahead handler.\n *\n * @internal\n */\n this.typeaheadTimeout = -1;\n }\n /**\n * The first selected option.\n *\n * @internal\n */\n get firstSelectedOption() {\n var _a;\n return (_a = this.selectedOptions[0]) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Returns true if there is one or more selectable option.\n *\n * @internal\n */\n get hasSelectableOptions() {\n return this.options.length > 0 && !this.options.every(o => o.disabled);\n }\n /**\n * The number of options.\n *\n * @public\n */\n get length() {\n var _a, _b;\n return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n }\n /**\n * The list of options.\n *\n * @public\n */\n get options() {\n Observable.track(this, \"options\");\n return this._options;\n }\n set options(value) {\n this._options = value;\n Observable.notify(this, \"options\");\n }\n /**\n * Flag for the typeahead timeout expiration.\n *\n * @deprecated use `Listbox.typeaheadExpired`\n * @internal\n */\n get typeAheadExpired() {\n return this.typeaheadExpired;\n }\n set typeAheadExpired(value) {\n this.typeaheadExpired = value;\n }\n /**\n * Handle click events for listbox options.\n *\n * @internal\n */\n clickHandler(e) {\n const captured = e.target.closest(`option,[role=option]`);\n if (captured && !captured.disabled) {\n this.selectedIndex = this.options.indexOf(captured);\n return true;\n }\n }\n /**\n * Ensures that the provided option is focused and scrolled into view.\n *\n * @param optionToFocus - The option to focus\n * @internal\n */\n focusAndScrollOptionIntoView(optionToFocus = this.firstSelectedOption) {\n // To ensure that the browser handles both `focus()` and `scrollIntoView()`, the\n // timing here needs to guarantee that they happen on different frames. Since this\n // function is typically called from the `openChanged` observer, `DOM.queueUpdate`\n // causes the calls to be grouped into the same frame. To prevent this,\n // `requestAnimationFrame` is used instead of `DOM.queueUpdate`.\n if (this.contains(document.activeElement) && optionToFocus !== null) {\n optionToFocus.focus();\n requestAnimationFrame(() => {\n optionToFocus.scrollIntoView({ block: \"nearest\" });\n });\n }\n }\n /**\n * Handles `focusin` actions for the component. When the component receives focus,\n * the list of selected options is refreshed and the first selected option is scrolled\n * into view.\n *\n * @internal\n */\n focusinHandler(e) {\n if (!this.shouldSkipFocus && e.target === e.currentTarget) {\n this.setSelectedOptions();\n this.focusAndScrollOptionIntoView();\n }\n this.shouldSkipFocus = false;\n }\n /**\n * Returns the options which match the current typeahead buffer.\n *\n * @internal\n */\n getTypeaheadMatches() {\n const pattern = this.typeaheadBuffer.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const re = new RegExp(`^${pattern}`, \"gi\");\n return this.options.filter((o) => o.text.trim().match(re));\n }\n /**\n * Determines the index of the next option which is selectable, if any.\n *\n * @param prev - the previous selected index\n * @param next - the next index to select\n *\n * @internal\n */\n getSelectableIndex(prev = this.selectedIndex, next) {\n const direction = prev > next ? -1 : prev < next ? 1 : 0;\n const potentialDirection = prev + direction;\n let nextSelectableOption = null;\n switch (direction) {\n case -1: {\n nextSelectableOption = this.options.reduceRight((nextSelectableOption, thisOption, index) => !nextSelectableOption &&\n !thisOption.disabled &&\n index < potentialDirection\n ? thisOption\n : nextSelectableOption, nextSelectableOption);\n break;\n }\n case 1: {\n nextSelectableOption = this.options.reduce((nextSelectableOption, thisOption, index) => !nextSelectableOption &&\n !thisOption.disabled &&\n index > potentialDirection\n ? thisOption\n : nextSelectableOption, nextSelectableOption);\n break;\n }\n }\n return this.options.indexOf(nextSelectableOption);\n }\n /**\n * Handles external changes to child options.\n *\n * @param source - the source object\n * @param propertyName - the property\n *\n * @internal\n */\n handleChange(source, propertyName) {\n switch (propertyName) {\n case \"selected\": {\n if (Listbox.slottedOptionFilter(source)) {\n this.selectedIndex = this.options.indexOf(source);\n }\n this.setSelectedOptions();\n break;\n }\n }\n }\n /**\n * Moves focus to an option whose label matches characters typed by the user.\n * Consecutive keystrokes are batched into a buffer of search text used\n * to match against the set of options. If `TYPE_AHEAD_TIMEOUT_MS` passes\n * between consecutive keystrokes, the search restarts.\n *\n * @param key - the key to be evaluated\n *\n * @internal\n */\n handleTypeAhead(key) {\n if (this.typeaheadTimeout) {\n window.clearTimeout(this.typeaheadTimeout);\n }\n this.typeaheadTimeout = window.setTimeout(() => (this.typeaheadExpired = true), Listbox.TYPE_AHEAD_TIMEOUT_MS);\n if (key.length > 1) {\n return;\n }\n this.typeaheadBuffer = `${this.typeaheadExpired ? \"\" : this.typeaheadBuffer}${key}`;\n }\n /**\n * Handles `keydown` actions for listbox navigation and typeahead.\n *\n * @internal\n */\n keydownHandler(e) {\n if (this.disabled) {\n return true;\n }\n this.shouldSkipFocus = false;\n const key = e.key;\n switch (key) {\n // Select the first available option\n case keyHome: {\n if (!e.shiftKey) {\n e.preventDefault();\n this.selectFirstOption();\n }\n break;\n }\n // Select the next selectable option\n case keyArrowDown: {\n if (!e.shiftKey) {\n e.preventDefault();\n this.selectNextOption();\n }\n break;\n }\n // Select the previous selectable option\n case keyArrowUp: {\n if (!e.shiftKey) {\n e.preventDefault();\n this.selectPreviousOption();\n }\n break;\n }\n // Select the last available option\n case keyEnd: {\n e.preventDefault();\n this.selectLastOption();\n break;\n }\n case keyTab: {\n this.focusAndScrollOptionIntoView();\n return true;\n }\n case keyEnter:\n case keyEscape: {\n return true;\n }\n case keySpace: {\n if (this.typeaheadExpired) {\n return true;\n }\n }\n // Send key to Typeahead handler\n default: {\n if (key.length === 1) {\n this.handleTypeAhead(`${key}`);\n }\n return true;\n }\n }\n }\n /**\n * Prevents `focusin` events from firing before `click` events when the\n * element is unfocused.\n *\n * @internal\n */\n mousedownHandler(e) {\n this.shouldSkipFocus = !this.contains(document.activeElement);\n return true;\n }\n /**\n * Switches between single-selection and multi-selection mode.\n *\n * @param prev - the previous value of the `multiple` attribute\n * @param next - the next value of the `multiple` attribute\n *\n * @internal\n */\n multipleChanged(prev, next) {\n this.ariaMultiSelectable = next ? \"true\" : null;\n }\n /**\n * Updates the list of selected options when the `selectedIndex` changes.\n *\n * @param prev - the previous selected index value\n * @param next - the current selected index value\n *\n * @internal\n */\n selectedIndexChanged(prev, next) {\n var _a;\n if (!this.hasSelectableOptions) {\n this.selectedIndex = -1;\n return;\n }\n if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === \"number\") {\n const selectableIndex = this.getSelectableIndex(prev, next);\n const newNext = selectableIndex > -1 ? selectableIndex : prev;\n this.selectedIndex = newNext;\n if (next === newNext) {\n this.selectedIndexChanged(next, newNext);\n }\n return;\n }\n this.setSelectedOptions();\n }\n /**\n * Updates the selectedness of each option when the list of selected options changes.\n *\n * @param prev - the previous list of selected options\n * @param next - the current list of selected options\n *\n * @internal\n */\n selectedOptionsChanged(prev, next) {\n var _a;\n const filteredNext = next.filter(Listbox.slottedOptionFilter);\n (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.unsubscribe(this, \"selected\");\n o.selected = filteredNext.includes(o);\n notifier.subscribe(this, \"selected\");\n });\n }\n /**\n * Moves focus to the first selectable option.\n *\n * @public\n */\n selectFirstOption() {\n var _a, _b;\n if (!this.disabled) {\n this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex(o => !o.disabled)) !== null && _b !== void 0 ? _b : -1;\n }\n }\n /**\n * Moves focus to the last selectable option.\n *\n * @internal\n */\n selectLastOption() {\n if (!this.disabled) {\n this.selectedIndex = findLastIndex(this.options, o => !o.disabled);\n }\n }\n /**\n * Moves focus to the next selectable option.\n *\n * @internal\n */\n selectNextOption() {\n if (!this.disabled && this.selectedIndex < this.options.length - 1) {\n this.selectedIndex += 1;\n }\n }\n /**\n * Moves focus to the previous selectable option.\n *\n * @internal\n */\n selectPreviousOption() {\n if (!this.disabled && this.selectedIndex > 0) {\n this.selectedIndex = this.selectedIndex - 1;\n }\n }\n /**\n * Updates the selected index to match the first selected option.\n *\n * @internal\n */\n setDefaultSelectedOption() {\n var _a, _b;\n this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex(el => el.defaultSelected)) !== null && _b !== void 0 ? _b : -1;\n }\n /**\n * Sets an option as selected and gives it focus.\n *\n * @public\n */\n setSelectedOptions() {\n var _a, _b, _c;\n if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) {\n this.selectedOptions = [this.options[this.selectedIndex]];\n this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : \"\";\n this.focusAndScrollOptionIntoView();\n }\n }\n /**\n * Updates the list of options and resets the selected option when the slotted option content changes.\n *\n * @param prev - the previous list of slotted options\n * @param next - the current list of slotted options\n *\n * @internal\n */\n slottedOptionsChanged(prev, next) {\n this.options = next.reduce((options, item) => {\n if (isListboxOption(item)) {\n options.push(item);\n }\n return options;\n }, []);\n const setSize = `${this.options.length}`;\n this.options.forEach((option, index) => {\n if (!option.id) {\n option.id = uniqueId(\"option-\");\n }\n option.ariaPosInSet = `${index + 1}`;\n option.ariaSetSize = setSize;\n });\n if (this.$fastController.isConnected) {\n this.setSelectedOptions();\n this.setDefaultSelectedOption();\n }\n }\n /**\n * Updates the filtered list of options when the typeahead buffer changes.\n *\n * @param prev - the previous typeahead buffer value\n * @param next - the current typeahead buffer value\n *\n * @internal\n */\n typeaheadBufferChanged(prev, next) {\n if (this.$fastController.isConnected) {\n const typeaheadMatches = this.getTypeaheadMatches();\n if (typeaheadMatches.length) {\n const selectedIndex = this.options.indexOf(typeaheadMatches[0]);\n if (selectedIndex > -1) {\n this.selectedIndex = selectedIndex;\n }\n }\n this.typeaheadExpired = false;\n }\n }\n}\n/**\n * A static filter to include only selectable options.\n *\n * @param n - element to filter\n * @public\n */\nListbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden;\n/**\n * Typeahead timeout in milliseconds.\n *\n * @internal\n */\nListbox.TYPE_AHEAD_TIMEOUT_MS = 1000;\n__decorate([\n attr({ mode: \"boolean\" })\n], Listbox.prototype, \"disabled\", void 0);\n__decorate([\n observable\n], Listbox.prototype, \"selectedIndex\", void 0);\n__decorate([\n observable\n], Listbox.prototype, \"selectedOptions\", void 0);\n__decorate([\n observable\n], Listbox.prototype, \"slottedOptions\", void 0);\n__decorate([\n observable\n], Listbox.prototype, \"typeaheadBuffer\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA listbox role\n *\n * @public\n */\nexport class DelegatesARIAListbox {\n}\n__decorate([\n observable\n], DelegatesARIAListbox.prototype, \"ariaActiveDescendant\", void 0);\n__decorate([\n observable\n], DelegatesARIAListbox.prototype, \"ariaDisabled\", void 0);\n__decorate([\n observable\n], DelegatesARIAListbox.prototype, \"ariaExpanded\", void 0);\n__decorate([\n observable\n], DelegatesARIAListbox.prototype, \"ariaMultiSelectable\", void 0);\napplyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties);\napplyMixins(Listbox, DelegatesARIAListbox);\n","/**\n * Returns the index of the last element in the array where predicate is true, and -1 otherwise.\n *\n * @param array - the array to test\n * @param predicate - find calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findIndex returns -1.\n */\nexport function findLastIndex(array, predicate) {\n let k = array.length;\n while (k--) {\n if (predicate(array[k], k, array)) {\n return k;\n }\n }\n return -1;\n}\n","/**\n * Positioning directions for the listbox when a select is open.\n * @public\n */\nexport const SelectPosition = {\n above: \"above\",\n below: \"below\",\n};\n","import { FormAssociated } from \"../form-associated/form-associated.js\";\nimport { Listbox } from \"../listbox/listbox.js\";\nclass _Combobox extends Listbox {\n}\n/**\n * A form-associated base class for the {@link (Combobox:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedCombobox extends FormAssociated(_Combobox) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","/**\n * Autocomplete values for combobox.\n * @public\n */\nexport const ComboboxAutocomplete = {\n inline: \"inline\",\n list: \"list\",\n both: \"both\",\n none: \"none\",\n};\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, Observable, observable } from \"@microsoft/fast-element\";\nimport { limit, uniqueId } from \"@microsoft/fast-web-utilities\";\nimport { DelegatesARIAListbox } from \"../listbox/listbox.js\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { SelectPosition } from \"../select/select.options.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { FormAssociatedCombobox } from \"./combobox.form-associated.js\";\nimport { ComboboxAutocomplete } from \"./combobox.options.js\";\n/**\n * A Combobox Custom HTML Element.\n * Implements the {@link https://w3c.github.io/aria-practices/#combobox | ARIA combobox }.\n *\n * @slot start - Content which can be provided before the input\n * @slot end - Content which can be provided after the input\n * @slot control - Used to replace the input element representing the combobox\n * @slot indicator - The visual indicator representing the expanded state\n * @slot - The default slot for the options\n * @csspart control - The wrapper element containing the input area, including start and end\n * @csspart selected-value - The input element representing the selected value\n * @csspart indicator - The element wrapping the indicator slot\n * @csspart listbox - The wrapper for the listbox slotted options\n * @fires change - Fires a custom 'change' event when the value updates\n *\n * @public\n */\nexport class Combobox extends FormAssociatedCombobox {\n constructor() {\n super(...arguments);\n /**\n * The internal value property.\n *\n * @internal\n */\n this._value = \"\";\n /**\n * The collection of currently filtered options.\n *\n * @public\n */\n this.filteredOptions = [];\n /**\n * The current filter value.\n *\n * @internal\n */\n this.filter = \"\";\n /**\n * The initial state of the position attribute.\n *\n * @internal\n */\n this.forcedPosition = false;\n /**\n * The unique id for the internal listbox element.\n *\n * @internal\n */\n this.listboxId = uniqueId(\"listbox-\");\n /**\n * The max height for the listbox when opened.\n *\n * @internal\n */\n this.maxHeight = 0;\n /**\n * The open attribute.\n *\n * @public\n * @remarks\n * HTML Attribute: open\n */\n this.open = false;\n }\n /**\n * Reset the element to its first selectable option when its parent form is reset.\n *\n * @internal\n */\n formResetCallback() {\n super.formResetCallback();\n this.setDefaultSelectedOption();\n this.updateValue();\n }\n /** {@inheritDoc (FormAssociated:interface).validate} */\n validate() {\n super.validate(this.control);\n }\n get isAutocompleteInline() {\n return (this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth);\n }\n get isAutocompleteList() {\n return this.autocomplete === ComboboxAutocomplete.list || this.isAutocompleteBoth;\n }\n get isAutocompleteBoth() {\n return this.autocomplete === ComboboxAutocomplete.both;\n }\n /**\n * Sets focus and synchronize ARIA attributes when the open property changes.\n *\n * @param prev - the previous open value\n * @param next - the current open value\n *\n * @internal\n */\n openChanged() {\n if (this.open) {\n this.ariaControls = this.listboxId;\n this.ariaExpanded = \"true\";\n this.setPositioning();\n this.focusAndScrollOptionIntoView();\n // focus is directed to the element when `open` is changed programmatically\n DOM.queueUpdate(() => this.focus());\n return;\n }\n this.ariaControls = \"\";\n this.ariaExpanded = \"false\";\n }\n /**\n * The list of options.\n *\n * @public\n * @remarks\n * Overrides `Listbox.options`.\n */\n get options() {\n Observable.track(this, \"options\");\n return this.filteredOptions.length ? this.filteredOptions : this._options;\n }\n set options(value) {\n this._options = value;\n Observable.notify(this, \"options\");\n }\n /**\n * Updates the placeholder on the proxy element.\n * @internal\n */\n placeholderChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.placeholder = this.placeholder;\n }\n }\n positionChanged(prev, next) {\n this.positionAttribute = next;\n this.setPositioning();\n }\n /**\n * The value property.\n *\n * @public\n */\n get value() {\n Observable.track(this, \"value\");\n return this._value;\n }\n set value(next) {\n var _a, _b, _c;\n const prev = `${this._value}`;\n if (this.$fastController.isConnected && this.options) {\n const selectedIndex = this.options.findIndex(el => el.text.toLowerCase() === next.toLowerCase());\n const prevSelectedValue = (_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.text;\n const nextSelectedValue = (_b = this.options[selectedIndex]) === null || _b === void 0 ? void 0 : _b.text;\n this.selectedIndex =\n prevSelectedValue !== nextSelectedValue\n ? selectedIndex\n : this.selectedIndex;\n next = ((_c = this.firstSelectedOption) === null || _c === void 0 ? void 0 : _c.text) || next;\n }\n if (prev !== next) {\n this._value = next;\n super.valueChanged(prev, next);\n Observable.notify(this, \"value\");\n }\n }\n /**\n * Handle opening and closing the listbox when the combobox is clicked.\n *\n * @param e - the mouse event\n * @internal\n */\n clickHandler(e) {\n if (this.disabled) {\n return;\n }\n if (this.open) {\n const captured = e.target.closest(`option,[role=option]`);\n if (!captured || captured.disabled) {\n return;\n }\n this.selectedOptions = [captured];\n this.control.value = captured.text;\n this.clearSelectionRange();\n this.updateValue(true);\n }\n this.open = !this.open;\n if (this.open) {\n this.control.focus();\n }\n return true;\n }\n connectedCallback() {\n super.connectedCallback();\n this.forcedPosition = !!this.positionAttribute;\n if (this.value) {\n this.initialValue = this.value;\n }\n }\n /**\n * Synchronize the `aria-disabled` property when the `disabled` property changes.\n *\n * @param prev - The previous disabled value\n * @param next - The next disabled value\n *\n * @internal\n */\n disabledChanged(prev, next) {\n if (super.disabledChanged) {\n super.disabledChanged(prev, next);\n }\n this.ariaDisabled = this.disabled ? \"true\" : \"false\";\n }\n /**\n * Filter available options by text value.\n *\n * @public\n */\n filterOptions() {\n if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) {\n this.filter = \"\";\n }\n const filter = this.filter.toLowerCase();\n this.filteredOptions = this._options.filter(o => o.text.toLowerCase().startsWith(this.filter.toLowerCase()));\n if (this.isAutocompleteList) {\n if (!this.filteredOptions.length && !filter) {\n this.filteredOptions = this._options;\n }\n this._options.forEach(o => {\n o.hidden = !this.filteredOptions.includes(o);\n });\n }\n }\n /**\n * Focus the control and scroll the first selected option into view.\n *\n * @internal\n * @remarks\n * Overrides: `Listbox.focusAndScrollOptionIntoView`\n */\n focusAndScrollOptionIntoView() {\n if (this.contains(document.activeElement)) {\n this.control.focus();\n if (this.firstSelectedOption) {\n requestAnimationFrame(() => {\n var _a;\n (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: \"nearest\" });\n });\n }\n }\n }\n /**\n * Handle focus state when the element or its children lose focus.\n *\n * @param e - The focus event\n * @internal\n */\n focusoutHandler(e) {\n this.syncValue();\n if (!this.open) {\n return true;\n }\n const focusTarget = e.relatedTarget;\n if (this.isSameNode(focusTarget)) {\n this.focus();\n return;\n }\n if (!this.options || !this.options.includes(focusTarget)) {\n this.open = false;\n }\n }\n /**\n * Handle content changes on the control input.\n *\n * @param e - the input event\n * @internal\n */\n inputHandler(e) {\n this.filter = this.control.value;\n this.filterOptions();\n if (!this.isAutocompleteInline) {\n this.selectedIndex = this.options\n .map(option => option.text)\n .indexOf(this.control.value);\n }\n if (e.inputType.includes(\"deleteContent\") || !this.filter.length) {\n return true;\n }\n if (this.isAutocompleteList && !this.open) {\n this.open = true;\n }\n if (this.isAutocompleteInline) {\n if (this.filteredOptions.length) {\n this.selectedOptions = [this.filteredOptions[0]];\n this.selectedIndex = this.options.indexOf(this.firstSelectedOption);\n this.setInlineSelection();\n }\n else {\n this.selectedIndex = -1;\n }\n }\n return;\n }\n /**\n * Handle keydown actions for listbox navigation.\n *\n * @param e - the keyboard event\n * @internal\n */\n keydownHandler(e) {\n const key = e.key;\n if (e.ctrlKey || e.shiftKey) {\n return true;\n }\n switch (key) {\n case \"Enter\": {\n this.syncValue();\n if (this.isAutocompleteInline) {\n this.filter = this.value;\n }\n this.open = false;\n this.clearSelectionRange();\n break;\n }\n case \"Escape\": {\n if (!this.isAutocompleteInline) {\n this.selectedIndex = -1;\n }\n if (this.open) {\n this.open = false;\n break;\n }\n this.value = \"\";\n this.control.value = \"\";\n this.filter = \"\";\n this.filterOptions();\n break;\n }\n case \"Tab\": {\n this.setInputToSelection();\n if (!this.open) {\n return true;\n }\n e.preventDefault();\n this.open = false;\n break;\n }\n case \"ArrowUp\":\n case \"ArrowDown\": {\n this.filterOptions();\n if (!this.open) {\n this.open = true;\n break;\n }\n if (this.filteredOptions.length > 0) {\n super.keydownHandler(e);\n }\n if (this.isAutocompleteInline) {\n this.setInlineSelection();\n }\n break;\n }\n default: {\n return true;\n }\n }\n }\n /**\n * Handle keyup actions for value input and text field manipulations.\n *\n * @param e - the keyboard event\n * @internal\n */\n keyupHandler(e) {\n const key = e.key;\n switch (key) {\n case \"ArrowLeft\":\n case \"ArrowRight\":\n case \"Backspace\":\n case \"Delete\":\n case \"Home\":\n case \"End\": {\n this.filter = this.control.value;\n this.selectedIndex = -1;\n this.filterOptions();\n break;\n }\n }\n }\n /**\n * Ensure that the selectedIndex is within the current allowable filtered range.\n *\n * @param prev - the previous selected index value\n * @param next - the current selected index value\n *\n * @internal\n */\n selectedIndexChanged(prev, next) {\n if (this.$fastController.isConnected) {\n next = limit(-1, this.options.length - 1, next);\n // we only want to call the super method when the selectedIndex is in range\n if (next !== this.selectedIndex) {\n this.selectedIndex = next;\n return;\n }\n super.selectedIndexChanged(prev, next);\n }\n }\n /**\n * Move focus to the previous selectable option.\n *\n * @internal\n * @remarks\n * Overrides `Listbox.selectPreviousOption`\n */\n selectPreviousOption() {\n if (!this.disabled && this.selectedIndex >= 0) {\n this.selectedIndex = this.selectedIndex - 1;\n }\n }\n /**\n * Set the default selected options at initialization or reset.\n *\n * @internal\n * @remarks\n * Overrides `Listbox.setDefaultSelectedOption`\n */\n setDefaultSelectedOption() {\n if (this.$fastController.isConnected && this.options) {\n const selectedIndex = this.options.findIndex(el => el.getAttribute(\"selected\") !== null || el.selected);\n this.selectedIndex = selectedIndex;\n if (!this.dirtyValue && this.firstSelectedOption) {\n this.value = this.firstSelectedOption.text;\n }\n this.setSelectedOptions();\n }\n }\n /**\n * Focus and set the content of the control based on the first selected option.\n *\n * @internal\n */\n setInputToSelection() {\n if (this.firstSelectedOption) {\n this.control.value = this.firstSelectedOption.text;\n this.control.focus();\n }\n }\n /**\n * Focus, set and select the content of the control based on the first selected option.\n *\n * @internal\n */\n setInlineSelection() {\n if (this.firstSelectedOption) {\n this.setInputToSelection();\n this.control.setSelectionRange(this.filter.length, this.control.value.length, \"backward\");\n }\n }\n /**\n * Determines if a value update should involve emitting a change event, then updates the value.\n *\n * @internal\n */\n syncValue() {\n var _a;\n const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value;\n this.updateValue(this.value !== newValue);\n }\n /**\n * Calculate and apply listbox positioning based on available viewport space.\n *\n * @param force - direction to force the listbox to display\n * @public\n */\n setPositioning() {\n const currentBox = this.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const availableBottom = viewportHeight - currentBox.bottom;\n this.position = this.forcedPosition\n ? this.positionAttribute\n : currentBox.top > availableBottom\n ? SelectPosition.above\n : SelectPosition.below;\n this.positionAttribute = this.forcedPosition\n ? this.positionAttribute\n : this.position;\n this.maxHeight =\n this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom;\n }\n /**\n * Ensure that the entire list of options is used when setting the selected property.\n *\n * @param prev - the previous list of selected options\n * @param next - the current list of selected options\n *\n * @internal\n * @remarks\n * Overrides: `Listbox.selectedOptionsChanged`\n */\n selectedOptionsChanged(prev, next) {\n if (this.$fastController.isConnected) {\n this._options.forEach(o => {\n o.selected = next.includes(o);\n });\n }\n }\n /**\n * Synchronize the form-associated proxy and update the value property of the element.\n *\n * @param prev - the previous collection of slotted option elements\n * @param next - the next collection of slotted option elements\n *\n * @internal\n */\n slottedOptionsChanged(prev, next) {\n super.slottedOptionsChanged(prev, next);\n this.updateValue();\n }\n /**\n * Sets the value and to match the first selected option.\n *\n * @param shouldEmit - if true, the change event will be emitted\n *\n * @internal\n */\n updateValue(shouldEmit) {\n var _a;\n if (this.$fastController.isConnected) {\n this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value;\n this.control.value = this.value;\n }\n if (shouldEmit) {\n this.$emit(\"change\");\n }\n }\n /**\n * @internal\n */\n clearSelectionRange() {\n const controlValueLength = this.control.value.length;\n this.control.setSelectionRange(controlValueLength, controlValueLength);\n }\n}\n__decorate([\n attr({ attribute: \"autocomplete\", mode: \"fromView\" })\n], Combobox.prototype, \"autocomplete\", void 0);\n__decorate([\n observable\n], Combobox.prototype, \"maxHeight\", void 0);\n__decorate([\n attr({ attribute: \"open\", mode: \"boolean\" })\n], Combobox.prototype, \"open\", void 0);\n__decorate([\n attr\n], Combobox.prototype, \"placeholder\", void 0);\n__decorate([\n attr({ attribute: \"position\" })\n], Combobox.prototype, \"positionAttribute\", void 0);\n__decorate([\n observable\n], Combobox.prototype, \"position\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA combobox role.\n *\n * @public\n */\nexport class DelegatesARIACombobox {\n}\n__decorate([\n observable\n], DelegatesARIACombobox.prototype, \"ariaAutoComplete\", void 0);\n__decorate([\n observable\n], DelegatesARIACombobox.prototype, \"ariaControls\", void 0);\napplyMixins(DelegatesARIACombobox, DelegatesARIAListbox);\napplyMixins(Combobox, StartEnd, DelegatesARIACombobox);\n","import { html, ref, slotted } from \"@microsoft/fast-element\";\nimport { Listbox } from \"../listbox/listbox.js\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Combobox:class)} component.\n * @public\n */\nexport const comboboxTemplate = (context, definition) => html `\n <template\n aria-disabled=\"${x => x.ariaDisabled}\"\n autocomplete=\"${x => x.autocomplete}\"\n class=\"${x => (x.open ? \"open\" : \"\")} ${x => x.disabled ? \"disabled\" : \"\"} ${x => x.position}\"\n ?open=\"${x => x.open}\"\n tabindex=\"${x => (!x.disabled ? \"0\" : null)}\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n @focusout=\"${(x, c) => x.focusoutHandler(c.event)}\"\n @keydown=\"${(x, c) => x.keydownHandler(c.event)}\"\n >\n <div class=\"control\" part=\"control\">\n ${startSlotTemplate(context, definition)}\n <slot name=\"control\">\n <input\n aria-activedescendant=\"${x => x.open ? x.ariaActiveDescendant : null}\"\n aria-autocomplete=\"${x => x.ariaAutoComplete}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-haspopup=\"listbox\"\n class=\"selected-value\"\n part=\"selected-value\"\n placeholder=\"${x => x.placeholder}\"\n role=\"combobox\"\n type=\"text\"\n ?disabled=\"${x => x.disabled}\"\n :value=\"${x => x.value}\"\n @input=\"${(x, c) => x.inputHandler(c.event)}\"\n @keyup=\"${(x, c) => x.keyupHandler(c.event)}\"\n ${ref(\"control\")}\n />\n <div class=\"indicator\" part=\"indicator\" aria-hidden=\"true\">\n <slot name=\"indicator\">\n ${definition.indicator || \"\"}\n </slot>\n </div>\n </slot>\n ${endSlotTemplate(context, definition)}\n </div>\n <div\n class=\"listbox\"\n id=\"${x => x.listboxId}\"\n part=\"listbox\"\n role=\"listbox\"\n ?disabled=\"${x => x.disabled}\"\n ?hidden=\"${x => !x.open}\"\n ${ref(\"listbox\")}\n >\n <slot\n ${slotted({\n filter: Listbox.slottedOptionFilter,\n flatten: true,\n property: \"slottedOptions\",\n})}\n ></slot>\n </div>\n </template>\n`;\n","import { children, elements, html } from \"@microsoft/fast-element\";\nimport { DataGridRow } from \"./data-grid-row.js\";\nfunction createRowItemTemplate(context) {\n const rowTag = context.tagFor(DataGridRow);\n return html `\n <${rowTag}\n :rowData=\"${x => x}\"\n :cellItemTemplate=\"${(x, c) => c.parent.cellItemTemplate}\"\n :headerCellItemTemplate=\"${(x, c) => c.parent.headerCellItemTemplate}\"\n ></${rowTag}>\n`;\n}\n/**\n * Generates a template for the {@link @microsoft/fast-foundation#DataGrid} component using\n * the provided prefix.\n *\n * @public\n */\nexport const dataGridTemplate = (context, definition) => {\n const rowItemTemplate = createRowItemTemplate(context);\n const rowTag = context.tagFor(DataGridRow);\n return html `\n <template\n role=\"grid\"\n tabindex=\"0\"\n :rowElementTag=\"${() => rowTag}\"\n :defaultRowItemTemplate=\"${rowItemTemplate}\"\n ${children({\n property: \"rowElements\",\n filter: elements(\"[role=row]\"),\n })}\n >\n <slot></slot>\n </template>\n `;\n};\n","import { children, elements, html, slotted } from \"@microsoft/fast-element\";\nimport { DataGridCell } from \"./data-grid-cell.js\";\nfunction createCellItemTemplate(context) {\n const cellTag = context.tagFor(DataGridCell);\n return html `\n <${cellTag}\n cell-type=\"${x => (x.isRowHeader ? \"rowheader\" : undefined)}\"\n grid-column=\"${(x, c) => c.index + 1}\"\n :rowData=\"${(x, c) => c.parent.rowData}\"\n :columnDefinition=\"${x => x}\"\n ></${cellTag}>\n`;\n}\nfunction createHeaderCellItemTemplate(context) {\n const cellTag = context.tagFor(DataGridCell);\n return html `\n <${cellTag}\n cell-type=\"columnheader\"\n grid-column=\"${(x, c) => c.index + 1}\"\n :columnDefinition=\"${x => x}\"\n ></${cellTag}>\n`;\n}\n/**\n * Generates a template for the {@link @microsoft/fast-foundation#DataGridRow} component using\n * the provided prefix.\n *\n * @public\n */\nexport const dataGridRowTemplate = (context, definition) => {\n const cellItemTemplate = createCellItemTemplate(context);\n const headerCellItemTemplate = createHeaderCellItemTemplate(context);\n return html `\n <template\n role=\"row\"\n class=\"${x => (x.rowType !== \"default\" ? x.rowType : \"\")}\"\n :defaultCellItemTemplate=\"${cellItemTemplate}\"\n :defaultHeaderCellItemTemplate=\"${headerCellItemTemplate}\"\n ${children({\n property: \"cellElements\",\n filter: elements('[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"]'),\n })}\n >\n <slot ${slotted(\"slottedCellElements\")}></slot>\n </template>\n `;\n};\n","import { html } from \"@microsoft/fast-element\";\n/**\n * Generates a template for the {@link @microsoft/fast-foundation#DataGridCell} component using\n * the provided prefix.\n * @public\n */\nexport const dataGridCellTemplate = (context, definition) => {\n return html `\n <template\n tabindex=\"-1\"\n role=\"${x => !x.cellType || x.cellType === \"default\" ? \"gridcell\" : x.cellType}\"\n class=\"\n ${x => x.cellType === \"columnheader\"\n ? \"column-header\"\n : x.cellType === \"rowheader\"\n ? \"row-header\"\n : \"\"}\n \"\n >\n <slot></slot>\n </template>\n `;\n};\n","/**\n * Retrieves the \"composed parent\" element of a node, ignoring DOM tree boundaries.\n * When the parent of a node is a shadow-root, it will return the host\n * element of the shadow root. Otherwise it will return the parent node or null if\n * no parent node exists.\n * @param element - The element for which to retrieve the composed parent\n *\n * @public\n */\nexport function composedParent(element) {\n const parentNode = element.parentElement;\n if (parentNode) {\n return parentNode;\n }\n else {\n const rootNode = element.getRootNode();\n if (rootNode.host instanceof HTMLElement) {\n // this is shadow-root\n return rootNode.host;\n }\n }\n return null;\n}\n","import { composedParent } from \"./composed-parent.js\";\n/**\n * Determines if the reference element contains the test element in a \"composed\" DOM tree that\n * ignores shadow DOM boundaries.\n *\n * Returns true of the test element is a descendent of the reference, or exist in\n * a shadow DOM that is a logical descendent of the reference. Otherwise returns false.\n * @param reference - The element to test for containment against.\n * @param test - The element being tested for containment.\n *\n * @public\n */\nexport function composedContains(reference, test) {\n let current = test;\n while (current !== null) {\n if (current === reference) {\n return true;\n }\n current = composedParent(current);\n }\n return false;\n}\n","import { __decorate } from \"tslib\";\nimport { DOM, ElementStyles, FASTElement, observable, Observable, } from \"@microsoft/fast-element\";\nexport const defaultElement = document.createElement(\"div\");\nfunction isFastElement(element) {\n return element instanceof FASTElement;\n}\nclass QueuedStyleSheetTarget {\n setProperty(name, value) {\n DOM.queueUpdate(() => this.target.setProperty(name, value));\n }\n removeProperty(name) {\n DOM.queueUpdate(() => this.target.removeProperty(name));\n }\n}\n/**\n * Handles setting properties for a FASTElement using Constructable Stylesheets\n */\nclass ConstructableStyleSheetTarget extends QueuedStyleSheetTarget {\n constructor(source) {\n super();\n const sheet = new CSSStyleSheet();\n this.target = sheet.cssRules[sheet.insertRule(\":host{}\")].style;\n source.$fastController.addStyles(ElementStyles.create([sheet]));\n }\n}\nclass DocumentStyleSheetTarget extends QueuedStyleSheetTarget {\n constructor() {\n super();\n const sheet = new CSSStyleSheet();\n this.target = sheet.cssRules[sheet.insertRule(\":root{}\")].style;\n document.adoptedStyleSheets = [\n ...document.adoptedStyleSheets,\n sheet,\n ];\n }\n}\nclass HeadStyleElementStyleSheetTarget extends QueuedStyleSheetTarget {\n constructor() {\n super();\n this.style = document.createElement(\"style\");\n document.head.appendChild(this.style);\n const { sheet } = this.style;\n // Because the HTMLStyleElement has been appended,\n // there shouldn't exist a case where `sheet` is null,\n // but if-check it just in case.\n if (sheet) {\n // https://github.com/jsdom/jsdom uses https://github.com/NV/CSSOM for it's CSSOM implementation,\n // which implements the DOM Level 2 spec for CSSStyleSheet where insertRule() requires an index argument.\n const index = sheet.insertRule(\":root{}\", sheet.cssRules.length);\n this.target = sheet.cssRules[index].style;\n }\n }\n}\n/**\n * Handles setting properties for a FASTElement using an HTMLStyleElement\n */\nclass StyleElementStyleSheetTarget {\n constructor(target) {\n this.store = new Map();\n this.target = null;\n const controller = target.$fastController;\n this.style = document.createElement(\"style\");\n controller.addStyles(this.style);\n Observable.getNotifier(controller).subscribe(this, \"isConnected\");\n this.handleChange(controller, \"isConnected\");\n }\n targetChanged() {\n if (this.target !== null) {\n for (const [key, value] of this.store.entries()) {\n this.target.setProperty(key, value);\n }\n }\n }\n setProperty(name, value) {\n this.store.set(name, value);\n DOM.queueUpdate(() => {\n if (this.target !== null) {\n this.target.setProperty(name, value);\n }\n });\n }\n removeProperty(name) {\n this.store.delete(name);\n DOM.queueUpdate(() => {\n if (this.target !== null) {\n this.target.removeProperty(name);\n }\n });\n }\n handleChange(source, key) {\n // HTMLStyleElement.sheet is null if the element isn't connected to the DOM,\n // so this method reacts to changes in DOM connection for the element hosting\n // the HTMLStyleElement.\n //\n // All rules applied via the CSSOM also get cleared when the element disconnects,\n // so we need to add a new rule each time and populate it with the stored properties\n const { sheet } = this.style;\n if (sheet) {\n // Safari will throw if we try to use the return result of insertRule()\n // to index the rule inline, so store as a const prior to indexing.\n // https://github.com/jsdom/jsdom uses https://github.com/NV/CSSOM for it's CSSOM implementation,\n // which implements the DOM Level 2 spec for CSSStyleSheet where insertRule() requires an index argument.\n const index = sheet.insertRule(\":host{}\", sheet.cssRules.length);\n this.target = sheet.cssRules[index].style;\n }\n else {\n this.target = null;\n }\n }\n}\n__decorate([\n observable\n], StyleElementStyleSheetTarget.prototype, \"target\", void 0);\n/**\n * Handles setting properties for a normal HTMLElement\n */\nclass ElementStyleSheetTarget {\n constructor(source) {\n this.target = source.style;\n }\n setProperty(name, value) {\n DOM.queueUpdate(() => this.target.setProperty(name, value));\n }\n removeProperty(name) {\n DOM.queueUpdate(() => this.target.removeProperty(name));\n }\n}\n/**\n * Controls emission for default values. This control is capable\n * of emitting to multiple {@link PropertyTarget | PropertyTargets},\n * and only emits if it has at least one root.\n *\n * @internal\n */\nexport class RootStyleSheetTarget {\n setProperty(name, value) {\n RootStyleSheetTarget.properties[name] = value;\n for (const target of RootStyleSheetTarget.roots.values()) {\n PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value);\n }\n }\n removeProperty(name) {\n delete RootStyleSheetTarget.properties[name];\n for (const target of RootStyleSheetTarget.roots.values()) {\n PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name);\n }\n }\n static registerRoot(root) {\n const { roots } = RootStyleSheetTarget;\n if (!roots.has(root)) {\n roots.add(root);\n const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root));\n for (const key in RootStyleSheetTarget.properties) {\n target.setProperty(key, RootStyleSheetTarget.properties[key]);\n }\n }\n }\n static unregisterRoot(root) {\n const { roots } = RootStyleSheetTarget;\n if (roots.has(root)) {\n roots.delete(root);\n const target = PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(root));\n for (const key in RootStyleSheetTarget.properties) {\n target.removeProperty(key);\n }\n }\n }\n /**\n * Returns the document when provided the default element,\n * otherwise is a no-op\n * @param root - the root to normalize\n */\n static normalizeRoot(root) {\n return root === defaultElement ? document : root;\n }\n}\nRootStyleSheetTarget.roots = new Set();\nRootStyleSheetTarget.properties = {};\n// Caches PropertyTarget instances\nconst propertyTargetCache = new WeakMap();\n// Use Constructable StyleSheets for FAST elements when supported, otherwise use\n// HTMLStyleElement instances\nconst propertyTargetCtor = DOM.supportsAdoptedStyleSheets\n ? ConstructableStyleSheetTarget\n : StyleElementStyleSheetTarget;\n/**\n * Manages creation and caching of PropertyTarget instances.\n *\n * @internal\n */\nexport const PropertyTargetManager = Object.freeze({\n getOrCreate(source) {\n if (propertyTargetCache.has(source)) {\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n return propertyTargetCache.get(source);\n }\n let target;\n if (source === defaultElement) {\n target = new RootStyleSheetTarget();\n }\n else if (source instanceof Document) {\n target = DOM.supportsAdoptedStyleSheets\n ? new DocumentStyleSheetTarget()\n : new HeadStyleElementStyleSheetTarget();\n }\n else if (isFastElement(source)) {\n target = new propertyTargetCtor(source);\n }\n else {\n target = new ElementStyleSheetTarget(source);\n }\n propertyTargetCache.set(source, target);\n return target;\n },\n});\n","import { __decorate } from \"tslib\";\nimport { CSSDirective, defaultExecutionContext, FASTElement, observable, Observable, } from \"@microsoft/fast-element\";\nimport { composedParent } from \"../utilities/composed-parent.js\";\nimport { composedContains } from \"../utilities/composed-contains.js\";\nimport { PropertyTargetManager, RootStyleSheetTarget, } from \"./custom-property-manager.js\";\nimport { defaultElement } from \"./custom-property-manager.js\";\n/**\n * Implementation of {@link (DesignToken:interface)}\n */\nclass DesignTokenImpl extends CSSDirective {\n constructor(configuration) {\n super();\n this.subscribers = new WeakMap();\n this._appliedTo = new Set();\n this.name = configuration.name;\n if (configuration.cssCustomPropertyName !== null) {\n this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`;\n this.cssVar = `var(${this.cssCustomProperty})`;\n }\n this.id = DesignTokenImpl.uniqueId();\n DesignTokenImpl.tokensById.set(this.id, this);\n }\n get appliedTo() {\n return [...this._appliedTo];\n }\n static from(nameOrConfig) {\n return new DesignTokenImpl({\n name: typeof nameOrConfig === \"string\" ? nameOrConfig : nameOrConfig.name,\n cssCustomPropertyName: typeof nameOrConfig === \"string\"\n ? nameOrConfig\n : nameOrConfig.cssCustomPropertyName === void 0\n ? nameOrConfig.name\n : nameOrConfig.cssCustomPropertyName,\n });\n }\n static isCSSDesignToken(token) {\n return typeof token.cssCustomProperty === \"string\";\n }\n static isDerivedDesignTokenValue(value) {\n return typeof value === \"function\";\n }\n /**\n * Gets a token by ID. Returns undefined if the token was not found.\n * @param id - The ID of the token\n * @returns\n */\n static getTokenById(id) {\n return DesignTokenImpl.tokensById.get(id);\n }\n getOrCreateSubscriberSet(target = this) {\n return (this.subscribers.get(target) ||\n (this.subscribers.set(target, new Set()) && this.subscribers.get(target)));\n }\n createCSS() {\n return this.cssVar || \"\";\n }\n getValueFor(element) {\n const value = DesignTokenNode.getOrCreate(element).get(this);\n if (value !== undefined) {\n return value;\n }\n throw new Error(`Value could not be retrieved for token named \"${this.name}\". Ensure the value is set for ${element} or an ancestor of ${element}.`);\n }\n setValueFor(element, value) {\n this._appliedTo.add(element);\n if (value instanceof DesignTokenImpl) {\n value = this.alias(value);\n }\n DesignTokenNode.getOrCreate(element).set(this, value);\n return this;\n }\n deleteValueFor(element) {\n this._appliedTo.delete(element);\n if (DesignTokenNode.existsFor(element)) {\n DesignTokenNode.getOrCreate(element).delete(this);\n }\n return this;\n }\n withDefault(value) {\n this.setValueFor(defaultElement, value);\n return this;\n }\n subscribe(subscriber, target) {\n const subscriberSet = this.getOrCreateSubscriberSet(target);\n if (target && !DesignTokenNode.existsFor(target)) {\n DesignTokenNode.getOrCreate(target);\n }\n if (!subscriberSet.has(subscriber)) {\n subscriberSet.add(subscriber);\n }\n }\n unsubscribe(subscriber, target) {\n const list = this.subscribers.get(target || this);\n if (list && list.has(subscriber)) {\n list.delete(subscriber);\n }\n }\n /**\n * Notifies subscribers that the value for an element has changed.\n * @param element - The element to emit a notification for\n */\n notify(element) {\n const record = Object.freeze({ token: this, target: element });\n if (this.subscribers.has(this)) {\n this.subscribers.get(this).forEach(sub => sub.handleChange(record));\n }\n if (this.subscribers.has(element)) {\n this.subscribers.get(element).forEach(sub => sub.handleChange(record));\n }\n }\n /**\n * Alias the token to the provided token.\n * @param token - the token to alias to\n */\n alias(token) {\n return ((target) => token.getValueFor(target));\n }\n}\nDesignTokenImpl.uniqueId = (() => {\n let id = 0;\n return () => {\n id++;\n return id.toString(16);\n };\n})();\n/**\n * Token storage by token ID\n */\nDesignTokenImpl.tokensById = new Map();\nclass CustomPropertyReflector {\n startReflection(token, target) {\n token.subscribe(this, target);\n this.handleChange({ token, target });\n }\n stopReflection(token, target) {\n token.unsubscribe(this, target);\n this.remove(token, target);\n }\n handleChange(record) {\n const { token, target } = record;\n this.add(token, target);\n }\n add(token, target) {\n PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token)));\n }\n remove(token, target) {\n PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty);\n }\n resolveCSSValue(value) {\n return value && typeof value.createCSS === \"function\" ? value.createCSS() : value;\n }\n}\n/**\n * A light wrapper around BindingObserver to handle value caching and\n * token notification\n */\nclass DesignTokenBindingObserver {\n constructor(source, token, node) {\n this.source = source;\n this.token = token;\n this.node = node;\n this.dependencies = new Set();\n this.observer = Observable.binding(source, this, false);\n // This is a little bit hacky because it's using internal APIs of BindingObserverImpl.\n // BindingObserverImpl queues updates to batch it's notifications which doesn't work for this\n // scenario because the DesignToken.getValueFor API is not async. Without this, using DesignToken.getValueFor()\n // after DesignToken.setValueFor() when setting a dependency of the value being retrieved can return a stale\n // value. Assigning .handleChange to .call forces immediate invocation of this classes handleChange() method,\n // allowing resolution of values synchronously.\n // TODO: https://github.com/microsoft/fast/issues/5110\n this.observer.handleChange = this.observer.call;\n this.handleChange();\n }\n disconnect() {\n this.observer.disconnect();\n }\n /**\n * @internal\n */\n handleChange() {\n this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext));\n }\n}\n/**\n * Stores resolved token/value pairs and notifies on changes\n */\nclass Store {\n constructor() {\n this.values = new Map();\n }\n set(token, value) {\n if (this.values.get(token) !== value) {\n this.values.set(token, value);\n Observable.getNotifier(this).notify(token.id);\n }\n }\n get(token) {\n Observable.track(this, token.id);\n return this.values.get(token);\n }\n delete(token) {\n this.values.delete(token);\n }\n all() {\n return this.values.entries();\n }\n}\nconst nodeCache = new WeakMap();\nconst childToParent = new WeakMap();\n/**\n * A node responsible for setting and getting token values,\n * emitting values to CSS custom properties, and maintaining\n * inheritance structures.\n */\nclass DesignTokenNode {\n constructor(target) {\n this.target = target;\n /**\n * Stores all resolved token values for a node\n */\n this.store = new Store();\n /**\n * All children assigned to the node\n */\n this.children = [];\n /**\n * All values explicitly assigned to the node in their raw form\n */\n this.assignedValues = new Map();\n /**\n * Tokens currently being reflected to CSS custom properties\n */\n this.reflecting = new Set();\n /**\n * Binding observers for assigned and inherited derived values.\n */\n this.bindingObservers = new Map();\n /**\n * Emits notifications to token when token values\n * change the DesignTokenNode\n */\n this.tokenValueChangeHandler = {\n handleChange: (source, arg) => {\n const token = DesignTokenImpl.getTokenById(arg);\n if (token) {\n // Notify any token subscribers\n token.notify(this.target);\n if (DesignTokenImpl.isCSSDesignToken(token)) {\n const parent = this.parent;\n const reflecting = this.isReflecting(token);\n if (parent) {\n const parentValue = parent.get(token);\n const sourceValue = source.get(token);\n if (parentValue !== sourceValue && !reflecting) {\n this.reflectToCSS(token);\n }\n else if (parentValue === sourceValue && reflecting) {\n this.stopReflectToCSS(token);\n }\n }\n else if (!reflecting) {\n this.reflectToCSS(token);\n }\n }\n }\n },\n };\n nodeCache.set(target, this);\n // Map store change notifications to token change notifications\n Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler);\n if (target instanceof FASTElement) {\n target.$fastController.addBehaviors([this]);\n }\n else if (target.isConnected) {\n this.bind();\n }\n }\n /**\n * Returns a DesignTokenNode for an element.\n * Creates a new instance if one does not already exist for a node,\n * otherwise returns the cached instance\n *\n * @param target - The HTML element to retrieve a DesignTokenNode for\n */\n static getOrCreate(target) {\n return nodeCache.get(target) || new DesignTokenNode(target);\n }\n /**\n * Determines if a DesignTokenNode has been created for a target\n * @param target - The element to test\n */\n static existsFor(target) {\n return nodeCache.has(target);\n }\n /**\n * Searches for and return the nearest parent DesignTokenNode.\n * Null is returned if no node is found or the node provided is for a default element.\n */\n static findParent(node) {\n if (!(defaultElement === node.target)) {\n let parent = composedParent(node.target);\n while (parent !== null) {\n if (nodeCache.has(parent)) {\n return nodeCache.get(parent);\n }\n parent = composedParent(parent);\n }\n return DesignTokenNode.getOrCreate(defaultElement);\n }\n return null;\n }\n /**\n * Finds the closest node with a value explicitly assigned for a token, otherwise null.\n * @param token - The token to look for\n * @param start - The node to start looking for value assignment\n * @returns\n */\n static findClosestAssignedNode(token, start) {\n let current = start;\n do {\n if (current.has(token)) {\n return current;\n }\n current = current.parent\n ? current.parent\n : current.target !== defaultElement\n ? DesignTokenNode.getOrCreate(defaultElement)\n : null;\n } while (current !== null);\n return null;\n }\n /**\n * The parent DesignTokenNode, or null.\n */\n get parent() {\n return childToParent.get(this) || null;\n }\n /**\n * Checks if a token has been assigned an explicit value the node.\n * @param token - the token to check.\n */\n has(token) {\n return this.assignedValues.has(token);\n }\n /**\n * Gets the value of a token for a node\n * @param token - The token to retrieve the value for\n * @returns\n */\n get(token) {\n const value = this.store.get(token);\n if (value !== undefined) {\n return value;\n }\n const raw = this.getRaw(token);\n if (raw !== undefined) {\n this.hydrate(token, raw);\n return this.get(token);\n }\n }\n /**\n * Retrieves the raw assigned value of a token from the nearest assigned node.\n * @param token - The token to retrieve a raw value for\n * @returns\n */\n getRaw(token) {\n var _a;\n if (this.assignedValues.has(token)) {\n return this.assignedValues.get(token);\n }\n return (_a = DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token);\n }\n /**\n * Sets a token to a value for a node\n * @param token - The token to set\n * @param value - The value to set the token to\n */\n set(token, value) {\n if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) {\n this.tearDownBindingObserver(token);\n }\n this.assignedValues.set(token, value);\n if (DesignTokenImpl.isDerivedDesignTokenValue(value)) {\n this.setupBindingObserver(token, value);\n }\n else {\n this.store.set(token, value);\n }\n }\n /**\n * Deletes a token value for the node.\n * @param token - The token to delete the value for\n */\n delete(token) {\n this.assignedValues.delete(token);\n this.tearDownBindingObserver(token);\n const upstream = this.getRaw(token);\n if (upstream) {\n this.hydrate(token, upstream);\n }\n else {\n this.store.delete(token);\n }\n }\n /**\n * Invoked when the DesignTokenNode.target is attached to the document\n */\n bind() {\n const parent = DesignTokenNode.findParent(this);\n if (parent) {\n parent.appendChild(this);\n }\n for (const key of this.assignedValues.keys()) {\n key.notify(this.target);\n }\n }\n /**\n * Invoked when the DesignTokenNode.target is detached from the document\n */\n unbind() {\n if (this.parent) {\n const parent = childToParent.get(this);\n parent.removeChild(this);\n }\n }\n /**\n * Appends a child to a parent DesignTokenNode.\n * @param child - The child to append to the node\n */\n appendChild(child) {\n if (child.parent) {\n childToParent.get(child).removeChild(child);\n }\n const reParent = this.children.filter(x => child.contains(x));\n childToParent.set(child, this);\n this.children.push(child);\n reParent.forEach(x => child.appendChild(x));\n Observable.getNotifier(this.store).subscribe(child);\n // How can we not notify *every* subscriber?\n for (const [token, value] of this.store.all()) {\n child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value);\n }\n }\n /**\n * Removes a child from a node.\n * @param child - The child to remove.\n */\n removeChild(child) {\n const childIndex = this.children.indexOf(child);\n if (childIndex !== -1) {\n this.children.splice(childIndex, 1);\n }\n Observable.getNotifier(this.store).unsubscribe(child);\n return child.parent === this ? childToParent.delete(child) : false;\n }\n /**\n * Tests whether a provided node is contained by\n * the calling node.\n * @param test - The node to test\n */\n contains(test) {\n return composedContains(this.target, test.target);\n }\n /**\n * Instructs the node to reflect a design token for the provided token.\n * @param token - The design token to reflect\n */\n reflectToCSS(token) {\n if (!this.isReflecting(token)) {\n this.reflecting.add(token);\n DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target);\n }\n }\n /**\n * Stops reflecting a DesignToken to CSS\n * @param token - The design token to stop reflecting\n */\n stopReflectToCSS(token) {\n if (this.isReflecting(token)) {\n this.reflecting.delete(token);\n DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target);\n }\n }\n /**\n * Determines if a token is being reflected to CSS for a node.\n * @param token - The token to check for reflection\n * @returns\n */\n isReflecting(token) {\n return this.reflecting.has(token);\n }\n /**\n * Handle changes to upstream tokens\n * @param source - The parent DesignTokenNode\n * @param property - The token ID that changed\n */\n handleChange(source, property) {\n const token = DesignTokenImpl.getTokenById(property);\n if (!token) {\n return;\n }\n this.hydrate(token, this.getRaw(token));\n }\n /**\n * Hydrates a token with a DesignTokenValue, making retrieval available.\n * @param token - The token to hydrate\n * @param value - The value to hydrate\n */\n hydrate(token, value) {\n if (!this.has(token)) {\n const observer = this.bindingObservers.get(token);\n if (DesignTokenImpl.isDerivedDesignTokenValue(value)) {\n if (observer) {\n // If the binding source doesn't match, we need\n // to update the binding\n if (observer.source !== value) {\n this.tearDownBindingObserver(token);\n this.setupBindingObserver(token, value);\n }\n }\n else {\n this.setupBindingObserver(token, value);\n }\n }\n else {\n if (observer) {\n this.tearDownBindingObserver(token);\n }\n this.store.set(token, value);\n }\n }\n }\n /**\n * Sets up a binding observer for a derived token value that notifies token\n * subscribers on change.\n *\n * @param token - The token to notify when the binding updates\n * @param source - The binding source\n */\n setupBindingObserver(token, source) {\n const binding = new DesignTokenBindingObserver(source, token, this);\n this.bindingObservers.set(token, binding);\n return binding;\n }\n /**\n * Tear down a binding observer for a token.\n */\n tearDownBindingObserver(token) {\n if (this.bindingObservers.has(token)) {\n this.bindingObservers.get(token).disconnect();\n this.bindingObservers.delete(token);\n return true;\n }\n return false;\n }\n}\n/**\n * Responsible for reflecting tokens to CSS custom properties\n */\nDesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector();\n__decorate([\n observable\n], DesignTokenNode.prototype, \"children\", void 0);\nfunction create(nameOrConfig) {\n return DesignTokenImpl.from(nameOrConfig);\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n/**\n * Factory object for creating {@link (DesignToken:interface)} instances.\n * @public\n */\nexport const DesignToken = Object.freeze({\n create,\n /**\n * Informs DesignToken that an HTMLElement for which tokens have\n * been set has been connected to the document.\n *\n * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness\n * in all scenarios, so invoking this method manually is necessary when:\n *\n * 1. Token values are set for an HTMLElement.\n * 2. The HTMLElement does not inherit from FASTElement.\n * 3. The HTMLElement is not connected to the document when token values are set.\n *\n * @param element - The element to notify\n * @returns - true if notification was successful, otherwise false.\n */\n notifyConnection(element) {\n if (!element.isConnected || !DesignTokenNode.existsFor(element)) {\n return false;\n }\n DesignTokenNode.getOrCreate(element).bind();\n return true;\n },\n /**\n * Informs DesignToken that an HTMLElement for which tokens have\n * been set has been disconnected to the document.\n *\n * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness\n * in all scenarios, so invoking this method manually is necessary when:\n *\n * 1. Token values are set for an HTMLElement.\n * 2. The HTMLElement does not inherit from FASTElement.\n *\n * @param element - The element to notify\n * @returns - true if notification was successful, otherwise false.\n */\n notifyDisconnection(element) {\n if (element.isConnected || !DesignTokenNode.existsFor(element)) {\n return false;\n }\n DesignTokenNode.getOrCreate(element).unbind();\n return true;\n },\n /**\n * Registers and element or document as a DesignToken root.\n * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via\n * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all\n * registered roots.\n * @param target - The root to register\n */\n registerRoot(target = defaultElement) {\n RootStyleSheetTarget.registerRoot(target);\n },\n /**\n * Unregister an element or document as a DesignToken root.\n * @param target - The root to deregister\n */\n unregisterRoot(target = defaultElement) {\n RootStyleSheetTarget.unregisterRoot(target);\n },\n});\n/* eslint-enable @typescript-eslint/no-non-null-assertion */\n","import { FASTElementDefinition } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { DI, Registration } from \"../di/di.js\";\nimport { DesignToken } from \"../design-token/design-token.js\";\nimport { ComponentPresentation } from \"./component-presentation.js\";\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/**\n * Indicates what to do with an ambiguous (duplicate) element.\n * @public\n */\nexport const ElementDisambiguation = Object.freeze({\n /**\n * Skip defining the element but still call the provided callback passed\n * to DesignSystemRegistrationContext.tryDefineElement\n */\n definitionCallbackOnly: null,\n /**\n * Ignore the duplicate element entirely.\n */\n ignoreDuplicate: Symbol(),\n});\nconst elementTypesByTag = new Map();\nconst elementTagsByType = new Map();\nlet rootDesignSystem = null;\nconst designSystemKey = DI.createInterface(x => x.cachedCallback(handler => {\n if (rootDesignSystem === null) {\n rootDesignSystem = new DefaultDesignSystem(null, handler);\n }\n return rootDesignSystem;\n}));\n/**\n * An API gateway to design system features.\n * @public\n */\nexport const DesignSystem = Object.freeze({\n /**\n * Returns the HTML element name that the type is defined as.\n * @param type - The type to lookup.\n * @public\n */\n tagFor(type) {\n return elementTagsByType.get(type);\n },\n /**\n * Searches the DOM hierarchy for the design system that is responsible\n * for the provided element.\n * @param element - The element to locate the design system for.\n * @returns The located design system.\n * @public\n */\n responsibleFor(element) {\n const owned = element.$$designSystem$$;\n if (owned) {\n return owned;\n }\n const container = DI.findResponsibleContainer(element);\n return container.get(designSystemKey);\n },\n /**\n * Gets the DesignSystem if one is explicitly defined on the provided element;\n * otherwise creates a design system defined directly on the element.\n * @param element - The element to get or create a design system for.\n * @returns The design system.\n * @public\n */\n getOrCreate(node) {\n if (!node) {\n if (rootDesignSystem === null) {\n rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey);\n }\n return rootDesignSystem;\n }\n const owned = node.$$designSystem$$;\n if (owned) {\n return owned;\n }\n const container = DI.getOrCreateDOMContainer(node);\n if (container.has(designSystemKey, false)) {\n return container.get(designSystemKey);\n }\n else {\n const system = new DefaultDesignSystem(node, container);\n container.register(Registration.instance(designSystemKey, system));\n return system;\n }\n },\n});\nfunction extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) {\n if (typeof params === \"string\") {\n return {\n name: params,\n type: elementDefinitionType,\n callback: elementDefinitionCallback,\n };\n }\n else {\n return params;\n }\n}\nclass DefaultDesignSystem {\n constructor(owner, container) {\n this.owner = owner;\n this.container = container;\n this.designTokensInitialized = false;\n this.prefix = \"fast\";\n this.shadowRootMode = undefined;\n this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly;\n if (owner !== null) {\n owner.$$designSystem$$ = this;\n }\n }\n withPrefix(prefix) {\n this.prefix = prefix;\n return this;\n }\n withShadowRootMode(mode) {\n this.shadowRootMode = mode;\n return this;\n }\n withElementDisambiguation(callback) {\n this.disambiguate = callback;\n return this;\n }\n withDesignTokenRoot(root) {\n this.designTokenRoot = root;\n return this;\n }\n register(...registrations) {\n const container = this.container;\n const elementDefinitionEntries = [];\n const disambiguate = this.disambiguate;\n const shadowRootMode = this.shadowRootMode;\n const context = {\n elementPrefix: this.prefix,\n tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) {\n const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback);\n const { name, callback, baseClass } = extractedParams;\n let { type } = extractedParams;\n let elementName = name;\n let typeFoundByName = elementTypesByTag.get(elementName);\n let needsDefine = true;\n while (typeFoundByName) {\n const result = disambiguate(elementName, type, typeFoundByName);\n switch (result) {\n case ElementDisambiguation.ignoreDuplicate:\n return;\n case ElementDisambiguation.definitionCallbackOnly:\n needsDefine = false;\n typeFoundByName = void 0;\n break;\n default:\n elementName = result;\n typeFoundByName = elementTypesByTag.get(elementName);\n break;\n }\n }\n if (needsDefine) {\n if (elementTagsByType.has(type) || type === FoundationElement) {\n type = class extends type {\n };\n }\n elementTypesByTag.set(elementName, type);\n elementTagsByType.set(type, elementName);\n if (baseClass) {\n elementTagsByType.set(baseClass, elementName);\n }\n }\n elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback, needsDefine));\n },\n };\n if (!this.designTokensInitialized) {\n this.designTokensInitialized = true;\n if (this.designTokenRoot !== null) {\n DesignToken.registerRoot(this.designTokenRoot);\n }\n }\n container.registerWithContext(context, ...registrations);\n for (const entry of elementDefinitionEntries) {\n entry.callback(entry);\n if (entry.willDefine && entry.definition !== null) {\n entry.definition.define();\n }\n }\n return this;\n }\n}\nclass ElementDefinitionEntry {\n constructor(container, name, type, shadowRootMode, callback, willDefine) {\n this.container = container;\n this.name = name;\n this.type = type;\n this.shadowRootMode = shadowRootMode;\n this.callback = callback;\n this.willDefine = willDefine;\n this.definition = null;\n }\n definePresentation(presentation) {\n ComponentPresentation.define(this.name, presentation, this.container);\n }\n defineElement(definition) {\n this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name }));\n }\n tagFor(type) {\n return DesignSystem.tagFor(type);\n }\n}\n/* eslint-enable @typescript-eslint/no-non-null-assertion */\n","import { html, ref, when } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Dialog} component.\n * @public\n */\nexport const dialogTemplate = (context, definition) => html `\n <div class=\"positioning-region\" part=\"positioning-region\">\n ${when(x => x.modal, html `\n <div\n class=\"overlay\"\n part=\"overlay\"\n role=\"presentation\"\n @click=\"${x => x.dismiss()}\"\n ></div>\n `)}\n <div\n role=\"dialog\"\n tabindex=\"-1\"\n class=\"control\"\n part=\"control\"\n aria-modal=\"${x => x.modal}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-label=\"${x => x.ariaLabel}\"\n ${ref(\"dialog\")}\n >\n <slot></slot>\n </div>\n </div>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, Observable } from \"@microsoft/fast-element\";\nimport { keyEscape, keyTab } from \"@microsoft/fast-web-utilities\";\nimport { isTabbable } from \"tabbable\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A Switch Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#dialog | ARIA dialog }.\n *\n * @slot - The default slot for the dialog content\n * @csspart positioning-region - A wrapping element used to center the dialog and position the modal overlay\n * @csspart overlay - The modal dialog overlay\n * @csspart control - The dialog element\n * @fires cancel - Fires a custom 'cancel' event when the modal overlay is clicked\n * @fires close - Fires a custom 'close' event when the dialog is hidden\n *\n * @public\n */\nexport class Dialog extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Indicates the element is modal. When modal, user mouse interaction will be limited to the contents of the element by a modal\n * overlay. Clicks on the overlay will cause the dialog to emit a \"dismiss\" event.\n * @public\n * @defaultValue - true\n * @remarks\n * HTML Attribute: modal\n */\n this.modal = true;\n /**\n * The hidden state of the element.\n *\n * @public\n * @defaultValue - false\n * @remarks\n * HTML Attribute: hidden\n */\n this.hidden = false;\n /**\n * Indicates that the dialog should trap focus.\n *\n * @public\n * @defaultValue - true\n * @remarks\n * HTML Attribute: trap-focus\n */\n this.trapFocus = true;\n this.trapFocusChanged = () => {\n if (this.$fastController.isConnected) {\n this.updateTrapFocus();\n }\n };\n /**\n * @internal\n */\n this.isTrappingFocus = false;\n this.handleDocumentKeydown = (e) => {\n if (!e.defaultPrevented && !this.hidden) {\n switch (e.key) {\n case keyEscape:\n this.dismiss();\n e.preventDefault();\n break;\n case keyTab:\n this.handleTabKeyDown(e);\n break;\n }\n }\n };\n this.handleDocumentFocus = (e) => {\n if (!e.defaultPrevented && this.shouldForceFocus(e.target)) {\n this.focusFirstElement();\n e.preventDefault();\n }\n };\n this.handleTabKeyDown = (e) => {\n if (!this.trapFocus || this.hidden) {\n return;\n }\n const bounds = this.getTabQueueBounds();\n if (bounds.length === 0) {\n return;\n }\n if (bounds.length === 1) {\n // keep focus on single element\n bounds[0].focus();\n e.preventDefault();\n return;\n }\n if (e.shiftKey && e.target === bounds[0]) {\n bounds[bounds.length - 1].focus();\n e.preventDefault();\n }\n else if (!e.shiftKey && e.target === bounds[bounds.length - 1]) {\n bounds[0].focus();\n e.preventDefault();\n }\n return;\n };\n this.getTabQueueBounds = () => {\n const bounds = [];\n return Dialog.reduceTabbableItems(bounds, this);\n };\n /**\n * focus on first element of tab queue\n */\n this.focusFirstElement = () => {\n const bounds = this.getTabQueueBounds();\n if (bounds.length > 0) {\n bounds[0].focus();\n }\n else {\n if (this.dialog instanceof HTMLElement) {\n this.dialog.focus();\n }\n }\n };\n /**\n * we should only focus if focus has not already been brought to the dialog\n */\n this.shouldForceFocus = (currentFocusElement) => {\n return this.isTrappingFocus && !this.contains(currentFocusElement);\n };\n /**\n * we should we be active trapping focus\n */\n this.shouldTrapFocus = () => {\n return this.trapFocus && !this.hidden;\n };\n /**\n *\n *\n * @internal\n */\n this.updateTrapFocus = (shouldTrapFocusOverride) => {\n const shouldTrapFocus = shouldTrapFocusOverride === undefined\n ? this.shouldTrapFocus()\n : shouldTrapFocusOverride;\n if (shouldTrapFocus && !this.isTrappingFocus) {\n this.isTrappingFocus = true;\n // Add an event listener for focusin events if we are trapping focus\n document.addEventListener(\"focusin\", this.handleDocumentFocus);\n DOM.queueUpdate(() => {\n if (this.shouldForceFocus(document.activeElement)) {\n this.focusFirstElement();\n }\n });\n }\n else if (!shouldTrapFocus && this.isTrappingFocus) {\n this.isTrappingFocus = false;\n // remove event listener if we are not trapping focus\n document.removeEventListener(\"focusin\", this.handleDocumentFocus);\n }\n };\n }\n /**\n * @internal\n */\n dismiss() {\n this.$emit(\"dismiss\");\n // implement `<dialog>` interface\n this.$emit(\"cancel\");\n }\n /**\n * The method to show the dialog.\n *\n * @public\n */\n show() {\n this.hidden = false;\n }\n /**\n * The method to hide the dialog.\n *\n * @public\n */\n hide() {\n this.hidden = true;\n // implement `<dialog>` interface\n this.$emit(\"close\");\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n document.addEventListener(\"keydown\", this.handleDocumentKeydown);\n this.notifier = Observable.getNotifier(this);\n this.notifier.subscribe(this, \"hidden\");\n this.updateTrapFocus();\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n // remove keydown event listener\n document.removeEventListener(\"keydown\", this.handleDocumentKeydown);\n // if we are trapping focus remove the focusin listener\n this.updateTrapFocus(false);\n this.notifier.unsubscribe(this, \"hidden\");\n }\n /**\n * @internal\n */\n handleChange(source, propertyName) {\n switch (propertyName) {\n case \"hidden\":\n this.updateTrapFocus();\n break;\n default:\n break;\n }\n }\n /**\n * Reduce a collection to only its focusable elements.\n *\n * @param elements - Collection of elements to reduce\n * @param element - The current element\n *\n * @internal\n */\n static reduceTabbableItems(elements, element) {\n if (element.getAttribute(\"tabindex\") === \"-1\") {\n return elements;\n }\n if (isTabbable(element) ||\n (Dialog.isFocusableFastElement(element) && Dialog.hasTabbableShadow(element))) {\n elements.push(element);\n return elements;\n }\n if (element.childElementCount) {\n return elements.concat(Array.from(element.children).reduce(Dialog.reduceTabbableItems, []));\n }\n return elements;\n }\n /**\n * Test if element is focusable fast element\n *\n * @param element - The element to check\n *\n * @internal\n */\n static isFocusableFastElement(element) {\n var _a, _b;\n return !!((_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus);\n }\n /**\n * Test if the element has a focusable shadow\n *\n * @param element - The element to check\n *\n * @internal\n */\n static hasTabbableShadow(element) {\n var _a, _b;\n return Array.from((_b = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(\"*\")) !== null && _b !== void 0 ? _b : []).some(x => {\n return isTabbable(x);\n });\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], Dialog.prototype, \"modal\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], Dialog.prototype, \"hidden\", void 0);\n__decorate([\n attr({ attribute: \"trap-focus\", mode: \"boolean\" })\n], Dialog.prototype, \"trapFocus\", void 0);\n__decorate([\n attr({ attribute: \"aria-describedby\" })\n], Dialog.prototype, \"ariaDescribedby\", void 0);\n__decorate([\n attr({ attribute: \"aria-labelledby\" })\n], Dialog.prototype, \"ariaLabelledby\", void 0);\n__decorate([\n attr({ attribute: \"aria-label\" })\n], Dialog.prototype, \"ariaLabel\", void 0);\n","import { AttachedBehaviorHTMLDirective, DOM, SubscriberSet, } from \"@microsoft/fast-element\";\nconst observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n AttributeReflectionSubscriptionSet.getOrCreateFor(mutation.target).notify(mutation.attributeName);\n }\n});\nclass AttributeReflectionSubscriptionSet extends SubscriberSet {\n constructor(source) {\n super(source);\n this.watchedAttributes = new Set();\n AttributeReflectionSubscriptionSet.subscriberCache.set(source, this);\n }\n subscribe(subscriber) {\n super.subscribe(subscriber);\n if (!this.watchedAttributes.has(subscriber.attributes)) {\n this.watchedAttributes.add(subscriber.attributes);\n this.observe();\n }\n }\n unsubscribe(subscriber) {\n super.unsubscribe(subscriber);\n if (this.watchedAttributes.has(subscriber.attributes)) {\n this.watchedAttributes.delete(subscriber.attributes);\n this.observe();\n }\n }\n static getOrCreateFor(source) {\n return (this.subscriberCache.get(source) ||\n new AttributeReflectionSubscriptionSet(source));\n }\n observe() {\n const attributeFilter = [];\n for (const attributes of this.watchedAttributes.values()) {\n for (let i = 0; i < attributes.length; i++) {\n attributeFilter.push(attributes[i]);\n }\n }\n observer.observe(this.source, { attributeFilter });\n }\n}\nAttributeReflectionSubscriptionSet.subscriberCache = new WeakMap();\nclass ReflectAttrBehavior {\n constructor(target, attributes) {\n this.target = target;\n this.attributes = Object.freeze(attributes);\n }\n bind(source) {\n AttributeReflectionSubscriptionSet.getOrCreateFor(source).subscribe(this);\n // Reflect any existing attributes because MutationObserver will only\n // handle *changes* to attributes.\n if (source.hasAttributes()) {\n for (let i = 0; i < source.attributes.length; i++) {\n this.handleChange(source, source.attributes[i].name);\n }\n }\n }\n unbind(source) {\n AttributeReflectionSubscriptionSet.getOrCreateFor(source).unsubscribe(this);\n }\n handleChange(source, arg) {\n // In cases where two or more ReflectAttrBehavior instances are bound to the same element,\n // they will share a Subscriber implementation. In that case, this handle change can be invoked with\n // attributes an instances doesn't need to reflect. This guards against reflecting attrs\n // that shouldn't be reflected.\n if (this.attributes.includes(arg)) {\n DOM.setAttribute(this.target, arg, source.getAttribute(arg));\n }\n }\n}\n/**\n * Reflects attributes from the host element to the target element of the directive.\n * @param attributes - The attributes to reflect\n *\n * @beta\n * @example\n * ```ts\n * const template = html`\n * <button\n * ${reflectAttributes(\"aria-label\", \"aria-describedby\")}\n * >\n * hello world\n * </button\n * `\n * ```\n */\nexport function reflectAttributes(...attributes) {\n return new AttachedBehaviorHTMLDirective(\"fast-reflect-attr\", ReflectAttrBehavior, attributes);\n}\n","import { html, ref } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Disclosure} component.\n * @public\n */\nexport const disclosureTemplate = (context, definition) => html `\n <details class=\"disclosure\" ${ref(\"details\")}>\n <summary\n class=\"invoker\"\n role=\"button\"\n aria-controls=\"disclosure-content\"\n aria-expanded=\"${x => x.expanded}\"\n >\n <slot name=\"start\"></slot>\n <slot name=\"title\">${x => x.title}</slot>\n <slot name=\"end\"></slot>\n </summary>\n <div id=\"disclosure-content\"><slot></slot></div>\n </details>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A Disclosure Custom HTML Element.\n * Based largely on the {@link https://w3c.github.io/aria-practices/#disclosure | disclosure element }.\n *\n * @slot start - Content which can be provided before the summary content\n * @slot end - Content which can be provided after the summary content\n * @slot title - The summary content\n * @slot - The default slot for the disclosure content\n * @fires toggle - fires a toggle event when the summary is toggled\n *\n * @public\n */\nexport class Disclosure extends FoundationElement {\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.setup();\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.details.removeEventListener(\"toggle\", this.onToggle);\n }\n /**\n * Show extra content.\n */\n show() {\n this.details.open = true;\n }\n /**\n * Hide extra content.\n */\n hide() {\n this.details.open = false;\n }\n /**\n * Toggle the current(expanded/collapsed) state.\n */\n toggle() {\n this.details.open = !this.details.open;\n }\n /**\n * Register listener and set default disclosure mode\n */\n setup() {\n this.onToggle = this.onToggle.bind(this);\n this.details.addEventListener(\"toggle\", this.onToggle);\n if (this.expanded) {\n this.show();\n }\n }\n /**\n * Update the aria attr and fire `toggle` event\n */\n onToggle() {\n this.expanded = this.details.open;\n this.$emit(\"toggle\");\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], Disclosure.prototype, \"expanded\", void 0);\n__decorate([\n attr\n], Disclosure.prototype, \"title\", void 0);\n","import { html } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Divider} component.\n * @public\n */\nexport const dividerTemplate = (context, definition) => html `\n <template role=\"${x => x.role}\" aria-orientation=\"${x => x.orientation}\"></template>\n`;\n","/**\n * Standard orientation values\n */\nexport const Orientation = {\n horizontal: \"horizontal\",\n vertical: \"vertical\",\n};\n","/**\n * Divider roles\n * @public\n */\nexport const DividerRole = {\n /**\n * The divider semantically separates content\n */\n separator: \"separator\",\n /**\n * The divider has no semantic value and is for visual presentation only.\n */\n presentation: \"presentation\",\n};\n","import { __decorate } from \"tslib\";\nimport { attr } from \"@microsoft/fast-element\";\nimport { Orientation } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { DividerRole } from \"./divider.options.js\";\nexport { DividerRole };\n/**\n * A Divider Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator } or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.\n *\n * @public\n */\nexport class Divider extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The role of the element.\n *\n * @public\n * @remarks\n * HTML Attribute: role\n */\n this.role = DividerRole.separator;\n /**\n * The orientation of the divider.\n *\n * @public\n * @remarks\n * HTML Attribute: orientation\n */\n this.orientation = Orientation.horizontal;\n }\n}\n__decorate([\n attr\n], Divider.prototype, \"role\", void 0);\n__decorate([\n attr\n], Divider.prototype, \"orientation\", void 0);\n","/**\n * The direction options for flipper.\n * @public\n */\nexport const FlipperDirection = {\n next: \"next\",\n previous: \"previous\",\n};\n","import { html, when } from \"@microsoft/fast-element\";\nimport { FlipperDirection } from \"./flipper.options.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Flipper} component.\n * @public\n */\nexport const flipperTemplate = (context, definition) => html `\n <template\n role=\"button\"\n aria-disabled=\"${x => (x.disabled ? true : void 0)}\"\n tabindex=\"${x => (x.hiddenFromAT ? -1 : 0)}\"\n class=\"${x => x.direction} ${x => (x.disabled ? \"disabled\" : \"\")}\"\n @keyup=\"${(x, c) => x.keyupHandler(c.event)}\"\n >\n ${when(x => x.direction === FlipperDirection.next, html `\n <span part=\"next\" class=\"next\">\n <slot name=\"next\">\n ${definition.next || \"\"}\n </slot>\n </span>\n `)}\n ${when(x => x.direction === FlipperDirection.previous, html `\n <span part=\"previous\" class=\"previous\">\n <slot name=\"previous\">\n ${definition.previous || \"\"}\n </slot>\n </span>\n `)}\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, booleanConverter } from \"@microsoft/fast-element\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\nimport { FlipperDirection } from \"./flipper.options.js\";\nexport { FlipperDirection };\n/**\n * A Flipper Custom HTML Element.\n * Flippers are a form of button that implies directional content navigation, such as in a carousel.\n *\n * @slot next - The next flipper content\n * @slot previous - The previous flipper content\n * @csspart next - Wraps the next flipper content\n * @csspart previous - Wraps the previous flipper content\n * @fires click - Fires a custom 'click' event when Enter or Space is invoked via keyboard and the flipper is exposed to assistive technologies.\n *\n * @public\n */\nexport class Flipper extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Indicates the flipper should be hidden from assistive technology. Because flippers are often supplementary navigation, they are often hidden from assistive technology.\n *\n * @public\n * @defaultValue - true\n * @remarks\n * HTML Attribute: aria-hidden\n */\n this.hiddenFromAT = true;\n /**\n * The direction that the flipper implies navigating.\n *\n * @public\n * @remarks\n * HTML Attribute: direction\n */\n this.direction = FlipperDirection.next;\n }\n /**\n * Simulate a click event when the flipper has focus and the user hits enter or space keys\n * Blur focus if the user hits escape key\n * @param e - Keyboard event\n * @public\n */\n keyupHandler(e) {\n if (!this.hiddenFromAT) {\n const key = e.key;\n if (key === \"Enter\" || key === \"Space\") {\n this.$emit(\"click\", e);\n }\n if (key === \"Escape\") {\n this.blur();\n }\n }\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], Flipper.prototype, \"disabled\", void 0);\n__decorate([\n attr({ attribute: \"aria-hidden\", converter: booleanConverter })\n], Flipper.prototype, \"hiddenFromAT\", void 0);\n__decorate([\n attr\n], Flipper.prototype, \"direction\", void 0);\n","import { html, slotted } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(ListboxOption:class)} component.\n * @public\n */\nexport const listboxOptionTemplate = (context, definition) => html `\n <template\n aria-checked=\"${x => x.ariaChecked}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-posinset=\"${x => x.ariaPosInSet}\"\n aria-selected=\"${x => x.ariaSelected}\"\n aria-setsize=\"${x => x.ariaSetSize}\"\n class=\"${x => [x.checked && \"checked\", x.selected && \"selected\", x.disabled && \"disabled\"]\n .filter(Boolean)\n .join(\" \")}\"\n role=\"option\"\n >\n ${startSlotTemplate(context, definition)}\n <span class=\"content\" part=\"content\">\n <slot ${slotted(\"content\")}></slot>\n </span>\n ${endSlotTemplate(context, definition)}\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, nullableNumberConverter, observable } from \"@microsoft/fast-element\";\nimport { inRange, keyArrowDown, keyArrowUp, keyEnd, keyEscape, keyHome, keySpace, keyTab, } from \"@microsoft/fast-web-utilities\";\nimport { Listbox } from \"./listbox.js\";\n/**\n * A Listbox Custom HTML Element.\n * Implements the {@link https://w3c.github.io/aria/#listbox | ARIA listbox }.\n *\n * @public\n */\nexport class ListboxElement extends Listbox {\n constructor() {\n super(...arguments);\n /**\n * The index of the most recently checked option.\n *\n * @internal\n * @remarks\n * Multiple-selection mode only.\n */\n this.activeIndex = -1;\n /**\n * The start index when checking a range of options.\n *\n * @internal\n */\n this.rangeStartIndex = -1;\n }\n /**\n * Returns the last checked option.\n *\n * @internal\n */\n get activeOption() {\n return this.options[this.activeIndex];\n }\n /**\n * Returns the list of checked options.\n *\n * @internal\n */\n get checkedOptions() {\n var _a;\n return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter(o => o.checked);\n }\n /**\n * Returns the index of the first selected option.\n *\n * @internal\n */\n get firstSelectedOptionIndex() {\n return this.options.indexOf(this.firstSelectedOption);\n }\n /**\n * Updates the `ariaActiveDescendant` property when the active index changes.\n *\n * @param prev - the previous active index\n * @param next - the next active index\n *\n * @internal\n */\n activeIndexChanged(prev, next) {\n var _a, _b;\n this.ariaActiveDescendant = (_b = (_a = this.options[next]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : \"\";\n this.focusAndScrollOptionIntoView();\n }\n /**\n * Toggles the checked state for the currently active option.\n *\n * @remarks\n * Multiple-selection mode only.\n *\n * @internal\n */\n checkActiveIndex() {\n if (!this.multiple) {\n return;\n }\n const activeItem = this.activeOption;\n if (activeItem) {\n activeItem.checked = true;\n }\n }\n /**\n * Sets the active index to the first option and marks it as checked.\n *\n * @remarks\n * Multi-selection mode only.\n *\n * @param preserveChecked - mark all options unchecked before changing the active index\n *\n * @internal\n */\n checkFirstOption(preserveChecked = false) {\n if (preserveChecked) {\n if (this.rangeStartIndex === -1) {\n this.rangeStartIndex = this.activeIndex + 1;\n }\n this.options.forEach((o, i) => {\n o.checked = inRange(i, this.rangeStartIndex);\n });\n }\n else {\n this.uncheckAllOptions();\n }\n this.activeIndex = 0;\n this.checkActiveIndex();\n }\n /**\n * Decrements the active index and sets the matching option as checked.\n *\n * @remarks\n * Multi-selection mode only.\n *\n * @param preserveChecked - mark all options unchecked before changing the active index\n *\n * @internal\n */\n checkLastOption(preserveChecked = false) {\n if (preserveChecked) {\n if (this.rangeStartIndex === -1) {\n this.rangeStartIndex = this.activeIndex;\n }\n this.options.forEach((o, i) => {\n o.checked = inRange(i, this.rangeStartIndex, this.options.length);\n });\n }\n else {\n this.uncheckAllOptions();\n }\n this.activeIndex = this.options.length - 1;\n this.checkActiveIndex();\n }\n /**\n * @override\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"focusout\", this.focusoutHandler);\n }\n /**\n * @override\n * @internal\n */\n disconnectedCallback() {\n this.removeEventListener(\"focusout\", this.focusoutHandler);\n super.disconnectedCallback();\n }\n /**\n * Increments the active index and marks the matching option as checked.\n *\n * @remarks\n * Multiple-selection mode only.\n *\n * @param preserveChecked - mark all options unchecked before changing the active index\n *\n * @internal\n */\n checkNextOption(preserveChecked = false) {\n if (preserveChecked) {\n if (this.rangeStartIndex === -1) {\n this.rangeStartIndex = this.activeIndex;\n }\n this.options.forEach((o, i) => {\n o.checked = inRange(i, this.rangeStartIndex, this.activeIndex + 1);\n });\n }\n else {\n this.uncheckAllOptions();\n }\n this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0;\n this.checkActiveIndex();\n }\n /**\n * Decrements the active index and marks the matching option as checked.\n *\n * @remarks\n * Multiple-selection mode only.\n *\n * @param preserveChecked - mark all options unchecked before changing the active index\n *\n * @internal\n */\n checkPreviousOption(preserveChecked = false) {\n if (preserveChecked) {\n if (this.rangeStartIndex === -1) {\n this.rangeStartIndex = this.activeIndex;\n }\n if (this.checkedOptions.length === 1) {\n this.rangeStartIndex += 1;\n }\n this.options.forEach((o, i) => {\n o.checked = inRange(i, this.activeIndex, this.rangeStartIndex);\n });\n }\n else {\n this.uncheckAllOptions();\n }\n this.activeIndex -= this.activeIndex > 0 ? 1 : 0;\n this.checkActiveIndex();\n }\n /**\n * Handles click events for listbox options.\n *\n * @param e - the event object\n *\n * @override\n * @internal\n */\n clickHandler(e) {\n var _a;\n if (!this.multiple) {\n return super.clickHandler(e);\n }\n const captured = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(`[role=option]`);\n if (!captured || captured.disabled) {\n return;\n }\n this.uncheckAllOptions();\n this.activeIndex = this.options.indexOf(captured);\n this.checkActiveIndex();\n this.toggleSelectedForAllCheckedOptions();\n return true;\n }\n /**\n * @override\n * @internal\n */\n focusAndScrollOptionIntoView() {\n super.focusAndScrollOptionIntoView(this.activeOption);\n }\n /**\n * In multiple-selection mode:\n * If any options are selected, the first selected option is checked when\n * the listbox receives focus. If no options are selected, the first\n * selectable option is checked.\n *\n * @override\n * @internal\n */\n focusinHandler(e) {\n if (!this.multiple) {\n return super.focusinHandler(e);\n }\n if (!this.shouldSkipFocus && e.target === e.currentTarget) {\n this.uncheckAllOptions();\n if (this.activeIndex === -1) {\n this.activeIndex =\n this.firstSelectedOptionIndex !== -1\n ? this.firstSelectedOptionIndex\n : 0;\n }\n this.checkActiveIndex();\n this.setSelectedOptions();\n this.focusAndScrollOptionIntoView();\n }\n this.shouldSkipFocus = false;\n }\n /**\n * Unchecks all options when the listbox loses focus.\n *\n * @internal\n */\n focusoutHandler(e) {\n if (this.multiple) {\n this.uncheckAllOptions();\n }\n }\n /**\n * Handles keydown actions for listbox navigation and typeahead\n *\n * @override\n * @internal\n */\n keydownHandler(e) {\n if (!this.multiple) {\n return super.keydownHandler(e);\n }\n if (this.disabled) {\n return true;\n }\n const { key, shiftKey } = e;\n this.shouldSkipFocus = false;\n switch (key) {\n // Select the first available option\n case keyHome: {\n this.checkFirstOption(shiftKey);\n return;\n }\n // Select the next selectable option\n case keyArrowDown: {\n this.checkNextOption(shiftKey);\n return;\n }\n // Select the previous selectable option\n case keyArrowUp: {\n this.checkPreviousOption(shiftKey);\n return;\n }\n // Select the last available option\n case keyEnd: {\n this.checkLastOption(shiftKey);\n return;\n }\n case keyTab: {\n this.focusAndScrollOptionIntoView();\n return true;\n }\n case keyEscape: {\n this.uncheckAllOptions();\n this.checkActiveIndex();\n return true;\n }\n case keySpace: {\n e.preventDefault();\n if (this.typeAheadExpired) {\n this.toggleSelectedForAllCheckedOptions();\n return;\n }\n }\n // Send key to Typeahead handler\n default: {\n if (key.length === 1) {\n this.handleTypeAhead(`${key}`);\n }\n return true;\n }\n }\n }\n /**\n * Prevents `focusin` events from firing before `click` events when the\n * element is unfocused.\n *\n * @override\n * @internal\n */\n mousedownHandler(e) {\n if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) {\n return super.mousedownHandler(e);\n }\n }\n /**\n * Switches between single-selection and multi-selection mode.\n *\n * @internal\n */\n multipleChanged(prev, next) {\n var _a;\n this.ariaMultiSelectable = next ? \"true\" : null;\n (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {\n o.checked = next ? false : undefined;\n });\n this.setSelectedOptions();\n }\n /**\n * Sets an option as selected and gives it focus.\n *\n * @override\n * @public\n */\n setSelectedOptions() {\n if (!this.multiple) {\n super.setSelectedOptions();\n return;\n }\n if (this.$fastController.isConnected && this.options) {\n this.selectedOptions = this.options.filter(o => o.selected);\n this.focusAndScrollOptionIntoView();\n }\n }\n /**\n * Ensures the size is a positive integer when the property is updated.\n *\n * @param prev - the previous size value\n * @param next - the current size value\n *\n * @internal\n */\n sizeChanged(prev, next) {\n var _a;\n const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : \"\", 10));\n if (size !== next) {\n DOM.queueUpdate(() => {\n this.size = size;\n });\n }\n }\n /**\n * Toggles the selected state of the provided options. If any provided items\n * are in an unselected state, all items are set to selected. If every\n * provided item is selected, they are all unselected.\n *\n * @internal\n */\n toggleSelectedForAllCheckedOptions() {\n const enabledCheckedOptions = this.checkedOptions.filter(o => !o.disabled);\n const force = !enabledCheckedOptions.every(o => o.selected);\n enabledCheckedOptions.forEach(o => (o.selected = force));\n this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]);\n this.setSelectedOptions();\n }\n /**\n * @override\n * @internal\n */\n typeaheadBufferChanged(prev, next) {\n if (!this.multiple) {\n super.typeaheadBufferChanged(prev, next);\n return;\n }\n if (this.$fastController.isConnected) {\n const typeaheadMatches = this.getTypeaheadMatches();\n const activeIndex = this.options.indexOf(typeaheadMatches[0]);\n if (activeIndex > -1) {\n this.activeIndex = activeIndex;\n this.uncheckAllOptions();\n this.checkActiveIndex();\n }\n this.typeAheadExpired = false;\n }\n }\n /**\n * Unchecks all options.\n *\n * @remarks\n * Multiple-selection mode only.\n *\n * @param preserveChecked - reset the rangeStartIndex\n *\n * @internal\n */\n uncheckAllOptions(preserveChecked = false) {\n this.options.forEach(o => (o.checked = this.multiple ? false : undefined));\n if (!preserveChecked) {\n this.rangeStartIndex = -1;\n }\n }\n}\n__decorate([\n observable\n], ListboxElement.prototype, \"activeIndex\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], ListboxElement.prototype, \"multiple\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], ListboxElement.prototype, \"size\", void 0);\n","import { html, slotted } from \"@microsoft/fast-element\";\nimport { ListboxElement } from \"./listbox.element.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Listbox:class)} component.\n * @public\n */\nexport const listboxTemplate = (context, definition) => html `\n <template\n aria-activedescendant=\"${x => x.ariaActiveDescendant}\"\n aria-multiselectable=\"${x => x.ariaMultiSelectable}\"\n class=\"listbox\"\n role=\"listbox\"\n tabindex=\"${x => (!x.disabled ? \"0\" : null)}\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n @focusin=\"${(x, c) => x.focusinHandler(c.event)}\"\n @keydown=\"${(x, c) => x.keydownHandler(c.event)}\"\n @mousedown=\"${(x, c) => x.mousedownHandler(c.event)}\"\n >\n <slot\n ${slotted({\n filter: ListboxElement.slottedOptionFilter,\n flatten: true,\n property: \"slottedOptions\",\n})}\n ></slot>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { uniqueId } from \"@microsoft/fast-web-utilities\";\nimport { observable } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A List Picker Menu Custom HTML Element.\n *\n * @alpha\n */\nexport class PickerMenu extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Children that are list items\n *\n * @internal\n */\n this.optionElements = [];\n }\n menuElementsChanged() {\n this.updateOptions();\n }\n headerElementsChanged() {\n this.updateOptions();\n }\n footerElementsChanged() {\n this.updateOptions();\n }\n updateOptions() {\n this.optionElements.splice(0, this.optionElements.length);\n this.addSlottedListItems(this.headerElements);\n this.addSlottedListItems(this.menuElements);\n this.addSlottedListItems(this.footerElements);\n this.$emit(\"optionsupdated\", { bubbles: false });\n }\n addSlottedListItems(slotChildren) {\n if (slotChildren === undefined) {\n return;\n }\n slotChildren.forEach((child) => {\n if (child.nodeType === 1 && child.getAttribute(\"role\") === \"listitem\") {\n child.id = child.id || uniqueId(\"option-\");\n this.optionElements.push(child);\n }\n });\n }\n}\n__decorate([\n observable\n], PickerMenu.prototype, \"menuElements\", void 0);\n__decorate([\n observable\n], PickerMenu.prototype, \"headerElements\", void 0);\n__decorate([\n observable\n], PickerMenu.prototype, \"footerElements\", void 0);\n__decorate([\n observable\n], PickerMenu.prototype, \"suggestionsAvailableText\", void 0);\n","import { __decorate } from \"tslib\";\nimport { attr, html, observable } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nconst defaultContentsTemplate = html `\n <template>\n ${x => x.value}\n </template>\n`;\n/**\n * A picker list item Custom HTML Element.\n *\n * @alpha\n */\nexport class PickerMenuOption extends FoundationElement {\n contentsTemplateChanged() {\n if (this.$fastController.isConnected) {\n this.updateView();\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.updateView();\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.disconnectView();\n }\n handleClick(e) {\n if (e.defaultPrevented) {\n return false;\n }\n this.handleInvoked();\n return false;\n }\n handleInvoked() {\n this.$emit(\"pickeroptioninvoked\");\n }\n updateView() {\n var _a, _b;\n this.disconnectView();\n this.customView =\n (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this);\n }\n disconnectView() {\n var _a;\n (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose();\n this.customView = undefined;\n }\n}\n__decorate([\n attr({ attribute: \"value\" })\n], PickerMenuOption.prototype, \"value\", void 0);\n__decorate([\n observable\n], PickerMenuOption.prototype, \"contentsTemplate\", void 0);\n","import { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A List Picker Menu Custom HTML Element.\n *\n * @alpha\n */\nexport class PickerList extends FoundationElement {\n}\n","import { __decorate } from \"tslib\";\nimport { attr, html, observable } from \"@microsoft/fast-element\";\nimport { keyEnter } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nconst defaultContentsTemplate = html `\n <template>\n ${x => x.value}\n </template>\n`;\n/**\n * A picker list item Custom HTML Element.\n *\n * @alpha\n */\nexport class PickerListItem extends FoundationElement {\n contentsTemplateChanged() {\n if (this.$fastController.isConnected) {\n this.updateView();\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.updateView();\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n this.disconnectView();\n super.disconnectedCallback();\n }\n handleKeyDown(e) {\n if (e.defaultPrevented) {\n return false;\n }\n if (e.key === keyEnter) {\n this.handleInvoke();\n return false;\n }\n return true;\n }\n handleClick(e) {\n if (!e.defaultPrevented) {\n this.handleInvoke();\n }\n return false;\n }\n handleInvoke() {\n this.$emit(\"pickeriteminvoked\");\n }\n updateView() {\n var _a, _b;\n this.disconnectView();\n this.customView =\n (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this);\n }\n disconnectView() {\n var _a;\n (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose();\n this.customView = undefined;\n }\n}\n__decorate([\n attr({ attribute: \"value\" })\n], PickerListItem.prototype, \"value\", void 0);\n__decorate([\n observable\n], PickerListItem.prototype, \"contentsTemplate\", void 0);\n","import { html, ref, when } from \"@microsoft/fast-element\";\nimport { AnchoredRegion } from \"../anchored-region/anchored-region.js\";\nimport { PickerMenu } from \"./picker-menu.js\";\nimport { PickerMenuOption } from \"./picker-menu-option.js\";\nimport { PickerList } from \"./picker-list.js\";\nimport { PickerListItem } from \"./picker-list-item.js\";\nfunction createDefaultListItemTemplate(context) {\n const pickerListItemTag = context.tagFor(PickerListItem);\n return html `\n <${pickerListItemTag}\n value=\"${x => x}\"\n :contentsTemplate=\"${(x, c) => c.parent.listItemContentsTemplate}\"\n >\n </${pickerListItemTag}>\n `;\n}\nfunction createDefaultMenuOptionTemplate(context) {\n const pickerMenuOptionTag = context.tagFor(PickerMenuOption);\n return html `\n <${pickerMenuOptionTag}\n value=\"${x => x}\"\n :contentsTemplate=\"${(x, c) => c.parent.menuOptionContentsTemplate}\"\n >\n </${pickerMenuOptionTag}>\n `;\n}\n/**\n * The template for the List Picker component.\n * @public\n */\nexport const pickerTemplate = (context, definition) => {\n const anchoredRegionTag = context.tagFor(AnchoredRegion);\n const pickerMenuTag = context.tagFor(PickerMenu);\n const pickerListTag = context.tagFor(PickerList);\n const progressRingTag = context.tagFor(PickerList);\n const defaultListItemTemplate = createDefaultListItemTemplate(context);\n const defaultMenuOptionTemplate = createDefaultMenuOptionTemplate(context);\n return html `\n <template\n :selectedListTag=\"${() => pickerListTag}\"\n :menuTag=\"${() => pickerMenuTag}\"\n :defaultListItemTemplate=\"${defaultListItemTemplate}\"\n :defaultMenuOptionTemplate=\"${defaultMenuOptionTemplate}\"\n @focusin=\"${(x, c) => x.handleFocusIn(c.event)}\"\n @focusout=\"${(x, c) => x.handleFocusOut(c.event)}\"\n @keydown=\"${(x, c) => x.handleKeyDown(c.event)}\"\n @pickeriteminvoked=\"${(x, c) => x.handleItemInvoke(c.event)}\"\n @pickeroptioninvoked=\"${(x, c) => x.handleOptionInvoke(c.event)}\"\n >\n <slot name=\"list-region\"></slot>\n\n ${when(x => x.flyoutOpen, html `\n <${anchoredRegionTag}\n class=\"region\"\n part=\"region\"\n auto-update-mode=\"${x => x.menuConfig.autoUpdateMode}\"\n fixed-placement=\"${x => x.menuConfig.fixedPlacement}\"\n vertical-positioning-mode=\"${x => x.menuConfig.verticalPositioningMode}\"\n vertical-default-position=\"${x => x.menuConfig.verticalDefaultPosition}\"\n vertical-scaling=\"${x => x.menuConfig.verticalScaling}\"\n vertical-inset=\"${x => x.menuConfig.verticalInset}\"\n vertical-viewport-lock=\"${x => x.menuConfig.verticalViewportLock}\"\n horizontal-positioning-mode=\"${x => x.menuConfig.horizontalPositioningMode}\"\n horizontal-default-position=\"${x => x.menuConfig.horizontalDefaultPosition}\"\n horizontal-scaling=\"${x => x.menuConfig.horizontalScaling}\"\n horizontal-inset=\"${x => x.menuConfig.horizontalInset}\"\n horizontal-viewport-lock=\"${x => x.menuConfig.horizontalViewportLock}\"\n @loaded=\"${(x, c) => x.handleRegionLoaded(c.event)}\"\n ${ref(\"region\")}\n >\n ${when(x => !x.showNoOptions && !x.showLoading, html `\n <slot name=\"menu-region\"></slot>\n `)}\n ${when(x => x.showNoOptions && !x.showLoading, html `\n <div class=\"no-options-display\" part=\"no-options-display\">\n <slot name=\"no-options-region\">\n ${x => x.noSuggestionsText}\n </slot>\n </div>\n `)}\n ${when(x => x.showLoading, html `\n <div class=\"loading-display\" part=\"loading-display\">\n <slot name=\"loading-region\">\n <${progressRingTag}\n part=\"loading-progress\"\n class=\"loading-progress\n slot=\"loading-region\"\n ></${progressRingTag}>\n ${x => x.loadingText}\n </slot>\n </div>\n `)}\n </${anchoredRegionTag}>\n `)}\n </template>\n `;\n};\n","import { FormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _Picker extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Picker:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedPicker extends FormAssociated(_Picker) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, html, observable, ref, RepeatDirective, } from \"@microsoft/fast-element\";\nimport { keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyBackspace, keyDelete, keyEnter, keyEscape, uniqueId, } from \"@microsoft/fast-web-utilities\";\nimport { FlyoutPosBottom, FlyoutPosBottomFill, FlyoutPosTallest, FlyoutPosTallestFill, FlyoutPosTop, FlyoutPosTopFill, } from \"../anchored-region/index.js\";\nimport { PickerMenuOption } from \"./picker-menu-option.js\";\nimport { PickerListItem } from \"./picker-list-item.js\";\nimport { FormAssociatedPicker } from \"./picker.form-associated.js\";\nconst pickerInputTemplate = html `\n <input\n slot=\"input-region\"\n role=\"combobox\"\n type=\"text\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n haspopup=\"list\"\n aria-label=\"${x => x.label}\"\n aria-labelledby=\"${x => x.labelledBy}\"\n placeholder=\"${x => x.placeholder}\"\n ${ref(\"inputElement\")}\n ></input>\n`;\n/**\n * A Picker Custom HTML Element. This is an early \"alpha\" version of the component.\n * Developers should expect the api to evolve, breaking changes are possible.\n *\n * @alpha\n */\nexport class Picker extends FormAssociatedPicker {\n constructor() {\n super(...arguments);\n /**\n * Currently selected items. Comma delineated string ie. \"apples,oranges\".\n *\n * @alpha\n * @remarks\n * HTML Attribute: selection\n */\n this.selection = \"\";\n /**\n * Whether the component should remove an option from the list when it is in the selection\n *\n * @alpha\n * @remarks\n * HTML Attribute: filter-selected\n */\n this.filterSelected = true;\n /**\n * Whether the component should remove options based on the current query\n *\n * @alpha\n * @remarks\n * HTML Attribute: filter-query\n */\n this.filterQuery = true;\n /**\n * The text to present to assistive technolgies when no suggestions are available.\n *\n * @alpha\n * @remarks\n * HTML Attribute: no-suggestions-text\n */\n this.noSuggestionsText = \"No suggestions available\";\n /**\n * The text to present to assistive technolgies when suggestions are available.\n *\n * @alpha\n * @remarks\n * HTML Attribute: suggestions-available-text\n */\n this.suggestionsAvailableText = \"Suggestions available\";\n /**\n * The text to present to assistive technologies when suggestions are loading.\n *\n * @alpha\n * @remarks\n * HTML Attribute: loading-text\n */\n this.loadingText = \"Loading suggestions\";\n /**\n * Controls menu placement\n *\n * @alpha\n * @remarks\n * HTML Attribute: menu-placement\n */\n this.menuPlacement = \"bottom-fill\";\n /**\n * Whether to display a loading state if the menu is opened.\n *\n * @alpha\n */\n this.showLoading = false;\n /**\n * Current list of options in array form\n *\n * @alpha\n */\n this.optionsList = [];\n /**\n * Current list of filtered options in array form\n *\n * @internal\n */\n this.filteredOptionsList = [];\n /**\n * Indicates if the flyout menu is open or not\n *\n * @internal\n */\n this.flyoutOpen = false;\n /**\n * Index of currently active menu option\n *\n * @internal\n */\n this.menuFocusIndex = -1;\n /**\n * Internal flag to indicate no options available display should be shown.\n *\n * @internal\n */\n this.showNoOptions = false;\n /**\n *\n *\n * @internal\n */\n this.selectedItems = [];\n this.inputElementView = null;\n /**\n * Handle input event from input element\n */\n this.handleTextInput = (e) => {\n this.query = this.inputElement.value;\n };\n /**\n * Handle click event from input element\n */\n this.handleInputClick = (e) => {\n e.preventDefault();\n this.toggleFlyout(true);\n };\n /**\n * Sets properties on the anchored region once it is instanciated.\n */\n this.setRegionProps = () => {\n if (!this.flyoutOpen) {\n return;\n }\n if (this.region === null || this.region === undefined) {\n // TODO: limit this\n DOM.queueUpdate(this.setRegionProps);\n return;\n }\n this.region.anchorElement = this.inputElement;\n };\n /**\n * matches menu placement values with the associated menu config\n */\n this.configLookup = {\n top: FlyoutPosTop,\n bottom: FlyoutPosBottom,\n tallest: FlyoutPosTallest,\n \"top-fill\": FlyoutPosTopFill,\n \"bottom-fill\": FlyoutPosBottomFill,\n \"tallest-fill\": FlyoutPosTallestFill,\n };\n }\n selectionChanged() {\n if (this.$fastController.isConnected) {\n this.handleSelectionChange();\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.value = this.selection;\n this.validate();\n }\n }\n }\n optionsChanged() {\n this.optionsList = this.options\n .split(\",\")\n .map(opt => opt.trim())\n .filter(opt => opt !== \"\");\n }\n menuPlacementChanged() {\n if (this.$fastController.isConnected) {\n this.updateMenuConfig();\n }\n }\n showLoadingChanged() {\n if (this.$fastController.isConnected) {\n DOM.queueUpdate(() => {\n this.setFocusedOption(0);\n });\n }\n }\n listItemTemplateChanged() {\n this.updateListItemTemplate();\n }\n defaultListItemTemplateChanged() {\n this.updateListItemTemplate();\n }\n menuOptionTemplateChanged() {\n this.updateOptionTemplate();\n }\n defaultMenuOptionTemplateChanged() {\n this.updateOptionTemplate();\n }\n optionsListChanged() {\n this.updateFilteredOptions();\n }\n queryChanged() {\n if (this.$fastController.isConnected) {\n if (this.inputElement.value !== this.query) {\n this.inputElement.value = this.query;\n }\n this.updateFilteredOptions();\n this.$emit(\"querychange\", { bubbles: false });\n }\n }\n filteredOptionsListChanged() {\n if (this.$fastController.isConnected) {\n this.showNoOptions =\n this.filteredOptionsList.length === 0 &&\n this.menuElement.querySelectorAll('[role=\"listitem\"]').length === 0;\n this.setFocusedOption(this.showNoOptions ? -1 : 0);\n }\n }\n flyoutOpenChanged() {\n if (this.flyoutOpen) {\n DOM.queueUpdate(this.setRegionProps);\n this.$emit(\"menuopening\", { bubbles: false });\n }\n else {\n this.$emit(\"menuclosing\", { bubbles: false });\n }\n }\n showNoOptionsChanged() {\n if (this.$fastController.isConnected) {\n DOM.queueUpdate(() => {\n this.setFocusedOption(0);\n });\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.listElement = document.createElement(this.selectedListTag);\n this.appendChild(this.listElement);\n this.itemsPlaceholderElement = document.createComment(\"\");\n this.listElement.append(this.itemsPlaceholderElement);\n this.inputElementView = pickerInputTemplate.render(this, this.listElement);\n const match = this.menuTag.toUpperCase();\n this.menuElement = Array.from(this.children).find((element) => {\n return element.tagName === match;\n });\n if (this.menuElement === undefined) {\n this.menuElement = document.createElement(this.menuTag);\n this.appendChild(this.menuElement);\n }\n if (this.menuElement.id === \"\") {\n this.menuElement.id = uniqueId(\"listbox-\");\n }\n this.menuId = this.menuElement.id;\n this.optionsPlaceholder = document.createComment(\"\");\n this.menuElement.append(this.optionsPlaceholder);\n this.updateMenuConfig();\n DOM.queueUpdate(() => this.initialize());\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.toggleFlyout(false);\n this.inputElement.removeEventListener(\"input\", this.handleTextInput);\n this.inputElement.removeEventListener(\"click\", this.handleInputClick);\n if (this.inputElementView !== null) {\n this.inputElementView.dispose();\n this.inputElementView = null;\n }\n }\n /**\n * Move focus to the input element\n * @public\n */\n focus() {\n this.inputElement.focus();\n }\n /**\n * Initialize the component. This is delayed a frame to ensure children are connected as well.\n */\n initialize() {\n this.updateListItemTemplate();\n this.updateOptionTemplate();\n this.itemsRepeatBehavior = new RepeatDirective(x => x.selectedItems, x => x.activeListItemTemplate, { positioning: true }).createBehavior(this.itemsPlaceholderElement);\n this.inputElement.addEventListener(\"input\", this.handleTextInput);\n this.inputElement.addEventListener(\"click\", this.handleInputClick);\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n this.$fastController.addBehaviors([this.itemsRepeatBehavior]);\n this.menuElement.suggestionsAvailableText = this.suggestionsAvailableText;\n this.menuElement.addEventListener(\"optionsupdated\", this.handleMenuOptionsUpdated);\n this.optionsRepeatBehavior = new RepeatDirective(x => x.filteredOptionsList, x => x.activeMenuOptionTemplate, { positioning: true }).createBehavior(this.optionsPlaceholder);\n /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n this.$fastController.addBehaviors([this.optionsRepeatBehavior]);\n this.handleSelectionChange();\n }\n /**\n * Toggles the menu flyout\n */\n toggleFlyout(open) {\n if (this.flyoutOpen === open) {\n return;\n }\n if (open && document.activeElement === this.inputElement) {\n this.flyoutOpen = open;\n DOM.queueUpdate(() => {\n if (this.menuElement !== undefined) {\n this.setFocusedOption(0);\n }\n else {\n this.disableMenu();\n }\n });\n return;\n }\n this.flyoutOpen = false;\n this.disableMenu();\n return;\n }\n /**\n * Handle the menu options updated event from the child menu\n */\n handleMenuOptionsUpdated(e) {\n e.preventDefault();\n if (this.flyoutOpen) {\n this.setFocusedOption(0);\n }\n }\n /**\n * Handle key down events.\n */\n handleKeyDown(e) {\n if (e.defaultPrevented) {\n return false;\n }\n switch (e.key) {\n // TODO: what should \"home\" and \"end\" keys do, exactly?\n //\n // case keyHome: {\n // if (!this.flyoutOpen) {\n // this.toggleFlyout(true);\n // } else {\n // if (this.menuElement.optionElements.length > 0) {\n // this.setFocusedOption(0);\n // }\n // }\n // return false;\n // }\n // case keyEnd: {\n // if (!this.flyoutOpen) {\n // this.toggleFlyout(true);\n // } else {\n // if (this.menuElement.optionElements.length > 0) {\n // this.toggleFlyout(true);\n // this.setFocusedOption(this.menuElement.optionElements.length - 1);\n // }\n // }\n // return false;\n // }\n case keyArrowDown: {\n if (!this.flyoutOpen) {\n this.toggleFlyout(true);\n }\n else {\n const nextFocusOptionIndex = this.flyoutOpen\n ? Math.min(this.menuFocusIndex + 1, this.menuElement.optionElements.length - 1)\n : 0;\n this.setFocusedOption(nextFocusOptionIndex);\n }\n return false;\n }\n case keyArrowUp: {\n if (!this.flyoutOpen) {\n this.toggleFlyout(true);\n }\n else {\n const previousFocusOptionIndex = this.flyoutOpen\n ? Math.max(this.menuFocusIndex - 1, 0)\n : 0;\n this.setFocusedOption(previousFocusOptionIndex);\n }\n return false;\n }\n case keyEscape: {\n this.toggleFlyout(false);\n return false;\n }\n case keyEnter: {\n if (this.menuFocusIndex !== -1 &&\n this.menuElement.optionElements.length > this.menuFocusIndex) {\n this.menuElement.optionElements[this.menuFocusIndex].click();\n }\n return false;\n }\n case keyArrowRight: {\n if (document.activeElement !== this.inputElement) {\n this.incrementFocusedItem(1);\n return false;\n }\n // don't block if arrow keys moving caret in input element\n return true;\n }\n case keyArrowLeft: {\n if (this.inputElement.selectionStart === 0) {\n this.incrementFocusedItem(-1);\n return false;\n }\n // don't block if arrow keys moving caret in input element\n return true;\n }\n case keyDelete:\n case keyBackspace: {\n if (document.activeElement === null) {\n return true;\n }\n if (document.activeElement === this.inputElement) {\n if (this.inputElement.selectionStart === 0) {\n this.selection = this.selectedItems\n .slice(0, this.selectedItems.length - 1)\n .toString();\n this.toggleFlyout(false);\n return false;\n }\n // let text deletion proceed\n return true;\n }\n const selectedItems = Array.from(this.listElement.children);\n const currentFocusedItemIndex = selectedItems.indexOf(document.activeElement);\n if (currentFocusedItemIndex > -1) {\n // delete currently focused item\n this.selection = this.selectedItems\n .splice(currentFocusedItemIndex, 1)\n .toString();\n DOM.queueUpdate(() => {\n selectedItems[Math.min(selectedItems.length, currentFocusedItemIndex)].focus();\n });\n return false;\n }\n return true;\n }\n }\n this.toggleFlyout(true);\n return true;\n }\n /**\n * Handle focus in events.\n */\n handleFocusIn(e) {\n return false;\n }\n /**\n * Handle focus out events.\n */\n handleFocusOut(e) {\n if (this.menuElement === undefined ||\n !this.menuElement.contains(e.relatedTarget)) {\n this.toggleFlyout(false);\n }\n return false;\n }\n /**\n * The list of selected items has changed\n */\n handleSelectionChange() {\n if (this.selectedItems.toString() === this.selection) {\n return;\n }\n this.selectedItems = this.selection === \"\" ? [] : this.selection.split(\",\");\n this.updateFilteredOptions();\n DOM.queueUpdate(() => {\n this.checkMaxItems();\n });\n this.$emit(\"selectionchange\", { bubbles: false });\n }\n /**\n * Anchored region is loaded, menu and options exist in the DOM.\n */\n handleRegionLoaded(e) {\n DOM.queueUpdate(() => {\n this.setFocusedOption(0);\n this.$emit(\"menuloaded\", { bubbles: false });\n });\n }\n /**\n * Checks if the maximum number of items has been chosen and updates the ui.\n */\n checkMaxItems() {\n if (this.inputElement === undefined) {\n return;\n }\n if (this.maxSelected !== undefined &&\n this.selectedItems.length >= this.maxSelected) {\n if (document.activeElement === this.inputElement) {\n const selectedItemInstances = Array.from(this.listElement.querySelectorAll(\"[role='listitem']\"));\n selectedItemInstances[selectedItemInstances.length - 1].focus();\n }\n this.inputElement.hidden = true;\n }\n else {\n this.inputElement.hidden = false;\n }\n }\n /**\n * A list item has been invoked.\n */\n handleItemInvoke(e) {\n if (e.defaultPrevented) {\n return false;\n }\n if (e.target instanceof PickerListItem) {\n const listItems = Array.from(this.listElement.querySelectorAll(\"[role='listitem']\"));\n const itemIndex = listItems.indexOf(e.target);\n if (itemIndex !== -1) {\n const newSelection = this.selectedItems.slice();\n newSelection.splice(itemIndex, 1);\n this.selection = newSelection.toString();\n DOM.queueUpdate(() => this.incrementFocusedItem(0));\n }\n return false;\n }\n return true;\n }\n /**\n * A menu option has been invoked.\n */\n handleOptionInvoke(e) {\n if (e.defaultPrevented) {\n return false;\n }\n if (e.target instanceof PickerMenuOption) {\n if (e.target.value !== undefined) {\n this.selection = `${this.selection}${this.selection === \"\" ? \"\" : \",\"}${e.target.value}`;\n }\n this.inputElement.value = \"\";\n this.query = \"\";\n this.inputElement.focus();\n this.toggleFlyout(false);\n return false;\n }\n // const value: string = (e.target as PickerMenuOption).value;\n return true;\n }\n /**\n * Increments the focused list item by the specified amount\n */\n incrementFocusedItem(increment) {\n if (this.selectedItems.length === 0) {\n this.inputElement.focus();\n return;\n }\n const selectedItemsAsElements = Array.from(this.listElement.querySelectorAll(\"[role='listitem']\"));\n if (document.activeElement !== null) {\n let currentFocusedItemIndex = selectedItemsAsElements.indexOf(document.activeElement);\n if (currentFocusedItemIndex === -1) {\n // use the input element\n currentFocusedItemIndex = selectedItemsAsElements.length;\n }\n const newFocusedItemIndex = Math.min(selectedItemsAsElements.length, Math.max(0, currentFocusedItemIndex + increment));\n if (newFocusedItemIndex === selectedItemsAsElements.length) {\n if (this.maxSelected !== undefined &&\n this.selectedItems.length >= this.maxSelected) {\n selectedItemsAsElements[newFocusedItemIndex - 1].focus();\n }\n else {\n this.inputElement.focus();\n }\n }\n else {\n selectedItemsAsElements[newFocusedItemIndex].focus();\n }\n }\n }\n /**\n * Disables the menu. Note that the menu can be open, just doens't have any valid options on display.\n */\n disableMenu() {\n var _a, _b, _c;\n this.menuFocusIndex = -1;\n this.menuFocusOptionId = undefined;\n (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeAttribute(\"aria-activedescendant\");\n (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeAttribute(\"aria-owns\");\n (_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeAttribute(\"aria-expanded\");\n }\n /**\n * Sets the currently focused menu option by index\n */\n setFocusedOption(optionIndex) {\n if (!this.flyoutOpen ||\n optionIndex === -1 ||\n this.showNoOptions ||\n this.showLoading) {\n this.disableMenu();\n return;\n }\n if (this.menuElement.optionElements.length === 0) {\n return;\n }\n this.menuElement.optionElements.forEach((element) => {\n element.setAttribute(\"aria-selected\", \"false\");\n });\n this.menuFocusIndex = optionIndex;\n if (this.menuFocusIndex > this.menuElement.optionElements.length - 1) {\n this.menuFocusIndex = this.menuElement.optionElements.length - 1;\n }\n this.menuFocusOptionId = this.menuElement.optionElements[this.menuFocusIndex].id;\n this.inputElement.setAttribute(\"aria-owns\", this.menuId);\n this.inputElement.setAttribute(\"aria-expanded\", \"true\");\n this.inputElement.setAttribute(\"aria-activedescendant\", this.menuFocusOptionId);\n const focusedOption = this.menuElement.optionElements[this.menuFocusIndex];\n focusedOption.setAttribute(\"aria-selected\", \"true\");\n this.menuElement.scrollTo(0, focusedOption.offsetTop);\n }\n /**\n * Updates the template used for the list item repeat behavior\n */\n updateListItemTemplate() {\n var _a;\n this.activeListItemTemplate =\n (_a = this.listItemTemplate) !== null && _a !== void 0 ? _a : this.defaultListItemTemplate;\n }\n /**\n * Updates the template used for the menu option repeat behavior\n */\n updateOptionTemplate() {\n var _a;\n this.activeMenuOptionTemplate =\n (_a = this.menuOptionTemplate) !== null && _a !== void 0 ? _a : this.defaultMenuOptionTemplate;\n }\n /**\n * Updates the filtered options array\n */\n updateFilteredOptions() {\n this.filteredOptionsList = this.optionsList.slice(0);\n if (this.filterSelected) {\n this.filteredOptionsList = this.filteredOptionsList.filter(el => this.selectedItems.indexOf(el) === -1);\n }\n if (this.filterQuery && this.query !== \"\" && this.query !== undefined) {\n this.filteredOptionsList = this.filteredOptionsList.filter(el => el.indexOf(this.query) !== -1);\n }\n }\n /**\n * Updates the menu configuration\n */\n updateMenuConfig() {\n let newConfig = this.configLookup[this.menuPlacement];\n if (newConfig === null) {\n newConfig = FlyoutPosBottomFill;\n }\n this.menuConfig = Object.assign(Object.assign({}, newConfig), { autoUpdateMode: \"auto\", fixedPlacement: true, horizontalViewportLock: false, verticalViewportLock: false });\n }\n}\n__decorate([\n attr({ attribute: \"selection\" })\n], Picker.prototype, \"selection\", void 0);\n__decorate([\n attr({ attribute: \"options\" })\n], Picker.prototype, \"options\", void 0);\n__decorate([\n attr({ attribute: \"filter-selected\", mode: \"boolean\" })\n], Picker.prototype, \"filterSelected\", void 0);\n__decorate([\n attr({ attribute: \"filter-query\", mode: \"boolean\" })\n], Picker.prototype, \"filterQuery\", void 0);\n__decorate([\n attr({ attribute: \"max-selected\" })\n], Picker.prototype, \"maxSelected\", void 0);\n__decorate([\n attr({ attribute: \"no-suggestions-text\" })\n], Picker.prototype, \"noSuggestionsText\", void 0);\n__decorate([\n attr({ attribute: \"suggestions-available-text\" })\n], Picker.prototype, \"suggestionsAvailableText\", void 0);\n__decorate([\n attr({ attribute: \"loading-text\" })\n], Picker.prototype, \"loadingText\", void 0);\n__decorate([\n attr({ attribute: \"label\" })\n], Picker.prototype, \"label\", void 0);\n__decorate([\n attr({ attribute: \"labelledby\" })\n], Picker.prototype, \"labelledBy\", void 0);\n__decorate([\n attr({ attribute: \"placeholder\" })\n], Picker.prototype, \"placeholder\", void 0);\n__decorate([\n attr({ attribute: \"menu-placement\" })\n], Picker.prototype, \"menuPlacement\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"showLoading\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"listItemTemplate\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"defaultListItemTemplate\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"activeListItemTemplate\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"menuOptionTemplate\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"defaultMenuOptionTemplate\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"activeMenuOptionTemplate\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"listItemContentsTemplate\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"menuOptionContentsTemplate\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"optionsList\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"query\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"filteredOptionsList\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"flyoutOpen\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"menuId\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"selectedListTag\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"menuTag\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"menuFocusIndex\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"menuFocusOptionId\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"showNoOptions\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"menuConfig\", void 0);\n__decorate([\n observable\n], Picker.prototype, \"selectedItems\", void 0);\n","import { html, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the List Picker component.\n * @public\n */\nexport const pickerMenuTemplate = (context, definition) => {\n return html `\n <template role=\"list\" slot=\"menu-region\">\n <div class=\"options-display\" part=\"options-display\">\n <div class=\"header-region\" part=\"header-region\">\n <slot name=\"header-region\" ${slotted(\"headerElements\")}></slot>\n </div>\n\n <slot ${slotted(\"menuElements\")}></slot>\n <div class=\"footer-region\" part=\"footer-region\">\n <slot name=\"footer-region\" ${slotted(\"footerElements\")}></slot>\n </div>\n <div\n role=\"alert\"\n aria-live=\"polite\"\n part=\"suggestions-available-alert\"\n class=\"suggestions-available-alert\"\n >\n ${x => x.suggestionsAvailableText}\n </div>\n </div>\n </template>\n `;\n};\n","import { html } from \"@microsoft/fast-element\";\n/**\n *\n * @public\n */\nexport const pickerMenuOptionTemplate = (context, definition) => {\n return html `\n <template\n role=\"listitem\"\n tabindex=\"-1\"\n @click=\"${(x, c) => x.handleClick(c.event)}\"\n >\n <slot></slot>\n </template>\n `;\n};\n","import { html } from \"@microsoft/fast-element\";\n/**\n *\n * @public\n */\nexport const pickerListTemplate = (context, definition) => {\n return html `\n <template slot=\"list-region\" role=\"list\" class=\"picker-list\">\n <slot></slot>\n <slot name=\"input-region\"></slot>\n </template>\n `;\n};\n","import { html } from \"@microsoft/fast-element\";\n/**\n *\n * @public\n */\nexport const pickerListItemTemplate = (context, definition) => {\n return html `\n <template\n role=\"listitem\"\n tabindex=\"0\"\n @click=\"${(x, c) => x.handleClick(c.event)}\"\n @keydown=\"${(x, c) => x.handleKeyDown(c.event)}\"\n >\n <slot></slot>\n </template>\n `;\n};\n","/**\n * Menu items roles.\n * @public\n */\nexport const MenuItemRole = {\n /**\n * The menu item has a \"menuitem\" role\n */\n menuitem: \"menuitem\",\n /**\n * The menu item has a \"menuitemcheckbox\" role\n */\n menuitemcheckbox: \"menuitemcheckbox\",\n /**\n * The menu item has a \"menuitemradio\" role\n */\n menuitemradio: \"menuitemradio\",\n};\n/**\n * @internal\n */\nexport const roleForMenuItem = {\n [MenuItemRole.menuitem]: \"menuitem\",\n [MenuItemRole.menuitemcheckbox]: \"menuitemcheckbox\",\n [MenuItemRole.menuitemradio]: \"menuitemradio\",\n};\n","import { html, ref, when } from \"@microsoft/fast-element\";\nimport { AnchoredRegion } from \"../anchored-region/anchored-region.js\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\nimport { MenuItemRole } from \"./menu-item.js\";\n/**\n * Generates a template for the {@link @microsoft/fast-foundation#(MenuItem:class)} component using\n * the provided prefix.\n *\n * @public\n */\nexport const menuItemTemplate = (context, definition) => html `\n <template\n role=\"${x => x.role}\"\n aria-haspopup=\"${x => (x.hasSubmenu ? \"menu\" : void 0)}\"\n aria-checked=\"${x => (x.role !== MenuItemRole.menuitem ? x.checked : void 0)}\"\n aria-disabled=\"${x => x.disabled}\"\n aria-expanded=\"${x => x.expanded}\"\n @keydown=\"${(x, c) => x.handleMenuItemKeyDown(c.event)}\"\n @click=\"${(x, c) => x.handleMenuItemClick(c.event)}\"\n @mouseover=\"${(x, c) => x.handleMouseOver(c.event)}\"\n @mouseout=\"${(x, c) => x.handleMouseOut(c.event)}\"\n class=\"${x => (x.disabled ? \"disabled\" : \"\")} ${x => x.expanded ? \"expanded\" : \"\"} ${x => `indent-${x.startColumnCount}`}\"\n >\n ${when(x => x.role === MenuItemRole.menuitemcheckbox, html `\n <div part=\"input-container\" class=\"input-container\">\n <span part=\"checkbox\" class=\"checkbox\">\n <slot name=\"checkbox-indicator\">\n ${definition.checkboxIndicator || \"\"}\n </slot>\n </span>\n </div>\n `)}\n ${when(x => x.role === MenuItemRole.menuitemradio, html `\n <div part=\"input-container\" class=\"input-container\">\n <span part=\"radio\" class=\"radio\">\n <slot name=\"radio-indicator\">\n ${definition.radioIndicator || \"\"}\n </slot>\n </span>\n </div>\n `)}\n </div>\n ${startSlotTemplate(context, definition)}\n <span class=\"content\" part=\"content\">\n <slot></slot>\n </span>\n ${endSlotTemplate(context, definition)}\n ${when(x => x.hasSubmenu, html `\n <div\n part=\"expand-collapse-glyph-container\"\n class=\"expand-collapse-glyph-container\"\n >\n <span part=\"expand-collapse\" class=\"expand-collapse\">\n <slot name=\"expand-collapse-indicator\">\n ${definition.expandCollapseGlyph || \"\"}\n </slot>\n </span>\n </div>\n `)}\n ${when(x => x.expanded, html `\n <${context.tagFor(AnchoredRegion)}\n :anchorElement=\"${x => x}\"\n vertical-positioning-mode=\"dynamic\"\n vertical-default-position=\"bottom\"\n vertical-inset=\"true\"\n horizontal-positioning-mode=\"dynamic\"\n horizontal-default-position=\"end\"\n class=\"submenu-region\"\n dir=\"${x => x.currentDirection}\"\n @loaded=\"${x => x.submenuLoaded()}\"\n ${ref(\"submenuRegion\")}\n part=\"submenu-region\"\n >\n <slot name=\"submenu\"></slot>\n </${context.tagFor(AnchoredRegion)}>\n `)}\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, observable } from \"@microsoft/fast-element\";\nimport { Direction, keyArrowLeft, keyArrowRight, keyEnter, keySpace, } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { getDirection } from \"../utilities/direction.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { MenuItemRole, roleForMenuItem } from \"./menu-item.options.js\";\nexport { MenuItemRole, roleForMenuItem };\n/**\n * A Switch Custom HTML Element.\n * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.\n *\n * @slot checked-indicator - The checked indicator\n * @slot radio-indicator - The radio indicator\n * @slot start - Content which can be provided before the menu item content\n * @slot end - Content which can be provided after the menu item content\n * @slot - The default slot for menu item content\n * @slot expand-collapse-indicator - The expand/collapse indicator\n * @slot submenu - Used to nest menu's within menu items\n * @csspart input-container - The element representing the visual checked or radio indicator\n * @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator\n * @csspart radio - The element wrapping the `menuitemradio` indicator\n * @csspart content - The element wrapping the menu item content\n * @csspart expand-collapse-glyph-container - The element wrapping the expand collapse element\n * @csspart expand-collapse - The expand/collapse element\n * @csspart submenu-region - The container for the submenu, used for positioning\n * @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes\n * @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked\n *\n * @public\n */\nexport class MenuItem extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The role of the element.\n *\n * @public\n * @remarks\n * HTML Attribute: role\n */\n this.role = MenuItemRole.menuitem;\n /**\n * @internal\n */\n this.hasSubmenu = false;\n /**\n * Track current direction to pass to the anchored region\n *\n * @internal\n */\n this.currentDirection = Direction.ltr;\n this.focusSubmenuOnLoad = false;\n /**\n * @internal\n */\n this.handleMenuItemKeyDown = (e) => {\n if (e.defaultPrevented) {\n return false;\n }\n switch (e.key) {\n case keyEnter:\n case keySpace:\n this.invoke();\n return false;\n case keyArrowRight:\n //open/focus on submenu\n this.expandAndFocus();\n return false;\n case keyArrowLeft:\n //close submenu\n if (this.expanded) {\n this.expanded = false;\n this.focus();\n return false;\n }\n }\n return true;\n };\n /**\n * @internal\n */\n this.handleMenuItemClick = (e) => {\n if (e.defaultPrevented || this.disabled) {\n return false;\n }\n this.invoke();\n return false;\n };\n /**\n * @internal\n */\n this.submenuLoaded = () => {\n if (!this.focusSubmenuOnLoad) {\n return;\n }\n this.focusSubmenuOnLoad = false;\n if (this.hasSubmenu) {\n this.submenu.focus();\n this.setAttribute(\"tabindex\", \"-1\");\n }\n };\n /**\n * @internal\n */\n this.handleMouseOver = (e) => {\n if (this.disabled || !this.hasSubmenu || this.expanded) {\n return false;\n }\n this.expanded = true;\n return false;\n };\n /**\n * @internal\n */\n this.handleMouseOut = (e) => {\n if (!this.expanded || this.contains(document.activeElement)) {\n return false;\n }\n this.expanded = false;\n return false;\n };\n /**\n * @internal\n */\n this.expandAndFocus = () => {\n if (!this.hasSubmenu) {\n return;\n }\n this.focusSubmenuOnLoad = true;\n this.expanded = true;\n };\n /**\n * @internal\n */\n this.invoke = () => {\n if (this.disabled) {\n return;\n }\n switch (this.role) {\n case MenuItemRole.menuitemcheckbox:\n this.checked = !this.checked;\n break;\n case MenuItemRole.menuitem:\n // update submenu\n this.updateSubmenu();\n if (this.hasSubmenu) {\n this.expandAndFocus();\n }\n else {\n this.$emit(\"change\");\n }\n break;\n case MenuItemRole.menuitemradio:\n if (!this.checked) {\n this.checked = true;\n }\n break;\n }\n };\n /**\n * Gets the submenu element if any\n *\n * @internal\n */\n this.updateSubmenu = () => {\n this.submenu = this.domChildren().find((element) => {\n return element.getAttribute(\"role\") === \"menu\";\n });\n this.hasSubmenu = this.submenu === undefined ? false : true;\n };\n }\n expandedChanged(oldValue) {\n if (this.$fastController.isConnected) {\n if (this.submenu === undefined) {\n return;\n }\n if (this.expanded === false) {\n this.submenu.collapseExpandedItem();\n }\n else {\n this.currentDirection = getDirection(this);\n }\n this.$emit(\"expanded-change\", this, { bubbles: false });\n }\n }\n checkedChanged(oldValue, newValue) {\n if (this.$fastController.isConnected) {\n this.$emit(\"change\");\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n DOM.queueUpdate(() => {\n this.updateSubmenu();\n });\n if (!this.startColumnCount) {\n this.startColumnCount = 1;\n }\n this.observer = new MutationObserver(this.updateSubmenu);\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.submenu = undefined;\n if (this.observer !== undefined) {\n this.observer.disconnect();\n this.observer = undefined;\n }\n }\n /**\n * get an array of valid DOM children\n */\n domChildren() {\n return Array.from(this.children).filter(child => !child.hasAttribute(\"hidden\"));\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], MenuItem.prototype, \"disabled\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], MenuItem.prototype, \"expanded\", void 0);\n__decorate([\n observable\n], MenuItem.prototype, \"startColumnCount\", void 0);\n__decorate([\n attr\n], MenuItem.prototype, \"role\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], MenuItem.prototype, \"checked\", void 0);\n__decorate([\n observable\n], MenuItem.prototype, \"submenuRegion\", void 0);\n__decorate([\n observable\n], MenuItem.prototype, \"hasSubmenu\", void 0);\n__decorate([\n observable\n], MenuItem.prototype, \"currentDirection\", void 0);\n__decorate([\n observable\n], MenuItem.prototype, \"submenu\", void 0);\napplyMixins(MenuItem, StartEnd);\n","import { html, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Menu} component.\n * @public\n */\nexport const menuTemplate = (context, definition) => html `\n <template\n slot=\"${x => (x.slot ? x.slot : x.isNestedMenu() ? \"submenu\" : void 0)}\"\n role=\"menu\"\n @keydown=\"${(x, c) => x.handleMenuKeyDown(c.event)}\"\n @focusout=\"${(x, c) => x.handleFocusOut(c.event)}\"\n >\n <slot ${slotted(\"items\")}></slot>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { DOM, observable } from \"@microsoft/fast-element\";\nimport { isHTMLElement, keyArrowDown, keyArrowUp, keyEnd, keyHome, } from \"@microsoft/fast-web-utilities\";\nimport { MenuItem, MenuItemRole, roleForMenuItem, } from \"../menu-item/index.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A Menu Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#menu | ARIA menu }.\n *\n * @slot - The default slot for the menu items\n *\n * @public\n */\nexport class Menu extends FoundationElement {\n constructor() {\n super(...arguments);\n this.expandedItem = null;\n /**\n * The index of the focusable element in the items array\n * defaults to -1\n */\n this.focusIndex = -1;\n /**\n * @internal\n */\n this.isNestedMenu = () => {\n return (this.parentElement !== null &&\n isHTMLElement(this.parentElement) &&\n this.parentElement.getAttribute(\"role\") === \"menuitem\");\n };\n /**\n * if focus is moving out of the menu, reset to a stable initial state\n * @internal\n */\n this.handleFocusOut = (e) => {\n if (!this.contains(e.relatedTarget) && this.menuItems !== undefined) {\n this.collapseExpandedItem();\n // find our first focusable element\n const focusIndex = this.menuItems.findIndex(this.isFocusableElement);\n // set the current focus index's tabindex to -1\n this.menuItems[this.focusIndex].setAttribute(\"tabindex\", \"-1\");\n // set the first focusable element tabindex to 0\n this.menuItems[focusIndex].setAttribute(\"tabindex\", \"0\");\n // set the focus index\n this.focusIndex = focusIndex;\n }\n };\n this.handleItemFocus = (e) => {\n const targetItem = e.target;\n if (this.menuItems !== undefined &&\n targetItem !== this.menuItems[this.focusIndex]) {\n this.menuItems[this.focusIndex].setAttribute(\"tabindex\", \"-1\");\n this.focusIndex = this.menuItems.indexOf(targetItem);\n targetItem.setAttribute(\"tabindex\", \"0\");\n }\n };\n this.handleExpandedChanged = (e) => {\n if (e.defaultPrevented ||\n e.target === null ||\n this.menuItems === undefined ||\n this.menuItems.indexOf(e.target) < 0) {\n return;\n }\n e.preventDefault();\n const changedItem = e.target;\n // closing an expanded item without opening another\n if (this.expandedItem !== null &&\n changedItem === this.expandedItem &&\n changedItem.expanded === false) {\n this.expandedItem = null;\n return;\n }\n if (changedItem.expanded) {\n if (this.expandedItem !== null && this.expandedItem !== changedItem) {\n this.expandedItem.expanded = false;\n }\n this.menuItems[this.focusIndex].setAttribute(\"tabindex\", \"-1\");\n this.expandedItem = changedItem;\n this.focusIndex = this.menuItems.indexOf(changedItem);\n changedItem.setAttribute(\"tabindex\", \"0\");\n }\n };\n this.removeItemListeners = () => {\n if (this.menuItems !== undefined) {\n this.menuItems.forEach((item) => {\n item.removeEventListener(\"expanded-change\", this.handleExpandedChanged);\n item.removeEventListener(\"focus\", this.handleItemFocus);\n });\n }\n };\n this.setItems = () => {\n const newItems = this.domChildren();\n this.removeItemListeners();\n this.menuItems = newItems;\n const menuItems = this.menuItems.filter(this.isMenuItemElement);\n // if our focus index is not -1 we have items\n if (menuItems.length) {\n this.focusIndex = 0;\n }\n function elementIndent(el) {\n const role = el.getAttribute(\"role\");\n const startSlot = el.querySelector(\"[slot=start]\");\n if (role !== MenuItemRole.menuitem && startSlot === null) {\n return 1;\n }\n else if (role === MenuItemRole.menuitem && startSlot !== null) {\n return 1;\n }\n else if (role !== MenuItemRole.menuitem && startSlot !== null) {\n return 2;\n }\n else {\n return 0;\n }\n }\n const indent = menuItems.reduce((accum, current) => {\n const elementValue = elementIndent(current);\n return accum > elementValue ? accum : elementValue;\n }, 0);\n menuItems.forEach((item, index) => {\n item.setAttribute(\"tabindex\", index === 0 ? \"0\" : \"-1\");\n item.addEventListener(\"expanded-change\", this.handleExpandedChanged);\n item.addEventListener(\"focus\", this.handleItemFocus);\n if (item instanceof MenuItem) {\n item.startColumnCount = indent;\n }\n });\n };\n /**\n * handle change from child element\n */\n this.changeHandler = (e) => {\n if (this.menuItems === undefined) {\n return;\n }\n const changedMenuItem = e.target;\n const changeItemIndex = this.menuItems.indexOf(changedMenuItem);\n if (changeItemIndex === -1) {\n return;\n }\n if (changedMenuItem.role === \"menuitemradio\" &&\n changedMenuItem.checked === true) {\n for (let i = changeItemIndex - 1; i >= 0; --i) {\n const item = this.menuItems[i];\n const role = item.getAttribute(\"role\");\n if (role === MenuItemRole.menuitemradio) {\n item.checked = false;\n }\n if (role === \"separator\") {\n break;\n }\n }\n const maxIndex = this.menuItems.length - 1;\n for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {\n const item = this.menuItems[i];\n const role = item.getAttribute(\"role\");\n if (role === MenuItemRole.menuitemradio) {\n item.checked = false;\n }\n if (role === \"separator\") {\n break;\n }\n }\n }\n };\n /**\n * check if the item is a menu item\n */\n this.isMenuItemElement = (el) => {\n return (isHTMLElement(el) &&\n Menu.focusableElementRoles.hasOwnProperty(el.getAttribute(\"role\")));\n };\n /**\n * check if the item is focusable\n */\n this.isFocusableElement = (el) => {\n return this.isMenuItemElement(el);\n };\n }\n itemsChanged(oldValue, newValue) {\n // only update children after the component is connected and\n // the setItems has run on connectedCallback\n // (menuItems is undefined until then)\n if (this.$fastController.isConnected && this.menuItems !== undefined) {\n this.setItems();\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n DOM.queueUpdate(() => {\n // wait until children have had a chance to\n // connect before setting/checking their props/attributes\n this.setItems();\n });\n this.addEventListener(\"change\", this.changeHandler);\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeItemListeners();\n this.menuItems = undefined;\n this.removeEventListener(\"change\", this.changeHandler);\n }\n /**\n * Focuses the first item in the menu.\n *\n * @public\n */\n focus() {\n this.setFocus(0, 1);\n }\n /**\n * Collapses any expanded menu items.\n *\n * @public\n */\n collapseExpandedItem() {\n if (this.expandedItem !== null) {\n this.expandedItem.expanded = false;\n this.expandedItem = null;\n }\n }\n /**\n * @internal\n */\n handleMenuKeyDown(e) {\n if (e.defaultPrevented || this.menuItems === undefined) {\n return;\n }\n switch (e.key) {\n case keyArrowDown:\n // go forward one index\n this.setFocus(this.focusIndex + 1, 1);\n return;\n case keyArrowUp:\n // go back one index\n this.setFocus(this.focusIndex - 1, -1);\n return;\n case keyEnd:\n // set focus on last item\n this.setFocus(this.menuItems.length - 1, -1);\n return;\n case keyHome:\n // set focus on first item\n this.setFocus(0, 1);\n return;\n default:\n // if we are not handling the event, do not prevent default\n return true;\n }\n }\n /**\n * get an array of valid DOM children\n */\n domChildren() {\n return Array.from(this.children).filter(child => !child.hasAttribute(\"hidden\"));\n }\n setFocus(focusIndex, adjustment) {\n if (this.menuItems === undefined) {\n return;\n }\n while (focusIndex >= 0 && focusIndex < this.menuItems.length) {\n const child = this.menuItems[focusIndex];\n if (this.isFocusableElement(child)) {\n // change the previous index to -1\n if (this.focusIndex > -1 &&\n this.menuItems.length >= this.focusIndex - 1) {\n this.menuItems[this.focusIndex].setAttribute(\"tabindex\", \"-1\");\n }\n // update the focus index\n this.focusIndex = focusIndex;\n // update the tabindex of next focusable element\n child.setAttribute(\"tabindex\", \"0\");\n // focus the element\n child.focus();\n break;\n }\n focusIndex += adjustment;\n }\n }\n}\nMenu.focusableElementRoles = roleForMenuItem;\n__decorate([\n observable\n], Menu.prototype, \"items\", void 0);\n","import { html, ref, slotted, when } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(NumberField:class)} component.\n * @public\n */\nexport const numberFieldTemplate = (context, definition) => html `\n <template class=\"${x => (x.readOnly ? \"readonly\" : \"\")}\">\n <label\n part=\"label\"\n for=\"control\"\n class=\"${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length\n ? \"label\"\n : \"label label__hidden\"}\"\n >\n <slot ${slotted(\"defaultSlottedNodes\")}></slot>\n </label>\n <div class=\"root\" part=\"root\">\n ${startSlotTemplate(context, definition)}\n <input\n class=\"control\"\n part=\"control\"\n id=\"control\"\n @input=\"${x => x.handleTextInput()}\"\n @change=\"${x => x.handleChange()}\"\n @keydown=\"${(x, c) => x.handleKeyDown(c.event)}\"\n @blur=\"${(x, c) => x.handleBlur()}\"\n ?autofocus=\"${x => x.autofocus}\"\n ?disabled=\"${x => x.disabled}\"\n list=\"${x => x.list}\"\n maxlength=\"${x => x.maxlength}\"\n minlength=\"${x => x.minlength}\"\n placeholder=\"${x => x.placeholder}\"\n ?readonly=\"${x => x.readOnly}\"\n ?required=\"${x => x.required}\"\n size=\"${x => x.size}\"\n type=\"text\"\n inputmode=\"numeric\"\n min=\"${x => x.min}\"\n max=\"${x => x.max}\"\n step=\"${x => x.step}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref(\"control\")}\n />\n ${when(x => !x.hideStep && !x.readOnly && !x.disabled, html `\n <div class=\"controls\" part=\"controls\">\n <div class=\"step-up\" part=\"step-up\" @click=\"${x => x.stepUp()}\">\n <slot name=\"step-up-glyph\">\n ${definition.stepUpGlyph || \"\"}\n </slot>\n </div>\n <div\n class=\"step-down\"\n part=\"step-down\"\n @click=\"${x => x.stepDown()}\"\n >\n <slot name=\"step-down-glyph\">\n ${definition.stepDownGlyph || \"\"}\n </slot>\n </div>\n </div>\n `)}\n ${endSlotTemplate(context, definition)}\n </div>\n </template>\n`;\n","import { FormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _TextField extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(TextField:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedTextField extends FormAssociated(_TextField) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","/**\n * Text field sub-types\n * @public\n */\nexport const TextFieldType = {\n /**\n * An email TextField\n */\n email: \"email\",\n /**\n * A password TextField\n */\n password: \"password\",\n /**\n * A telephone TextField\n */\n tel: \"tel\",\n /**\n * A text TextField\n */\n text: \"text\",\n /**\n * A URL TextField\n */\n url: \"url\",\n};\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, nullableNumberConverter, observable } from \"@microsoft/fast-element\";\nimport { ARIAGlobalStatesAndProperties, StartEnd, } from \"../patterns/index.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { FormAssociatedTextField } from \"./text-field.form-associated.js\";\nimport { TextFieldType } from \"./text-field.options.js\";\nexport { TextFieldType };\n/**\n * A Text Field Custom HTML Element.\n * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text | <input type=\"text\" /> element }.\n *\n * @slot start - Content which can be provided before the number field input\n * @slot end - Content which can be provided after the number field input\n * @slot - The default slot for the label\n * @csspart label - The label\n * @csspart root - The element wrapping the control, including start and end slots\n * @csspart control - The text field element\n * @fires change - Fires a custom 'change' event when the value has changed\n *\n * @public\n */\nexport class TextField extends FormAssociatedTextField {\n constructor() {\n super(...arguments);\n /**\n * Allows setting a type or mode of text.\n * @public\n * @remarks\n * HTML Attribute: type\n */\n this.type = TextFieldType.text;\n }\n readOnlyChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.readOnly = this.readOnly;\n this.validate();\n }\n }\n autofocusChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.autofocus = this.autofocus;\n this.validate();\n }\n }\n placeholderChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.placeholder = this.placeholder;\n }\n }\n typeChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.type = this.type;\n this.validate();\n }\n }\n listChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.setAttribute(\"list\", this.list);\n this.validate();\n }\n }\n maxlengthChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.maxLength = this.maxlength;\n this.validate();\n }\n }\n minlengthChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.minLength = this.minlength;\n this.validate();\n }\n }\n patternChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.pattern = this.pattern;\n this.validate();\n }\n }\n sizeChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.size = this.size;\n }\n }\n spellcheckChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.spellcheck = this.spellcheck;\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.proxy.setAttribute(\"type\", this.type);\n this.validate();\n if (this.autofocus) {\n DOM.queueUpdate(() => {\n this.focus();\n });\n }\n }\n /**\n * Selects all the text in the text field\n *\n * @public\n */\n select() {\n this.control.select();\n /**\n * The select event does not permeate the shadow DOM boundary.\n * This fn effectively proxies the select event,\n * emitting a `select` event whenever the internal\n * control emits a `select` event\n */\n this.$emit(\"select\");\n }\n /**\n * Handles the internal control's `input` event\n * @internal\n */\n handleTextInput() {\n this.value = this.control.value;\n }\n /**\n * Change event handler for inner control.\n * @remarks\n * \"Change\" events are not `composable` so they will not\n * permeate the shadow DOM boundary. This fn effectively proxies\n * the change event, emitting a `change` event whenever the internal\n * control emits a `change` event\n * @internal\n */\n handleChange() {\n this.$emit(\"change\");\n }\n /** {@inheritDoc (FormAssociated:interface).validate} */\n validate() {\n super.validate(this.control);\n }\n}\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], TextField.prototype, \"readOnly\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], TextField.prototype, \"autofocus\", void 0);\n__decorate([\n attr\n], TextField.prototype, \"placeholder\", void 0);\n__decorate([\n attr\n], TextField.prototype, \"type\", void 0);\n__decorate([\n attr\n], TextField.prototype, \"list\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], TextField.prototype, \"maxlength\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], TextField.prototype, \"minlength\", void 0);\n__decorate([\n attr\n], TextField.prototype, \"pattern\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], TextField.prototype, \"size\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], TextField.prototype, \"spellcheck\", void 0);\n__decorate([\n observable\n], TextField.prototype, \"defaultSlottedNodes\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA textbox role\n *\n * @public\n */\nexport class DelegatesARIATextbox {\n}\napplyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);\napplyMixins(TextField, StartEnd, DelegatesARIATextbox);\n","import { FormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _NumberField extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(NumberField:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedNumberField extends FormAssociated(_NumberField) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, nullableNumberConverter, observable, } from \"@microsoft/fast-element\";\nimport { keyArrowDown, keyArrowUp } from \"@microsoft/fast-web-utilities\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { DelegatesARIATextbox } from \"../text-field/text-field.js\";\nimport { FormAssociatedNumberField } from \"./number-field.form-associated.js\";\n/**\n * A Number Field Custom HTML Element.\n * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number | <input type=\"number\" /> element }.\n *\n * @slot start - Content which can be provided before the number field input\n * @slot end - Content which can be provided after the number field input\n * @slot - The default slot for the label\n * @slot step-up-glyph - The glyph for the step up control\n * @slot step-down-glyph - The glyph for the step down control\n * @csspart label - The label\n * @csspart root - The element wrapping the control, including start and end slots\n * @csspart control - The element representing the input\n * @csspart controls - The step up and step down controls\n * @csspart step-up - The step up control\n * @csspart step-down - The step down control\n * @fires input - Fires a custom 'input' event when the value has changed\n * @fires change - Fires a custom 'change' event when the value has changed\n *\n * @public\n */\nexport class NumberField extends FormAssociatedNumberField {\n constructor() {\n super(...arguments);\n /**\n * When true, spin buttons will not be rendered\n * @public\n * @remarks\n * HTML Attribute: autofocus\n */\n this.hideStep = false;\n /**\n * Amount to increment or decrement the value by\n * @public\n * @remarks\n * HTMLAttribute: step\n */\n this.step = 1;\n /**\n * Flag to indicate that the value change is from the user input\n * @internal\n */\n this.isUserInput = false;\n }\n /**\n * Ensures that the max is greater than the min and that the value\n * is less than the max\n * @param previous - the previous max value\n * @param next - updated max value\n *\n * @internal\n */\n maxChanged(previous, next) {\n var _a;\n this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next);\n const min = Math.min(this.min, this.max);\n if (this.min !== undefined && this.min !== min) {\n this.min = min;\n }\n this.value = this.getValidValue(this.value);\n }\n /**\n * Ensures that the min is less than the max and that the value\n * is greater than the min\n * @param previous - previous min value\n * @param next - updated min value\n *\n * @internal\n */\n minChanged(previous, next) {\n var _a;\n this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);\n const max = Math.max(this.min, this.max);\n if (this.max !== undefined && this.max !== max) {\n this.max = max;\n }\n this.value = this.getValidValue(this.value);\n }\n /**\n * The value property, typed as a number.\n *\n * @public\n */\n get valueAsNumber() {\n return parseFloat(super.value);\n }\n set valueAsNumber(next) {\n this.value = next.toString();\n }\n /**\n * Validates that the value is a number between the min and max\n * @param previous - previous stored value\n * @param next - value being updated\n * @param updateControl - should the text field be updated with value, defaults to true\n * @internal\n */\n valueChanged(previous, next) {\n this.value = this.getValidValue(next);\n if (next !== this.value) {\n return;\n }\n if (this.control && !this.isUserInput) {\n this.control.value = this.value;\n }\n super.valueChanged(previous, this.value);\n if (previous !== undefined && !this.isUserInput) {\n this.$emit(\"input\");\n this.$emit(\"change\");\n }\n this.isUserInput = false;\n }\n /** {@inheritDoc (FormAssociated:interface).validate} */\n validate() {\n super.validate(this.control);\n }\n /**\n * Sets the internal value to a valid number between the min and max properties\n * @param value - user input\n *\n * @internal\n */\n getValidValue(value) {\n var _a, _b;\n let validValue = parseFloat(parseFloat(value).toPrecision(12));\n if (isNaN(validValue)) {\n validValue = \"\";\n }\n else {\n validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue);\n validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();\n }\n return validValue;\n }\n /**\n * Increments the value using the step value\n *\n * @public\n */\n stepUp() {\n const value = parseFloat(this.value);\n const stepUpValue = !isNaN(value)\n ? value + this.step\n : this.min > 0\n ? this.min\n : this.max < 0\n ? this.max\n : !this.min\n ? this.step\n : 0;\n this.value = stepUpValue.toString();\n }\n /**\n * Decrements the value using the step value\n *\n * @public\n */\n stepDown() {\n const value = parseFloat(this.value);\n const stepDownValue = !isNaN(value)\n ? value - this.step\n : this.min > 0\n ? this.min\n : this.max < 0\n ? this.max\n : !this.min\n ? 0 - this.step\n : 0;\n this.value = stepDownValue.toString();\n }\n /**\n * Sets up the initial state of the number field\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.proxy.setAttribute(\"type\", \"number\");\n this.validate();\n this.control.value = this.value;\n if (this.autofocus) {\n DOM.queueUpdate(() => {\n this.focus();\n });\n }\n }\n /**\n * Selects all the text in the number field\n *\n * @public\n */\n select() {\n this.control.select();\n /**\n * The select event does not permeate the shadow DOM boundary.\n * This fn effectively proxies the select event,\n * emitting a `select` event whenever the internal\n * control emits a `select` event\n */\n this.$emit(\"select\");\n }\n /**\n * Handles the internal control's `input` event\n * @internal\n */\n handleTextInput() {\n this.control.value = this.control.value.replace(/[^0-9\\-+e.]/g, \"\");\n this.isUserInput = true;\n this.value = this.control.value;\n }\n /**\n * Change event handler for inner control.\n * @remarks\n * \"Change\" events are not `composable` so they will not\n * permeate the shadow DOM boundary. This fn effectively proxies\n * the change event, emitting a `change` event whenever the internal\n * control emits a `change` event\n * @internal\n */\n handleChange() {\n this.$emit(\"change\");\n }\n /**\n * Handles the internal control's `keydown` event\n * @internal\n */\n handleKeyDown(e) {\n const key = e.key;\n switch (key) {\n case keyArrowUp:\n this.stepUp();\n return false;\n case keyArrowDown:\n this.stepDown();\n return false;\n }\n return true;\n }\n /**\n * Handles populating the input field with a validated value when\n * leaving the input field.\n * @internal\n */\n handleBlur() {\n this.control.value = this.value;\n }\n}\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], NumberField.prototype, \"readOnly\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], NumberField.prototype, \"autofocus\", void 0);\n__decorate([\n attr({ attribute: \"hide-step\", mode: \"boolean\" })\n], NumberField.prototype, \"hideStep\", void 0);\n__decorate([\n attr\n], NumberField.prototype, \"placeholder\", void 0);\n__decorate([\n attr\n], NumberField.prototype, \"list\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], NumberField.prototype, \"maxlength\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], NumberField.prototype, \"minlength\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], NumberField.prototype, \"size\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], NumberField.prototype, \"step\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], NumberField.prototype, \"max\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], NumberField.prototype, \"min\", void 0);\n__decorate([\n observable\n], NumberField.prototype, \"defaultSlottedNodes\", void 0);\napplyMixins(NumberField, StartEnd, DelegatesARIATextbox);\n","import { html, when } from \"@microsoft/fast-element\";\nconst progressSegments = 44;\n/**\n * The template for the {@link @microsoft/fast-foundation#BaseProgress} component.\n * @public\n */\nexport const progressRingTemplate = (context, definition) => html `\n <template\n role=\"progressbar\"\n aria-valuenow=\"${x => x.value}\"\n aria-valuemin=\"${x => x.min}\"\n aria-valuemax=\"${x => x.max}\"\n class=\"${x => (x.paused ? \"paused\" : \"\")}\"\n >\n ${when(x => typeof x.value === \"number\", html `\n <svg\n class=\"progress\"\n part=\"progress\"\n viewBox=\"0 0 16 16\"\n slot=\"determinate\"\n >\n <circle\n class=\"background\"\n part=\"background\"\n cx=\"8px\"\n cy=\"8px\"\n r=\"7px\"\n ></circle>\n <circle\n class=\"determinate\"\n part=\"determinate\"\n style=\"stroke-dasharray: ${x => (progressSegments * x.percentComplete) /\n 100}px ${progressSegments}px\"\n cx=\"8px\"\n cy=\"8px\"\n r=\"7px\"\n ></circle>\n </svg>\n `)}\n ${when(x => typeof x.value !== \"number\", html `\n <slot name=\"indeterminate\" slot=\"indeterminate\">\n ${definition.indeterminateIndicator || \"\"}\n </slot>\n `)}\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, nullableNumberConverter, observable, } from \"@microsoft/fast-element\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\n/**\n * An Progress HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.\n *\n * @slot indeterminate - The slot for a custom indeterminate indicator\n * @csspart progress - Represents the progress element\n * @csspart determinate - The determinate indicator\n * @csspart indeterminate - The indeterminate indicator\n *\n * @public\n */\nexport class BaseProgress extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Indicates progress in %\n * @internal\n */\n this.percentComplete = 0;\n }\n valueChanged() {\n if (this.$fastController.isConnected) {\n this.updatePercentComplete();\n }\n }\n minChanged() {\n if (this.$fastController.isConnected) {\n this.updatePercentComplete();\n }\n }\n maxChanged() {\n if (this.$fastController.isConnected) {\n this.updatePercentComplete();\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.updatePercentComplete();\n }\n updatePercentComplete() {\n const min = typeof this.min === \"number\" ? this.min : 0;\n const max = typeof this.max === \"number\" ? this.max : 100;\n const value = typeof this.value === \"number\" ? this.value : 0;\n const range = max - min;\n this.percentComplete =\n range === 0 ? 0 : Math.fround(((value - min) / range) * 100);\n }\n}\n__decorate([\n attr({ converter: nullableNumberConverter })\n], BaseProgress.prototype, \"value\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], BaseProgress.prototype, \"min\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], BaseProgress.prototype, \"max\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], BaseProgress.prototype, \"paused\", void 0);\n__decorate([\n observable\n], BaseProgress.prototype, \"percentComplete\", void 0);\n","import { html, when } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#BaseProgress} component.\n * @public\n */\nexport const progressTemplate = (context, defintion) => html `\n <template\n role=\"progressbar\"\n aria-valuenow=\"${x => x.value}\"\n aria-valuemin=\"${x => x.min}\"\n aria-valuemax=\"${x => x.max}\"\n class=\"${x => (x.paused ? \"paused\" : \"\")}\"\n >\n ${when(x => typeof x.value === \"number\", html `\n <div class=\"progress\" part=\"progress\" slot=\"determinate\">\n <div\n class=\"determinate\"\n part=\"determinate\"\n style=\"width: ${x => x.percentComplete}%\"\n ></div>\n </div>\n `)}\n ${when(x => typeof x.value !== \"number\", html `\n <div class=\"progress\" part=\"progress\" slot=\"indeterminate\">\n <slot class=\"indeterminate\" name=\"indeterminate\">\n ${defintion.indeterminateIndicator1 || \"\"}\n ${defintion.indeterminateIndicator2 || \"\"}\n </slot>\n </div>\n `)}\n </template>\n`;\n","import { elements, html, slotted } from \"@microsoft/fast-element\";\nimport { Orientation } from \"@microsoft/fast-web-utilities\";\n/**\n * The template for the {@link @microsoft/fast-foundation#RadioGroup} component.\n * @public\n */\nexport const radioGroupTemplate = (context, definition) => html `\n <template\n role=\"radiogroup\"\n aria-disabled=\"${x => x.disabled}\"\n aria-readonly=\"${x => x.readOnly}\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n @keydown=\"${(x, c) => x.keydownHandler(c.event)}\"\n @focusout=\"${(x, c) => x.focusOutHandler(c.event)}\"\n >\n <slot name=\"label\"></slot>\n <div\n class=\"positioning-region ${x => x.orientation === Orientation.horizontal ? \"horizontal\" : \"vertical\"}\"\n part=\"positioning-region\"\n >\n <slot\n ${slotted({\n property: \"slottedRadioButtons\",\n filter: elements(\"[role=radio]\"),\n})}\n ></slot>\n </div>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { ArrowKeys, Direction, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnter, Orientation, } from \"@microsoft/fast-web-utilities\";\nimport { getDirection } from \"../utilities/direction.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * An Radio Group Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radiogroup | ARIA radiogroup }.\n *\n * @slot label - The slot for the label\n * @slot - The default slot for radio buttons\n * @csspart positioning-region - The positioning region for laying out the radios\n * @fires change - Fires a custom 'change' event when the value changes\n *\n * @public\n */\nexport class RadioGroup extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The orientation of the group\n *\n * @public\n * @remarks\n * HTML Attribute: orientation\n */\n this.orientation = Orientation.horizontal;\n this.radioChangeHandler = (e) => {\n const changedRadio = e.target;\n if (changedRadio.checked) {\n this.slottedRadioButtons.forEach((radio) => {\n if (radio !== changedRadio) {\n radio.checked = false;\n if (!this.isInsideFoundationToolbar) {\n radio.setAttribute(\"tabindex\", \"-1\");\n }\n }\n });\n this.selectedRadio = changedRadio;\n this.value = changedRadio.value;\n changedRadio.setAttribute(\"tabindex\", \"0\");\n this.focusedRadio = changedRadio;\n }\n e.stopPropagation();\n };\n this.moveToRadioByIndex = (group, index) => {\n const radio = group[index];\n if (!this.isInsideToolbar) {\n radio.setAttribute(\"tabindex\", \"0\");\n if (radio.readOnly) {\n this.slottedRadioButtons.forEach((nextRadio) => {\n if (nextRadio !== radio) {\n nextRadio.setAttribute(\"tabindex\", \"-1\");\n }\n });\n }\n else {\n radio.checked = true;\n this.selectedRadio = radio;\n }\n }\n this.focusedRadio = radio;\n radio.focus();\n };\n this.moveRightOffGroup = () => {\n var _a;\n (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();\n };\n this.moveLeftOffGroup = () => {\n var _a;\n (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus();\n };\n /**\n * @internal\n */\n this.focusOutHandler = (e) => {\n const group = this.slottedRadioButtons;\n const radio = e.target;\n const index = radio !== null ? group.indexOf(radio) : 0;\n const focusedIndex = this.focusedRadio\n ? group.indexOf(this.focusedRadio)\n : -1;\n if ((focusedIndex === 0 && index === focusedIndex) ||\n (focusedIndex === group.length - 1 && focusedIndex === index)) {\n if (!this.selectedRadio) {\n this.focusedRadio = group[0];\n this.focusedRadio.setAttribute(\"tabindex\", \"0\");\n group.forEach((nextRadio) => {\n if (nextRadio !== this.focusedRadio) {\n nextRadio.setAttribute(\"tabindex\", \"-1\");\n }\n });\n }\n else {\n this.focusedRadio = this.selectedRadio;\n if (!this.isInsideFoundationToolbar) {\n this.selectedRadio.setAttribute(\"tabindex\", \"0\");\n group.forEach((nextRadio) => {\n if (nextRadio !== this.selectedRadio) {\n nextRadio.setAttribute(\"tabindex\", \"-1\");\n }\n });\n }\n }\n }\n return true;\n };\n /**\n * @internal\n */\n this.clickHandler = (e) => {\n const radio = e.target;\n if (radio) {\n const group = this.slottedRadioButtons;\n if (radio.checked || group.indexOf(radio) === 0) {\n radio.setAttribute(\"tabindex\", \"0\");\n this.selectedRadio = radio;\n }\n else {\n radio.setAttribute(\"tabindex\", \"-1\");\n this.selectedRadio = null;\n }\n this.focusedRadio = radio;\n }\n e.preventDefault();\n };\n this.shouldMoveOffGroupToTheRight = (index, group, key) => {\n return index === group.length && this.isInsideToolbar && key === keyArrowRight;\n };\n this.shouldMoveOffGroupToTheLeft = (group, key) => {\n const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;\n return index < 0 && this.isInsideToolbar && key === keyArrowLeft;\n };\n this.checkFocusedRadio = () => {\n if (this.focusedRadio !== null &&\n !this.focusedRadio.readOnly &&\n !this.focusedRadio.checked) {\n this.focusedRadio.checked = true;\n this.focusedRadio.setAttribute(\"tabindex\", \"0\");\n this.focusedRadio.focus();\n this.selectedRadio = this.focusedRadio;\n }\n };\n this.moveRight = (e) => {\n const group = this.slottedRadioButtons;\n let index = 0;\n index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1;\n if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) {\n this.moveRightOffGroup();\n return;\n }\n else if (index === group.length) {\n index = 0;\n }\n /* looping to get to next radio that is not disabled */\n /* matching native radio/radiogroup which does not select an item if there is only 1 in the group */\n while (index < group.length && group.length > 1) {\n if (!group[index].disabled) {\n this.moveToRadioByIndex(group, index);\n break;\n }\n else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {\n break;\n }\n else if (index + 1 >= group.length) {\n if (this.isInsideToolbar) {\n break;\n }\n else {\n index = 0;\n }\n }\n else {\n index += 1;\n }\n }\n };\n this.moveLeft = (e) => {\n const group = this.slottedRadioButtons;\n let index = 0;\n index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;\n index = index < 0 ? group.length - 1 : index;\n if (this.shouldMoveOffGroupToTheLeft(group, e.key)) {\n this.moveLeftOffGroup();\n return;\n }\n /* looping to get to next radio that is not disabled */\n while (index >= 0 && group.length > 1) {\n if (!group[index].disabled) {\n this.moveToRadioByIndex(group, index);\n break;\n }\n else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {\n break;\n }\n else if (index - 1 < 0) {\n index = group.length - 1;\n }\n else {\n index -= 1;\n }\n }\n };\n /**\n * keyboard handling per https://w3c.github.io/aria-practices/#for-radio-groups-not-contained-in-a-toolbar\n * navigation is different when there is an ancestor with role='toolbar'\n *\n * @internal\n */\n this.keydownHandler = (e) => {\n const key = e.key;\n if (key in ArrowKeys && this.isInsideFoundationToolbar) {\n return true;\n }\n switch (key) {\n case keyEnter: {\n this.checkFocusedRadio();\n break;\n }\n case keyArrowRight:\n case keyArrowDown: {\n if (this.direction === Direction.ltr) {\n this.moveRight(e);\n }\n else {\n this.moveLeft(e);\n }\n break;\n }\n case keyArrowLeft:\n case keyArrowUp: {\n if (this.direction === Direction.ltr) {\n this.moveLeft(e);\n }\n else {\n this.moveRight(e);\n }\n break;\n }\n default: {\n return true;\n }\n }\n };\n }\n readOnlyChanged() {\n if (this.slottedRadioButtons !== undefined) {\n this.slottedRadioButtons.forEach((radio) => {\n if (this.readOnly) {\n radio.readOnly = true;\n }\n else {\n radio.readOnly = false;\n }\n });\n }\n }\n disabledChanged() {\n if (this.slottedRadioButtons !== undefined) {\n this.slottedRadioButtons.forEach((radio) => {\n if (this.disabled) {\n radio.disabled = true;\n }\n else {\n radio.disabled = false;\n }\n });\n }\n }\n nameChanged() {\n if (this.slottedRadioButtons) {\n this.slottedRadioButtons.forEach((radio) => {\n radio.setAttribute(\"name\", this.name);\n });\n }\n }\n valueChanged() {\n if (this.slottedRadioButtons) {\n this.slottedRadioButtons.forEach((radio) => {\n if (radio.value === this.value) {\n radio.checked = true;\n this.selectedRadio = radio;\n }\n });\n }\n this.$emit(\"change\");\n }\n slottedRadioButtonsChanged(oldValue, newValue) {\n if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) {\n this.setupRadioButtons();\n }\n }\n get parentToolbar() {\n return this.closest('[role=\"toolbar\"]');\n }\n get isInsideToolbar() {\n var _a;\n return ((_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false);\n }\n get isInsideFoundationToolbar() {\n var _a;\n return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a[\"$fastController\"]);\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.direction = getDirection(this);\n this.setupRadioButtons();\n }\n disconnectedCallback() {\n this.slottedRadioButtons.forEach((radio) => {\n radio.removeEventListener(\"change\", this.radioChangeHandler);\n });\n }\n setupRadioButtons() {\n const checkedRadios = this.slottedRadioButtons.filter((radio) => {\n return radio.hasAttribute(\"checked\");\n });\n const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0;\n if (numberOfCheckedRadios > 1) {\n const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];\n lastCheckedRadio.checked = true;\n }\n let foundMatchingVal = false;\n this.slottedRadioButtons.forEach((radio) => {\n if (this.name !== undefined) {\n radio.setAttribute(\"name\", this.name);\n }\n if (this.disabled) {\n radio.disabled = true;\n }\n if (this.readOnly) {\n radio.readOnly = true;\n }\n if (this.value && this.value === radio.value) {\n this.selectedRadio = radio;\n this.focusedRadio = radio;\n radio.checked = true;\n radio.setAttribute(\"tabindex\", \"0\");\n foundMatchingVal = true;\n }\n else {\n if (!this.isInsideFoundationToolbar) {\n radio.setAttribute(\"tabindex\", \"-1\");\n }\n radio.checked = false;\n }\n radio.addEventListener(\"change\", this.radioChangeHandler);\n });\n if (this.value === undefined && this.slottedRadioButtons.length > 0) {\n const checkedRadios = this.slottedRadioButtons.filter((radio) => {\n return radio.hasAttribute(\"checked\");\n });\n const numberOfCheckedRadios = checkedRadios !== null ? checkedRadios.length : 0;\n if (numberOfCheckedRadios > 0 && !foundMatchingVal) {\n const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];\n lastCheckedRadio.checked = true;\n this.focusedRadio = lastCheckedRadio;\n lastCheckedRadio.setAttribute(\"tabindex\", \"0\");\n }\n else {\n this.slottedRadioButtons[0].setAttribute(\"tabindex\", \"0\");\n this.focusedRadio = this.slottedRadioButtons[0];\n }\n }\n }\n}\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], RadioGroup.prototype, \"readOnly\", void 0);\n__decorate([\n attr({ attribute: \"disabled\", mode: \"boolean\" })\n], RadioGroup.prototype, \"disabled\", void 0);\n__decorate([\n attr\n], RadioGroup.prototype, \"name\", void 0);\n__decorate([\n attr\n], RadioGroup.prototype, \"value\", void 0);\n__decorate([\n attr\n], RadioGroup.prototype, \"orientation\", void 0);\n__decorate([\n observable\n], RadioGroup.prototype, \"childItems\", void 0);\n__decorate([\n observable\n], RadioGroup.prototype, \"slottedRadioButtons\", void 0);\n","import { html, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Radio:class)} component.\n * @public\n */\nexport const radioTemplate = (context, definition) => html `\n <template\n role=\"radio\"\n class=\"${x => (x.checked ? \"checked\" : \"\")} ${x => x.readOnly ? \"readonly\" : \"\"}\"\n aria-checked=\"${x => x.checked}\"\n aria-required=\"${x => x.required}\"\n aria-disabled=\"${x => x.disabled}\"\n aria-readonly=\"${x => x.readOnly}\"\n @keypress=\"${(x, c) => x.keypressHandler(c.event)}\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n >\n <div part=\"control\" class=\"control\">\n <slot name=\"checked-indicator\">\n ${definition.checkedIndicator || \"\"}\n </slot>\n </div>\n <label\n part=\"label\"\n class=\"${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length\n ? \"label\"\n : \"label label__hidden\"}\"\n >\n <slot ${slotted(\"defaultSlottedNodes\")}></slot>\n </label>\n </template>\n`;\n","import { CheckableFormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _Radio extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Radio:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedRadio extends CheckableFormAssociated(_Radio) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { keySpace } from \"@microsoft/fast-web-utilities\";\nimport { FormAssociatedRadio } from \"./radio.form-associated.js\";\n/**\n * A Radio Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radio | ARIA radio }.\n *\n * @slot checked-indicator - The checked indicator\n * @slot - The default slot for the label\n * @csspart control - The element representing the visual radio control\n * @csspart label - The label\n * @fires change - Emits a custom change event when the checked state changes\n *\n * @public\n */\nexport class Radio extends FormAssociatedRadio {\n constructor() {\n super();\n /**\n * The element's value to be included in form submission when checked.\n * Default to \"on\" to reach parity with input[type=\"radio\"]\n *\n * @internal\n */\n this.initialValue = \"on\";\n /**\n * @internal\n */\n this.keypressHandler = (e) => {\n switch (e.key) {\n case keySpace:\n if (!this.checked && !this.readOnly) {\n this.checked = true;\n }\n return;\n }\n return true;\n };\n this.proxy.setAttribute(\"type\", \"radio\");\n }\n readOnlyChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.readOnly = this.readOnly;\n }\n }\n /**\n * @internal\n */\n defaultCheckedChanged() {\n var _a;\n if (this.$fastController.isConnected && !this.dirtyChecked) {\n // Setting this.checked will cause us to enter a dirty state,\n // but if we are clean when defaultChecked is changed, we want to stay\n // in a clean state, so reset this.dirtyChecked\n if (!this.isInsideRadioGroup()) {\n this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false;\n this.dirtyChecked = false;\n }\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n var _a, _b;\n super.connectedCallback();\n this.validate();\n if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute(\"role\")) !== \"radiogroup\" &&\n this.getAttribute(\"tabindex\") === null) {\n if (!this.disabled) {\n this.setAttribute(\"tabindex\", \"0\");\n }\n }\n if (this.checkedAttribute) {\n if (!this.dirtyChecked) {\n // Setting this.checked will cause us to enter a dirty state,\n // but if we are clean when defaultChecked is changed, we want to stay\n // in a clean state, so reset this.dirtyChecked\n if (!this.isInsideRadioGroup()) {\n this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false;\n this.dirtyChecked = false;\n }\n }\n }\n }\n isInsideRadioGroup() {\n const parent = this.closest(\"[role=radiogroup]\");\n return parent !== null;\n }\n /**\n * @internal\n */\n clickHandler(e) {\n if (!this.disabled && !this.readOnly && !this.checked) {\n this.checked = true;\n }\n }\n}\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], Radio.prototype, \"readOnly\", void 0);\n__decorate([\n observable\n], Radio.prototype, \"name\", void 0);\n__decorate([\n observable\n], Radio.prototype, \"defaultSlottedNodes\", void 0);\n","import { __decorate } from \"tslib\";\nimport { attr, booleanConverter, DOM, nullableNumberConverter, observable, } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A HorizontalScroll Custom HTML Element\n *\n * @slot start - Content which can be provided before the scroll area\n * @slot end - Content which can be provided after the scroll area\n * @csspart scroll-area - Wraps the entire scrollable region\n * @csspart scroll-view - The visible scroll area\n * @csspart content-container - The container for the content\n * @csspart scroll-prev - The previous flipper container\n * @csspart scroll-action-previous - The element wrapping the previous flipper\n * @csspart scroll-next - The next flipper container\n * @csspart scroll-action-next - The element wrapping the next flipper\n * @fires scrollstart - Fires a custom 'scrollstart' event when scrolling\n * @fires scrollend - Fires a custom 'scrollend' event when scrolling stops\n *\n * @public\n */\nexport class HorizontalScroll extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * @internal\n */\n this.framesPerSecond = 60;\n /**\n * Flag indicating that the items are being updated\n *\n * @internal\n */\n this.updatingItems = false;\n /**\n * Speed of scroll in pixels per second\n * @public\n */\n this.speed = 600;\n /**\n * Attribute used for easing, defaults to ease-in-out\n * @public\n */\n this.easing = \"ease-in-out\";\n /**\n * Attribute to hide flippers from assistive technology\n * @public\n */\n this.flippersHiddenFromAT = false;\n /**\n * Scrolling state\n * @internal\n */\n this.scrolling = false;\n /**\n * Detects if the component has been resized\n * @internal\n */\n this.resizeDetector = null;\n }\n /**\n * The calculated duration for a frame.\n *\n * @internal\n */\n get frameTime() {\n return 1000 / this.framesPerSecond;\n }\n /**\n * Firing scrollstart and scrollend events\n * @internal\n */\n scrollingChanged(prev, next) {\n if (this.scrollContainer) {\n const event = this.scrolling == true ? \"scrollstart\" : \"scrollend\";\n this.$emit(event, this.scrollContainer.scrollLeft);\n }\n }\n /**\n * In RTL mode\n * @internal\n */\n get isRtl() {\n return (this.scrollItems.length > 1 &&\n this.scrollItems[0].offsetLeft > this.scrollItems[1].offsetLeft);\n }\n connectedCallback() {\n super.connectedCallback();\n this.initializeResizeDetector();\n }\n disconnectedCallback() {\n this.disconnectResizeDetector();\n super.disconnectedCallback();\n }\n /**\n * Updates scroll stops and flippers when scroll items change\n * @param previous - current scroll items\n * @param next - new updated scroll items\n * @public\n */\n scrollItemsChanged(previous, next) {\n if (next && !this.updatingItems) {\n DOM.queueUpdate(() => this.setStops());\n }\n }\n /**\n * destroys the instance's resize observer\n * @internal\n */\n disconnectResizeDetector() {\n if (this.resizeDetector) {\n this.resizeDetector.disconnect();\n this.resizeDetector = null;\n }\n }\n /**\n * initializes the instance's resize observer\n * @internal\n */\n initializeResizeDetector() {\n this.disconnectResizeDetector();\n this.resizeDetector = new window.ResizeObserver(this.resized.bind(this));\n this.resizeDetector.observe(this);\n }\n /**\n * Looks for slots and uses child nodes instead\n * @internal\n */\n updateScrollStops() {\n this.updatingItems = true;\n const updatedItems = this.scrollItems.reduce((scrollItems, scrollItem) => {\n if (scrollItem instanceof HTMLSlotElement) {\n return scrollItems.concat(scrollItem.assignedElements());\n }\n scrollItems.push(scrollItem);\n return scrollItems;\n }, []);\n this.scrollItems = updatedItems;\n this.updatingItems = false;\n }\n /**\n * Finds all of the scroll stops between elements\n * @internal\n */\n setStops() {\n this.updateScrollStops();\n const { scrollContainer: container } = this;\n const { scrollLeft } = container;\n const { width: containerWidth, left: containerLeft, } = container.getBoundingClientRect();\n this.width = containerWidth;\n let lastStop = 0;\n let stops = this.scrollItems\n .map((item, index) => {\n const { left, width } = item.getBoundingClientRect();\n const leftPosition = Math.round(left + scrollLeft - containerLeft);\n const right = Math.round(leftPosition + width);\n if (this.isRtl) {\n return -right;\n }\n lastStop = right;\n return index === 0 ? 0 : leftPosition;\n })\n .concat(lastStop);\n /* Fixes a FireFox bug where it doesn't scroll to the start */\n stops = this.fixScrollMisalign(stops);\n /* Sort to zero */\n stops.sort((a, b) => Math.abs(a) - Math.abs(b));\n this.scrollStops = stops;\n this.setFlippers();\n }\n /**\n *\n */\n fixScrollMisalign(stops) {\n if (this.isRtl && stops.some(stop => stop > 0)) {\n stops.sort((a, b) => b - a);\n const offset = stops[0];\n stops = stops.map(stop => stop - offset);\n }\n return stops;\n }\n /**\n * Sets the controls view if enabled\n * @internal\n */\n setFlippers() {\n var _a, _b;\n const position = this.scrollContainer.scrollLeft;\n (_a = this.previousFlipperContainer) === null || _a === void 0 ? void 0 : _a.classList.toggle(\"disabled\", position === 0);\n if (this.scrollStops) {\n const lastStop = Math.abs(this.scrollStops[this.scrollStops.length - 1]);\n (_b = this.nextFlipperContainer) === null || _b === void 0 ? void 0 : _b.classList.toggle(\"disabled\", Math.abs(position) + this.width >= lastStop);\n }\n }\n /**\n * Function that can scroll an item into view.\n * @param item - An item index, a scroll item or a child of one of the scroll items\n * @param padding - Padding of the viewport where the active item shouldn't be\n * @param rightPadding - Optional right padding. Uses the padding if not defined\n *\n * @public\n */\n scrollInView(item, padding = 0, rightPadding) {\n var _a;\n if (typeof item !== \"number\" && item) {\n item = this.scrollItems.findIndex(scrollItem => scrollItem === item || scrollItem.contains(item));\n }\n if (item !== undefined) {\n rightPadding = rightPadding !== null && rightPadding !== void 0 ? rightPadding : padding;\n const { scrollContainer: container, scrollStops, scrollItems: items } = this;\n const { scrollLeft } = this.scrollContainer;\n const { width: containerWidth } = container.getBoundingClientRect();\n const itemStart = scrollStops[item];\n const { width } = items[item].getBoundingClientRect();\n const itemEnd = itemStart + width;\n const isBefore = scrollLeft + padding > itemStart;\n if (isBefore || scrollLeft + containerWidth - rightPadding < itemEnd) {\n const stops = [...scrollStops].sort((a, b) => (isBefore ? b - a : a - b));\n const scrollTo = (_a = stops.find(position => isBefore\n ? position + padding < itemStart\n : position + containerWidth - (rightPadding !== null && rightPadding !== void 0 ? rightPadding : 0) > itemEnd)) !== null && _a !== void 0 ? _a : 0;\n this.scrollToPosition(scrollTo);\n }\n }\n }\n /**\n * Lets the user arrow left and right through the horizontal scroll\n * @param e - Keyboard event\n * @public\n */\n keyupHandler(e) {\n const key = e.key;\n switch (key) {\n case \"ArrowLeft\":\n this.scrollToPrevious();\n break;\n case \"ArrowRight\":\n this.scrollToNext();\n break;\n }\n }\n /**\n * Scrolls items to the left\n * @public\n */\n scrollToPrevious() {\n const scrollPosition = this.scrollContainer.scrollLeft;\n const current = this.scrollStops.findIndex((stop, index) => stop >= scrollPosition &&\n (this.isRtl ||\n index === this.scrollStops.length - 1 ||\n this.scrollStops[index + 1] > scrollPosition));\n const right = Math.abs(this.scrollStops[current + 1]);\n let nextIndex = this.scrollStops.findIndex(stop => Math.abs(stop) + this.width > right);\n if (nextIndex >= current || nextIndex === -1) {\n nextIndex = current > 0 ? current - 1 : 0;\n }\n this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition);\n }\n /**\n * Scrolls items to the right\n * @public\n */\n scrollToNext() {\n const scrollPosition = this.scrollContainer.scrollLeft;\n const current = this.scrollStops.findIndex(stop => Math.abs(stop) >= Math.abs(scrollPosition));\n const outOfView = this.scrollStops.findIndex(stop => Math.abs(scrollPosition) + this.width <= Math.abs(stop));\n let nextIndex = current;\n if (outOfView > current + 2) {\n nextIndex = outOfView - 2;\n }\n else if (current < this.scrollStops.length - 2) {\n nextIndex = current + 1;\n }\n this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition);\n }\n /**\n * Handles scrolling with easing\n * @param position - starting position\n * @param newPosition - position to scroll to\n * @public\n */\n scrollToPosition(newPosition, position = this.scrollContainer.scrollLeft) {\n var _a;\n if (this.scrolling) {\n return;\n }\n this.scrolling = true;\n const seconds = (_a = this.duration) !== null && _a !== void 0 ? _a : `${Math.abs(newPosition - position) / this.speed}s`;\n this.content.style.setProperty(\"transition-duration\", seconds);\n const computedDuration = parseFloat(getComputedStyle(this.content).getPropertyValue(\"transition-duration\"));\n const transitionendHandler = (e) => {\n if (e && e.target !== e.currentTarget) {\n return;\n }\n this.content.style.setProperty(\"transition-duration\", \"0s\");\n this.content.style.removeProperty(\"transform\");\n this.scrollContainer.style.setProperty(\"scroll-behavior\", \"auto\");\n this.scrollContainer.scrollLeft = newPosition;\n this.setFlippers();\n this.content.removeEventListener(\"transitionend\", transitionendHandler);\n this.scrolling = false;\n };\n if (computedDuration === 0) {\n transitionendHandler();\n return;\n }\n this.content.addEventListener(\"transitionend\", transitionendHandler);\n const maxScrollValue = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth;\n let transitionStop = this.scrollContainer.scrollLeft - Math.min(newPosition, maxScrollValue);\n if (this.isRtl) {\n transitionStop =\n this.scrollContainer.scrollLeft +\n Math.min(Math.abs(newPosition), maxScrollValue);\n }\n this.content.style.setProperty(\"transition-property\", \"transform\");\n this.content.style.setProperty(\"transition-timing-function\", this.easing);\n this.content.style.setProperty(\"transform\", `translateX(${transitionStop}px)`);\n }\n /**\n * Monitors resize event on the horizontal-scroll element\n * @public\n */\n resized() {\n if (this.resizeTimeout) {\n this.resizeTimeout = clearTimeout(this.resizeTimeout);\n }\n this.resizeTimeout = setTimeout(() => {\n this.width = this.scrollContainer.offsetWidth;\n this.setFlippers();\n }, this.frameTime);\n }\n /**\n * Monitors scrolled event on the content container\n * @public\n */\n scrolled() {\n if (this.scrollTimeout) {\n this.scrollTimeout = clearTimeout(this.scrollTimeout);\n }\n this.scrollTimeout = setTimeout(() => {\n this.setFlippers();\n }, this.frameTime);\n }\n}\n__decorate([\n attr({ converter: nullableNumberConverter })\n], HorizontalScroll.prototype, \"speed\", void 0);\n__decorate([\n attr\n], HorizontalScroll.prototype, \"duration\", void 0);\n__decorate([\n attr\n], HorizontalScroll.prototype, \"easing\", void 0);\n__decorate([\n attr({ attribute: \"flippers-hidden-from-at\", converter: booleanConverter })\n], HorizontalScroll.prototype, \"flippersHiddenFromAT\", void 0);\n__decorate([\n observable\n], HorizontalScroll.prototype, \"scrolling\", void 0);\n__decorate([\n observable\n], HorizontalScroll.prototype, \"scrollItems\", void 0);\n__decorate([\n attr({ attribute: \"view\" })\n], HorizontalScroll.prototype, \"view\", void 0);\n","import { elements, html, ref, slotted, when, } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * @public\n */\nexport const horizontalScrollTemplate = (context, definition) => {\n var _a, _b;\n return html `\n <template\n class=\"horizontal-scroll\"\n @keyup=\"${(x, c) => x.keyupHandler(c.event)}\"\n >\n ${startSlotTemplate(context, definition)}\n <div class=\"scroll-area\" part=\"scroll-area\">\n <div\n class=\"scroll-view\"\n part=\"scroll-view\"\n @scroll=\"${x => x.scrolled()}\"\n ${ref(\"scrollContainer\")}\n >\n <div class=\"content-container\" part=\"content-container\" ${ref(\"content\")}>\n <slot\n ${slotted({\n property: \"scrollItems\",\n filter: elements(),\n })}\n ></slot>\n </div>\n </div>\n ${when(x => x.view !== \"mobile\", html `\n <div\n class=\"scroll scroll-prev\"\n part=\"scroll-prev\"\n ${ref(\"previousFlipperContainer\")}\n >\n <div class=\"scroll-action\" part=\"scroll-action-previous\">\n <slot name=\"previous-flipper\">\n ${definition.previousFlipper instanceof Function\n ? definition.previousFlipper(context, definition)\n : (_a = definition.previousFlipper) !== null && _a !== void 0 ? _a : \"\"}\n </slot>\n </div>\n </div>\n <div\n class=\"scroll scroll-next\"\n part=\"scroll-next\"\n ${ref(\"nextFlipperContainer\")}\n >\n <div class=\"scroll-action\" part=\"scroll-action-next\">\n <slot name=\"next-flipper\">\n ${definition.nextFlipper instanceof Function\n ? definition.nextFlipper(context, definition)\n : (_b = definition.nextFlipper) !== null && _b !== void 0 ? _b : \"\"}\n </slot>\n </div>\n </div>\n `)}\n </div>\n ${endSlotTemplate(context, definition)}\n </template>\n`;\n};\n","/**\n * a method to filter out any whitespace _only_ nodes, to be used inside a template\n * @param value - The Node that is being inspected\n * @param index - The index of the node within the array\n * @param array - The Node array that is being filtered\n *\n * @public\n */\nexport function whitespaceFilter(value, index, array) {\n return value.nodeType !== Node.TEXT_NODE\n ? true\n : typeof value.nodeValue === \"string\" && !!value.nodeValue.trim().length;\n}\n","import { html, ref, slotted } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\nimport { whitespaceFilter } from \"../utilities/whitespace-filter.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Search:class)} component.\n * @public\n */\nexport const searchTemplate = (context, definition) => html `\n <template\n class=\"\n ${x => (x.readOnly ? \"readonly\" : \"\")}\n \"\n >\n <label\n part=\"label\"\n for=\"control\"\n class=\"${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length\n ? \"label\"\n : \"label label__hidden\"}\"\n >\n <slot\n ${slotted({ property: \"defaultSlottedNodes\", filter: whitespaceFilter })}\n ></slot>\n </label>\n <div class=\"root\" part=\"root\" ${ref(\"root\")}>\n ${startSlotTemplate(context, definition)}\n <div class=\"input-wrapper\" part=\"input-wrapper\">\n <input\n class=\"control\"\n part=\"control\"\n id=\"control\"\n @input=\"${x => x.handleTextInput()}\"\n @change=\"${x => x.handleChange()}\"\n ?autofocus=\"${x => x.autofocus}\"\n ?disabled=\"${x => x.disabled}\"\n list=\"${x => x.list}\"\n maxlength=\"${x => x.maxlength}\"\n minlength=\"${x => x.minlength}\"\n pattern=\"${x => x.pattern}\"\n placeholder=\"${x => x.placeholder}\"\n ?readonly=\"${x => x.readOnly}\"\n ?required=\"${x => x.required}\"\n size=\"${x => x.size}\"\n ?spellcheck=\"${x => x.spellcheck}\"\n :value=\"${x => x.value}\"\n type=\"search\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref(\"control\")}\n />\n <slot name=\"close-button\">\n <button\n class=\"clear-button ${x => x.value ? \"\" : \"clear-button__hidden\"}\"\n part=\"clear-button\"\n tabindex=\"-1\"\n @click=${x => x.handleClearInput()}\n >\n <slot name=\"close-glyph\">\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M0.146447 0.146447C0.338683 -0.0478972 0.645911 -0.0270359 0.853553 0.146447L4.5 3.793L8.14645 0.146447C8.34171 -0.0488155 8.65829 -0.0488155 8.85355 0.146447C9.04882 0.341709 9.04882 0.658291 8.85355 0.853553L5.207 4.5L8.85355 8.14645C9.05934 8.35223 9.03129 8.67582 8.85355 8.85355C8.67582 9.03129 8.35409 9.02703 8.14645 8.85355L4.5 5.207L0.853553 8.85355C0.658291 9.04882 0.341709 9.04882 0.146447 8.85355C-0.0488155 8.65829 -0.0488155 8.34171 0.146447 8.14645L3.793 4.5L0.146447 0.853553C-0.0268697 0.680237 -0.0457894 0.34079 0.146447 0.146447Z\"\n />\n </svg>\n </slot>\n </button>\n </slot>\n </div>\n ${endSlotTemplate(context, definition)}\n </div>\n </template>\n`;\n","import { FormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _Search extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Search:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedSearch extends FormAssociated(_Search) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, nullableNumberConverter, observable } from \"@microsoft/fast-element\";\nimport { ARIAGlobalStatesAndProperties, StartEnd, } from \"../patterns/index.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { FormAssociatedSearch } from \"./search.form-associated.js\";\n/**\n * A Search Custom HTML Element.\n * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search | <input type=\"search\" /> element }.\n *\n * @slot start - Content which can be provided before the search input\n * @slot end - Content which can be provided after the search clear button\n * @slot - The default slot for the label\n * @slot close-button - The clear button\n * @slot close-glyph - The clear glyph\n * @csspart label - The label\n * @csspart root - The element wrapping the control, including start and end slots\n * @csspart control - The element representing the input\n * @csspart clear-button - The button to clear the input\n *\n * @public\n */\nexport class Search extends FormAssociatedSearch {\n readOnlyChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.readOnly = this.readOnly;\n this.validate();\n }\n }\n autofocusChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.autofocus = this.autofocus;\n this.validate();\n }\n }\n placeholderChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.placeholder = this.placeholder;\n }\n }\n listChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.setAttribute(\"list\", this.list);\n this.validate();\n }\n }\n maxlengthChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.maxLength = this.maxlength;\n this.validate();\n }\n }\n minlengthChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.minLength = this.minlength;\n this.validate();\n }\n }\n patternChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.pattern = this.pattern;\n this.validate();\n }\n }\n sizeChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.size = this.size;\n }\n }\n spellcheckChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.spellcheck = this.spellcheck;\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.validate();\n if (this.autofocus) {\n DOM.queueUpdate(() => {\n this.focus();\n });\n }\n }\n /** {@inheritDoc (FormAssociated:interface).validate} */\n validate() {\n super.validate(this.control);\n }\n /**\n * Handles the internal control's `input` event\n * @internal\n */\n handleTextInput() {\n this.value = this.control.value;\n }\n /**\n * Handles the control's clear value event\n * @public\n */\n handleClearInput() {\n this.value = \"\";\n this.control.focus();\n this.handleChange();\n }\n /**\n * Change event handler for inner control.\n * @remarks\n * \"Change\" events are not `composable` so they will not\n * permeate the shadow DOM boundary. This fn effectively proxies\n * the change event, emitting a `change` event whenever the internal\n * control emits a `change` event\n * @internal\n */\n handleChange() {\n this.$emit(\"change\");\n }\n}\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], Search.prototype, \"readOnly\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], Search.prototype, \"autofocus\", void 0);\n__decorate([\n attr\n], Search.prototype, \"placeholder\", void 0);\n__decorate([\n attr\n], Search.prototype, \"list\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], Search.prototype, \"maxlength\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], Search.prototype, \"minlength\", void 0);\n__decorate([\n attr\n], Search.prototype, \"pattern\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], Search.prototype, \"size\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], Search.prototype, \"spellcheck\", void 0);\n__decorate([\n observable\n], Search.prototype, \"defaultSlottedNodes\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA textbox role\n *\n * @public\n */\nexport class DelegatesARIASearch {\n}\napplyMixins(DelegatesARIASearch, ARIAGlobalStatesAndProperties);\napplyMixins(Search, StartEnd, DelegatesARIASearch);\n","import { ListboxElement } from \"../listbox/listbox.element.js\";\nimport { FormAssociated } from \"../form-associated/form-associated.js\";\nclass _Select extends ListboxElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Select:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedSelect extends FormAssociated(_Select) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"select\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, Observable, observable, volatile } from \"@microsoft/fast-element\";\nimport { keyArrowDown, keyArrowUp, keyEnd, keyEnter, keyEscape, keyHome, keySpace, keyTab, uniqueId, } from \"@microsoft/fast-web-utilities\";\nimport { DelegatesARIAListbox, Listbox } from \"../listbox/listbox.js\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { FormAssociatedSelect } from \"./select.form-associated.js\";\nimport { SelectPosition } from \"./select.options.js\";\n/**\n * A Select Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#select | ARIA select }.\n *\n * @slot start - Content which can be provided before the button content\n * @slot end - Content which can be provided after the button content\n * @slot button-container - The element representing the select button\n * @slot selected-value - The selected value\n * @slot indicator - The visual indicator for the expand/collapse state of the button\n * @slot - The default slot for slotted options\n * @csspart control - The element representing the select invoking element\n * @csspart selected-value - The element wrapping the selected value\n * @csspart indicator - The element wrapping the visual indicator\n * @csspart listbox - The listbox element\n * @fires input - Fires a custom 'input' event when the value updates\n * @fires change - Fires a custom 'change' event when the value updates\n *\n * @public\n */\nexport class Select extends FormAssociatedSelect {\n constructor() {\n super(...arguments);\n /**\n * The open attribute.\n *\n * @public\n * @remarks\n * HTML Attribute: open\n */\n this.open = false;\n /**\n * Indicates the initial state of the position attribute.\n *\n * @internal\n */\n this.forcedPosition = false;\n /**\n * The unique id for the internal listbox element.\n *\n * @internal\n */\n this.listboxId = uniqueId(\"listbox-\");\n /**\n * The max height for the listbox when opened.\n *\n * @internal\n */\n this.maxHeight = 0;\n }\n /**\n * Sets focus and synchronizes ARIA attributes when the open property changes.\n *\n * @param prev - the previous open value\n * @param next - the current open value\n *\n * @internal\n */\n openChanged(prev, next) {\n if (!this.collapsible) {\n return;\n }\n if (this.open) {\n this.ariaControls = this.listboxId;\n this.ariaExpanded = \"true\";\n this.setPositioning();\n this.focusAndScrollOptionIntoView();\n this.indexWhenOpened = this.selectedIndex;\n // focus is directed to the element when `open` is changed programmatically\n DOM.queueUpdate(() => this.focus());\n return;\n }\n this.ariaControls = \"\";\n this.ariaExpanded = \"false\";\n }\n /**\n * The component is collapsible when in single-selection mode with no size attribute.\n *\n * @internal\n */\n get collapsible() {\n return !(this.multiple || typeof this.size === \"number\");\n }\n /**\n * The value property.\n *\n * @public\n */\n get value() {\n Observable.track(this, \"value\");\n return this._value;\n }\n set value(next) {\n var _a, _b, _c, _d, _e, _f, _g;\n const prev = `${this._value}`;\n if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) {\n const selectedIndex = this._options.findIndex(el => el.value === next);\n const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;\n const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null;\n if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {\n next = \"\";\n this.selectedIndex = selectedIndex;\n }\n next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next;\n }\n if (prev !== next) {\n this._value = next;\n super.valueChanged(prev, next);\n Observable.notify(this, \"value\");\n this.updateDisplayValue();\n }\n }\n /**\n * Sets the value and display value to match the first selected option.\n *\n * @param shouldEmit - if true, the input and change events will be emitted\n *\n * @internal\n */\n updateValue(shouldEmit) {\n var _a, _b;\n if (this.$fastController.isConnected) {\n this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : \"\";\n }\n if (shouldEmit) {\n this.$emit(\"input\");\n this.$emit(\"change\", this, {\n bubbles: true,\n composed: undefined,\n });\n }\n }\n /**\n * Updates the proxy value when the selected index changes.\n *\n * @param prev - the previous selected index\n * @param next - the next selected index\n *\n * @internal\n */\n selectedIndexChanged(prev, next) {\n super.selectedIndexChanged(prev, next);\n this.updateValue();\n }\n positionChanged(prev, next) {\n this.positionAttribute = next;\n this.setPositioning();\n }\n /**\n * Calculate and apply listbox positioning based on available viewport space.\n *\n * @public\n */\n setPositioning() {\n const currentBox = this.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const availableBottom = viewportHeight - currentBox.bottom;\n this.position = this.forcedPosition\n ? this.positionAttribute\n : currentBox.top > availableBottom\n ? SelectPosition.above\n : SelectPosition.below;\n this.positionAttribute = this.forcedPosition\n ? this.positionAttribute\n : this.position;\n this.maxHeight =\n this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom;\n }\n /**\n * The value displayed on the button.\n *\n * @public\n */\n get displayValue() {\n var _a, _b;\n Observable.track(this, \"displayValue\");\n return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : \"\";\n }\n /**\n * Synchronize the `aria-disabled` property when the `disabled` property changes.\n *\n * @param prev - The previous disabled value\n * @param next - The next disabled value\n *\n * @internal\n */\n disabledChanged(prev, next) {\n if (super.disabledChanged) {\n super.disabledChanged(prev, next);\n }\n this.ariaDisabled = this.disabled ? \"true\" : \"false\";\n }\n /**\n * Reset the element to its first selectable option when its parent form is reset.\n *\n * @internal\n */\n formResetCallback() {\n this.setProxyOptions();\n // Call the base class's implementation setDefaultSelectedOption instead of the select's\n // override, in order to reset the selectedIndex without using the value property.\n super.setDefaultSelectedOption();\n if (this.selectedIndex === -1) {\n this.selectedIndex = 0;\n }\n }\n /**\n * Handle opening and closing the listbox when the select is clicked.\n *\n * @param e - the mouse event\n * @internal\n */\n clickHandler(e) {\n // do nothing if the select is disabled\n if (this.disabled) {\n return;\n }\n if (this.open) {\n const captured = e.target.closest(`option,[role=option]`);\n if (captured && captured.disabled) {\n return;\n }\n }\n super.clickHandler(e);\n this.open = this.collapsible && !this.open;\n if (!this.open && this.indexWhenOpened !== this.selectedIndex) {\n this.updateValue(true);\n }\n return true;\n }\n /**\n * Handles focus state when the element or its children lose focus.\n *\n * @param e - The focus event\n * @internal\n */\n focusoutHandler(e) {\n var _a;\n super.focusoutHandler(e);\n if (!this.open) {\n return true;\n }\n const focusTarget = e.relatedTarget;\n if (this.isSameNode(focusTarget)) {\n this.focus();\n return;\n }\n if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) {\n this.open = false;\n if (this.indexWhenOpened !== this.selectedIndex) {\n this.updateValue(true);\n }\n }\n }\n /**\n * Updates the value when an option's value changes.\n *\n * @param source - the source object\n * @param propertyName - the property to evaluate\n *\n * @internal\n * @override\n */\n handleChange(source, propertyName) {\n super.handleChange(source, propertyName);\n if (propertyName === \"value\") {\n this.updateValue();\n }\n }\n /**\n * Synchronize the form-associated proxy and updates the value property of the element.\n *\n * @param prev - the previous collection of slotted option elements\n * @param next - the next collection of slotted option elements\n *\n * @internal\n */\n slottedOptionsChanged(prev, next) {\n this.options.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.unsubscribe(this, \"value\");\n });\n super.slottedOptionsChanged(prev, next);\n this.options.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.subscribe(this, \"value\");\n });\n this.setProxyOptions();\n this.updateValue();\n }\n /**\n * Prevents focus when size is set and a scrollbar is clicked.\n *\n * @param e - the mouse event object\n *\n * @override\n * @internal\n */\n mousedownHandler(e) {\n var _a;\n if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) {\n return super.mousedownHandler(e);\n }\n return this.collapsible;\n }\n /**\n * Sets the multiple property on the proxy element.\n *\n * @param prev - the previous multiple value\n * @param next - the current multiple value\n */\n multipleChanged(prev, next) {\n super.multipleChanged(prev, next);\n if (this.proxy) {\n this.proxy.multiple = next;\n }\n }\n /**\n * Updates the selectedness of each option when the list of selected options changes.\n *\n * @param prev - the previous list of selected options\n * @param next - the current list of selected options\n *\n * @override\n * @internal\n */\n selectedOptionsChanged(prev, next) {\n var _a;\n super.selectedOptionsChanged(prev, next);\n (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => {\n var _a;\n const proxyOption = (_a = this.proxy) === null || _a === void 0 ? void 0 : _a.options.item(i);\n if (proxyOption) {\n proxyOption.selected = o.selected;\n }\n });\n }\n /**\n * Sets the selected index to match the first option with the selected attribute, or\n * the first selectable option.\n *\n * @override\n * @internal\n */\n setDefaultSelectedOption() {\n var _a;\n const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter);\n const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex(el => el.hasAttribute(\"selected\") || el.selected || el.value === this.value);\n if (selectedIndex !== -1) {\n this.selectedIndex = selectedIndex;\n return;\n }\n this.selectedIndex = 0;\n }\n /**\n * Resets and fills the proxy to match the component's options.\n *\n * @internal\n */\n setProxyOptions() {\n if (this.proxy instanceof HTMLSelectElement && this.options) {\n this.proxy.options.length = 0;\n this.options.forEach(option => {\n const proxyOption = option.proxy ||\n (option instanceof HTMLOptionElement ? option.cloneNode() : null);\n if (proxyOption) {\n this.proxy.options.add(proxyOption);\n }\n });\n }\n }\n /**\n * Handle keyboard interaction for the select.\n *\n * @param e - the keyboard event\n * @internal\n */\n keydownHandler(e) {\n super.keydownHandler(e);\n const key = e.key || e.key.charCodeAt(0);\n switch (key) {\n case keySpace: {\n e.preventDefault();\n if (this.collapsible && this.typeAheadExpired) {\n this.open = !this.open;\n }\n break;\n }\n case keyHome:\n case keyEnd: {\n e.preventDefault();\n break;\n }\n case keyEnter: {\n e.preventDefault();\n this.open = !this.open;\n break;\n }\n case keyEscape: {\n if (this.collapsible && this.open) {\n e.preventDefault();\n this.open = false;\n }\n break;\n }\n case keyTab: {\n if (this.collapsible && this.open) {\n e.preventDefault();\n this.open = false;\n }\n return true;\n }\n }\n if (!this.open && this.indexWhenOpened !== this.selectedIndex) {\n this.updateValue(true);\n this.indexWhenOpened = this.selectedIndex;\n }\n return !(key === keyArrowDown || key === keyArrowUp);\n }\n connectedCallback() {\n super.connectedCallback();\n this.forcedPosition = !!this.positionAttribute;\n this.addEventListener(\"contentchange\", this.updateDisplayValue);\n }\n disconnectedCallback() {\n this.removeEventListener(\"contentchange\", this.updateDisplayValue);\n super.disconnectedCallback();\n }\n /**\n * Updates the proxy's size property when the size attribute changes.\n *\n * @param prev - the previous size\n * @param next - the current size\n *\n * @override\n * @internal\n */\n sizeChanged(prev, next) {\n super.sizeChanged(prev, next);\n if (this.proxy) {\n this.proxy.size = next;\n }\n }\n /**\n *\n * @internal\n */\n updateDisplayValue() {\n if (this.collapsible) {\n Observable.notify(this, \"displayValue\");\n }\n }\n}\n__decorate([\n attr({ attribute: \"open\", mode: \"boolean\" })\n], Select.prototype, \"open\", void 0);\n__decorate([\n volatile\n], Select.prototype, \"collapsible\", null);\n__decorate([\n observable\n], Select.prototype, \"control\", void 0);\n__decorate([\n attr({ attribute: \"position\" })\n], Select.prototype, \"positionAttribute\", void 0);\n__decorate([\n observable\n], Select.prototype, \"position\", void 0);\n__decorate([\n observable\n], Select.prototype, \"maxHeight\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA select role.\n *\n * @public\n */\nexport class DelegatesARIASelect {\n}\n__decorate([\n observable\n], DelegatesARIASelect.prototype, \"ariaControls\", void 0);\napplyMixins(DelegatesARIASelect, DelegatesARIAListbox);\napplyMixins(Select, StartEnd, DelegatesARIASelect);\n","import { html, ref, slotted, when } from \"@microsoft/fast-element\";\nimport { Listbox } from \"../listbox/listbox.js\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Select:class)} component.\n * @public\n */\nexport const selectTemplate = (context, definition) => html `\n <template\n class=\"${x => [\n x.collapsible && \"collapsible\",\n x.collapsible && x.open && \"open\",\n x.disabled && \"disabled\",\n x.collapsible && x.position,\n]\n .filter(Boolean)\n .join(\" \")}\"\n aria-activedescendant=\"${x => x.ariaActiveDescendant}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-haspopup=\"${x => (x.collapsible ? \"listbox\" : null)}\"\n aria-multiselectable=\"${x => x.ariaMultiSelectable}\"\n ?open=\"${x => x.open}\"\n role=\"combobox\"\n tabindex=\"${x => (!x.disabled ? \"0\" : null)}\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n @focusin=\"${(x, c) => x.focusinHandler(c.event)}\"\n @focusout=\"${(x, c) => x.focusoutHandler(c.event)}\"\n @keydown=\"${(x, c) => x.keydownHandler(c.event)}\"\n @mousedown=\"${(x, c) => x.mousedownHandler(c.event)}\"\n >\n ${when(x => x.collapsible, html `\n <div\n class=\"control\"\n part=\"control\"\n ?disabled=\"${x => x.disabled}\"\n ${ref(\"control\")}\n >\n ${startSlotTemplate(context, definition)}\n <slot name=\"button-container\">\n <div class=\"selected-value\" part=\"selected-value\">\n <slot name=\"selected-value\">${x => x.displayValue}</slot>\n </div>\n <div aria-hidden=\"true\" class=\"indicator\" part=\"indicator\">\n <slot name=\"indicator\">\n ${definition.indicator || \"\"}\n </slot>\n </div>\n </slot>\n ${endSlotTemplate(context, definition)}\n </div>\n `)}\n <div\n class=\"listbox\"\n id=\"${x => x.listboxId}\"\n part=\"listbox\"\n role=\"listbox\"\n ?disabled=\"${x => x.disabled}\"\n ?hidden=\"${x => (x.collapsible ? !x.open : false)}\"\n ${ref(\"listbox\")}\n >\n <slot\n ${slotted({\n filter: Listbox.slottedOptionFilter,\n flatten: true,\n property: \"slottedOptions\",\n})}\n ></slot>\n </div>\n </template>\n`;\n","import { html, when } from \"@microsoft/fast-element\";\n/**\n * The template for the fast-skeleton component\n * @public\n */\nexport const skeletonTemplate = (context, definition) => html `\n <template\n class=\"${x => (x.shape === \"circle\" ? \"circle\" : \"rect\")}\"\n pattern=\"${x => x.pattern}\"\n ?shimmer=\"${x => x.shimmer}\"\n >\n ${when(x => x.shimmer === true, html `\n <span class=\"shimmer\"></span>\n `)}\n <object type=\"image/svg+xml\" data=\"${x => x.pattern}\" role=\"presentation\">\n <img class=\"pattern\" src=\"${x => x.pattern}\" />\n </object>\n <slot></slot>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A Skeleton Custom HTML Element.\n *\n * @slot - The default slot\n *\n * @public\n */\nexport class Skeleton extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Indicates what the shape of the Skeleton should be.\n *\n * @public\n * @remarks\n * HTML Attribute: shape\n */\n this.shape = \"rect\";\n }\n}\n__decorate([\n attr\n], Skeleton.prototype, \"fill\", void 0);\n__decorate([\n attr\n], Skeleton.prototype, \"shape\", void 0);\n__decorate([\n attr\n], Skeleton.prototype, \"pattern\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], Skeleton.prototype, \"shimmer\", void 0);\n","import { html, ref, when } from \"@microsoft/fast-element\";\nimport { Orientation } from \"@microsoft/fast-web-utilities\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(SliderLabel:class)} component.\n * @public\n */\nexport const sliderLabelTemplate = (context, definition) => html `\n <template\n aria-disabled=\"${x => x.disabled}\"\n class=\"${x => x.sliderOrientation || Orientation.horizontal}\n ${x => (x.disabled ? \"disabled\" : \"\")}\"\n >\n <div ${ref(\"root\")} part=\"root\" class=\"root\" style=\"${x => x.positionStyle}\">\n <div class=\"container\">\n ${when(x => !x.hideMark, html `\n <div class=\"mark\"></div>\n `)}\n <div class=\"label\">\n <slot></slot>\n </div>\n </div>\n </div>\n </template>\n`;\n","import { Direction, limit } from \"@microsoft/fast-web-utilities\";\n/**\n * Converts a pixel coordinate on the track to a percent of the track's range\n */\nexport function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {\n let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));\n if (direction === Direction.rtl) {\n pct = 1 - pct;\n }\n return pct;\n}\n","import { __decorate } from \"tslib\";\nimport { attr, Observable, observable } from \"@microsoft/fast-element\";\nimport { Direction, Orientation } from \"@microsoft/fast-web-utilities\";\nimport { convertPixelToPercent } from \"../slider/slider-utilities.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nconst defaultConfig = {\n min: 0,\n max: 0,\n direction: Direction.ltr,\n orientation: Orientation.horizontal,\n disabled: false,\n};\n/**\n * A label element intended to be used with the {@link @microsoft/fast-foundation#(Slider:class)} component.\n *\n * @slot - The default slot for the label content\n * @csspart root - The element wrapping the label mark and text\n *\n * @public\n */\nexport class SliderLabel extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * Hides the tick mark.\n *\n * @public\n * @remarks\n * HTML Attribute: hide-mark\n */\n this.hideMark = false;\n /**\n * @internal\n */\n this.sliderDirection = Direction.ltr;\n this.getSliderConfiguration = () => {\n if (!this.isSliderConfig(this.parentNode)) {\n this.sliderDirection = defaultConfig.direction || Direction.ltr;\n this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal;\n this.sliderMaxPosition = defaultConfig.max;\n this.sliderMinPosition = defaultConfig.min;\n }\n else {\n const parentSlider = this\n .parentNode;\n const { min, max, direction, orientation, disabled } = parentSlider;\n if (disabled !== undefined) {\n this.disabled = disabled;\n }\n this.sliderDirection = direction || Direction.ltr;\n this.sliderOrientation = orientation || Orientation.horizontal;\n this.sliderMaxPosition = max;\n this.sliderMinPosition = min;\n }\n };\n this.positionAsStyle = () => {\n const direction = this.sliderDirection\n ? this.sliderDirection\n : Direction.ltr;\n const pct = convertPixelToPercent(Number(this.position), Number(this.sliderMinPosition), Number(this.sliderMaxPosition));\n let rightNum = Math.round((1 - pct) * 100);\n let leftNum = Math.round(pct * 100);\n if (Number.isNaN(leftNum) && Number.isNaN(rightNum)) {\n rightNum = 50;\n leftNum = 50;\n }\n if (this.sliderOrientation === Orientation.horizontal) {\n return direction === Direction.rtl\n ? `right: ${leftNum}%; left: ${rightNum}%;`\n : `left: ${leftNum}%; right: ${rightNum}%;`;\n }\n else {\n return `top: ${leftNum}%; bottom: ${rightNum}%;`;\n }\n };\n }\n positionChanged() {\n this.positionStyle = this.positionAsStyle();\n }\n /**\n * @internal\n */\n sliderOrientationChanged() {\n void 0;\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.getSliderConfiguration();\n this.positionStyle = this.positionAsStyle();\n this.notifier = Observable.getNotifier(this.parentNode);\n this.notifier.subscribe(this, \"orientation\");\n this.notifier.subscribe(this, \"direction\");\n this.notifier.subscribe(this, \"max\");\n this.notifier.subscribe(this, \"min\");\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.notifier.unsubscribe(this, \"orientation\");\n this.notifier.unsubscribe(this, \"direction\");\n this.notifier.unsubscribe(this, \"max\");\n this.notifier.unsubscribe(this, \"min\");\n }\n /**\n * @internal\n */\n handleChange(source, propertyName) {\n switch (propertyName) {\n case \"direction\":\n this.sliderDirection = source.direction;\n break;\n case \"orientation\":\n this.sliderOrientation = source.orientation;\n break;\n case \"max\":\n this.sliderMaxPosition = source.max;\n break;\n case \"min\":\n this.sliderMinPosition = source.min;\n break;\n default:\n break;\n }\n this.positionStyle = this.positionAsStyle();\n }\n isSliderConfig(node) {\n return node.max !== undefined && node.min !== undefined;\n }\n}\n__decorate([\n observable\n], SliderLabel.prototype, \"positionStyle\", void 0);\n__decorate([\n attr\n], SliderLabel.prototype, \"position\", void 0);\n__decorate([\n attr({ attribute: \"hide-mark\", mode: \"boolean\" })\n], SliderLabel.prototype, \"hideMark\", void 0);\n__decorate([\n attr({ attribute: \"disabled\", mode: \"boolean\" })\n], SliderLabel.prototype, \"disabled\", void 0);\n__decorate([\n observable\n], SliderLabel.prototype, \"sliderOrientation\", void 0);\n__decorate([\n observable\n], SliderLabel.prototype, \"sliderMinPosition\", void 0);\n__decorate([\n observable\n], SliderLabel.prototype, \"sliderMaxPosition\", void 0);\n__decorate([\n observable\n], SliderLabel.prototype, \"sliderDirection\", void 0);\n","import { html, ref } from \"@microsoft/fast-element\";\nimport { Orientation } from \"@microsoft/fast-web-utilities\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Slider:class)} component.\n * @public\n */\nexport const sliderTemplate = (context, definition) => html `\n <template\n role=\"slider\"\n class=\"${x => (x.readOnly ? \"readonly\" : \"\")}\n ${x => x.orientation || Orientation.horizontal}\"\n tabindex=\"${x => (x.disabled ? null : 0)}\"\n aria-valuetext=\"${x => x.valueTextFormatter(x.value)}\"\n aria-valuenow=\"${x => x.value}\"\n aria-valuemin=\"${x => x.min}\"\n aria-valuemax=\"${x => x.max}\"\n aria-disabled=\"${x => (x.disabled ? true : void 0)}\"\n aria-readonly=\"${x => (x.readOnly ? true : void 0)}\"\n aria-orientation=\"${x => x.orientation}\"\n class=\"${x => x.orientation}\"\n >\n <div part=\"positioning-region\" class=\"positioning-region\">\n <div ${ref(\"track\")} part=\"track-container\" class=\"track\">\n <slot name=\"track\"></slot>\n <div part=\"track-start\" class=\"track-start\" style=\"${x => x.position}\">\n <slot name=\"track-start\"></slot>\n </div>\n </div>\n <slot></slot>\n <div\n ${ref(\"thumb\")}\n part=\"thumb-container\"\n class=\"thumb-container\"\n style=\"${x => x.position}\"\n >\n <slot name=\"thumb\">${definition.thumb || \"\"}</slot>\n </div>\n </div>\n </template>\n`;\n","import { FormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _Slider extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Slider:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedSlider extends FormAssociated(_Slider) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, nullableNumberConverter, observable, } from \"@microsoft/fast-element\";\nimport { Direction, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnd, keyHome, Orientation, } from \"@microsoft/fast-web-utilities\";\nimport { getDirection } from \"../utilities/direction.js\";\nimport { convertPixelToPercent } from \"./slider-utilities.js\";\nimport { FormAssociatedSlider } from \"./slider.form-associated.js\";\n/**\n * The selection modes of a {@link @microsoft/fast-foundation#(Slider:class)}.\n * @public\n */\nexport const SliderMode = {\n singleValue: \"single-value\",\n};\n/**\n * A Slider Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#slider | ARIA slider }.\n *\n * @slot track - The track of the slider\n * @slot track-start - The track-start visual indicator\n * @slot thumb - The slider thumb\n * @slot - The default slot for labels\n * @csspart positioning-region - The region used to position the elements of the slider\n * @csspart track-container - The region containing the track elements\n * @csspart track-start - The element wrapping the track start slot\n * @csspart thumb-container - The thumb container element which is programatically positioned\n * @fires change - Fires a custom 'change' event when the slider value changes\n *\n * @public\n */\nexport class Slider extends FormAssociatedSlider {\n constructor() {\n super(...arguments);\n /**\n * @internal\n */\n this.direction = Direction.ltr;\n /**\n * @internal\n */\n this.isDragging = false;\n /**\n * @internal\n */\n this.trackWidth = 0;\n /**\n * @internal\n */\n this.trackMinWidth = 0;\n /**\n * @internal\n */\n this.trackHeight = 0;\n /**\n * @internal\n */\n this.trackLeft = 0;\n /**\n * @internal\n */\n this.trackMinHeight = 0;\n /**\n * Custom function that generates a string for the component's \"aria-valuetext\" attribute based on the current value.\n *\n * @public\n */\n this.valueTextFormatter = () => null;\n /**\n * The minimum allowed value.\n *\n * @defaultValue - 0\n * @public\n * @remarks\n * HTML Attribute: min\n */\n this.min = 0; // Map to proxy element.\n /**\n * The maximum allowed value.\n *\n * @defaultValue - 10\n * @public\n * @remarks\n * HTML Attribute: max\n */\n this.max = 10; // Map to proxy element.\n /**\n * Value to increment or decrement via arrow keys, mouse click or drag.\n *\n * @public\n * @remarks\n * HTML Attribute: step\n */\n this.step = 1; // Map to proxy element.\n /**\n * The orientation of the slider.\n *\n * @public\n * @remarks\n * HTML Attribute: orientation\n */\n this.orientation = Orientation.horizontal;\n /**\n * The selection mode.\n *\n * @public\n * @remarks\n * HTML Attribute: mode\n */\n this.mode = SliderMode.singleValue;\n this.keypressHandler = (e) => {\n if (this.readOnly) {\n return;\n }\n if (e.key === keyHome) {\n e.preventDefault();\n this.value = `${this.min}`;\n }\n else if (e.key === keyEnd) {\n e.preventDefault();\n this.value = `${this.max}`;\n }\n else if (!e.shiftKey) {\n switch (e.key) {\n case keyArrowRight:\n case keyArrowUp:\n e.preventDefault();\n this.increment();\n break;\n case keyArrowLeft:\n case keyArrowDown:\n e.preventDefault();\n this.decrement();\n break;\n }\n }\n };\n this.setupTrackConstraints = () => {\n const clientRect = this.track.getBoundingClientRect();\n this.trackWidth = this.track.clientWidth;\n this.trackMinWidth = this.track.clientLeft;\n this.trackHeight = clientRect.bottom;\n this.trackMinHeight = clientRect.top;\n this.trackLeft = this.getBoundingClientRect().left;\n if (this.trackWidth === 0) {\n this.trackWidth = 1;\n }\n };\n this.setupListeners = (remove = false) => {\n const eventAction = `${remove ? \"remove\" : \"add\"}EventListener`;\n this[eventAction](\"keydown\", this.keypressHandler);\n this[eventAction](\"mousedown\", this.handleMouseDown);\n this.thumb[eventAction](\"mousedown\", this.handleThumbMouseDown, {\n passive: true,\n });\n this.thumb[eventAction](\"touchstart\", this.handleThumbMouseDown, {\n passive: true,\n });\n // removes handlers attached by mousedown handlers\n if (remove) {\n this.handleMouseDown(null);\n this.handleThumbMouseDown(null);\n }\n };\n /**\n * @internal\n */\n this.initialValue = \"\";\n /**\n * Handle mouse moves during a thumb drag operation\n * If the event handler is null it removes the events\n */\n this.handleThumbMouseDown = (event) => {\n if (event) {\n if (this.readOnly || this.disabled || event.defaultPrevented) {\n return;\n }\n event.target.focus();\n }\n const eventAction = `${event !== null ? \"add\" : \"remove\"}EventListener`;\n window[eventAction](\"mouseup\", this.handleWindowMouseUp);\n window[eventAction](\"mousemove\", this.handleMouseMove, { passive: true });\n window[eventAction](\"touchmove\", this.handleMouseMove, { passive: true });\n window[eventAction](\"touchend\", this.handleWindowMouseUp);\n this.isDragging = event !== null;\n };\n /**\n * Handle mouse moves during a thumb drag operation\n */\n this.handleMouseMove = (e) => {\n if (this.readOnly || this.disabled || e.defaultPrevented) {\n return;\n }\n // update the value based on current position\n const sourceEvent = window.TouchEvent && e instanceof TouchEvent\n ? e.touches[0]\n : e;\n const eventValue = this.orientation === Orientation.horizontal\n ? sourceEvent.pageX - document.documentElement.scrollLeft - this.trackLeft\n : sourceEvent.pageY - document.documentElement.scrollTop;\n this.value = `${this.calculateNewValue(eventValue)}`;\n };\n this.calculateNewValue = (rawValue) => {\n // update the value based on current position\n const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.horizontal\n ? this.trackMinWidth\n : this.trackMinHeight, this.orientation === Orientation.horizontal\n ? this.trackWidth\n : this.trackHeight, this.direction);\n const newValue = (this.max - this.min) * newPosition + this.min;\n return this.convertToConstrainedValue(newValue);\n };\n /**\n * Handle a window mouse up during a drag operation\n */\n this.handleWindowMouseUp = (event) => {\n this.stopDragging();\n };\n this.stopDragging = () => {\n this.isDragging = false;\n this.handleMouseDown(null);\n this.handleThumbMouseDown(null);\n };\n /**\n *\n * @param e - MouseEvent or null. If there is no event handler it will remove the events\n */\n this.handleMouseDown = (e) => {\n const eventAction = `${e !== null ? \"add\" : \"remove\"}EventListener`;\n if (e === null || (!this.disabled && !this.readOnly)) {\n window[eventAction](\"mouseup\", this.handleWindowMouseUp);\n window.document[eventAction](\"mouseleave\", this.handleWindowMouseUp);\n window[eventAction](\"mousemove\", this.handleMouseMove);\n if (e) {\n e.preventDefault();\n this.setupTrackConstraints();\n e.target.focus();\n const controlValue = this.orientation === Orientation.horizontal\n ? e.pageX - document.documentElement.scrollLeft - this.trackLeft\n : e.pageY - document.documentElement.scrollTop;\n this.value = `${this.calculateNewValue(controlValue)}`;\n }\n }\n };\n this.convertToConstrainedValue = (value) => {\n if (isNaN(value)) {\n value = this.min;\n }\n /**\n * The following logic intends to overcome the issue with math in JavaScript with regards to floating point numbers.\n * This is needed as the `step` may be an integer but could also be a float. To accomplish this the step is assumed to be a float\n * and is converted to an integer by determining the number of decimal places it represent, multiplying it until it is an\n * integer and then dividing it to get back to the correct number.\n */\n let constrainedValue = value - this.min;\n const roundedConstrainedValue = Math.round(constrainedValue / this.step);\n const remainderValue = constrainedValue -\n (roundedConstrainedValue * (this.stepMultiplier * this.step)) /\n this.stepMultiplier;\n constrainedValue =\n remainderValue >= Number(this.step) / 2\n ? constrainedValue - remainderValue + Number(this.step)\n : constrainedValue - remainderValue;\n return constrainedValue + this.min;\n };\n }\n readOnlyChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.readOnly = this.readOnly;\n }\n }\n /**\n * The value property, typed as a number.\n *\n * @public\n */\n get valueAsNumber() {\n return parseFloat(super.value);\n }\n set valueAsNumber(next) {\n this.value = next.toString();\n }\n /**\n * @internal\n */\n valueChanged(previous, next) {\n super.valueChanged(previous, next);\n if (this.$fastController.isConnected) {\n this.setThumbPositionForOrientation(this.direction);\n }\n this.$emit(\"change\");\n }\n minChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.min = `${this.min}`;\n }\n this.validate();\n }\n maxChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.max = `${this.max}`;\n }\n this.validate();\n }\n stepChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.step = `${this.step}`;\n }\n this.updateStepMultiplier();\n this.validate();\n }\n orientationChanged() {\n if (this.$fastController.isConnected) {\n this.setThumbPositionForOrientation(this.direction);\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.proxy.setAttribute(\"type\", \"range\");\n this.direction = getDirection(this);\n this.updateStepMultiplier();\n this.setupTrackConstraints();\n this.setupListeners();\n this.setupDefaultValue();\n this.setThumbPositionForOrientation(this.direction);\n }\n /**\n * @internal\n */\n disconnectedCallback() {\n this.setupListeners(true);\n }\n /**\n * Increment the value by the step\n *\n * @public\n */\n increment() {\n const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical\n ? Number(this.value) + Number(this.step)\n : Number(this.value) - Number(this.step);\n const incrementedVal = this.convertToConstrainedValue(newVal);\n const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`;\n this.value = incrementedValString;\n }\n /**\n * Decrement the value by the step\n *\n * @public\n */\n decrement() {\n const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical\n ? Number(this.value) - Number(this.step)\n : Number(this.value) + Number(this.step);\n const decrementedVal = this.convertToConstrainedValue(newVal);\n const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`;\n this.value = decrementedValString;\n }\n /**\n * Places the thumb based on the current value\n *\n * @public\n * @param direction - writing mode\n */\n setThumbPositionForOrientation(direction) {\n const newPct = convertPixelToPercent(Number(this.value), Number(this.min), Number(this.max), direction);\n const percentage = (1 - newPct) * 100;\n if (this.orientation === Orientation.horizontal) {\n this.position = this.isDragging\n ? `right: ${percentage}%; transition: none;`\n : `right: ${percentage}%; transition: all 0.2s ease;`;\n }\n else {\n this.position = this.isDragging\n ? `bottom: ${percentage}%; transition: none;`\n : `bottom: ${percentage}%; transition: all 0.2s ease;`;\n }\n }\n /**\n * Update the step multiplier used to ensure rounding errors from steps that\n * are not whole numbers\n */\n updateStepMultiplier() {\n const stepString = this.step + \"\";\n const decimalPlacesOfStep = !!(this.step % 1)\n ? stepString.length - stepString.indexOf(\".\") - 1\n : 0;\n this.stepMultiplier = Math.pow(10, decimalPlacesOfStep);\n }\n get midpoint() {\n return `${this.convertToConstrainedValue((this.max + this.min) / 2)}`;\n }\n setupDefaultValue() {\n if (typeof this.value === \"string\") {\n if (this.value.length === 0) {\n this.initialValue = this.midpoint;\n }\n else {\n const value = parseFloat(this.value);\n if (!Number.isNaN(value) && (value < this.min || value > this.max)) {\n this.value = this.midpoint;\n }\n }\n }\n }\n}\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], Slider.prototype, \"readOnly\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"direction\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"isDragging\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"position\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"trackWidth\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"trackMinWidth\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"trackHeight\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"trackLeft\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"trackMinHeight\", void 0);\n__decorate([\n observable\n], Slider.prototype, \"valueTextFormatter\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], Slider.prototype, \"min\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], Slider.prototype, \"max\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], Slider.prototype, \"step\", void 0);\n__decorate([\n attr\n], Slider.prototype, \"orientation\", void 0);\n__decorate([\n attr\n], Slider.prototype, \"mode\", void 0);\n","import { html, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Switch:class)} component.\n * @public\n */\nexport const switchTemplate = (context, definition) => html `\n <template\n role=\"switch\"\n aria-checked=\"${x => x.checked}\"\n aria-disabled=\"${x => x.disabled}\"\n aria-readonly=\"${x => x.readOnly}\"\n tabindex=\"${x => (x.disabled ? null : 0)}\"\n @keypress=\"${(x, c) => x.keypressHandler(c.event)}\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n class=\"${x => (x.checked ? \"checked\" : \"\")}\"\n >\n <label\n part=\"label\"\n class=\"${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length\n ? \"label\"\n : \"label label__hidden\"}\"\n >\n <slot ${slotted(\"defaultSlottedNodes\")}></slot>\n </label>\n <div part=\"switch\" class=\"switch\">\n <slot name=\"switch\">${definition.switch || \"\"}</slot>\n </div>\n <span class=\"status-message\" part=\"status-message\">\n <span class=\"checked-message\" part=\"checked-message\">\n <slot name=\"checked-message\"></slot>\n </span>\n <span class=\"unchecked-message\" part=\"unchecked-message\">\n <slot name=\"unchecked-message\"></slot>\n </span>\n </span>\n </template>\n`;\n","import { CheckableFormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _Switch extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Switch:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedSwitch extends CheckableFormAssociated(_Switch) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"input\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { keyEnter, keySpace } from \"@microsoft/fast-web-utilities\";\nimport { FormAssociatedSwitch } from \"./switch.form-associated.js\";\n/**\n * A Switch Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#switch | ARIA switch }.\n *\n * @slot - The deafult slot for the label\n * @slot checked-message - The message when in a checked state\n * @slot unchecked-message - The message when in an unchecked state\n * @csspart label - The label\n * @csspart switch - The element representing the switch, which wraps the indicator\n * @csspart status-message - The wrapper for the status messages\n * @csspart checked-message - The checked message\n * @csspart unchecked-message - The unchecked message\n * @fires change - Emits a custom change event when the checked state changes\n *\n * @public\n */\nexport class Switch extends FormAssociatedSwitch {\n constructor() {\n super();\n /**\n * The element's value to be included in form submission when checked.\n * Default to \"on\" to reach parity with input[type=\"checkbox\"]\n *\n * @internal\n */\n this.initialValue = \"on\";\n /**\n * @internal\n */\n this.keypressHandler = (e) => {\n if (this.readOnly) {\n return;\n }\n switch (e.key) {\n case keyEnter:\n case keySpace:\n this.checked = !this.checked;\n break;\n }\n };\n /**\n * @internal\n */\n this.clickHandler = (e) => {\n if (!this.disabled && !this.readOnly) {\n this.checked = !this.checked;\n }\n };\n this.proxy.setAttribute(\"type\", \"checkbox\");\n }\n readOnlyChanged() {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.readOnly = this.readOnly;\n }\n this.readOnly\n ? this.classList.add(\"readonly\")\n : this.classList.remove(\"readonly\");\n }\n /**\n * @internal\n */\n checkedChanged(prev, next) {\n super.checkedChanged(prev, next);\n /**\n * @deprecated - this behavior already exists in the template and should not exist in the class.\n */\n this.checked ? this.classList.add(\"checked\") : this.classList.remove(\"checked\");\n }\n}\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], Switch.prototype, \"readOnly\", void 0);\n__decorate([\n observable\n], Switch.prototype, \"defaultSlottedNodes\", void 0);\n","import { html } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#TabPanel} component.\n * @public\n */\nexport const tabPanelTemplate = (context, definition) => html `\n <template slot=\"tabpanel\" role=\"tabpanel\">\n <slot></slot>\n </template>\n`;\n","import { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A TabPanel Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}\n *\n * @slot - The default slot for the tabpanel content\n *\n * @public\n */\nexport class TabPanel extends FoundationElement {\n}\n","import { html } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Tab} component.\n * @public\n */\nexport const tabTemplate = (context, definition) => html `\n <template slot=\"tab\" role=\"tab\" aria-disabled=\"${x => x.disabled}\">\n <slot></slot>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A Tab Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}\n *\n * @slot - The default slot for the tab content\n *\n * @public\n */\nexport class Tab extends FoundationElement {\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], Tab.prototype, \"disabled\", void 0);\n","import { html, ref, slotted, when } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Tabs:class)} component.\n * @public\n */\nexport const tabsTemplate = (context, definition) => html `\n <template class=\"${x => x.orientation}\">\n ${startSlotTemplate(context, definition)}\n <div class=\"tablist\" part=\"tablist\" role=\"tablist\">\n <slot class=\"tab\" name=\"tab\" part=\"tab\" ${slotted(\"tabs\")}></slot>\n\n ${when(x => x.showActiveIndicator, html `\n <div\n ${ref(\"activeIndicatorRef\")}\n class=\"activeIndicator\"\n part=\"activeIndicator\"\n ></div>\n `)}\n </div>\n ${endSlotTemplate(context, definition)}\n <div class=\"tabpanel\">\n <slot name=\"tabpanel\" part=\"tabpanel\" ${slotted(\"tabpanels\")}></slot>\n </div>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnd, keyHome, uniqueId, wrapInBounds, } from \"@microsoft/fast-web-utilities\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\n/**\n * The orientation of the {@link @microsoft/fast-foundation#(Tabs:class)} component\n * @public\n */\nexport const TabsOrientation = {\n vertical: \"vertical\",\n horizontal: \"horizontal\",\n};\n/**\n * A Tabs Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#tablist | ARIA tablist }.\n *\n * @slot start - Content which can be provided before the tablist element\n * @slot end - Content which can be provided after the tablist element\n * @slot tab - The slot for tabs\n * @slot tabpanel - The slot for tabpanels\n * @csspart tablist - The element wrapping for the tabs\n * @csspart tab - The tab slot\n * @csspart activeIndicator - The visual indicator\n * @csspart tabpanel - The tabpanel slot\n * @fires change - Fires a custom 'change' event when a tab is clicked or during keyboard navigation\n *\n * @public\n */\nexport class Tabs extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The orientation\n * @public\n * @remarks\n * HTML Attribute: orientation\n */\n this.orientation = TabsOrientation.horizontal;\n /**\n * Whether or not to show the active indicator\n * @public\n * @remarks\n * HTML Attribute: activeindicator\n */\n this.activeindicator = true;\n /**\n * @internal\n */\n this.showActiveIndicator = true;\n this.prevActiveTabIndex = 0;\n this.activeTabIndex = 0;\n this.ticking = false;\n this.change = () => {\n this.$emit(\"change\", this.activetab);\n };\n this.isDisabledElement = (el) => {\n return el.getAttribute(\"aria-disabled\") === \"true\";\n };\n this.isFocusableElement = (el) => {\n return !this.isDisabledElement(el);\n };\n this.setTabs = () => {\n const gridHorizontalProperty = \"gridColumn\";\n const gridVerticalProperty = \"gridRow\";\n const gridProperty = this.isHorizontal()\n ? gridHorizontalProperty\n : gridVerticalProperty;\n this.activeTabIndex = this.getActiveIndex();\n this.showActiveIndicator = false;\n this.tabs.forEach((tab, index) => {\n if (tab.slot === \"tab\") {\n const isActiveTab = this.activeTabIndex === index && this.isFocusableElement(tab);\n if (this.activeindicator && this.isFocusableElement(tab)) {\n this.showActiveIndicator = true;\n }\n const tabId = this.tabIds[index];\n const tabpanelId = this.tabpanelIds[index];\n tab.setAttribute(\"id\", tabId);\n tab.setAttribute(\"aria-selected\", isActiveTab ? \"true\" : \"false\");\n tab.setAttribute(\"aria-controls\", tabpanelId);\n tab.addEventListener(\"click\", this.handleTabClick);\n tab.addEventListener(\"keydown\", this.handleTabKeyDown);\n tab.setAttribute(\"tabindex\", isActiveTab ? \"0\" : \"-1\");\n if (isActiveTab) {\n this.activetab = tab;\n }\n }\n // If the original property isn't emptied out,\n // the next set will morph into a grid-area style setting that is not what we want\n tab.style[gridHorizontalProperty] = \"\";\n tab.style[gridVerticalProperty] = \"\";\n tab.style[gridProperty] = `${index + 1}`;\n !this.isHorizontal()\n ? tab.classList.add(\"vertical\")\n : tab.classList.remove(\"vertical\");\n });\n };\n this.setTabPanels = () => {\n this.tabpanels.forEach((tabpanel, index) => {\n const tabId = this.tabIds[index];\n const tabpanelId = this.tabpanelIds[index];\n tabpanel.setAttribute(\"id\", tabpanelId);\n tabpanel.setAttribute(\"aria-labelledby\", tabId);\n this.activeTabIndex !== index\n ? tabpanel.setAttribute(\"hidden\", \"\")\n : tabpanel.removeAttribute(\"hidden\");\n });\n };\n this.handleTabClick = (event) => {\n const selectedTab = event.currentTarget;\n if (selectedTab.nodeType === 1 && this.isFocusableElement(selectedTab)) {\n this.prevActiveTabIndex = this.activeTabIndex;\n this.activeTabIndex = this.tabs.indexOf(selectedTab);\n this.setComponent();\n }\n };\n this.handleTabKeyDown = (event) => {\n if (this.isHorizontal()) {\n switch (event.key) {\n case keyArrowLeft:\n event.preventDefault();\n this.adjustBackward(event);\n break;\n case keyArrowRight:\n event.preventDefault();\n this.adjustForward(event);\n break;\n }\n }\n else {\n switch (event.key) {\n case keyArrowUp:\n event.preventDefault();\n this.adjustBackward(event);\n break;\n case keyArrowDown:\n event.preventDefault();\n this.adjustForward(event);\n break;\n }\n }\n switch (event.key) {\n case keyHome:\n event.preventDefault();\n this.adjust(-this.activeTabIndex);\n break;\n case keyEnd:\n event.preventDefault();\n this.adjust(this.tabs.length - this.activeTabIndex - 1);\n break;\n }\n };\n this.adjustForward = (e) => {\n const group = this.tabs;\n let index = 0;\n index = this.activetab ? group.indexOf(this.activetab) + 1 : 1;\n if (index === group.length) {\n index = 0;\n }\n while (index < group.length && group.length > 1) {\n if (this.isFocusableElement(group[index])) {\n this.moveToTabByIndex(group, index);\n break;\n }\n else if (this.activetab && index === group.indexOf(this.activetab)) {\n break;\n }\n else if (index + 1 >= group.length) {\n index = 0;\n }\n else {\n index += 1;\n }\n }\n };\n this.adjustBackward = (e) => {\n const group = this.tabs;\n let index = 0;\n index = this.activetab ? group.indexOf(this.activetab) - 1 : 0;\n index = index < 0 ? group.length - 1 : index;\n while (index >= 0 && group.length > 1) {\n if (this.isFocusableElement(group[index])) {\n this.moveToTabByIndex(group, index);\n break;\n }\n else if (index - 1 < 0) {\n index = group.length - 1;\n }\n else {\n index -= 1;\n }\n }\n };\n this.moveToTabByIndex = (group, index) => {\n const tab = group[index];\n this.activetab = tab;\n this.prevActiveTabIndex = this.activeTabIndex;\n this.activeTabIndex = index;\n tab.focus();\n this.setComponent();\n };\n }\n /**\n * @internal\n */\n orientationChanged() {\n if (this.$fastController.isConnected) {\n this.setTabs();\n this.setTabPanels();\n this.handleActiveIndicatorPosition();\n }\n }\n /**\n * @internal\n */\n activeidChanged(oldValue, newValue) {\n if (this.$fastController.isConnected &&\n this.tabs.length <= this.tabpanels.length) {\n this.prevActiveTabIndex = this.tabs.findIndex((item) => item.id === oldValue);\n this.setTabs();\n this.setTabPanels();\n this.handleActiveIndicatorPosition();\n }\n }\n /**\n * @internal\n */\n tabsChanged() {\n if (this.$fastController.isConnected &&\n this.tabs.length <= this.tabpanels.length) {\n this.tabIds = this.getTabIds();\n this.tabpanelIds = this.getTabPanelIds();\n this.setTabs();\n this.setTabPanels();\n this.handleActiveIndicatorPosition();\n }\n }\n /**\n * @internal\n */\n tabpanelsChanged() {\n if (this.$fastController.isConnected &&\n this.tabpanels.length <= this.tabs.length) {\n this.tabIds = this.getTabIds();\n this.tabpanelIds = this.getTabPanelIds();\n this.setTabs();\n this.setTabPanels();\n this.handleActiveIndicatorPosition();\n }\n }\n getActiveIndex() {\n const id = this.activeid;\n if (id !== undefined) {\n return this.tabIds.indexOf(this.activeid) === -1\n ? 0\n : this.tabIds.indexOf(this.activeid);\n }\n else {\n return 0;\n }\n }\n getTabIds() {\n return this.tabs.map((tab) => {\n var _a;\n return (_a = tab.getAttribute(\"id\")) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`;\n });\n }\n getTabPanelIds() {\n return this.tabpanels.map((tabPanel) => {\n var _a;\n return (_a = tabPanel.getAttribute(\"id\")) !== null && _a !== void 0 ? _a : `panel-${uniqueId()}`;\n });\n }\n setComponent() {\n if (this.activeTabIndex !== this.prevActiveTabIndex) {\n this.activeid = this.tabIds[this.activeTabIndex];\n this.focusTab();\n this.change();\n }\n }\n isHorizontal() {\n return this.orientation === TabsOrientation.horizontal;\n }\n handleActiveIndicatorPosition() {\n // Ignore if we click twice on the same tab\n if (this.showActiveIndicator &&\n this.activeindicator &&\n this.activeTabIndex !== this.prevActiveTabIndex) {\n if (this.ticking) {\n this.ticking = false;\n }\n else {\n this.ticking = true;\n this.animateActiveIndicator();\n }\n }\n }\n animateActiveIndicator() {\n this.ticking = true;\n const gridProperty = this.isHorizontal() ? \"gridColumn\" : \"gridRow\";\n const translateProperty = this.isHorizontal()\n ? \"translateX\"\n : \"translateY\";\n const offsetProperty = this.isHorizontal() ? \"offsetLeft\" : \"offsetTop\";\n const prev = this.activeIndicatorRef[offsetProperty];\n this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`;\n const next = this.activeIndicatorRef[offsetProperty];\n this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`;\n const dif = next - prev;\n this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`;\n this.activeIndicatorRef.classList.add(\"activeIndicatorTransition\");\n this.activeIndicatorRef.addEventListener(\"transitionend\", () => {\n this.ticking = false;\n this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`;\n this.activeIndicatorRef.style.transform = `${translateProperty}(0px)`;\n this.activeIndicatorRef.classList.remove(\"activeIndicatorTransition\");\n });\n }\n /**\n * The adjust method for FASTTabs\n * @public\n * @remarks\n * This method allows the active index to be adjusted by numerical increments\n */\n adjust(adjustment) {\n this.prevActiveTabIndex = this.activeTabIndex;\n this.activeTabIndex = wrapInBounds(0, this.tabs.length - 1, this.activeTabIndex + adjustment);\n this.setComponent();\n }\n focusTab() {\n this.tabs[this.activeTabIndex].focus();\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.tabIds = this.getTabIds();\n this.tabpanelIds = this.getTabPanelIds();\n this.activeTabIndex = this.getActiveIndex();\n }\n}\n__decorate([\n attr\n], Tabs.prototype, \"orientation\", void 0);\n__decorate([\n attr\n], Tabs.prototype, \"activeid\", void 0);\n__decorate([\n observable\n], Tabs.prototype, \"tabs\", void 0);\n__decorate([\n observable\n], Tabs.prototype, \"tabpanels\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], Tabs.prototype, \"activeindicator\", void 0);\n__decorate([\n observable\n], Tabs.prototype, \"activeIndicatorRef\", void 0);\n__decorate([\n observable\n], Tabs.prototype, \"showActiveIndicator\", void 0);\napplyMixins(Tabs, StartEnd);\n","/**\n * Resize mode for a TextArea\n * @public\n */\nexport const TextAreaResize = {\n /**\n * No resize.\n */\n none: \"none\",\n /**\n * Resize vertically and horizontally.\n */\n both: \"both\",\n /**\n * Resize horizontally.\n */\n horizontal: \"horizontal\",\n /**\n * Resize vertically.\n */\n vertical: \"vertical\",\n};\n","import { html, ref, slotted } from \"@microsoft/fast-element\";\nimport { TextAreaResize } from \"./text-area.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(TextArea:class)} component.\n * @public\n */\nexport const textAreaTemplate = (context, definition) => html `\n <template\n class=\"\n ${x => (x.readOnly ? \"readonly\" : \"\")}\n ${x => (x.resize !== TextAreaResize.none ? `resize-${x.resize}` : \"\")}\"\n >\n <label\n part=\"label\"\n for=\"control\"\n class=\"${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length\n ? \"label\"\n : \"label label__hidden\"}\"\n >\n <slot ${slotted(\"defaultSlottedNodes\")}></slot>\n </label>\n <textarea\n part=\"control\"\n class=\"control\"\n id=\"control\"\n ?autofocus=\"${x => x.autofocus}\"\n cols=\"${x => x.cols}\"\n ?disabled=\"${x => x.disabled}\"\n form=\"${x => x.form}\"\n list=\"${x => x.list}\"\n maxlength=\"${x => x.maxlength}\"\n minlength=\"${x => x.minlength}\"\n name=\"${x => x.name}\"\n placeholder=\"${x => x.placeholder}\"\n ?readonly=\"${x => x.readOnly}\"\n ?required=\"${x => x.required}\"\n rows=\"${x => x.rows}\"\n ?spellcheck=\"${x => x.spellcheck}\"\n :value=\"${x => x.value}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n @input=\"${(x, c) => x.handleTextInput()}\"\n @change=\"${x => x.handleChange()}\"\n ${ref(\"control\")}\n ></textarea>\n </template>\n`;\n","import { FormAssociated } from \"../form-associated/form-associated.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nclass _TextArea extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(TextArea:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedTextArea extends FormAssociated(_TextArea) {\n constructor() {\n super(...arguments);\n this.proxy = document.createElement(\"textarea\");\n }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, nullableNumberConverter, observable } from \"@microsoft/fast-element\";\nimport { DelegatesARIATextbox } from \"../text-field/text-field.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { FormAssociatedTextArea } from \"./text-area.form-associated.js\";\nimport { TextAreaResize } from \"./text-area.options.js\";\nexport { TextAreaResize };\n/**\n * A Text Area Custom HTML Element.\n * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | <textarea> element }.\n *\n * @slot - The default slot for the label\n * @csspart label - The label\n * @csspart root - The element wrapping the control\n * @csspart control - The textarea element\n * @fires change - Emits a custom 'change' event when the textarea emits a change event\n *\n * @public\n */\nexport class TextArea extends FormAssociatedTextArea {\n constructor() {\n super(...arguments);\n /**\n * The resize mode of the element.\n * @public\n * @remarks\n * HTML Attribute: resize\n */\n this.resize = TextAreaResize.none;\n /**\n * Sizes the element horizontally by a number of character columns.\n *\n * @public\n * @remarks\n * HTML Attribute: cols\n */\n this.cols = 20;\n /**\n * @internal\n */\n this.handleTextInput = () => {\n this.value = this.control.value;\n };\n }\n readOnlyChanged() {\n if (this.proxy instanceof HTMLTextAreaElement) {\n this.proxy.readOnly = this.readOnly;\n }\n }\n autofocusChanged() {\n if (this.proxy instanceof HTMLTextAreaElement) {\n this.proxy.autofocus = this.autofocus;\n }\n }\n listChanged() {\n if (this.proxy instanceof HTMLTextAreaElement) {\n this.proxy.setAttribute(\"list\", this.list);\n }\n }\n maxlengthChanged() {\n if (this.proxy instanceof HTMLTextAreaElement) {\n this.proxy.maxLength = this.maxlength;\n }\n }\n minlengthChanged() {\n if (this.proxy instanceof HTMLTextAreaElement) {\n this.proxy.minLength = this.minlength;\n }\n }\n spellcheckChanged() {\n if (this.proxy instanceof HTMLTextAreaElement) {\n this.proxy.spellcheck = this.spellcheck;\n }\n }\n /**\n * Selects all the text in the text area\n *\n * @public\n */\n select() {\n this.control.select();\n /**\n * The select event does not permeate the shadow DOM boundary.\n * This fn effectively proxies the select event,\n * emitting a `select` event whenever the internal\n * control emits a `select` event\n */\n this.$emit(\"select\");\n }\n /**\n * Change event handler for inner control.\n * @remarks\n * \"Change\" events are not `composable` so they will not\n * permeate the shadow DOM boundary. This fn effectively proxies\n * the change event, emitting a `change` event whenever the internal\n * control emits a `change` event\n * @internal\n */\n handleChange() {\n this.$emit(\"change\");\n }\n /** {@inheritDoc (FormAssociated:interface).validate} */\n validate() {\n super.validate(this.control);\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], TextArea.prototype, \"readOnly\", void 0);\n__decorate([\n attr\n], TextArea.prototype, \"resize\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], TextArea.prototype, \"autofocus\", void 0);\n__decorate([\n attr({ attribute: \"form\" })\n], TextArea.prototype, \"formId\", void 0);\n__decorate([\n attr\n], TextArea.prototype, \"list\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], TextArea.prototype, \"maxlength\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter })\n], TextArea.prototype, \"minlength\", void 0);\n__decorate([\n attr\n], TextArea.prototype, \"name\", void 0);\n__decorate([\n attr\n], TextArea.prototype, \"placeholder\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter, mode: \"fromView\" })\n], TextArea.prototype, \"cols\", void 0);\n__decorate([\n attr({ converter: nullableNumberConverter, mode: \"fromView\" })\n], TextArea.prototype, \"rows\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], TextArea.prototype, \"spellcheck\", void 0);\n__decorate([\n observable\n], TextArea.prototype, \"defaultSlottedNodes\", void 0);\napplyMixins(TextArea, DelegatesARIATextbox);\n","import { html, ref, slotted } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\nimport { whitespaceFilter } from \"../utilities/whitespace-filter.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(TextField:class)} component.\n * @public\n */\nexport const textFieldTemplate = (context, definition) => html `\n <template\n class=\"\n ${x => (x.readOnly ? \"readonly\" : \"\")}\n \"\n >\n <label\n part=\"label\"\n for=\"control\"\n class=\"${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length\n ? \"label\"\n : \"label label__hidden\"}\"\n >\n <slot\n ${slotted({ property: \"defaultSlottedNodes\", filter: whitespaceFilter })}\n ></slot>\n </label>\n <div class=\"root\" part=\"root\">\n ${startSlotTemplate(context, definition)}\n <input\n class=\"control\"\n part=\"control\"\n id=\"control\"\n @input=\"${x => x.handleTextInput()}\"\n @change=\"${x => x.handleChange()}\"\n ?autofocus=\"${x => x.autofocus}\"\n ?disabled=\"${x => x.disabled}\"\n list=\"${x => x.list}\"\n maxlength=\"${x => x.maxlength}\"\n minlength=\"${x => x.minlength}\"\n pattern=\"${x => x.pattern}\"\n placeholder=\"${x => x.placeholder}\"\n ?readonly=\"${x => x.readOnly}\"\n ?required=\"${x => x.required}\"\n size=\"${x => x.size}\"\n ?spellcheck=\"${x => x.spellcheck}\"\n :value=\"${x => x.value}\"\n type=\"${x => x.type}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref(\"control\")}\n />\n ${endSlotTemplate(context, definition)}\n </div>\n </template>\n`;\n","import { children, elements, html, slotted } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Toolbar:class)} component.\n *\n * @public\n */\nexport const toolbarTemplate = (context, definition) => html `\n <template\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-orientation=\"${x => x.orientation}\"\n orientation=\"${x => x.orientation}\"\n role=\"toolbar\"\n @click=\"${(x, c) => x.clickHandler(c.event)}\"\n @focusin=\"${(x, c) => x.focusinHandler(c.event)}\"\n @keydown=\"${(x, c) => x.keydownHandler(c.event)}\"\n ${children({\n property: \"childItems\",\n attributeFilter: [\"disabled\", \"hidden\"],\n filter: elements(),\n subtree: true,\n})}\n >\n <slot name=\"label\"></slot>\n <div class=\"positioning-region\" part=\"positioning-region\">\n ${startSlotTemplate(context, definition)}\n <slot\n ${slotted({\n filter: elements(),\n property: \"slottedItems\",\n})}\n ></slot>\n ${endSlotTemplate(context, definition)}\n </div>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, observable, Observable } from \"@microsoft/fast-element\";\nimport { ArrowKeys, Direction, limit, Orientation } from \"@microsoft/fast-web-utilities\";\nimport { isFocusable } from \"tabbable\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\nimport { ARIAGlobalStatesAndProperties } from \"../patterns/aria-global.js\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { getDirection } from \"../utilities/direction.js\";\n/**\n * A map for directionality derived from keyboard input strings,\n * visual orientation, and text direction.\n *\n * @internal\n */\nconst ToolbarArrowKeyMap = Object.freeze({\n [ArrowKeys.ArrowUp]: {\n [Orientation.vertical]: -1,\n },\n [ArrowKeys.ArrowDown]: {\n [Orientation.vertical]: 1,\n },\n [ArrowKeys.ArrowLeft]: {\n [Orientation.horizontal]: {\n [Direction.ltr]: -1,\n [Direction.rtl]: 1,\n },\n },\n [ArrowKeys.ArrowRight]: {\n [Orientation.horizontal]: {\n [Direction.ltr]: 1,\n [Direction.rtl]: -1,\n },\n },\n});\n/**\n * A Toolbar Custom HTML Element.\n * Implements the {@link https://w3c.github.io/aria-practices/#Toolbar|ARIA Toolbar}.\n *\n * @slot start - Content which can be provided before the slotted items\n * @slot end - Content which can be provided after the slotted items\n * @slot - The default slot for slotted items\n * @slot label - The toolbar label\n * @csspart positioning-region - The element containing the items, start and end slots\n *\n * @public\n */\nexport class Toolbar extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The internal index of the currently focused element.\n *\n * @internal\n */\n this._activeIndex = 0;\n /**\n * The text direction of the toolbar.\n *\n * @internal\n */\n this.direction = Direction.ltr;\n /**\n * The orientation of the toolbar.\n *\n * @public\n * @remarks\n * HTML Attribute: `orientation`\n */\n this.orientation = Orientation.horizontal;\n }\n /**\n * The index of the currently focused element, clamped between 0 and the last element.\n *\n * @internal\n */\n get activeIndex() {\n Observable.track(this, \"activeIndex\");\n return this._activeIndex;\n }\n set activeIndex(value) {\n if (this.$fastController.isConnected) {\n this._activeIndex = limit(0, this.focusableElements.length - 1, value);\n Observable.notify(this, \"activeIndex\");\n }\n }\n slottedItemsChanged() {\n if (this.$fastController.isConnected) {\n this.reduceFocusableElements();\n }\n }\n /**\n * Set the activeIndex when a focusable element in the toolbar is clicked.\n *\n * @internal\n */\n clickHandler(e) {\n var _a;\n const activeIndex = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a.indexOf(e.target);\n if (activeIndex > -1 && this.activeIndex !== activeIndex) {\n this.setFocusedElement(activeIndex);\n }\n return true;\n }\n childItemsChanged(prev, next) {\n if (this.$fastController.isConnected) {\n this.reduceFocusableElements();\n }\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.direction = getDirection(this);\n }\n /**\n * When the toolbar receives focus, set the currently active element as focused.\n *\n * @internal\n */\n focusinHandler(e) {\n const relatedTarget = e.relatedTarget;\n if (!relatedTarget || this.contains(relatedTarget)) {\n return;\n }\n this.setFocusedElement();\n }\n /**\n * Determines a value that can be used to iterate a list with the arrow keys.\n *\n * @param this - An element with an orientation and direction\n * @param key - The event key value\n * @internal\n */\n getDirectionalIncrementer(key) {\n var _a, _b, _c, _d, _e;\n return ((_e = (_c = (_b = (_a = ToolbarArrowKeyMap[key]) === null || _a === void 0 ? void 0 : _a[this.orientation]) === null || _b === void 0 ? void 0 : _b[this.direction]) !== null && _c !== void 0 ? _c : (_d = ToolbarArrowKeyMap[key]) === null || _d === void 0 ? void 0 : _d[this.orientation]) !== null && _e !== void 0 ? _e : 0);\n }\n /**\n * Handle keyboard events for the toolbar.\n *\n * @internal\n */\n keydownHandler(e) {\n const key = e.key;\n if (!(key in ArrowKeys) || e.defaultPrevented || e.shiftKey) {\n return true;\n }\n const incrementer = this.getDirectionalIncrementer(key);\n if (!incrementer) {\n return !e.target.closest(\"[role=radiogroup]\");\n }\n const nextIndex = this.activeIndex + incrementer;\n if (this.focusableElements[nextIndex]) {\n e.preventDefault();\n }\n this.setFocusedElement(nextIndex);\n return true;\n }\n /**\n * get all the slotted elements\n * @internal\n */\n get allSlottedItems() {\n return [\n ...this.start.assignedElements(),\n ...this.slottedItems,\n ...this.end.assignedElements(),\n ];\n }\n /**\n * Prepare the slotted elements which can be focusable.\n *\n * @internal\n */\n reduceFocusableElements() {\n var _a;\n const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex];\n this.focusableElements = this.allSlottedItems.reduce(Toolbar.reduceFocusableItems, []);\n // If the previously active item is still focusable, adjust the active index to the\n // index of that item.\n const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement);\n this.activeIndex = Math.max(0, adjustedActiveIndex);\n this.setFocusableElements();\n }\n /**\n * Set the activeIndex and focus the corresponding control.\n *\n * @param activeIndex - The new index to set\n * @internal\n */\n setFocusedElement(activeIndex = this.activeIndex) {\n var _a;\n this.activeIndex = activeIndex;\n this.setFocusableElements();\n (_a = this.focusableElements[this.activeIndex]) === null || _a === void 0 ? void 0 : _a.focus();\n }\n /**\n * Reduce a collection to only its focusable elements.\n *\n * @param elements - Collection of elements to reduce\n * @param element - The current element\n *\n * @internal\n */\n static reduceFocusableItems(elements, element) {\n var _a, _b, _c, _d;\n const isRoleRadio = element.getAttribute(\"role\") === \"radio\";\n const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus;\n const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll(\"*\")) !== null && _d !== void 0 ? _d : []).some(x => isFocusable(x));\n if (!element.hasAttribute(\"disabled\") &&\n !element.hasAttribute(\"hidden\") &&\n (isFocusable(element) ||\n isRoleRadio ||\n isFocusableFastElement ||\n hasFocusableShadow)) {\n elements.push(element);\n return elements;\n }\n if (element.childElementCount) {\n return elements.concat(Array.from(element.children).reduce(Toolbar.reduceFocusableItems, []));\n }\n return elements;\n }\n /**\n * @internal\n */\n setFocusableElements() {\n if (this.$fastController.isConnected && this.focusableElements.length > 0) {\n this.focusableElements.forEach((element, index) => {\n element.tabIndex = this.activeIndex === index ? 0 : -1;\n });\n }\n }\n}\n__decorate([\n observable\n], Toolbar.prototype, \"direction\", void 0);\n__decorate([\n attr\n], Toolbar.prototype, \"orientation\", void 0);\n__decorate([\n observable\n], Toolbar.prototype, \"slottedItems\", void 0);\n__decorate([\n observable\n], Toolbar.prototype, \"slottedLabel\", void 0);\n__decorate([\n observable\n], Toolbar.prototype, \"childItems\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA toolbar role\n *\n * @public\n */\nexport class DelegatesARIAToolbar {\n}\n__decorate([\n attr({ attribute: \"aria-labelledby\" })\n], DelegatesARIAToolbar.prototype, \"ariaLabelledby\", void 0);\n__decorate([\n attr({ attribute: \"aria-label\" })\n], DelegatesARIAToolbar.prototype, \"ariaLabel\", void 0);\napplyMixins(DelegatesARIAToolbar, ARIAGlobalStatesAndProperties);\napplyMixins(Toolbar, StartEnd, DelegatesARIAToolbar);\n","import { html, ref, when } from \"@microsoft/fast-element\";\nimport { AnchoredRegion } from \"../anchored-region/anchored-region.js\";\n/**\n * Creates a template for the {@link @microsoft/fast-foundation#(Tooltip:class)} component using the provided prefix.\n * @public\n */\nexport const tooltipTemplate = (context, definition) => {\n return html `\n ${when(x => x.tooltipVisible, html `\n <${context.tagFor(AnchoredRegion)}\n fixed-placement=\"true\"\n auto-update-mode=\"${x => x.autoUpdateMode}\"\n vertical-positioning-mode=\"${x => x.verticalPositioningMode}\"\n vertical-default-position=\"${x => x.verticalDefaultPosition}\"\n vertical-inset=\"${x => x.verticalInset}\"\n vertical-scaling=\"${x => x.verticalScaling}\"\n horizontal-positioning-mode=\"${x => x.horizontalPositioningMode}\"\n horizontal-default-position=\"${x => x.horizontalDefaultPosition}\"\n horizontal-scaling=\"${x => x.horizontalScaling}\"\n horizontal-inset=\"${x => x.horizontalInset}\"\n vertical-viewport-lock=\"${x => x.horizontalViewportLock}\"\n horizontal-viewport-lock=\"${x => x.verticalViewportLock}\"\n dir=\"${x => x.currentDirection}\"\n ${ref(\"region\")}\n >\n <div class=\"tooltip\" part=\"tooltip\" role=\"tooltip\">\n <slot></slot>\n </div>\n </${context.tagFor(AnchoredRegion)}>\n `)}\n `;\n};\n","/**\n * Enumerates possible tooltip positions\n *\n * @public\n */\nexport const TooltipPosition = {\n /**\n * The tooltip is positioned above the element\n */\n top: \"top\",\n /**\n * The tooltip is positioned to the right of the element\n */\n right: \"right\",\n /**\n * The tooltip is positioned below the element\n */\n bottom: \"bottom\",\n /**\n * The tooltip is positioned to the left of the element\n */\n left: \"left\",\n /**\n * The tooltip is positioned before the element\n */\n start: \"start\",\n /**\n * The tooltip is positioned after the element\n */\n end: \"end\",\n /**\n * The tooltip is positioned above the element and to the left\n */\n topLeft: \"top-left\",\n /**\n * The tooltip is positioned above the element and to the right\n */\n topRight: \"top-right\",\n /**\n * The tooltip is positioned below the element and to the left\n */\n bottomLeft: \"bottom-left\",\n /**\n * The tooltip is positioned below the element and to the right\n */\n bottomRight: \"bottom-right\",\n /**\n * The tooltip is positioned above the element and to the left\n */\n topStart: \"top-start\",\n /**\n * The tooltip is positioned above the element and to the right\n */\n topEnd: \"top-end\",\n /**\n * The tooltip is positioned below the element and to the left\n */\n bottomStart: \"bottom-start\",\n /**\n * The tooltip is positioned below the element and to the right\n */\n bottomEnd: \"bottom-end\",\n};\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, observable } from \"@microsoft/fast-element\";\nimport { Direction, keyEscape } from \"@microsoft/fast-web-utilities\";\nimport { getDirection } from \"../utilities/direction.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\nimport { TooltipPosition } from \"./tooltip.options.js\";\nexport { TooltipPosition };\n/**\n * An Tooltip Custom HTML Element.\n *\n * @slot - The default slot for the tooltip content\n * @csspart tooltip - The tooltip element\n * @fires dismiss - Fires a custom 'dismiss' event when the tooltip is visible and escape key is pressed\n *\n * @public\n */\nexport class Tooltip extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The id of the element the tooltip is anchored to\n *\n * @defaultValue - undefined\n * @public\n * HTML Attribute: anchor\n */\n this.anchor = \"\";\n /**\n * The delay in milliseconds before a tooltip is shown after a hover event\n *\n * @defaultValue - 300\n * @public\n * HTML Attribute: delay\n */\n this.delay = 300;\n /**\n * Controls when the tooltip updates its position, default is 'anchor' which only updates when\n * the anchor is resized. 'auto' will update on scroll/resize events.\n * Corresponds to anchored-region auto-update-mode.\n * @public\n * @remarks\n * HTML Attribute: auto-update-mode\n */\n this.autoUpdateMode = \"anchor\";\n /**\n * the html element currently being used as anchor.\n * Setting this directly overrides the anchor attribute.\n *\n * @public\n */\n this.anchorElement = null;\n /**\n * The current viewport element instance\n *\n * @internal\n */\n this.viewportElement = null;\n /**\n * @internal\n * @defaultValue \"dynamic\"\n */\n this.verticalPositioningMode = \"dynamic\";\n /**\n * @internal\n * @defaultValue \"dynamic\"\n */\n this.horizontalPositioningMode = \"dynamic\";\n /**\n * @internal\n */\n this.horizontalInset = \"false\";\n /**\n * @internal\n */\n this.verticalInset = \"false\";\n /**\n * @internal\n */\n this.horizontalScaling = \"content\";\n /**\n * @internal\n */\n this.verticalScaling = \"content\";\n /**\n * @internal\n */\n this.verticalDefaultPosition = undefined;\n /**\n * @internal\n */\n this.horizontalDefaultPosition = undefined;\n /**\n * @internal\n */\n this.tooltipVisible = false;\n /**\n * Track current direction to pass to the anchored region\n * updated when tooltip is shown\n *\n * @internal\n */\n this.currentDirection = Direction.ltr;\n /**\n * The timer that tracks delay time before the tooltip is shown on hover\n */\n this.showDelayTimer = null;\n /**\n * The timer that tracks delay time before the tooltip is hidden\n */\n this.hideDelayTimer = null;\n /**\n * Indicates whether the anchor is currently being hovered or has focus\n */\n this.isAnchorHoveredFocused = false;\n /**\n * Indicates whether the region is currently being hovered\n */\n this.isRegionHovered = false;\n /**\n * invoked when the anchored region's position relative to the anchor changes\n *\n * @internal\n */\n this.handlePositionChange = (ev) => {\n this.classList.toggle(\"top\", this.region.verticalPosition === \"start\");\n this.classList.toggle(\"bottom\", this.region.verticalPosition === \"end\");\n this.classList.toggle(\"inset-top\", this.region.verticalPosition === \"insetStart\");\n this.classList.toggle(\"inset-bottom\", this.region.verticalPosition === \"insetEnd\");\n this.classList.toggle(\"center-vertical\", this.region.verticalPosition === \"center\");\n this.classList.toggle(\"left\", this.region.horizontalPosition === \"start\");\n this.classList.toggle(\"right\", this.region.horizontalPosition === \"end\");\n this.classList.toggle(\"inset-left\", this.region.horizontalPosition === \"insetStart\");\n this.classList.toggle(\"inset-right\", this.region.horizontalPosition === \"insetEnd\");\n this.classList.toggle(\"center-horizontal\", this.region.horizontalPosition === \"center\");\n };\n /**\n * mouse enters region\n */\n this.handleRegionMouseOver = (ev) => {\n this.isRegionHovered = true;\n };\n /**\n * mouse leaves region\n */\n this.handleRegionMouseOut = (ev) => {\n this.isRegionHovered = false;\n this.startHideDelayTimer();\n };\n /**\n * mouse enters anchor\n */\n this.handleAnchorMouseOver = (ev) => {\n if (this.tooltipVisible) {\n // tooltip is already visible, just set the anchor hover flag\n this.isAnchorHoveredFocused = true;\n return;\n }\n this.startShowDelayTimer();\n };\n /**\n * mouse leaves anchor\n */\n this.handleAnchorMouseOut = (ev) => {\n this.isAnchorHoveredFocused = false;\n this.clearShowDelayTimer();\n this.startHideDelayTimer();\n };\n /**\n * anchor gets focus\n */\n this.handleAnchorFocusIn = (ev) => {\n this.startShowDelayTimer();\n };\n /**\n * anchor loses focus\n */\n this.handleAnchorFocusOut = (ev) => {\n this.isAnchorHoveredFocused = false;\n this.clearShowDelayTimer();\n this.startHideDelayTimer();\n };\n /**\n * starts the hide timer\n */\n this.startHideDelayTimer = () => {\n this.clearHideDelayTimer();\n if (!this.tooltipVisible) {\n return;\n }\n // allow 60 ms for account for pointer to move between anchor/tooltip\n // without hiding tooltip\n this.hideDelayTimer = window.setTimeout(() => {\n this.updateTooltipVisibility();\n }, 60);\n };\n /**\n * clears the hide delay\n */\n this.clearHideDelayTimer = () => {\n if (this.hideDelayTimer !== null) {\n clearTimeout(this.hideDelayTimer);\n this.hideDelayTimer = null;\n }\n };\n /**\n * starts the show timer if not currently running\n */\n this.startShowDelayTimer = () => {\n if (this.isAnchorHoveredFocused) {\n return;\n }\n if (this.delay > 1) {\n if (this.showDelayTimer === null)\n this.showDelayTimer = window.setTimeout(() => {\n this.startHover();\n }, this.delay);\n return;\n }\n this.startHover();\n };\n /**\n * start hover\n */\n this.startHover = () => {\n this.isAnchorHoveredFocused = true;\n this.updateTooltipVisibility();\n };\n /**\n * clears the show delay\n */\n this.clearShowDelayTimer = () => {\n if (this.showDelayTimer !== null) {\n clearTimeout(this.showDelayTimer);\n this.showDelayTimer = null;\n }\n };\n /**\n * Gets the anchor element by id\n */\n this.getAnchor = () => {\n const rootNode = this.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n return rootNode.getElementById(this.anchor);\n }\n return document.getElementById(this.anchor);\n };\n /**\n * handles key down events to check for dismiss\n */\n this.handleDocumentKeydown = (e) => {\n if (!e.defaultPrevented && this.tooltipVisible) {\n switch (e.key) {\n case keyEscape:\n this.isAnchorHoveredFocused = false;\n this.updateTooltipVisibility();\n this.$emit(\"dismiss\");\n break;\n }\n }\n };\n /**\n * determines whether to show or hide the tooltip based on current state\n */\n this.updateTooltipVisibility = () => {\n if (this.visible === false) {\n this.hideTooltip();\n }\n else if (this.visible === true) {\n this.showTooltip();\n return;\n }\n else {\n if (this.isAnchorHoveredFocused || this.isRegionHovered) {\n this.showTooltip();\n return;\n }\n this.hideTooltip();\n }\n };\n /**\n * shows the tooltip\n */\n this.showTooltip = () => {\n if (this.tooltipVisible) {\n return;\n }\n this.currentDirection = getDirection(this);\n this.tooltipVisible = true;\n document.addEventListener(\"keydown\", this.handleDocumentKeydown);\n DOM.queueUpdate(this.setRegionProps);\n };\n /**\n * hides the tooltip\n */\n this.hideTooltip = () => {\n if (!this.tooltipVisible) {\n return;\n }\n this.clearHideDelayTimer();\n if (this.region !== null && this.region !== undefined) {\n this.region.removeEventListener(\"positionchange\", this.handlePositionChange);\n this.region.viewportElement = null;\n this.region.anchorElement = null;\n this.region.removeEventListener(\"mouseover\", this.handleRegionMouseOver);\n this.region.removeEventListener(\"mouseout\", this.handleRegionMouseOut);\n }\n document.removeEventListener(\"keydown\", this.handleDocumentKeydown);\n this.tooltipVisible = false;\n };\n /**\n * updates the tooltip anchored region props after it has been\n * added to the DOM\n */\n this.setRegionProps = () => {\n if (!this.tooltipVisible) {\n return;\n }\n this.region.viewportElement = this.viewportElement;\n this.region.anchorElement = this.anchorElement;\n this.region.addEventListener(\"positionchange\", this.handlePositionChange);\n this.region.addEventListener(\"mouseover\", this.handleRegionMouseOver, {\n passive: true,\n });\n this.region.addEventListener(\"mouseout\", this.handleRegionMouseOut, {\n passive: true,\n });\n };\n }\n visibleChanged() {\n if (this.$fastController.isConnected) {\n this.updateTooltipVisibility();\n this.updateLayout();\n }\n }\n anchorChanged() {\n if (this.$fastController.isConnected) {\n this.anchorElement = this.getAnchor();\n }\n }\n positionChanged() {\n if (this.$fastController.isConnected) {\n this.updateLayout();\n }\n }\n anchorElementChanged(oldValue) {\n if (this.$fastController.isConnected) {\n if (oldValue !== null && oldValue !== undefined) {\n oldValue.removeEventListener(\"mouseover\", this.handleAnchorMouseOver);\n oldValue.removeEventListener(\"mouseout\", this.handleAnchorMouseOut);\n oldValue.removeEventListener(\"focusin\", this.handleAnchorFocusIn);\n oldValue.removeEventListener(\"focusout\", this.handleAnchorFocusOut);\n }\n if (this.anchorElement !== null && this.anchorElement !== undefined) {\n this.anchorElement.addEventListener(\"mouseover\", this.handleAnchorMouseOver, { passive: true });\n this.anchorElement.addEventListener(\"mouseout\", this.handleAnchorMouseOut, { passive: true });\n this.anchorElement.addEventListener(\"focusin\", this.handleAnchorFocusIn, {\n passive: true,\n });\n this.anchorElement.addEventListener(\"focusout\", this.handleAnchorFocusOut, { passive: true });\n const anchorId = this.anchorElement.id;\n if (this.anchorElement.parentElement !== null) {\n this.anchorElement.parentElement\n .querySelectorAll(\":hover\")\n .forEach(element => {\n if (element.id === anchorId) {\n this.startShowDelayTimer();\n }\n });\n }\n }\n if (this.region !== null &&\n this.region !== undefined &&\n this.tooltipVisible) {\n this.region.anchorElement = this.anchorElement;\n }\n this.updateLayout();\n }\n }\n viewportElementChanged() {\n if (this.region !== null && this.region !== undefined) {\n this.region.viewportElement = this.viewportElement;\n }\n this.updateLayout();\n }\n connectedCallback() {\n super.connectedCallback();\n this.anchorElement = this.getAnchor();\n this.updateTooltipVisibility();\n }\n disconnectedCallback() {\n this.hideTooltip();\n this.clearShowDelayTimer();\n this.clearHideDelayTimer();\n super.disconnectedCallback();\n }\n /**\n * updated the properties being passed to the anchored region\n */\n updateLayout() {\n this.verticalPositioningMode = \"locktodefault\";\n this.horizontalPositioningMode = \"locktodefault\";\n switch (this.position) {\n case TooltipPosition.top:\n case TooltipPosition.bottom:\n this.verticalDefaultPosition = this.position;\n this.horizontalDefaultPosition = \"center\";\n break;\n case TooltipPosition.right:\n case TooltipPosition.left:\n case TooltipPosition.start:\n case TooltipPosition.end:\n this.verticalDefaultPosition = \"center\";\n this.horizontalDefaultPosition = this.position;\n break;\n case TooltipPosition.topLeft:\n this.verticalDefaultPosition = \"top\";\n this.horizontalDefaultPosition = \"left\";\n break;\n case TooltipPosition.topRight:\n this.verticalDefaultPosition = \"top\";\n this.horizontalDefaultPosition = \"right\";\n break;\n case TooltipPosition.bottomLeft:\n this.verticalDefaultPosition = \"bottom\";\n this.horizontalDefaultPosition = \"left\";\n break;\n case TooltipPosition.bottomRight:\n this.verticalDefaultPosition = \"bottom\";\n this.horizontalDefaultPosition = \"right\";\n break;\n case TooltipPosition.topStart:\n this.verticalDefaultPosition = \"top\";\n this.horizontalDefaultPosition = \"start\";\n break;\n case TooltipPosition.topEnd:\n this.verticalDefaultPosition = \"top\";\n this.horizontalDefaultPosition = \"end\";\n break;\n case TooltipPosition.bottomStart:\n this.verticalDefaultPosition = \"bottom\";\n this.horizontalDefaultPosition = \"start\";\n break;\n case TooltipPosition.bottomEnd:\n this.verticalDefaultPosition = \"bottom\";\n this.horizontalDefaultPosition = \"end\";\n break;\n default:\n this.verticalPositioningMode = \"dynamic\";\n this.horizontalPositioningMode = \"dynamic\";\n this.verticalDefaultPosition = void 0;\n this.horizontalDefaultPosition = \"center\";\n break;\n }\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], Tooltip.prototype, \"visible\", void 0);\n__decorate([\n attr\n], Tooltip.prototype, \"anchor\", void 0);\n__decorate([\n attr\n], Tooltip.prototype, \"delay\", void 0);\n__decorate([\n attr\n], Tooltip.prototype, \"position\", void 0);\n__decorate([\n attr({ attribute: \"auto-update-mode\" })\n], Tooltip.prototype, \"autoUpdateMode\", void 0);\n__decorate([\n attr({ attribute: \"horizontal-viewport-lock\" })\n], Tooltip.prototype, \"horizontalViewportLock\", void 0);\n__decorate([\n attr({ attribute: \"vertical-viewport-lock\" })\n], Tooltip.prototype, \"verticalViewportLock\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"anchorElement\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"viewportElement\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"verticalPositioningMode\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"horizontalPositioningMode\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"horizontalInset\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"verticalInset\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"horizontalScaling\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"verticalScaling\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"verticalDefaultPosition\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"horizontalDefaultPosition\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"tooltipVisible\", void 0);\n__decorate([\n observable\n], Tooltip.prototype, \"currentDirection\", void 0);\n","import { children, elements, html, ref, slotted, when } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end.js\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(TreeItem:class)} component.\n * @public\n */\nexport const treeItemTemplate = (context, definition) => html `\n <template\n role=\"treeitem\"\n slot=\"${x => (x.isNestedItem() ? \"item\" : void 0)}\"\n tabindex=\"-1\"\n class=\"${x => (x.expanded ? \"expanded\" : \"\")} ${x => x.selected ? \"selected\" : \"\"} ${x => (x.nested ? \"nested\" : \"\")}\n ${x => (x.disabled ? \"disabled\" : \"\")}\"\n aria-expanded=\"${x => x.childItems && x.childItemLength() > 0 ? x.expanded : void 0}\"\n aria-selected=\"${x => x.selected}\"\n aria-disabled=\"${x => x.disabled}\"\n @focusin=\"${(x, c) => x.handleFocus(c.event)}\"\n @focusout=\"${(x, c) => x.handleBlur(c.event)}\"\n ${children({\n property: \"childItems\",\n filter: elements(),\n})}\n >\n <div class=\"positioning-region\" part=\"positioning-region\">\n <div class=\"content-region\" part=\"content-region\">\n ${when(x => x.childItems && x.childItemLength() > 0, html `\n <div\n aria-hidden=\"true\"\n class=\"expand-collapse-button\"\n part=\"expand-collapse-button\"\n @click=\"${(x, c) => x.handleExpandCollapseButtonClick(c.event)}\"\n ${ref(\"expandCollapseButton\")}\n >\n <slot name=\"expand-collapse-glyph\">\n ${definition.expandCollapseGlyph || \"\"}\n </slot>\n </div>\n `)}\n ${startSlotTemplate(context, definition)}\n <slot></slot>\n ${endSlotTemplate(context, definition)}\n </div>\n </div>\n ${when(x => x.childItems &&\n x.childItemLength() > 0 &&\n (x.expanded || x.renderCollapsedChildren), html `\n <div role=\"group\" class=\"items\" part=\"items\">\n <slot name=\"item\" ${slotted(\"items\")}></slot>\n </div>\n `)}\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { isHTMLElement } from \"@microsoft/fast-web-utilities\";\nimport { StartEnd } from \"../patterns/start-end.js\";\nimport { applyMixins } from \"../utilities/apply-mixins.js\";\nimport { FoundationElement, } from \"../foundation-element/foundation-element.js\";\n/**\n * check if the item is a tree item\n * @public\n * @remarks\n * determines if element is an HTMLElement and if it has the role treeitem\n */\nexport function isTreeItemElement(el) {\n return isHTMLElement(el) && el.getAttribute(\"role\") === \"treeitem\";\n}\n/**\n * A Tree item Custom HTML Element.\n *\n * @slot start - Content which can be provided before the tree item content\n * @slot end - Content which can be provided after the tree item content\n * @slot - The default slot for tree item text content\n * @slot item - The slot for tree items (fast tree items manage this assignment themselves)\n * @slot expand-collapse-button - The expand/collapse button\n * @csspart positioning-region - The element used to position the tree item content with exception of any child nodes\n * @csspart content-region - The element containing the expand/collapse, start, and end slots\n * @csspart items - The element wrapping any child items\n * @csspart expand-collapse-button - The expand/collapse button\n * @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes\n * @fires selected-change - Fires a custom 'selected-change' event when the selected state changes\n *\n * @public\n */\nexport class TreeItem extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * When true, the control will be appear expanded by user interaction.\n * @public\n * @remarks\n * HTML Attribute: expanded\n */\n this.expanded = false;\n /**\n * Whether the item is focusable\n *\n * @internal\n */\n this.focusable = false;\n /**\n * Whether the tree is nested\n *\n * @public\n */\n this.isNestedItem = () => {\n return isTreeItemElement(this.parentElement);\n };\n /**\n * Handle expand button click\n *\n * @internal\n */\n this.handleExpandCollapseButtonClick = (e) => {\n if (!this.disabled && !e.defaultPrevented) {\n this.expanded = !this.expanded;\n }\n };\n /**\n * Handle focus events\n *\n * @internal\n */\n this.handleFocus = (e) => {\n this.setAttribute(\"tabindex\", \"0\");\n };\n /**\n * Handle blur events\n *\n * @internal\n */\n this.handleBlur = (e) => {\n this.setAttribute(\"tabindex\", \"-1\");\n };\n }\n expandedChanged() {\n if (this.$fastController.isConnected) {\n this.$emit(\"expanded-change\", this);\n }\n }\n selectedChanged() {\n if (this.$fastController.isConnected) {\n this.$emit(\"selected-change\", this);\n }\n }\n itemsChanged(oldValue, newValue) {\n if (this.$fastController.isConnected) {\n this.items.forEach((node) => {\n if (isTreeItemElement(node)) {\n // TODO: maybe not require it to be a TreeItem?\n node.nested = true;\n }\n });\n }\n }\n /**\n * Places document focus on a tree item\n *\n * @public\n * @param el - the element to focus\n */\n static focusItem(el) {\n el.focusable = true;\n el.focus();\n }\n /**\n * Gets number of children\n *\n * @internal\n */\n childItemLength() {\n const treeChildren = this.childItems.filter((item) => {\n return isTreeItemElement(item);\n });\n return treeChildren ? treeChildren.length : 0;\n }\n}\n__decorate([\n attr({ mode: \"boolean\" })\n], TreeItem.prototype, \"expanded\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], TreeItem.prototype, \"selected\", void 0);\n__decorate([\n attr({ mode: \"boolean\" })\n], TreeItem.prototype, \"disabled\", void 0);\n__decorate([\n observable\n], TreeItem.prototype, \"focusable\", void 0);\n__decorate([\n observable\n], TreeItem.prototype, \"childItems\", void 0);\n__decorate([\n observable\n], TreeItem.prototype, \"items\", void 0);\n__decorate([\n observable\n], TreeItem.prototype, \"nested\", void 0);\n__decorate([\n observable\n], TreeItem.prototype, \"renderCollapsedChildren\", void 0);\napplyMixins(TreeItem, StartEnd);\n","import { html, ref, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#TreeView} component.\n * @public\n */\nexport const treeViewTemplate = (context, definition) => html `\n <template\n role=\"tree\"\n ${ref(\"treeView\")}\n @keydown=\"${(x, c) => x.handleKeyDown(c.event)}\"\n @focusin=\"${(x, c) => x.handleFocus(c.event)}\"\n @focusout=\"${(x, c) => x.handleBlur(c.event)}\"\n @click=\"${(x, c) => x.handleClick(c.event)}\"\n @selected-change=\"${(x, c) => x.handleSelectedChange(c.event)}\"\n >\n <slot ${slotted(\"slottedTreeItems\")}></slot>\n </template>\n`;\n","import { __decorate } from \"tslib\";\nimport { attr, DOM, observable } from \"@microsoft/fast-element\";\nimport { getDisplayedNodes, isHTMLElement, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnd, keyEnter, keyHome, } from \"@microsoft/fast-web-utilities\";\nimport { isTreeItemElement, TreeItem } from \"../tree-item/tree-item.js\";\nimport { FoundationElement } from \"../foundation-element/foundation-element.js\";\n/**\n * A Tree view Custom HTML Element.\n * Implements the {@link https://w3c.github.io/aria-practices/#TreeView | ARIA TreeView }.\n *\n * @slot - The default slot for tree items\n *\n * @public\n */\nexport class TreeView extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The tree item that is designated to be in the tab queue.\n *\n * @internal\n */\n this.currentFocused = null;\n /**\n * Handle focus events\n *\n * @internal\n */\n this.handleFocus = (e) => {\n if (this.slottedTreeItems.length < 1) {\n // no child items, nothing to do\n return;\n }\n if (e.target === this) {\n if (this.currentFocused === null) {\n this.currentFocused = this.getValidFocusableItem();\n }\n if (this.currentFocused !== null) {\n TreeItem.focusItem(this.currentFocused);\n }\n return;\n }\n if (this.contains(e.target)) {\n this.setAttribute(\"tabindex\", \"-1\");\n this.currentFocused = e.target;\n }\n };\n /**\n * Handle blur events\n *\n * @internal\n */\n this.handleBlur = (e) => {\n if (e.target instanceof HTMLElement &&\n (e.relatedTarget === null || !this.contains(e.relatedTarget))) {\n this.setAttribute(\"tabindex\", \"0\");\n }\n };\n /**\n * KeyDown handler\n *\n * @internal\n */\n this.handleKeyDown = (e) => {\n if (e.defaultPrevented) {\n return;\n }\n if (this.slottedTreeItems.length < 1) {\n return true;\n }\n const treeItems = this.getVisibleNodes();\n switch (e.key) {\n case keyHome:\n if (treeItems.length) {\n TreeItem.focusItem(treeItems[0]);\n }\n return;\n case keyEnd:\n if (treeItems.length) {\n TreeItem.focusItem(treeItems[treeItems.length - 1]);\n }\n return;\n case keyArrowLeft:\n if (e.target && this.isFocusableElement(e.target)) {\n const item = e.target;\n if (item instanceof TreeItem &&\n item.childItemLength() > 0 &&\n item.expanded) {\n item.expanded = false;\n }\n else if (item instanceof TreeItem &&\n item.parentElement instanceof TreeItem) {\n TreeItem.focusItem(item.parentElement);\n }\n }\n return false;\n case keyArrowRight:\n if (e.target && this.isFocusableElement(e.target)) {\n const item = e.target;\n if (item instanceof TreeItem &&\n item.childItemLength() > 0 &&\n !item.expanded) {\n item.expanded = true;\n }\n else if (item instanceof TreeItem && item.childItemLength() > 0) {\n this.focusNextNode(1, e.target);\n }\n }\n return;\n case keyArrowDown:\n if (e.target && this.isFocusableElement(e.target)) {\n this.focusNextNode(1, e.target);\n }\n return;\n case keyArrowUp:\n if (e.target && this.isFocusableElement(e.target)) {\n this.focusNextNode(-1, e.target);\n }\n return;\n case keyEnter:\n // In single-select trees where selection does not follow focus (see note below),\n // the default action is typically to select the focused node.\n this.handleClick(e);\n return;\n }\n // don't prevent default if we took no action\n return true;\n };\n /**\n * Handles the selected-changed events bubbling up\n * from child tree items\n *\n * @internal\n */\n this.handleSelectedChange = (e) => {\n if (e.defaultPrevented) {\n return;\n }\n if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) {\n return true;\n }\n const item = e.target;\n if (item.selected) {\n if (this.currentSelected && this.currentSelected !== item) {\n this.currentSelected.selected = false;\n }\n // new selected item\n this.currentSelected = item;\n }\n else if (!item.selected && this.currentSelected === item) {\n // selected item deselected\n this.currentSelected = null;\n }\n return;\n };\n /**\n * Updates the tree view when slottedTreeItems changes\n */\n this.setItems = () => {\n // force single selection\n // defaults to first one found\n const selectedItem = this.treeView.querySelector(\"[aria-selected='true']\");\n this.currentSelected = selectedItem;\n // invalidate the current focused item if it is no longer valid\n if (this.currentFocused === null || !this.contains(this.currentFocused)) {\n this.currentFocused = this.getValidFocusableItem();\n }\n // toggle properties on child elements\n this.nested = this.checkForNestedItems();\n const treeItems = this.getVisibleNodes();\n treeItems.forEach(node => {\n if (isTreeItemElement(node)) {\n node.nested = this.nested;\n }\n });\n };\n /**\n * check if the item is focusable\n */\n this.isFocusableElement = (el) => {\n return isTreeItemElement(el);\n };\n this.isSelectedElement = (el) => {\n return el.selected;\n };\n }\n slottedTreeItemsChanged() {\n if (this.$fastController.isConnected) {\n // update for slotted children change\n this.setItems();\n }\n }\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute(\"tabindex\", \"0\");\n DOM.queueUpdate(() => {\n this.setItems();\n });\n }\n /**\n * Handles click events bubbling up\n *\n * @internal\n */\n handleClick(e) {\n if (e.defaultPrevented) {\n // handled, do nothing\n return;\n }\n if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) {\n // not a tree item, ignore\n return true;\n }\n const item = e.target;\n if (!item.disabled) {\n item.selected = !item.selected;\n }\n return;\n }\n /**\n * Move focus to a tree item based on its offset from the provided item\n */\n focusNextNode(delta, item) {\n const visibleNodes = this.getVisibleNodes();\n if (!visibleNodes) {\n return;\n }\n const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta];\n if (isHTMLElement(focusItem)) {\n TreeItem.focusItem(focusItem);\n }\n }\n /**\n * checks if there are any nested tree items\n */\n getValidFocusableItem() {\n const treeItems = this.getVisibleNodes();\n // default to selected element if there is one\n let focusIndex = treeItems.findIndex(this.isSelectedElement);\n if (focusIndex === -1) {\n // otherwise first focusable tree item\n focusIndex = treeItems.findIndex(this.isFocusableElement);\n }\n if (focusIndex !== -1) {\n return treeItems[focusIndex];\n }\n return null;\n }\n /**\n * checks if there are any nested tree items\n */\n checkForNestedItems() {\n return this.slottedTreeItems.some((node) => {\n return isTreeItemElement(node) && node.querySelector(\"[role='treeitem']\");\n });\n }\n getVisibleNodes() {\n return getDisplayedNodes(this, \"[role='treeitem']\") || [];\n }\n}\n__decorate([\n attr({ attribute: \"render-collapsed-nodes\" })\n], TreeView.prototype, \"renderCollapsedNodes\", void 0);\n__decorate([\n observable\n], TreeView.prototype, \"currentSelected\", void 0);\n__decorate([\n observable\n], TreeView.prototype, \"slottedTreeItems\", void 0);\n","/**\n * An abstract behavior to react to media queries. Implementations should implement\n * the `constructListener` method to perform some action based on media query changes.\n *\n * @public\n */\nexport class MatchMediaBehavior {\n /**\n *\n * @param query - The media query to operate from.\n */\n constructor(query) {\n /**\n * The behavior needs to operate on element instances but elements might share a behavior instance.\n * To ensure proper attachment / detachment per instance, we construct a listener for\n * each bind invocation and cache the listeners by element reference.\n */\n this.listenerCache = new WeakMap();\n this.query = query;\n }\n /**\n * Binds the behavior to the element.\n * @param source - The element for which the behavior is bound.\n */\n bind(source) {\n const { query } = this;\n const listener = this.constructListener(source);\n // Invoke immediately to add if the query currently matches\n listener.bind(query)();\n query.addListener(listener);\n this.listenerCache.set(source, listener);\n }\n /**\n * Unbinds the behavior from the element.\n * @param source - The element for which the behavior is unbinding.\n */\n unbind(source) {\n const listener = this.listenerCache.get(source);\n if (listener) {\n this.query.removeListener(listener);\n this.listenerCache.delete(source);\n }\n }\n}\n/**\n * A behavior to add or remove a stylesheet from an element based on a media query. The behavior ensures that\n * styles are applied while the a query matches the environment and that styles are not applied if the query does\n * not match the environment.\n *\n * @public\n */\nexport class MatchMediaStyleSheetBehavior extends MatchMediaBehavior {\n /**\n * Constructs a {@link MatchMediaStyleSheetBehavior} instance.\n * @param query - The media query to operate from.\n * @param styles - The styles to coordinate with the query.\n */\n constructor(query, styles) {\n super(query);\n this.styles = styles;\n }\n /**\n * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for\n * a provided query.\n * @param query - The media query to operate from.\n *\n * @public\n * @example\n *\n * ```ts\n * import { css } from \"@microsoft/fast-element\";\n * import { MatchMediaStyleSheetBehavior } from \"@microsoft/fast-foundation\";\n *\n * const landscapeBehavior = MatchMediaStyleSheetBehavior.with(\n * window.matchMedia(\"(orientation: landscape)\")\n * );\n * const styles = css`\n * :host {\n * width: 200px;\n * height: 400px;\n * }\n * `\n * .withBehaviors(landscapeBehavior(css`\n * :host {\n * width: 400px;\n * height: 200px;\n * }\n * `))\n * ```\n */\n static with(query) {\n return (styles) => {\n return new MatchMediaStyleSheetBehavior(query, styles);\n };\n }\n /**\n * Constructs a match-media listener for a provided element.\n * @param source - the element for which to attach or detach styles.\n * @internal\n */\n constructListener(source) {\n let attached = false;\n const styles = this.styles;\n return function listener() {\n const { matches } = this;\n if (matches && !attached) {\n source.$fastController.addStyles(styles);\n attached = matches;\n }\n else if (!matches && attached) {\n source.$fastController.removeStyles(styles);\n attached = matches;\n }\n };\n }\n /**\n * Unbinds the behavior from the element.\n * @param source - The element for which the behavior is unbinding.\n * @internal\n */\n unbind(source) {\n super.unbind(source);\n source.$fastController.removeStyles(this.styles);\n }\n}\n/**\n * This can be used to construct a behavior to apply a forced-colors only stylesheet.\n * @public\n */\nexport const forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia(\"(forced-colors)\"));\n/**\n * This can be used to construct a behavior to apply a prefers color scheme: dark only stylesheet.\n * @public\n */\nexport const darkModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia(\"(prefers-color-scheme: dark)\"));\n/**\n * This can be used to construct a behavior to apply a prefers color scheme: light only stylesheet.\n * @public\n */\nexport const lightModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia(\"(prefers-color-scheme: light)\"));\n","import { Observable, } from \"@microsoft/fast-element\";\n/**\n * A behavior to add or remove a stylesheet from an element based on a property. The behavior ensures that\n * styles are applied while the property matches and that styles are not applied if the property does\n * not match.\n *\n * @public\n */\nexport class PropertyStyleSheetBehavior {\n /**\n * Constructs a {@link PropertyStyleSheetBehavior} instance.\n * @param propertyName - The property name to operate from.\n * @param value - The property value to operate from.\n * @param styles - The styles to coordinate with the property.\n */\n constructor(propertyName, value, styles) {\n this.propertyName = propertyName;\n this.value = value;\n this.styles = styles;\n }\n /**\n * Binds the behavior to the element.\n * @param elementInstance - The element for which the property is applied.\n */\n bind(elementInstance) {\n Observable.getNotifier(elementInstance).subscribe(this, this.propertyName);\n this.handleChange(elementInstance, this.propertyName);\n }\n /**\n * Unbinds the behavior from the element.\n * @param source - The element for which the behavior is unbinding.\n * @internal\n */\n unbind(source) {\n Observable.getNotifier(source).unsubscribe(this, this.propertyName);\n source.$fastController.removeStyles(this.styles);\n }\n /**\n * Change event for the provided element.\n * @param source - the element for which to attach or detach styles.\n * @param key - the key to lookup to know if the element already has the styles\n * @internal\n */\n handleChange(source, key) {\n if (source[key] === this.value) {\n source.$fastController.addStyles(this.styles);\n }\n else {\n source.$fastController.removeStyles(this.styles);\n }\n }\n}\n","/**\n * The CSS value for disabled cursors.\n * @public\n */\nexport const disabledCursor = \"not-allowed\";\n","/**\n * A CSS fragment to set `display: none;` when the host is hidden using the [hidden] attribute.\n * @public\n */\nexport const hidden = `:host([hidden]){display:none}`;\n/**\n * Applies a CSS display property.\n * Also adds CSS rules to not display the element when the [hidden] attribute is applied to the element.\n * @param display - The CSS display property value\n * @public\n */\nexport function display(displayValue) {\n return `${hidden}:host{display:${displayValue}}`;\n}\n","import { canUseFocusVisible } from \"@microsoft/fast-web-utilities\";\n/**\n * The string representing the focus selector to be used. Value\n * will be \"focus-visible\" when https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo\n * is supported and \"focus\" when it is not.\n *\n * @public\n */\nexport const focusVisible = canUseFocusVisible() ? \"focus-visible\" : \"focus\";\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n"],"sourceRoot":""}
|