{"version":3,"sources":["webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/dom.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/select/select.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/strings.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.options.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/key-codes.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/numbers.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/events.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/aria.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/localization.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js","webpack:///./node_modules/@microsoft/fast-web-utilities/dist/system-colors.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js"],"names":["supportsElementInternals","window","prototype","InternalsMap","Map","FormAssociated","BaseCtor","C","args","super","this","dirtyValue","disabled","proxyEventsToBlock","proxyInitialized","required","initialValue","elementInternals","formResetCallback","bind","validity","proxy","form","validationMessage","willValidate","Object","freeze","Array","from","labels","HTMLElement","ownerDocument","id","parentLabels","forLabels","getRootNode","querySelectorAll","concat","previous","next","value","currentValue","setFormValue","validate","queueUpdate","classList","toggle","name","prev","internals","get","attachInternals","set","connectedCallback","addEventListener","_keypressHandler","attachProxy","forEach","removeEventListener","stopPropagation","checkValidity","reportValidity","flags","message","anchor","setValidity","setCustomValidity","_a","style","display","setAttribute","proxySlot","document","createElement","shadowRoot","appendChild","removeChild","state","e","key","HTMLFormElement","defaultButton","querySelector","click","mode","attribute","CheckableFormAssociated","D","dirtyChecked","checkedAttribute","checked","defaultChecked","currentChecked","updateForm","HTMLInputElement","undefined","$emit","converter","RadioGroup","arguments","orientation","horizontal","radioChangeHandler","changedRadio","target","slottedRadioButtons","radio","isInsideFoundationToolbar","selectedRadio","focusedRadio","moveToRadioByIndex","group","index","isInsideToolbar","readOnly","nextRadio","focus","moveRightOffGroup","nextElementSibling","moveLeftOffGroup","previousElementSibling","focusOutHandler","indexOf","focusedIndex","length","clickHandler","preventDefault","shouldMoveOffGroupToTheRight","shouldMoveOffGroupToTheLeft","checkFocusedRadio","moveRight","moveLeft","keydownHandler","direction","ltr","getAttribute","oldValue","newValue","setupRadioButtons","closest","parentToolbar","checkedRadios","filter","hasAttribute","numberOfCheckedRadios","foundMatchingVal","lastCheckedRadio","Dialog","modal","hidden","trapFocus","trapFocusChanged","$fastController","isConnected","updateTrapFocus","isTrappingFocus","handleDocumentKeydown","defaultPrevented","dismiss","handleTabKeyDown","handleDocumentFocus","shouldForceFocus","focusFirstElement","bounds","getTabQueueBounds","shiftKey","reduceTabbableItems","dialog","currentFocusElement","contains","shouldTrapFocus","shouldTrapFocusOverride","activeElement","notifier","getNotifier","subscribe","disconnectedCallback","unsubscribe","source","propertyName","elements","element","isFocusableFastElement","hasTabbableShadow","push","childElementCount","children","reduce","_b","definition","shadowOptions","delegatesFocus","some","x","displayValue","convertPixelToPercent","pixelPos","minPosition","maxPosition","pct","rtl","SliderMode","isDragging","trackWidth","trackMinWidth","trackHeight","trackLeft","trackMinHeight","valueTextFormatter","min","max","step","singleValue","keypressHandler","increment","decrement","setupTrackConstraints","clientRect","track","getBoundingClientRect","clientWidth","clientLeft","bottom","top","left","setupListeners","remove","eventAction","handleMouseDown","thumb","handleThumbMouseDown","event","handleWindowMouseUp","handleMouseMove","sourceEvent","TouchEvent","touches","eventValue","pageX","documentElement","scrollLeft","pageY","scrollTop","calculateNewValue","rawValue","newPosition","convertToConstrainedValue","stopDragging","controlValue","isNaN","constrainedValue","remainderValue","Math","round","stepMultiplier","Number","valueChanged","setThumbPositionForOrientation","updateStepMultiplier","setupDefaultValue","newVal","vertical","incrementedVal","incrementedValString","decrementedVal","decrementedValString","newPct","percentage","position","stepString","decimalPlacesOfStep","pow","midpoint","parseFloat","observable","tabTemplate","context","isHTMLElement","every","arg","_canUseFocusVisible","canUseFocusVisible","styleElement","styleNonce","node","getNonce","head","sheet","insertRule","composedParent","parentNode","parentElement","rootNode","host","switchTemplate","c","defaultSlottedNodes","switch","tabsTemplate","showActiveIndicator","SelectPosition","SelectRole","open","forcedPosition","role","combobox","below","maxHeight","ariaExpanded","setPositioning","focusAndScrollOptionIntoView","indexWhenOpened","selectedIndex","_value","options","findIndex","el","prevSelectedOption","nextSelectedOption","prevSelectedValue","nextSelectedValue","firstSelectedOption","notify","shouldEmit","textContent","bubbles","composed","selectedIndexChanged","updateValue","currentBox","availableBottom","innerHeight","positionAttribute","above","listbox","setProperty","disabledChanged","ariaDisabled","setProxyOptions","setDefaultSelectedOption","captured","focusTarget","relatedTarget","isSameNode","includes","slottedOptionsChanged","HTMLSelectElement","option","proxyOption","HTMLOptionElement","cloneNode","charCodeAt","typeAheadExpired","DelegatesARIASelect","Menu","expandedItem","focusIndex","isNestedMenu","handleFocusOut","collapseExpandedItem","menuItems","isFocusableElement","handleItemFocus","targetItem","handleExpandedChanged","changedItem","expanded","setItems","isMenuItemElement","indent","accum","current","elementValue","menuitem","item","startColumnCount","resetItems","changeHandler","changedMenuItem","changeItemIndex","i","menuitemradio","maxIndex","focusableElementRoles","hasOwnProperty","domChildren","setFocus","adjustment","child","IntersectionService","intersectionDetector","observedElements","requestPosition","callback","has","observe","cancelRequestPosition","callbacks","callBackIndex","splice","initializeIntersectionDetector","IntersectionObserver","handleIntersection","root","rootMargin","threshold","entries","pendingCallbacks","pendingCallbackParams","entry","unobserve","thisElementCallbacks","targetCallbackIndex","delete","disabledCursor","uniqueIdCounter","ListboxRole","typeaheadBuffer","typeaheadTimeout","_options","selectedOptions","shouldSkipFocus","handleTypeAhead","clearTimeout","setTimeout","TYPE_AHEAD_TIMEOUT_MS","setSelectedOptions","pattern","replace","re","RegExp","filteredOptions","o","text","trim","match","prefix","uniqueId","selected","requestAnimationFrame","scrollIntoView","block","currentTarget","selectedOption","ariaActiveDescendant","selectFirstOption","selectNextOption","selectPreviousOption","selectLastOption","slottedOptionFilter","n","DelegatesARIAListbox","getDirection","dirNode","dir","KeyCodes","keyArrowDown","keyArrowLeft","keyArrowRight","keyArrowUp","keyEnter","keyEscape","keyHome","keyEnd","keySpace","keyTab","ArrowKeys","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","ARIAGlobalStatesAndProperties","BaseProgress","percentComplete","updatePercentComplete","range","fround","wrapInBounds","limit","TabsOrientation","Tabs","activeindicator","prevActiveTabIndex","activeTabIndex","ticking","change","activetab","isDisabledElement","setTabs","gridProperty","isHorizontal","tabIds","getTabIds","tabpanelIds","getTabPanelIds","getActiveIndex","tabs","tab","slot","tabId","tabpanelId","handleTabClick","add","setTabPanels","tabpanels","tabpanel","removeAttribute","selectedTab","nodeType","setComponent","adjustBackward","adjustForward","adjust","moveToTabByIndex","handleActiveIndicatorPosition","activeid","map","tabPanel","focusTab","animateActiveIndicator","translateProperty","offsetProperty","activeIndicatorRef","dif","transform","MenuItem","hasSubmenu","currentDirection","focusSubmenuOnLoad","handleMenuItemKeyDown","invoke","expandAndFocus","handleMenuItemClick","submenuLoaded","submenu","handleMouseOver","handleMouseOut","menuitemcheckbox","updateSubmenu","find","observer","MutationObserver","disconnect","isListboxOption","ListboxOption","defaultSelected","dirtySelected","Option","selectedAttribute","checkedChanged","PropertyStyleSheetBehavior","styles","elementInstance","handleChange","removeStyles","addStyles","MatchMediaStyleSheetBehavior","query","listenerCache","WeakMap","listener","constructListener","addListener","removeListener","attached","matches","unbind","forcedColorsStylesheetBehavior","with","matchMedia","TabPanel","menuItemTemplate","checkboxIndicator","radioIndicator","expandCollapseGlyph","tagFor","selectTemplate","focusoutHandler","indicator","flatten","property","whitespaceFilter","array","Node","TEXT_NODE","nodeValue","StartEnd","startContainer","start","assignedNodes","endContainer","end","endSlotTemplate","handleEndContentChange","startSlotTemplate","handleStartContentChange","listboxOptionTemplate","radioTemplate","checkedIndicator","progressRingTemplate","paused","indeterminateIndicator","sliderTemplate","FoundationElement","_presentation","forTag","tagName","template","$presentation","applyTo","elementDefinition","overrideDefinition","FoundationElementRegistry","resolveOption","type","assign","container","elementPrefix","baseName","tryDefineElement","baseClass","presentation","definePresentation","shadowRootMode","defineElement","elementOptions","attributes","dialogTemplate","ariaDescribedby","ariaLabelledby","ariaLabel","focusVisible","eventResize","eventScroll","tabPanelTemplate","menuTemplate","handleMenuKeyDown","MenuItemRole","roleForMenuItem","Orientation","applyMixins","derivedCtor","baseCtors","baseCtor","getOwnPropertyNames","defineProperty","getOwnPropertyDescriptor","existing","Direction","radioGroupTemplate","SystemColors","TextFieldType","autofocus","placeholder","list","maxLength","maxlength","minLength","minlength","size","spellcheck","control","DelegatesARIATextbox","isInsideRadioGroup","composedContains","reference","test","textFieldTemplate","handleTextInput","ariaAtomic","ariaBusy","ariaControls","ariaCurrent","ariaDetails","ariaErrormessage","ariaFlowto","ariaHaspopup","ariaHidden","ariaInvalid","ariaKeyshortcuts","ariaLive","ariaOwns","ariaRelevant","ariaRoledescription","Tab"],"mappings":"8FAAA,oIAEA,MAKaA,EAJe,qBAImCC,QAC3D,iBAAkBA,OAA0B,iBAAEC,UAC5CC,EAAe,IAAIC,IAMlB,SAASC,EAAeC,GAC3B,MAAMC,EAAI,cAAcD,EACpB,eAAeE,GACXC,SAASD,GAITE,KAAKC,YAAa,EAOlBD,KAAKE,UAAW,EAQhBF,KAAKG,mBAAqB,CAAC,SAAU,SACrCH,KAAKI,kBAAmB,EACxBJ,KAAKK,UAAW,EAChBL,KAAKM,aAAeN,KAAKM,cAAgB,GACpCN,KAAKO,mBAINP,KAAKQ,kBAAoBR,KAAKQ,kBAAkBC,KAAKT,OAS7D,4BACI,OAAOV,EAOX,eACI,OAAOU,KAAKO,iBACNP,KAAKO,iBAAiBG,SACtBV,KAAKW,MAAMD,SAQrB,WACI,OAAOV,KAAKO,iBAAmBP,KAAKO,iBAAiBK,KAAOZ,KAAKW,MAAMC,KAQ3E,wBACI,OAAOZ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GAAKA,EAAEmb;gCACXnb,GAAKA,EAAEge;iCACNhe,GAAKA,EAAEgJ;qCACHhJ,GAAKA,EAAEie;+BACbje,GAAKA,EAAEke;iCACLle,GAAKA,EAAEme;+BACTne,GAAKA,EAAEoe;gCACNpe,GAAKA,EAAEqe;qCACFre,GAAKA,EAAEse;8BACdte,GAAKA,EAAEqb;mCACFrb,GAAKA,EAAEob;6BACbpb,GAAKA,EAAEue;6BACPve,GAAKA,EAAEwe;iCACHxe,GAAKA,EAAEye;wCACAze,GAAKA,EAAE0e;kBAC7B,YAAI;;cAER,YAAgBvZ,EAASvF;;;qCClEvC,0EAOO,MAAM+e,UAAY,KAEzB,YAAW,CACP,YAAK,CAAExlB,KAAM,aACdwlB,EAAI1qB,UAAW,gBAAY","file":"vendors~663689f8.33ced0fc0d7814f67541.chunk.js","sourcesContent":["import { attr, DOM, emptyArray, observable, booleanConverter, } 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 Map();\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        /**\n         * Sets the validity of the custom element. By default this uses the proxy element to determine\n         * validity, but this can be extended or replaced in implementation.\n         */\n        validate() {\n            if (this.proxy instanceof HTMLElement) {\n                this.setValidity(this.proxy.validity, this.proxy.validationMessage);\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 { __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\";\nimport { FoundationElement } from \"../foundation-element\";\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 * @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.getAttribute(\"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 { __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\";\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 * @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    }\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    }\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","/**\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 { 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, 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\";\nimport { convertPixelToPercent } from \"./slider-utilities\";\nimport { FormAssociatedSlider } from \"./slider.form-associated\";\n/**\n * The selection modes of a {@link @microsoft/fast-foundation#(Slider:class)}.\n * @public\n */\nexport var SliderMode;\n(function (SliderMode) {\n    SliderMode[\"singleValue\"] = \"single-value\";\n})(SliderMode || (SliderMode = {}));\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 * @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 (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            this.thumb[eventAction](\"touchstart\", this.handleThumbMouseDown);\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.preventDefault();\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);\n            window[eventAction](\"touchmove\", this.handleMouseMove);\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     * @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 = Math.round((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 { FormAssociated } from \"../form-associated/form-associated\";\nimport { FoundationElement } from \"../foundation-element\";\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 { 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 { 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","/**\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 { 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 { html, ref, slotted, when } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end\";\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","/**\n * Positioning directions for the listbox when a select is open.\n * @public\n */\nexport var SelectPosition;\n(function (SelectPosition) {\n    SelectPosition[\"above\"] = \"above\";\n    SelectPosition[\"below\"] = \"below\";\n})(SelectPosition || (SelectPosition = {}));\n/**\n * Select role.\n * @public\n */\nexport var SelectRole;\n(function (SelectRole) {\n    SelectRole[\"combobox\"] = \"combobox\";\n})(SelectRole || (SelectRole = {}));\n","import { Listbox } from \"../listbox/listbox\";\nimport { FormAssociated } from \"../form-associated/form-associated\";\nclass _Select extends Listbox {\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, Observable, observable, } from \"@microsoft/fast-element\";\nimport { ARIAGlobalStatesAndProperties } from \"../patterns/aria-global\";\nimport { StartEnd } from \"../patterns/start-end\";\nimport { applyMixins } from \"../utilities/apply-mixins\";\nimport { FormAssociatedSelect } from \"./select.form-associated\";\nimport { SelectPosition, SelectRole } from \"./select.options\";\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 * @public\n */\nexport class Select extends FormAssociatedSelect {\n    constructor() {\n        super(...arguments);\n        /**\n         * The open attribute.\n         *\n         * @internal\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 role of the element.\n         *\n         * @public\n         * @remarks\n         * HTML Attribute: role\n         */\n        this.role = SelectRole.combobox;\n        /**\n         * Holds the current state for the calculated position of the listbox.\n         *\n         * @public\n         */\n        this.position = SelectPosition.below;\n        /**\n         * The max height for the listbox when opened.\n         *\n         * @internal\n         */\n        this.maxHeight = 0;\n        /**\n         * The value displayed on the button.\n         *\n         * @public\n         */\n        this.displayValue = \"\";\n    }\n    openChanged() {\n        this.ariaExpanded = this.open ? \"true\" : \"false\";\n        if (this.open) {\n            this.setPositioning();\n            this.focusAndScrollOptionIntoView();\n            this.indexWhenOpened = this.selectedIndex;\n        }\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        const prev = `${this._value}`;\n        if (this.$fastController.isConnected && this.options) {\n            const selectedIndex = this.options.findIndex(el => el.value === next);\n            const prevSelectedOption = this.options[this.selectedIndex];\n            const nextSelectedOption = this.options[selectedIndex];\n            const prevSelectedValue = prevSelectedOption\n                ? prevSelectedOption.value\n                : null;\n            const nextSelectedValue = nextSelectedOption\n                ? nextSelectedOption.value\n                : null;\n            if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {\n                next = \"\";\n                this.selectedIndex = selectedIndex;\n            }\n            if (this.firstSelectedOption) {\n                next = this.firstSelectedOption.value;\n            }\n        }\n        if (prev !== next) {\n            this._value = next;\n            super.valueChanged(prev, next);\n            Observable.notify(this, \"value\");\n        }\n    }\n    updateValue(shouldEmit) {\n        if (this.$fastController.isConnected) {\n            this.value = this.firstSelectedOption ? this.firstSelectedOption.value : \"\";\n            this.displayValue = this.firstSelectedOption\n                ? this.firstSelectedOption.textContent || this.firstSelectedOption.value\n                : this.value;\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    /**\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    maxHeightChanged() {\n        if (this.listbox) {\n            this.listbox.style.setProperty(\"--max-height\", `${this.maxHeight}px`);\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     * Reset the element to its first selectable option when its parent form is reset.\n     *\n     * @internal\n     */\n    formResetCallback() {\n        this.setProxyOptions();\n        this.setDefaultSelectedOption();\n        this.value = this.firstSelectedOption.value;\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.open;\n        if (!this.open && this.indexWhenOpened !== this.selectedIndex) {\n            this.updateValue(true);\n        }\n        return true;\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        var _a;\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     * 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.setProxyOptions();\n        this.updateValue();\n    }\n    /**\n     * Reset and fill 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.appendChild(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 \" \": {\n                if (this.typeAheadExpired) {\n                    e.preventDefault();\n                    this.open = !this.open;\n                }\n                break;\n            }\n            case \"Enter\": {\n                e.preventDefault();\n                this.open = !this.open;\n                break;\n            }\n            case \"Escape\": {\n                if (this.open) {\n                    e.preventDefault();\n                    this.open = false;\n                }\n                break;\n            }\n            case \"Tab\": {\n                if (!this.open) {\n                    return true;\n                }\n                e.preventDefault();\n                this.open = false;\n            }\n        }\n        if (!this.open && this.indexWhenOpened !== this.selectedIndex) {\n            this.updateValue(true);\n            this.indexWhenOpened = this.selectedIndex;\n        }\n        return true;\n    }\n    connectedCallback() {\n        super.connectedCallback();\n        this.forcedPosition = !!this.positionAttribute;\n    }\n}\n__decorate([\n    attr({ attribute: \"open\", mode: \"boolean\" })\n], Select.prototype, \"open\", 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__decorate([\n    observable\n], Select.prototype, \"displayValue\", 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, \"ariaExpanded\", void 0);\n__decorate([\n    attr({ attribute: \"aria-pressed\", mode: \"fromView\" })\n], DelegatesARIASelect.prototype, \"ariaPressed\", void 0);\napplyMixins(DelegatesARIASelect, ARIAGlobalStatesAndProperties);\napplyMixins(Select, StartEnd, DelegatesARIASelect);\n","import { __decorate } from \"tslib\";\nimport { observable } from \"@microsoft/fast-element\";\nimport { isHTMLElement, keyArrowDown, keyArrowUp, keyEnd, keyHome, } from \"@microsoft/fast-web-utilities\";\nimport { MenuItem, MenuItemRole, roleForMenuItem, } from \"../menu-item/index\";\nimport { FoundationElement } from \"../foundation-element\";\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 * @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)) {\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 (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.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.setItems = () => {\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                if (!(el instanceof MenuItem)) {\n                    return 1;\n                }\n                if (el.role !== MenuItemRole.menuitem &&\n                    el.querySelector(\"[slot=start]\") === null) {\n                    return 1;\n                }\n                else if (el.role === MenuItemRole.menuitem &&\n                    el.querySelector(\"[slot=start]\") !== null) {\n                    return 1;\n                }\n                else if (el.role !== MenuItemRole.menuitem &&\n                    el.querySelector(\"[slot=start]\") !== 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        this.resetItems = (oldValue) => {\n            oldValue.forEach((item) => {\n                item.removeEventListener(\"expanded-change\", this.handleExpandedChanged);\n                item.removeEventListener(\"focus\", this.handleItemFocus);\n            });\n        };\n        /**\n         * handle change from child element\n         */\n        this.changeHandler = (e) => {\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        if (this.$fastController.isConnected) {\n            this.menuItems = this.domChildren();\n            this.resetItems(oldValue);\n            this.setItems();\n        }\n    }\n    /**\n     * @internal\n     */\n    connectedCallback() {\n        super.connectedCallback();\n        this.menuItems = this.domChildren();\n        this.addEventListener(\"change\", this.changeHandler);\n    }\n    /**\n     * @internal\n     */\n    disconnectedCallback() {\n        super.disconnectedCallback();\n        this.menuItems = [];\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) {\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);\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 { $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 * The CSS value for disabled cursors.\n * @public\n */\nexport const disabledCursor = \"not-allowed\";\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 * Matches all instances of the RegExp in the string. Operates similarly to the\n * native `String.matchAll`, which is not yet available on all supported\n * browsers. Note that the regex *must* be global.\n */\nfunction matchAll(re, str) {\n    const matches = [];\n    let match;\n    while ((match = re.exec(str))) {\n        matches.push(match[1]);\n    }\n    re.lastIndex = 0;\n    return matches;\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}\nconst wordRe = /([A-Z]+[a-z0-9]*|[A-Z]*[a-z0-9]+)/g;\n/**\n * Converts a string to Pascal Case\n */\nexport function pascalCase(value) {\n    return matchAll(wordRe, value)\n        .map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1).toLowerCase()}`)\n        .join(\"\");\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])/g, function (match, group1) {\n        return `-${group1.toLowerCase()}`;\n    });\n}\n","/**\n * Listbox role.\n * @public\n */\nexport var ListboxRole;\n(function (ListboxRole) {\n    ListboxRole[\"listbox\"] = \"listbox\";\n})(ListboxRole || (ListboxRole = {}));\n","import { __decorate } from \"tslib\";\nimport { attr, observable, Observable } from \"@microsoft/fast-element\";\nimport { uniqueId } from \"@microsoft/fast-web-utilities\";\nimport { FoundationElement } from \"../foundation-element\";\nimport { isListboxOption } from \"../listbox-option/listbox-option\";\nimport { ARIAGlobalStatesAndProperties } from \"../patterns/aria-global\";\nimport { applyMixins } from \"../utilities/apply-mixins\";\nimport { ListboxRole } from \"./listbox.options\";\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 * @public\n */\nexport class Listbox extends FoundationElement {\n    constructor() {\n        super(...arguments);\n        /**\n         * The index of the selected option\n         *\n         * @public\n         */\n        this.selectedIndex = -1;\n        /**\n         * @internal\n         */\n        this.typeaheadBuffer = \"\";\n        /**\n         * @internal\n         */\n        this.typeaheadTimeout = -1;\n        /**\n         * Flag for the typeahead timeout expiration.\n         *\n         * @internal\n         */\n        this.typeAheadExpired = true;\n        /**\n         * The role of the element.\n         *\n         * @public\n         * @remarks\n         * HTML Attribute: role\n         */\n        this.role = ListboxRole.listbox;\n        /**\n         * The internal unfiltered list of selectable options.\n         *\n         * @internal\n         */\n        this._options = [];\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         * Move 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        this.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    selectedIndexChanged(prev, next) {\n        this.setSelectedOptions();\n    }\n    typeaheadBufferChanged(prev, next) {\n        if (this.$fastController.isConnected) {\n            const pattern = this.typeaheadBuffer.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n            const re = new RegExp(`^${pattern}`, \"gi\");\n            const filteredOptions = this.options.filter((o) => o.text.trim().match(re));\n            if (filteredOptions.length) {\n                const selectedIndex = this.options.indexOf(filteredOptions[0]);\n                if (selectedIndex > -1) {\n                    this.selectedIndex = selectedIndex;\n                }\n            }\n            this.typeAheadExpired = false;\n        }\n    }\n    slottedOptionsChanged(prev, next) {\n        if (this.$fastController.isConnected) {\n            this.options = next.reduce((options, item) => {\n                if (isListboxOption(item)) {\n                    options.push(item);\n                }\n                return options;\n            }, []);\n            this.options.forEach(o => {\n                o.id = o.id || uniqueId(\"option-\");\n            });\n            this.setSelectedOptions();\n            this.setDefaultSelectedOption();\n        }\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    selectedOptionsChanged(prev, next) {\n        if (this.$fastController.isConnected) {\n            this.options.forEach(o => {\n                o.selected = next.includes(o);\n            });\n        }\n    }\n    /**\n     * @internal\n     */\n    get firstSelectedOption() {\n        return this.selectedOptions[0];\n    }\n    /**\n     * @internal\n     */\n    focusAndScrollOptionIntoView() {\n        if (this.contains(document.activeElement) && this.firstSelectedOption) {\n            this.firstSelectedOption.focus();\n            requestAnimationFrame(() => {\n                this.firstSelectedOption.scrollIntoView({ block: \"nearest\" });\n            });\n        }\n    }\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     * 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     * @internal\n     */\n    setDefaultSelectedOption() {\n        if (this.options && this.$fastController.isConnected) {\n            const selectedIndex = this.options.findIndex(el => el.getAttribute(\"selected\") !== null);\n            if (selectedIndex !== -1) {\n                this.selectedIndex = selectedIndex;\n                return;\n            }\n            this.selectedIndex = 0;\n        }\n    }\n    /**\n     * Sets an option as selected and gives it focus.\n     *\n     * @param index - option index to select\n     * @public\n     */\n    setSelectedOptions() {\n        if (this.$fastController.isConnected && this.options) {\n            const selectedOption = this.options[this.selectedIndex] || null;\n            this.selectedOptions = this.options.filter(el => el.isSameNode(selectedOption));\n            this.ariaActiveDescendant = this.firstSelectedOption\n                ? this.firstSelectedOption.id\n                : \"\";\n            this.focusAndScrollOptionIntoView();\n        }\n    }\n    /**\n     * Moves focus to the first selectable option\n     *\n     * @public\n     */\n    selectFirstOption() {\n        if (!this.disabled) {\n            this.selectedIndex = 0;\n        }\n    }\n    /**\n     * Moves focus to the last selectable option\n     *\n     * @internal\n     */\n    selectLastOption() {\n        if (!this.disabled) {\n            this.selectedIndex = this.options.length - 1;\n        }\n    }\n    /**\n     * Moves focus to the next selectable option\n     *\n     * @internal\n     */\n    selectNextOption() {\n        if (!this.disabled &&\n            this.options &&\n            this.selectedIndex < this.options.length - 1) {\n            this.selectedIndex += 1;\n        }\n    }\n    get length() {\n        if (this.options) {\n            return this.options.length;\n        }\n        return 0;\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     * Handles 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     * 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 \"Home\": {\n                if (!e.shiftKey) {\n                    e.preventDefault();\n                    this.selectFirstOption();\n                }\n                break;\n            }\n            // Select the next selectable option\n            case \"ArrowDown\": {\n                if (!e.shiftKey) {\n                    e.preventDefault();\n                    this.selectNextOption();\n                }\n                break;\n            }\n            // Select the previous selectable option\n            case \"ArrowUp\": {\n                if (!e.shiftKey) {\n                    e.preventDefault();\n                    this.selectPreviousOption();\n                }\n                break;\n            }\n            // Select the last available option\n            case \"End\": {\n                e.preventDefault();\n                this.selectLastOption();\n                break;\n            }\n            case \"Tab\": {\n                this.focusAndScrollOptionIntoView();\n                return true;\n            }\n            case \"Enter\":\n            case \"Escape\": {\n                return true;\n            }\n            case \" \": {\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/**\n * Typeahead timeout in milliseconds.\n *\n * @internal\n */\nListbox.TYPE_AHEAD_TIMEOUT_MS = 1000;\n/**\n * A static filter to include only enabled elements\n *\n * @param n - element to filter\n * @public\n */\nListbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.disabled && !n.hidden;\n__decorate([\n    observable\n], Listbox.prototype, \"selectedIndex\", void 0);\n__decorate([\n    observable\n], Listbox.prototype, \"typeaheadBuffer\", void 0);\n__decorate([\n    attr\n], Listbox.prototype, \"role\", void 0);\n__decorate([\n    attr({ mode: \"boolean\" })\n], Listbox.prototype, \"disabled\", void 0);\n__decorate([\n    observable\n], Listbox.prototype, \"slottedOptions\", void 0);\n__decorate([\n    observable\n], Listbox.prototype, \"selectedOptions\", void 0);\n/**\n * Includes ARIA states and properties relating to the ARIA listbox role\n *\n * @public\n */\nexport class DelegatesARIAListbox {\n    constructor() {\n        /**\n         * See {@link https://www.w3.org/WAI/PF/aria/roles#listbox} for more information\n         * @public\n         * @remarks\n         * HTML Attribute: aria-activedescendant\n         */\n        this.ariaActiveDescendant = \"\";\n    }\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);\napplyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties);\napplyMixins(Listbox, DelegatesARIAListbox);\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","/**\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","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\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaAtomic\", void 0);\n__decorate([\n    attr({ attribute: \"aria-busy\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaBusy\", void 0);\n__decorate([\n    attr({ attribute: \"aria-controls\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaControls\", void 0);\n__decorate([\n    attr({ attribute: \"aria-current\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaCurrent\", void 0);\n__decorate([\n    attr({ attribute: \"aria-describedby\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaDescribedby\", void 0);\n__decorate([\n    attr({ attribute: \"aria-details\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaDetails\", void 0);\n__decorate([\n    attr({ attribute: \"aria-disabled\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaDisabled\", void 0);\n__decorate([\n    attr({ attribute: \"aria-errormessage\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaErrormessage\", void 0);\n__decorate([\n    attr({ attribute: \"aria-flowto\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaFlowto\", void 0);\n__decorate([\n    attr({ attribute: \"aria-haspopup\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaHaspopup\", void 0);\n__decorate([\n    attr({ attribute: \"aria-hidden\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaHidden\", void 0);\n__decorate([\n    attr({ attribute: \"aria-invalid\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaInvalid\", void 0);\n__decorate([\n    attr({ attribute: \"aria-keyshortcuts\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaKeyshortcuts\", void 0);\n__decorate([\n    attr({ attribute: \"aria-label\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaLabel\", void 0);\n__decorate([\n    attr({ attribute: \"aria-labelledby\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaLabelledby\", void 0);\n__decorate([\n    attr({ attribute: \"aria-live\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaLive\", void 0);\n__decorate([\n    attr({ attribute: \"aria-owns\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaOwns\", void 0);\n__decorate([\n    attr({ attribute: \"aria-relevant\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaRelevant\", void 0);\n__decorate([\n    attr({ attribute: \"aria-roledescription\", mode: \"fromView\" })\n], ARIAGlobalStatesAndProperties.prototype, \"ariaRoledescription\", void 0);\n","import { __decorate } from \"tslib\";\nimport { attr, nullableNumberConverter, observable, } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element\";\n/**\n * An Progress HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.\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","/**\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","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnd, keyHome, wrapInBounds, } from \"@microsoft/fast-web-utilities\";\nimport { StartEnd } from \"../patterns/start-end\";\nimport { applyMixins } from \"../utilities/apply-mixins\";\nimport { FoundationElement } from \"../foundation-element\";\n/**\n * The orientation of the {@link @microsoft/fast-foundation#(Tabs:class)} component\n * @public\n */\nexport var TabsOrientation;\n(function (TabsOrientation) {\n    TabsOrientation[\"vertical\"] = \"vertical\";\n    TabsOrientation[\"horizontal\"] = \"horizontal\";\n})(TabsOrientation || (TabsOrientation = {}));\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 * @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.tabIds = this.getTabIds();\n            this.tabpanelIds = this.getTabPanelIds();\n            this.activeTabIndex = this.getActiveIndex();\n            this.showActiveIndicator = false;\n            this.tabs.forEach((tab, index) => {\n                if (tab.slot === \"tab\" && this.isFocusableElement(tab)) {\n                    if (this.activeindicator) {\n                        this.showActiveIndicator = true;\n                    }\n                    const tabId = this.tabIds[index];\n                    const tabpanelId = this.tabpanelIds[index];\n                    tab.setAttribute(\"id\", typeof tabId !== \"string\" ? `tab-${index + 1}` : tabId);\n                    tab.setAttribute(\"aria-selected\", this.activeTabIndex === index ? \"true\" : \"false\");\n                    tab.setAttribute(\"aria-controls\", typeof tabpanelId !== \"string\" ? `panel-${index + 1}` : tabpanelId);\n                    tab.addEventListener(\"click\", this.handleTabClick);\n                    tab.addEventListener(\"keydown\", this.handleTabKeyDown);\n                    tab.setAttribute(\"tabindex\", this.activeTabIndex === index ? \"0\" : \"-1\");\n                    if (this.activeTabIndex === index) {\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.tabIds = this.getTabIds();\n            this.tabpanelIds = this.getTabPanelIds();\n            this.tabpanels.forEach((tabpanel, index) => {\n                const tabId = this.tabIds[index];\n                const tabpanelId = this.tabpanelIds[index];\n                tabpanel.setAttribute(\"id\", typeof tabpanelId !== \"string\" ? `panel-${index + 1}` : tabpanelId);\n                tabpanel.setAttribute(\"aria-labelledby\", typeof tabId !== \"string\" ? `tab-${index + 1}` : 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) {\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.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.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            return tab.getAttribute(\"id\");\n        });\n    }\n    getTabPanelIds() {\n        return this.tabpanels.map((tabPanel) => {\n            return tabPanel.getAttribute(\"id\");\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","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\";\nimport { StartEnd } from \"../patterns/start-end\";\nimport { getDirection } from \"../utilities/\";\nimport { applyMixins } from \"../utilities/apply-mixins\";\nimport { MenuItemRole, roleForMenuItem } from \"./menu-item.options\";\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 * @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);\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 { __decorate } from \"tslib\";\nimport { attr, observable, Observable } from \"@microsoft/fast-element\";\nimport { isHTMLElement } from \"@microsoft/fast-web-utilities\";\nimport { StartEnd } from \"../patterns/start-end\";\nimport { applyMixins } from \"../utilities/apply-mixins\";\nimport { FoundationElement } from \"../foundation-element\";\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 * @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        this.initialValue = this.initialValue || \"\";\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    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        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        if (this.$fastController.isConnected) {\n            if (!this.dirtySelected) {\n                this.dirtySelected = true;\n            }\n            if (this.proxy instanceof HTMLOptionElement) {\n                this.proxy.selected = this.selected;\n            }\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        return this.value ? this.value : this.textContent ? this.textContent : \"\";\n    }\n    get text() {\n        return this.textContent;\n    }\n    set value(next) {\n        this._value = next;\n        this.dirtyValue = true;\n        if (this.proxy instanceof HTMLElement) {\n            this.proxy.value = next;\n        }\n        Observable.notify(this, \"value\");\n    }\n    get value() {\n        Observable.track(this, \"value\");\n        return this._value ? this._value : this.text;\n    }\n    get form() {\n        return this.proxy ? this.proxy.form : null;\n    }\n}\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);\napplyMixins(ListboxOption, StartEnd);\n","import { CheckableFormAssociated } from \"../form-associated/form-associated\";\nimport { FoundationElement } from \"../foundation-element\";\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 { keySpace, keyEnter } from \"@microsoft/fast-web-utilities\";\nimport { FormAssociatedSwitch } from \"./switch.form-associated\";\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 * @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            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 { 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     * @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 * 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 { FoundationElement } from \"../foundation-element\";\n/**\n * A TabPanel Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}\n * @public\n */\nexport class TabPanel extends FoundationElement {\n}\n","import { html, ref, when } from \"@microsoft/fast-element\";\nimport { AnchoredRegion } from \"../anchored-region\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end\";\nimport { MenuItemRole } from \"./menu-item\";\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 { html, ref, slotted } from \"@microsoft/fast-element\";\nimport { Listbox } from \"../listbox/listbox\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end\";\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 => (x.open ? \"open\" : \"\")} ${x => x.disabled ? \"disabled\" : \"\"} ${x => x.position}\"\n        role=\"${x => x.role}\"\n        tabindex=\"${x => (!x.disabled ? \"0\" : null)}\"\n        aria-disabled=\"${x => x.ariaDisabled}\"\n        aria-expanded=\"${x => x.ariaExpanded}\"\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\n            aria-activedescendant=\"${x => (x.open ? x.ariaActiveDescendant : null)}\"\n            aria-controls=\"listbox\"\n            aria-expanded=\"${x => x.ariaExpanded}\"\n            aria-haspopup=\"listbox\"\n            class=\"control\"\n            part=\"control\"\n            role=\"button\"\n            ?disabled=\"${x => x.disabled}\"\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 class=\"indicator\" part=\"indicator\">\n                    <slot name=\"indicator\">\n                        ${definition.indicator || \"\"}\n                    </slot>\n                </div>\n            </slot>\n            ${endSlotTemplate(context, definition)}\n        </div>\n        <div\n            aria-disabled=\"${x => x.disabled}\"\n            class=\"listbox\"\n            id=\"listbox\"\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","/**\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 } 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 } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns/start-end\";\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-selected=\"${x => x.selected}\"\n        class=\"${x => (x.selected ? \"selected\" : \"\")} ${x => x.disabled ? \"disabled\" : \"\"}\"\n        role=\"option\"\n    >\n        ${startSlotTemplate(context, definition)}\n        <span class=\"content\" part=\"content\">\n            <slot></slot>\n        </span>\n        ${endSlotTemplate(context, definition)}\n    </template>\n`;\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 { 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 { 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>\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 { __decorate } from \"tslib\";\nimport { FASTElement, observable } from \"@microsoft/fast-element\";\nimport { ComponentPresentation, DefaultComponentPresentation, } from \"../design-system/component-presentation\";\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 { 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 { 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","/**\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 { 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 { 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","/**\n * Menu items roles.\n * @public\n */\nexport var MenuItemRole;\n(function (MenuItemRole) {\n    /**\n     * The menu item has a \"menuitem\" role\n     */\n    MenuItemRole[\"menuitem\"] = \"menuitem\";\n    /**\n     * The menu item has a \"menuitemcheckbox\" role\n     */\n    MenuItemRole[\"menuitemcheckbox\"] = \"menuitemcheckbox\";\n    /**\n     * The menu item has a \"menuitemradio\" role\n     */\n    MenuItemRole[\"menuitemradio\"] = \"menuitemradio\";\n})(MenuItemRole || (MenuItemRole = {}));\n/**\n * @internal\n */\nexport const roleForMenuItem = {\n    [MenuItemRole.menuitem]: \"menuitem\",\n    [MenuItemRole.menuitemcheckbox]: \"menuitemcheckbox\",\n    [MenuItemRole.menuitemradio]: \"menuitemradio\",\n};\n","export var Orientation;\n(function (Orientation) {\n    Orientation[\"horizontal\"] = \"horizontal\";\n    Orientation[\"vertical\"] = \"vertical\";\n})(Orientation || (Orientation = {}));\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    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        if (baseCtor.attributes) {\n            const existing = derivedCtor.attributes || [];\n            derivedCtor.attributes = existing.concat(baseCtor.attributes);\n        }\n    });\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","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","/**\n * Define system colors for use in CSS stylesheets.\n *\n * https://drafts.csswg.org/css-color/#css-system-colors\n */\nexport var SystemColors;\n(function (SystemColors) {\n    SystemColors[\"Canvas\"] = \"Canvas\";\n    SystemColors[\"CanvasText\"] = \"CanvasText\";\n    SystemColors[\"LinkText\"] = \"LinkText\";\n    SystemColors[\"VisitedText\"] = \"VisitedText\";\n    SystemColors[\"ActiveText\"] = \"ActiveText\";\n    SystemColors[\"ButtonFace\"] = \"ButtonFace\";\n    SystemColors[\"ButtonText\"] = \"ButtonText\";\n    SystemColors[\"Field\"] = \"Field\";\n    SystemColors[\"FieldText\"] = \"FieldText\";\n    SystemColors[\"Highlight\"] = \"Highlight\";\n    SystemColors[\"HighlightText\"] = \"HighlightText\";\n    SystemColors[\"GrayText\"] = \"GrayText\";\n})(SystemColors || (SystemColors = {}));\n","/**\n * Text field sub-types\n * @public\n */\nexport var TextFieldType;\n(function (TextFieldType) {\n    /**\n     * An email TextField\n     */\n    TextFieldType[\"email\"] = \"email\";\n    /**\n     * A password TextField\n     */\n    TextFieldType[\"password\"] = \"password\";\n    /**\n     * A telephone TextField\n     */\n    TextFieldType[\"tel\"] = \"tel\";\n    /**\n     * A text TextField\n     */\n    TextFieldType[\"text\"] = \"text\";\n    /**\n     * A URL TextField\n     */\n    TextFieldType[\"url\"] = \"url\";\n})(TextFieldType || (TextFieldType = {}));\n","import { FormAssociated } from \"../form-associated/form-associated\";\nimport { FoundationElement } from \"../foundation-element\";\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","import { __decorate } from \"tslib\";\nimport { attr, DOM, nullableNumberConverter, observable } from \"@microsoft/fast-element\";\nimport { ARIAGlobalStatesAndProperties, StartEnd, } from \"../patterns/index\";\nimport { applyMixins } from \"../utilities/index\";\nimport { FormAssociatedTextField } from \"./text-field.form-associated\";\nimport { TextFieldType } from \"./text-field.options\";\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 * @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     * 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}\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 { CheckableFormAssociated } from \"../form-associated/form-associated\";\nimport { FoundationElement } from \"../foundation-element\";\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\";\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 * @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 { composedParent } from \"./composed-parent\";\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 { html, ref, slotted } from \"@microsoft/fast-element\";\nimport { endSlotTemplate, startSlotTemplate } from \"../patterns\";\nimport { whitespaceFilter } from \"../utilities\";\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 { __decorate } from \"tslib\";\nimport { attr } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element\";\n/**\n * A Tab Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}\n * @public\n */\nexport class Tab extends FoundationElement {\n}\n__decorate([\n    attr({ mode: \"boolean\" })\n], Tab.prototype, \"disabled\", void 0);\n"],"sourceRoot":""}