material-components-web.js.map 832 KB

1
  1. {"version":3,"sources":["webpack://mdc/webpack/universalModuleDefinition","webpack://mdc/webpack/bootstrap","webpack://mdc/./packages/material-components-web/index.ts","webpack://mdc/./packages/mdc-animation/util.ts","webpack://mdc/./packages/mdc-auto-init/constants.ts","webpack://mdc/./packages/mdc-auto-init/index.ts","webpack://mdc/./packages/mdc-base/component.ts","webpack://mdc/./packages/mdc-base/foundation.ts","webpack://mdc/./packages/mdc-base/index.ts","webpack://mdc/./packages/mdc-checkbox/component.ts","webpack://mdc/./packages/mdc-checkbox/constants.ts","webpack://mdc/./packages/mdc-checkbox/foundation.ts","webpack://mdc/./packages/mdc-checkbox/index.ts","webpack://mdc/./packages/mdc-chips/chip-set/component.ts","webpack://mdc/./packages/mdc-chips/chip-set/constants.ts","webpack://mdc/./packages/mdc-chips/chip-set/foundation.ts","webpack://mdc/./packages/mdc-chips/chip-set/index.ts","webpack://mdc/./packages/mdc-chips/chip/component.ts","webpack://mdc/./packages/mdc-chips/chip/constants.ts","webpack://mdc/./packages/mdc-chips/chip/foundation.ts","webpack://mdc/./packages/mdc-chips/chip/index.ts","webpack://mdc/./packages/mdc-chips/index.ts","webpack://mdc/./packages/mdc-data-table/component.ts","webpack://mdc/./packages/mdc-data-table/constants.ts","webpack://mdc/./packages/mdc-data-table/foundation.ts","webpack://mdc/./packages/mdc-data-table/index.ts","webpack://mdc/./packages/mdc-dialog/component.ts","webpack://mdc/./packages/mdc-dialog/constants.ts","webpack://mdc/./packages/mdc-dialog/foundation.ts","webpack://mdc/./packages/mdc-dialog/index.ts","webpack://mdc/./packages/mdc-dialog/util.ts","webpack://mdc/./packages/mdc-dom/announce.ts","webpack://mdc/./packages/mdc-dom/events.ts","webpack://mdc/./packages/mdc-dom/focus-trap.ts","webpack://mdc/./packages/mdc-dom/index.ts","webpack://mdc/./packages/mdc-dom/ponyfill.ts","webpack://mdc/./packages/mdc-drawer/component.ts","webpack://mdc/./packages/mdc-drawer/constants.ts","webpack://mdc/./packages/mdc-drawer/dismissible/foundation.ts","webpack://mdc/./packages/mdc-drawer/index.ts","webpack://mdc/./packages/mdc-drawer/modal/foundation.ts","webpack://mdc/./packages/mdc-drawer/util.ts","webpack://mdc/./packages/mdc-floating-label/component.ts","webpack://mdc/./packages/mdc-floating-label/constants.ts","webpack://mdc/./packages/mdc-floating-label/foundation.ts","webpack://mdc/./packages/mdc-floating-label/index.ts","webpack://mdc/./packages/mdc-form-field/component.ts","webpack://mdc/./packages/mdc-form-field/constants.ts","webpack://mdc/./packages/mdc-form-field/foundation.ts","webpack://mdc/./packages/mdc-form-field/index.ts","webpack://mdc/./packages/mdc-icon-button/component.ts","webpack://mdc/./packages/mdc-icon-button/constants.ts","webpack://mdc/./packages/mdc-icon-button/foundation.ts","webpack://mdc/./packages/mdc-icon-button/index.ts","webpack://mdc/./packages/mdc-line-ripple/component.ts","webpack://mdc/./packages/mdc-line-ripple/constants.ts","webpack://mdc/./packages/mdc-line-ripple/foundation.ts","webpack://mdc/./packages/mdc-line-ripple/index.ts","webpack://mdc/./packages/mdc-linear-progress/component.ts","webpack://mdc/./packages/mdc-linear-progress/constants.ts","webpack://mdc/./packages/mdc-linear-progress/foundation.ts","webpack://mdc/./packages/mdc-linear-progress/index.ts","webpack://mdc/./packages/mdc-list/component.ts","webpack://mdc/./packages/mdc-list/constants.ts","webpack://mdc/./packages/mdc-list/foundation.ts","webpack://mdc/./packages/mdc-list/index.ts","webpack://mdc/./packages/mdc-menu-surface/component.ts","webpack://mdc/./packages/mdc-menu-surface/constants.ts","webpack://mdc/./packages/mdc-menu-surface/foundation.ts","webpack://mdc/./packages/mdc-menu-surface/index.ts","webpack://mdc/./packages/mdc-menu-surface/util.ts","webpack://mdc/./packages/mdc-menu/component.ts","webpack://mdc/./packages/mdc-menu/constants.ts","webpack://mdc/./packages/mdc-menu/foundation.ts","webpack://mdc/./packages/mdc-menu/index.ts","webpack://mdc/./packages/mdc-notched-outline/component.ts","webpack://mdc/./packages/mdc-notched-outline/constants.ts","webpack://mdc/./packages/mdc-notched-outline/foundation.ts","webpack://mdc/./packages/mdc-notched-outline/index.ts","webpack://mdc/./packages/mdc-radio/component.ts","webpack://mdc/./packages/mdc-radio/constants.ts","webpack://mdc/./packages/mdc-radio/foundation.ts","webpack://mdc/./packages/mdc-radio/index.ts","webpack://mdc/./packages/mdc-ripple/component.ts","webpack://mdc/./packages/mdc-ripple/constants.ts","webpack://mdc/./packages/mdc-ripple/foundation.ts","webpack://mdc/./packages/mdc-ripple/index.ts","webpack://mdc/./packages/mdc-ripple/util.ts","webpack://mdc/./packages/mdc-select/component.ts","webpack://mdc/./packages/mdc-select/constants.ts","webpack://mdc/./packages/mdc-select/foundation.ts","webpack://mdc/./packages/mdc-select/helper-text/component.ts","webpack://mdc/./packages/mdc-select/helper-text/constants.ts","webpack://mdc/./packages/mdc-select/helper-text/foundation.ts","webpack://mdc/./packages/mdc-select/helper-text/index.ts","webpack://mdc/./packages/mdc-select/icon/component.ts","webpack://mdc/./packages/mdc-select/icon/constants.ts","webpack://mdc/./packages/mdc-select/icon/foundation.ts","webpack://mdc/./packages/mdc-select/icon/index.ts","webpack://mdc/./packages/mdc-select/index.ts","webpack://mdc/./packages/mdc-slider/component.ts","webpack://mdc/./packages/mdc-slider/constants.ts","webpack://mdc/./packages/mdc-slider/foundation.ts","webpack://mdc/./packages/mdc-slider/index.ts","webpack://mdc/./packages/mdc-snackbar/component.ts","webpack://mdc/./packages/mdc-snackbar/constants.ts","webpack://mdc/./packages/mdc-snackbar/foundation.ts","webpack://mdc/./packages/mdc-snackbar/index.ts","webpack://mdc/./packages/mdc-snackbar/util.ts","webpack://mdc/./packages/mdc-switch/component.ts","webpack://mdc/./packages/mdc-switch/constants.ts","webpack://mdc/./packages/mdc-switch/foundation.ts","webpack://mdc/./packages/mdc-switch/index.ts","webpack://mdc/./packages/mdc-tab-bar/component.ts","webpack://mdc/./packages/mdc-tab-bar/constants.ts","webpack://mdc/./packages/mdc-tab-bar/foundation.ts","webpack://mdc/./packages/mdc-tab-bar/index.ts","webpack://mdc/./packages/mdc-tab-indicator/component.ts","webpack://mdc/./packages/mdc-tab-indicator/constants.ts","webpack://mdc/./packages/mdc-tab-indicator/fading-foundation.ts","webpack://mdc/./packages/mdc-tab-indicator/foundation.ts","webpack://mdc/./packages/mdc-tab-indicator/index.ts","webpack://mdc/./packages/mdc-tab-indicator/sliding-foundation.ts","webpack://mdc/./packages/mdc-tab-scroller/component.ts","webpack://mdc/./packages/mdc-tab-scroller/constants.ts","webpack://mdc/./packages/mdc-tab-scroller/foundation.ts","webpack://mdc/./packages/mdc-tab-scroller/index.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-default-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-negative-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-reverse-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/util.ts","webpack://mdc/./packages/mdc-tab/component.ts","webpack://mdc/./packages/mdc-tab/constants.ts","webpack://mdc/./packages/mdc-tab/foundation.ts","webpack://mdc/./packages/mdc-tab/index.ts","webpack://mdc/./packages/mdc-textfield/character-counter/component.ts","webpack://mdc/./packages/mdc-textfield/character-counter/constants.ts","webpack://mdc/./packages/mdc-textfield/character-counter/foundation.ts","webpack://mdc/./packages/mdc-textfield/character-counter/index.ts","webpack://mdc/./packages/mdc-textfield/component.ts","webpack://mdc/./packages/mdc-textfield/constants.ts","webpack://mdc/./packages/mdc-textfield/foundation.ts","webpack://mdc/./packages/mdc-textfield/helper-text/component.ts","webpack://mdc/./packages/mdc-textfield/helper-text/constants.ts","webpack://mdc/./packages/mdc-textfield/helper-text/foundation.ts","webpack://mdc/./packages/mdc-textfield/helper-text/index.ts","webpack://mdc/./packages/mdc-textfield/icon/component.ts","webpack://mdc/./packages/mdc-textfield/icon/constants.ts","webpack://mdc/./packages/mdc-textfield/icon/foundation.ts","webpack://mdc/./packages/mdc-textfield/icon/index.ts","webpack://mdc/./packages/mdc-textfield/index.ts","webpack://mdc/./packages/mdc-top-app-bar/component.ts","webpack://mdc/./packages/mdc-top-app-bar/constants.ts","webpack://mdc/./packages/mdc-top-app-bar/fixed/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/index.ts","webpack://mdc/./packages/mdc-top-app-bar/short/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/standard/foundation.ts"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AC7DG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAiD;AA0D/C,mBA1DK,QA0DG;AAzDV,4CAA6C;AA0D3C,eAAI;AAzDN,gDAAqD;AA0DnD,mBAAQ;AAzDV,6CAA+C;AA0D7C,gBAAK;AAzDP,iDAAwD;AA0DtD,oBAAS;AAzDX,8CAAiD;AA0D/C,iBAAM;AAzDR,2CAA2C;AA0DzC,cAAG;AAzDL,8CAAiD;AA0D/C,iBAAM;AAzDR,qDAAgE;AA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EAIhC,YAAO,QACZ;AAAC;AAIE;;;AACK,qCAAe,kBAAvB;AACE,YAA0B,uBAAG,CAAK,KAAkB;AACpD,YAA2B,wBAAO,KAAwB,0BAAK;AAC/D,YAA0B,uBAAO,KAAwB,0BAAwB;AACjF,YAAsB,mBAAwB,yBAAyB;AAEtB;AACjD,YAAoB,kBAAE;AAChB,iBAAW,aAAS;AACzB,eAAM;AAC+D;AACpE,gBAAI,CAAK,KAAW,YAAE;AAChB,qBAAW,aAAQ;AACvB,uBAAY;AACb,mBAAM,IAAQ,KAAiB,qBAAyB,sBAAE;AACrD,qBAAiB,mBAAwB;AAC7C,uBAAY;AACb;AACF;AAED,eACF;AAAC;AAIE;;;AACK,qCAAc,iBAAtB;AACE,YAAQ,KAAkB,mBAAE;AACuE;AACJ;AAC7F,gBAAU,SAAO,KAAyB;AAC1C,gBAAQ,KAAI,IAAQ,WAAQ,KAAiB,kBAAE;AACvC,yBAAG,CAAC,YAAO,QAAwB;AAC1C;AAEG,iBAAS,SAAS,SAAM,OAAQ,SAAS;AAEjD;AAAC;AAKE;;;;AACK,qCAAuB,0BAA/B;AACE,YAAmB,gBAAO,KAAS,SAAsB;AACzD,YAAQ,KAAiB,qBAAkB,eAAE;AACvC,iBAAW,aAAS;AAE2D;AACb;AACK;AACvE,iBAAwB,2BAAQ,KAAiB,mBAAiB;AAClE,iBAAiB,mBAAiB;AACvC;AACG,aACN;AAAC;AACH,WAAC;AAAA,EAnK2C,aAmK3C;AAnKY,iCAAsB;AAqK8E;AACjH,kBAAsC,uB","file":"material-components-web.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"mdc\"] = factory();\n\telse\n\t\troot[\"mdc\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./packages/material-components-web/index.ts\");\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport autoInit from '@material/auto-init/index';\nimport * as base from '@material/base/index';\nimport * as checkbox from '@material/checkbox/index';\nimport * as chips from '@material/chips/index';\nimport * as dataTable from '@material/data-table/index';\nimport * as dialog from '@material/dialog/index';\nimport * as dom from '@material/dom/index';\nimport * as drawer from '@material/drawer/index';\nimport * as floatingLabel from '@material/floating-label/index';\nimport * as formField from '@material/form-field/index';\nimport * as iconButton from '@material/icon-button/index';\nimport * as lineRipple from '@material/line-ripple/index';\nimport * as linearProgress from '@material/linear-progress/index';\nimport * as list from '@material/list/index';\nimport * as menuSurface from '@material/menu-surface/index';\nimport * as menu from '@material/menu/index';\nimport * as notchedOutline from '@material/notched-outline/index';\nimport * as radio from '@material/radio/index';\nimport * as ripple from '@material/ripple/index';\nimport * as select from '@material/select/index';\nimport * as slider from '@material/slider/index';\nimport * as snackbar from '@material/snackbar/index';\nimport * as switchControl from '@material/switch/index';\nimport * as tabBar from '@material/tab-bar/index';\nimport * as tabIndicator from '@material/tab-indicator/index';\nimport * as tabScroller from '@material/tab-scroller/index';\nimport * as tab from '@material/tab/index';\nimport * as textField from '@material/textfield/index';\nimport * as topAppBar from '@material/top-app-bar/index';\n\n// Register all components\nautoInit.register('MDCCheckbox', checkbox.MDCCheckbox);\nautoInit.register('MDCChip', chips.MDCChip);\nautoInit.register('MDCChipSet', chips.MDCChipSet);\nautoInit.register('MDCDataTable', dataTable.MDCDataTable);\nautoInit.register('MDCDialog', dialog.MDCDialog);\nautoInit.register('MDCDrawer', drawer.MDCDrawer);\nautoInit.register('MDCFloatingLabel', floatingLabel.MDCFloatingLabel);\nautoInit.register('MDCFormField', formField.MDCFormField);\nautoInit.register('MDCIconButtonToggle', iconButton.MDCIconButtonToggle);\nautoInit.register('MDCLineRipple', lineRipple.MDCLineRipple);\nautoInit.register('MDCLinearProgress', linearProgress.MDCLinearProgress);\nautoInit.register('MDCList', list.MDCList);\nautoInit.register('MDCMenu', menu.MDCMenu);\nautoInit.register('MDCMenuSurface', menuSurface.MDCMenuSurface);\nautoInit.register('MDCNotchedOutline', notchedOutline.MDCNotchedOutline);\nautoInit.register('MDCRadio', radio.MDCRadio);\nautoInit.register('MDCRipple', ripple.MDCRipple);\nautoInit.register('MDCSelect', select.MDCSelect);\nautoInit.register('MDCSlider', slider.MDCSlider);\nautoInit.register('MDCSnackbar', snackbar.MDCSnackbar);\nautoInit.register('MDCSwitch', switchControl.MDCSwitch);\nautoInit.register('MDCTabBar', tabBar.MDCTabBar);\nautoInit.register('MDCTextField', textField.MDCTextField);\nautoInit.register('MDCTopAppBar', topAppBar.MDCTopAppBar);\n\n// Export all components.\nexport {\n autoInit,\n base,\n checkbox,\n chips,\n dataTable,\n dialog,\n dom,\n drawer,\n floatingLabel,\n formField,\n iconButton,\n lineRipple,\n linearProgress,\n list,\n menu,\n menuSurface,\n notchedOutline,\n radio,\n ripple,\n select,\n slider,\n snackbar,\n switchControl,\n tab,\n tabBar,\n tabIndicator,\n tabScroller,\n textField,\n topAppBar,\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {\n CssVendorPropertyMap, JsVendorPropertyMap,\n PrefixedCssPropertyName, PrefixedJsEventType,\n StandardCssPropertyName, StandardJsEventType,\n} from './types';\n\nconst cssPropertyNameMap: CssVendorPropertyMap = {\n animation: {\n prefixed: '-webkit-animation',\n standard: 'animation',\n },\n transform: {\n prefixed: '-webkit-transform',\n standard: 'transform',\n },\n transition: {\n prefixed: '-webkit-transition',\n standard: 'transition',\n },\n};\n\nconst jsEventTypeMap: JsVendorPropertyMap = {\n animationend: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationEnd',\n standard: 'animationend',\n },\n animationiteration: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationIteration',\n standard: 'animationiteration',\n },\n animationstart: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationStart',\n standard: 'animationstart',\n },\n transitionend: {\n cssProperty: 'transition',\n prefixed: 'webkitTransitionEnd',\n standard: 'transitionend',\n },\n};\n\nfunction isWindow(windowObj: Window): boolean {\n return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';\n}\n\nexport function getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName):\n StandardCssPropertyName | PrefixedCssPropertyName {\n if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {\n const el = windowObj.document.createElement('div');\n const {standard, prefixed} = cssPropertyNameMap[cssProperty];\n const isStandard = standard in el.style;\n return isStandard ? standard : prefixed;\n }\n return cssProperty;\n}\n\nexport function getCorrectEventName(windowObj: Window, eventType: StandardJsEventType):\n StandardJsEventType | PrefixedJsEventType {\n if (isWindow(windowObj) && eventType in jsEventTypeMap) {\n const el = windowObj.document.createElement('div');\n const {standard, prefixed, cssProperty} = jsEventTypeMap[eventType];\n const isStandard = cssProperty in el.style;\n return isStandard ? standard : prefixed;\n }\n return eventType;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const strings = {\n AUTO_INIT_ATTR: 'data-mdc-auto-init',\n AUTO_INIT_STATE_ATTR: 'data-mdc-auto-init-state',\n INITIALIZED_STATE: 'initialized',\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// tslint:disable:only-arrow-functions\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {strings} from './constants';\n\nconst {AUTO_INIT_ATTR, AUTO_INIT_STATE_ATTR, INITIALIZED_STATE} = strings;\n\nexport interface MDCAttachable {\n new<F extends MDCFoundation>(root: Element, foundation?: F, ...args: Array<unknown>): MDCComponent<F>;\n\n // Static method.\n attachTo<F extends MDCFoundation>(root: Element): MDCComponent<F>;\n}\n\ninterface InternalComponentRegistry {\n [key: string]: MDCAttachable;\n}\n\nconst registry: InternalComponentRegistry = {};\n\nconst CONSOLE_WARN = console.warn.bind(console); // tslint:disable-line:no-console\n\nfunction emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n let evt;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent<T>(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n } else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n\n document.dispatchEvent(evt);\n}\n\n/* istanbul ignore next: optional argument is not a branch statement */\n/**\n * Auto-initializes all MDC components on a page.\n */\nfunction mdcAutoInit(root = document) {\n const components = [];\n let nodes: Element[] = [].slice.call(root.querySelectorAll(`[${AUTO_INIT_ATTR}]`));\n nodes = nodes.filter((node) => node.getAttribute(AUTO_INIT_STATE_ATTR) !== INITIALIZED_STATE);\n\n for (const node of nodes) {\n const ctorName = node.getAttribute(AUTO_INIT_ATTR);\n if (!ctorName) {\n throw new Error('(mdc-auto-init) Constructor name must be given.');\n }\n\n const Constructor = registry[ctorName]; // tslint:disable-line:variable-name\n if (typeof Constructor !== 'function') {\n throw new Error(\n `(mdc-auto-init) Could not find constructor in registry for ${ctorName}`);\n }\n\n // TODO: Should we make an eslint rule for an attachTo() static method?\n // See https://github.com/Microsoft/TypeScript/issues/14600 for discussion of static interface support in TS\n const component = Constructor.attachTo(node);\n Object.defineProperty(node, ctorName, {\n configurable: true,\n enumerable: false,\n value: component,\n writable: false,\n });\n components.push(component);\n node.setAttribute(AUTO_INIT_STATE_ATTR, INITIALIZED_STATE);\n }\n\n emit('MDCAutoInit:End', {});\n return components;\n}\n\n// Constructor is PascalCased because it is a direct reference to a class, rather than an instance of a class.\n// tslint:disable-next-line:variable-name\nmdcAutoInit.register = function(componentName: string, Constructor: MDCAttachable, warn = CONSOLE_WARN) {\n if (typeof Constructor !== 'function') {\n throw new Error(`(mdc-auto-init) Invalid Constructor value: ${Constructor}. Expected function.`);\n }\n const registryValue = registry[componentName];\n if (registryValue) {\n warn(`(mdc-auto-init) Overriding registration for ${componentName} with ${Constructor}. Was: ${registryValue}`);\n }\n registry[componentName] = Constructor;\n};\n\nmdcAutoInit.deregister = function(componentName: string) {\n delete registry[componentName];\n};\n\nmdcAutoInit.deregisterAll = function() {\n const keys = Object.keys(registry) as string[];\n keys.forEach(this.deregister, this);\n};\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default mdcAutoInit;\nexport {mdcAutoInit};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from './foundation';\nimport {CustomEventListener, EventType, SpecificEventListener} from './types';\n\nexport class MDCComponent<FoundationType extends MDCFoundation> {\n static attachTo(root: Element): MDCComponent<MDCFoundation<{}>> {\n // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and\n // returns an instantiated component with its root set to that element. Also note that in the cases of\n // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized\n // from getDefaultFoundation().\n return new MDCComponent(root, new MDCFoundation({}));\n }\n\n protected root_: Element;\n protected foundation_: FoundationType;\n\n constructor(\n root: Element,\n foundation?: FoundationType,\n ...args: Array<unknown>\n ) {\n this.root_ = root;\n this.initialize(...args);\n // Note that we initialize foundation here and not within the constructor's default param so that\n // this.root_ is defined and can be used within the foundation class.\n this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;\n this.foundation_.init();\n this.initialSyncWithDOM();\n }\n\n /* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */\n initialize(..._args: Array<unknown>) {\n // Subclasses can override this to do any additional setup work that would be considered part of a\n // \"constructor\". Essentially, it is a hook into the parent constructor before the foundation is\n // initialized. Any additional arguments besides root and foundation will be passed in here.\n }\n\n getDefaultFoundation(): FoundationType {\n // Subclasses must override this method to return a properly configured foundation class for the\n // component.\n throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' +\n 'foundation class');\n }\n\n initialSyncWithDOM() {\n // Subclasses should override this method if they need to perform work to synchronize with a host DOM\n // object. An example of this would be a form control wrapper that needs to synchronize its internal state\n // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM\n // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.\n }\n\n destroy() {\n // Subclasses may implement this method to release any resources / deregister any listeners they have\n // attached. An example of this might be deregistering a resize event from the window object.\n this.foundation_.destroy();\n }\n\n /**\n * Wrapper method to add an event listener to the component's root element. This is most useful when\n * listening for custom events.\n */\n listen<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;\n listen<E extends Event>(\n evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;\n listen(evtType: string, handler: EventListener, options?: AddEventListenerOptions | boolean) {\n this.root_.addEventListener(evtType, handler, options);\n }\n\n /**\n * Wrapper method to remove an event listener to the component's root element. This is most useful when\n * unlistening for custom events.\n */\n unlisten<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;\n unlisten<E extends Event>(\n evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;\n unlisten(evtType: string, handler: EventListener, options?: AddEventListenerOptions | boolean) {\n this.root_.removeEventListener(evtType, handler, options);\n }\n\n /**\n * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.\n */\n emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n let evt: CustomEvent<T>;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent<T>(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n } else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n\n this.root_.dispatchEvent(evt);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCComponent;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport class MDCFoundation<AdapterType extends {} = {}> {\n static get cssClasses(): { [key: string]: string } {\n // Classes extending MDCFoundation should implement this method to return an object which exports every\n // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}\n return {};\n }\n\n static get strings(): { [key: string]: string } {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}\n return {};\n }\n\n static get numbers(): { [key: string]: number } {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}\n return {};\n }\n\n static get defaultAdapter(): {} {\n // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient\n // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter\n // validation.\n return {};\n }\n\n protected adapter_: AdapterType;\n\n constructor(adapter: AdapterType = {} as AdapterType) {\n this.adapter_ = adapter;\n }\n\n init() {\n // Subclasses should override this method to perform initialization routines (registering events, etc.)\n }\n\n destroy() {\n // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectEventName} from '@material/animation/util';\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCCheckboxAdapter} from './adapter';\nimport {MDCCheckboxFoundation} from './foundation';\n\n/**\n * This type is needed for compatibility with Closure Compiler.\n */\ntype PropertyDescriptorGetter = (() => unknown) | undefined;\n\nconst CB_PROTO_PROPS = ['checked', 'indeterminate'];\n\nexport type MDCCheckboxFactory = (el: Element, foundation?: MDCCheckboxFoundation) => MDCCheckbox;\n\nexport class MDCCheckbox extends MDCComponent<MDCCheckboxFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element) {\n return new MDCCheckbox(root);\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n get checked(): boolean {\n return this.nativeControl_.checked;\n }\n\n set checked(checked: boolean) {\n this.nativeControl_.checked = checked;\n }\n\n get indeterminate(): boolean {\n return this.nativeControl_.indeterminate;\n }\n\n set indeterminate(indeterminate: boolean) {\n this.nativeControl_.indeterminate = indeterminate;\n }\n\n get disabled(): boolean {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.foundation_.setDisabled(disabled);\n }\n\n get value(): string {\n return this.nativeControl_.value;\n }\n\n set value(value: string) {\n this.nativeControl_.value = value;\n }\n\n // Public visibility for this property is required by MDCRippleCapableSurface.\n root_!: Element; // assigned in MDCComponent constructor\n\n private readonly ripple_: MDCRipple = this.createRipple_();\n private handleChange_!: EventListener; // assigned in initialSyncWithDOM()\n private handleAnimationEnd_!: EventListener; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.handleChange_ = () => this.foundation_.handleChange();\n this.handleAnimationEnd_ = () => this.foundation_.handleAnimationEnd();\n this.nativeControl_.addEventListener('change', this.handleChange_);\n this.listen(getCorrectEventName(window, 'animationend'), this.handleAnimationEnd_);\n this.installPropertyChangeHooks_();\n }\n\n destroy() {\n this.ripple_.destroy();\n this.nativeControl_.removeEventListener('change', this.handleChange_);\n this.unlisten(getCorrectEventName(window, 'animationend'), this.handleAnimationEnd_);\n this.uninstallPropertyChangeHooks_();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCCheckboxAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n forceLayout: () => (this.root_ as HTMLElement).offsetWidth,\n hasNativeControl: () => !!this.nativeControl_,\n isAttachedToDOM: () => Boolean(this.root_.parentNode),\n isChecked: () => this.checked,\n isIndeterminate: () => this.indeterminate,\n removeClass: (className) => this.root_.classList.remove(className),\n removeNativeControlAttr: (attr) => this.nativeControl_.removeAttribute(attr),\n setNativeControlAttr: (attr, value) => this.nativeControl_.setAttribute(attr, value),\n setNativeControlDisabled: (disabled) => this.nativeControl_.disabled = disabled,\n };\n return new MDCCheckboxFoundation(adapter);\n }\n\n private createRipple_(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n deregisterInteractionHandler: (evtType, handler) => this.nativeControl_.removeEventListener(\n evtType, handler, applyPassive()),\n isSurfaceActive: () => matches(this.nativeControl_, ':active'),\n isUnbounded: () => true,\n registerInteractionHandler: (evtType, handler) => this.nativeControl_.addEventListener(\n evtType, handler, applyPassive()),\n };\n return new MDCRipple(this.root_, new MDCRippleFoundation(adapter));\n }\n\n private installPropertyChangeHooks_() {\n const nativeCb = this.nativeControl_;\n const cbProto = Object.getPrototypeOf(nativeCb);\n\n CB_PROTO_PROPS.forEach((controlState) => {\n const desc = Object.getOwnPropertyDescriptor(cbProto, controlState);\n // We have to check for this descriptor, since some browsers (Safari) don't support its return.\n // See: https://bugs.webkit.org/show_bug.cgi?id=49739\n if (!validDescriptor(desc)) {\n return;\n }\n\n // Type cast is needed for compatibility with Closure Compiler.\n const nativeGetter = (desc as {get: PropertyDescriptorGetter}).get;\n\n const nativeCbDesc = {\n configurable: desc.configurable,\n enumerable: desc.enumerable,\n get: nativeGetter,\n set: (state: boolean) => {\n desc.set!.call(nativeCb, state);\n this.foundation_.handleChange();\n },\n };\n Object.defineProperty(nativeCb, controlState, nativeCbDesc);\n });\n }\n\n private uninstallPropertyChangeHooks_() {\n const nativeCb = this.nativeControl_;\n const cbProto = Object.getPrototypeOf(nativeCb);\n\n CB_PROTO_PROPS.forEach((controlState) => {\n const desc = Object.getOwnPropertyDescriptor(cbProto, controlState);\n if (!validDescriptor(desc)) {\n return;\n }\n Object.defineProperty(nativeCb, controlState, desc);\n });\n }\n\n private get nativeControl_(): HTMLInputElement {\n const {NATIVE_CONTROL_SELECTOR} = MDCCheckboxFoundation.strings;\n const el = this.root_.querySelector<HTMLInputElement>(NATIVE_CONTROL_SELECTOR);\n if (!el) {\n throw new Error(`Checkbox component requires a ${NATIVE_CONTROL_SELECTOR} element`);\n }\n return el;\n }\n}\n\nfunction validDescriptor(inputPropDesc: PropertyDescriptor | undefined): inputPropDesc is PropertyDescriptor {\n return !!inputPropDesc && typeof inputPropDesc.set === 'function';\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',\n ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',\n ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',\n ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked',\n ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',\n ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',\n BACKGROUND: 'mdc-checkbox__background',\n CHECKED: 'mdc-checkbox--checked',\n CHECKMARK: 'mdc-checkbox__checkmark',\n CHECKMARK_PATH: 'mdc-checkbox__checkmark-path',\n DISABLED: 'mdc-checkbox--disabled',\n INDETERMINATE: 'mdc-checkbox--indeterminate',\n MIXEDMARK: 'mdc-checkbox__mixedmark',\n NATIVE_CONTROL: 'mdc-checkbox__native-control',\n ROOT: 'mdc-checkbox',\n SELECTED: 'mdc-checkbox--selected',\n UPGRADED: 'mdc-checkbox--upgraded',\n};\n\nexport const strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed',\n NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control',\n TRANSITION_STATE_CHECKED: 'checked',\n TRANSITION_STATE_INDETERMINATE: 'indeterminate',\n TRANSITION_STATE_INIT: 'init',\n TRANSITION_STATE_UNCHECKED: 'unchecked',\n};\n\nexport const numbers = {\n ANIM_END_LATCH_MS: 250,\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCCheckboxAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCCheckboxFoundation extends MDCFoundation<MDCCheckboxAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCCheckboxAdapter {\n return {\n addClass: () => undefined,\n forceLayout: () => undefined,\n hasNativeControl: () => false,\n isAttachedToDOM: () => false,\n isChecked: () => false,\n isIndeterminate: () => false,\n removeClass: () => undefined,\n removeNativeControlAttr: () => undefined,\n setNativeControlAttr: () => undefined,\n setNativeControlDisabled: () => undefined,\n };\n }\n\n private currentCheckState_ = strings.TRANSITION_STATE_INIT;\n private currentAnimationClass_ = '';\n private animEndLatchTimer_ = 0;\n private enableAnimationEndHandler_ = false;\n\n constructor(adapter?: Partial<MDCCheckboxAdapter>) {\n super({...MDCCheckboxFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.currentCheckState_ = this.determineCheckState_();\n this.updateAriaChecked_();\n this.adapter_.addClass(cssClasses.UPGRADED);\n }\n\n destroy() {\n clearTimeout(this.animEndLatchTimer_);\n }\n\n setDisabled(disabled: boolean) {\n this.adapter_.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter_.addClass(cssClasses.DISABLED);\n } else {\n this.adapter_.removeClass(cssClasses.DISABLED);\n }\n }\n\n /**\n * Handles the animationend event for the checkbox\n */\n handleAnimationEnd() {\n if (!this.enableAnimationEndHandler_) {\n return;\n }\n\n clearTimeout(this.animEndLatchTimer_);\n\n this.animEndLatchTimer_ = setTimeout(() => {\n this.adapter_.removeClass(this.currentAnimationClass_);\n this.enableAnimationEndHandler_ = false;\n }, numbers.ANIM_END_LATCH_MS);\n }\n\n /**\n * Handles the change event for the checkbox\n */\n handleChange() {\n this.transitionCheckState_();\n }\n\n private transitionCheckState_() {\n if (!this.adapter_.hasNativeControl()) {\n return;\n }\n const oldState = this.currentCheckState_;\n const newState = this.determineCheckState_();\n\n if (oldState === newState) {\n return;\n }\n\n this.updateAriaChecked_();\n\n const {TRANSITION_STATE_UNCHECKED} = strings;\n const {SELECTED} = cssClasses;\n if (newState === TRANSITION_STATE_UNCHECKED) {\n this.adapter_.removeClass(SELECTED);\n } else {\n this.adapter_.addClass(SELECTED);\n }\n\n // Check to ensure that there isn't a previously existing animation class, in case for example\n // the user interacted with the checkbox before the animation was finished.\n if (this.currentAnimationClass_.length > 0) {\n clearTimeout(this.animEndLatchTimer_);\n this.adapter_.forceLayout();\n this.adapter_.removeClass(this.currentAnimationClass_);\n }\n\n this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);\n this.currentCheckState_ = newState;\n\n // Check for parentNode so that animations are only run when the element is attached\n // to the DOM.\n if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {\n this.adapter_.addClass(this.currentAnimationClass_);\n this.enableAnimationEndHandler_ = true;\n }\n }\n\n private determineCheckState_(): string {\n const {\n TRANSITION_STATE_INDETERMINATE,\n TRANSITION_STATE_CHECKED,\n TRANSITION_STATE_UNCHECKED,\n } = strings;\n\n if (this.adapter_.isIndeterminate()) {\n return TRANSITION_STATE_INDETERMINATE;\n }\n return this.adapter_.isChecked() ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;\n }\n\n private getTransitionAnimationClass_(oldState: string, newState: string): string {\n const {\n TRANSITION_STATE_INIT,\n TRANSITION_STATE_CHECKED,\n TRANSITION_STATE_UNCHECKED,\n } = strings;\n\n const {\n ANIM_UNCHECKED_CHECKED,\n ANIM_UNCHECKED_INDETERMINATE,\n ANIM_CHECKED_UNCHECKED,\n ANIM_CHECKED_INDETERMINATE,\n ANIM_INDETERMINATE_CHECKED,\n ANIM_INDETERMINATE_UNCHECKED,\n } = MDCCheckboxFoundation.cssClasses;\n\n switch (oldState) {\n case TRANSITION_STATE_INIT:\n if (newState === TRANSITION_STATE_UNCHECKED) {\n return '';\n }\n return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;\n case TRANSITION_STATE_UNCHECKED:\n return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;\n case TRANSITION_STATE_CHECKED:\n return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;\n default: // TRANSITION_STATE_INDETERMINATE\n return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;\n }\n }\n\n private updateAriaChecked_() {\n // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.\n if (this.adapter_.isIndeterminate()) {\n this.adapter_.setNativeControlAttr(\n strings.ARIA_CHECKED_ATTR, strings.ARIA_CHECKED_INDETERMINATE_VALUE);\n } else {\n // The on/off state does not need to keep track of aria-checked, since\n // the screenreader uses the checked property on the checkbox element.\n this.adapter_.removeNativeControlAttr(strings.ARIA_CHECKED_ATTR);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCCheckboxFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {announce} from '@material/dom/announce';\nimport {MDCChip, MDCChipFactory} from '../chip/component';\nimport {MDCChipFoundation} from '../chip/foundation';\nimport {MDCChipInteractionEvent, MDCChipNavigationEvent, MDCChipRemovalEvent,\n MDCChipSelectionEvent} from '../chip/types';\nimport {MDCChipSetAdapter} from './adapter';\nimport {MDCChipSetFoundation} from './foundation';\n\nconst {INTERACTION_EVENT, SELECTION_EVENT, REMOVAL_EVENT, NAVIGATION_EVENT} = MDCChipFoundation.strings;\nconst {CHIP_SELECTOR} = MDCChipSetFoundation.strings;\n\nlet idCounter = 0;\n\nexport class MDCChipSet extends MDCComponent<MDCChipSetFoundation> {\n static attachTo(root: Element) {\n return new MDCChipSet(root);\n }\n\n get chips(): ReadonlyArray<MDCChip> {\n return this.chips_.slice();\n }\n\n /**\n * @return An array of the IDs of all selected chips.\n */\n get selectedChipIds(): ReadonlyArray<string> {\n return this.foundation_.getSelectedChipIds();\n }\n\n private chips_!: MDCChip[]; // assigned in initialize()\n private chipFactory_!: (el: Element) => MDCChip; // assigned in initialize()\n private handleChipInteraction_!: (evt: MDCChipInteractionEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipSelection_!: (evt: MDCChipSelectionEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipRemoval_!: (evt: MDCChipRemovalEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipNavigation_!: (evt: MDCChipNavigationEvent) => void; // assigned in initialSyncWithDOM()\n\n /**\n * @param chipFactory A function which creates a new MDCChip.\n */\n initialize(chipFactory: MDCChipFactory = (el) => new MDCChip(el)) {\n this.chipFactory_ = chipFactory;\n this.chips_ = this.instantiateChips_(this.chipFactory_);\n }\n\n initialSyncWithDOM() {\n this.chips_.forEach((chip) => {\n if (chip.id && chip.selected) {\n this.foundation_.select(chip.id);\n }\n });\n\n this.handleChipInteraction_ = (evt) =>\n this.foundation_.handleChipInteraction(evt.detail);\n this.handleChipSelection_ = (evt) =>\n this.foundation_.handleChipSelection(evt.detail);\n this.handleChipRemoval_ = (evt) =>\n this.foundation_.handleChipRemoval(evt.detail);\n this.handleChipNavigation_ = (evt) =>\n this.foundation_.handleChipNavigation(evt.detail);\n this.listen(INTERACTION_EVENT, this.handleChipInteraction_);\n this.listen(SELECTION_EVENT, this.handleChipSelection_);\n this.listen(REMOVAL_EVENT, this.handleChipRemoval_);\n this.listen(NAVIGATION_EVENT, this.handleChipNavigation_);\n }\n\n destroy() {\n this.chips_.forEach((chip) => {\n chip.destroy();\n });\n\n this.unlisten(INTERACTION_EVENT, this.handleChipInteraction_);\n this.unlisten(SELECTION_EVENT, this.handleChipSelection_);\n this.unlisten(REMOVAL_EVENT, this.handleChipRemoval_);\n this.unlisten(NAVIGATION_EVENT, this.handleChipNavigation_);\n\n super.destroy();\n }\n\n /**\n * Adds a new chip object to the chip set from the given chip element.\n */\n addChip(chipEl: Element) {\n chipEl.id = chipEl.id || `mdc-chip-${++idCounter}`;\n this.chips_.push(this.chipFactory_(chipEl));\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCChipSetAdapter = {\n announceMessage: (message) => {\n announce(message);\n },\n focusChipPrimaryActionAtIndex: (index) => {\n this.chips_[index].focusPrimaryAction();\n },\n focusChipTrailingActionAtIndex: (index) => {\n this.chips_[index].focusTrailingAction();\n },\n getChipListCount: () => this.chips_.length,\n getIndexOfChipById: (chipId) => {\n return this.findChipIndex_(chipId);\n },\n hasClass: (className) => this.root_.classList.contains(className),\n isRTL: () =>\n window.getComputedStyle(this.root_).getPropertyValue('direction') ===\n 'rtl',\n removeChipAtIndex: (index) => {\n if (index >= 0 && index < this.chips_.length) {\n this.chips_[index].destroy();\n this.chips_[index].remove();\n this.chips_.splice(index, 1);\n }\n },\n removeFocusFromChipAtIndex: (index) => {\n this.chips_[index].removeFocus();\n },\n selectChipAtIndex: (index, selected, shouldNotifyClients) => {\n if (index >= 0 && index < this.chips_.length) {\n this.chips_[index].setSelectedFromChipSet(selected, shouldNotifyClients);\n }\n },\n };\n return new MDCChipSetFoundation(adapter);\n }\n\n /**\n * Instantiates chip components on all of the chip set's child chip elements.\n */\n private instantiateChips_(chipFactory: MDCChipFactory): MDCChip[] {\n const chipElements: Element[] =\n [].slice.call(this.root_.querySelectorAll(CHIP_SELECTOR));\n return chipElements.map((el) => {\n el.id = el.id || `mdc-chip-${++idCounter}`;\n return chipFactory(el);\n });\n }\n\n /**\n * Returns the index of the chip with the given id, or -1 if the chip does not exist.\n */\n private findChipIndex_(chipId: string): number {\n for (let i = 0; i < this.chips_.length; i++) {\n if (this.chips_[i].id === chipId) {\n return i;\n }\n }\n return -1;\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const strings = {\n CHIP_SELECTOR: '.mdc-chip',\n};\n\nexport const cssClasses = {\n CHOICE: 'mdc-chip-set--choice',\n FILTER: 'mdc-chip-set--filter',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {Direction, EventSource, jumpChipKeys, navigationKeys, strings as chipStrings} from '../chip/constants';\nimport {MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail, MDCChipSelectionEventDetail} from '../chip/types';\n\nimport {MDCChipSetAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCChipSetFoundation extends MDCFoundation<MDCChipSetAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCChipSetAdapter {\n return {\n announceMessage: () => undefined,\n focusChipPrimaryActionAtIndex: () => undefined,\n focusChipTrailingActionAtIndex: () => undefined,\n getChipListCount: () => -1,\n getIndexOfChipById: () => -1,\n hasClass: () => false,\n isRTL: () => false,\n removeChipAtIndex: () => undefined,\n removeFocusFromChipAtIndex: () => undefined,\n selectChipAtIndex: () => undefined,\n };\n }\n\n /**\n * The ids of the selected chips in the set. Only used for choice chip set or filter chip set.\n */\n private selectedChipIds_: string[] = [];\n\n constructor(adapter?: Partial<MDCChipSetAdapter>) {\n super({...MDCChipSetFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Returns an array of the IDs of all selected chips.\n */\n getSelectedChipIds(): ReadonlyArray<string> {\n return this.selectedChipIds_.slice();\n }\n\n /**\n * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant.\n * Does not notify clients of the updated selection state.\n */\n select(chipId: string) {\n this.select_(chipId, false);\n }\n\n /**\n * Handles a chip interaction event\n */\n handleChipInteraction({chipId}: MDCChipInteractionEventDetail) {\n const index = this.adapter_.getIndexOfChipById(chipId);\n this.removeFocusFromChipsExcept_(index);\n if (this.adapter_.hasClass(cssClasses.CHOICE) || this.adapter_.hasClass(cssClasses.FILTER)) {\n this.toggleSelect_(chipId);\n }\n }\n\n /**\n * Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip.\n */\n handleChipSelection({chipId, selected, shouldIgnore}:\n MDCChipSelectionEventDetail) {\n // Early exit if we should ignore the event\n if (shouldIgnore) {\n return;\n }\n\n const chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0;\n if (selected && !chipIsSelected) {\n this.select(chipId);\n } else if (!selected && chipIsSelected) {\n this.deselect_(chipId);\n }\n }\n\n /**\n * Handles the event when a chip is removed.\n */\n handleChipRemoval({chipId, removedAnnouncement}: MDCChipRemovalEventDetail) {\n if (removedAnnouncement) {\n this.adapter_.announceMessage(removedAnnouncement);\n }\n\n const index = this.adapter_.getIndexOfChipById(chipId);\n this.deselectAndNotifyClients_(chipId);\n this.adapter_.removeChipAtIndex(index);\n const maxIndex = this.adapter_.getChipListCount() - 1;\n const nextIndex = Math.min(index, maxIndex);\n this.removeFocusFromChipsExcept_(nextIndex);\n // After removing a chip, we should focus the trailing action for the next chip.\n this.adapter_.focusChipTrailingActionAtIndex(nextIndex);\n }\n\n /**\n * Handles a chip navigation event.\n */\n handleChipNavigation({chipId, key, source}: MDCChipNavigationEventDetail) {\n const maxIndex = this.adapter_.getChipListCount() - 1;\n let index = this.adapter_.getIndexOfChipById(chipId);\n // Early exit if the index is out of range or the key is unusable\n if (index === -1 || !navigationKeys.has(key)) {\n return;\n }\n\n const isRTL = this.adapter_.isRTL();\n const shouldIncrement = key === chipStrings.ARROW_RIGHT_KEY && !isRTL\n || key === chipStrings.ARROW_LEFT_KEY && isRTL\n || key === chipStrings.ARROW_DOWN_KEY;\n const isHome = key === chipStrings.HOME_KEY;\n const isEnd = key === chipStrings.END_KEY;\n if (shouldIncrement) {\n index++;\n } else if (isHome) {\n index = 0;\n } else if (isEnd) {\n index = maxIndex;\n } else {\n index--;\n }\n\n // Early exit if the index is out of bounds\n if (index < 0 || index > maxIndex) {\n return;\n }\n\n this.removeFocusFromChipsExcept_(index);\n this.focusChipAction_(index, key, source);\n }\n\n private focusChipAction_(index: number, key: string, source: EventSource) {\n const shouldJumpChips = jumpChipKeys.has(key);\n if (shouldJumpChips && source === EventSource.PRIMARY) {\n return this.adapter_.focusChipPrimaryActionAtIndex(index);\n }\n\n if (shouldJumpChips && source === EventSource.TRAILING) {\n return this.adapter_.focusChipTrailingActionAtIndex(index);\n }\n\n const dir = this.getDirection_(key);\n if (dir === Direction.LEFT) {\n return this.adapter_.focusChipTrailingActionAtIndex(index);\n }\n\n if (dir === Direction.RIGHT) {\n return this.adapter_.focusChipPrimaryActionAtIndex(index);\n }\n }\n\n private getDirection_(key: string): Direction {\n const isRTL = this.adapter_.isRTL();\n if (key === chipStrings.ARROW_LEFT_KEY && !isRTL || key === chipStrings.ARROW_RIGHT_KEY && isRTL) {\n return Direction.LEFT;\n }\n\n return Direction.RIGHT;\n }\n\n /**\n * Deselects the chip with the given id and optionally notifies clients.\n */\n private deselect_(chipId: string, shouldNotifyClients = false) {\n const index = this.selectedChipIds_.indexOf(chipId);\n if (index >= 0) {\n this.selectedChipIds_.splice(index, 1);\n const chipIndex = this.adapter_.getIndexOfChipById(chipId);\n this.adapter_.selectChipAtIndex(chipIndex, /** isSelected */ false, shouldNotifyClients);\n }\n }\n\n /**\n * Deselects the chip with the given id and notifies clients.\n */\n private deselectAndNotifyClients_(chipId: string) {\n this.deselect_(chipId, true);\n }\n\n /**\n * Toggles selection of the chip with the given id.\n */\n private toggleSelect_(chipId: string) {\n if (this.selectedChipIds_.indexOf(chipId) >= 0) {\n this.deselectAndNotifyClients_(chipId);\n } else {\n this.selectAndNotifyClients_(chipId);\n }\n }\n\n private removeFocusFromChipsExcept_(index: number) {\n const chipCount = this.adapter_.getChipListCount();\n for (let i = 0; i < chipCount; i++) {\n if (i !== index) {\n this.adapter_.removeFocusFromChipAtIndex(i);\n }\n }\n }\n\n private selectAndNotifyClients_(chipId: string) {\n this.select_(chipId, true);\n }\n\n private select_(chipId: string, shouldNotifyClients: boolean) {\n if (this.selectedChipIds_.indexOf(chipId) >= 0) {\n return;\n }\n\n if (this.adapter_.hasClass(cssClasses.CHOICE) && this.selectedChipIds_.length > 0) {\n const previouslySelectedChip = this.selectedChipIds_[0];\n const previouslySelectedIndex = this.adapter_.getIndexOfChipById(previouslySelectedChip);\n this.selectedChipIds_ = [];\n this.adapter_.selectChipAtIndex(previouslySelectedIndex, /** isSelected */ false, shouldNotifyClients);\n }\n this.selectedChipIds_.push(chipId);\n const index = this.adapter_.getIndexOfChipById(chipId);\n this.adapter_.selectChipAtIndex(index, /** isSelected */ true, shouldNotifyClients);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipSetFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as chipSetCssClasses, strings as chipSetStrings} from './constants';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCChipAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCChipFoundation} from './foundation';\nimport {MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail,\n MDCChipSelectionEventDetail} from './types';\n\ntype InteractionType = 'click' | 'keydown';\n\nconst INTERACTION_EVENTS: InteractionType[] = ['click', 'keydown'];\n\nexport type MDCChipFactory = (el: Element, foundation?: MDCChipFoundation) => MDCChip;\n\nexport class MDCChip extends MDCComponent<MDCChipFoundation> implements MDCRippleCapableSurface {\n /**\n * @return Whether the chip is selected.\n */\n get selected(): boolean {\n return this.foundation_.isSelected();\n }\n\n /**\n * Sets selected state on the chip.\n */\n set selected(selected: boolean) {\n this.foundation_.setSelected(selected);\n }\n\n /**\n * @return Whether a trailing icon click should trigger exit/removal of the chip.\n */\n get shouldRemoveOnTrailingIconClick(): boolean {\n return this.foundation_.getShouldRemoveOnTrailingIconClick();\n }\n\n /**\n * Sets whether a trailing icon click should trigger exit/removal of the chip.\n */\n set shouldRemoveOnTrailingIconClick(shouldRemove: boolean) {\n this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove);\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n get id(): string {\n return this.root_.id;\n }\n\n static attachTo(root: Element) {\n return new MDCChip(root);\n }\n\n // Public visibility for this property is required by MDCRippleCapableSurface.\n root_!: HTMLElement; // assigned in MDCComponent constructor\n\n private leadingIcon_!: Element | null; // assigned in initialize()\n private trailingIcon_!: Element | null; // assigned in initialize()\n private checkmark_!: Element | null; // assigned in initialize()\n private ripple_!: MDCRipple; // assigned in initialize()\n private primaryAction_!: Element | null; // assigned in initialize()\n private trailingAction_!: Element | null; // assigned in initialize()\n\n private handleInteraction_!: SpecificEventListener<InteractionType>; // assigned in initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // assigned in initialSyncWithDOM()\n private handleTrailingIconInteraction_!: SpecificEventListener<InteractionType>; // assigned in initialSyncWithDOM()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n\n initialize(rippleFactory: MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation)) {\n this.leadingIcon_ = this.root_.querySelector(strings.LEADING_ICON_SELECTOR);\n this.trailingIcon_ = this.root_.querySelector(strings.TRAILING_ICON_SELECTOR);\n this.checkmark_ = this.root_.querySelector(strings.CHECKMARK_SELECTOR);\n this.primaryAction_ = this.root_.querySelector(strings.PRIMARY_ACTION_SELECTOR);\n this.trailingAction_ = this.root_.querySelector(strings.TRAILING_ACTION_SELECTOR);\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const rippleAdapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n computeBoundingRect: () => this.foundation_.getDimensions(),\n };\n this.ripple_ = rippleFactory(this.root_, new MDCRippleFoundation(rippleAdapter));\n }\n\n initialSyncWithDOM() {\n this.handleInteraction_ = (evt: MouseEvent | KeyboardEvent) => this.foundation_.handleInteraction(evt);\n this.handleTransitionEnd_ = (evt: TransitionEvent) => this.foundation_.handleTransitionEnd(evt);\n this.handleTrailingIconInteraction_ = (evt: MouseEvent | KeyboardEvent) =>\n this.foundation_.handleTrailingIconInteraction(evt);\n this.handleKeydown_ = (evt: KeyboardEvent) => this.foundation_.handleKeydown(evt);\n\n INTERACTION_EVENTS.forEach((evtType) => {\n this.listen(evtType, this.handleInteraction_);\n });\n this.listen('transitionend', this.handleTransitionEnd_);\n this.listen('keydown', this.handleKeydown_);\n\n if (this.trailingIcon_) {\n INTERACTION_EVENTS.forEach((evtType) => {\n this.trailingIcon_!.addEventListener(evtType, this.handleTrailingIconInteraction_ as EventListener);\n });\n }\n }\n\n destroy() {\n this.ripple_.destroy();\n\n INTERACTION_EVENTS.forEach((evtType) => {\n this.unlisten(evtType, this.handleInteraction_);\n });\n this.unlisten('transitionend', this.handleTransitionEnd_);\n this.unlisten('keydown', this.handleKeydown_);\n\n if (this.trailingIcon_) {\n INTERACTION_EVENTS.forEach((evtType) => {\n this.trailingIcon_!.removeEventListener(evtType, this.handleTrailingIconInteraction_ as EventListener);\n });\n }\n\n super.destroy();\n }\n\n /**\n * Begins the exit animation which leads to removal of the chip.\n */\n beginExit() {\n this.foundation_.beginExit();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCChipAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n addClassToLeadingIcon: (className) => {\n if (this.leadingIcon_) {\n this.leadingIcon_.classList.add(className);\n }\n },\n eventTargetHasClass: (target, className) =>\n target ? (target as Element).classList.contains(className) : false,\n focusPrimaryAction: () => {\n if (this.primaryAction_) {\n (this.primaryAction_ as HTMLElement).focus();\n }\n },\n focusTrailingAction: () => {\n if (this.trailingAction_) {\n (this.trailingAction_ as HTMLElement).focus();\n }\n },\n getAttribute: (attr) => this.root_.getAttribute(attr),\n getCheckmarkBoundingClientRect: () =>\n this.checkmark_ ? this.checkmark_.getBoundingClientRect() : null,\n getComputedStyleValue: (propertyName) =>\n window.getComputedStyle(this.root_).getPropertyValue(propertyName),\n getRootBoundingClientRect: () => this.root_.getBoundingClientRect(),\n hasClass: (className) => this.root_.classList.contains(className),\n hasLeadingIcon: () => !!this.leadingIcon_,\n hasTrailingAction: () => !!this.trailingAction_,\n isRTL: () =>\n window.getComputedStyle(this.root_).getPropertyValue('direction') ===\n 'rtl',\n notifyInteraction: () => this.emit<MDCChipInteractionEventDetail>(\n strings.INTERACTION_EVENT, {chipId: this.id},\n true /* shouldBubble */),\n notifyNavigation: (key, source) =>\n this.emit<MDCChipNavigationEventDetail>(\n strings.NAVIGATION_EVENT, {chipId: this.id, key, source},\n true /* shouldBubble */),\n notifyRemoval: (removedAnnouncement) => {\n this.emit<MDCChipRemovalEventDetail>(\n strings.REMOVAL_EVENT, {chipId: this.id, removedAnnouncement},\n true /* shouldBubble */);\n },\n notifySelection: (selected, shouldIgnore) =>\n this.emit<MDCChipSelectionEventDetail>(\n strings.SELECTION_EVENT,\n {chipId: this.id, selected, shouldIgnore},\n true /* shouldBubble */),\n notifyTrailingIconInteraction: () =>\n this.emit<MDCChipInteractionEventDetail>(\n strings.TRAILING_ICON_INTERACTION_EVENT, {chipId: this.id},\n true /* shouldBubble */),\n removeClass: (className) => this.root_.classList.remove(className),\n removeClassFromLeadingIcon: (className) => {\n if (this.leadingIcon_) {\n this.leadingIcon_.classList.remove(className);\n }\n },\n setPrimaryActionAttr: (attr, value) => {\n if (this.primaryAction_) {\n this.primaryAction_.setAttribute(attr, value);\n }\n },\n setStyleProperty: (propertyName, value) =>\n this.root_.style.setProperty(propertyName, value),\n setTrailingActionAttr: (attr, value) => {\n if (this.trailingAction_) {\n this.trailingAction_.setAttribute(attr, value);\n }\n },\n };\n return new MDCChipFoundation(adapter);\n }\n\n setSelectedFromChipSet(selected: boolean, shouldNotifyClients: boolean) {\n this.foundation_.setSelectedFromChipSet(selected, shouldNotifyClients);\n }\n\n focusPrimaryAction() {\n this.foundation_.focusPrimaryAction();\n }\n\n focusTrailingAction() {\n this.foundation_.focusTrailingAction();\n }\n\n removeFocus() {\n this.foundation_.removeFocus();\n }\n\n remove() {\n const parent = this.root_.parentNode;\n if (parent !== null) {\n parent.removeChild(this.root_);\n }\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport enum Direction {\n RIGHT,\n LEFT,\n}\n\nexport enum EventSource {\n PRIMARY,\n TRAILING,\n NONE,\n}\n\nexport const strings = {\n ADDED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-added-announcement',\n ARIA_CHECKED: 'aria-checked',\n ARROW_DOWN_KEY: 'ArrowDown',\n ARROW_LEFT_KEY: 'ArrowLeft',\n ARROW_RIGHT_KEY: 'ArrowRight',\n ARROW_UP_KEY: 'ArrowUp',\n BACKSPACE_KEY: 'Backspace',\n CHECKMARK_SELECTOR: '.mdc-chip__checkmark',\n DELETE_KEY: 'Delete',\n END_KEY: 'End',\n ENTER_KEY: 'Enter',\n ENTRY_ANIMATION_NAME: 'mdc-chip-entry',\n HOME_KEY: 'Home',\n INTERACTION_EVENT: 'MDCChip:interaction',\n LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',\n NAVIGATION_EVENT: 'MDCChip:navigation',\n PRIMARY_ACTION_SELECTOR: '.mdc-chip__primary-action',\n REMOVED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-removed-announcement',\n REMOVAL_EVENT: 'MDCChip:removal',\n SELECTION_EVENT: 'MDCChip:selection',\n SPACEBAR_KEY: ' ',\n TAB_INDEX: 'tabindex',\n TRAILING_ACTION_SELECTOR: '.mdc-chip__trailing-action',\n TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',\n TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing',\n};\n\nexport const cssClasses = {\n CHECKMARK: 'mdc-chip__checkmark',\n CHIP_EXIT: 'mdc-chip--exit',\n DELETABLE: 'mdc-chip--deletable',\n HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',\n LEADING_ICON: 'mdc-chip__icon--leading',\n PRIMARY_ACTION: 'mdc-chip__primary-action',\n SELECTED: 'mdc-chip--selected',\n TEXT: 'mdc-chip__text',\n TRAILING_ACTION: 'mdc-chip__trailing-action',\n TRAILING_ICON: 'mdc-chip__icon--trailing',\n};\n\nexport const navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\nnavigationKeys.add(strings.ARROW_LEFT_KEY);\nnavigationKeys.add(strings.ARROW_RIGHT_KEY);\nnavigationKeys.add(strings.ARROW_DOWN_KEY);\nnavigationKeys.add(strings.ARROW_UP_KEY);\nnavigationKeys.add(strings.END_KEY);\nnavigationKeys.add(strings.HOME_KEY);\n\nexport const jumpChipKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\njumpChipKeys.add(strings.ARROW_UP_KEY);\njumpChipKeys.add(strings.ARROW_DOWN_KEY);\njumpChipKeys.add(strings.HOME_KEY);\njumpChipKeys.add(strings.END_KEY);\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCChipAdapter} from './adapter';\nimport {cssClasses, Direction, EventSource, jumpChipKeys, navigationKeys, strings} from './constants';\n\nconst emptyClientRect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n};\n\nexport class MDCChipFoundation extends MDCFoundation<MDCChipAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCChipAdapter {\n return {\n addClass: () => undefined,\n addClassToLeadingIcon: () => undefined,\n eventTargetHasClass: () => false,\n focusPrimaryAction: () => undefined,\n focusTrailingAction: () => undefined,\n getAttribute: () => null,\n getCheckmarkBoundingClientRect: () => emptyClientRect,\n getComputedStyleValue: () => '',\n getRootBoundingClientRect: () => emptyClientRect,\n hasClass: () => false,\n hasLeadingIcon: () => false,\n hasTrailingAction: () => false,\n isRTL: () => false,\n notifyInteraction: () => undefined,\n notifyNavigation: () => undefined,\n notifyRemoval: () => undefined,\n notifySelection: () => undefined,\n notifyTrailingIconInteraction: () => undefined,\n removeClass: () => undefined,\n removeClassFromLeadingIcon: () => undefined,\n setPrimaryActionAttr: () => undefined,\n setStyleProperty: () => undefined,\n setTrailingActionAttr: () => undefined,\n };\n }\n\n /** Whether a trailing icon click should immediately trigger exit/removal of the chip. */\n private shouldRemoveOnTrailingIconClick_ = true;\n\n constructor(adapter?: Partial<MDCChipAdapter>) {\n super({...MDCChipFoundation.defaultAdapter, ...adapter});\n }\n\n isSelected() {\n return this.adapter_.hasClass(cssClasses.SELECTED);\n }\n\n setSelected(selected: boolean) {\n this.setSelected_(selected);\n this.notifySelection_(selected);\n }\n\n setSelectedFromChipSet(selected: boolean, shouldNotifyClients: boolean) {\n this.setSelected_(selected);\n if (shouldNotifyClients) {\n this.notifyIgnoredSelection_(selected);\n }\n }\n\n getShouldRemoveOnTrailingIconClick() {\n return this.shouldRemoveOnTrailingIconClick_;\n }\n\n setShouldRemoveOnTrailingIconClick(shouldRemove: boolean) {\n this.shouldRemoveOnTrailingIconClick_ = shouldRemove;\n }\n\n getDimensions(): ClientRect {\n const getRootRect = () => this.adapter_.getRootBoundingClientRect();\n const getCheckmarkRect = () => this.adapter_.getCheckmarkBoundingClientRect();\n\n // When a chip has a checkmark and not a leading icon, the bounding rect changes in size depending on the current\n // size of the checkmark.\n if (!this.adapter_.hasLeadingIcon()) {\n const checkmarkRect = getCheckmarkRect();\n if (checkmarkRect) {\n const rootRect = getRootRect();\n // Checkmark is a square, meaning the client rect's width and height are identical once the animation completes.\n // However, the checkbox is initially hidden by setting the width to 0.\n // To account for an initial width of 0, we use the checkbox's height instead (which equals the end-state width)\n // when adding it to the root client rect's width.\n return {\n bottom: rootRect.bottom,\n height: rootRect.height,\n left: rootRect.left,\n right: rootRect.right,\n top: rootRect.top,\n width: rootRect.width + checkmarkRect.height,\n };\n }\n }\n\n return getRootRect();\n }\n\n /**\n * Begins the exit animation which leads to removal of the chip.\n */\n beginExit() {\n this.adapter_.addClass(cssClasses.CHIP_EXIT);\n }\n\n /**\n * Handles an interaction event on the root element.\n */\n handleInteraction(evt: MouseEvent | KeyboardEvent) {\n if (this.shouldHandleInteraction_(evt)) {\n this.adapter_.notifyInteraction();\n this.focusPrimaryAction_();\n }\n }\n\n /**\n * Handles a transition end event on the root element.\n */\n handleTransitionEnd(evt: TransitionEvent) {\n // Handle transition end event on the chip when it is about to be removed.\n const shouldHandle = this.adapter_.eventTargetHasClass(evt.target, cssClasses.CHIP_EXIT);\n const widthIsAnimating = evt.propertyName === 'width';\n const opacityIsAnimating = evt.propertyName === 'opacity';\n\n if (shouldHandle && opacityIsAnimating) {\n // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5\n const chipWidth = this.adapter_.getComputedStyleValue('width');\n\n // On the next frame (once we get the computed width), explicitly set the chip's width\n // to its current pixel width, so we aren't transitioning out of 'auto'.\n requestAnimationFrame(() => {\n this.adapter_.setStyleProperty('width', chipWidth);\n\n // To mitigate jitter, start transitioning padding and margin before width.\n this.adapter_.setStyleProperty('padding', '0');\n this.adapter_.setStyleProperty('margin', '0');\n\n // On the next frame (once width is explicitly set), transition width to 0.\n requestAnimationFrame(() => {\n this.adapter_.setStyleProperty('width', '0');\n });\n });\n return;\n }\n\n if (shouldHandle && widthIsAnimating) {\n this.removeFocus_();\n const removedAnnouncement =\n this.adapter_.getAttribute(strings.REMOVED_ANNOUNCEMENT_ATTRIBUTE);\n\n this.adapter_.notifyRemoval(removedAnnouncement);\n }\n\n // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles.\n if (!opacityIsAnimating) {\n return;\n }\n\n const shouldHideLeadingIcon = this.adapter_.eventTargetHasClass(evt.target, cssClasses.LEADING_ICON)\n && this.adapter_.hasClass(cssClasses.SELECTED);\n const shouldShowLeadingIcon = this.adapter_.eventTargetHasClass(evt.target, cssClasses.CHECKMARK)\n && !this.adapter_.hasClass(cssClasses.SELECTED);\n\n if (shouldHideLeadingIcon) {\n return this.adapter_.addClassToLeadingIcon(cssClasses.HIDDEN_LEADING_ICON);\n }\n\n if (shouldShowLeadingIcon) {\n return this.adapter_.removeClassFromLeadingIcon(cssClasses.HIDDEN_LEADING_ICON);\n }\n }\n\n /**\n * Handles an interaction event on the trailing icon element. This is used to\n * prevent the ripple from activating on interaction with the trailing icon.\n */\n handleTrailingIconInteraction(evt: MouseEvent | KeyboardEvent) {\n if (this.shouldHandleInteraction_(evt)) {\n this.adapter_.notifyTrailingIconInteraction();\n this.removeChip_(evt);\n }\n }\n\n /**\n * Handles a keydown event from the root element.\n */\n handleKeydown(evt: KeyboardEvent) {\n if (this.shouldRemoveChip_(evt)) {\n return this.removeChip_(evt);\n }\n\n const key = evt.key;\n // Early exit if the key is not usable\n if (!navigationKeys.has(key)) {\n return;\n }\n\n // Prevent default behavior for movement keys which could include scrolling\n evt.preventDefault();\n this.focusNextAction_(evt);\n }\n\n removeFocus() {\n this.adapter_.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n this.adapter_.setTrailingActionAttr(strings.TAB_INDEX, '-1');\n }\n\n focusPrimaryAction() {\n this.focusPrimaryAction_();\n }\n\n focusTrailingAction() {\n if (!this.adapter_.hasTrailingAction()) {\n return this.focusPrimaryAction_();\n }\n this.focusTrailingAction_();\n }\n\n private focusNextAction_(evt: KeyboardEvent) {\n const key = evt.key;\n const hasTrailingAction = this.adapter_.hasTrailingAction();\n const dir = this.getDirection_(key);\n const source = this.getEvtSource_(evt);\n // Early exit if the key should jump keys or the chip only has one action (i.e. no trailing action)\n if (jumpChipKeys.has(key) || !hasTrailingAction) {\n this.adapter_.notifyNavigation(key, source);\n return;\n }\n\n if (source === EventSource.PRIMARY && dir === Direction.RIGHT) {\n return this.focusTrailingAction_();\n }\n\n if (source === EventSource.TRAILING && dir === Direction.LEFT) {\n return this.focusPrimaryAction_();\n }\n\n this.adapter_.notifyNavigation(key, EventSource.NONE);\n }\n\n private getEvtSource_(evt: KeyboardEvent): EventSource {\n if (this.adapter_.eventTargetHasClass(evt.target, cssClasses.PRIMARY_ACTION)) {\n return EventSource.PRIMARY;\n }\n\n if (this.adapter_.eventTargetHasClass(evt.target, cssClasses.TRAILING_ACTION)) {\n return EventSource.TRAILING;\n }\n\n return EventSource.NONE;\n }\n\n private getDirection_(key: string): Direction {\n const isRTL = this.adapter_.isRTL();\n if (key === strings.ARROW_LEFT_KEY && !isRTL || key === strings.ARROW_RIGHT_KEY && isRTL) {\n return Direction.LEFT;\n }\n\n return Direction.RIGHT;\n }\n\n private focusPrimaryAction_() {\n this.adapter_.setPrimaryActionAttr(strings.TAB_INDEX, '0');\n this.adapter_.focusPrimaryAction();\n this.adapter_.setTrailingActionAttr(strings.TAB_INDEX, '-1');\n }\n\n private focusTrailingAction_() {\n this.adapter_.setTrailingActionAttr(strings.TAB_INDEX, '0');\n this.adapter_.focusTrailingAction();\n this.adapter_.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n }\n\n private removeFocus_() {\n this.adapter_.setTrailingActionAttr(strings.TAB_INDEX, '-1');\n this.adapter_.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n }\n\n private removeChip_(evt: MouseEvent|KeyboardEvent) {\n evt.stopPropagation();\n // Prevent default behavior for backspace on Firefox which causes a page\n // navigation.\n evt.preventDefault();\n if (this.shouldRemoveOnTrailingIconClick_) {\n this.beginExit();\n }\n }\n\n private shouldHandleInteraction_(evt: MouseEvent|KeyboardEvent): boolean {\n if (evt.type === 'click') {\n return true;\n }\n\n const keyEvt = evt as KeyboardEvent;\n return keyEvt.key === strings.ENTER_KEY || keyEvt.key === strings.SPACEBAR_KEY;\n }\n\n private shouldRemoveChip_(evt: KeyboardEvent): boolean {\n const isDeletable = this.adapter_.hasClass(cssClasses.DELETABLE);\n return isDeletable && (evt.key === strings.BACKSPACE_KEY || evt.key === strings.DELETE_KEY);\n }\n\n private setSelected_(selected: boolean) {\n if (selected) {\n this.adapter_.addClass(cssClasses.SELECTED);\n this.adapter_.setPrimaryActionAttr(strings.ARIA_CHECKED, 'true');\n } else {\n this.adapter_.removeClass(cssClasses.SELECTED);\n this.adapter_.setPrimaryActionAttr(strings.ARIA_CHECKED, 'false');\n }\n }\n\n private notifySelection_(selected: boolean) {\n this.adapter_.notifySelection(selected, false);\n }\n\n private notifyIgnoredSelection_(selected: boolean) {\n this.adapter_.notifySelection(selected, true);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\nexport {cssClasses as chipCssClasses, strings as chipStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './chip/index';\nexport * from './chip-set/index';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCCheckbox, MDCCheckboxFactory} from '@material/checkbox/component';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCDataTableAdapter} from './adapter';\nimport {cssClasses, events, strings} from './constants';\nimport {MDCDataTableFoundation} from './foundation';\nimport {MDCDataTableRowSelectionChangedEventDetail} from './types';\n\nexport class MDCDataTable extends MDCComponent<MDCDataTableFoundation> {\n static attachTo(root: Element): MDCDataTable {\n return new MDCDataTable(root);\n }\n\n private headerRowCheckbox_!: MDCCheckbox;\n private rowCheckboxList_!: MDCCheckbox[];\n private checkboxFactory_!: MDCCheckboxFactory;\n private headerRow_!: HTMLElement;\n private content_!: HTMLElement;\n private handleHeaderRowCheckboxChange_!: SpecificEventListener<'change'>;\n private handleRowCheckboxChange_!: SpecificEventListener<'change'>;\n\n initialize(checkboxFactory: MDCCheckboxFactory = (el: Element) => new MDCCheckbox(el)) {\n this.checkboxFactory_ = checkboxFactory;\n }\n\n initialSyncWithDOM() {\n this.headerRow_ = this.root_.querySelector(`.${cssClasses.HEADER_ROW}`) as HTMLElement;\n this.handleHeaderRowCheckboxChange_ = () => this.foundation_.handleHeaderRowCheckboxChange();\n this.headerRow_.addEventListener('change', this.handleHeaderRowCheckboxChange_);\n\n this.content_ = this.root_.querySelector(`.${cssClasses.CONTENT}`) as HTMLElement;\n this.handleRowCheckboxChange_ = (event) => this.foundation_.handleRowCheckboxChange(event);\n this.content_.addEventListener('change', this.handleRowCheckboxChange_);\n\n this.layout();\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n */\n layout() {\n this.foundation_.layout();\n }\n\n /**\n * @return Returns array of row elements.\n */\n getRows(): Element[] {\n return this.foundation_.getRows();\n }\n\n /**\n * @return Returns array of selected row ids.\n */\n getSelectedRowIds(): Array<string|null> {\n return this.foundation_.getSelectedRowIds();\n }\n\n /**\n * Sets selected row ids. Overwrites previously selected rows.\n * @param rowIds Array of row ids that needs to be selected.\n */\n setSelectedRowIds(rowIds: string[]) {\n this.foundation_.setSelectedRowIds(rowIds);\n }\n\n destroy() {\n this.headerRow_.removeEventListener('change', this.handleHeaderRowCheckboxChange_);\n this.content_.removeEventListener('change', this.handleRowCheckboxChange_);\n\n this.headerRowCheckbox_.destroy();\n this.rowCheckboxList_.forEach((checkbox) => checkbox.destroy());\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCDataTableAdapter = {\n addClassAtRowIndex: (rowIndex: number, className: string) => this.getRows()[rowIndex].classList.add(className),\n getRowCount: () => this.getRows().length,\n getRowElements: () => [].slice.call(this.root_.querySelectorAll(strings.ROW_SELECTOR)),\n getRowIdAtIndex: (rowIndex: number) => this.getRows()[rowIndex].getAttribute(strings.DATA_ROW_ID_ATTR),\n getRowIndexByChildElement: (el: Element) => {\n return this.getRows().indexOf((closest(el, strings.ROW_SELECTOR) as HTMLElement));\n },\n getSelectedRowCount: () => this.root_.querySelectorAll(strings.ROW_SELECTED_SELECTOR).length,\n isCheckboxAtRowIndexChecked: (rowIndex: number) => this.rowCheckboxList_[rowIndex].checked,\n isHeaderRowCheckboxChecked: () => this.headerRowCheckbox_.checked,\n isRowsSelectable: () => !!this.root_.querySelector(strings.ROW_CHECKBOX_SELECTOR),\n notifyRowSelectionChanged: (data: MDCDataTableRowSelectionChangedEventDetail) => {\n this.emit(events.ROW_SELECTION_CHANGED, {\n row: this.getRowByIndex_(data.rowIndex),\n rowId: this.getRowIdByIndex_(data.rowIndex),\n rowIndex: data.rowIndex,\n selected: data.selected,\n },\n /** shouldBubble */ true);\n },\n notifySelectedAll: () => this.emit(events.SELECTED_ALL, {}, /** shouldBubble */ true),\n notifyUnselectedAll: () => this.emit(events.UNSELECTED_ALL, {}, /** shouldBubble */ true),\n registerHeaderRowCheckbox: () => {\n if (this.headerRowCheckbox_) {\n this.headerRowCheckbox_.destroy();\n }\n\n const checkboxEl = (this.root_.querySelector(strings.HEADER_ROW_CHECKBOX_SELECTOR) as HTMLElement);\n this.headerRowCheckbox_ = this.checkboxFactory_(checkboxEl);\n },\n registerRowCheckboxes: () => {\n if (this.rowCheckboxList_) {\n this.rowCheckboxList_.forEach((checkbox) => checkbox.destroy());\n }\n\n this.rowCheckboxList_ = [];\n this.getRows().forEach((rowEl) => {\n const checkbox = this.checkboxFactory_((rowEl.querySelector(strings.ROW_CHECKBOX_SELECTOR) as HTMLElement));\n this.rowCheckboxList_.push(checkbox);\n });\n },\n removeClassAtRowIndex: (rowIndex: number, className: string) => {\n this.getRows()[rowIndex].classList.remove(className);\n },\n setAttributeAtRowIndex: (rowIndex: number, attr: string, value: string) => {\n this.getRows()[rowIndex].setAttribute(attr, value);\n },\n setHeaderRowCheckboxChecked: (checked: boolean) => {\n this.headerRowCheckbox_.checked = checked;\n },\n setHeaderRowCheckboxIndeterminate: (indeterminate: boolean) => {\n this.headerRowCheckbox_.indeterminate = indeterminate;\n },\n setRowCheckboxCheckedAtIndex: (rowIndex: number, checked: boolean) => {\n this.rowCheckboxList_[rowIndex].checked = checked;\n },\n };\n return new MDCDataTableFoundation(adapter);\n }\n\n private getRowByIndex_(index: number): Element {\n return this.getRows()[index];\n }\n\n private getRowIdByIndex_(index: number): string | null {\n return this.getRowByIndex_(index).getAttribute(strings.DATA_ROW_ID_ATTR);\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n CELL: 'mdc-data-table__cell',\n CELL_NUMERIC: 'mdc-data-table__cell--numeric',\n CONTENT: 'mdc-data-table__content',\n HEADER_ROW: 'mdc-data-table__header-row',\n HEADER_ROW_CHECKBOX: 'mdc-data-table__header-row-checkbox',\n ROOT: 'mdc-data-table',\n ROW: 'mdc-data-table__row',\n ROW_CHECKBOX: 'mdc-data-table__row-checkbox',\n ROW_SELECTED: 'mdc-data-table__row--selected',\n};\n\nexport const strings = {\n ARIA_SELECTED: 'aria-selected',\n DATA_ROW_ID_ATTR: 'data-row-id',\n HEADER_ROW_CHECKBOX_SELECTOR: `.${cssClasses.HEADER_ROW_CHECKBOX}`,\n ROW_CHECKBOX_SELECTOR: `.${cssClasses.ROW_CHECKBOX}`,\n ROW_SELECTED_SELECTOR: `.${cssClasses.ROW_SELECTED}`,\n ROW_SELECTOR: `.${cssClasses.ROW}`,\n};\n\nexport const events = {\n ROW_SELECTION_CHANGED: 'MDCDataTable:rowSelectionChanged',\n SELECTED_ALL: 'MDCDataTable:selectedAll',\n UNSELECTED_ALL: 'MDCDataTable:unselectedAll',\n};\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCDataTableAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCDataTableFoundation extends MDCFoundation<MDCDataTableAdapter> {\n static get defaultAdapter(): MDCDataTableAdapter {\n return {\n addClassAtRowIndex: () => undefined,\n getRowCount: () => 0,\n getRowElements: () => [],\n getRowIdAtIndex: () => '',\n getRowIndexByChildElement: () => 0,\n getSelectedRowCount: () => 0,\n isCheckboxAtRowIndexChecked: () => false,\n isHeaderRowCheckboxChecked: () => false,\n isRowsSelectable: () => false,\n notifyRowSelectionChanged: () => undefined,\n notifySelectedAll: () => undefined,\n notifyUnselectedAll: () => undefined,\n registerHeaderRowCheckbox: () => undefined,\n registerRowCheckboxes: () => undefined,\n removeClassAtRowIndex: () => undefined,\n setAttributeAtRowIndex: () => undefined,\n setHeaderRowCheckboxChecked: () => undefined,\n setHeaderRowCheckboxIndeterminate: () => undefined,\n setRowCheckboxCheckedAtIndex: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCDataTableAdapter>) {\n super({...MDCDataTableFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n * Use this if registering checkbox is synchronous.\n */\n layout() {\n if (this.adapter_.isRowsSelectable()) {\n this.adapter_.registerHeaderRowCheckbox();\n this.adapter_.registerRowCheckboxes();\n\n this.setHeaderRowCheckboxState_();\n }\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n * Use this if registering checkbox is asynchronous.\n */\n async layoutAsync(): Promise<void> {\n if (this.adapter_.isRowsSelectable()) {\n await this.adapter_.registerHeaderRowCheckbox();\n await this.adapter_.registerRowCheckboxes();\n\n this.setHeaderRowCheckboxState_();\n }\n }\n\n /**\n * @return Returns array of row elements.\n */\n getRows(): Element[] {\n return this.adapter_.getRowElements();\n }\n\n /**\n * Sets selected row ids. Overwrites previously selected rows.\n * @param rowIds Array of row ids that needs to be selected.\n */\n setSelectedRowIds(rowIds: string[]) {\n for (let rowIndex = 0; rowIndex < this.adapter_.getRowCount(); rowIndex++) {\n const rowId = this.adapter_.getRowIdAtIndex(rowIndex);\n\n let isSelected = false;\n if (rowId && rowIds.indexOf(rowId) >= 0) {\n isSelected = true;\n }\n\n this.adapter_.setRowCheckboxCheckedAtIndex(rowIndex, isSelected);\n this.selectRowAtIndex_(rowIndex, isSelected);\n }\n\n this.setHeaderRowCheckboxState_();\n }\n\n /**\n * @return Returns array of selected row ids.\n */\n getSelectedRowIds(): Array<string|null> {\n const selectedRowIds: Array<string|null> = [];\n for (let rowIndex = 0; rowIndex < this.adapter_.getRowCount(); rowIndex++) {\n if (this.adapter_.isCheckboxAtRowIndexChecked(rowIndex)) {\n selectedRowIds.push(this.adapter_.getRowIdAtIndex(rowIndex));\n }\n }\n\n return selectedRowIds;\n }\n\n /**\n * Handles header row checkbox change event.\n */\n handleHeaderRowCheckboxChange() {\n const isHeaderChecked = this.adapter_.isHeaderRowCheckboxChecked();\n\n for (let rowIndex = 0; rowIndex < this.adapter_.getRowCount(); rowIndex++) {\n this.adapter_.setRowCheckboxCheckedAtIndex(rowIndex, isHeaderChecked);\n this.selectRowAtIndex_(rowIndex, isHeaderChecked);\n }\n\n if (isHeaderChecked) {\n this.adapter_.notifySelectedAll();\n } else {\n this.adapter_.notifyUnselectedAll();\n }\n }\n\n /**\n * Handles change event originated from row checkboxes.\n */\n handleRowCheckboxChange(event: Event) {\n const rowIndex = this.adapter_.getRowIndexByChildElement(event.target as HTMLInputElement);\n\n if (rowIndex === -1) {\n return;\n }\n\n const selected = this.adapter_.isCheckboxAtRowIndexChecked(rowIndex);\n\n this.selectRowAtIndex_(rowIndex, selected);\n this.setHeaderRowCheckboxState_();\n\n const rowId = this.adapter_.getRowIdAtIndex(rowIndex);\n this.adapter_.notifyRowSelectionChanged({rowId, rowIndex, selected});\n }\n\n /**\n * Updates header row checkbox state based on number of rows selected.\n */\n private setHeaderRowCheckboxState_() {\n if (this.adapter_.getSelectedRowCount() === this.adapter_.getRowCount()) {\n this.adapter_.setHeaderRowCheckboxChecked(true);\n this.adapter_.setHeaderRowCheckboxIndeterminate(false);\n } else if (this.adapter_.getSelectedRowCount() === 0) {\n this.adapter_.setHeaderRowCheckboxIndeterminate(false);\n this.adapter_.setHeaderRowCheckboxChecked(false);\n } else {\n this.adapter_.setHeaderRowCheckboxIndeterminate(true);\n this.adapter_.setHeaderRowCheckboxChecked(false);\n }\n }\n\n /**\n * Sets the attributes of row element based on selection state.\n */\n private selectRowAtIndex_(rowIndex: number, selected: boolean) {\n if (selected) {\n this.adapter_.addClassAtRowIndex(rowIndex, cssClasses.ROW_SELECTED);\n this.adapter_.setAttributeAtRowIndex(rowIndex, strings.ARIA_SELECTED, 'true');\n } else {\n this.adapter_.removeClassAtRowIndex(rowIndex, cssClasses.ROW_SELECTED);\n this.adapter_.setAttributeAtRowIndex(rowIndex, strings.ARIA_SELECTED, 'false');\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './constants';\nexport * from './types';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {FocusTrap} from '@material/dom/focus-trap';\nimport {closest, matches} from '@material/dom/ponyfill';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCDialogAdapter} from './adapter';\nimport {MDCDialogFoundation} from './foundation';\nimport {MDCDialogCloseEventDetail} from './types';\nimport * as util from './util';\nimport {MDCDialogFocusTrapFactory} from './util';\n\nconst {strings} = MDCDialogFoundation;\n\nexport class MDCDialog extends MDCComponent<MDCDialogFoundation> {\n get isOpen() {\n return this.foundation_.isOpen();\n }\n\n get escapeKeyAction() {\n return this.foundation_.getEscapeKeyAction();\n }\n\n set escapeKeyAction(action) {\n this.foundation_.setEscapeKeyAction(action);\n }\n\n get scrimClickAction() {\n return this.foundation_.getScrimClickAction();\n }\n\n set scrimClickAction(action) {\n this.foundation_.setScrimClickAction(action);\n }\n\n get autoStackButtons() {\n return this.foundation_.getAutoStackButtons();\n }\n\n set autoStackButtons(autoStack) {\n this.foundation_.setAutoStackButtons(autoStack);\n }\n\n static attachTo(root: Element) {\n return new MDCDialog(root);\n }\n\n private buttonRipples_!: MDCRipple[]; // assigned in initialize()\n private buttons_!: HTMLElement[]; // assigned in initialize()\n private container_!: HTMLElement; // assigned in initialize()\n private content_!: HTMLElement | null; // assigned in initialize()\n private defaultButton_!: HTMLElement | null; // assigned in initialize()\n\n private focusTrap_!: FocusTrap; // assigned in initialSyncWithDOM()\n private focusTrapFactory_!: MDCDialogFocusTrapFactory; // assigned in initialize()\n\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleDocumentKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleLayout_!: EventListener; // assigned in initialSyncWithDOM()\n private handleOpening_!: EventListener; // assigned in initialSyncWithDOM()\n private handleClosing_!: () => void; // assigned in initialSyncWithDOM()\n\n initialize(\n focusTrapFactory: MDCDialogFocusTrapFactory = (el, focusOptions) => new FocusTrap(el, focusOptions),\n ) {\n const container = this.root_.querySelector<HTMLElement>(strings.CONTAINER_SELECTOR);\n if (!container) {\n throw new Error(`Dialog component requires a ${strings.CONTAINER_SELECTOR} container element`);\n }\n this.container_ = container;\n this.content_ = this.root_.querySelector<HTMLElement>(strings.CONTENT_SELECTOR);\n this.buttons_ = [].slice.call(this.root_.querySelectorAll<HTMLElement>(strings.BUTTON_SELECTOR));\n this.defaultButton_ = this.root_.querySelector<HTMLElement>(`[${strings.BUTTON_DEFAULT_ATTRIBUTE}]`);\n this.focusTrapFactory_ = focusTrapFactory;\n this.buttonRipples_ = [];\n\n for (const buttonEl of this.buttons_) {\n this.buttonRipples_.push(new MDCRipple(buttonEl));\n }\n }\n\n initialSyncWithDOM() {\n this.focusTrap_ = util.createFocusTrapInstance(\n this.container_, this.focusTrapFactory_, this.getInitialFocusEl_() || undefined);\n\n this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);\n this.handleKeydown_ = this.foundation_.handleKeydown.bind(this.foundation_);\n this.handleDocumentKeydown_ = this.foundation_.handleDocumentKeydown.bind(this.foundation_);\n this.handleLayout_ = this.layout.bind(this);\n\n const LAYOUT_EVENTS = ['resize', 'orientationchange'];\n this.handleOpening_ = () => {\n LAYOUT_EVENTS.forEach((evtType) => window.addEventListener(evtType, this.handleLayout_));\n document.addEventListener('keydown', this.handleDocumentKeydown_);\n };\n this.handleClosing_ = () => {\n LAYOUT_EVENTS.forEach((evtType) => window.removeEventListener(evtType, this.handleLayout_));\n document.removeEventListener('keydown', this.handleDocumentKeydown_);\n };\n\n this.listen('click', this.handleClick_);\n this.listen('keydown', this.handleKeydown_);\n this.listen(strings.OPENING_EVENT, this.handleOpening_);\n this.listen(strings.CLOSING_EVENT, this.handleClosing_);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick_);\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten(strings.OPENING_EVENT, this.handleOpening_);\n this.unlisten(strings.CLOSING_EVENT, this.handleClosing_);\n this.handleClosing_();\n\n this.buttonRipples_.forEach((ripple) => ripple.destroy());\n super.destroy();\n }\n\n layout() {\n this.foundation_.layout();\n }\n\n open() {\n this.foundation_.open();\n }\n\n close(action = '') {\n this.foundation_.close(action);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCDialogAdapter = {\n addBodyClass: (className) => document.body.classList.add(className),\n addClass: (className) => this.root_.classList.add(className),\n areButtonsStacked: () => util.areTopsMisaligned(this.buttons_),\n clickDefaultButton: () => this.defaultButton_ && this.defaultButton_.click(),\n eventTargetMatches: (target, selector) => target ? matches(target as Element, selector) : false,\n getActionFromEvent: (evt: Event) => {\n if (!evt.target) {\n return '';\n }\n const element = closest(evt.target as Element, `[${strings.ACTION_ATTRIBUTE}]`);\n return element && element.getAttribute(strings.ACTION_ATTRIBUTE);\n },\n getInitialFocusEl: () => this.getInitialFocusEl_(),\n hasClass: (className) => this.root_.classList.contains(className),\n isContentScrollable: () => util.isScrollable(this.content_),\n notifyClosed: (action) => this.emit<MDCDialogCloseEventDetail>(strings.CLOSED_EVENT, action ? {action} : {}),\n notifyClosing: (action) => this.emit<MDCDialogCloseEventDetail>(strings.CLOSING_EVENT, action ? {action} : {}),\n notifyOpened: () => this.emit(strings.OPENED_EVENT, {}),\n notifyOpening: () => this.emit(strings.OPENING_EVENT, {}),\n releaseFocus: () => this.focusTrap_.releaseFocus(),\n removeBodyClass: (className) => document.body.classList.remove(className),\n removeClass: (className) => this.root_.classList.remove(className),\n reverseButtons: () => {\n this.buttons_.reverse();\n this.buttons_.forEach((button) => {\n button.parentElement!.appendChild(button);\n });\n },\n trapFocus: () => this.focusTrap_.trapFocus(),\n };\n return new MDCDialogFoundation(adapter);\n }\n\n private getInitialFocusEl_(): HTMLElement|null {\n return document.querySelector(`[${strings.INITIAL_FOCUS_ATTRIBUTE}]`);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n CLOSING: 'mdc-dialog--closing',\n OPEN: 'mdc-dialog--open',\n OPENING: 'mdc-dialog--opening',\n SCROLLABLE: 'mdc-dialog--scrollable',\n SCROLL_LOCK: 'mdc-dialog-scroll-lock',\n STACKED: 'mdc-dialog--stacked',\n};\n\nexport const strings = {\n ACTION_ATTRIBUTE: 'data-mdc-dialog-action',\n BUTTON_DEFAULT_ATTRIBUTE: 'data-mdc-dialog-button-default',\n BUTTON_SELECTOR: '.mdc-dialog__button',\n CLOSED_EVENT: 'MDCDialog:closed',\n CLOSE_ACTION: 'close',\n CLOSING_EVENT: 'MDCDialog:closing',\n CONTAINER_SELECTOR: '.mdc-dialog__container',\n CONTENT_SELECTOR: '.mdc-dialog__content',\n DESTROY_ACTION: 'destroy',\n INITIAL_FOCUS_ATTRIBUTE: 'data-mdc-dialog-initial-focus',\n OPENED_EVENT: 'MDCDialog:opened',\n OPENING_EVENT: 'MDCDialog:opening',\n SCRIM_SELECTOR: '.mdc-dialog__scrim',\n SUPPRESS_DEFAULT_PRESS_SELECTOR: [\n 'textarea',\n '.mdc-menu .mdc-list-item',\n ].join(', '),\n SURFACE_SELECTOR: '.mdc-dialog__surface',\n};\n\nexport const numbers = {\n DIALOG_ANIMATION_CLOSE_TIME_MS: 75,\n DIALOG_ANIMATION_OPEN_TIME_MS: 150,\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCDialogAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCDialogFoundation extends MDCFoundation<MDCDialogAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCDialogAdapter {\n return {\n addBodyClass: () => undefined,\n addClass: () => undefined,\n areButtonsStacked: () => false,\n clickDefaultButton: () => undefined,\n eventTargetMatches: () => false,\n getActionFromEvent: () => '',\n getInitialFocusEl: () => null,\n hasClass: () => false,\n isContentScrollable: () => false,\n notifyClosed: () => undefined,\n notifyClosing: () => undefined,\n notifyOpened: () => undefined,\n notifyOpening: () => undefined,\n releaseFocus: () => undefined,\n removeBodyClass: () => undefined,\n removeClass: () => undefined,\n reverseButtons: () => undefined,\n trapFocus: () => undefined,\n };\n }\n\n private isOpen_ = false;\n private animationFrame_ = 0;\n private animationTimer_ = 0;\n private layoutFrame_ = 0;\n private escapeKeyAction_ = strings.CLOSE_ACTION;\n private scrimClickAction_ = strings.CLOSE_ACTION;\n private autoStackButtons_ = true;\n private areButtonsStacked_ = false;\n\n constructor(adapter?: Partial<MDCDialogAdapter>) {\n super({...MDCDialogFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n if (this.adapter_.hasClass(cssClasses.STACKED)) {\n this.setAutoStackButtons(false);\n }\n }\n\n destroy() {\n if (this.isOpen_) {\n this.close(strings.DESTROY_ACTION);\n }\n\n if (this.animationTimer_) {\n clearTimeout(this.animationTimer_);\n this.handleAnimationTimerEnd_();\n }\n\n if (this.layoutFrame_) {\n cancelAnimationFrame(this.layoutFrame_);\n this.layoutFrame_ = 0;\n }\n }\n\n open() {\n this.isOpen_ = true;\n this.adapter_.notifyOpening();\n this.adapter_.addClass(cssClasses.OPENING);\n\n // Wait a frame once display is no longer \"none\", to establish basis for animation\n this.runNextAnimationFrame_(() => {\n this.adapter_.addClass(cssClasses.OPEN);\n this.adapter_.addBodyClass(cssClasses.SCROLL_LOCK);\n\n this.layout();\n\n this.animationTimer_ = setTimeout(() => {\n this.handleAnimationTimerEnd_();\n this.adapter_.trapFocus(this.adapter_.getInitialFocusEl());\n this.adapter_.notifyOpened();\n }, numbers.DIALOG_ANIMATION_OPEN_TIME_MS);\n });\n }\n\n close(action = '') {\n if (!this.isOpen_) {\n // Avoid redundant close calls (and events), e.g. from keydown on elements that inherently emit click\n return;\n }\n\n this.isOpen_ = false;\n this.adapter_.notifyClosing(action);\n this.adapter_.addClass(cssClasses.CLOSING);\n this.adapter_.removeClass(cssClasses.OPEN);\n this.adapter_.removeBodyClass(cssClasses.SCROLL_LOCK);\n\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = 0;\n\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(() => {\n this.adapter_.releaseFocus();\n this.handleAnimationTimerEnd_();\n this.adapter_.notifyClosed(action);\n }, numbers.DIALOG_ANIMATION_CLOSE_TIME_MS);\n }\n\n isOpen() {\n return this.isOpen_;\n }\n\n getEscapeKeyAction(): string {\n return this.escapeKeyAction_;\n }\n\n setEscapeKeyAction(action: string) {\n this.escapeKeyAction_ = action;\n }\n\n getScrimClickAction(): string {\n return this.scrimClickAction_;\n }\n\n setScrimClickAction(action: string) {\n this.scrimClickAction_ = action;\n }\n\n getAutoStackButtons(): boolean {\n return this.autoStackButtons_;\n }\n\n setAutoStackButtons(autoStack: boolean) {\n this.autoStackButtons_ = autoStack;\n }\n\n layout() {\n if (this.layoutFrame_) {\n cancelAnimationFrame(this.layoutFrame_);\n }\n this.layoutFrame_ = requestAnimationFrame(() => {\n this.layoutInternal_();\n this.layoutFrame_ = 0;\n });\n }\n\n /** Handles click on the dialog root element. */\n handleClick(evt: MouseEvent) {\n const isScrim = this.adapter_.eventTargetMatches(evt.target, strings.SCRIM_SELECTOR);\n // Check for scrim click first since it doesn't require querying ancestors.\n if (isScrim && this.scrimClickAction_ !== '') {\n this.close(this.scrimClickAction_);\n } else {\n const action = this.adapter_.getActionFromEvent(evt);\n if (action) {\n this.close(action);\n }\n }\n }\n\n /** Handles keydown on the dialog root element. */\n handleKeydown(evt: KeyboardEvent) {\n const isEnter = evt.key === 'Enter' || evt.keyCode === 13;\n if (!isEnter) {\n return;\n }\n const action = this.adapter_.getActionFromEvent(evt);\n if (action) {\n // Action button callback is handled in `handleClick`,\n // since space/enter keydowns on buttons trigger click events.\n return;\n }\n\n const isDefault = !this.adapter_.eventTargetMatches(\n evt.target, strings.SUPPRESS_DEFAULT_PRESS_SELECTOR);\n if (isEnter && isDefault) {\n this.adapter_.clickDefaultButton();\n }\n }\n\n /** Handles keydown on the document. */\n handleDocumentKeydown(evt: KeyboardEvent) {\n const isEscape = evt.key === 'Escape' || evt.keyCode === 27;\n if (isEscape && this.escapeKeyAction_ !== '') {\n this.close(this.escapeKeyAction_);\n }\n }\n\n private layoutInternal_() {\n if (this.autoStackButtons_) {\n this.detectStackedButtons_();\n }\n this.detectScrollableContent_();\n }\n\n private handleAnimationTimerEnd_() {\n this.animationTimer_ = 0;\n this.adapter_.removeClass(cssClasses.OPENING);\n this.adapter_.removeClass(cssClasses.CLOSING);\n }\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame_(callback: () => void) {\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = requestAnimationFrame(() => {\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(callback, 0);\n });\n }\n\n private detectStackedButtons_() {\n // Remove the class first to let us measure the buttons' natural positions.\n this.adapter_.removeClass(cssClasses.STACKED);\n\n const areButtonsStacked = this.adapter_.areButtonsStacked();\n\n if (areButtonsStacked) {\n this.adapter_.addClass(cssClasses.STACKED);\n }\n\n if (areButtonsStacked !== this.areButtonsStacked_) {\n this.adapter_.reverseButtons();\n this.areButtonsStacked_ = areButtonsStacked;\n }\n }\n\n private detectScrollableContent_() {\n // Remove the class first to let us measure the natural height of the content.\n this.adapter_.removeClass(cssClasses.SCROLLABLE);\n if (this.adapter_.isContentScrollable()) {\n this.adapter_.addClass(cssClasses.SCROLLABLE);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCDialogFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {FocusOptions, FocusTrap} from '@material/dom/focus-trap';\n\nexport type MDCDialogFocusTrapFactory = (\n element: HTMLElement,\n options: FocusOptions,\n) => FocusTrap;\n\nexport function createFocusTrapInstance(\n surfaceEl: HTMLElement,\n focusTrapFactory: MDCDialogFocusTrapFactory,\n initialFocusEl?: HTMLElement,\n): FocusTrap {\n return focusTrapFactory(surfaceEl, {initialFocusEl});\n}\n\nexport function isScrollable(el: HTMLElement | null): boolean {\n return el ? el.scrollHeight > el.offsetHeight : false;\n}\n\nexport function areTopsMisaligned(els: HTMLElement[]): boolean {\n const tops = new Set();\n [].forEach.call(els, (el: HTMLElement) => tops.add(el.offsetTop));\n return tops.size > 1;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Priorities for the announce function\n */\nexport enum AnnouncerPriority {\n POLITE = 'polite',\n ASSERTIVE = 'assertive',\n}\n\n/**\n * Announces the given message with optional priority, defaulting to \"polite\"\n */\nexport function announce(message: string, priority?: AnnouncerPriority) {\n Announcer.getInstance().say(message, priority);\n}\n\nclass Announcer {\n private static instance: Announcer;\n private readonly liveRegions: Map<AnnouncerPriority, Element>;\n\n static getInstance(): Announcer {\n if (!Announcer.instance) {\n Announcer.instance = new Announcer();\n }\n\n return Announcer.instance;\n }\n\n // Constructor made private to ensure only the singleton is used\n private constructor() {\n this.liveRegions = new Map();\n }\n\n say(message: string, priority: AnnouncerPriority = AnnouncerPriority.POLITE) {\n const liveRegion = this.getLiveRegion(priority);\n // Reset the region to pick up the message, even if the message is the\n // exact same as before.\n liveRegion.textContent = '';\n // Timeout is necessary for screen readers like NVDA and VoiceOver.\n setTimeout(() => {\n liveRegion.textContent = message;\n }, 1);\n }\n\n private getLiveRegion(priority: AnnouncerPriority): Element {\n const existingLiveRegion = this.liveRegions.get(priority);\n if (existingLiveRegion &&\n document.body.contains(existingLiveRegion as Node)) {\n return existingLiveRegion;\n }\n\n const liveRegion = this.createLiveRegion(priority);\n this.liveRegions.set(priority, liveRegion);\n return liveRegion;\n }\n\n private createLiveRegion(priority: AnnouncerPriority): Element {\n const el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.top = '-9999px';\n el.style.left = '-9999px';\n el.style.height = '1px';\n el.style.overflow = 'hidden';\n el.setAttribute('aria-atomic', 'true');\n el.setAttribute('aria-live', priority);\n document.body.appendChild(el);\n return el;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Determine whether the current browser supports passive event listeners, and\n * if so, use them.\n */\nexport function applyPassive(globalObj: Window = window):\n boolean | EventListenerOptions {\n return supportsPassiveOption(globalObj) ?\n {passive: true} as AddEventListenerOptions :\n false;\n}\n\nfunction supportsPassiveOption(globalObj: Window = window): boolean {\n // See\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n let passiveSupported = false;\n\n try {\n const options = {\n // This function will be called when the browser\n // attempts to access the passive property.\n get passive() {\n passiveSupported = true;\n return false;\n }\n };\n\n const handler = () => {};\n globalObj.document.addEventListener('test', handler, options);\n globalObj.document.removeEventListener(\n 'test', handler, options as EventListenerOptions);\n } catch (err) {\n passiveSupported = false;\n }\n\n return passiveSupported;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst FOCUS_SENTINEL_CLASS = 'mdc-dom-focus-sentinel';\n\n/**\n * Utility to trap focus in a given root element, e.g. for modal components such\n * as dialogs. The root should have at least one focusable child element,\n * for setting initial focus when trapping focus.\n * Also tracks the previously focused element, and restores focus to that\n * element when releasing focus.\n */\nexport class FocusTrap {\n // Previously focused element before trapping focus.\n private elFocusedBeforeTrapFocus: HTMLElement|null = null;\n\n constructor(\n private readonly root: HTMLElement,\n private readonly options: FocusOptions = {}) {}\n\n /**\n * Traps focus in `root`. Also focuses on either `initialFocusEl` if set;\n * otherwises sets initial focus to the first focusable child element.\n */\n trapFocus() {\n const focusableEls = this.getFocusableElements(this.root);\n if (focusableEls.length === 0) {\n throw new Error(\n 'FocusTrap: Element must have at least one focusable child.');\n }\n\n this.elFocusedBeforeTrapFocus =\n document.activeElement instanceof HTMLElement ? document.activeElement :\n null;\n this.wrapTabFocus(this.root, focusableEls);\n\n if (!this.options.skipInitialFocus) {\n this.focusInitialElement(focusableEls, this.options.initialFocusEl);\n }\n }\n\n /**\n * Releases focus from `root`. Also restores focus to the previously focused\n * element.\n */\n releaseFocus() {\n [].slice.call(this.root.querySelectorAll(`.${FOCUS_SENTINEL_CLASS}`))\n .forEach((sentinelEl: HTMLElement) => {\n sentinelEl.parentElement!.removeChild(sentinelEl);\n });\n\n if (this.elFocusedBeforeTrapFocus) {\n this.elFocusedBeforeTrapFocus.focus();\n }\n }\n\n /**\n * Wraps tab focus within `el` by adding two hidden sentinel divs which are\n * used to mark the beginning and the end of the tabbable region. When\n * focused, these sentinel elements redirect focus to the first/last\n * children elements of the tabbable region, ensuring that focus is trapped\n * within that region.\n */\n private wrapTabFocus(el: HTMLElement, focusableEls: HTMLElement[]) {\n const sentinelStart = this.createSentinel();\n const sentinelEnd = this.createSentinel();\n\n sentinelStart.addEventListener('focus', () => {\n if (focusableEls.length > 0) {\n focusableEls[focusableEls.length - 1].focus();\n }\n });\n sentinelEnd.addEventListener('focus', () => {\n if (focusableEls.length > 0) {\n focusableEls[0].focus();\n }\n });\n\n el.insertBefore(sentinelStart, el.children[0]);\n el.appendChild(sentinelEnd);\n }\n\n /**\n * Focuses on `initialFocusEl` if defined and a child of the root element.\n * Otherwise, focuses on the first focusable child element of the root.\n */\n private focusInitialElement(\n focusableEls: HTMLElement[], initialFocusEl?: HTMLElement) {\n let focusIndex = 0;\n if (initialFocusEl) {\n focusIndex = Math.max(focusableEls.indexOf(initialFocusEl), 0);\n }\n focusableEls[focusIndex].focus();\n }\n\n private getFocusableElements(root: HTMLElement): HTMLElement[] {\n const focusableEls =\n [].slice.call(root.querySelectorAll(\n '[autofocus], [tabindex], a, input, textarea, select, button')) as\n HTMLElement[];\n return focusableEls.filter((el) => {\n const isDisabledOrHidden = el.getAttribute('aria-disabled') === 'true' ||\n el.getAttribute('disabled') != null ||\n el.getAttribute('hidden') != null ||\n el.getAttribute('aria-hidden') === 'true';\n const isTabbableAndVisible = el.tabIndex >= 0 &&\n el.getBoundingClientRect().width > 0 &&\n !el.classList.contains(FOCUS_SENTINEL_CLASS) && !isDisabledOrHidden;\n\n let isProgrammaticallyHidden = false;\n if (isTabbableAndVisible) {\n const style = getComputedStyle(el);\n isProgrammaticallyHidden =\n style.display === 'none' || style.visibility === 'hidden';\n }\n return isTabbableAndVisible && !isProgrammaticallyHidden;\n });\n }\n\n private createSentinel() {\n const sentinel = document.createElement('div');\n sentinel.setAttribute('tabindex', '0');\n // Don't announce in screen readers.\n sentinel.setAttribute('aria-hidden', 'true');\n sentinel.classList.add(FOCUS_SENTINEL_CLASS);\n return sentinel;\n }\n}\n\n/** Customization options. */\nexport interface FocusOptions {\n // The element to focus initially when trapping focus.\n // Must be a child of the root element.\n initialFocusEl?: HTMLElement;\n\n // Whether to skip initially focusing on any element when trapping focus.\n // By default, focus is set on the first focusable child element of the root.\n // This is useful if the caller wants to handle setting initial focus.\n skipInitialFocus?: boolean;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as events from './events';\nimport * as focusTrap from './focus-trap';\nimport * as ponyfill from './ponyfill';\n\nexport {events, focusTrap, ponyfill};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global prototype chain.\n * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.\n */\n\nexport function closest(element: Element, selector: string): Element | null {\n if (element.closest) {\n return element.closest(selector);\n }\n\n let el: Element | null = element;\n while (el) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n}\n\nexport function matches(element: Element, selector: string): boolean {\n const nativeMatches = element.matches\n || element.webkitMatchesSelector\n || element.msMatchesSelector;\n return nativeMatches.call(element, selector);\n}\n\n/**\n * Used to compute the estimated scroll width of elements. When an element is\n * hidden due to display: none; being applied to a parent element, the width is\n * returned as 0. However, the element will have a true width once no longer\n * inside a display: none context. This method computes an estimated width when\n * the element is hidden or returns the true width when the element is visble.\n * @param {Element} element the element whose width to estimate\n */\nexport function estimateScrollWidth(element: Element): number {\n // Check the offsetParent. If the element inherits display: none from any\n // parent, the offsetParent property will be null (see\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent).\n // This check ensures we only clone the node when necessary.\n const htmlEl = element as HTMLElement;\n if (htmlEl.offsetParent !== null) {\n return htmlEl.scrollWidth;\n }\n\n const clone = htmlEl.cloneNode(true) as HTMLElement;\n clone.style.setProperty('position', 'absolute');\n clone.style.setProperty('transform', 'translate(-9999px, -9999px)');\n document.documentElement.appendChild(clone);\n const scrollWidth = clone.scrollWidth;\n document.documentElement.removeChild(clone);\n return scrollWidth;\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {FocusTrap} from '@material/dom/focus-trap';\nimport {MDCList, MDCListFactory} from '@material/list/component';\nimport {MDCListFoundation} from '@material/list/foundation';\nimport {MDCDrawerAdapter} from './adapter';\nimport {MDCDismissibleDrawerFoundation} from './dismissible/foundation';\nimport {MDCModalDrawerFoundation} from './modal/foundation';\nimport * as util from './util';\nimport {MDCDrawerFocusTrapFactory} from './util';\n\nconst {cssClasses, strings} = MDCDismissibleDrawerFoundation;\n\n/**\n * @events `MDCDrawer:closed {}` Emits when the navigation drawer has closed.\n * @events `MDCDrawer:opened {}` Emits when the navigation drawer has opened.\n */\nexport class MDCDrawer extends MDCComponent<MDCDismissibleDrawerFoundation> {\n static attachTo(root: Element): MDCDrawer {\n return new MDCDrawer(root);\n }\n\n /**\n * @return boolean Proxies to the foundation's `open`/`close` methods.\n * Also returns true if drawer is in the open position.\n */\n get open(): boolean {\n return this.foundation_.isOpen();\n }\n\n /**\n * Toggles the drawer open and closed.\n */\n set open(isOpen: boolean) {\n if (isOpen) {\n this.foundation_.open();\n } else {\n this.foundation_.close();\n }\n }\n\n private previousFocus_?: Element | null;\n private scrim_!: HTMLElement | null; // assigned in initialSyncWithDOM()\n private list_?: MDCList; // assigned in initialize()\n\n private focusTrap_?: FocusTrap; // assigned in initialSyncWithDOM()\n private focusTrapFactory_!: MDCDrawerFocusTrapFactory; // assigned in initialize()\n\n private handleScrimClick_?: SpecificEventListener<'click'>; // initialized in initialSyncWithDOM()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // initialized in initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // initialized in initialSyncWithDOM()\n\n get list(): MDCList | undefined {\n return this.list_;\n }\n\n initialize(\n focusTrapFactory: MDCDrawerFocusTrapFactory = (el) => new FocusTrap(el),\n listFactory: MDCListFactory = (el) => new MDCList(el),\n ) {\n const listEl = this.root_.querySelector(`.${MDCListFoundation.cssClasses.ROOT}`);\n if (listEl) {\n this.list_ = listFactory(listEl);\n this.list_.wrapFocus = true;\n }\n this.focusTrapFactory_ = focusTrapFactory;\n }\n\n initialSyncWithDOM() {\n const {MODAL} = cssClasses;\n const {SCRIM_SELECTOR} = strings;\n\n this.scrim_ = (this.root_.parentNode as Element).querySelector<HTMLElement>(SCRIM_SELECTOR);\n\n if (this.scrim_ && this.root_.classList.contains(MODAL)) {\n this.handleScrimClick_ = () => (this.foundation_ as MDCModalDrawerFoundation).handleScrimClick();\n this.scrim_.addEventListener('click', this.handleScrimClick_);\n this.focusTrap_ = util.createFocusTrapInstance(this.root_ as HTMLElement, this.focusTrapFactory_);\n }\n\n this.handleKeydown_ = (evt) => this.foundation_.handleKeydown(evt);\n this.handleTransitionEnd_ = (evt) => this.foundation_.handleTransitionEnd(evt);\n\n this.listen('keydown', this.handleKeydown_);\n this.listen('transitionend', this.handleTransitionEnd_);\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten('transitionend', this.handleTransitionEnd_);\n\n if (this.list_) {\n this.list_.destroy();\n }\n\n const {MODAL} = cssClasses;\n if (this.scrim_ && this.handleScrimClick_ && this.root_.classList.contains(MODAL)) {\n this.scrim_.removeEventListener('click', this.handleScrimClick_);\n // Ensure drawer is closed to hide scrim and release focus\n this.open = false;\n }\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCDrawerAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n hasClass: (className) => this.root_.classList.contains(className),\n elementHasClass: (element, className) => element.classList.contains(className),\n saveFocus: () => this.previousFocus_ = document.activeElement,\n restoreFocus: () => {\n const previousFocus = this.previousFocus_ as HTMLOrSVGElement | null;\n if (previousFocus && previousFocus.focus && this.root_.contains(document.activeElement)) {\n previousFocus.focus();\n }\n },\n focusActiveNavigationItem: () => {\n const activeNavItemEl =\n this.root_.querySelector<HTMLElement>(`.${MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS}`);\n if (activeNavItemEl) {\n activeNavItemEl.focus();\n }\n },\n notifyClose: () => this.emit(strings.CLOSE_EVENT, {}, true /* shouldBubble */),\n notifyOpen: () => this.emit(strings.OPEN_EVENT, {}, true /* shouldBubble */),\n trapFocus: () => this.focusTrap_!.trapFocus(),\n releaseFocus: () => this.focusTrap_!.releaseFocus(),\n };\n // tslint:enable:object-literal-sort-keys\n\n const {DISMISSIBLE, MODAL} = cssClasses;\n if (this.root_.classList.contains(DISMISSIBLE)) {\n return new MDCDismissibleDrawerFoundation(adapter);\n } else if (this.root_.classList.contains(MODAL)) {\n return new MDCModalDrawerFoundation(adapter);\n } else {\n throw new Error(\n `MDCDrawer: Failed to instantiate component. Supported variants are ${DISMISSIBLE} and ${MODAL}.`);\n }\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANIMATE: 'mdc-drawer--animate',\n CLOSING: 'mdc-drawer--closing',\n DISMISSIBLE: 'mdc-drawer--dismissible',\n MODAL: 'mdc-drawer--modal',\n OPEN: 'mdc-drawer--open',\n OPENING: 'mdc-drawer--opening',\n ROOT: 'mdc-drawer',\n};\n\nconst strings = {\n APP_CONTENT_SELECTOR: '.mdc-drawer-app-content',\n CLOSE_EVENT: 'MDCDrawer:closed',\n OPEN_EVENT: 'MDCDrawer:opened',\n SCRIM_SELECTOR: '.mdc-drawer-scrim',\n};\n\nexport {cssClasses, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCDrawerAdapter} from '../adapter';\nimport {cssClasses, strings} from '../constants';\n\nexport class MDCDismissibleDrawerFoundation extends MDCFoundation<MDCDrawerAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCDrawerAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n elementHasClass: () => false,\n notifyClose: () => undefined,\n notifyOpen: () => undefined,\n saveFocus: () => undefined,\n restoreFocus: () => undefined,\n focusActiveNavigationItem: () => undefined,\n trapFocus: () => undefined,\n releaseFocus: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private animationFrame_ = 0;\n private animationTimer_ = 0;\n\n constructor(adapter?: Partial<MDCDrawerAdapter>) {\n super({...MDCDismissibleDrawerFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n if (this.animationFrame_) {\n cancelAnimationFrame(this.animationFrame_);\n }\n if (this.animationTimer_) {\n clearTimeout(this.animationTimer_);\n }\n }\n\n /**\n * Opens the drawer from the closed state.\n */\n open() {\n if (this.isOpen() || this.isOpening() || this.isClosing()) {\n return;\n }\n\n this.adapter_.addClass(cssClasses.OPEN);\n this.adapter_.addClass(cssClasses.ANIMATE);\n\n // Wait a frame once display is no longer \"none\", to establish basis for animation\n this.runNextAnimationFrame_(() => {\n this.adapter_.addClass(cssClasses.OPENING);\n });\n\n this.adapter_.saveFocus();\n }\n\n /**\n * Closes the drawer from the open state.\n */\n close() {\n if (!this.isOpen() || this.isOpening() || this.isClosing()) {\n return;\n }\n\n this.adapter_.addClass(cssClasses.CLOSING);\n }\n\n /**\n * Returns true if the drawer is in the open position.\n * @return true if drawer is in open state.\n */\n isOpen(): boolean {\n return this.adapter_.hasClass(cssClasses.OPEN);\n }\n\n /**\n * Returns true if the drawer is animating open.\n * @return true if drawer is animating open.\n */\n isOpening(): boolean {\n return this.adapter_.hasClass(cssClasses.OPENING) || this.adapter_.hasClass(cssClasses.ANIMATE);\n }\n\n /**\n * Returns true if the drawer is animating closed.\n * @return true if drawer is animating closed.\n */\n isClosing(): boolean {\n return this.adapter_.hasClass(cssClasses.CLOSING);\n }\n\n /**\n * Keydown handler to close drawer when key is escape.\n */\n handleKeydown(evt: KeyboardEvent) {\n const {keyCode, key} = evt;\n const isEscape = key === 'Escape' || keyCode === 27;\n if (isEscape) {\n this.close();\n }\n }\n\n /**\n * Handles the `transitionend` event when the drawer finishes opening/closing.\n */\n handleTransitionEnd(evt: TransitionEvent) {\n const {OPENING, CLOSING, OPEN, ANIMATE, ROOT} = cssClasses;\n\n // In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first.\n const isRootElement = this.isElement_(evt.target) && this.adapter_.elementHasClass(evt.target, ROOT);\n if (!isRootElement) {\n return;\n }\n\n if (this.isClosing()) {\n this.adapter_.removeClass(OPEN);\n this.closed_();\n this.adapter_.restoreFocus();\n this.adapter_.notifyClose();\n } else {\n this.adapter_.focusActiveNavigationItem();\n this.opened_();\n this.adapter_.notifyOpen();\n }\n\n this.adapter_.removeClass(ANIMATE);\n this.adapter_.removeClass(OPENING);\n this.adapter_.removeClass(CLOSING);\n }\n\n /**\n * Extension point for when drawer finishes open animation.\n */\n protected opened_() {} // tslint:disable-line:no-empty\n\n /**\n * Extension point for when drawer finishes close animation.\n */\n protected closed_() {} // tslint:disable-line:no-empty\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame_(callback: () => void) {\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = requestAnimationFrame(() => {\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(callback, 0);\n });\n }\n\n private isElement_(element: unknown): element is Element {\n // In Edge, transitionend on ripple pseudo-elements yields a target without classList.\n return Boolean((element as Element).classList);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCDismissibleDrawerFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './dismissible/foundation';\nexport * from './modal/foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCDismissibleDrawerFoundation} from '../dismissible/foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCModalDrawerFoundation extends MDCDismissibleDrawerFoundation {\n /**\n * Handles click event on scrim.\n */\n handleScrimClick() {\n this.close();\n }\n\n /**\n * Called when drawer finishes open animation.\n */\n protected opened_() {\n this.adapter_.trapFocus();\n }\n\n /**\n * Called when drawer finishes close animation.\n */\n protected closed_() {\n this.adapter_.releaseFocus();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCModalDrawerFoundation;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {FocusOptions, FocusTrap} from '@material/dom/focus-trap';\n\nexport type MDCDrawerFocusTrapFactory = (\n element: HTMLElement,\n options: FocusOptions,\n) => FocusTrap;\n\nexport function createFocusTrapInstance(\n surfaceEl: HTMLElement,\n focusTrapFactory: MDCDrawerFocusTrapFactory,\n): FocusTrap {\n return focusTrapFactory(surfaceEl, {\n // Component handles focusing on active nav item.\n skipInitialFocus: true, \n });\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {estimateScrollWidth} from '@material/dom/ponyfill';\nimport {MDCFloatingLabelAdapter} from './adapter';\nimport {MDCFloatingLabelFoundation} from './foundation';\n\nexport type MDCFloatingLabelFactory = (el: Element, foundation?: MDCFloatingLabelFoundation) => MDCFloatingLabel;\n\nexport class MDCFloatingLabel extends MDCComponent<MDCFloatingLabelFoundation> {\n static attachTo(root: Element): MDCFloatingLabel {\n return new MDCFloatingLabel(root);\n }\n\n /**\n * Styles the label to produce the label shake for errors.\n * @param shouldShake If true, shakes the label by adding a CSS class; otherwise, stops shaking by removing the class.\n */\n shake(shouldShake: boolean) {\n this.foundation_.shake(shouldShake);\n }\n\n /**\n * Styles the label to float/dock.\n * @param shouldFloat If true, floats the label by adding a CSS class; otherwise, docks it by removing the class.\n */\n float(shouldFloat: boolean) {\n this.foundation_.float(shouldFloat);\n }\n\n getWidth(): number {\n return this.foundation_.getWidth();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCFloatingLabelAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n getWidth: () => estimateScrollWidth(this.root_),\n registerInteractionHandler: (evtType, handler) =>\n this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) =>\n this.unlisten(evtType, handler),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCFloatingLabelFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',\n LABEL_SHAKE: 'mdc-floating-label--shake',\n ROOT: 'mdc-floating-label',\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCFloatingLabelAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\nexport class MDCFloatingLabelFoundation extends MDCFoundation<MDCFloatingLabelAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCFloatingLabelAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n getWidth: () => 0,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly shakeAnimationEndHandler_: SpecificEventListener<'animationend'>;\n\n constructor(adapter?: Partial<MDCFloatingLabelAdapter>) {\n super({...MDCFloatingLabelFoundation.defaultAdapter, ...adapter});\n\n this.shakeAnimationEndHandler_ = () => this.handleShakeAnimationEnd_();\n }\n\n init() {\n this.adapter_.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_);\n }\n\n destroy() {\n this.adapter_.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_);\n }\n\n /**\n * Returns the width of the label element.\n */\n getWidth(): number {\n return this.adapter_.getWidth();\n }\n\n /**\n * Styles the label to produce a shake animation to indicate an error.\n * @param shouldShake If true, adds the shake CSS class; otherwise, removes shake class.\n */\n shake(shouldShake: boolean) {\n const {LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n if (shouldShake) {\n this.adapter_.addClass(LABEL_SHAKE);\n } else {\n this.adapter_.removeClass(LABEL_SHAKE);\n }\n }\n\n /**\n * Styles the label to float or dock.\n * @param shouldFloat If true, adds the float CSS class; otherwise, removes float and shake classes to dock the label.\n */\n float(shouldFloat: boolean) {\n const {LABEL_FLOAT_ABOVE, LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n if (shouldFloat) {\n this.adapter_.addClass(LABEL_FLOAT_ABOVE);\n } else {\n this.adapter_.removeClass(LABEL_FLOAT_ABOVE);\n this.adapter_.removeClass(LABEL_SHAKE);\n }\n }\n\n private handleShakeAnimationEnd_() {\n const {LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n this.adapter_.removeClass(LABEL_SHAKE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFloatingLabelFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCFormFieldAdapter} from './adapter';\nimport {MDCFormFieldFoundation} from './foundation';\n\nexport interface MDCFormFieldInput {\n readonly ripple: MDCRipple | undefined;\n}\n\nexport class MDCFormField extends MDCComponent<MDCFormFieldFoundation> {\n static attachTo(root: HTMLElement) {\n return new MDCFormField(root);\n }\n\n private input_?: MDCFormFieldInput;\n\n set input(input: MDCFormFieldInput | undefined) {\n this.input_ = input;\n }\n\n get input(): MDCFormFieldInput | undefined {\n return this.input_;\n }\n\n private get label_(): Element | null {\n const {LABEL_SELECTOR} = MDCFormFieldFoundation.strings;\n return this.root_.querySelector(LABEL_SELECTOR);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCFormFieldAdapter = {\n activateInputRipple: () => {\n if (this.input_ && this.input_.ripple) {\n this.input_.ripple.activate();\n }\n },\n deactivateInputRipple: () => {\n if (this.input_ && this.input_.ripple) {\n this.input_.ripple.deactivate();\n }\n },\n deregisterInteractionHandler: (evtType, handler) => {\n if (this.label_) {\n (this.label_ as HTMLElement).removeEventListener(evtType, handler);\n }\n },\n registerInteractionHandler: (evtType, handler) => {\n if (this.label_) {\n (this.label_ as HTMLElement).addEventListener(evtType, handler);\n }\n },\n };\n return new MDCFormFieldFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ROOT: 'mdc-form-field',\n};\n\nexport const strings = {\n LABEL_SELECTOR: '.mdc-form-field > label',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCFormFieldAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCFormFieldFoundation extends MDCFoundation<MDCFormFieldAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCFormFieldAdapter {\n return {\n activateInputRipple: () => undefined,\n deactivateInputRipple: () => undefined,\n deregisterInteractionHandler: () => undefined,\n registerInteractionHandler: () => undefined,\n };\n }\n\n private readonly clickHandler_: () => void;\n\n constructor(adapter?: Partial<MDCFormFieldAdapter>) {\n super({...MDCFormFieldFoundation.defaultAdapter, ...adapter});\n\n this.clickHandler_ = () => this.handleClick_();\n }\n\n init() {\n this.adapter_.registerInteractionHandler('click', this.clickHandler_);\n }\n\n destroy() {\n this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);\n }\n\n private handleClick_() {\n this.adapter_.activateInputRipple();\n requestAnimationFrame(() => this.adapter_.deactivateInputRipple());\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFormFieldFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCIconButtonToggleAdapter} from './adapter';\nimport {MDCIconButtonToggleFoundation} from './foundation';\nimport {MDCIconButtonToggleEventDetail} from './types';\n\nconst {strings} = MDCIconButtonToggleFoundation;\n\nexport class MDCIconButtonToggle extends MDCComponent<MDCIconButtonToggleFoundation> {\n static attachTo(root: HTMLElement) {\n return new MDCIconButtonToggle(root);\n }\n\n protected root_!: HTMLElement; // assigned in MDCComponent constructor\n\n private readonly ripple_: MDCRipple = this.createRipple_();\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.handleClick_ = () => this.foundation_.handleClick();\n this.listen('click', this.handleClick_);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick_);\n this.ripple_.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCIconButtonToggleAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n hasClass: (className) => this.root_.classList.contains(className),\n notifyChange: (evtData) => this.emit<MDCIconButtonToggleEventDetail>(strings.CHANGE_EVENT, evtData),\n removeClass: (className) => this.root_.classList.remove(className),\n setAttr: (attrName, attrValue) => this.root_.setAttribute(attrName, attrValue),\n };\n return new MDCIconButtonToggleFoundation(adapter);\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n get on(): boolean {\n return this.foundation_.isOn();\n }\n\n set on(isOn: boolean) {\n this.foundation_.toggle(isOn);\n }\n\n private createRipple_(): MDCRipple {\n const ripple = new MDCRipple(this.root_);\n ripple.unbounded = true;\n return ripple;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ICON_BUTTON_ON: 'mdc-icon-button--on',\n ROOT: 'mdc-icon-button',\n};\n\nexport const strings = {\n ARIA_PRESSED: 'aria-pressed',\n CHANGE_EVENT: 'MDCIconButtonToggle:change',\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCIconButtonToggleAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCIconButtonToggleFoundation extends MDCFoundation<MDCIconButtonToggleAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCIconButtonToggleAdapter {\n return {\n addClass: () => undefined,\n hasClass: () => false,\n notifyChange: () => undefined,\n removeClass: () => undefined,\n setAttr: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCIconButtonToggleAdapter>) {\n super({...MDCIconButtonToggleFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.adapter_.setAttr(strings.ARIA_PRESSED, `${this.isOn()}`);\n }\n\n handleClick() {\n this.toggle();\n this.adapter_.notifyChange({isOn: this.isOn()});\n }\n\n isOn(): boolean {\n return this.adapter_.hasClass(cssClasses.ICON_BUTTON_ON);\n }\n\n toggle(isOn: boolean = !this.isOn()) {\n if (isOn) {\n this.adapter_.addClass(cssClasses.ICON_BUTTON_ON);\n } else {\n this.adapter_.removeClass(cssClasses.ICON_BUTTON_ON);\n }\n\n this.adapter_.setAttr(strings.ARIA_PRESSED, `${isOn}`);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCIconButtonToggleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCLineRippleAdapter} from './adapter';\nimport {MDCLineRippleFoundation} from './foundation';\n\nexport type MDCLineRippleFactory = (el: Element, foundation?: MDCLineRippleFoundation) => MDCLineRipple;\n\nexport class MDCLineRipple extends MDCComponent<MDCLineRippleFoundation> {\n static attachTo(root: Element): MDCLineRipple {\n return new MDCLineRipple(root);\n }\n\n /**\n * Activates the line ripple\n */\n activate() {\n this.foundation_.activate();\n }\n\n /**\n * Deactivates the line ripple\n */\n deactivate() {\n this.foundation_.deactivate();\n }\n\n /**\n * Sets the transform origin given a user's click location.\n * The `rippleCenter` is the x-coordinate of the middle of the ripple.\n */\n setRippleCenter(xCoordinate: number) {\n this.foundation_.setRippleCenter(xCoordinate);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCLineRippleAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n hasClass: (className) => this.root_.classList.contains(className),\n setStyle: (propertyName, value) => (this.root_ as HTMLElement).style.setProperty(propertyName, value),\n registerEventHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterEventHandler: (evtType, handler) => this.unlisten(evtType, handler),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCLineRippleFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',\n LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating',\n};\n\nexport {cssClasses};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCLineRippleAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\nexport class MDCLineRippleFoundation extends MDCFoundation<MDCLineRippleAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCLineRippleAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCLineRippleAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setStyle: () => undefined,\n registerEventHandler: () => undefined,\n deregisterEventHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly transitionEndHandler_: SpecificEventListener<'transitionend'>;\n\n constructor(adapter?: Partial<MDCLineRippleAdapter>) {\n super({...MDCLineRippleFoundation.defaultAdapter, ...adapter});\n\n this.transitionEndHandler_ = (evt) => this.handleTransitionEnd(evt);\n }\n\n init() {\n this.adapter_.registerEventHandler('transitionend', this.transitionEndHandler_);\n }\n\n destroy() {\n this.adapter_.deregisterEventHandler('transitionend', this.transitionEndHandler_);\n }\n\n activate() {\n this.adapter_.removeClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n this.adapter_.addClass(cssClasses.LINE_RIPPLE_ACTIVE);\n }\n\n setRippleCenter(xCoordinate: number) {\n this.adapter_.setStyle('transform-origin', `${xCoordinate}px center`);\n }\n\n deactivate() {\n this.adapter_.addClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n }\n\n handleTransitionEnd(evt: TransitionEvent) {\n // Wait for the line ripple to be either transparent or opaque\n // before emitting the animation end event\n const isDeactivating = this.adapter_.hasClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n\n if (evt.propertyName === 'opacity') {\n if (isDeactivating) {\n this.adapter_.removeClass(cssClasses.LINE_RIPPLE_ACTIVE);\n this.adapter_.removeClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n }\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCLineRippleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCProgressIndicator} from '@material/progress-indicator/component';\nimport {MDCLinearProgressAdapter} from './adapter';\nimport {MDCLinearProgressFoundation} from './foundation';\n\nexport class MDCLinearProgress extends\n MDCComponent<MDCLinearProgressFoundation> implements MDCProgressIndicator {\n static attachTo(root: Element) {\n return new MDCLinearProgress(root);\n }\n\n set determinate(value: boolean) {\n this.foundation_.setDeterminate(value);\n }\n\n set progress(value: number) {\n this.foundation_.setProgress(value);\n }\n\n set buffer(value: number) {\n this.foundation_.setBuffer(value);\n }\n\n set reverse(value: boolean) {\n this.foundation_.setReverse(value);\n }\n\n open() {\n this.foundation_.open();\n }\n\n close() {\n this.foundation_.close();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCLinearProgressAdapter = {\n addClass: (className: string) => this.root_.classList.add(className),\n forceLayout: () => (this.root_ as HTMLElement).offsetWidth,\n getBuffer: () => this.root_.querySelector(MDCLinearProgressFoundation.strings.BUFFER_SELECTOR),\n getPrimaryBar: () => this.root_.querySelector(MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR),\n hasClass: (className: string) => this.root_.classList.contains(className),\n removeAttribute: (attributeName: string) => {\n this.root_.removeAttribute(attributeName);\n },\n removeClass: (className: string) => this.root_.classList.remove(className),\n setAttribute: (attributeName: string, value: string) => {\n this.root_.setAttribute(attributeName, value);\n },\n setStyle: (el: HTMLElement, styleProperty: string, value: string) => el.style.setProperty(styleProperty, value),\n };\n return new MDCLinearProgressFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n CLOSED_CLASS: 'mdc-linear-progress--closed',\n INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',\n REVERSED_CLASS: 'mdc-linear-progress--reversed',\n};\n\nexport const strings = {\n ARIA_VALUENOW: 'aria-valuenow',\n BUFFER_SELECTOR: '.mdc-linear-progress__buffer',\n PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectPropertyName} from '@material/animation/util';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCProgressIndicatorFoundation} from '@material/progress-indicator/foundation';\nimport {MDCLinearProgressAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCLinearProgressFoundation extends\n MDCFoundation<MDCLinearProgressAdapter> implements\n MDCProgressIndicatorFoundation {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCLinearProgressAdapter {\n return {\n addClass: () => undefined,\n forceLayout: () => undefined,\n getBuffer: () => null,\n getPrimaryBar: () => null,\n hasClass: () => false,\n removeAttribute: () => undefined,\n removeClass: () => undefined,\n setAttribute: () => undefined,\n setStyle: () => undefined,\n };\n }\n\n private isDeterminate_!: boolean;\n private isReversed_!: boolean;\n private progress_!: number;\n private buffer_!: number;\n\n constructor(adapter?: Partial<MDCLinearProgressAdapter>) {\n super({...MDCLinearProgressFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.isDeterminate_ = !this.adapter_.hasClass(cssClasses.INDETERMINATE_CLASS);\n this.isReversed_ = this.adapter_.hasClass(cssClasses.REVERSED_CLASS);\n this.progress_ = 0;\n this.buffer_ = 1;\n }\n\n setDeterminate(isDeterminate: boolean) {\n this.isDeterminate_ = isDeterminate;\n\n if (this.isDeterminate_) {\n this.adapter_.removeClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter_.setAttribute(strings.ARIA_VALUENOW, this.progress_.toString());\n this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);\n this.setScale_(this.adapter_.getBuffer(), this.buffer_);\n } else {\n if (this.isReversed_) {\n // Adding/removing REVERSED_CLASS starts a translate animation, while\n // adding INDETERMINATE_CLASS starts a scale animation. Here, we reset\n // the translate animation in order to keep it in sync with the new\n // scale animation that will start from adding INDETERMINATE_CLASS\n // below.\n this.adapter_.removeClass(cssClasses.REVERSED_CLASS);\n this.adapter_.forceLayout();\n this.adapter_.addClass(cssClasses.REVERSED_CLASS);\n }\n\n this.adapter_.addClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter_.removeAttribute(strings.ARIA_VALUENOW);\n this.setScale_(this.adapter_.getPrimaryBar(), 1);\n this.setScale_(this.adapter_.getBuffer(), 1);\n }\n }\n\n setProgress(value: number) {\n this.progress_ = value;\n if (this.isDeterminate_) {\n this.setScale_(this.adapter_.getPrimaryBar(), value);\n this.adapter_.setAttribute(strings.ARIA_VALUENOW, value.toString());\n }\n }\n\n setBuffer(value: number) {\n this.buffer_ = value;\n if (this.isDeterminate_) {\n this.setScale_(this.adapter_.getBuffer(), value);\n }\n }\n\n setReverse(isReversed: boolean) {\n this.isReversed_ = isReversed;\n\n if (!this.isDeterminate_) {\n // Adding INDETERMINATE_CLASS starts a scale animation, while\n // adding/removing REVERSED_CLASS starts a translate animation. Here, we\n // reset the scale animation in order to keep it in sync with the new\n // translate animation that will start from adding/removing REVERSED_CLASS\n // below.\n this.adapter_.removeClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter_.forceLayout();\n this.adapter_.addClass(cssClasses.INDETERMINATE_CLASS);\n }\n\n if (this.isReversed_) {\n this.adapter_.addClass(cssClasses.REVERSED_CLASS);\n } else {\n this.adapter_.removeClass(cssClasses.REVERSED_CLASS);\n }\n }\n\n open() {\n this.adapter_.removeClass(cssClasses.CLOSED_CLASS);\n }\n\n close() {\n this.adapter_.addClass(cssClasses.CLOSED_CLASS);\n }\n\n private setScale_(el: HTMLElement | null, scaleValue: number) {\n if (!el) {\n return;\n }\n const value = `scaleX(${scaleValue})`;\n this.adapter_.setStyle(el, getCorrectPropertyName(window, 'transform'), value);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCLinearProgressFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest, matches} from '@material/dom/ponyfill';\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCListFoundation} from './foundation';\nimport {MDCListActionEventDetail, MDCListIndex} from './types';\n\nexport type MDCListFactory = (el: Element, foundation?: MDCListFoundation) => MDCList;\n\nexport class MDCList extends MDCComponent<MDCListFoundation> {\n set vertical(value: boolean) {\n this.foundation_.setVerticalOrientation(value);\n }\n\n get listElements(): Element[] {\n return [].slice.call(this.root_.querySelectorAll(`.${cssClasses.LIST_ITEM_CLASS}`));\n }\n\n set wrapFocus(value: boolean) {\n this.foundation_.setWrapFocus(value);\n }\n\n set singleSelection(isSingleSelectionList: boolean) {\n this.foundation_.setSingleSelection(isSingleSelectionList);\n }\n\n get selectedIndex(): MDCListIndex {\n return this.foundation_.getSelectedIndex();\n }\n\n set selectedIndex(index: MDCListIndex) {\n this.foundation_.setSelectedIndex(index);\n }\n\n static attachTo(root: Element) {\n return new MDCList(root);\n }\n\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private focusInEventListener_!: SpecificEventListener<'focus'>; // assigned in initialSyncWithDOM()\n private focusOutEventListener_!: SpecificEventListener<'focus'>; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.handleClick_ = this.handleClickEvent_.bind(this);\n this.handleKeydown_ = this.handleKeydownEvent_.bind(this);\n this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);\n this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);\n this.listen('keydown', this.handleKeydown_);\n this.listen('click', this.handleClick_);\n this.listen('focusin', this.focusInEventListener_);\n this.listen('focusout', this.focusOutEventListener_);\n this.layout();\n this.initializeListType();\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten('click', this.handleClick_);\n this.unlisten('focusin', this.focusInEventListener_);\n this.unlisten('focusout', this.focusOutEventListener_);\n }\n\n layout() {\n const direction = this.root_.getAttribute(strings.ARIA_ORIENTATION);\n this.vertical = direction !== strings.ARIA_ORIENTATION_HORIZONTAL;\n\n // List items need to have at least tabindex=-1 to be focusable.\n [].slice.call(this.root_.querySelectorAll('.mdc-list-item:not([tabindex])'))\n .forEach((el: Element) => {\n el.setAttribute('tabindex', '-1');\n });\n\n // Child button/a elements are not tabbable until the list item is focused.\n [].slice.call(this.root_.querySelectorAll(strings.FOCUSABLE_CHILD_ELEMENTS))\n .forEach((el: Element) => el.setAttribute('tabindex', '-1'));\n\n this.foundation_.layout();\n }\n\n /**\n * Initialize selectedIndex value based on pre-selected checkbox list items, single selection or radio.\n */\n initializeListType() {\n const checkboxListItems = this.root_.querySelectorAll(strings.ARIA_ROLE_CHECKBOX_SELECTOR);\n const singleSelectedListItem = this.root_.querySelector(`\n .${cssClasses.LIST_ITEM_ACTIVATED_CLASS},\n .${cssClasses.LIST_ITEM_SELECTED_CLASS}\n `);\n const radioSelectedListItem = this.root_.querySelector(strings.ARIA_CHECKED_RADIO_SELECTOR);\n\n if (checkboxListItems.length) {\n const preselectedItems = this.root_.querySelectorAll(strings.ARIA_CHECKED_CHECKBOX_SELECTOR);\n this.selectedIndex =\n [].map.call(preselectedItems, (listItem: Element) => this.listElements.indexOf(listItem)) as number[];\n } else if (singleSelectedListItem) {\n if (singleSelectedListItem.classList.contains(cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {\n this.foundation_.setUseActivatedClass(true);\n }\n\n this.singleSelection = true;\n this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);\n } else if (radioSelectedListItem) {\n this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);\n }\n }\n\n /**\n * Updates the list item at itemIndex to the desired isEnabled state.\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n setEnabled(itemIndex: number, isEnabled: boolean) {\n this.foundation_.setEnabled(itemIndex, isEnabled);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCListAdapter = {\n addClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.add(className);\n }\n },\n focusItemAtIndex: (index) => {\n const element = this.listElements[index] as HTMLElement | undefined;\n if (element) {\n element.focus();\n }\n },\n getAttributeForElementIndex: (index, attr) => this.listElements[index].getAttribute(attr),\n getFocusedElementIndex: () => this.listElements.indexOf(document.activeElement!),\n getListItemCount: () => this.listElements.length,\n hasCheckboxAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector(strings.CHECKBOX_SELECTOR);\n },\n hasRadioAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector(strings.RADIO_SELECTOR);\n },\n isCheckboxCheckedAtIndex: (index) => {\n const listItem = this.listElements[index];\n const toggleEl = listItem.querySelector<HTMLInputElement>(strings.CHECKBOX_SELECTOR);\n return toggleEl!.checked;\n },\n isFocusInsideList: () => {\n return this.root_.contains(document.activeElement);\n },\n isRootFocused: () => document.activeElement === this.root_,\n listItemAtIndexHasClass: (index, className) => this.listElements[index].classList.contains(className),\n notifyAction: (index) => {\n this.emit<MDCListActionEventDetail>(strings.ACTION_EVENT, {index}, /** shouldBubble */ true);\n },\n removeClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.remove(className);\n }\n },\n setAttributeForElementIndex: (index, attr, value) => {\n const element = this.listElements[index];\n if (element) {\n element.setAttribute(attr, value);\n }\n },\n setCheckedCheckboxOrRadioAtIndex: (index, isChecked) => {\n const listItem = this.listElements[index];\n const toggleEl = listItem.querySelector<HTMLInputElement>(strings.CHECKBOX_RADIO_SELECTOR);\n toggleEl!.checked = isChecked;\n\n const event = document.createEvent('Event');\n event.initEvent('change', true, true);\n toggleEl!.dispatchEvent(event);\n },\n setTabIndexForListItemChildren: (listItemIndex, tabIndexValue) => {\n const element = this.listElements[listItemIndex];\n const listItemChildren: Element[] =\n [].slice.call(element.querySelectorAll(strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));\n listItemChildren.forEach((el) => el.setAttribute('tabindex', tabIndexValue));\n },\n };\n return new MDCListFoundation(adapter);\n }\n\n /**\n * Used to figure out which list item this event is targetting. Or returns -1 if\n * there is no list item\n */\n private getListItemIndex_(evt: Event) {\n const eventTarget = evt.target as Element;\n const nearestParent = closest(eventTarget, `.${cssClasses.LIST_ITEM_CLASS}, .${cssClasses.ROOT}`);\n\n // Get the index of the element if it is a list item.\n if (nearestParent && matches(nearestParent, `.${cssClasses.LIST_ITEM_CLASS}`)) {\n return this.listElements.indexOf(nearestParent);\n }\n\n return -1;\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n private handleFocusInEvent_(evt: FocusEvent) {\n const index = this.getListItemIndex_(evt);\n this.foundation_.handleFocusIn(evt, index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n private handleFocusOutEvent_(evt: FocusEvent) {\n const index = this.getListItemIndex_(evt);\n this.foundation_.handleFocusOut(evt, index);\n }\n\n /**\n * Used to figure out which element was focused when keydown event occurred before sending the event to the\n * foundation.\n */\n private handleKeydownEvent_(evt: KeyboardEvent) {\n const index = this.getListItemIndex_(evt);\n const target = evt.target as Element;\n this.foundation_.handleKeydown(evt, target.classList.contains(cssClasses.LIST_ITEM_CLASS), index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n private handleClickEvent_(evt: MouseEvent) {\n const index = this.getListItemIndex_(evt);\n const target = evt.target as Element;\n\n // Toggle the checkbox only if it's not the target of the event, or the checkbox will have 2 change events.\n const toggleCheckbox = !matches(target, strings.CHECKBOX_RADIO_SELECTOR);\n this.foundation_.handleClick(index, toggleCheckbox);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated',\n LIST_ITEM_CLASS: 'mdc-list-item',\n LIST_ITEM_DISABLED_CLASS: 'mdc-list-item--disabled',\n LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',\n ROOT: 'mdc-list',\n};\n\nconst strings = {\n ACTION_EVENT: 'MDCList:action',\n ARIA_CHECKED: 'aria-checked',\n ARIA_CHECKED_CHECKBOX_SELECTOR: '[role=\"checkbox\"][aria-checked=\"true\"]',\n ARIA_CHECKED_RADIO_SELECTOR: '[role=\"radio\"][aria-checked=\"true\"]',\n ARIA_CURRENT: 'aria-current',\n ARIA_DISABLED: 'aria-disabled',\n ARIA_ORIENTATION: 'aria-orientation',\n ARIA_ORIENTATION_HORIZONTAL: 'horizontal',\n ARIA_ROLE_CHECKBOX_SELECTOR: '[role=\"checkbox\"]',\n ARIA_SELECTED: 'aria-selected',\n CHECKBOX_RADIO_SELECTOR: 'input[type=\"checkbox\"], input[type=\"radio\"]',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: `\n .${cssClasses.LIST_ITEM_CLASS} button:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} a\n `,\n FOCUSABLE_CHILD_ELEMENTS: `\n .${cssClasses.LIST_ITEM_CLASS} button:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} a,\n .${cssClasses.LIST_ITEM_CLASS} input[type=\"radio\"]:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} input[type=\"checkbox\"]:not(:disabled)\n `,\n RADIO_SELECTOR: 'input[type=\"radio\"]',\n};\n\nconst numbers = {\n UNSET_INDEX: -1,\n};\n\nexport {strings, cssClasses, numbers};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCListIndex} from './types';\n\nconst ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];\n\nfunction isNumberArray(selectedIndex: MDCListIndex): selectedIndex is number[] {\n return selectedIndex instanceof Array;\n}\n\nexport class MDCListFoundation extends MDCFoundation<MDCListAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCListAdapter {\n return {\n addClassForElementIndex: () => undefined,\n focusItemAtIndex: () => undefined,\n getAttributeForElementIndex: () => null,\n getFocusedElementIndex: () => 0,\n getListItemCount: () => 0,\n hasCheckboxAtIndex: () => false,\n hasRadioAtIndex: () => false,\n isCheckboxCheckedAtIndex: () => false,\n isFocusInsideList: () => false,\n isRootFocused: () => false,\n listItemAtIndexHasClass: () => false,\n notifyAction: () => undefined,\n removeClassForElementIndex: () => undefined,\n setAttributeForElementIndex: () => undefined,\n setCheckedCheckboxOrRadioAtIndex: () => undefined,\n setTabIndexForListItemChildren: () => undefined,\n };\n }\n\n private wrapFocus_ = false;\n private isVertical_ = true;\n private isSingleSelectionList_ = false;\n private selectedIndex_: MDCListIndex = numbers.UNSET_INDEX;\n private focusedItemIndex_ = numbers.UNSET_INDEX;\n private useActivatedClass_ = false;\n private ariaCurrentAttrValue_: string | null = null;\n private isCheckboxList_ = false;\n private isRadioList_ = false;\n\n constructor(adapter?: Partial<MDCListAdapter>) {\n super({...MDCListFoundation.defaultAdapter, ...adapter});\n }\n\n layout() {\n if (this.adapter_.getListItemCount() === 0) {\n return;\n }\n\n if (this.adapter_.hasCheckboxAtIndex(0)) {\n this.isCheckboxList_ = true;\n } else if (this.adapter_.hasRadioAtIndex(0)) {\n this.isRadioList_ = true;\n }\n }\n\n /**\n * Sets the private wrapFocus_ variable.\n */\n setWrapFocus(value: boolean) {\n this.wrapFocus_ = value;\n }\n\n /**\n * Sets the isVertical_ private variable.\n */\n setVerticalOrientation(value: boolean) {\n this.isVertical_ = value;\n }\n\n /**\n * Sets the isSingleSelectionList_ private variable.\n */\n setSingleSelection(value: boolean) {\n this.isSingleSelectionList_ = value;\n }\n\n /**\n * Sets the useActivatedClass_ private variable.\n */\n setUseActivatedClass(useActivated: boolean) {\n this.useActivatedClass_ = useActivated;\n }\n\n getSelectedIndex(): MDCListIndex {\n return this.selectedIndex_;\n }\n\n setSelectedIndex(index: MDCListIndex) {\n if (!this.isIndexValid_(index)) {\n return;\n }\n\n if (this.isCheckboxList_) {\n this.setCheckboxAtIndex_(index as number[]);\n } else if (this.isRadioList_) {\n this.setRadioAtIndex_(index as number);\n } else {\n this.setSingleSelectionAtIndex_(index as number);\n }\n }\n\n /**\n * Focus in handler for the list items.\n */\n handleFocusIn(_: FocusEvent, listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.adapter_.setTabIndexForListItemChildren(listItemIndex, '0');\n }\n }\n\n /**\n * Focus out handler for the list items.\n */\n handleFocusOut(_: FocusEvent, listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.adapter_.setTabIndexForListItemChildren(listItemIndex, '-1');\n }\n\n /**\n * Between Focusout & Focusin some browsers do not have focus on any element. Setting a delay to wait till the focus\n * is moved to next element.\n */\n setTimeout(() => {\n if (!this.adapter_.isFocusInsideList()) {\n this.setTabindexToFirstSelectedItem_();\n }\n }, 0);\n }\n\n /**\n * Key handler for the list.\n */\n handleKeydown(evt: KeyboardEvent, isRootListItem: boolean, listItemIndex: number) {\n const isArrowLeft = evt.key === 'ArrowLeft' || evt.keyCode === 37;\n const isArrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38;\n const isArrowRight = evt.key === 'ArrowRight' || evt.keyCode === 39;\n const isArrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40;\n const isHome = evt.key === 'Home' || evt.keyCode === 36;\n const isEnd = evt.key === 'End' || evt.keyCode === 35;\n const isEnter = evt.key === 'Enter' || evt.keyCode === 13;\n const isSpace = evt.key === 'Space' || evt.keyCode === 32;\n\n if (this.adapter_.isRootFocused()) {\n if (isArrowUp || isEnd) {\n evt.preventDefault();\n this.focusLastElement();\n } else if (isArrowDown || isHome) {\n evt.preventDefault();\n this.focusFirstElement();\n }\n\n return;\n }\n\n let currentIndex = this.adapter_.getFocusedElementIndex();\n if (currentIndex === -1) {\n currentIndex = listItemIndex;\n if (currentIndex < 0) {\n // If this event doesn't have a mdc-list-item ancestor from the\n // current list (not from a sublist), return early.\n return;\n }\n }\n\n let nextIndex;\n if ((this.isVertical_ && isArrowDown) || (!this.isVertical_ && isArrowRight)) {\n this.preventDefaultEvent_(evt);\n nextIndex = this.focusNextElement(currentIndex);\n } else if ((this.isVertical_ && isArrowUp) || (!this.isVertical_ && isArrowLeft)) {\n this.preventDefaultEvent_(evt);\n nextIndex = this.focusPrevElement(currentIndex);\n } else if (isHome) {\n this.preventDefaultEvent_(evt);\n nextIndex = this.focusFirstElement();\n } else if (isEnd) {\n this.preventDefaultEvent_(evt);\n nextIndex = this.focusLastElement();\n } else if (isEnter || isSpace) {\n if (isRootListItem) {\n // Return early if enter key is pressed on anchor element which triggers synthetic MouseEvent event.\n const target = evt.target as Element | null;\n if (target && target.tagName === 'A' && isEnter) {\n return;\n }\n this.preventDefaultEvent_(evt);\n\n if (this.isSelectableList_()) {\n this.setSelectedIndexOnAction_(currentIndex);\n }\n\n this.adapter_.notifyAction(currentIndex);\n }\n }\n\n this.focusedItemIndex_ = currentIndex;\n\n if (nextIndex !== undefined) {\n this.setTabindexAtIndex_(nextIndex);\n this.focusedItemIndex_ = nextIndex;\n }\n }\n\n /**\n * Click handler for the list.\n */\n handleClick(index: number, toggleCheckbox: boolean) {\n if (index === numbers.UNSET_INDEX) {\n return;\n }\n\n if (this.isSelectableList_()) {\n this.setSelectedIndexOnAction_(index, toggleCheckbox);\n }\n\n this.adapter_.notifyAction(index);\n\n this.setTabindexAtIndex_(index);\n this.focusedItemIndex_ = index;\n }\n\n /**\n * Focuses the next element on the list.\n */\n focusNextElement(index: number) {\n const count = this.adapter_.getListItemCount();\n let nextIndex = index + 1;\n if (nextIndex >= count) {\n if (this.wrapFocus_) {\n nextIndex = 0;\n } else {\n // Return early because last item is already focused.\n return index;\n }\n }\n this.adapter_.focusItemAtIndex(nextIndex);\n\n return nextIndex;\n }\n\n /**\n * Focuses the previous element on the list.\n */\n focusPrevElement(index: number) {\n let prevIndex = index - 1;\n if (prevIndex < 0) {\n if (this.wrapFocus_) {\n prevIndex = this.adapter_.getListItemCount() - 1;\n } else {\n // Return early because first item is already focused.\n return index;\n }\n }\n this.adapter_.focusItemAtIndex(prevIndex);\n\n return prevIndex;\n }\n\n focusFirstElement() {\n this.adapter_.focusItemAtIndex(0);\n return 0;\n }\n\n focusLastElement() {\n const lastIndex = this.adapter_.getListItemCount() - 1;\n this.adapter_.focusItemAtIndex(lastIndex);\n return lastIndex;\n }\n\n /**\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n setEnabled(itemIndex: number, isEnabled: boolean): void {\n if (!this.isIndexValid_(itemIndex)) {\n return;\n }\n\n if (isEnabled) {\n this.adapter_.removeClassForElementIndex(itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter_.setAttributeForElementIndex(itemIndex, strings.ARIA_DISABLED, 'false');\n } else {\n this.adapter_.addClassForElementIndex(itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter_.setAttributeForElementIndex(itemIndex, strings.ARIA_DISABLED, 'true');\n }\n }\n\n /**\n * Ensures that preventDefault is only called if the containing element doesn't\n * consume the event, and it will cause an unintended scroll.\n */\n private preventDefaultEvent_(evt: KeyboardEvent) {\n const target = evt.target as Element;\n const tagName = `${target.tagName}`.toLowerCase();\n if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {\n evt.preventDefault();\n }\n }\n\n private setSingleSelectionAtIndex_(index: number) {\n if (this.selectedIndex_ === index) {\n return;\n }\n\n let selectedClassName = cssClasses.LIST_ITEM_SELECTED_CLASS;\n if (this.useActivatedClass_) {\n selectedClassName = cssClasses.LIST_ITEM_ACTIVATED_CLASS;\n }\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter_.removeClassForElementIndex(this.selectedIndex_ as number, selectedClassName);\n }\n this.adapter_.addClassForElementIndex(index, selectedClassName);\n this.setAriaForSingleSelectionAtIndex_(index);\n\n this.selectedIndex_ = index;\n }\n\n /**\n * Sets aria attribute for single selection at given index.\n */\n private setAriaForSingleSelectionAtIndex_(index: number) {\n // Detect the presence of aria-current and get the value only during list initialization when it is in unset state.\n if (this.selectedIndex_ === numbers.UNSET_INDEX) {\n this.ariaCurrentAttrValue_ =\n this.adapter_.getAttributeForElementIndex(index, strings.ARIA_CURRENT);\n }\n\n const isAriaCurrent = this.ariaCurrentAttrValue_ !== null;\n const ariaAttribute = isAriaCurrent ? strings.ARIA_CURRENT : strings.ARIA_SELECTED;\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter_.setAttributeForElementIndex(this.selectedIndex_ as number, ariaAttribute, 'false');\n }\n\n const ariaAttributeValue = isAriaCurrent ? this.ariaCurrentAttrValue_ : 'true';\n this.adapter_.setAttributeForElementIndex(index, ariaAttribute, ariaAttributeValue as string);\n }\n\n /**\n * Toggles radio at give index. Radio doesn't change the checked state if it is already checked.\n */\n private setRadioAtIndex_(index: number) {\n this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, true);\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter_.setAttributeForElementIndex(this.selectedIndex_ as number, strings.ARIA_CHECKED, 'false');\n }\n\n this.adapter_.setAttributeForElementIndex(index, strings.ARIA_CHECKED, 'true');\n\n this.selectedIndex_ = index;\n }\n\n private setCheckboxAtIndex_(index: number[]) {\n for (let i = 0; i < this.adapter_.getListItemCount(); i++) {\n let isChecked = false;\n if (index.indexOf(i) >= 0) {\n isChecked = true;\n }\n\n this.adapter_.setCheckedCheckboxOrRadioAtIndex(i, isChecked);\n this.adapter_.setAttributeForElementIndex(i, strings.ARIA_CHECKED, isChecked ? 'true' : 'false');\n }\n\n this.selectedIndex_ = index;\n }\n\n private setTabindexAtIndex_(index: number) {\n if (this.focusedItemIndex_ === numbers.UNSET_INDEX && index !== 0) {\n // If no list item was selected set first list item's tabindex to -1.\n // Generally, tabindex is set to 0 on first list item of list that has no preselected items.\n this.adapter_.setAttributeForElementIndex(0, 'tabindex', '-1');\n } else if (this.focusedItemIndex_ >= 0 && this.focusedItemIndex_ !== index) {\n this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_, 'tabindex', '-1');\n }\n\n this.adapter_.setAttributeForElementIndex(index, 'tabindex', '0');\n }\n\n /**\n * @return Return true if it is single selectin list, checkbox list or radio list.\n */\n private isSelectableList_() {\n return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;\n }\n\n private setTabindexToFirstSelectedItem_() {\n let targetIndex = 0;\n\n if (this.isSelectableList_()) {\n if (typeof this.selectedIndex_ === 'number' && this.selectedIndex_ !== numbers.UNSET_INDEX) {\n targetIndex = this.selectedIndex_;\n } else if (isNumberArray(this.selectedIndex_) && this.selectedIndex_.length > 0) {\n targetIndex = this.selectedIndex_.reduce((currentIndex, minIndex) => Math.min(currentIndex, minIndex));\n }\n }\n\n this.setTabindexAtIndex_(targetIndex);\n }\n\n private isIndexValid_(index: MDCListIndex) {\n if (index instanceof Array) {\n if (!this.isCheckboxList_) {\n throw new Error('MDCListFoundation: Array of index is only supported for checkbox based list');\n }\n\n if (index.length === 0) {\n return true;\n } else {\n return index.some((i) => this.isIndexInRange_(i));\n }\n } else if (typeof index === 'number') {\n if (this.isCheckboxList_) {\n throw new Error('MDCListFoundation: Expected array of index for checkbox based list but got number: ' + index);\n }\n return this.isIndexInRange_(index);\n } else {\n return false;\n }\n }\n\n private isIndexInRange_(index: number) {\n const listSize = this.adapter_.getListItemCount();\n return index >= 0 && index < listSize;\n }\n\n /**\n * Sets selected index on user action, toggles checkbox / radio based on toggleCheckbox value.\n * User interaction should not toggle list item(s) when disabled.\n */\n private setSelectedIndexOnAction_(index: number, toggleCheckbox = true) {\n if (this.adapter_.listItemAtIndexHasClass(index, cssClasses.LIST_ITEM_DISABLED_CLASS)) {\n return;\n }\n\n if (this.isCheckboxList_) {\n this.toggleCheckboxAtIndex_(index, toggleCheckbox);\n } else {\n this.setSelectedIndex(index);\n }\n }\n\n private toggleCheckboxAtIndex_(index: number, toggleCheckbox: boolean) {\n let isChecked = this.adapter_.isCheckboxCheckedAtIndex(index);\n\n if (toggleCheckbox) {\n isChecked = !isChecked;\n this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);\n }\n\n this.adapter_.setAttributeForElementIndex(index, strings.ARIA_CHECKED, isChecked ? 'true' : 'false');\n\n // If none of the checkbox items are selected and selectedIndex is not initialized then provide a default value.\n let selectedIndexes = this.selectedIndex_ === numbers.UNSET_INDEX ? [] : (this.selectedIndex_ as number[]).slice();\n\n if (isChecked) {\n selectedIndexes.push(index);\n } else {\n selectedIndexes = selectedIndexes.filter((i) => i !== index);\n }\n\n this.selectedIndex_ = selectedIndexes;\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCListFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCMenuSurfaceAdapter} from './adapter';\nimport {Corner, cssClasses, strings} from './constants';\nimport {MDCMenuSurfaceFoundation} from './foundation';\nimport {MDCMenuDistance} from './types';\nimport * as util from './util';\n\ntype RegisterFunction = () => void;\n\nexport type MDCMenuSurfaceFactory = (el: Element, foundation?: MDCMenuSurfaceFoundation) => MDCMenuSurface;\n\nexport class MDCMenuSurface extends MDCComponent<MDCMenuSurfaceFoundation> {\n static attachTo(root: Element): MDCMenuSurface {\n return new MDCMenuSurface(root);\n }\n\n anchorElement!: Element | null; // assigned in initialSyncWithDOM()\n\n protected root_!: HTMLElement; // assigned in MDCComponent constructor\n\n private previousFocus_?: HTMLElement | SVGElement | null;\n\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleBodyClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n private registerBodyClickListener_!: RegisterFunction; // assigned in initialSyncWithDOM()\n private deregisterBodyClickListener_!: RegisterFunction; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n const parentEl = this.root_.parentElement;\n this.anchorElement = parentEl && parentEl.classList.contains(cssClasses.ANCHOR) ? parentEl : null;\n\n if (this.root_.classList.contains(cssClasses.FIXED)) {\n this.setFixedPosition(true);\n }\n\n this.handleKeydown_ = (evt) => this.foundation_.handleKeydown(evt);\n this.handleBodyClick_ = (evt) => this.foundation_.handleBodyClick(evt);\n\n this.registerBodyClickListener_ = () => document.body.addEventListener('click', this.handleBodyClick_);\n this.deregisterBodyClickListener_ = () => document.body.removeEventListener('click', this.handleBodyClick_);\n\n this.listen('keydown', this.handleKeydown_);\n this.listen(strings.OPENED_EVENT, this.registerBodyClickListener_);\n this.listen(strings.CLOSED_EVENT, this.deregisterBodyClickListener_);\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten(strings.OPENED_EVENT, this.registerBodyClickListener_);\n this.unlisten(strings.CLOSED_EVENT, this.deregisterBodyClickListener_);\n super.destroy();\n }\n\n isOpen(): boolean {\n return this.foundation_.isOpen();\n }\n\n open() {\n this.foundation_.open();\n }\n\n close(skipRestoreFocus = false) {\n this.foundation_.close(skipRestoreFocus);\n }\n\n set quickOpen(quickOpen: boolean) {\n this.foundation_.setQuickOpen(quickOpen);\n }\n\n /** Sets the foundation to use page offsets for an positioning when the menu is hoisted to the body. */\n setIsHoisted(isHoisted: boolean) {\n this.foundation_.setIsHoisted(isHoisted);\n }\n\n /** Sets the element that the menu-surface is anchored to. */\n setMenuSurfaceAnchorElement(element: Element) {\n this.anchorElement = element;\n }\n\n /** Sets the menu-surface to position: fixed. */\n setFixedPosition(isFixed: boolean) {\n if (isFixed) {\n this.root_.classList.add(cssClasses.FIXED);\n } else {\n this.root_.classList.remove(cssClasses.FIXED);\n }\n\n this.foundation_.setFixedPosition(isFixed);\n }\n\n /** Sets the absolute x/y position to position based on. Requires the menu to be hoisted. */\n setAbsolutePosition(x: number, y: number) {\n this.foundation_.setAbsolutePosition(x, y);\n this.setIsHoisted(true);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left surface corner.\n */\n setAnchorCorner(corner: Corner) {\n this.foundation_.setAnchorCorner(corner);\n }\n\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.foundation_.setAnchorMargin(margin);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCMenuSurfaceAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n hasClass: (className) => this.root_.classList.contains(className),\n hasAnchor: () => !!this.anchorElement,\n notifyClose: () => this.emit(MDCMenuSurfaceFoundation.strings.CLOSED_EVENT, {}),\n notifyOpen: () => this.emit(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, {}),\n isElementInContainer: (el) => this.root_.contains(el),\n isRtl: () => getComputedStyle(this.root_).getPropertyValue('direction') === 'rtl',\n setTransformOrigin: (origin) => {\n const propertyName = `${util.getTransformPropertyName(window)}-origin`;\n this.root_.style.setProperty(propertyName, origin);\n },\n\n isFocused: () => document.activeElement === this.root_,\n saveFocus: () => {\n this.previousFocus_ = document.activeElement as HTMLElement | SVGElement | null;\n },\n restoreFocus: () => {\n if (this.root_.contains(document.activeElement)) {\n if (this.previousFocus_ && this.previousFocus_.focus) {\n this.previousFocus_.focus();\n }\n }\n },\n\n getInnerDimensions: () => {\n return {width: this.root_.offsetWidth, height: this.root_.offsetHeight};\n },\n getAnchorDimensions: () => this.anchorElement ? this.anchorElement.getBoundingClientRect() : null,\n getWindowDimensions: () => {\n return {width: window.innerWidth, height: window.innerHeight};\n },\n getBodyDimensions: () => {\n return {width: document.body.clientWidth, height: document.body.clientHeight};\n },\n getWindowScroll: () => {\n return {x: window.pageXOffset, y: window.pageYOffset};\n },\n setPosition: (position) => {\n this.root_.style.left = 'left' in position ? `${position.left}px` : '';\n this.root_.style.right = 'right' in position ? `${position.right}px` : '';\n this.root_.style.top = 'top' in position ? `${position.top}px` : '';\n this.root_.style.bottom = 'bottom' in position ? `${position.bottom}px` : '';\n },\n setMaxHeight: (height) => {\n this.root_.style.maxHeight = height;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuSurfaceFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANCHOR: 'mdc-menu-surface--anchor',\n ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed',\n ANIMATING_OPEN: 'mdc-menu-surface--animating-open',\n FIXED: 'mdc-menu-surface--fixed',\n OPEN: 'mdc-menu-surface--open',\n ROOT: 'mdc-menu-surface',\n};\n\n// tslint:disable:object-literal-sort-keys\nconst strings = {\n CLOSED_EVENT: 'MDCMenuSurface:closed',\n OPENED_EVENT: 'MDCMenuSurface:opened',\n FOCUSABLE_ELEMENTS: [\n 'button:not(:disabled)', '[href]:not([aria-disabled=\"true\"])', 'input:not(:disabled)',\n 'select:not(:disabled)', 'textarea:not(:disabled)', '[tabindex]:not([tabindex=\"-1\"]):not([aria-disabled=\"true\"])',\n ].join(', '),\n};\n// tslint:enable:object-literal-sort-keys\n\nconst numbers = {\n /** Total duration of menu-surface open animation. */\n TRANSITION_OPEN_DURATION: 120,\n\n /** Total duration of menu-surface close animation. */\n TRANSITION_CLOSE_DURATION: 75,\n\n /** Margin left to the edge of the viewport when menu-surface is at maximum possible height. */\n MARGIN_TO_EDGE: 32,\n\n /** Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning. */\n ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67,\n};\n\n/**\n * Enum for bits in the {@see Corner) bitmap.\n */\nenum CornerBit {\n BOTTOM = 1,\n CENTER = 2,\n RIGHT = 4,\n FLIP_RTL = 8,\n}\n\n/**\n * Enum for representing an element corner for positioning the menu-surface.\n *\n * The START constants map to LEFT if element directionality is left\n * to right and RIGHT if the directionality is right to left.\n * Likewise END maps to RIGHT or LEFT depending on the directionality.\n */\nenum Corner {\n TOP_LEFT = 0,\n TOP_RIGHT = CornerBit.RIGHT,\n BOTTOM_LEFT = CornerBit.BOTTOM,\n BOTTOM_RIGHT = CornerBit.BOTTOM | CornerBit.RIGHT, // tslint:disable-line:no-bitwise\n TOP_START = CornerBit.FLIP_RTL,\n TOP_END = CornerBit.FLIP_RTL | CornerBit.RIGHT, // tslint:disable-line:no-bitwise\n BOTTOM_START = CornerBit.BOTTOM | CornerBit.FLIP_RTL, // tslint:disable-line:no-bitwise\n BOTTOM_END = CornerBit.BOTTOM | CornerBit.RIGHT | CornerBit.FLIP_RTL, // tslint:disable-line:no-bitwise\n}\n\nexport {cssClasses, strings, numbers, CornerBit, Corner};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCMenuSurfaceAdapter} from './adapter';\nimport {Corner, CornerBit, cssClasses, numbers, strings} from './constants';\nimport {MDCMenuDimensions, MDCMenuDistance, MDCMenuPoint} from './types';\n\ninterface AutoLayoutMeasurements {\n anchorSize: MDCMenuDimensions;\n bodySize: MDCMenuDimensions;\n surfaceSize: MDCMenuDimensions;\n viewportDistance: MDCMenuDistance;\n viewportSize: MDCMenuDimensions;\n windowScroll: MDCMenuPoint;\n}\n\nexport class MDCMenuSurfaceFoundation extends MDCFoundation<MDCMenuSurfaceAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get Corner() {\n return Corner;\n }\n\n /**\n * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCMenuSurfaceAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n hasAnchor: () => false,\n\n isElementInContainer: () => false,\n isFocused: () => false,\n isRtl: () => false,\n\n getInnerDimensions: () => ({height: 0, width: 0}),\n getAnchorDimensions: () => null,\n getWindowDimensions: () => ({height: 0, width: 0}),\n getBodyDimensions: () => ({height: 0, width: 0}),\n getWindowScroll: () => ({x: 0, y: 0}),\n setPosition: () => undefined,\n setMaxHeight: () => undefined,\n setTransformOrigin: () => undefined,\n\n saveFocus: () => undefined,\n restoreFocus: () => undefined,\n\n notifyClose: () => undefined,\n notifyOpen: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private isOpen_ = false;\n private isQuickOpen_ = false;\n private isHoistedElement_ = false;\n private isFixedPosition_ = false;\n\n private openAnimationEndTimerId_ = 0;\n private closeAnimationEndTimerId_ = 0;\n private animationRequestId_ = 0;\n\n private anchorCorner_: Corner = Corner.TOP_START;\n private anchorMargin_: MDCMenuDistance = {top: 0, right: 0, bottom: 0, left: 0};\n private position_: MDCMenuPoint = {x: 0, y: 0};\n\n private dimensions_!: MDCMenuDimensions; // assigned in open()\n private measurements_!: AutoLayoutMeasurements; // assigned in open()\n\n constructor(adapter?: Partial<MDCMenuSurfaceAdapter>) {\n super({...MDCMenuSurfaceFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n const {ROOT, OPEN} = MDCMenuSurfaceFoundation.cssClasses;\n\n if (!this.adapter_.hasClass(ROOT)) {\n throw new Error(`${ROOT} class required in root element.`);\n }\n\n if (this.adapter_.hasClass(OPEN)) {\n this.isOpen_ = true;\n }\n }\n\n destroy() {\n clearTimeout(this.openAnimationEndTimerId_);\n clearTimeout(this.closeAnimationEndTimerId_);\n // Cancel any currently running animations.\n cancelAnimationFrame(this.animationRequestId_);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left menu surface corner.\n */\n setAnchorCorner(corner: Corner) {\n this.anchorCorner_ = corner;\n }\n\n /**\n * @param margin Set of margin values from anchor.\n */\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.anchorMargin_.top = margin.top || 0;\n this.anchorMargin_.right = margin.right || 0;\n this.anchorMargin_.bottom = margin.bottom || 0;\n this.anchorMargin_.left = margin.left || 0;\n }\n\n /** Used to indicate if the menu-surface is hoisted to the body. */\n setIsHoisted(isHoisted: boolean) {\n this.isHoistedElement_ = isHoisted;\n }\n\n /** Used to set the menu-surface calculations based on a fixed position menu. */\n setFixedPosition(isFixedPosition: boolean) {\n this.isFixedPosition_ = isFixedPosition;\n }\n\n /** Sets the menu-surface position on the page. */\n setAbsolutePosition(x: number, y: number) {\n this.position_.x = this.isFinite_(x) ? x : 0;\n this.position_.y = this.isFinite_(y) ? y : 0;\n }\n\n setQuickOpen(quickOpen: boolean) {\n this.isQuickOpen_ = quickOpen;\n }\n\n isOpen() {\n return this.isOpen_;\n }\n\n /**\n * Open the menu surface.\n */\n open() {\n this.adapter_.saveFocus();\n\n if (!this.isQuickOpen_) {\n this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n }\n\n this.animationRequestId_ = requestAnimationFrame(() => {\n this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.dimensions_ = this.adapter_.getInnerDimensions();\n this.autoPosition_();\n if (this.isQuickOpen_) {\n this.adapter_.notifyOpen();\n } else {\n this.openAnimationEndTimerId_ = setTimeout(() => {\n this.openAnimationEndTimerId_ = 0;\n this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.adapter_.notifyOpen();\n }, numbers.TRANSITION_OPEN_DURATION);\n }\n });\n\n this.isOpen_ = true;\n }\n\n /**\n * Closes the menu surface.\n */\n close(skipRestoreFocus = false) {\n if (!this.isQuickOpen_) {\n this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n }\n\n requestAnimationFrame(() => {\n this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n if (this.isQuickOpen_) {\n this.adapter_.notifyClose();\n } else {\n this.closeAnimationEndTimerId_ = setTimeout(() => {\n this.closeAnimationEndTimerId_ = 0;\n this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n this.adapter_.notifyClose();\n }, numbers.TRANSITION_CLOSE_DURATION);\n }\n });\n\n this.isOpen_ = false;\n if (!skipRestoreFocus) {\n this.maybeRestoreFocus_();\n }\n }\n\n /** Handle clicks and close if not within menu-surface element. */\n handleBodyClick(evt: MouseEvent) {\n const el = evt.target as Element;\n if (this.adapter_.isElementInContainer(el)) {\n return;\n }\n this.close();\n }\n\n /** Handle keys that close the surface. */\n handleKeydown(evt: KeyboardEvent) {\n const {keyCode, key} = evt;\n\n const isEscape = key === 'Escape' || keyCode === 27;\n if (isEscape) {\n this.close();\n }\n }\n\n private autoPosition_() {\n // Compute measurements for autoposition methods reuse.\n this.measurements_ = this.getAutoLayoutMeasurements_();\n\n const corner = this.getOriginCorner_();\n const maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner);\n const verticalAlignment = this.hasBit_(corner, CornerBit.BOTTOM) ? 'bottom' : 'top';\n let horizontalAlignment = this.hasBit_(corner, CornerBit.RIGHT) ? 'right' : 'left';\n const horizontalOffset = this.getHorizontalOriginOffset_(corner);\n const verticalOffset = this.getVerticalOriginOffset_(corner);\n const {anchorSize, surfaceSize} = this.measurements_;\n\n const position: Partial<MDCMenuDistance> = {\n [horizontalAlignment]: horizontalOffset,\n [verticalAlignment]: verticalOffset,\n };\n\n // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.\n if (anchorSize.width / surfaceSize.width > numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {\n horizontalAlignment = 'center';\n }\n\n // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element\n if (this.isHoistedElement_ || this.isFixedPosition_) {\n this.adjustPositionForHoistedElement_(position);\n }\n\n this.adapter_.setTransformOrigin(`${horizontalAlignment} ${verticalAlignment}`);\n this.adapter_.setPosition(position);\n this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');\n }\n\n /**\n * @return Measurements used to position menu surface popup.\n */\n private getAutoLayoutMeasurements_(): AutoLayoutMeasurements {\n let anchorRect = this.adapter_.getAnchorDimensions();\n const bodySize = this.adapter_.getBodyDimensions();\n const viewportSize = this.adapter_.getWindowDimensions();\n const windowScroll = this.adapter_.getWindowScroll();\n\n if (!anchorRect) {\n // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together\n anchorRect = {\n top: this.position_.y,\n right: this.position_.x,\n bottom: this.position_.y,\n left: this.position_.x,\n width: 0,\n height: 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n return {\n anchorSize: anchorRect,\n bodySize,\n surfaceSize: this.dimensions_,\n viewportDistance: {\n // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together\n top: anchorRect.top,\n right: viewportSize.width - anchorRect.right,\n bottom: viewportSize.height - anchorRect.bottom,\n left: anchorRect.left,\n // tslint:enable:object-literal-sort-keys\n },\n viewportSize,\n windowScroll,\n };\n }\n\n /**\n * Computes the corner of the anchor from which to animate and position the menu surface.\n */\n private getOriginCorner_(): Corner {\n // Defaults: open from the top left.\n let corner = Corner.TOP_LEFT;\n\n const {viewportDistance, anchorSize, surfaceSize} = this.measurements_;\n\n const isBottomAligned = this.hasBit_(this.anchorCorner_, CornerBit.BOTTOM);\n const availableTop = isBottomAligned ? viewportDistance.top + anchorSize.height + this.anchorMargin_.bottom\n : viewportDistance.top + this.anchorMargin_.top;\n const availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom\n : viewportDistance.bottom + anchorSize.height - this.anchorMargin_.top;\n\n const topOverflow = surfaceSize.height - availableTop;\n const bottomOverflow = surfaceSize.height - availableBottom;\n if (bottomOverflow > 0 && topOverflow < bottomOverflow) {\n corner = this.setBit_(corner, CornerBit.BOTTOM);\n }\n\n const isRtl = this.adapter_.isRtl();\n const isFlipRtl = this.hasBit_(this.anchorCorner_, CornerBit.FLIP_RTL);\n const avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, CornerBit.RIGHT);\n const isAlignedRight = (avoidHorizontalOverlap && !isRtl) ||\n (!avoidHorizontalOverlap && isFlipRtl && isRtl);\n const availableLeft = isAlignedRight ? viewportDistance.left + anchorSize.width + this.anchorMargin_.right :\n viewportDistance.left + this.anchorMargin_.left;\n const availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right :\n viewportDistance.right + anchorSize.width - this.anchorMargin_.left;\n\n const leftOverflow = surfaceSize.width - availableLeft;\n const rightOverflow = surfaceSize.width - availableRight;\n\n if ((leftOverflow < 0 && isAlignedRight && isRtl) ||\n (avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0) ||\n (rightOverflow > 0 && leftOverflow < rightOverflow)) {\n corner = this.setBit_(corner, CornerBit.RIGHT);\n }\n\n return corner;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Maximum height of the menu surface, based on available space. 0 indicates should not be set.\n */\n private getMenuSurfaceMaxHeight_(corner: Corner): number {\n const {viewportDistance} = this.measurements_;\n\n let maxHeight = 0;\n const isBottomAligned = this.hasBit_(corner, CornerBit.BOTTOM);\n const isBottomAnchored = this.hasBit_(this.anchorCorner_, CornerBit.BOTTOM);\n const {MARGIN_TO_EDGE} = MDCMenuSurfaceFoundation.numbers;\n\n // When maximum height is not specified, it is handled from CSS.\n if (isBottomAligned) {\n maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE;\n if (!isBottomAnchored) {\n maxHeight += this.measurements_.anchorSize.height;\n }\n } else {\n maxHeight =\n viewportDistance.bottom - this.anchorMargin_.bottom + this.measurements_.anchorSize.height - MARGIN_TO_EDGE;\n if (isBottomAnchored) {\n maxHeight -= this.measurements_.anchorSize.height;\n }\n }\n\n return maxHeight;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Horizontal offset of menu surface origin corner from corresponding anchor corner.\n */\n private getHorizontalOriginOffset_(corner: Corner): number {\n const {anchorSize} = this.measurements_;\n\n // isRightAligned corresponds to using the 'right' property on the surface.\n const isRightAligned = this.hasBit_(corner, CornerBit.RIGHT);\n const avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, CornerBit.RIGHT);\n\n if (isRightAligned) {\n const rightOffset =\n avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.left : this.anchorMargin_.right;\n\n // For hoisted or fixed elements, adjust the offset by the difference between viewport width and body width so\n // when we calculate the right value (`adjustPositionForHoistedElement_`) based on the element position,\n // the right property is correct.\n if (this.isHoistedElement_ || this.isFixedPosition_) {\n return rightOffset - (this.measurements_.viewportSize.width - this.measurements_.bodySize.width);\n }\n\n return rightOffset;\n }\n\n return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.right : this.anchorMargin_.left;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Vertical offset of menu surface origin corner from corresponding anchor corner.\n */\n private getVerticalOriginOffset_(corner: Corner): number {\n const {anchorSize} = this.measurements_;\n const isBottomAligned = this.hasBit_(corner, CornerBit.BOTTOM);\n const avoidVerticalOverlap = this.hasBit_(this.anchorCorner_, CornerBit.BOTTOM);\n\n let y = 0;\n if (isBottomAligned) {\n y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin_.top : -this.anchorMargin_.bottom;\n } else {\n y = avoidVerticalOverlap ? (anchorSize.height + this.anchorMargin_.bottom) : this.anchorMargin_.top;\n }\n return y;\n }\n\n /** Calculates the offsets for positioning the menu-surface when the menu-surface has been hoisted to the body. */\n private adjustPositionForHoistedElement_(position: Partial<MDCMenuDistance>) {\n const {windowScroll, viewportDistance} = this.measurements_;\n\n const props = Object.keys(position) as Array<keyof Partial<MDCMenuDistance>>;\n\n for (const prop of props) {\n let value = position[prop] || 0;\n\n // Hoisted surfaces need to have the anchor elements location on the page added to the\n // position properties for proper alignment on the body.\n value += viewportDistance[prop];\n\n // Surfaces that are absolutely positioned need to have additional calculations for scroll\n // and bottom positioning.\n if (!this.isFixedPosition_) {\n if (prop === 'top') {\n value += windowScroll.y;\n } else if (prop === 'bottom') {\n value -= windowScroll.y;\n } else if (prop === 'left') {\n value += windowScroll.x;\n } else { // prop === 'right'\n value -= windowScroll.x;\n }\n }\n\n position[prop] = value;\n }\n }\n\n /**\n * The last focused element when the menu surface was opened should regain focus, if the user is\n * focused on or within the menu surface when it is closed.\n */\n private maybeRestoreFocus_() {\n const isRootFocused = this.adapter_.isFocused();\n const childHasFocus = document.activeElement && this.adapter_.isElementInContainer(document.activeElement);\n if (isRootFocused || childHasFocus) {\n this.adapter_.restoreFocus();\n }\n }\n\n private hasBit_(corner: Corner, bit: CornerBit): boolean {\n return Boolean(corner & bit); // tslint:disable-line:no-bitwise\n }\n\n private setBit_(corner: Corner, bit: CornerBit): Corner {\n return corner | bit; // tslint:disable-line:no-bitwise\n }\n\n /**\n * isFinite that doesn't force conversion to number type.\n * Equivalent to Number.isFinite in ES2015, which is not supported in IE.\n */\n private isFinite_(num: number): boolean {\n return typeof num === 'number' && isFinite(num);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuSurfaceFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\ntype CssTransformPropertyName = ('transform' | 'webkitTransform');\n\nlet cachedCssTransformPropertyName_: CssTransformPropertyName | undefined;\n\n/**\n * Returns the name of the correct transform property to use on the current browser.\n */\nfunction getTransformPropertyName(globalObj: Window, forceRefresh = false): CssTransformPropertyName {\n if (cachedCssTransformPropertyName_ === undefined || forceRefresh) {\n const el = globalObj.document.createElement('div');\n cachedCssTransformPropertyName_ = 'transform' in el.style ? 'transform' : 'webkitTransform';\n }\n return cachedCssTransformPropertyName_;\n}\n\nexport {getTransformPropertyName};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCList, MDCListFactory} from '@material/list/component';\nimport {MDCListFoundation} from '@material/list/foundation';\nimport {MDCListActionEvent} from '@material/list/types';\nimport {MDCMenuSurface, MDCMenuSurfaceFactory} from '@material/menu-surface/component';\nimport {Corner} from '@material/menu-surface/constants';\nimport {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation';\nimport {MDCMenuDistance} from '@material/menu-surface/types';\nimport {MDCMenuAdapter} from './adapter';\nimport {cssClasses, DefaultFocusState, strings} from './constants';\nimport {MDCMenuFoundation} from './foundation';\nimport {MDCMenuItemComponentEventDetail} from './types';\n\nexport type MDCMenuFactory = (el: Element, foundation?: MDCMenuFoundation) => MDCMenu;\n\nexport class MDCMenu extends MDCComponent<MDCMenuFoundation> {\n static attachTo(root: Element) {\n return new MDCMenu(root);\n }\n\n private menuSurfaceFactory_!: MDCMenuSurfaceFactory; // assigned in initialize()\n private listFactory_!: MDCListFactory; // assigned in initialize()\n\n private menuSurface_!: MDCMenuSurface; // assigned in initialSyncWithDOM()\n private list_!: MDCList | null; // assigned in initialSyncWithDOM()\n\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleItemAction_!: CustomEventListener<MDCListActionEvent>; // assigned in initialSyncWithDOM()\n private handleMenuSurfaceOpened_!: EventListener; // assigned in initialSyncWithDOM()\n\n initialize(\n menuSurfaceFactory: MDCMenuSurfaceFactory = (el) => new MDCMenuSurface(el),\n listFactory: MDCListFactory = (el) => new MDCList(el)) {\n this.menuSurfaceFactory_ = menuSurfaceFactory;\n this.listFactory_ = listFactory;\n }\n\n initialSyncWithDOM() {\n this.menuSurface_ = this.menuSurfaceFactory_(this.root_);\n\n const list = this.root_.querySelector(strings.LIST_SELECTOR);\n if (list) {\n this.list_ = this.listFactory_(list);\n this.list_.wrapFocus = true;\n } else {\n this.list_ = null;\n }\n\n this.handleKeydown_ = (evt) => this.foundation_.handleKeydown(evt);\n this.handleItemAction_ = (evt) => this.foundation_.handleItemAction(this.items[evt.detail.index]);\n this.handleMenuSurfaceOpened_ = () => this.foundation_.handleMenuSurfaceOpened();\n\n this.menuSurface_.listen(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);\n this.listen('keydown', this.handleKeydown_);\n this.listen(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);\n }\n\n destroy() {\n if (this.list_) {\n this.list_.destroy();\n }\n\n this.menuSurface_.destroy();\n this.menuSurface_.unlisten(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);\n super.destroy();\n }\n\n get open(): boolean {\n return this.menuSurface_.isOpen();\n }\n\n set open(value: boolean) {\n if (value) {\n this.menuSurface_.open();\n } else {\n this.menuSurface_.close();\n }\n }\n\n get wrapFocus(): boolean {\n return this.list_ ? this.list_.wrapFocus : false;\n }\n\n set wrapFocus(value: boolean) {\n if (this.list_) {\n this.list_.wrapFocus = value;\n }\n }\n\n /**\n * Return the items within the menu. Note that this only contains the set of elements within\n * the items container that are proper list items, and not supplemental / presentational DOM\n * elements.\n */\n get items(): Element[] {\n return this.list_ ? this.list_.listElements : [];\n }\n\n set quickOpen(quickOpen: boolean) {\n this.menuSurface_.quickOpen = quickOpen;\n }\n\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n * @param focusState Default focus state.\n */\n setDefaultFocusState(focusState: DefaultFocusState) {\n this.foundation_.setDefaultFocusState(focusState);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left menu corner.\n */\n setAnchorCorner(corner: Corner) {\n this.menuSurface_.setAnchorCorner(corner);\n }\n\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.menuSurface_.setAnchorMargin(margin);\n }\n\n /**\n * Sets the list item as the selected row at the specified index.\n * @param index Index of list item within menu.\n */\n setSelectedIndex(index: number) {\n this.foundation_.setSelectedIndex(index);\n }\n\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n setEnabled(index: number, isEnabled: boolean): void {\n this.foundation_.setEnabled(index, isEnabled);\n }\n\n /**\n * @return The item within the menu at the index specified.\n */\n getOptionByIndex(index: number): Element | null {\n const items = this.items;\n\n if (index < items.length) {\n return this.items[index];\n } else {\n return null;\n }\n }\n\n setFixedPosition(isFixed: boolean) {\n this.menuSurface_.setFixedPosition(isFixed);\n }\n\n setIsHoisted(isHoisted: boolean) {\n this.menuSurface_.setIsHoisted(isHoisted);\n }\n\n setAbsolutePosition(x: number, y: number) {\n this.menuSurface_.setAbsolutePosition(x, y);\n }\n\n /**\n * Sets the element that the menu-surface is anchored to.\n */\n setAnchorElement(element: Element) {\n this.menuSurface_.anchorElement = element;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCMenuAdapter = {\n addClassToElementAtIndex: (index, className) => {\n const list = this.items;\n list[index].classList.add(className);\n },\n removeClassFromElementAtIndex: (index, className) => {\n const list = this.items;\n list[index].classList.remove(className);\n },\n addAttributeToElementAtIndex: (index, attr, value) => {\n const list = this.items;\n list[index].setAttribute(attr, value);\n },\n removeAttributeFromElementAtIndex: (index, attr) => {\n const list = this.items;\n list[index].removeAttribute(attr);\n },\n elementContainsClass: (element, className) => element.classList.contains(className),\n closeSurface: (skipRestoreFocus: boolean) => this.menuSurface_.close(skipRestoreFocus),\n getElementIndex: (element) => this.items.indexOf(element),\n notifySelected: (evtData) => this.emit<MDCMenuItemComponentEventDetail>(strings.SELECTED_EVENT, {\n index: evtData.index,\n item: this.items[evtData.index],\n }),\n getMenuItemCount: () => this.items.length,\n focusItemAtIndex: (index) => (this.items[index] as HTMLElement).focus(),\n focusListRoot: () => (this.root_.querySelector(strings.LIST_SELECTOR) as HTMLElement).focus(),\n isSelectableItemAtIndex: (index) => !!closest(this.items[index], `.${cssClasses.MENU_SELECTION_GROUP}`),\n getSelectedSiblingOfItemAtIndex: (index) => {\n const selectionGroupEl = closest(this.items[index], `.${cssClasses.MENU_SELECTION_GROUP}`) as HTMLElement;\n const selectedItemEl = selectionGroupEl.querySelector(`.${cssClasses.MENU_SELECTED_LIST_ITEM}`);\n return selectedItemEl ? this.items.indexOf(selectedItemEl) : -1;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',\n MENU_SELECTION_GROUP: 'mdc-menu__selection-group',\n ROOT: 'mdc-menu',\n};\n\nconst strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_DISABLED_ATTR: 'aria-disabled',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n LIST_SELECTOR: '.mdc-list',\n SELECTED_EVENT: 'MDCMenu:selected',\n};\n\nconst numbers = {\n FOCUS_ROOT_INDEX: -1,\n};\n\nenum DefaultFocusState {\n NONE = 0,\n LIST_ROOT = 1,\n FIRST_ITEM = 2,\n LAST_ITEM = 3,\n}\n\nexport {cssClasses, strings, numbers, DefaultFocusState};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {cssClasses as listCssClasses} from '@material/list/constants';\nimport {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation';\nimport {MDCMenuAdapter} from './adapter';\nimport {cssClasses, DefaultFocusState, numbers, strings} from './constants';\n\nexport class MDCMenuFoundation extends MDCFoundation<MDCMenuAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n private closeAnimationEndTimerId_ = 0;\n private defaultFocusState_ = DefaultFocusState.LIST_ROOT;\n\n /**\n * @see {@link MDCMenuAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCMenuAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClassToElementAtIndex: () => undefined,\n removeClassFromElementAtIndex: () => undefined,\n addAttributeToElementAtIndex: () => undefined,\n removeAttributeFromElementAtIndex: () => undefined,\n elementContainsClass: () => false,\n closeSurface: () => undefined,\n getElementIndex: () => -1,\n notifySelected: () => undefined,\n getMenuItemCount: () => 0,\n focusItemAtIndex: () => undefined,\n focusListRoot: () => undefined,\n getSelectedSiblingOfItemAtIndex: () => -1,\n isSelectableItemAtIndex: () => false,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCMenuAdapter>) {\n super({...MDCMenuFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n if (this.closeAnimationEndTimerId_) {\n clearTimeout(this.closeAnimationEndTimerId_);\n }\n\n this.adapter_.closeSurface();\n }\n\n handleKeydown(evt: KeyboardEvent) {\n const {key, keyCode} = evt;\n const isTab = key === 'Tab' || keyCode === 9;\n\n if (isTab) {\n this.adapter_.closeSurface(/** skipRestoreFocus */ true);\n }\n }\n\n handleItemAction(listItem: Element) {\n const index = this.adapter_.getElementIndex(listItem);\n if (index < 0) {\n return;\n }\n\n this.adapter_.notifySelected({index});\n this.adapter_.closeSurface();\n\n // Wait for the menu to close before adding/removing classes that affect styles.\n this.closeAnimationEndTimerId_ = setTimeout(() => {\n // Recompute the index in case the menu contents have changed.\n const recomputedIndex = this.adapter_.getElementIndex(listItem);\n if (this.adapter_.isSelectableItemAtIndex(recomputedIndex)) {\n this.setSelectedIndex(recomputedIndex);\n }\n }, MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);\n }\n\n handleMenuSurfaceOpened() {\n switch (this.defaultFocusState_) {\n case DefaultFocusState.FIRST_ITEM:\n this.adapter_.focusItemAtIndex(0);\n break;\n case DefaultFocusState.LAST_ITEM:\n this.adapter_.focusItemAtIndex(this.adapter_.getMenuItemCount() - 1);\n break;\n case DefaultFocusState.NONE:\n // Do nothing.\n break;\n default:\n this.adapter_.focusListRoot();\n break;\n }\n }\n\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n */\n setDefaultFocusState(focusState: DefaultFocusState) {\n this.defaultFocusState_ = focusState;\n }\n\n /**\n * Selects the list item at `index` within the menu.\n * @param index Index of list item within the menu.\n */\n setSelectedIndex(index: number) {\n this.validatedIndex_(index);\n\n if (!this.adapter_.isSelectableItemAtIndex(index)) {\n throw new Error('MDCMenuFoundation: No selection group at specified index.');\n }\n\n const prevSelectedIndex = this.adapter_.getSelectedSiblingOfItemAtIndex(index);\n if (prevSelectedIndex >= 0) {\n this.adapter_.removeAttributeFromElementAtIndex(prevSelectedIndex, strings.ARIA_CHECKED_ATTR);\n this.adapter_.removeClassFromElementAtIndex(prevSelectedIndex, cssClasses.MENU_SELECTED_LIST_ITEM);\n }\n\n this.adapter_.addClassToElementAtIndex(index, cssClasses.MENU_SELECTED_LIST_ITEM);\n this.adapter_.addAttributeToElementAtIndex(index, strings.ARIA_CHECKED_ATTR, 'true');\n }\n\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n setEnabled(index: number, isEnabled: boolean): void {\n this.validatedIndex_(index);\n\n if (isEnabled) {\n this.adapter_.removeClassFromElementAtIndex(index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter_.addAttributeToElementAtIndex(index, strings.ARIA_DISABLED_ATTR, 'false');\n } else {\n this.adapter_.addClassToElementAtIndex(index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter_.addAttributeToElementAtIndex(index, strings.ARIA_DISABLED_ATTR, 'true');\n }\n }\n\n private validatedIndex_(index: number): void {\n const menuSize = this.adapter_.getMenuItemCount();\n const isIndexInRange = index >= 0 && index < menuSize;\n\n if (!isIndexInRange) {\n throw new Error('MDCMenuFoundation: No list item at specified index.');\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport {Corner} from '@material/menu-surface/constants'; // for backward compatibility\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCFloatingLabelFoundation} from '@material/floating-label/foundation';\nimport {MDCNotchedOutlineAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCNotchedOutlineFoundation} from './foundation';\n\nexport type MDCNotchedOutlineFactory = (el: Element, foundation?: MDCNotchedOutlineFoundation) => MDCNotchedOutline;\n\nexport class MDCNotchedOutline extends MDCComponent<MDCNotchedOutlineFoundation> {\n static attachTo(root: Element): MDCNotchedOutline {\n return new MDCNotchedOutline(root);\n }\n\n private notchElement_!: HTMLElement; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.notchElement_ = this.root_.querySelector<HTMLElement>(strings.NOTCH_ELEMENT_SELECTOR)!;\n\n const label = this.root_.querySelector<HTMLElement>('.' + MDCFloatingLabelFoundation.cssClasses.ROOT);\n if (label) {\n label.style.transitionDuration = '0s';\n this.root_.classList.add(cssClasses.OUTLINE_UPGRADED);\n requestAnimationFrame(() => {\n label.style.transitionDuration = '';\n });\n } else {\n this.root_.classList.add(cssClasses.NO_LABEL);\n }\n }\n\n /**\n * Updates classes and styles to open the notch to the specified width.\n * @param notchWidth The notch width in the outline.\n */\n notch(notchWidth: number) {\n this.foundation_.notch(notchWidth);\n }\n\n /**\n * Updates classes and styles to close the notch.\n */\n closeNotch() {\n this.foundation_.closeNotch();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCNotchedOutlineAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n setNotchWidthProperty: (width) => this.notchElement_.style.setProperty('width', width + 'px'),\n removeNotchWidthProperty: () => this.notchElement_.style.removeProperty('width'),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCNotchedOutlineFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch',\n};\n\nconst numbers = {\n // This should stay in sync with $mdc-notched-outline-padding * 2.\n NOTCH_ELEMENT_PADDING: 8,\n};\n\nconst cssClasses = {\n NO_LABEL: 'mdc-notched-outline--no-label',\n OUTLINE_NOTCHED: 'mdc-notched-outline--notched',\n OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded',\n};\n\nexport {cssClasses, numbers, strings};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCNotchedOutlineAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCNotchedOutlineFoundation extends MDCFoundation<MDCNotchedOutlineAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n /**\n * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCNotchedOutlineAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNotchWidthProperty: () => undefined,\n removeNotchWidthProperty: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCNotchedOutlineAdapter>) {\n super({...MDCNotchedOutlineFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Adds the outline notched selector and updates the notch width calculated based off of notchWidth.\n */\n notch(notchWidth: number) {\n const {OUTLINE_NOTCHED} = MDCNotchedOutlineFoundation.cssClasses;\n\n if (notchWidth > 0) {\n notchWidth += numbers.NOTCH_ELEMENT_PADDING; // Add padding from left/right.\n }\n\n this.adapter_.setNotchWidthProperty(notchWidth);\n this.adapter_.addClass(OUTLINE_NOTCHED);\n }\n\n /**\n * Removes notched outline selector to close the notch in the outline.\n */\n closeNotch() {\n const {OUTLINE_NOTCHED} = MDCNotchedOutlineFoundation.cssClasses;\n this.adapter_.removeClass(OUTLINE_NOTCHED);\n this.adapter_.removeNotchWidthProperty();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCNotchedOutlineFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCRadioAdapter} from './adapter';\nimport {MDCRadioFoundation} from './foundation';\n\nexport class MDCRadio extends MDCComponent<MDCRadioFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element) {\n return new MDCRadio(root);\n }\n\n get checked(): boolean {\n return this.nativeControl_.checked;\n }\n\n set checked(checked: boolean) {\n this.nativeControl_.checked = checked;\n }\n\n get disabled() {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.foundation_.setDisabled(disabled);\n }\n\n get value() {\n return this.nativeControl_.value;\n }\n\n set value(value: string) {\n this.nativeControl_.value = value;\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n // Public visibility for this property is required by MDCRippleCapableSurface.\n root_!: Element; // assigned in MDCComponent constructor\n\n private readonly ripple_: MDCRipple = this.createRipple_();\n\n destroy() {\n this.ripple_.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRadioAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n setNativeControlDisabled: (disabled) => this.nativeControl_.disabled = disabled,\n };\n return new MDCRadioFoundation(adapter);\n }\n\n private createRipple_(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n registerInteractionHandler: (evtType, handler) => this.nativeControl_.addEventListener(\n evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) => this.nativeControl_.removeEventListener(\n evtType, handler, applyPassive()),\n // Radio buttons technically go \"active\" whenever there is *any* keyboard interaction.\n // This is not the UI we desire.\n isSurfaceActive: () => false,\n isUnbounded: () => true,\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCRipple(this.root_, new MDCRippleFoundation(adapter));\n }\n\n private get nativeControl_(): HTMLInputElement {\n const {NATIVE_CONTROL_SELECTOR} = MDCRadioFoundation.strings;\n const el = this.root_.querySelector<HTMLInputElement>(NATIVE_CONTROL_SELECTOR);\n if (!el) {\n throw new Error(`Radio component requires a ${NATIVE_CONTROL_SELECTOR} element`);\n }\n return el;\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control',\n};\n\nconst cssClasses = {\n DISABLED: 'mdc-radio--disabled',\n ROOT: 'mdc-radio',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCRadioAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCRadioFoundation extends MDCFoundation<MDCRadioAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCRadioAdapter {\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNativeControlDisabled: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCRadioAdapter>) {\n super({...MDCRadioFoundation.defaultAdapter, ...adapter});\n }\n\n setDisabled(disabled: boolean) {\n const {DISABLED} = MDCRadioFoundation.cssClasses;\n this.adapter_.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter_.addClass(DISABLED);\n } else {\n this.adapter_.removeClass(DISABLED);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRadioFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from './adapter';\nimport {MDCRippleFoundation} from './foundation';\nimport {MDCRippleAttachOpts, MDCRippleCapableSurface} from './types';\nimport * as util from './util';\n\nexport type MDCRippleFactory = (el: Element, foundation?: MDCRippleFoundation) => MDCRipple;\n\nexport class MDCRipple extends MDCComponent<MDCRippleFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element, opts: MDCRippleAttachOpts = {isUnbounded: undefined}): MDCRipple {\n const ripple = new MDCRipple(root);\n // Only override unbounded behavior if option is explicitly specified\n if (opts.isUnbounded !== undefined) {\n ripple.unbounded = opts.isUnbounded;\n }\n return ripple;\n }\n\n static createAdapter(instance: MDCRippleCapableSurface): MDCRippleAdapter {\n return {\n addClass: (className) => instance.root_.classList.add(className),\n browserSupportsCssVars: () => util.supportsCssVariables(window),\n computeBoundingRect: () => instance.root_.getBoundingClientRect(),\n containsEventTarget: (target) => instance.root_.contains(target as Node),\n deregisterDocumentInteractionHandler: (evtType, handler) =>\n document.documentElement.removeEventListener(evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n (instance.root_ as HTMLElement).removeEventListener(evtType, handler, applyPassive()),\n deregisterResizeHandler: (handler) => window.removeEventListener('resize', handler),\n getWindowPageOffset: () => ({x: window.pageXOffset, y: window.pageYOffset}),\n isSurfaceActive: () => matches(instance.root_, ':active'),\n isSurfaceDisabled: () => Boolean(instance.disabled),\n isUnbounded: () => Boolean(instance.unbounded),\n registerDocumentInteractionHandler: (evtType, handler) =>\n document.documentElement.addEventListener(evtType, handler, applyPassive()),\n registerInteractionHandler: (evtType, handler) =>\n (instance.root_ as HTMLElement).addEventListener(evtType, handler, applyPassive()),\n registerResizeHandler: (handler) => window.addEventListener('resize', handler),\n removeClass: (className) => instance.root_.classList.remove(className),\n updateCssVariable: (varName, value) => (instance.root_ as HTMLElement).style.setProperty(varName, value),\n };\n }\n\n // Public visibility for this property is required by MDCRippleCapableSurface.\n root_!: Element; // assigned in MDCComponent constructor\n\n disabled = false;\n\n private unbounded_?: boolean;\n\n get unbounded(): boolean {\n return Boolean(this.unbounded_);\n }\n\n set unbounded(unbounded: boolean) {\n this.unbounded_ = Boolean(unbounded);\n this.setUnbounded_();\n }\n\n activate() {\n this.foundation_.activate();\n }\n\n deactivate() {\n this.foundation_.deactivate();\n }\n\n layout() {\n this.foundation_.layout();\n }\n\n getDefaultFoundation() {\n return new MDCRippleFoundation(MDCRipple.createAdapter(this));\n }\n\n initialSyncWithDOM() {\n const root = this.root_ as HTMLElement;\n this.unbounded = 'mdcRippleIsUnbounded' in root.dataset;\n }\n\n /**\n * Closure Compiler throws an access control error when directly accessing a\n * protected or private property inside a getter/setter, like unbounded above.\n * By accessing the protected property inside a method, we solve that problem.\n * That's why this function exists.\n */\n private setUnbounded_() {\n this.foundation_.setUnbounded(Boolean(this.unbounded_));\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n // Ripple is a special case where the \"root\" component is really a \"mixin\" of sorts,\n // given that it's an 'upgrade' to an existing component. That being said it is the root\n // CSS class that all other CSS classes derive from.\n BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',\n FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',\n FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',\n ROOT: 'mdc-ripple-upgraded',\n UNBOUNDED: 'mdc-ripple-upgraded--unbounded',\n};\n\nexport const strings = {\n VAR_FG_SCALE: '--mdc-ripple-fg-scale',\n VAR_FG_SIZE: '--mdc-ripple-fg-size',\n VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',\n VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',\n VAR_LEFT: '--mdc-ripple-left',\n VAR_TOP: '--mdc-ripple-top',\n};\n\nexport const numbers = {\n DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)\n FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)\n INITIAL_ORIGIN_SCALE: 0.6,\n PADDING: 10,\n TAP_DELAY_MS: 300, // Delay between touch and simulated mouse events on touch devices\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCRippleAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCRipplePoint} from './types';\nimport {getNormalizedEventCoords} from './util';\n\ninterface ActivationStateType {\n isActivated?: boolean;\n hasDeactivationUXRun?: boolean;\n wasActivatedByPointer?: boolean;\n wasElementMadeActive?: boolean;\n activationEvent?: Event;\n isProgrammatic?: boolean;\n}\n\ninterface FgTranslationCoordinates {\n startPoint: MDCRipplePoint;\n endPoint: MDCRipplePoint;\n}\n\ninterface Coordinates {\n left: number;\n top: number;\n}\n\ntype ActivationEventType = 'touchstart' | 'pointerdown' | 'mousedown' | 'keydown';\ntype DeactivationEventType = 'touchend' | 'pointerup' | 'mouseup' | 'contextmenu';\n\n// Activation events registered on the root element of each instance for activation\nconst ACTIVATION_EVENT_TYPES: ActivationEventType[] = [\n 'touchstart', 'pointerdown', 'mousedown', 'keydown',\n];\n\n// Deactivation events registered on documentElement when a pointer-related down event occurs\nconst POINTER_DEACTIVATION_EVENT_TYPES: DeactivationEventType[] = [\n 'touchend', 'pointerup', 'mouseup', 'contextmenu',\n];\n\n// simultaneous nested activations\nlet activatedTargets: Array<EventTarget | null> = [];\n\nexport class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCRippleAdapter {\n return {\n addClass: () => undefined,\n browserSupportsCssVars: () => true,\n computeBoundingRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n containsEventTarget: () => true,\n deregisterDocumentInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n deregisterResizeHandler: () => undefined,\n getWindowPageOffset: () => ({x: 0, y: 0}),\n isSurfaceActive: () => true,\n isSurfaceDisabled: () => true,\n isUnbounded: () => true,\n registerDocumentInteractionHandler: () => undefined,\n registerInteractionHandler: () => undefined,\n registerResizeHandler: () => undefined,\n removeClass: () => undefined,\n updateCssVariable: () => undefined,\n };\n }\n\n private activationAnimationHasEnded_ = false;\n private activationState_: ActivationStateType;\n private activationTimer_ = 0;\n private fgDeactivationRemovalTimer_ = 0;\n private fgScale_ = '0';\n private frame_ = {width: 0, height: 0};\n private initialSize_ = 0;\n private layoutFrame_ = 0;\n private maxRadius_ = 0;\n private unboundedCoords_: Coordinates = {left: 0, top: 0};\n\n private readonly activationTimerCallback_: () => void;\n private readonly activateHandler_: EventHandlerNonNull;\n private readonly deactivateHandler_: EventHandlerNonNull;\n private readonly focusHandler_: EventHandlerNonNull;\n private readonly blurHandler_: EventHandlerNonNull;\n private readonly resizeHandler_: EventHandlerNonNull;\n\n private previousActivationEvent_?: Event;\n\n constructor(adapter?: Partial<MDCRippleAdapter>) {\n super({...MDCRippleFoundation.defaultAdapter, ...adapter});\n\n this.activationState_ = this.defaultActivationState_();\n\n this.activationTimerCallback_ = () => {\n this.activationAnimationHasEnded_ = true;\n this.runDeactivationUXLogicIfReady_();\n };\n this.activateHandler_ = (e) => this.activate_(e);\n this.deactivateHandler_ = () => this.deactivate_();\n this.focusHandler_ = () => this.handleFocus();\n this.blurHandler_ = () => this.handleBlur();\n this.resizeHandler_ = () => this.layout();\n }\n\n init() {\n const supportsPressRipple = this.supportsPressRipple_();\n\n this.registerRootHandlers_(supportsPressRipple);\n\n if (supportsPressRipple) {\n const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n requestAnimationFrame(() => {\n this.adapter_.addClass(ROOT);\n if (this.adapter_.isUnbounded()) {\n this.adapter_.addClass(UNBOUNDED);\n // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple\n this.layoutInternal_();\n }\n });\n }\n }\n\n destroy() {\n if (this.supportsPressRipple_()) {\n if (this.activationTimer_) {\n clearTimeout(this.activationTimer_);\n this.activationTimer_ = 0;\n this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);\n }\n\n if (this.fgDeactivationRemovalTimer_) {\n clearTimeout(this.fgDeactivationRemovalTimer_);\n this.fgDeactivationRemovalTimer_ = 0;\n this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);\n }\n\n const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n requestAnimationFrame(() => {\n this.adapter_.removeClass(ROOT);\n this.adapter_.removeClass(UNBOUNDED);\n this.removeCssVars_();\n });\n }\n\n this.deregisterRootHandlers_();\n this.deregisterDeactivationHandlers_();\n }\n\n /**\n * @param evt Optional event containing position information.\n */\n activate(evt?: Event): void {\n this.activate_(evt);\n }\n\n deactivate(): void {\n this.deactivate_();\n }\n\n layout(): void {\n if (this.layoutFrame_) {\n cancelAnimationFrame(this.layoutFrame_);\n }\n this.layoutFrame_ = requestAnimationFrame(() => {\n this.layoutInternal_();\n this.layoutFrame_ = 0;\n });\n }\n\n setUnbounded(unbounded: boolean): void {\n const {UNBOUNDED} = MDCRippleFoundation.cssClasses;\n if (unbounded) {\n this.adapter_.addClass(UNBOUNDED);\n } else {\n this.adapter_.removeClass(UNBOUNDED);\n }\n }\n\n handleFocus(): void {\n requestAnimationFrame(() =>\n this.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED));\n }\n\n handleBlur(): void {\n requestAnimationFrame(() =>\n this.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED));\n }\n\n /**\n * We compute this property so that we are not querying information about the client\n * until the point in time where the foundation requests it. This prevents scenarios where\n * client-side feature-detection may happen too early, such as when components are rendered on the server\n * and then initialized at mount time on the client.\n */\n private supportsPressRipple_(): boolean {\n return this.adapter_.browserSupportsCssVars();\n }\n\n private defaultActivationState_(): ActivationStateType {\n return {\n activationEvent: undefined,\n hasDeactivationUXRun: false,\n isActivated: false,\n isProgrammatic: false,\n wasActivatedByPointer: false,\n wasElementMadeActive: false,\n };\n }\n\n /**\n * supportsPressRipple Passed from init to save a redundant function call\n */\n private registerRootHandlers_(supportsPressRipple: boolean) {\n if (supportsPressRipple) {\n ACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter_.registerInteractionHandler(evtType, this.activateHandler_);\n });\n if (this.adapter_.isUnbounded()) {\n this.adapter_.registerResizeHandler(this.resizeHandler_);\n }\n }\n\n this.adapter_.registerInteractionHandler('focus', this.focusHandler_);\n this.adapter_.registerInteractionHandler('blur', this.blurHandler_);\n }\n\n private registerDeactivationHandlers_(evt: Event) {\n if (evt.type === 'keydown') {\n this.adapter_.registerInteractionHandler('keyup', this.deactivateHandler_);\n } else {\n POINTER_DEACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter_.registerDocumentInteractionHandler(evtType, this.deactivateHandler_);\n });\n }\n }\n\n private deregisterRootHandlers_() {\n ACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter_.deregisterInteractionHandler(evtType, this.activateHandler_);\n });\n this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);\n this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);\n\n if (this.adapter_.isUnbounded()) {\n this.adapter_.deregisterResizeHandler(this.resizeHandler_);\n }\n }\n\n private deregisterDeactivationHandlers_() {\n this.adapter_.deregisterInteractionHandler('keyup', this.deactivateHandler_);\n POINTER_DEACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter_.deregisterDocumentInteractionHandler(evtType, this.deactivateHandler_);\n });\n }\n\n private removeCssVars_() {\n const rippleStrings = MDCRippleFoundation.strings;\n const keys = Object.keys(rippleStrings) as Array<keyof typeof rippleStrings>;\n keys.forEach((key) => {\n if (key.indexOf('VAR_') === 0) {\n this.adapter_.updateCssVariable(rippleStrings[key], null);\n }\n });\n }\n\n private activate_(evt?: Event) {\n if (this.adapter_.isSurfaceDisabled()) {\n return;\n }\n\n const activationState = this.activationState_;\n if (activationState.isActivated) {\n return;\n }\n\n // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction\n const previousActivationEvent = this.previousActivationEvent_;\n const isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;\n if (isSameInteraction) {\n return;\n }\n\n activationState.isActivated = true;\n activationState.isProgrammatic = evt === undefined;\n activationState.activationEvent = evt;\n activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (\n evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown'\n );\n\n const hasActivatedChild = evt !== undefined && activatedTargets.length > 0 && activatedTargets.some(\n (target) => this.adapter_.containsEventTarget(target));\n if (hasActivatedChild) {\n // Immediately reset activation state, while preserving logic that prevents touch follow-on events\n this.resetActivationState_();\n return;\n }\n\n if (evt !== undefined) {\n activatedTargets.push(evt.target);\n this.registerDeactivationHandlers_(evt);\n }\n\n activationState.wasElementMadeActive = this.checkElementMadeActive_(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation_();\n }\n\n requestAnimationFrame(() => {\n // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples\n activatedTargets = [];\n\n if (!activationState.wasElementMadeActive\n && evt !== undefined\n && ((evt as KeyboardEvent).key === ' ' || (evt as KeyboardEvent).keyCode === 32)) {\n // If space was pressed, try again within an rAF call to detect :active, because different UAs report\n // active states inconsistently when they're called within event handling code:\n // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741\n // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS\n // variable is set within a rAF callback for a submit button interaction (#2241).\n activationState.wasElementMadeActive = this.checkElementMadeActive_(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation_();\n }\n }\n\n if (!activationState.wasElementMadeActive) {\n // Reset activation state immediately if element was not made active.\n this.activationState_ = this.defaultActivationState_();\n }\n });\n }\n\n private checkElementMadeActive_(evt?: Event) {\n return (evt !== undefined && evt.type === 'keydown') ? this.adapter_.isSurfaceActive() : true;\n }\n\n private animateActivation_() {\n const {VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END} = MDCRippleFoundation.strings;\n const {FG_DEACTIVATION, FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n const {DEACTIVATION_TIMEOUT_MS} = MDCRippleFoundation.numbers;\n\n this.layoutInternal_();\n\n let translateStart = '';\n let translateEnd = '';\n\n if (!this.adapter_.isUnbounded()) {\n const {startPoint, endPoint} = this.getFgTranslationCoordinates_();\n translateStart = `${startPoint.x}px, ${startPoint.y}px`;\n translateEnd = `${endPoint.x}px, ${endPoint.y}px`;\n }\n\n this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);\n this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);\n // Cancel any ongoing activation/deactivation animations\n clearTimeout(this.activationTimer_);\n clearTimeout(this.fgDeactivationRemovalTimer_);\n this.rmBoundedActivationClasses_();\n this.adapter_.removeClass(FG_DEACTIVATION);\n\n // Force layout in order to re-trigger the animation.\n this.adapter_.computeBoundingRect();\n this.adapter_.addClass(FG_ACTIVATION);\n this.activationTimer_ = setTimeout(() => this.activationTimerCallback_(), DEACTIVATION_TIMEOUT_MS);\n }\n\n private getFgTranslationCoordinates_(): FgTranslationCoordinates {\n const {activationEvent, wasActivatedByPointer} = this.activationState_;\n\n let startPoint;\n if (wasActivatedByPointer) {\n startPoint = getNormalizedEventCoords(\n activationEvent,\n this.adapter_.getWindowPageOffset(),\n this.adapter_.computeBoundingRect(),\n );\n } else {\n startPoint = {\n x: this.frame_.width / 2,\n y: this.frame_.height / 2,\n };\n }\n // Center the element around the start point.\n startPoint = {\n x: startPoint.x - (this.initialSize_ / 2),\n y: startPoint.y - (this.initialSize_ / 2),\n };\n\n const endPoint = {\n x: (this.frame_.width / 2) - (this.initialSize_ / 2),\n y: (this.frame_.height / 2) - (this.initialSize_ / 2),\n };\n\n return {startPoint, endPoint};\n }\n\n private runDeactivationUXLogicIfReady_() {\n // This method is called both when a pointing device is released, and when the activation animation ends.\n // The deactivation animation should only run after both of those occur.\n const {FG_DEACTIVATION} = MDCRippleFoundation.cssClasses;\n const {hasDeactivationUXRun, isActivated} = this.activationState_;\n const activationHasEnded = hasDeactivationUXRun || !isActivated;\n\n if (activationHasEnded && this.activationAnimationHasEnded_) {\n this.rmBoundedActivationClasses_();\n this.adapter_.addClass(FG_DEACTIVATION);\n this.fgDeactivationRemovalTimer_ = setTimeout(() => {\n this.adapter_.removeClass(FG_DEACTIVATION);\n }, numbers.FG_DEACTIVATION_MS);\n }\n }\n\n private rmBoundedActivationClasses_() {\n const {FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n this.adapter_.removeClass(FG_ACTIVATION);\n this.activationAnimationHasEnded_ = false;\n this.adapter_.computeBoundingRect();\n }\n\n private resetActivationState_() {\n this.previousActivationEvent_ = this.activationState_.activationEvent;\n this.activationState_ = this.defaultActivationState_();\n // Touch devices may fire additional events for the same interaction within a short time.\n // Store the previous event until it's safe to assume that subsequent events are for new interactions.\n setTimeout(() => this.previousActivationEvent_ = undefined, MDCRippleFoundation.numbers.TAP_DELAY_MS);\n }\n\n private deactivate_(): void {\n const activationState = this.activationState_;\n // This can happen in scenarios such as when you have a keyup event that blurs the element.\n if (!activationState.isActivated) {\n return;\n }\n\n const state: ActivationStateType = {...activationState};\n\n if (activationState.isProgrammatic) {\n requestAnimationFrame(() => this.animateDeactivation_(state));\n this.resetActivationState_();\n } else {\n this.deregisterDeactivationHandlers_();\n requestAnimationFrame(() => {\n this.activationState_.hasDeactivationUXRun = true;\n this.animateDeactivation_(state);\n this.resetActivationState_();\n });\n }\n }\n\n private animateDeactivation_({wasActivatedByPointer, wasElementMadeActive}: ActivationStateType) {\n if (wasActivatedByPointer || wasElementMadeActive) {\n this.runDeactivationUXLogicIfReady_();\n }\n }\n\n private layoutInternal_() {\n this.frame_ = this.adapter_.computeBoundingRect();\n const maxDim = Math.max(this.frame_.height, this.frame_.width);\n\n // Surface diameter is treated differently for unbounded vs. bounded ripples.\n // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately\n // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically\n // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter\n // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via\n // `overflow: hidden`.\n const getBoundedRadius = () => {\n const hypotenuse = Math.sqrt(Math.pow(this.frame_.width, 2) + Math.pow(this.frame_.height, 2));\n return hypotenuse + MDCRippleFoundation.numbers.PADDING;\n };\n\n this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius();\n\n // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform\n const initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);\n // Unbounded ripple size should always be even number to equally center align.\n if (this.adapter_.isUnbounded() && initialSize % 2 !== 0) {\n this.initialSize_ = initialSize - 1;\n } else {\n this.initialSize_ = initialSize;\n }\n this.fgScale_ = `${this.maxRadius_ / this.initialSize_}`;\n\n this.updateLayoutCssVars_();\n }\n\n private updateLayoutCssVars_() {\n const {\n VAR_FG_SIZE, VAR_LEFT, VAR_TOP, VAR_FG_SCALE,\n } = MDCRippleFoundation.strings;\n\n this.adapter_.updateCssVariable(VAR_FG_SIZE, `${this.initialSize_}px`);\n this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);\n\n if (this.adapter_.isUnbounded()) {\n this.unboundedCoords_ = {\n left: Math.round((this.frame_.width / 2) - (this.initialSize_ / 2)),\n top: Math.round((this.frame_.height / 2) - (this.initialSize_ / 2)),\n };\n\n this.adapter_.updateCssVariable(VAR_LEFT, `${this.unboundedCoords_.left}px`);\n this.adapter_.updateCssVariable(VAR_TOP, `${this.unboundedCoords_.top}px`);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRippleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport {MDCRipplePoint} from './types';\n\n/**\n * Stores result from supportsCssVariables to avoid redundant processing to\n * detect CSS custom variable support.\n */\nlet supportsCssVariables_: boolean | undefined;\n\nexport function supportsCssVariables(windowObj: Window, forceRefresh = false): boolean {\n const {CSS} = windowObj;\n let supportsCssVars = supportsCssVariables_;\n if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {\n return supportsCssVariables_;\n }\n\n const supportsFunctionPresent = CSS && typeof CSS.supports === 'function';\n if (!supportsFunctionPresent) {\n return false;\n }\n\n const explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');\n // See: https://bugs.webkit.org/show_bug.cgi?id=154669\n // See: README section on Safari\n const weAreFeatureDetectingSafari10plus = (\n CSS.supports('(--css-vars: yes)') &&\n CSS.supports('color', '#00000000')\n );\n\n supportsCssVars =\n explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;\n\n if (!forceRefresh) {\n supportsCssVariables_ = supportsCssVars;\n }\n return supportsCssVars;\n}\n\nexport function getNormalizedEventCoords(evt: Event | undefined, pageOffset: MDCRipplePoint, clientRect: ClientRect):\n MDCRipplePoint {\n if (!evt) {\n return {x: 0, y: 0};\n }\n const {x, y} = pageOffset;\n const documentX = x + clientRect.left;\n const documentY = y + clientRect.top;\n\n let normalizedX;\n let normalizedY;\n // Determine touch point relative to the ripple container.\n if (evt.type === 'touchstart') {\n const touchEvent = evt as TouchEvent;\n normalizedX = touchEvent.changedTouches[0].pageX - documentX;\n normalizedY = touchEvent.changedTouches[0].pageY - documentY;\n } else {\n const mouseEvent = evt as MouseEvent;\n normalizedX = mouseEvent.pageX - documentX;\n normalizedY = mouseEvent.pageY - documentY;\n }\n\n return {x: normalizedX, y: normalizedY};\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCFloatingLabel, MDCFloatingLabelFactory} from '@material/floating-label/component';\nimport {MDCLineRipple, MDCLineRippleFactory} from '@material/line-ripple/component';\nimport * as menuSurfaceConstants from '@material/menu-surface/constants';\nimport {MDCMenu, MDCMenuFactory} from '@material/menu/component';\nimport * as menuConstants from '@material/menu/constants';\nimport {MDCMenuItemEvent} from '@material/menu/types';\nimport {MDCNotchedOutline, MDCNotchedOutlineFactory} from '@material/notched-outline/component';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCSelectAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCSelectFoundation} from './foundation';\nimport {MDCSelectHelperText, MDCSelectHelperTextFactory} from './helper-text/component';\nimport {MDCSelectIcon, MDCSelectIconFactory} from './icon/component';\nimport {MDCSelectEventDetail, MDCSelectFoundationMap} from './types';\n\nexport class MDCSelect extends MDCComponent<MDCSelectFoundation> {\n static attachTo(root: Element): MDCSelect {\n return new MDCSelect(root);\n }\n\n // Root container for select (anchor) element and menu.\n protected root_!: HTMLElement; // assigned in MDCComponent constructor\n\n private ripple_!: MDCRipple | null;\n\n private menu_!: MDCMenu; // assigned in menuSetup_()\n\n private selectAnchor_!: HTMLElement; // assigned in initialize()\n private selectedText_!: HTMLElement; // assigned in initialize()\n\n private menuElement_!: Element; // assigned in menuSetup_()\n private leadingIcon_?: MDCSelectIcon; // assigned in initialize()\n private helperText_!: MDCSelectHelperText | null; // assigned in initialize()\n private lineRipple_!: MDCLineRipple | null; // assigned in initialize()\n private label_!: MDCFloatingLabel | null; // assigned in initialize()\n private outline_!: MDCNotchedOutline | null; // assigned in initialize()\n private handleChange_!: SpecificEventListener<'change'>; // assigned in initialize()\n private handleFocus_!: SpecificEventListener<'focus'>; // assigned in initialize()\n private handleBlur_!: SpecificEventListener<'blur'>; // assigned in initialize()\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialize()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialize()\n private handleMenuOpened_!: EventListener; // assigned in initialize()\n private handleMenuClosed_!: EventListener; // assigned in initialize()\n private handleMenuItemAction_!: CustomEventListener<MDCMenuItemEvent>; // assigned in initialize()\n\n initialize(\n labelFactory: MDCFloatingLabelFactory = (el) => new MDCFloatingLabel(el),\n lineRippleFactory: MDCLineRippleFactory = (el) => new MDCLineRipple(el),\n outlineFactory: MDCNotchedOutlineFactory = (el) => new MDCNotchedOutline(el),\n menuFactory: MDCMenuFactory = (el) => new MDCMenu(el),\n iconFactory: MDCSelectIconFactory = (el) => new MDCSelectIcon(el),\n helperTextFactory: MDCSelectHelperTextFactory = (el) => new MDCSelectHelperText(el),\n ) {\n this.selectAnchor_ = this.root_.querySelector(strings.SELECT_ANCHOR_SELECTOR) as HTMLElement;\n this.selectedText_ = this.root_.querySelector(strings.SELECTED_TEXT_SELECTOR) as HTMLElement;\n\n if (!this.selectedText_) {\n throw new Error(\n 'MDCSelect: Missing required element: The following selector must be present: ' +\n `'${strings.SELECTED_TEXT_SELECTOR}'`,\n );\n }\n\n if (this.selectedText_.hasAttribute(strings.ARIA_CONTROLS)) {\n const helperTextElement = document.getElementById(this.selectedText_.getAttribute(strings.ARIA_CONTROLS)!);\n if (helperTextElement) {\n this.helperText_ = helperTextFactory(helperTextElement);\n }\n }\n\n this.menuSetup_(menuFactory);\n\n const labelElement = this.root_.querySelector(strings.LABEL_SELECTOR);\n this.label_ = labelElement ? labelFactory(labelElement) : null;\n\n const lineRippleElement = this.root_.querySelector(strings.LINE_RIPPLE_SELECTOR);\n this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;\n\n const outlineElement = this.root_.querySelector(strings.OUTLINE_SELECTOR);\n this.outline_ = outlineElement ? outlineFactory(outlineElement) : null;\n\n const leadingIcon = this.root_.querySelector(strings.LEADING_ICON_SELECTOR);\n if (leadingIcon) {\n this.leadingIcon_ = iconFactory(leadingIcon);\n }\n\n if (!this.root_.classList.contains(cssClasses.OUTLINED)) {\n this.ripple_ = this.createRipple_();\n }\n }\n\n /**\n * Initializes the select's event listeners and internal state based\n * on the environment's state.\n */\n initialSyncWithDOM() {\n this.handleChange_ = () => this.foundation_.handleChange();\n this.handleFocus_ = () => this.foundation_.handleFocus();\n this.handleBlur_ = () => this.foundation_.handleBlur();\n this.handleClick_ = (evt) => {\n this.selectedText_.focus();\n this.foundation_.handleClick(this.getNormalizedXCoordinate_(evt));\n };\n this.handleKeydown_ = (evt) => this.foundation_.handleKeydown(evt);\n this.handleMenuItemAction_ = (evt) => this.foundation_.handleMenuItemAction(evt.detail.index);\n this.handleMenuOpened_ = () => this.foundation_.handleMenuOpened();\n this.handleMenuClosed_ = () => this.foundation_.handleMenuClosed();\n\n this.selectedText_.addEventListener('focus', this.handleFocus_);\n this.selectedText_.addEventListener('blur', this.handleBlur_);\n\n this.selectedText_.addEventListener('click', this.handleClick_ as EventListener);\n\n this.selectedText_!.addEventListener('keydown', this.handleKeydown_);\n this.menu_!.listen(menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed_);\n this.menu_!.listen(menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened_);\n this.menu_!.listen(menuConstants.strings.SELECTED_EVENT, this.handleMenuItemAction_);\n this.foundation_.init();\n\n // Sets disabled state in foundation\n this.disabled = this.root_.classList.contains(cssClasses.DISABLED);\n }\n\n destroy() {\n this.selectedText_.removeEventListener('change', this.handleChange_);\n this.selectedText_.removeEventListener('focus', this.handleFocus_);\n this.selectedText_.removeEventListener('blur', this.handleBlur_);\n this.selectedText_.removeEventListener('keydown', this.handleKeydown_);\n this.selectedText_.removeEventListener('click', this.handleClick_ as EventListener);\n\n this.menu_.unlisten(menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed_);\n this.menu_.unlisten(menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened_);\n this.menu_.unlisten(menuConstants.strings.SELECTED_EVENT, this.handleMenuItemAction_);\n this.menu_.destroy();\n\n if (this.ripple_) {\n this.ripple_.destroy();\n }\n if (this.outline_) {\n this.outline_.destroy();\n }\n if (this.leadingIcon_) {\n this.leadingIcon_.destroy();\n }\n if (this.helperText_) {\n this.helperText_.destroy();\n }\n\n super.destroy();\n }\n\n get value(): string {\n return this.foundation_.getValue();\n }\n\n set value(value: string) {\n this.foundation_.setValue(value);\n }\n\n get selectedIndex(): number {\n return this.foundation_.getSelectedIndex();\n }\n\n set selectedIndex(selectedIndex: number) {\n this.foundation_.setSelectedIndex(selectedIndex, /** closeMenu */ true);\n }\n\n get disabled(): boolean {\n return this.foundation_.getDisabled();\n }\n\n set disabled(disabled: boolean) {\n this.foundation_.setDisabled(disabled);\n }\n\n set leadingIconAriaLabel(label: string) {\n this.foundation_.setLeadingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n set leadingIconContent(content: string) {\n this.foundation_.setLeadingIconContent(content);\n }\n\n /**\n * Sets the text content of the helper text.\n */\n set helperTextContent(content: string) {\n this.foundation_.setHelperTextContent(content);\n }\n\n /**\n * Sets the current invalid state of the select.\n */\n set valid(isValid: boolean) {\n this.foundation_.setValid(isValid);\n }\n\n /**\n * Checks if the select is in a valid state.\n */\n get valid(): boolean {\n return this.foundation_.isValid();\n }\n\n /**\n * Sets the control to the required state.\n */\n set required(isRequired: boolean) {\n this.foundation_.setRequired(isRequired);\n }\n\n /**\n * Returns whether the select is required.\n */\n get required(): boolean {\n return this.foundation_.getRequired();\n }\n\n /**\n * Recomputes the outline SVG path for the outline element.\n */\n layout() {\n this.foundation_.layout();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSelectAdapter = {\n ...this.getSelectAdapterMethods_(),\n ...this.getCommonAdapterMethods_(),\n ...this.getOutlineAdapterMethods_(),\n ...this.getLabelAdapterMethods_(),\n };\n return new MDCSelectFoundation(adapter, this.getFoundationMap_());\n }\n\n /**\n * Handles setup for the menu.\n */\n private menuSetup_(menuFactory: MDCMenuFactory) {\n this.menuElement_ = this.root_.querySelector(strings.MENU_SELECTOR)!;\n this.menu_ = menuFactory(this.menuElement_);\n }\n\n private createRipple_(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter({root_: this.selectAnchor_}),\n registerInteractionHandler: (evtType, handler) => this.selectedText_.addEventListener(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) => this.selectedText_.removeEventListener(evtType, handler),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCRipple(this.selectAnchor_, new MDCRippleFoundation(adapter));\n }\n\n private getSelectAdapterMethods_() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getSelectedMenuItem: () => this.menuElement_!.querySelector(strings.SELECTED_ITEM_SELECTOR),\n getMenuItemAttr: (menuItem: Element, attr: string) => menuItem.getAttribute(attr),\n setSelectedText: (text: string) => this.selectedText_.textContent = text,\n isSelectedTextFocused: () => document.activeElement === this.selectedText_,\n getSelectedTextAttr: (attr: string) => this.selectedText_.getAttribute(attr),\n setSelectedTextAttr: (attr: string, value: string) => this.selectedText_.setAttribute(attr, value),\n openMenu: () => this.menu_.open = true,\n closeMenu: () => this.menu_.open = false,\n getAnchorElement: () => this.root_.querySelector(strings.SELECT_ANCHOR_SELECTOR)!,\n setMenuAnchorElement: (anchorEl: HTMLElement) => this.menu_.setAnchorElement(anchorEl),\n setMenuAnchorCorner: (anchorCorner: menuSurfaceConstants.Corner) => this.menu_.setAnchorCorner(anchorCorner),\n setMenuWrapFocus: (wrapFocus: boolean) => this.menu_.wrapFocus = wrapFocus,\n setAttributeAtIndex: (index: number, attributeName: string, attributeValue: string) =>\n this.menu_.items[index].setAttribute(attributeName, attributeValue),\n removeAttributeAtIndex: (index: number, attributeName: string) =>\n this.menu_.items[index].removeAttribute(attributeName),\n focusMenuItemAtIndex: (index: number) => (this.menu_.items[index] as HTMLElement).focus(),\n getMenuItemCount: () => this.menu_.items.length,\n getMenuItemValues: () => this.menu_.items.map((el) => el.getAttribute(strings.VALUE_ATTR) || ''),\n getMenuItemTextAtIndex: (index: number) => this.menu_.items[index].textContent as string,\n addClassAtIndex: (index: number, className: string) => this.menu_.items[index].classList.add(className),\n removeClassAtIndex: (index: number, className: string) => this.menu_.items[index].classList.remove(className),\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getCommonAdapterMethods_() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: (className: string) => this.root_.classList.add(className),\n removeClass: (className: string) => this.root_.classList.remove(className),\n hasClass: (className: string) => this.root_.classList.contains(className),\n setRippleCenter: (normalizedX: number) => this.lineRipple_ && this.lineRipple_.setRippleCenter(normalizedX),\n activateBottomLine: () => this.lineRipple_ && this.lineRipple_.activate(),\n deactivateBottomLine: () => this.lineRipple_ && this.lineRipple_.deactivate(),\n notifyChange: (value: string) => {\n const index = this.selectedIndex;\n this.emit<MDCSelectEventDetail>(strings.CHANGE_EVENT, {value, index}, true /* shouldBubble */);\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getOutlineAdapterMethods_() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n hasOutline: () => Boolean(this.outline_),\n notchOutline: (labelWidth: number) => this.outline_ && this.outline_.notch(labelWidth),\n closeOutline: () => this.outline_ && this.outline_.closeNotch(),\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getLabelAdapterMethods_() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n hasLabel: () => !!this.label_,\n floatLabel: (shouldFloat: boolean) => this.label_ && this.label_.float(shouldFloat),\n getLabelWidth: () => this.label_ ? this.label_.getWidth() : 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /**\n * Calculates where the line ripple should start based on the x coordinate within the component.\n */\n private getNormalizedXCoordinate_(evt: MouseEvent | TouchEvent): number {\n const targetClientRect = (evt.target as Element).getBoundingClientRect();\n const xCoordinate = this.isTouchEvent_(evt) ? evt.touches[0].clientX : evt.clientX;\n return xCoordinate - targetClientRect.left;\n }\n\n private isTouchEvent_(evt: MouseEvent | TouchEvent): evt is TouchEvent {\n return Boolean((evt as TouchEvent).touches);\n }\n\n /**\n * Returns a map of all subcomponents to subfoundations.\n */\n private getFoundationMap_(): Partial<MDCSelectFoundationMap> {\n return {\n helperText: this.helperText_ ? this.helperText_.foundation : undefined,\n leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,\n };\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVATED: 'mdc-select--activated',\n DISABLED: 'mdc-select--disabled',\n FOCUSED: 'mdc-select--focused',\n INVALID: 'mdc-select--invalid',\n OUTLINED: 'mdc-select--outlined',\n REQUIRED: 'mdc-select--required',\n ROOT: 'mdc-select',\n SELECTED_ITEM_CLASS: 'mdc-list-item--selected',\n WITH_LEADING_ICON: 'mdc-select--with-leading-icon',\n};\n\nconst strings = {\n ARIA_CONTROLS: 'aria-controls',\n ARIA_SELECTED_ATTR: 'aria-selected',\n CHANGE_EVENT: 'MDCSelect:change',\n LABEL_SELECTOR: '.mdc-floating-label',\n LEADING_ICON_SELECTOR: '.mdc-select__icon',\n LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',\n MENU_SELECTOR: '.mdc-select__menu',\n OUTLINE_SELECTOR: '.mdc-notched-outline',\n SELECTED_ITEM_SELECTOR: `.${cssClasses.SELECTED_ITEM_CLASS}`,\n SELECTED_TEXT_SELECTOR: '.mdc-select__selected-text',\n SELECT_ANCHOR_SELECTOR: '.mdc-select__anchor',\n VALUE_ATTR: 'data-value',\n};\n\nconst numbers = {\n LABEL_SCALE: 0.75,\n UNSET_INDEX: -1,\n};\n\nexport {cssClasses, strings, numbers};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {Corner} from '@material/menu-surface/constants';\n\nimport {MDCSelectAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCSelectHelperTextFoundation} from './helper-text/foundation';\nimport {MDCSelectIconFoundation} from './icon/foundation';\nimport {MDCSelectFoundationMap} from './types';\n\nexport class MDCSelectFoundation extends MDCFoundation<MDCSelectAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n activateBottomLine: () => undefined,\n deactivateBottomLine: () => undefined,\n getSelectedMenuItem: () => null,\n hasLabel: () => false,\n floatLabel: () => undefined,\n getLabelWidth: () => 0,\n hasOutline: () => false,\n notchOutline: () => undefined,\n closeOutline: () => undefined,\n setRippleCenter: () => undefined,\n notifyChange: () => undefined,\n setSelectedText: () => undefined,\n isSelectedTextFocused: () => false,\n getSelectedTextAttr: () => '',\n setSelectedTextAttr: () => undefined,\n openMenu: () => undefined,\n closeMenu: () => undefined,\n getAnchorElement: () => null,\n setMenuAnchorElement: () => undefined,\n setMenuAnchorCorner: () => undefined,\n setMenuWrapFocus: () => undefined,\n setAttributeAtIndex: () => undefined,\n removeAttributeAtIndex: () => undefined,\n focusMenuItemAtIndex: () => undefined,\n getMenuItemCount: () => 0,\n getMenuItemValues: () => [],\n getMenuItemTextAtIndex: () => '',\n getMenuItemAttr: () => '',\n addClassAtIndex: () => undefined,\n removeClassAtIndex: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly leadingIcon_: MDCSelectIconFoundation | undefined;\n private readonly helperText_: MDCSelectHelperTextFoundation | undefined;\n\n // Index of the currently selected menu item.\n private selectedIndex_: number = numbers.UNSET_INDEX;\n // VALUE_ATTR values of the menu items.\n private readonly menuItemValues_: string[];\n // Disabled state\n private disabled_ = false;\n // isMenuOpen_ is used to track the state of the menu by listening to the MDCMenuSurface:closed event\n // For reference, menu.open will return false if the menu is still closing, but isMenuOpen_ returns false only after\n // the menu has closed\n private isMenuOpen_ = false;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n /**\n * @param adapter\n * @param foundationMap Map from subcomponent names to their subfoundations.\n */\n constructor(adapter?: Partial<MDCSelectAdapter>, foundationMap: Partial<MDCSelectFoundationMap> = {}) {\n super({...MDCSelectFoundation.defaultAdapter, ...adapter});\n\n this.leadingIcon_ = foundationMap.leadingIcon;\n this.helperText_ = foundationMap.helperText;\n\n this.menuItemValues_ = this.adapter_.getMenuItemValues();\n }\n\n /** Returns the index of the currently selected menu item, or -1 if none. */\n getSelectedIndex(): number {\n return this.selectedIndex_;\n }\n\n setSelectedIndex(index: number, closeMenu = false) {\n if (index >= this.adapter_.getMenuItemCount()) {\n return;\n }\n\n const previouslySelectedIndex = this.selectedIndex_;\n this.selectedIndex_ = index;\n\n if (this.selectedIndex_ === numbers.UNSET_INDEX) {\n this.adapter_.setSelectedText('');\n } else {\n this.adapter_.setSelectedText(this.adapter_.getMenuItemTextAtIndex(this.selectedIndex_)!.trim());\n }\n\n if (previouslySelectedIndex !== numbers.UNSET_INDEX) {\n this.adapter_.removeClassAtIndex(previouslySelectedIndex, cssClasses.SELECTED_ITEM_CLASS);\n this.adapter_.removeAttributeAtIndex(previouslySelectedIndex, strings.ARIA_SELECTED_ATTR);\n }\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter_.addClassAtIndex(this.selectedIndex_, cssClasses.SELECTED_ITEM_CLASS);\n this.adapter_.setAttributeAtIndex(this.selectedIndex_, strings.ARIA_SELECTED_ATTR, 'true');\n }\n this.layout();\n\n if (closeMenu) {\n this.adapter_.closeMenu();\n }\n\n this.handleChange();\n }\n\n setValue(value: string) {\n const index = this.menuItemValues_.indexOf(value);\n this.setSelectedIndex(index);\n this.handleChange();\n }\n\n getValue() {\n const listItem = this.adapter_.getSelectedMenuItem();\n if (listItem) {\n return this.adapter_.getMenuItemAttr(listItem, strings.VALUE_ATTR) || '';\n }\n return '';\n }\n\n getDisabled() {\n return this.disabled_;\n }\n\n setDisabled(isDisabled: boolean) {\n this.disabled_ = isDisabled;\n if (this.disabled_) {\n this.adapter_.addClass(cssClasses.DISABLED);\n this.adapter_.closeMenu();\n } else {\n this.adapter_.removeClass(cssClasses.DISABLED);\n }\n\n if (this.leadingIcon_) {\n this.leadingIcon_.setDisabled(this.disabled_);\n }\n\n this.adapter_.setSelectedTextAttr('tabindex', this.disabled_ ? '-1' : '0');\n this.adapter_.setSelectedTextAttr('aria-disabled', this.disabled_.toString());\n }\n\n /**\n * @param content Sets the content of the helper text.\n */\n setHelperTextContent(content: string) {\n if (this.helperText_) {\n this.helperText_.setContent(content);\n }\n }\n\n layout() {\n if (this.adapter_.hasLabel()) {\n const openNotch = this.getValue().length > 0;\n this.notchOutline(openNotch);\n }\n }\n\n handleMenuOpened() {\n if (this.adapter_.getMenuItemValues().length === 0) {\n return;\n }\n\n this.adapter_.addClass(cssClasses.ACTIVATED);\n\n // Menu should open to the last selected element, should open to first menu item otherwise.\n const focusItemIndex = this.selectedIndex_ >= 0 ? this.selectedIndex_ : 0;\n this.adapter_.focusMenuItemAtIndex(focusItemIndex);\n }\n\n handleMenuClosed() {\n this.adapter_.removeClass(cssClasses.ACTIVATED);\n this.isMenuOpen_ = false;\n this.adapter_.setSelectedTextAttr('aria-expanded', 'false');\n\n // Unfocus the select if menu is closed without a selection\n if (!this.adapter_.isSelectedTextFocused()) {\n this.blur_();\n }\n }\n\n /**\n * Handles value changes, via change event or programmatic updates.\n */\n handleChange() {\n this.updateLabel_();\n this.adapter_.notifyChange(this.getValue());\n\n const isRequired = this.adapter_.hasClass(cssClasses.REQUIRED);\n if (isRequired) {\n this.setValid(this.isValid());\n if (this.helperText_) {\n this.helperText_.setValidity(this.isValid());\n }\n }\n }\n\n handleMenuItemAction(index: number) {\n this.setSelectedIndex(index, /** closeMenu */ true);\n }\n\n /**\n * Handles focus events from select element.\n */\n handleFocus() {\n this.adapter_.addClass(cssClasses.FOCUSED);\n\n if (this.adapter_.hasLabel()) {\n this.notchOutline(true);\n this.adapter_.floatLabel(true);\n }\n\n this.adapter_.activateBottomLine();\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }\n\n /**\n * Handles blur events from select element.\n */\n handleBlur() {\n if (this.isMenuOpen_) {\n return;\n }\n this.blur_();\n }\n\n handleClick(normalizedX: number) {\n if (this.isMenuOpen_) {\n return;\n }\n this.adapter_.setRippleCenter(normalizedX);\n\n this.adapter_.openMenu();\n this.isMenuOpen_ = true;\n this.adapter_.setSelectedTextAttr('aria-expanded', 'true');\n }\n\n handleKeydown(event: KeyboardEvent) {\n if (this.isMenuOpen_) {\n return;\n }\n\n const isEnter = event.key === 'Enter' || event.keyCode === 13;\n const isSpace = event.key === 'Space' || event.keyCode === 32;\n const arrowUp = event.key === 'ArrowUp' || event.keyCode === 38;\n const arrowDown = event.key === 'ArrowDown' || event.keyCode === 40;\n\n if (this.adapter_.hasClass(cssClasses.FOCUSED) && (isEnter || isSpace || arrowUp || arrowDown)) {\n this.adapter_.openMenu();\n this.isMenuOpen_ = true;\n this.adapter_.setSelectedTextAttr('aria-expanded', 'true');\n event.preventDefault();\n }\n }\n\n /**\n * Opens/closes the notched outline.\n */\n notchOutline(openNotch: boolean) {\n if (!this.adapter_.hasOutline()) {\n return;\n }\n const isFocused = this.adapter_.hasClass(cssClasses.FOCUSED);\n\n if (openNotch) {\n const labelScale = numbers.LABEL_SCALE;\n const labelWidth = this.adapter_.getLabelWidth() * labelScale;\n this.adapter_.notchOutline(labelWidth);\n } else if (!isFocused) {\n this.adapter_.closeOutline();\n }\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n setLeadingIconAriaLabel(label: string) {\n if (this.leadingIcon_) {\n this.leadingIcon_.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n setLeadingIconContent(content: string) {\n if (this.leadingIcon_) {\n this.leadingIcon_.setContent(content);\n }\n }\n\n setValid(isValid: boolean) {\n this.adapter_.setSelectedTextAttr('aria-invalid', (!isValid).toString());\n if (isValid) {\n this.adapter_.removeClass(cssClasses.INVALID);\n } else {\n this.adapter_.addClass(cssClasses.INVALID);\n }\n }\n\n isValid() {\n if (this.adapter_.hasClass(cssClasses.REQUIRED) && !this.adapter_.hasClass(cssClasses.DISABLED)) {\n // See notes for required attribute under https://www.w3.org/TR/html52/sec-forms.html#the-select-element\n // TL;DR: Invalid if no index is selected, or if the first index is selected and has an empty value.\n return this.selectedIndex_ !== numbers.UNSET_INDEX &&\n (this.selectedIndex_ !== 0 || Boolean(this.getValue()));\n }\n return true;\n }\n\n setRequired(isRequired: boolean) {\n if (isRequired) {\n this.adapter_.addClass(cssClasses.REQUIRED);\n } else {\n this.adapter_.removeClass(cssClasses.REQUIRED);\n }\n this.adapter_.setSelectedTextAttr('aria-required', isRequired.toString());\n }\n\n getRequired() {\n return this.adapter_.getSelectedTextAttr('aria-required') === 'true';\n }\n\n init() {\n const anchorEl = this.adapter_.getAnchorElement();\n if (anchorEl) {\n this.adapter_.setMenuAnchorElement(anchorEl);\n this.adapter_.setMenuAnchorCorner(Corner.BOTTOM_START);\n }\n this.adapter_.setMenuWrapFocus(false);\n\n const value = this.getValue();\n if (value) {\n this.setValue(value);\n }\n\n // Initially sync floating label\n this.updateLabel_();\n }\n\n /**\n * Notches the outline and floats the label when appropriate.\n */\n private updateLabel_() {\n const value = this.getValue();\n const optionHasValue = value.length > 0;\n\n if (this.adapter_.hasLabel()) {\n this.notchOutline(optionHasValue);\n\n if (!this.adapter_.hasClass(cssClasses.FOCUSED)) {\n this.adapter_.floatLabel(optionHasValue);\n }\n }\n }\n\n /**\n * Unfocuses the select component.\n */\n private blur_() {\n this.adapter_.removeClass(cssClasses.FOCUSED);\n this.updateLabel_();\n this.adapter_.deactivateBottomLine();\n\n const isRequired = this.adapter_.hasClass(cssClasses.REQUIRED);\n if (isRequired) {\n this.setValid(this.isValid());\n if (this.helperText_) {\n this.helperText_.setValidity(this.isValid());\n }\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCSelectHelperTextAdapter} from './adapter';\nimport {MDCSelectHelperTextFoundation} from './foundation';\n\nexport type MDCSelectHelperTextFactory =\n (el: Element, foundation?: MDCSelectHelperTextFoundation) => MDCSelectHelperText;\n\nexport class MDCSelectHelperText extends MDCComponent<MDCSelectHelperTextFoundation> {\n static attachTo(root: Element): MDCSelectHelperText {\n return new MDCSelectHelperText(root);\n }\n\n get foundation(): MDCSelectHelperTextFoundation {\n return this.foundation_;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCSelectHelperTextAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n hasClass: (className) => this.root_.classList.contains(className),\n setAttr: (attr, value) => this.root_.setAttribute(attr, value),\n removeAttr: (attr) => this.root_.removeAttribute(attr),\n setContent: (content) => {\n this.root_.textContent = content;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSelectHelperTextFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARIA_HIDDEN: 'aria-hidden',\n ROLE: 'role',\n};\n\nconst cssClasses = {\n HELPER_TEXT_PERSISTENT: 'mdc-select-helper-text--persistent',\n HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSelectHelperTextAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCSelectHelperTextFoundation extends MDCFoundation<MDCSelectHelperTextAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectHelperTextAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectHelperTextAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCSelectHelperTextAdapter>) {\n super({...MDCSelectHelperTextFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Sets the content of the helper text field.\n */\n setContent(content: string) {\n this.adapter_.setContent(content);\n }\n\n /**\n * Sets the persistency of the helper text.\n */\n setPersistent(isPersistent: boolean) {\n if (isPersistent) {\n this.adapter_.addClass(cssClasses.HELPER_TEXT_PERSISTENT);\n } else {\n this.adapter_.removeClass(cssClasses.HELPER_TEXT_PERSISTENT);\n }\n }\n\n /**\n * @param isValidation True to make the helper text act as an error validation message.\n */\n setValidation(isValidation: boolean) {\n if (isValidation) {\n this.adapter_.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n } else {\n this.adapter_.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n }\n\n /**\n * Makes the helper text visible to screen readers.\n */\n showToScreenReader() {\n this.adapter_.removeAttr(strings.ARIA_HIDDEN);\n }\n\n /**\n * Sets the validity of the helper text based on the select validity.\n */\n setValidity(selectIsValid: boolean) {\n const helperTextIsPersistent = this.adapter_.hasClass(cssClasses.HELPER_TEXT_PERSISTENT);\n const helperTextIsValidationMsg = this.adapter_.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n const validationMsgNeedsDisplay = helperTextIsValidationMsg && !selectIsValid;\n\n if (validationMsgNeedsDisplay) {\n this.adapter_.setAttr(strings.ROLE, 'alert');\n } else {\n this.adapter_.removeAttr(strings.ROLE);\n }\n\n if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {\n this.hide_();\n }\n }\n\n /**\n * Hides the help text from screen readers.\n */\n private hide_() {\n this.adapter_.setAttr(strings.ARIA_HIDDEN, 'true');\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectHelperTextFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as helperTextCssClasses, strings as helperTextStrings} from './constants';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCSelectIconAdapter} from './adapter';\nimport {MDCSelectIconFoundation} from './foundation';\n\nexport type MDCSelectIconFactory = (el: Element, foundation?: MDCSelectIconFoundation) => MDCSelectIcon;\n\nexport class MDCSelectIcon extends MDCComponent<MDCSelectIconFoundation> {\n static attachTo(root: Element): MDCSelectIcon {\n return new MDCSelectIcon(root);\n }\n\n get foundation(): MDCSelectIconFoundation {\n return this.foundation_;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCSelectIconAdapter = {\n getAttr: (attr) => this.root_.getAttribute(attr),\n setAttr: (attr, value) => this.root_.setAttribute(attr, value),\n removeAttr: (attr) => this.root_.removeAttribute(attr),\n setContent: (content) => {\n this.root_.textContent = content;\n },\n registerInteractionHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) => this.unlisten(evtType, handler),\n notifyIconAction: () => this.emit(\n MDCSelectIconFoundation.strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSelectIconFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ICON_EVENT: 'MDCSelect:icon',\n ICON_ROLE: 'button',\n};\n\nexport {strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCSelectIconAdapter} from './adapter';\nimport {strings} from './constants';\n\ntype InteractionEventType = 'click' | 'keydown';\n\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCSelectIconFoundation extends MDCFoundation<MDCSelectIconAdapter> {\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectIconAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectIconAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getAttr: () => null,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n notifyIconAction: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private savedTabIndex_: string | null = null;\n\n // assigned in initialSyncWithDOM()\n private readonly interactionHandler_!: SpecificEventListener<InteractionEventType>;\n\n constructor(adapter?: Partial<MDCSelectIconAdapter>) {\n super({...MDCSelectIconFoundation.defaultAdapter, ...adapter});\n\n this.interactionHandler_ = (evt) => this.handleInteraction(evt);\n }\n\n init() {\n this.savedTabIndex_ = this.adapter_.getAttr('tabindex');\n\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter_.registerInteractionHandler(evtType, this.interactionHandler_);\n });\n }\n\n destroy() {\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter_.deregisterInteractionHandler(evtType, this.interactionHandler_);\n });\n }\n\n setDisabled(disabled: boolean) {\n if (!this.savedTabIndex_) {\n return;\n }\n\n if (disabled) {\n this.adapter_.setAttr('tabindex', '-1');\n this.adapter_.removeAttr('role');\n } else {\n this.adapter_.setAttr('tabindex', this.savedTabIndex_);\n this.adapter_.setAttr('role', strings.ICON_ROLE);\n }\n }\n\n setAriaLabel(label: string) {\n this.adapter_.setAttr('aria-label', label);\n }\n\n setContent(content: string) {\n this.adapter_.setContent(content);\n }\n\n handleInteraction(evt: MouseEvent | KeyboardEvent) {\n const isEnterKey = (evt as KeyboardEvent).key === 'Enter' || (evt as KeyboardEvent).keyCode === 13;\n if (evt.type === 'click' || isEnterKey) {\n this.adapter_.notifyIconAction();\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectIconFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {strings as iconStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\nexport * from './helper-text/index';\nexport * from './icon/index';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {MDCSliderAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCSliderFoundation} from './foundation';\n\nexport class MDCSlider extends MDCComponent<MDCSliderFoundation> {\n static attachTo(root: Element) {\n return new MDCSlider(root);\n }\n\n protected root_!: HTMLElement; // assigned in MDCComponent constructor\n\n private thumbContainer_!: HTMLElement; // assigned in initialize()\n private track_!: HTMLElement; // assigned in initialize()\n private pinValueMarker_!: HTMLElement; // assigned in initialize()\n private trackMarkerContainer_!: HTMLElement; // assigned in initialize()\n\n get value(): number {\n return this.foundation_.getValue();\n }\n\n set value(value: number) {\n this.foundation_.setValue(value);\n }\n\n get min(): number {\n return this.foundation_.getMin();\n }\n\n set min(min: number) {\n this.foundation_.setMin(min);\n }\n\n get max(): number {\n return this.foundation_.getMax();\n }\n\n set max(max: number) {\n this.foundation_.setMax(max);\n }\n\n get step(): number {\n return this.foundation_.getStep();\n }\n\n set step(step: number) {\n this.foundation_.setStep(step);\n }\n\n get disabled(): boolean {\n return this.foundation_.isDisabled();\n }\n\n set disabled(disabled: boolean) {\n this.foundation_.setDisabled(disabled);\n }\n\n initialize() {\n this.thumbContainer_ = this.root_.querySelector<HTMLElement>(\n strings.THUMB_CONTAINER_SELECTOR)!;\n this.track_ =\n this.root_.querySelector<HTMLElement>(strings.TRACK_SELECTOR)!;\n this.pinValueMarker_ = this.root_.querySelector<HTMLElement>(\n strings.PIN_VALUE_MARKER_SELECTOR)!;\n this.trackMarkerContainer_ = this.root_.querySelector<HTMLElement>(\n strings.TRACK_MARKER_CONTAINER_SELECTOR)!;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same\n // order as the adapter interface.\n const adapter: MDCSliderAdapter = {\n hasClass: (className) => this.root_.classList.contains(className),\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n getAttribute: (name) => this.root_.getAttribute(name),\n setAttribute: (name, value) => this.root_.setAttribute(name, value),\n removeAttribute: (name) => this.root_.removeAttribute(name),\n computeBoundingRect: () => this.root_.getBoundingClientRect(),\n getTabIndex: () => this.root_.tabIndex,\n registerInteractionHandler: (evtType, handler) =>\n this.listen(evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n this.unlisten(evtType, handler, applyPassive()),\n registerThumbContainerInteractionHandler: (evtType, handler) => {\n this.thumbContainer_.addEventListener(evtType, handler, applyPassive());\n },\n deregisterThumbContainerInteractionHandler: (evtType, handler) => {\n this.thumbContainer_.removeEventListener(\n evtType, handler, applyPassive());\n },\n registerBodyInteractionHandler: (evtType, handler) =>\n document.body.addEventListener(evtType, handler),\n deregisterBodyInteractionHandler: (evtType, handler) =>\n document.body.removeEventListener(evtType, handler),\n registerResizeHandler: (handler) =>\n window.addEventListener('resize', handler),\n deregisterResizeHandler: (handler) =>\n window.removeEventListener('resize', handler),\n notifyInput: () => this.emit<MDCSlider>(\n strings.INPUT_EVENT,\n this), // TODO(acdvorak): Create detail interface\n notifyChange: () => this.emit<MDCSlider>(\n strings.CHANGE_EVENT,\n this), // TODO(acdvorak): Create detail interface\n setThumbContainerStyleProperty: (propertyName, value) => {\n this.thumbContainer_.style.setProperty(propertyName, value);\n },\n setTrackStyleProperty: (propertyName, value) =>\n this.track_.style.setProperty(propertyName, value),\n setMarkerValue: (value) => this.pinValueMarker_.innerText =\n value.toLocaleString(),\n setTrackMarkers: (step, max, min) => {\n const stepStr = step.toLocaleString();\n const maxStr = max.toLocaleString();\n const minStr = min.toLocaleString();\n // keep calculation in css for better rounding/subpixel behavior\n const markerAmount = `((${maxStr} - ${minStr}) / ${stepStr})`;\n const markerWidth = `2px`;\n const markerBkgdImage = `linear-gradient(to right, currentColor ${\n markerWidth}, transparent 0)`;\n const markerBkgdLayout = `0 center / calc((100% - ${markerWidth}) / ${\n markerAmount}) 100% repeat-x`;\n const markerBkgdShorthand = `${markerBkgdImage} ${markerBkgdLayout}`;\n this.trackMarkerContainer_.style.setProperty(\n 'background', markerBkgdShorthand);\n },\n isRTL: () => getComputedStyle(this.root_).direction === 'rtl',\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSliderFoundation(adapter);\n }\n\n initialSyncWithDOM() {\n const origValueNow = this.parseFloat_(\n this.root_.getAttribute(strings.ARIA_VALUENOW), this.value);\n const min = this.parseFloat_(\n this.root_.getAttribute(strings.ARIA_VALUEMIN), this.min);\n const max = this.parseFloat_(\n this.root_.getAttribute(strings.ARIA_VALUEMAX), this.max);\n\n // min and max need to be set in the right order to avoid throwing an error\n // when the new min is greater than the default max.\n if (min >= this.max) {\n this.max = max;\n this.min = min;\n } else {\n this.min = min;\n this.max = max;\n }\n\n this.step = this.parseFloat_(\n this.root_.getAttribute(strings.STEP_DATA_ATTR), this.step);\n this.value = origValueNow;\n this.disabled =\n (this.root_.hasAttribute(strings.ARIA_DISABLED) &&\n this.root_.getAttribute(strings.ARIA_DISABLED) !== 'false');\n this.foundation_.setupTrackMarker();\n }\n\n layout() {\n this.foundation_.layout();\n }\n\n stepUp(amount = (this.step || 1)) {\n this.value += amount;\n }\n\n stepDown(amount = (this.step || 1)) {\n this.value -= amount;\n }\n\n private parseFloat_(str: string|null, defaultValue: number) {\n const num = parseFloat(str!); // tslint:disable-line:ban\n const isNumeric = typeof num === 'number' && isFinite(num);\n return isNumeric ? num : defaultValue;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVE: 'mdc-slider--active',\n DISABLED: 'mdc-slider--disabled',\n DISCRETE: 'mdc-slider--discrete',\n FOCUS: 'mdc-slider--focus',\n HAS_TRACK_MARKER: 'mdc-slider--display-markers',\n IN_TRANSIT: 'mdc-slider--in-transit',\n IS_DISCRETE: 'mdc-slider--discrete',\n};\n\nconst strings = {\n ARIA_DISABLED: 'aria-disabled',\n ARIA_VALUEMAX: 'aria-valuemax',\n ARIA_VALUEMIN: 'aria-valuemin',\n ARIA_VALUENOW: 'aria-valuenow',\n CHANGE_EVENT: 'MDCSlider:change',\n INPUT_EVENT: 'MDCSlider:input',\n PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker',\n STEP_DATA_ATTR: 'data-step',\n THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container',\n TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container',\n TRACK_SELECTOR: '.mdc-slider__track',\n};\n\nconst numbers = {\n PAGE_FACTOR: 4,\n};\n\nexport {cssClasses, strings, numbers};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectEventName, getCorrectPropertyName} from '@material/animation/util';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {EventType, SpecificEventListener} from '@material/base/types';\nimport {MDCSliderAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\ntype UpEventType = 'mouseup'|'pointerup'|'touchend';\ntype DownEventType = 'mousedown'|'pointerdown'|'touchstart';\ntype MoveEventType = 'mousemove'|'pointermove'|'touchmove';\ntype MouseLikeEvent = MouseEvent|PointerEvent|TouchEvent;\n\ntype MoveEventMap = {\n readonly[K in DownEventType]: MoveEventType;\n};\n\nconst DOWN_EVENTS: DownEventType[] = ['mousedown', 'pointerdown', 'touchstart'];\nconst UP_EVENTS: UpEventType[] = ['mouseup', 'pointerup', 'touchend'];\n\nconst MOVE_EVENT_MAP: MoveEventMap = {\n mousedown: 'mousemove',\n pointerdown: 'pointermove',\n touchstart: 'touchmove',\n};\n\nconst KEY_IDS = {\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_UP: 'ArrowUp',\n END: 'End',\n HOME: 'Home',\n PAGE_DOWN: 'PageDown',\n PAGE_UP: 'PageUp',\n};\n\nexport class MDCSliderFoundation extends MDCFoundation<MDCSliderAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCSliderAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same\n // order as the adapter interface.\n return {\n hasClass: () => false,\n addClass: () => undefined,\n removeClass: () => undefined,\n getAttribute: () => null,\n setAttribute: () => undefined,\n removeAttribute: () => undefined,\n computeBoundingRect: () =>\n ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n getTabIndex: () => 0,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n registerThumbContainerInteractionHandler: () => undefined,\n deregisterThumbContainerInteractionHandler: () => undefined,\n registerBodyInteractionHandler: () => undefined,\n deregisterBodyInteractionHandler: () => undefined,\n registerResizeHandler: () => undefined,\n deregisterResizeHandler: () => undefined,\n notifyInput: () => undefined,\n notifyChange: () => undefined,\n setThumbContainerStyleProperty: () => undefined,\n setTrackStyleProperty: () => undefined,\n setMarkerValue: () => undefined,\n setTrackMarkers: () => undefined,\n isRTL: () => false,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private rect_!: ClientRect; // assigned in layout() via init()\n\n /**\n * We set this to NaN since we want it to be a number, but we can't use '0' or\n * '-1' because those could be valid tabindices set by the client code.\n */\n private savedTabIndex_ = NaN;\n\n private active_ = false;\n private inTransit_ = false;\n private isDiscrete_ = false;\n private hasTrackMarker_ = false;\n private handlingThumbTargetEvt_ = false;\n private min_ = 0;\n private max_ = 100;\n private step_ = 0;\n private value_ = 0;\n private disabled_ = false;\n private preventFocusState_ = false;\n\n private readonly thumbContainerPointerHandler_:\n SpecificEventListener<DownEventType>;\n private readonly interactionStartHandler_:\n SpecificEventListener<DownEventType>;\n private readonly keydownHandler_: SpecificEventListener<'keydown'>;\n private readonly focusHandler_: SpecificEventListener<'focus'>;\n private readonly blurHandler_: SpecificEventListener<'blur'>;\n private readonly resizeHandler_: SpecificEventListener<'resize'>;\n\n constructor(adapter?: Partial<MDCSliderAdapter>) {\n super({...MDCSliderFoundation.defaultAdapter, ...adapter});\n\n this.thumbContainerPointerHandler_ = () => this.handlingThumbTargetEvt_ =\n true;\n this.interactionStartHandler_ = (evt: MouseLikeEvent) =>\n this.handleDown_(evt);\n this.keydownHandler_ = (evt) => this.handleKeydown_(evt);\n this.focusHandler_ = () => this.handleFocus_();\n this.blurHandler_ = () => this.handleBlur_();\n this.resizeHandler_ = () => this.layout();\n }\n\n init() {\n this.isDiscrete_ = this.adapter_.hasClass(cssClasses.IS_DISCRETE);\n this.hasTrackMarker_ = this.adapter_.hasClass(cssClasses.HAS_TRACK_MARKER);\n\n DOWN_EVENTS.forEach((evtName) => {\n this.adapter_.registerInteractionHandler(\n evtName, this.interactionStartHandler_);\n this.adapter_.registerThumbContainerInteractionHandler(\n evtName, this.thumbContainerPointerHandler_);\n });\n\n this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);\n this.adapter_.registerInteractionHandler('focus', this.focusHandler_);\n this.adapter_.registerInteractionHandler('blur', this.blurHandler_);\n this.adapter_.registerResizeHandler(this.resizeHandler_);\n\n this.layout();\n\n // At last step, provide a reasonable default value to discrete slider\n if (this.isDiscrete_ && this.getStep() === 0) {\n this.step_ = 1;\n }\n }\n\n destroy() {\n DOWN_EVENTS.forEach((evtName) => {\n this.adapter_.deregisterInteractionHandler(\n evtName, this.interactionStartHandler_);\n this.adapter_.deregisterThumbContainerInteractionHandler(\n evtName, this.thumbContainerPointerHandler_);\n });\n\n this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);\n this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);\n this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);\n this.adapter_.deregisterResizeHandler(this.resizeHandler_);\n }\n\n setupTrackMarker() {\n if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() !== 0) {\n this.adapter_.setTrackMarkers(\n this.getStep(), this.getMax(), this.getMin());\n }\n }\n\n layout() {\n this.rect_ = this.adapter_.computeBoundingRect();\n this.updateUIForCurrentValue_();\n }\n\n getValue(): number {\n return this.value_;\n }\n\n setValue(value: number) {\n this.setValue_(value, false);\n }\n\n getMax(): number {\n return this.max_;\n }\n\n setMax(max: number) {\n if (max < this.min_) {\n throw new Error(\n 'Cannot set max to be less than the slider\\'s minimum value');\n }\n this.max_ = max;\n this.setValue_(this.value_, false, true);\n this.adapter_.setAttribute(strings.ARIA_VALUEMAX, String(this.max_));\n this.setupTrackMarker();\n }\n\n getMin(): number {\n return this.min_;\n }\n\n setMin(min: number) {\n if (min > this.max_) {\n throw new Error(\n 'Cannot set min to be greater than the slider\\'s maximum value');\n }\n this.min_ = min;\n this.setValue_(this.value_, false, true);\n this.adapter_.setAttribute(strings.ARIA_VALUEMIN, String(this.min_));\n this.setupTrackMarker();\n }\n\n getStep(): number {\n return this.step_;\n }\n\n setStep(step: number) {\n if (step < 0) {\n throw new Error('Step cannot be set to a negative number');\n }\n if (this.isDiscrete_ && (typeof (step) !== 'number' || step < 1)) {\n step = 1;\n }\n this.step_ = step;\n this.setValue_(this.value_, false, true);\n this.setupTrackMarker();\n }\n\n isDisabled(): boolean {\n return this.disabled_;\n }\n\n setDisabled(disabled: boolean) {\n this.disabled_ = disabled;\n this.toggleClass_(cssClasses.DISABLED, this.disabled_);\n if (this.disabled_) {\n this.savedTabIndex_ = this.adapter_.getTabIndex();\n this.adapter_.setAttribute(strings.ARIA_DISABLED, 'true');\n this.adapter_.removeAttribute('tabindex');\n } else {\n this.adapter_.removeAttribute(strings.ARIA_DISABLED);\n if (!isNaN(this.savedTabIndex_)) {\n this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_));\n }\n }\n }\n\n /**\n * Called when the user starts interacting with the slider\n */\n private handleDown_(downEvent: MouseLikeEvent) {\n if (this.disabled_) {\n return;\n }\n\n this.preventFocusState_ = true;\n this.setInTransit_(!this.handlingThumbTargetEvt_);\n this.handlingThumbTargetEvt_ = false;\n this.setActive_(true);\n\n const moveHandler = (moveEvent: MouseLikeEvent) => {\n this.handleMove_(moveEvent);\n };\n\n const moveEventType = MOVE_EVENT_MAP[downEvent.type as DownEventType];\n\n // Note: upHandler is [de]registered on ALL potential pointer-related\n // release event types, since some browsers do not always fire these\n // consistently in pairs. (See\n // https://github.com/material-components/material-components-web/issues/1192)\n const upHandler = () => {\n this.handleUp_();\n this.adapter_.deregisterBodyInteractionHandler(\n moveEventType, moveHandler);\n UP_EVENTS.forEach(\n (evtName) => this.adapter_.deregisterBodyInteractionHandler(\n evtName, upHandler));\n };\n\n this.adapter_.registerBodyInteractionHandler(moveEventType, moveHandler);\n UP_EVENTS.forEach(\n (evtName) =>\n this.adapter_.registerBodyInteractionHandler(evtName, upHandler));\n this.setValueFromEvt_(downEvent);\n }\n\n /**\n * Called when the user moves the slider\n */\n private handleMove_(evt: MouseLikeEvent) {\n evt.preventDefault();\n this.setValueFromEvt_(evt);\n }\n\n /**\n * Called when the user's interaction with the slider ends\n */\n private handleUp_() {\n this.setActive_(false);\n this.adapter_.notifyChange();\n }\n\n /**\n * Returns the clientX of the event\n */\n private getClientX_(evt: MouseLikeEvent): number {\n if ((evt as TouchEvent).targetTouches &&\n (evt as TouchEvent).targetTouches.length > 0) {\n return (evt as TouchEvent).targetTouches[0].clientX;\n }\n return (evt as MouseEvent).clientX;\n }\n\n /**\n * Sets the slider value from an event\n */\n private setValueFromEvt_(evt: MouseLikeEvent) {\n const clientX = this.getClientX_(evt);\n const value = this.computeValueFromClientX_(clientX);\n this.setValue_(value, true);\n }\n\n /**\n * Computes the new value from the clientX position\n */\n private computeValueFromClientX_(clientX: number): number {\n const {max_: max, min_: min} = this;\n const xPos = clientX - this.rect_.left;\n let pctComplete = xPos / this.rect_.width;\n if (this.adapter_.isRTL()) {\n pctComplete = 1 - pctComplete;\n }\n // Fit the percentage complete between the range [min,max]\n // by remapping from [0, 1] to [min, min+(max-min)].\n return min + pctComplete * (max - min);\n }\n\n /**\n * Handles keydown events\n */\n private handleKeydown_(evt: KeyboardEvent) {\n const keyId = this.getKeyId_(evt);\n const value = this.getValueForKeyId_(keyId);\n if (isNaN(value)) {\n return;\n }\n\n // Prevent page from scrolling due to key presses that would normally scroll\n // the page\n evt.preventDefault();\n this.adapter_.addClass(cssClasses.FOCUS);\n this.setValue_(value, true);\n this.adapter_.notifyChange();\n }\n\n /**\n * Returns the computed name of the event\n */\n private getKeyId_(kbdEvt: KeyboardEvent): string {\n if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {\n return KEY_IDS.ARROW_LEFT;\n }\n if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {\n return KEY_IDS.ARROW_RIGHT;\n }\n if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {\n return KEY_IDS.ARROW_UP;\n }\n if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {\n return KEY_IDS.ARROW_DOWN;\n }\n if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {\n return KEY_IDS.HOME;\n }\n if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {\n return KEY_IDS.END;\n }\n if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {\n return KEY_IDS.PAGE_UP;\n }\n if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {\n return KEY_IDS.PAGE_DOWN;\n }\n return '';\n }\n\n /**\n * Computes the value given a keyboard key ID\n */\n private getValueForKeyId_(keyId: string): number {\n const {max_: max, min_: min, step_: step} = this;\n let delta = step || (max - min) / 100;\n const valueNeedsToBeFlipped = this.adapter_.isRTL() &&\n (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);\n if (valueNeedsToBeFlipped) {\n delta = -delta;\n }\n\n switch (keyId) {\n case KEY_IDS.ARROW_LEFT:\n case KEY_IDS.ARROW_DOWN:\n return this.value_ - delta;\n case KEY_IDS.ARROW_RIGHT:\n case KEY_IDS.ARROW_UP:\n return this.value_ + delta;\n case KEY_IDS.HOME:\n return this.min_;\n case KEY_IDS.END:\n return this.max_;\n case KEY_IDS.PAGE_UP:\n return this.value_ + delta * numbers.PAGE_FACTOR;\n case KEY_IDS.PAGE_DOWN:\n return this.value_ - delta * numbers.PAGE_FACTOR;\n default:\n return NaN;\n }\n }\n\n private handleFocus_() {\n if (this.preventFocusState_) {\n return;\n }\n this.adapter_.addClass(cssClasses.FOCUS);\n }\n\n private handleBlur_() {\n this.preventFocusState_ = false;\n this.adapter_.removeClass(cssClasses.FOCUS);\n }\n\n /**\n * Sets the value of the slider\n */\n private setValue_(value: number, shouldFireInput: boolean, force = false) {\n if (value === this.value_ && !force) {\n return;\n }\n\n const {min_: min, max_: max} = this;\n const valueSetToBoundary = value === min || value === max;\n if (this.step_ && !valueSetToBoundary) {\n value = this.quantize_(value);\n }\n if (value < min) {\n value = min;\n } else if (value > max) {\n value = max;\n }\n value = value || 0; // coerce -0 to 0\n this.value_ = value;\n this.adapter_.setAttribute(strings.ARIA_VALUENOW, String(this.value_));\n this.updateUIForCurrentValue_();\n\n if (shouldFireInput) {\n this.adapter_.notifyInput();\n if (this.isDiscrete_) {\n this.adapter_.setMarkerValue(value);\n }\n }\n }\n\n /**\n * Calculates the quantized value\n */\n private quantize_(value: number): number {\n const numSteps = Math.round(value / this.step_);\n return numSteps * this.step_;\n }\n\n private updateUIForCurrentValue_() {\n const {max_: max, min_: min, value_: value} = this;\n const pctComplete = (value - min) / (max - min);\n let translatePx = pctComplete * this.rect_.width;\n if (this.adapter_.isRTL()) {\n translatePx = this.rect_.width - translatePx;\n }\n\n const transformProp = getCorrectPropertyName(window, 'transform');\n const transitionendEvtName =\n getCorrectEventName(window, 'transitionend') as EventType;\n\n if (this.inTransit_) {\n const onTransitionEnd = () => {\n this.setInTransit_(false);\n this.adapter_.deregisterThumbContainerInteractionHandler(\n transitionendEvtName, onTransitionEnd);\n };\n this.adapter_.registerThumbContainerInteractionHandler(\n transitionendEvtName, onTransitionEnd);\n }\n\n requestAnimationFrame(() => {\n // NOTE(traviskaufman): It would be nice to use calc() here,\n // but IE cannot handle calcs in transforms correctly.\n // See: https://goo.gl/NC2itk\n // Also note that the -50% offset is used to center the slider thumb.\n this.adapter_.setThumbContainerStyleProperty(\n transformProp, `translateX(${translatePx}px) translateX(-50%)`);\n this.adapter_.setTrackStyleProperty(\n transformProp, `scaleX(${pctComplete})`);\n });\n }\n\n /**\n * Toggles the active state of the slider\n */\n private setActive_(active: boolean) {\n this.active_ = active;\n this.toggleClass_(cssClasses.ACTIVE, this.active_);\n }\n\n /**\n * Toggles the inTransit state of the slider\n */\n private setInTransit_(inTransit: boolean) {\n this.inTransit_ = inTransit;\n this.toggleClass_(cssClasses.IN_TRANSIT, this.inTransit_);\n }\n\n /**\n * Conditionally adds or removes a class based on shouldBePresent\n */\n private toggleClass_(className: string, shouldBePresent: boolean) {\n if (shouldBePresent) {\n this.adapter_.addClass(className);\n } else {\n this.adapter_.removeClass(className);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility\n// with MDC Web v0.44.0 and earlier.\nexport default MDCSliderFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCSnackbarAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCSnackbarFoundation} from './foundation';\nimport {MDCSnackbarAnnouncer, MDCSnackbarAnnouncerFactory, MDCSnackbarCloseEventDetail} from './types';\nimport * as util from './util';\n\nconst {\n SURFACE_SELECTOR, LABEL_SELECTOR, ACTION_SELECTOR, DISMISS_SELECTOR,\n OPENING_EVENT, OPENED_EVENT, CLOSING_EVENT, CLOSED_EVENT,\n} = strings;\n\nexport class MDCSnackbar extends MDCComponent<MDCSnackbarFoundation> {\n static attachTo(root: Element) {\n return new MDCSnackbar(root);\n }\n\n private announce_!: MDCSnackbarAnnouncer; // assigned in initialize()\n\n private actionEl_!: Element; // assigned in initialSyncWithDOM()\n private labelEl_!: Element; // assigned in initialSyncWithDOM()\n private surfaceEl_!: Element; // assigned in initialSyncWithDOM()\n\n private handleKeyDown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleSurfaceClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n initialize(announcerFactory: MDCSnackbarAnnouncerFactory = () => util.announce) {\n this.announce_ = announcerFactory();\n }\n\n initialSyncWithDOM() {\n this.surfaceEl_ = this.root_.querySelector(SURFACE_SELECTOR)!;\n this.labelEl_ = this.root_.querySelector(LABEL_SELECTOR)!;\n this.actionEl_ = this.root_.querySelector(ACTION_SELECTOR)!;\n\n this.handleKeyDown_ = (evt) => this.foundation_.handleKeyDown(evt);\n this.handleSurfaceClick_ = (evt) => {\n const target = evt.target as Element;\n if (this.isActionButton_(target)) {\n this.foundation_.handleActionButtonClick(evt);\n } else if (this.isActionIcon_(target)) {\n this.foundation_.handleActionIconClick(evt);\n }\n };\n\n this.registerKeyDownHandler_(this.handleKeyDown_);\n this.registerSurfaceClickHandler_(this.handleSurfaceClick_);\n }\n\n destroy() {\n super.destroy();\n this.deregisterKeyDownHandler_(this.handleKeyDown_);\n this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_);\n }\n\n open() {\n this.foundation_.open();\n }\n\n /**\n * @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the\n * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom\n * client-specific values may also be used if desired.\n */\n close(reason = '') {\n this.foundation_.close(reason);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSnackbarAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n announce: () => this.announce_(this.labelEl_),\n notifyClosed: (reason) => this.emit<MDCSnackbarCloseEventDetail>(CLOSED_EVENT, reason ? {reason} : {}),\n notifyClosing: (reason) => this.emit<MDCSnackbarCloseEventDetail>(CLOSING_EVENT, reason ? {reason} : {}),\n notifyOpened: () => this.emit(OPENED_EVENT, {}),\n notifyOpening: () => this.emit(OPENING_EVENT, {}),\n removeClass: (className) => this.root_.classList.remove(className),\n };\n return new MDCSnackbarFoundation(adapter);\n }\n\n get timeoutMs(): number {\n return this.foundation_.getTimeoutMs();\n }\n\n set timeoutMs(timeoutMs: number) {\n this.foundation_.setTimeoutMs(timeoutMs);\n }\n\n get closeOnEscape(): boolean {\n return this.foundation_.getCloseOnEscape();\n }\n\n set closeOnEscape(closeOnEscape: boolean) {\n this.foundation_.setCloseOnEscape(closeOnEscape);\n }\n\n get isOpen(): boolean {\n return this.foundation_.isOpen();\n }\n\n get labelText(): string {\n // This property only returns null if the node is a document, DOCTYPE, or notation.\n // On Element nodes, it always returns a string.\n return this.labelEl_.textContent!;\n }\n\n set labelText(labelText: string) {\n this.labelEl_.textContent = labelText;\n }\n\n get actionButtonText(): string {\n return this.actionEl_.textContent!;\n }\n\n set actionButtonText(actionButtonText: string) {\n this.actionEl_.textContent = actionButtonText;\n }\n\n private registerKeyDownHandler_(handler: SpecificEventListener<'keydown'>) {\n this.listen('keydown', handler);\n }\n\n private deregisterKeyDownHandler_(handler: SpecificEventListener<'keydown'>) {\n this.unlisten('keydown', handler);\n }\n\n private registerSurfaceClickHandler_(handler: SpecificEventListener<'click'>) {\n this.surfaceEl_.addEventListener('click', handler as EventListener);\n }\n\n private deregisterSurfaceClickHandler_(handler: SpecificEventListener<'click'>) {\n this.surfaceEl_.removeEventListener('click', handler as EventListener);\n }\n\n private isActionButton_(target: Element): boolean {\n return Boolean(closest(target, ACTION_SELECTOR));\n }\n\n private isActionIcon_(target: Element): boolean {\n return Boolean(closest(target, DISMISS_SELECTOR));\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n CLOSING: 'mdc-snackbar--closing',\n OPEN: 'mdc-snackbar--open',\n OPENING: 'mdc-snackbar--opening',\n};\n\nconst strings = {\n ACTION_SELECTOR: '.mdc-snackbar__action',\n ARIA_LIVE_LABEL_TEXT_ATTR: 'data-mdc-snackbar-label-text',\n CLOSED_EVENT: 'MDCSnackbar:closed',\n CLOSING_EVENT: 'MDCSnackbar:closing',\n DISMISS_SELECTOR: '.mdc-snackbar__dismiss',\n LABEL_SELECTOR: '.mdc-snackbar__label',\n OPENED_EVENT: 'MDCSnackbar:opened',\n OPENING_EVENT: 'MDCSnackbar:opening',\n REASON_ACTION: 'action',\n REASON_DISMISS: 'dismiss',\n SURFACE_SELECTOR: '.mdc-snackbar__surface',\n};\n\nconst numbers = {\n DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5000,\n INDETERMINATE: -1,\n MAX_AUTO_DISMISS_TIMEOUT_MS: 10000,\n MIN_AUTO_DISMISS_TIMEOUT_MS: 4000,\n\n // These variables need to be kept in sync with the values in _variables.scss.\n SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75,\n SNACKBAR_ANIMATION_OPEN_TIME_MS: 150,\n\n /**\n * Number of milliseconds to wait between temporarily clearing the label text\n * in the DOM and subsequently restoring it. This is necessary to force IE 11\n * to pick up the `aria-live` content change and announce it to the user.\n */\n ARIA_LIVE_DELAY_MS: 1000,\n};\n\nexport {cssClasses, strings, numbers};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSnackbarAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nconst {OPENING, OPEN, CLOSING} = cssClasses;\nconst {REASON_ACTION, REASON_DISMISS} = strings;\n\nexport class MDCSnackbarFoundation extends MDCFoundation<MDCSnackbarAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCSnackbarAdapter {\n return {\n addClass: () => undefined,\n announce: () => undefined,\n notifyClosed: () => undefined,\n notifyClosing: () => undefined,\n notifyOpened: () => undefined,\n notifyOpening: () => undefined,\n removeClass: () => undefined,\n };\n }\n\n private isOpen_ = false;\n private animationFrame_ = 0;\n private animationTimer_ = 0;\n private autoDismissTimer_ = 0;\n private autoDismissTimeoutMs_ = numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS;\n private closeOnEscape_ = true;\n\n constructor(adapter?: Partial<MDCSnackbarAdapter>) {\n super({...MDCSnackbarFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n this.clearAutoDismissTimer_();\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = 0;\n this.adapter_.removeClass(OPENING);\n this.adapter_.removeClass(OPEN);\n this.adapter_.removeClass(CLOSING);\n }\n\n open() {\n this.clearAutoDismissTimer_();\n this.isOpen_ = true;\n this.adapter_.notifyOpening();\n this.adapter_.removeClass(CLOSING);\n this.adapter_.addClass(OPENING);\n this.adapter_.announce();\n\n // Wait a frame once display is no longer \"none\", to establish basis for animation\n this.runNextAnimationFrame_(() => {\n this.adapter_.addClass(OPEN);\n\n this.animationTimer_ = setTimeout(() => {\n const timeoutMs = this.getTimeoutMs();\n this.handleAnimationTimerEnd_();\n this.adapter_.notifyOpened();\n if (timeoutMs !== numbers.INDETERMINATE) {\n this.autoDismissTimer_ = setTimeout(() => {\n this.close(REASON_DISMISS);\n }, timeoutMs);\n }\n }, numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS);\n });\n }\n\n /**\n * @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the\n * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom\n * client-specific values may also be used if desired.\n */\n close(reason = '') {\n if (!this.isOpen_) {\n // Avoid redundant close calls (and events), e.g. repeated interactions as the snackbar is animating closed\n return;\n }\n\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = 0;\n this.clearAutoDismissTimer_();\n\n this.isOpen_ = false;\n this.adapter_.notifyClosing(reason);\n this.adapter_.addClass(cssClasses.CLOSING);\n this.adapter_.removeClass(cssClasses.OPEN);\n this.adapter_.removeClass(cssClasses.OPENING);\n\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(() => {\n this.handleAnimationTimerEnd_();\n this.adapter_.notifyClosed(reason);\n }, numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS);\n }\n\n isOpen(): boolean {\n return this.isOpen_;\n }\n\n getTimeoutMs(): number {\n return this.autoDismissTimeoutMs_;\n }\n\n setTimeoutMs(timeoutMs: number) {\n // Use shorter variable names to make the code more readable\n const minValue = numbers.MIN_AUTO_DISMISS_TIMEOUT_MS;\n const maxValue = numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;\n const indeterminateValue = numbers.INDETERMINATE;\n\n if (timeoutMs === numbers.INDETERMINATE || (timeoutMs <= maxValue && timeoutMs >= minValue)) {\n this.autoDismissTimeoutMs_ = timeoutMs;\n } else {\n throw new Error(`\n timeoutMs must be an integer in the range ${minValue}–${maxValue}\n (or ${indeterminateValue} to disable), but got '${timeoutMs}'`);\n }\n }\n\n getCloseOnEscape(): boolean {\n return this.closeOnEscape_;\n }\n\n setCloseOnEscape(closeOnEscape: boolean) {\n this.closeOnEscape_ = closeOnEscape;\n }\n\n handleKeyDown(evt: KeyboardEvent) {\n const isEscapeKey = evt.key === 'Escape' || evt.keyCode === 27;\n if (isEscapeKey && this.getCloseOnEscape()) {\n this.close(REASON_DISMISS);\n }\n }\n\n handleActionButtonClick(_evt: MouseEvent) {\n this.close(REASON_ACTION);\n }\n\n handleActionIconClick(_evt: MouseEvent) {\n this.close(REASON_DISMISS);\n }\n\n private clearAutoDismissTimer_() {\n clearTimeout(this.autoDismissTimer_);\n this.autoDismissTimer_ = 0;\n }\n\n private handleAnimationTimerEnd_() {\n this.animationTimer_ = 0;\n this.adapter_.removeClass(cssClasses.OPENING);\n this.adapter_.removeClass(cssClasses.CLOSING);\n }\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame_(callback: () => void) {\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = requestAnimationFrame(() => {\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(callback, 0);\n });\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSnackbarFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {numbers, strings} from './constants';\n\nconst {ARIA_LIVE_DELAY_MS} = numbers;\nconst {ARIA_LIVE_LABEL_TEXT_ATTR} = strings;\n\nfunction announce(ariaEl: Element, labelEl: Element = ariaEl) {\n const priority = ariaEl.getAttribute('aria-live');\n\n // Trim text to ignore `&nbsp;` (see below).\n // textContent is only null if the node is a document, DOCTYPE, or notation.\n const labelText = labelEl.textContent!.trim();\n if (!labelText || !priority) {\n return;\n }\n\n // Temporarily disable `aria-live` to prevent JAWS+Firefox from announcing the message twice.\n ariaEl.setAttribute('aria-live', 'off');\n\n // Temporarily clear `textContent` to force a DOM mutation event that will be detected by screen readers.\n // `aria-live` elements are only announced when the element's `textContent` *changes*, so snackbars\n // sent to the browser in the initial HTML response won't be read unless we clear the element's `textContent` first.\n // Similarly, displaying the same snackbar message twice in a row doesn't trigger a DOM mutation event,\n // so screen readers won't announce the second message unless we first clear `textContent`.\n //\n // We have to clear the label text two different ways to make it work in all browsers and screen readers:\n //\n // 1. `textContent = ''` is required for IE11 + JAWS\n // 2. `innerHTML = '&nbsp;'` is required for Chrome + JAWS and NVDA\n //\n // All other browser/screen reader combinations support both methods.\n //\n // The wrapper `<span>` visually hides the space character so that it doesn't cause jank when added/removed.\n // N.B.: Setting `position: absolute`, `opacity: 0`, or `height: 0` prevents Chrome from detecting the DOM change.\n //\n // This technique has been tested in:\n //\n // * JAWS 2019:\n // - Chrome 70\n // - Firefox 60 (ESR)\n // - IE 11\n // * NVDA 2018:\n // - Chrome 70\n // - Firefox 60 (ESR)\n // - IE 11\n // * ChromeVox 53\n labelEl.textContent = '';\n labelEl.innerHTML = '<span style=\"display: inline-block; width: 0; height: 1px;\">&nbsp;</span>';\n\n // Prevent visual jank by temporarily displaying the label text in the ::before pseudo-element.\n // CSS generated content is normally announced by screen readers\n // (except in IE 11; see https://tink.uk/accessibility-support-for-css-generated-content/);\n // however, `aria-live` is turned off, so this DOM update will be ignored by screen readers.\n labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText);\n\n setTimeout(() => {\n // Allow screen readers to announce changes to the DOM again.\n ariaEl.setAttribute('aria-live', priority);\n\n // Remove the message from the ::before pseudo-element.\n labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR);\n\n // Restore the original label text, which will be announced by screen readers.\n labelEl.textContent = labelText;\n }, ARIA_LIVE_DELAY_MS);\n}\n\nexport {announce};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {EventType, SpecificEventListener} from '@material/base/types';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCSwitchAdapter} from './adapter';\nimport {MDCSwitchFoundation} from './foundation';\n\nexport class MDCSwitch extends MDCComponent<MDCSwitchFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: HTMLElement) {\n return new MDCSwitch(root);\n }\n\n // Public visibility for this property is required by MDCRippleCapableSurface.\n root_!: Element; // assigned in MDCComponent constructor\n\n private readonly ripple_ = this.createRipple_();\n\n // Initialized in `initialSyncWithDOM`.\n private changeHandler_!: EventListener;\n\n destroy() {\n super.destroy();\n this.ripple_.destroy();\n this.nativeControl_.removeEventListener('change', this.changeHandler_);\n }\n\n initialSyncWithDOM() {\n this.changeHandler_ = (...args) => this.foundation_.handleChange(...args);\n this.nativeControl_.addEventListener('change', this.changeHandler_);\n\n // Sometimes the checked state of the input element is saved in the history.\n // The switch styling should match the checked state of the input element.\n // Do an initial sync between the native control and the foundation.\n this.checked = this.checked;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSwitchAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n setNativeControlChecked: (checked) => this.nativeControl_.checked = checked,\n setNativeControlDisabled: (disabled) => this.nativeControl_.disabled = disabled,\n setNativeControlAttr: (attr, value) => this.nativeControl_.setAttribute(attr, value),\n };\n return new MDCSwitchFoundation(adapter);\n }\n\n get ripple() {\n return this.ripple_;\n }\n\n get checked() {\n return this.nativeControl_.checked;\n }\n\n set checked(checked) {\n this.foundation_.setChecked(checked);\n }\n\n get disabled() {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled) {\n this.foundation_.setDisabled(disabled);\n }\n\n private createRipple_(): MDCRipple {\n const {RIPPLE_SURFACE_SELECTOR} = MDCSwitchFoundation.strings;\n const rippleSurface = this.root_.querySelector(RIPPLE_SURFACE_SELECTOR) as HTMLElement;\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n addClass: (className: string) => rippleSurface.classList.add(className),\n computeBoundingRect: () => rippleSurface.getBoundingClientRect(),\n deregisterInteractionHandler: <K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>) => {\n this.nativeControl_.removeEventListener(evtType, handler, applyPassive());\n },\n isSurfaceActive: () => matches(this.nativeControl_, ':active'),\n isUnbounded: () => true,\n registerInteractionHandler: <K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>) => {\n this.nativeControl_.addEventListener(evtType, handler, applyPassive());\n },\n removeClass: (className: string) => {\n rippleSurface.classList.remove(className);\n },\n updateCssVariable: (varName: string, value: string) => {\n rippleSurface.style.setProperty(varName, value);\n },\n };\n return new MDCRipple(this.root_, new MDCRippleFoundation(adapter));\n }\n\n private get nativeControl_() {\n const {NATIVE_CONTROL_SELECTOR} = MDCSwitchFoundation.strings;\n return this.root_.querySelector(NATIVE_CONTROL_SELECTOR) as HTMLInputElement;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/** CSS classes used by the switch. */\nconst cssClasses = {\n /** Class used for a switch that is in the \"checked\" (on) position. */\n CHECKED: 'mdc-switch--checked',\n /** Class used for a switch that is disabled. */\n DISABLED: 'mdc-switch--disabled',\n};\n\n/** String constants used by the switch. */\nconst strings = {\n /** Aria attribute for checked or unchecked state of switch */\n ARIA_CHECKED_ATTR: 'aria-checked',\n /** A CSS selector used to locate the native HTML control for the switch. */\n NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',\n /** A CSS selector used to locate the ripple surface element for the switch. */\n RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay',\n};\n\nexport {cssClasses, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSwitchAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCSwitchFoundation extends MDCFoundation<MDCSwitchAdapter> {\n /** The string constants used by the switch. */\n static get strings() {\n return strings;\n }\n\n /** The CSS classes used by the switch. */\n static get cssClasses() {\n return cssClasses;\n }\n\n /** The default Adapter for the switch. */\n static get defaultAdapter(): MDCSwitchAdapter {\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNativeControlChecked: () => undefined,\n setNativeControlDisabled: () => undefined,\n setNativeControlAttr: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCSwitchAdapter>) {\n super({...MDCSwitchFoundation.defaultAdapter, ...adapter});\n }\n\n /** Sets the checked state of the switch. */\n setChecked(checked: boolean) {\n this.adapter_.setNativeControlChecked(checked);\n this.updateAriaChecked_(checked);\n this.updateCheckedStyling_(checked);\n }\n\n /** Sets the disabled state of the switch. */\n setDisabled(disabled: boolean) {\n this.adapter_.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter_.addClass(cssClasses.DISABLED);\n } else {\n this.adapter_.removeClass(cssClasses.DISABLED);\n }\n }\n\n /** Handles the change event for the switch native control. */\n handleChange(evt: Event) {\n const nativeControl = evt.target as HTMLInputElement;\n this.updateAriaChecked_(nativeControl.checked);\n this.updateCheckedStyling_(nativeControl.checked);\n }\n\n /** Updates the styling of the switch based on its checked state. */\n private updateCheckedStyling_(checked: boolean) {\n if (checked) {\n this.adapter_.addClass(cssClasses.CHECKED);\n } else {\n this.adapter_.removeClass(cssClasses.CHECKED);\n }\n }\n\n private updateAriaChecked_(checked: boolean) {\n this.adapter_.setNativeControlAttr(\n strings.ARIA_CHECKED_ATTR, `${!!checked}`);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSwitchFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCTabScroller, MDCTabScrollerFactory} from '@material/tab-scroller/component';\nimport {MDCTab, MDCTabFactory} from '@material/tab/component';\nimport {MDCTabFoundation} from '@material/tab/foundation';\nimport {MDCTabInteractionEvent} from '@material/tab/types';\nimport {MDCTabBarAdapter} from './adapter';\nimport {MDCTabBarFoundation} from './foundation';\nimport {MDCTabBarActivatedEventDetail} from './types';\n\nconst {strings} = MDCTabBarFoundation;\n\nlet tabIdCounter = 0;\n\nexport class MDCTabBar extends MDCComponent<MDCTabBarFoundation> {\n static attachTo(root: Element): MDCTabBar {\n return new MDCTabBar(root);\n }\n\n private tabList_!: MDCTab[]; // assigned in initialize()\n private tabScroller_!: MDCTabScroller | null; // assigned in initialize()\n private handleTabInteraction_!: CustomEventListener<MDCTabInteractionEvent>; // assigned in initialSyncWithDOM()\n private handleKeyDown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n\n set focusOnActivate(focusOnActivate: boolean) {\n this.tabList_.forEach((tab) => tab.focusOnActivate = focusOnActivate);\n }\n\n set useAutomaticActivation(useAutomaticActivation: boolean) {\n this.foundation_.setUseAutomaticActivation(useAutomaticActivation);\n }\n\n initialize(\n tabFactory: MDCTabFactory = (el) => new MDCTab(el),\n tabScrollerFactory: MDCTabScrollerFactory = (el) => new MDCTabScroller(el),\n ) {\n this.tabList_ = this.instantiateTabs_(tabFactory);\n this.tabScroller_ = this.instantiateTabScroller_(tabScrollerFactory);\n }\n\n initialSyncWithDOM() {\n this.handleTabInteraction_ = (evt) => this.foundation_.handleTabInteraction(evt);\n this.handleKeyDown_ = (evt) => this.foundation_.handleKeyDown(evt);\n\n this.listen(MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);\n this.listen('keydown', this.handleKeyDown_);\n\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].active) {\n this.scrollIntoView(i);\n break;\n }\n }\n }\n\n destroy() {\n super.destroy();\n this.unlisten(MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);\n this.unlisten('keydown', this.handleKeyDown_);\n this.tabList_.forEach((tab) => tab.destroy());\n\n if (this.tabScroller_) {\n this.tabScroller_.destroy();\n }\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabBarAdapter = {\n scrollTo: (scrollX) => this.tabScroller_!.scrollTo(scrollX),\n incrementScroll: (scrollXIncrement) => this.tabScroller_!.incrementScroll(scrollXIncrement),\n getScrollPosition: () => this.tabScroller_!.getScrollPosition(),\n getScrollContentWidth: () => this.tabScroller_!.getScrollContentWidth(),\n getOffsetWidth: () => (this.root_ as HTMLElement).offsetWidth,\n isRTL: () => window.getComputedStyle(this.root_).getPropertyValue('direction') === 'rtl',\n setActiveTab: (index) => this.foundation_.activateTab(index),\n activateTabAtIndex: (index, clientRect) => this.tabList_[index].activate(clientRect),\n deactivateTabAtIndex: (index) => this.tabList_[index].deactivate(),\n focusTabAtIndex: (index) => this.tabList_[index].focus(),\n getTabIndicatorClientRectAtIndex: (index) => this.tabList_[index].computeIndicatorClientRect(),\n getTabDimensionsAtIndex: (index) => this.tabList_[index].computeDimensions(),\n getPreviousActiveTabIndex: () => {\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].active) {\n return i;\n }\n }\n return -1;\n },\n getFocusedTabIndex: () => {\n const tabElements = this.getTabElements_();\n const activeElement = document.activeElement!;\n return tabElements.indexOf(activeElement);\n },\n getIndexOfTabById: (id) => {\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].id === id) {\n return i;\n }\n }\n return -1;\n },\n getTabListLength: () => this.tabList_.length,\n notifyTabActivated: (index) =>\n this.emit<MDCTabBarActivatedEventDetail>(strings.TAB_ACTIVATED_EVENT, {index}, true),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabBarFoundation(adapter);\n }\n\n /**\n * Activates the tab at the given index\n * @param index The index of the tab\n */\n activateTab(index: number) {\n this.foundation_.activateTab(index);\n }\n\n /**\n * Scrolls the tab at the given index into view\n * @param index THe index of the tab\n */\n scrollIntoView(index: number) {\n this.foundation_.scrollIntoView(index);\n }\n\n /**\n * Returns all the tab elements in a nice clean array\n */\n private getTabElements_(): Element[] {\n return [].slice.call(this.root_.querySelectorAll(strings.TAB_SELECTOR));\n }\n\n /**\n * Instantiates tab components on all child tab elements\n */\n private instantiateTabs_(tabFactory: MDCTabFactory) {\n return this.getTabElements_().map((el) => {\n el.id = el.id || `mdc-tab-${++tabIdCounter}`;\n return tabFactory(el);\n });\n }\n\n /**\n * Instantiates tab scroller component on the child tab scroller element\n */\n private instantiateTabScroller_(tabScrollerFactory: MDCTabScrollerFactory): MDCTabScroller | null {\n const tabScrollerElement = this.root_.querySelector(strings.TAB_SCROLLER_SELECTOR);\n if (tabScrollerElement) {\n return tabScrollerFactory(tabScrollerElement);\n }\n return null;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARROW_LEFT_KEY: 'ArrowLeft',\n ARROW_RIGHT_KEY: 'ArrowRight',\n END_KEY: 'End',\n ENTER_KEY: 'Enter',\n HOME_KEY: 'Home',\n SPACE_KEY: 'Space',\n TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',\n TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',\n TAB_SELECTOR: '.mdc-tab',\n};\n\nconst numbers = {\n ARROW_LEFT_KEYCODE: 37,\n ARROW_RIGHT_KEYCODE: 39,\n END_KEYCODE: 35,\n ENTER_KEYCODE: 13,\n EXTRA_SCROLL_AMOUNT: 20,\n HOME_KEYCODE: 36,\n SPACE_KEYCODE: 32,\n};\n\nexport {numbers, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabDimensions, MDCTabInteractionEvent} from '@material/tab/types';\nimport {MDCTabBarAdapter} from './adapter';\nimport {numbers, strings} from './constants';\n\nconst ACCEPTABLE_KEYS = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\nACCEPTABLE_KEYS.add(strings.ARROW_LEFT_KEY);\nACCEPTABLE_KEYS.add(strings.ARROW_RIGHT_KEY);\nACCEPTABLE_KEYS.add(strings.END_KEY);\nACCEPTABLE_KEYS.add(strings.HOME_KEY);\nACCEPTABLE_KEYS.add(strings.ENTER_KEY);\nACCEPTABLE_KEYS.add(strings.SPACE_KEY);\n\nconst KEYCODE_MAP = new Map<number, string>();\n// IE11 has no support for new Map with iterable so we need to initialize this by hand\nKEYCODE_MAP.set(numbers.ARROW_LEFT_KEYCODE, strings.ARROW_LEFT_KEY);\nKEYCODE_MAP.set(numbers.ARROW_RIGHT_KEYCODE, strings.ARROW_RIGHT_KEY);\nKEYCODE_MAP.set(numbers.END_KEYCODE, strings.END_KEY);\nKEYCODE_MAP.set(numbers.HOME_KEYCODE, strings.HOME_KEY);\nKEYCODE_MAP.set(numbers.ENTER_KEYCODE, strings.ENTER_KEY);\nKEYCODE_MAP.set(numbers.SPACE_KEYCODE, strings.SPACE_KEY);\n\nexport class MDCTabBarFoundation extends MDCFoundation<MDCTabBarAdapter> {\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCTabBarAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n scrollTo: () => undefined,\n incrementScroll: () => undefined,\n getScrollPosition: () => 0,\n getScrollContentWidth: () => 0,\n getOffsetWidth: () => 0,\n isRTL: () => false,\n setActiveTab: () => undefined,\n activateTabAtIndex: () => undefined,\n deactivateTabAtIndex: () => undefined,\n focusTabAtIndex: () => undefined,\n getTabIndicatorClientRectAtIndex: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n getTabDimensionsAtIndex: () => ({rootLeft: 0, rootRight: 0, contentLeft: 0, contentRight: 0}),\n getPreviousActiveTabIndex: () => -1,\n getFocusedTabIndex: () => -1,\n getIndexOfTabById: () => -1,\n getTabListLength: () => 0,\n notifyTabActivated: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private useAutomaticActivation_ = false;\n\n constructor(adapter?: Partial<MDCTabBarAdapter>) {\n super({...MDCTabBarFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Switches between automatic and manual activation modes.\n * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.\n */\n setUseAutomaticActivation(useAutomaticActivation: boolean) {\n this.useAutomaticActivation_ = useAutomaticActivation;\n }\n\n activateTab(index: number) {\n const previousActiveIndex = this.adapter_.getPreviousActiveTabIndex();\n if (!this.indexIsInRange_(index) || index === previousActiveIndex) {\n return;\n }\n\n let previousClientRect;\n if (previousActiveIndex !== -1) {\n this.adapter_.deactivateTabAtIndex(previousActiveIndex);\n previousClientRect = this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex);\n }\n\n this.adapter_.activateTabAtIndex(index, previousClientRect);\n this.scrollIntoView(index);\n\n this.adapter_.notifyTabActivated(index);\n }\n\n handleKeyDown(evt: KeyboardEvent) {\n // Get the key from the event\n const key = this.getKeyFromEvent_(evt);\n\n // Early exit if the event key isn't one of the keyboard navigation keys\n if (key === undefined) {\n return;\n }\n\n // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple\n if (!this.isActivationKey_(key)) {\n evt.preventDefault();\n }\n\n if (this.useAutomaticActivation_) {\n if (this.isActivationKey_(key)) {\n return;\n }\n\n const index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key);\n this.adapter_.setActiveTab(index);\n this.scrollIntoView(index);\n } else {\n const focusedTabIndex = this.adapter_.getFocusedTabIndex();\n if (this.isActivationKey_(key)) {\n this.adapter_.setActiveTab(focusedTabIndex);\n } else {\n const index = this.determineTargetFromKey_(focusedTabIndex, key);\n this.adapter_.focusTabAtIndex(index);\n this.scrollIntoView(index);\n }\n }\n }\n\n /**\n * Handles the MDCTab:interacted event\n */\n handleTabInteraction(evt: MDCTabInteractionEvent) {\n this.adapter_.setActiveTab(this.adapter_.getIndexOfTabById(evt.detail.tabId));\n }\n\n /**\n * Scrolls the tab at the given index into view\n * @param index The tab index to make visible\n */\n scrollIntoView(index: number) {\n // Early exit if the index is out of range\n if (!this.indexIsInRange_(index)) {\n return;\n }\n\n // Always scroll to 0 if scrolling to the 0th index\n if (index === 0) {\n return this.adapter_.scrollTo(0);\n }\n\n // Always scroll to the max value if scrolling to the Nth index\n // MDCTabScroller.scrollTo() will never scroll past the max possible value\n if (index === this.adapter_.getTabListLength() - 1) {\n return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());\n }\n\n if (this.isRTL_()) {\n return this.scrollIntoViewRTL_(index);\n }\n\n this.scrollIntoView_(index);\n }\n\n /**\n * Private method for determining the index of the destination tab based on what key was pressed\n * @param origin The original index from which to determine the destination\n * @param key The name of the key\n */\n private determineTargetFromKey_(origin: number, key: string): number {\n const isRTL = this.isRTL_();\n const maxIndex = this.adapter_.getTabListLength() - 1;\n const shouldGoToEnd = key === strings.END_KEY;\n const shouldDecrement = key === strings.ARROW_LEFT_KEY && !isRTL || key === strings.ARROW_RIGHT_KEY && isRTL;\n const shouldIncrement = key === strings.ARROW_RIGHT_KEY && !isRTL || key === strings.ARROW_LEFT_KEY && isRTL;\n let index = origin;\n\n if (shouldGoToEnd) {\n index = maxIndex;\n } else if (shouldDecrement) {\n index -= 1;\n } else if (shouldIncrement) {\n index += 1;\n } else {\n index = 0;\n }\n\n if (index < 0) {\n index = maxIndex;\n } else if (index > maxIndex) {\n index = 0;\n }\n\n return index;\n }\n\n /**\n * Calculates the scroll increment that will make the tab at the given index visible\n * @param index The index of the tab\n * @param nextIndex The index of the next tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the Tab Bar\n */\n private calculateScrollIncrement_(\n index: number,\n nextIndex: number,\n scrollPosition: number,\n barWidth: number,\n ): number {\n const nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);\n const relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;\n const relativeContentRight = nextTabDimensions.contentRight - scrollPosition;\n const leftIncrement = relativeContentRight - numbers.EXTRA_SCROLL_AMOUNT;\n const rightIncrement = relativeContentLeft + numbers.EXTRA_SCROLL_AMOUNT;\n\n if (nextIndex < index) {\n return Math.min(leftIncrement, 0);\n }\n\n return Math.max(rightIncrement, 0);\n }\n\n /**\n * Calculates the scroll increment that will make the tab at the given index visible in RTL\n * @param index The index of the tab\n * @param nextIndex The index of the next tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the Tab Bar\n * @param scrollContentWidth The width of the scroll content\n */\n private calculateScrollIncrementRTL_(\n index: number,\n nextIndex: number,\n scrollPosition: number,\n barWidth: number,\n scrollContentWidth: number,\n ): number {\n const nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);\n const relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;\n const relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;\n const leftIncrement = relativeContentRight + numbers.EXTRA_SCROLL_AMOUNT;\n const rightIncrement = relativeContentLeft - numbers.EXTRA_SCROLL_AMOUNT;\n\n if (nextIndex > index) {\n return Math.max(leftIncrement, 0);\n }\n\n return Math.min(rightIncrement, 0);\n }\n\n /**\n * Determines the index of the adjacent tab closest to either edge of the Tab Bar\n * @param index The index of the tab\n * @param tabDimensions The dimensions of the tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the tab bar\n */\n private findAdjacentTabIndexClosestToEdge_(\n index: number,\n tabDimensions: MDCTabDimensions,\n scrollPosition: number,\n barWidth: number,\n ): number {\n /**\n * Tabs are laid out in the Tab Scroller like this:\n *\n * Scroll Position\n * +---+\n * | | Bar Width\n * | +-----------------------------------+\n * | | |\n * | V V\n * | +-----------------------------------+\n * V | Tab Scroller |\n * +------------+--------------+-------------------+\n * | Tab | Tab | Tab |\n * +------------+--------------+-------------------+\n * | |\n * +-----------------------------------+\n *\n * To determine the next adjacent index, we look at the Tab root left and\n * Tab root right, both relative to the scroll position. If the Tab root\n * left is less than 0, then we know it's out of view to the left. If the\n * Tab root right minus the bar width is greater than 0, we know the Tab is\n * out of view to the right. From there, we either increment or decrement\n * the index.\n */\n const relativeRootLeft = tabDimensions.rootLeft - scrollPosition;\n const relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;\n const relativeRootDelta = relativeRootLeft + relativeRootRight;\n const leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;\n const rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;\n\n if (leftEdgeIsCloser) {\n return index - 1;\n }\n\n if (rightEdgeIsCloser) {\n return index + 1;\n }\n\n return -1;\n }\n\n /**\n * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL\n * @param index The index of the tab\n * @param tabDimensions The dimensions of the tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the tab bar\n * @param scrollContentWidth The width of the scroller content\n */\n private findAdjacentTabIndexClosestToEdgeRTL_(\n index: number,\n tabDimensions: MDCTabDimensions,\n scrollPosition: number,\n barWidth: number,\n scrollContentWidth: number,\n ): number {\n const rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;\n const rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;\n const rootDelta = rootLeft + rootRight;\n const leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;\n const rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;\n\n if (leftEdgeIsCloser) {\n return index + 1;\n }\n\n if (rightEdgeIsCloser) {\n return index - 1;\n }\n\n return -1;\n }\n\n /**\n * Returns the key associated with a keydown event\n * @param evt The keydown event\n */\n private getKeyFromEvent_(evt: KeyboardEvent): string {\n if (ACCEPTABLE_KEYS.has(evt.key)) {\n return evt.key;\n }\n return KEYCODE_MAP.get(evt.keyCode)!;\n }\n\n private isActivationKey_(key: string) {\n return key === strings.SPACE_KEY || key === strings.ENTER_KEY;\n }\n\n /**\n * Returns whether a given index is inclusively between the ends\n * @param index The index to test\n */\n private indexIsInRange_(index: number) {\n return index >= 0 && index < this.adapter_.getTabListLength();\n }\n\n /**\n * Returns the view's RTL property\n */\n private isRTL_(): boolean {\n return this.adapter_.isRTL();\n }\n\n /**\n * Scrolls the tab at the given index into view for left-to-right user agents.\n * @param index The index of the tab to scroll into view\n */\n private scrollIntoView_(index: number) {\n const scrollPosition = this.adapter_.getScrollPosition();\n const barWidth = this.adapter_.getOffsetWidth();\n const tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);\n const nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);\n\n if (!this.indexIsInRange_(nextIndex)) {\n return;\n }\n\n const scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);\n this.adapter_.incrementScroll(scrollIncrement);\n }\n\n /**\n * Scrolls the tab at the given index into view in RTL\n * @param index The tab index to make visible\n */\n private scrollIntoViewRTL_(index: number) {\n const scrollPosition = this.adapter_.getScrollPosition();\n const barWidth = this.adapter_.getOffsetWidth();\n const tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);\n const scrollWidth = this.adapter_.getScrollContentWidth();\n const nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(\n index, tabDimensions, scrollPosition, barWidth, scrollWidth);\n\n if (!this.indexIsInRange_(nextIndex)) {\n return;\n }\n\n const scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);\n this.adapter_.incrementScroll(scrollIncrement);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabBarFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\n\nimport {MDCTabIndicatorAdapter} from './adapter';\nimport {MDCFadingTabIndicatorFoundation} from './fading-foundation';\nimport {MDCTabIndicatorFoundation} from './foundation';\nimport {MDCSlidingTabIndicatorFoundation} from './sliding-foundation';\n\nexport type MDCTabIndicatorFactory = (el: Element, foundation?: MDCTabIndicatorFoundation) => MDCTabIndicator;\n\nexport class MDCTabIndicator extends MDCComponent<MDCTabIndicatorFoundation> {\n static attachTo(root: Element): MDCTabIndicator {\n return new MDCTabIndicator(root);\n }\n\n private content_!: HTMLElement; // assigned in initialize()\n\n initialize() {\n this.content_ = this.root_.querySelector<HTMLElement>(MDCTabIndicatorFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n computeContentClientRect(): ClientRect {\n return this.foundation_.computeContentClientRect();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabIndicatorAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n computeContentClientRect: () => this.content_.getBoundingClientRect(),\n setContentStyleProperty: (prop, value) => this.content_.style.setProperty(prop, value),\n };\n // tslint:enable:object-literal-sort-keys\n\n if (this.root_.classList.contains(MDCTabIndicatorFoundation.cssClasses.FADE)) {\n return new MDCFadingTabIndicatorFoundation(adapter);\n }\n\n // Default to the sliding indicator\n return new MDCSlidingTabIndicatorFoundation(adapter);\n }\n\n activate(previousIndicatorClientRect?: ClientRect) {\n this.foundation_.activate(previousIndicatorClientRect);\n }\n\n deactivate() {\n this.foundation_.deactivate();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVE: 'mdc-tab-indicator--active',\n FADE: 'mdc-tab-indicator--fade',\n NO_TRANSITION: 'mdc-tab-indicator--no-transition',\n};\n\nconst strings = {\n CONTENT_SELECTOR: '.mdc-tab-indicator__content',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabIndicatorFoundation} from './foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCFadingTabIndicatorFoundation extends MDCTabIndicatorFoundation {\n activate() {\n this.adapter_.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n\n deactivate() {\n this.adapter_.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFadingTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabIndicatorAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport abstract class MDCTabIndicatorFoundation extends MDCFoundation<MDCTabIndicatorAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabIndicatorAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n computeContentClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n setContentStyleProperty: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCTabIndicatorAdapter>) {\n super({...MDCTabIndicatorFoundation.defaultAdapter, ...adapter});\n }\n\n computeContentClientRect(): ClientRect {\n return this.adapter_.computeContentClientRect();\n }\n\n abstract activate(previousIndicatorClientRect?: ClientRect): void;\n abstract deactivate(): void;\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './fading-foundation';\nexport * from './sliding-foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabIndicatorFoundation} from './foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCSlidingTabIndicatorFoundation extends MDCTabIndicatorFoundation {\n activate(previousIndicatorClientRect?: ClientRect) {\n // Early exit if no indicator is present to handle cases where an indicator\n // may be activated without a prior indicator state\n if (!previousIndicatorClientRect) {\n this.adapter_.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n return;\n }\n\n // This animation uses the FLIP approach. You can read more about it at the link below:\n // https://aerotwist.com/blog/flip-your-animations/\n\n // Calculate the dimensions based on the dimensions of the previous indicator\n const currentClientRect = this.computeContentClientRect();\n const widthDelta = previousIndicatorClientRect.width / currentClientRect.width;\n const xPosition = previousIndicatorClientRect.left - currentClientRect.left;\n this.adapter_.addClass(MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);\n this.adapter_.setContentStyleProperty('transform', `translateX(${xPosition}px) scaleX(${widthDelta})`);\n\n // Force repaint before updating classes and transform to ensure the transform properly takes effect\n this.computeContentClientRect();\n\n this.adapter_.removeClass(MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);\n this.adapter_.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n this.adapter_.setContentStyleProperty('transform', '');\n }\n\n deactivate() {\n this.adapter_.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSlidingTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {MDCTabScrollerFoundation} from './foundation';\nimport * as util from './util';\n\ntype InteractionEventType = 'wheel' | 'touchstart' | 'pointerdown' | 'mousedown' | 'keydown';\n\nexport type MDCTabScrollerFactory = (el: Element, foundation?: MDCTabScrollerFoundation) => MDCTabScroller;\n\nexport class MDCTabScroller extends MDCComponent<MDCTabScrollerFoundation> {\n static attachTo(root: Element): MDCTabScroller {\n return new MDCTabScroller(root);\n }\n\n private content_!: HTMLElement; // assigned in initialize()\n private area_!: HTMLElement; // assigned in initialize()\n private handleInteraction_!: SpecificEventListener<InteractionEventType>; // assigned in initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // assigned in initialSyncWithDOM()\n\n initialize() {\n this.area_ = this.root_.querySelector<HTMLElement>(MDCTabScrollerFoundation.strings.AREA_SELECTOR)!;\n this.content_ = this.root_.querySelector<HTMLElement>(MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n initialSyncWithDOM() {\n this.handleInteraction_ = () => this.foundation_.handleInteraction();\n this.handleTransitionEnd_ = (evt) => this.foundation_.handleTransitionEnd(evt);\n\n this.area_.addEventListener('wheel', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('touchstart', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('pointerdown', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('mousedown', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('keydown', this.handleInteraction_, applyPassive());\n this.content_.addEventListener('transitionend', this.handleTransitionEnd_);\n }\n\n destroy() {\n super.destroy();\n\n this.area_.removeEventListener('wheel', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('touchstart', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('pointerdown', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('mousedown', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('keydown', this.handleInteraction_, applyPassive());\n this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabScrollerAdapter = {\n eventTargetMatchesSelector: (evtTarget, selector) => matches(evtTarget as Element, selector),\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n addScrollAreaClass: (className) => this.area_.classList.add(className),\n setScrollAreaStyleProperty: (prop, value) => this.area_.style.setProperty(prop, value),\n setScrollContentStyleProperty: (prop, value) => this.content_.style.setProperty(prop, value),\n getScrollContentStyleValue: (propName) => window.getComputedStyle(this.content_).getPropertyValue(propName),\n setScrollAreaScrollLeft: (scrollX) => this.area_.scrollLeft = scrollX,\n getScrollAreaScrollLeft: () => this.area_.scrollLeft,\n getScrollContentOffsetWidth: () => this.content_.offsetWidth,\n getScrollAreaOffsetWidth: () => this.area_.offsetWidth,\n computeScrollAreaClientRect: () => this.area_.getBoundingClientRect(),\n computeScrollContentClientRect: () => this.content_.getBoundingClientRect(),\n computeHorizontalScrollbarHeight: () => util.computeHorizontalScrollbarHeight(document),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabScrollerFoundation(adapter);\n }\n\n /**\n * Returns the current visual scroll position\n */\n getScrollPosition(): number {\n return this.foundation_.getScrollPosition();\n }\n\n /**\n * Returns the width of the scroll content\n */\n getScrollContentWidth(): number {\n return this.content_.offsetWidth;\n }\n\n /**\n * Increments the scroll value by the given amount\n * @param scrollXIncrement The pixel value by which to increment the scroll value\n */\n incrementScroll(scrollXIncrement: number) {\n this.foundation_.incrementScroll(scrollXIncrement);\n }\n\n /**\n * Scrolls to the given pixel position\n * @param scrollX The pixel value to scroll to\n */\n scrollTo(scrollX: number) {\n this.foundation_.scrollTo(scrollX);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANIMATING: 'mdc-tab-scroller--animating',\n SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll',\n SCROLL_TEST: 'mdc-tab-scroller__test',\n};\n\nconst strings = {\n AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',\n CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCTabScrollerRTLDefault} from './rtl-default-scroller';\nimport {MDCTabScrollerRTLNegative} from './rtl-negative-scroller';\nimport {MDCTabScrollerRTLReverse} from './rtl-reverse-scroller';\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerFoundation extends MDCFoundation<MDCTabScrollerAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabScrollerAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n eventTargetMatchesSelector: () => false,\n addClass: () => undefined,\n removeClass: () => undefined,\n addScrollAreaClass: () => undefined,\n setScrollAreaStyleProperty: () => undefined,\n setScrollContentStyleProperty: () => undefined,\n getScrollContentStyleValue: () => '',\n setScrollAreaScrollLeft: () => undefined,\n getScrollAreaScrollLeft: () => 0,\n getScrollContentOffsetWidth: () => 0,\n getScrollAreaOffsetWidth: () => 0,\n computeScrollAreaClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n computeScrollContentClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n computeHorizontalScrollbarHeight: () => 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /**\n * Controls whether we should handle the transitionend and interaction events during the animation.\n */\n private isAnimating_ = false;\n\n /**\n * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior\n * of RTL scrolling in it's own class.\n */\n private rtlScrollerInstance_?: MDCTabScrollerRTL;\n\n constructor(adapter?: Partial<MDCTabScrollerAdapter>) {\n super({...MDCTabScrollerFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll\n // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.\n const horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();\n this.adapter_.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px');\n this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);\n }\n\n /**\n * Computes the current visual scroll position\n */\n getScrollPosition(): number {\n if (this.isRTL_()) {\n return this.computeCurrentScrollPositionRTL_();\n }\n\n const currentTranslateX = this.calculateCurrentTranslateX_();\n const scrollLeft = this.adapter_.getScrollAreaScrollLeft();\n return scrollLeft - currentTranslateX;\n }\n\n /**\n * Handles interaction events that occur during transition\n */\n handleInteraction() {\n // Early exit if we aren't animating\n if (!this.isAnimating_) {\n return;\n }\n\n // Prevent other event listeners from handling this event\n this.stopScrollAnimation_();\n }\n\n /**\n * Handles the transitionend event\n */\n handleTransitionEnd(evt: Event) {\n // Early exit if we aren't animating or the event was triggered by a different element.\n const evtTarget = evt.target as Element;\n if (!this.isAnimating_ ||\n !this.adapter_.eventTargetMatchesSelector(evtTarget, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {\n return;\n }\n\n this.isAnimating_ = false;\n this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n }\n\n /**\n * Increment the scroll value by the scrollXIncrement using animation.\n * @param scrollXIncrement The value by which to increment the scroll position\n */\n incrementScroll(scrollXIncrement: number) {\n // Early exit for non-operational increment values\n if (scrollXIncrement === 0) {\n return;\n }\n\n this.animate_(this.getIncrementScrollOperation_(scrollXIncrement));\n }\n\n /**\n * Increment the scroll value by the scrollXIncrement without animation.\n * @param scrollXIncrement The value by which to increment the scroll position\n */\n incrementScrollImmediate(scrollXIncrement: number) {\n // Early exit for non-operational increment values\n if (scrollXIncrement === 0) {\n return;\n }\n\n const operation = this.getIncrementScrollOperation_(scrollXIncrement);\n if (operation.scrollDelta === 0) {\n return;\n }\n\n this.stopScrollAnimation_();\n this.adapter_.setScrollAreaScrollLeft(operation.finalScrollPosition);\n }\n\n /**\n * Scrolls to the given scrollX value\n */\n scrollTo(scrollX: number) {\n if (this.isRTL_()) {\n return this.scrollToRTL_(scrollX);\n }\n\n this.scrollTo_(scrollX);\n }\n\n /**\n * @return Browser-specific {@link MDCTabScrollerRTL} instance.\n */\n getRTLScroller(): MDCTabScrollerRTL {\n if (!this.rtlScrollerInstance_) {\n this.rtlScrollerInstance_ = this.rtlScrollerFactory_();\n }\n\n return this.rtlScrollerInstance_;\n }\n\n /**\n * @return translateX value from a CSS matrix transform function string.\n */\n private calculateCurrentTranslateX_(): number {\n const transformValue = this.adapter_.getScrollContentStyleValue('transform');\n // Early exit if no transform is present\n if (transformValue === 'none') {\n return 0;\n }\n\n // The transform value comes back as a matrix transformation in the form\n // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so\n // we're going to grab all the parenthesized values, strip out tx, and\n // parse it.\n const match = /\\((.+?)\\)/.exec(transformValue);\n if (!match) {\n return 0;\n }\n\n const matrixParams = match[1];\n\n // tslint:disable-next-line:ban-ts-ignore \"Unused vars\" should be a linter warning, not a compiler error.\n // @ts-ignore These unused variables should retain their semantic names for clarity.\n const [a, b, c, d, tx, ty] = matrixParams.split(',');\n\n return parseFloat(tx); // tslint:disable-line:ban\n }\n\n /**\n * Calculates a safe scroll value that is > 0 and < the max scroll value\n * @param scrollX The distance to scroll\n */\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.left, scrollX), edges.right);\n }\n\n private computeCurrentScrollPositionRTL_(): number {\n const translateX = this.calculateCurrentTranslateX_();\n return this.getRTLScroller().getScrollPositionRTL(translateX);\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter_.getScrollContentOffsetWidth();\n const rootWidth = this.adapter_.getScrollAreaOffsetWidth();\n return {\n left: 0,\n right: contentWidth - rootWidth,\n };\n }\n\n /**\n * Internal scroll method\n * @param scrollX The new scroll position\n */\n private scrollTo_(scrollX: number) {\n const currentScrollX = this.getScrollPosition();\n const safeScrollX = this.clampScrollValue_(scrollX);\n const scrollDelta = safeScrollX - currentScrollX;\n this.animate_({\n finalScrollPosition: safeScrollX,\n scrollDelta,\n });\n }\n\n /**\n * Internal RTL scroll method\n * @param scrollX The new scroll position\n */\n private scrollToRTL_(scrollX: number) {\n const animation = this.getRTLScroller().scrollToRTL(scrollX);\n this.animate_(animation);\n }\n\n /**\n * Internal method to compute the increment scroll operation values.\n * @param scrollX The desired scroll position increment\n * @return MDCTabScrollerAnimation with the sanitized values for performing the scroll operation.\n */\n private getIncrementScrollOperation_(scrollX: number): MDCTabScrollerAnimation {\n if (this.isRTL_()) {\n return this.getRTLScroller().incrementScrollRTL(scrollX);\n }\n\n const currentScrollX = this.getScrollPosition();\n const targetScrollX = scrollX + currentScrollX;\n const safeScrollX = this.clampScrollValue_(targetScrollX);\n const scrollDelta = safeScrollX - currentScrollX;\n return {\n finalScrollPosition: safeScrollX,\n scrollDelta,\n };\n }\n\n /**\n * Animates the tab scrolling\n * @param animation The animation to apply\n */\n private animate_(animation: MDCTabScrollerAnimation) {\n // Early exit if translateX is 0, which means there's no animation to perform\n if (animation.scrollDelta === 0) {\n return;\n }\n\n this.stopScrollAnimation_();\n // This animation uses the FLIP approach.\n // Read more here: https://aerotwist.com/blog/flip-your-animations/\n this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);\n this.adapter_.setScrollContentStyleProperty('transform', `translateX(${animation.scrollDelta}px)`);\n // Force repaint\n this.adapter_.computeScrollAreaClientRect();\n\n requestAnimationFrame(() => {\n this.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n this.adapter_.setScrollContentStyleProperty('transform', 'none');\n });\n\n this.isAnimating_ = true;\n }\n\n /**\n * Stops scroll animation\n */\n private stopScrollAnimation_() {\n this.isAnimating_ = false;\n const currentScrollPosition = this.getAnimatingScrollPosition_();\n this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n this.adapter_.setScrollContentStyleProperty('transform', 'translateX(0px)');\n this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);\n }\n\n /**\n * Gets the current scroll position during animation\n */\n private getAnimatingScrollPosition_(): number {\n const currentTranslateX = this.calculateCurrentTranslateX_();\n const scrollLeft = this.adapter_.getScrollAreaScrollLeft();\n if (this.isRTL_()) {\n return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);\n }\n\n return scrollLeft - currentTranslateX;\n }\n\n /**\n * Determines the RTL Scroller to use\n */\n private rtlScrollerFactory_(): MDCTabScrollerRTL {\n // Browsers have three different implementations of scrollLeft in RTL mode,\n // dependent on the browser. The behavior is based off the max LTR\n // scrollLeft value and 0.\n //\n // * Default scrolling in RTL *\n // - Left-most value: 0\n // - Right-most value: Max LTR scrollLeft value\n //\n // * Negative scrolling in RTL *\n // - Left-most value: Negated max LTR scrollLeft value\n // - Right-most value: 0\n //\n // * Reverse scrolling in RTL *\n // - Left-most value: Max LTR scrollLeft value\n // - Right-most value: 0\n //\n // We use those principles below to determine which RTL scrollLeft\n // behavior is implemented in the current browser.\n const initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);\n const newScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n\n // If the newScrollLeft value is negative,then we know that the browser has\n // implemented negative RTL scrolling, since all other implementations have\n // only positive values.\n if (newScrollLeft < 0) {\n // Undo the scrollLeft test check\n this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);\n return new MDCTabScrollerRTLNegative(this.adapter_);\n }\n\n const rootClientRect = this.adapter_.computeScrollAreaClientRect();\n const contentClientRect = this.adapter_.computeScrollContentClientRect();\n const rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);\n // Undo the scrollLeft test check\n this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);\n\n // By calculating the clientRect of the root element and the clientRect of\n // the content element, we can determine how much the scroll value changed\n // when we performed the scrollLeft subtraction above.\n if (rightEdgeDelta === newScrollLeft) {\n return new MDCTabScrollerRTLReverse(this.adapter_);\n }\n\n return new MDCTabScrollerRTLDefault(this.adapter_);\n }\n\n private isRTL_(): boolean {\n return this.adapter_.getScrollContentStyleValue('direction') === 'rtl';\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLDefault extends MDCTabScrollerRTL {\n getScrollPositionRTL(): number {\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n const {right} = this.calculateScrollEdges_();\n // Scroll values on most browsers are ints instead of floats so we round\n return Math.round(right - currentScrollLeft);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const edges = this.calculateScrollEdges_();\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number): number {\n return scrollX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter_.getScrollContentOffsetWidth();\n const rootWidth = this.adapter_.getScrollAreaOffsetWidth();\n return {\n left: 0,\n right: contentWidth - rootWidth,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.left, scrollX), edges.right);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLDefault;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLNegative extends MDCTabScrollerRTL {\n getScrollPositionRTL(translateX: number): number {\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n return Math.round(translateX - currentScrollLeft);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(-scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number, translateX: number): number {\n return scrollX - translateX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter_.getScrollContentOffsetWidth();\n const rootWidth = this.adapter_.getScrollAreaOffsetWidth();\n return {\n left: rootWidth - contentWidth,\n right: 0,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.max(Math.min(edges.right, scrollX), edges.left);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLNegative;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLReverse extends MDCTabScrollerRTL {\n getScrollPositionRTL(translateX: number): number {\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n // Scroll values on most browsers are ints instead of floats so we round\n return Math.round(currentScrollLeft - translateX);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: currentScrollLeft - clampedScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: currentScrollLeft - clampedScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number, translateX: number): number {\n return scrollX + translateX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter_.getScrollContentOffsetWidth();\n const rootWidth = this.adapter_.getScrollAreaOffsetWidth();\n return {\n left: contentWidth - rootWidth,\n right: 0,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.right, scrollX), edges.left);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLReverse;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {MDCTabScrollerAnimation} from './types';\n\nexport abstract class MDCTabScrollerRTL {\n protected readonly adapter_: MDCTabScrollerAdapter;\n\n constructor(adapter: MDCTabScrollerAdapter) {\n this.adapter_ = adapter;\n }\n\n abstract getScrollPositionRTL(translateX: number): number;\n\n abstract scrollToRTL(scrollX: number): MDCTabScrollerAnimation;\n\n abstract incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation;\n\n /**\n * @param scrollX The current scrollX position\n * @param translateX The current translateX position\n */\n abstract getAnimatingScrollPosition(scrollX: number, translateX: number): number;\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTL;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {cssClasses} from './constants';\n\n/**\n * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.\n */\nlet horizontalScrollbarHeight_: number | undefined;\n\n/**\n * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.\n * May return 0 (e.g. on OS X browsers under default configuration).\n */\nexport function computeHorizontalScrollbarHeight(documentObj: Document, shouldCacheResult = true): number {\n if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {\n return horizontalScrollbarHeight_;\n }\n\n const el = documentObj.createElement('div');\n el.classList.add(cssClasses.SCROLL_TEST);\n documentObj.body.appendChild(el);\n\n const horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;\n documentObj.body.removeChild(el);\n\n if (shouldCacheResult) {\n horizontalScrollbarHeight_ = horizontalScrollbarHeight;\n }\n return horizontalScrollbarHeight;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCTabIndicator, MDCTabIndicatorFactory} from '@material/tab-indicator/component';\nimport {MDCTabAdapter} from './adapter';\nimport {MDCTabFoundation} from './foundation';\nimport {MDCTabDimensions, MDCTabInteractionEventDetail} from './types';\n\nexport type MDCTabFactory = (el: Element, foundation?: MDCTabFoundation) => MDCTab;\n\nexport class MDCTab extends MDCComponent<MDCTabFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element): MDCTab {\n return new MDCTab(root);\n }\n\n id!: string; // assigned in initialize();\n\n // Public visibility for this property is required by MDCRippleCapableSurface.\n root_!: HTMLElement; // assigned in MDCComponent constructor\n\n private ripple_!: MDCRipple; // assigned in initialize();\n private tabIndicator_!: MDCTabIndicator; // assigned in initialize();\n private content_!: HTMLElement; // assigned in initialize();\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialize();\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n tabIndicatorFactory: MDCTabIndicatorFactory = (el) => new MDCTabIndicator(el),\n ) {\n this.id = this.root_.id;\n const rippleSurface = this.root_.querySelector<HTMLElement>(MDCTabFoundation.strings.RIPPLE_SELECTOR)!;\n const rippleAdapter = {\n ...MDCRipple.createAdapter(this),\n addClass: (className: string) => rippleSurface.classList.add(className),\n removeClass: (className: string) => rippleSurface.classList.remove(className),\n updateCssVariable: (varName: string, value: string) => rippleSurface.style.setProperty(varName, value),\n };\n const rippleFoundation = new MDCRippleFoundation(rippleAdapter);\n this.ripple_ = rippleFactory(this.root_, rippleFoundation);\n\n const tabIndicatorElement = this.root_.querySelector(MDCTabFoundation.strings.TAB_INDICATOR_SELECTOR)!;\n this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);\n this.content_ = this.root_.querySelector<HTMLElement>(MDCTabFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n initialSyncWithDOM() {\n this.handleClick_ = () => this.foundation_.handleClick();\n this.listen('click', this.handleClick_);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick_);\n this.ripple_.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabAdapter = {\n setAttr: (attr, value) => this.root_.setAttribute(attr, value),\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n hasClass: (className) => this.root_.classList.contains(className),\n activateIndicator: (previousIndicatorClientRect) => this.tabIndicator_.activate(previousIndicatorClientRect),\n deactivateIndicator: () => this.tabIndicator_.deactivate(),\n notifyInteracted: () => this.emit<MDCTabInteractionEventDetail>(\n MDCTabFoundation.strings.INTERACTED_EVENT, {tabId: this.id}, true /* bubble */),\n getOffsetLeft: () => this.root_.offsetLeft,\n getOffsetWidth: () => this.root_.offsetWidth,\n getContentOffsetLeft: () => this.content_.offsetLeft,\n getContentOffsetWidth: () => this.content_.offsetWidth,\n focus: () => this.root_.focus(),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabFoundation(adapter);\n }\n\n /**\n * Getter for the active state of the tab\n */\n get active(): boolean {\n return this.foundation_.isActive();\n }\n\n set focusOnActivate(focusOnActivate: boolean) {\n this.foundation_.setFocusOnActivate(focusOnActivate);\n }\n\n /**\n * Activates the tab\n */\n activate(computeIndicatorClientRect?: ClientRect) {\n this.foundation_.activate(computeIndicatorClientRect);\n }\n\n /**\n * Deactivates the tab\n */\n deactivate() {\n this.foundation_.deactivate();\n }\n\n /**\n * Returns the indicator's client rect\n */\n computeIndicatorClientRect(): ClientRect {\n return this.tabIndicator_.computeContentClientRect();\n }\n\n computeDimensions(): MDCTabDimensions {\n return this.foundation_.computeDimensions();\n }\n\n /**\n * Focuses the tab\n */\n focus() {\n this.root_.focus();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVE: 'mdc-tab--active',\n};\n\nconst strings = {\n ARIA_SELECTED: 'aria-selected',\n CONTENT_SELECTOR: '.mdc-tab__content',\n INTERACTED_EVENT: 'MDCTab:interacted',\n RIPPLE_SELECTOR: '.mdc-tab__ripple',\n TABINDEX: 'tabIndex',\n TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCTabDimensions} from './types';\n\nexport class MDCTabFoundation extends MDCFoundation<MDCTabAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setAttr: () => undefined,\n activateIndicator: () => undefined,\n deactivateIndicator: () => undefined,\n notifyInteracted: () => undefined,\n getOffsetLeft: () => 0,\n getOffsetWidth: () => 0,\n getContentOffsetLeft: () => 0,\n getContentOffsetWidth: () => 0,\n focus: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private focusOnActivate_ = true;\n\n constructor(adapter?: Partial<MDCTabAdapter>) {\n super({...MDCTabFoundation.defaultAdapter, ...adapter});\n }\n\n handleClick() {\n // It's up to the parent component to keep track of the active Tab and\n // ensure we don't activate a Tab that's already active.\n this.adapter_.notifyInteracted();\n }\n\n isActive(): boolean {\n return this.adapter_.hasClass(cssClasses.ACTIVE);\n }\n\n /**\n * Sets whether the tab should focus itself when activated\n */\n setFocusOnActivate(focusOnActivate: boolean) {\n this.focusOnActivate_ = focusOnActivate;\n }\n\n /**\n * Activates the Tab\n */\n activate(previousIndicatorClientRect?: ClientRect) {\n this.adapter_.addClass(cssClasses.ACTIVE);\n this.adapter_.setAttr(strings.ARIA_SELECTED, 'true');\n this.adapter_.setAttr(strings.TABINDEX, '0');\n this.adapter_.activateIndicator(previousIndicatorClientRect);\n if (this.focusOnActivate_) {\n this.adapter_.focus();\n }\n }\n\n /**\n * Deactivates the Tab\n */\n deactivate() {\n // Early exit\n if (!this.isActive()) {\n return;\n }\n\n this.adapter_.removeClass(cssClasses.ACTIVE);\n this.adapter_.setAttr(strings.ARIA_SELECTED, 'false');\n this.adapter_.setAttr(strings.TABINDEX, '-1');\n this.adapter_.deactivateIndicator();\n }\n\n /**\n * Returns the dimensions of the Tab\n */\n computeDimensions(): MDCTabDimensions {\n const rootWidth = this.adapter_.getOffsetWidth();\n const rootLeft = this.adapter_.getOffsetLeft();\n const contentWidth = this.adapter_.getContentOffsetWidth();\n const contentLeft = this.adapter_.getContentOffsetLeft();\n\n return {\n contentLeft: rootLeft + contentLeft,\n contentRight: rootLeft + contentLeft + contentWidth,\n rootLeft,\n rootRight: rootLeft + rootWidth,\n };\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldCharacterCounterAdapter} from './adapter';\nimport {MDCTextFieldCharacterCounterFoundation} from './foundation';\n\nexport type MDCTextFieldCharacterCounterFactory =\n (el: Element, foundation?: MDCTextFieldCharacterCounterFoundation) => MDCTextFieldCharacterCounter;\n\nexport class MDCTextFieldCharacterCounter extends MDCComponent<MDCTextFieldCharacterCounterFoundation> {\n static attachTo(root: Element): MDCTextFieldCharacterCounter {\n return new MDCTextFieldCharacterCounter(root);\n }\n\n get foundation(): MDCTextFieldCharacterCounterFoundation {\n return this.foundation_;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCTextFieldCharacterCounterAdapter = {\n setContent: (content) => {\n this.root_.textContent = content;\n },\n };\n return new MDCTextFieldCharacterCounterFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ROOT: 'mdc-text-field-character-counter',\n};\n\nconst strings = {\n ROOT_SELECTOR: `.${cssClasses.ROOT}`,\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTextFieldCharacterCounterAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCTextFieldCharacterCounterFoundation extends MDCFoundation<MDCTextFieldCharacterCounterAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldCharacterCounterAdapter {\n return {\n setContent: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCTextFieldCharacterCounterAdapter>) {\n super({...MDCTextFieldCharacterCounterFoundation.defaultAdapter, ...adapter});\n }\n\n setCounterValue(currentLength: number, maxLength: number) {\n currentLength = Math.min(currentLength, maxLength);\n this.adapter_.setContent(`${currentLength} / ${maxLength}`);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldCharacterCounterFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as characterCountCssClasses, strings as characterCountStrings} from './constants';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport * as ponyfill from '@material/dom/ponyfill';\nimport {MDCFloatingLabel, MDCFloatingLabelFactory} from '@material/floating-label/component';\nimport {MDCLineRipple, MDCLineRippleFactory} from '@material/line-ripple/component';\nimport {MDCNotchedOutline, MDCNotchedOutlineFactory} from '@material/notched-outline/component';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCTextFieldAdapter, MDCTextFieldInputAdapter, MDCTextFieldLabelAdapter, MDCTextFieldLineRippleAdapter, MDCTextFieldOutlineAdapter, MDCTextFieldRootAdapter,} from './adapter';\nimport {MDCTextFieldCharacterCounter, MDCTextFieldCharacterCounterFactory,} from './character-counter/component';\nimport {MDCTextFieldCharacterCounterFoundation} from './character-counter/foundation';\nimport {cssClasses, strings} from './constants';\nimport {MDCTextFieldFoundation} from './foundation';\nimport {MDCTextFieldHelperText, MDCTextFieldHelperTextFactory,} from './helper-text/component';\nimport {MDCTextFieldHelperTextFoundation} from './helper-text/foundation';\nimport {MDCTextFieldIcon, MDCTextFieldIconFactory} from './icon/component';\nimport {MDCTextFieldFoundationMap} from './types';\n\nexport class MDCTextField extends MDCComponent<MDCTextFieldFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element): MDCTextField {\n return new MDCTextField(root);\n }\n\n // Public visibility for this property is required by MDCRippleCapableSurface.\n root_!: HTMLElement; // assigned in MDCComponent constructor\n\n ripple!: MDCRipple | null; // assigned in initialize()\n\n // The only required sub-element.\n private input_!: HTMLInputElement; // assigned in initialize()\n\n // Optional sub-elements.\n private characterCounter_!: MDCTextFieldCharacterCounter | null; // assigned in initialize()\n private helperText_!: MDCTextFieldHelperText | null; // assigned in initialize()\n private label_!: MDCFloatingLabel | null; // assigned in initialize()\n private leadingIcon_!: MDCTextFieldIcon | null; // assigned in initialize()\n private lineRipple_!: MDCLineRipple | null; // assigned in initialize()\n private outline_!: MDCNotchedOutline | null; // assigned in initialize()\n private trailingIcon_!: MDCTextFieldIcon | null; // assigned in initialize()\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n lineRippleFactory: MDCLineRippleFactory = (el) => new MDCLineRipple(el),\n helperTextFactory: MDCTextFieldHelperTextFactory = (el) => new MDCTextFieldHelperText(el),\n characterCounterFactory: MDCTextFieldCharacterCounterFactory = (el) => new MDCTextFieldCharacterCounter(el),\n iconFactory: MDCTextFieldIconFactory = (el) => new MDCTextFieldIcon(el),\n labelFactory: MDCFloatingLabelFactory = (el) => new MDCFloatingLabel(el),\n outlineFactory: MDCNotchedOutlineFactory = (el) => new MDCNotchedOutline(el),\n ) {\n this.input_ = this.root_.querySelector<HTMLInputElement>(strings.INPUT_SELECTOR)!;\n\n const labelElement = this.root_.querySelector(strings.LABEL_SELECTOR);\n this.label_ = labelElement ? labelFactory(labelElement) : null;\n\n const lineRippleElement = this.root_.querySelector(strings.LINE_RIPPLE_SELECTOR);\n this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;\n\n const outlineElement = this.root_.querySelector(strings.OUTLINE_SELECTOR);\n this.outline_ = outlineElement ? outlineFactory(outlineElement) : null;\n\n // Helper text\n const helperTextStrings = MDCTextFieldHelperTextFoundation.strings;\n const nextElementSibling = this.root_.nextElementSibling;\n const hasHelperLine = (nextElementSibling && nextElementSibling.classList.contains(cssClasses.HELPER_LINE));\n const helperTextEl =\n hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR);\n this.helperText_ = helperTextEl ? helperTextFactory(helperTextEl) : null;\n\n // Character counter\n const characterCounterStrings = MDCTextFieldCharacterCounterFoundation.strings;\n let characterCounterEl = this.root_.querySelector(characterCounterStrings.ROOT_SELECTOR);\n // If character counter is not found in root element search in sibling element.\n if (!characterCounterEl && hasHelperLine && nextElementSibling) {\n characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR);\n }\n this.characterCounter_ = characterCounterEl ? characterCounterFactory(characterCounterEl) : null;\n\n // Leading icon\n const leadingIconEl =\n this.root_.querySelector(strings.LEADING_ICON_SELECTOR);\n this.leadingIcon_ = leadingIconEl ? iconFactory(leadingIconEl) : null;\n\n // Trailing icon\n const trailingIconEl =\n this.root_.querySelector(strings.TRAILING_ICON_SELECTOR);\n this.trailingIcon_ = trailingIconEl ? iconFactory(trailingIconEl) : null;\n\n this.ripple = this.createRipple_(rippleFactory);\n }\n\n destroy() {\n if (this.ripple) {\n this.ripple.destroy();\n }\n if (this.lineRipple_) {\n this.lineRipple_.destroy();\n }\n if (this.helperText_) {\n this.helperText_.destroy();\n }\n if (this.characterCounter_) {\n this.characterCounter_.destroy();\n }\n if (this.leadingIcon_) {\n this.leadingIcon_.destroy();\n }\n if (this.trailingIcon_) {\n this.trailingIcon_.destroy();\n }\n if (this.label_) {\n this.label_.destroy();\n }\n if (this.outline_) {\n this.outline_.destroy();\n }\n super.destroy();\n }\n\n /**\n * Initializes the Text Field's internal state based on the environment's\n * state.\n */\n initialSyncWithDOM() {\n this.disabled = this.input_.disabled;\n }\n\n get value(): string {\n return this.foundation_.getValue();\n }\n\n /**\n * @param value The value to set on the input.\n */\n set value(value: string) {\n this.foundation_.setValue(value);\n }\n\n get disabled(): boolean {\n return this.foundation_.isDisabled();\n }\n\n /**\n * @param disabled Sets the Text Field disabled or enabled.\n */\n set disabled(disabled: boolean) {\n this.foundation_.setDisabled(disabled);\n }\n\n get valid(): boolean {\n return this.foundation_.isValid();\n }\n\n /**\n * @param valid Sets the Text Field valid or invalid.\n */\n set valid(valid: boolean) {\n this.foundation_.setValid(valid);\n }\n\n get required(): boolean {\n return this.input_.required;\n }\n\n /**\n * @param required Sets the Text Field to required.\n */\n set required(required: boolean) {\n this.input_.required = required;\n }\n\n get pattern(): string {\n return this.input_.pattern;\n }\n\n /**\n * @param pattern Sets the input element's validation pattern.\n */\n set pattern(pattern: string) {\n this.input_.pattern = pattern;\n }\n\n get minLength(): number {\n return this.input_.minLength;\n }\n\n /**\n * @param minLength Sets the input element's minLength.\n */\n set minLength(minLength: number) {\n this.input_.minLength = minLength;\n }\n\n get maxLength(): number {\n return this.input_.maxLength;\n }\n\n /**\n * @param maxLength Sets the input element's maxLength.\n */\n set maxLength(maxLength: number) {\n // Chrome throws exception if maxLength is set to a value less than zero\n if (maxLength < 0) {\n this.input_.removeAttribute('maxLength');\n } else {\n this.input_.maxLength = maxLength;\n }\n }\n\n get min(): string {\n return this.input_.min;\n }\n\n /**\n * @param min Sets the input element's min.\n */\n set min(min: string) {\n this.input_.min = min;\n }\n\n get max(): string {\n return this.input_.max;\n }\n\n /**\n * @param max Sets the input element's max.\n */\n set max(max: string) {\n this.input_.max = max;\n }\n\n get step(): string {\n return this.input_.step;\n }\n\n /**\n * @param step Sets the input element's step.\n */\n set step(step: string) {\n this.input_.step = step;\n }\n\n /**\n * Sets the helper text element content.\n */\n set helperTextContent(content: string) {\n this.foundation_.setHelperTextContent(content);\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n set leadingIconAriaLabel(label: string) {\n this.foundation_.setLeadingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n set leadingIconContent(content: string) {\n this.foundation_.setLeadingIconContent(content);\n }\n\n /**\n * Sets the aria label of the trailing icon.\n */\n set trailingIconAriaLabel(label: string) {\n this.foundation_.setTrailingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the trailing icon.\n */\n set trailingIconContent(content: string) {\n this.foundation_.setTrailingIconContent(content);\n }\n\n /**\n * Enables or disables the use of native validation. Use this for custom validation.\n * @param useNativeValidation Set this to false to ignore native input validation.\n */\n set useNativeValidation(useNativeValidation: boolean) {\n this.foundation_.setUseNativeValidation(useNativeValidation);\n }\n\n /**\n * Focuses the input element.\n */\n focus() {\n this.input_.focus();\n }\n\n /**\n * Recomputes the outline SVG path for the outline element.\n */\n layout() {\n const openNotch = this.foundation_.shouldFloat;\n this.foundation_.notchOutline(openNotch);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldAdapter = {\n ...this.getRootAdapterMethods_(),\n ...this.getInputAdapterMethods_(),\n ...this.getLabelAdapterMethods_(),\n ...this.getLineRippleAdapterMethods_(),\n ...this.getOutlineAdapterMethods_(),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldFoundation(adapter, this.getFoundationMap_());\n }\n\n private getRootAdapterMethods_(): MDCTextFieldRootAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n hasClass: (className) => this.root_.classList.contains(className),\n registerTextFieldInteractionHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterTextFieldInteractionHandler: (evtType, handler) => this.unlisten(evtType, handler),\n registerValidationAttributeChangeHandler: (handler) => {\n const getAttributesList = (mutationsList: MutationRecord[]): string[] => {\n return mutationsList\n .map((mutation) => mutation.attributeName)\n .filter((attributeName) => attributeName) as string[];\n };\n const observer = new MutationObserver((mutationsList) => handler(getAttributesList(mutationsList)));\n const config = {attributes: true};\n observer.observe(this.input_, config);\n return observer;\n },\n deregisterValidationAttributeChangeHandler: (observer) => observer.disconnect(),\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getInputAdapterMethods_(): MDCTextFieldInputAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getNativeInput: () => this.input_,\n isFocused: () => document.activeElement === this.input_,\n registerInputInteractionHandler: (evtType, handler) =>\n this.input_.addEventListener(evtType, handler, applyPassive()),\n deregisterInputInteractionHandler: (evtType, handler) =>\n this.input_.removeEventListener(evtType, handler, applyPassive()),\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getLabelAdapterMethods_(): MDCTextFieldLabelAdapter {\n return {\n floatLabel: (shouldFloat) => this.label_ && this.label_.float(shouldFloat),\n getLabelWidth: () => this.label_ ? this.label_.getWidth() : 0,\n hasLabel: () => Boolean(this.label_),\n shakeLabel: (shouldShake) => this.label_ && this.label_.shake(shouldShake),\n };\n }\n\n private getLineRippleAdapterMethods_(): MDCTextFieldLineRippleAdapter {\n return {\n activateLineRipple: () => {\n if (this.lineRipple_) {\n this.lineRipple_.activate();\n }\n },\n deactivateLineRipple: () => {\n if (this.lineRipple_) {\n this.lineRipple_.deactivate();\n }\n },\n setLineRippleTransformOrigin: (normalizedX) => {\n if (this.lineRipple_) {\n this.lineRipple_.setRippleCenter(normalizedX);\n }\n },\n };\n }\n\n private getOutlineAdapterMethods_(): MDCTextFieldOutlineAdapter {\n return {\n closeOutline: () => this.outline_ && this.outline_.closeNotch(),\n hasOutline: () => Boolean(this.outline_),\n notchOutline: (labelWidth) => this.outline_ && this.outline_.notch(labelWidth),\n };\n }\n\n /**\n * @return A map of all subcomponents to subfoundations.\n */\n private getFoundationMap_(): Partial<MDCTextFieldFoundationMap> {\n return {\n characterCounter: this.characterCounter_ ? this.characterCounter_.foundation : undefined,\n helperText: this.helperText_ ? this.helperText_.foundation : undefined,\n leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,\n trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundation : undefined,\n };\n }\n\n private createRipple_(rippleFactory: MDCRippleFactory): MDCRipple | null {\n const isTextArea = this.root_.classList.contains(cssClasses.TEXTAREA);\n const isOutlined = this.root_.classList.contains(cssClasses.OUTLINED);\n\n if (isTextArea || isOutlined) {\n return null;\n }\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n isSurfaceActive: () => ponyfill.matches(this.input_, ':active'),\n registerInteractionHandler: (evtType, handler) => this.input_.addEventListener(evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n this.input_.removeEventListener(evtType, handler, applyPassive()),\n };\n // tslint:enable:object-literal-sort-keys\n return rippleFactory(this.root_, new MDCRippleFoundation(adapter));\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARIA_CONTROLS: 'aria-controls',\n INPUT_SELECTOR: '.mdc-text-field__input',\n LABEL_SELECTOR: '.mdc-floating-label',\n LEADING_ICON_SELECTOR: '.mdc-text-field__icon--leading',\n LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',\n OUTLINE_SELECTOR: '.mdc-notched-outline',\n TRAILING_ICON_SELECTOR: '.mdc-text-field__icon--trailing'\n};\n\nconst cssClasses = {\n DENSE: 'mdc-text-field--dense',\n DISABLED: 'mdc-text-field--disabled',\n FOCUSED: 'mdc-text-field--focused',\n FULLWIDTH: 'mdc-text-field--fullwidth',\n HELPER_LINE: 'mdc-text-field-helper-line',\n INVALID: 'mdc-text-field--invalid',\n NO_LABEL: 'mdc-text-field--no-label',\n OUTLINED: 'mdc-text-field--outlined',\n ROOT: 'mdc-text-field',\n TEXTAREA: 'mdc-text-field--textarea',\n WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon',\n WITH_TRAILING_ICON: 'mdc-text-field--with-trailing-icon',\n};\n\nconst numbers = {\n DENSE_LABEL_SCALE: 0.923,\n LABEL_SCALE: 0.75,\n};\n\n/**\n * Whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * under the \"Validation-related attributes\" section.\n */\nconst VALIDATION_ATTR_WHITELIST = [\n 'pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength',\n];\n\n/**\n * Label should always float for these types as they show some UI even if value is empty.\n */\nconst ALWAYS_FLOAT_TYPES = [\n 'color', 'date', 'datetime-local', 'month', 'range', 'time', 'week',\n];\n\nexport {cssClasses, strings, numbers, VALIDATION_ATTR_WHITELIST, ALWAYS_FLOAT_TYPES};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCTextFieldAdapter} from './adapter';\nimport {MDCTextFieldCharacterCounterFoundation} from './character-counter/foundation';\nimport {ALWAYS_FLOAT_TYPES, cssClasses, numbers, strings, VALIDATION_ATTR_WHITELIST} from './constants';\nimport {MDCTextFieldHelperTextFoundation} from './helper-text/foundation';\nimport {MDCTextFieldIconFoundation} from './icon/foundation';\nimport {MDCTextFieldFoundationMap, MDCTextFieldNativeInputElement} from './types';\n\ntype PointerDownEventType = 'mousedown' | 'touchstart';\ntype InteractionEventType = 'click' | 'keydown';\n\nconst POINTERDOWN_EVENTS: PointerDownEventType[] = ['mousedown', 'touchstart'];\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCTextFieldFoundation extends MDCFoundation<MDCTextFieldAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n private get shouldAlwaysFloat_(): boolean {\n const type = this.getNativeInput_().type;\n return ALWAYS_FLOAT_TYPES.indexOf(type) >= 0;\n }\n\n get shouldFloat(): boolean {\n return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();\n }\n\n get shouldShake(): boolean {\n return !this.isFocused_ && !this.isValid() && !!this.getValue();\n }\n\n /**\n * See {@link MDCTextFieldAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => true,\n registerTextFieldInteractionHandler: () => undefined,\n deregisterTextFieldInteractionHandler: () => undefined,\n registerInputInteractionHandler: () => undefined,\n deregisterInputInteractionHandler: () => undefined,\n registerValidationAttributeChangeHandler: () => new MutationObserver(() => undefined),\n deregisterValidationAttributeChangeHandler: () => undefined,\n getNativeInput: () => null,\n isFocused: () => false,\n activateLineRipple: () => undefined,\n deactivateLineRipple: () => undefined,\n setLineRippleTransformOrigin: () => undefined,\n shakeLabel: () => undefined,\n floatLabel: () => undefined,\n hasLabel: () => false,\n getLabelWidth: () => 0,\n hasOutline: () => false,\n notchOutline: () => undefined,\n closeOutline: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private isFocused_ = false;\n private receivedUserInput_ = false;\n private isValid_ = true;\n private useNativeValidation_ = true;\n\n private readonly inputFocusHandler_: () => void;\n private readonly inputBlurHandler_: SpecificEventListener<'blur'>;\n private readonly inputInputHandler_: SpecificEventListener<'input'>;\n private readonly setPointerXOffset_: SpecificEventListener<PointerDownEventType>;\n private readonly textFieldInteractionHandler_: SpecificEventListener<InteractionEventType>;\n private readonly validationAttributeChangeHandler_: (attributesList: string[]) => void;\n private validationObserver_!: MutationObserver; // assigned in init()\n\n private readonly helperText_?: MDCTextFieldHelperTextFoundation;\n private readonly characterCounter_?: MDCTextFieldCharacterCounterFoundation;\n private readonly leadingIcon_?: MDCTextFieldIconFoundation;\n private readonly trailingIcon_?: MDCTextFieldIconFoundation;\n\n /**\n * @param adapter\n * @param foundationMap Map from subcomponent names to their subfoundations.\n */\n constructor(adapter?: Partial<MDCTextFieldAdapter>, foundationMap: Partial<MDCTextFieldFoundationMap> = {}) {\n super({...MDCTextFieldFoundation.defaultAdapter, ...adapter});\n\n this.helperText_ = foundationMap.helperText;\n this.characterCounter_ = foundationMap.characterCounter;\n this.leadingIcon_ = foundationMap.leadingIcon;\n this.trailingIcon_ = foundationMap.trailingIcon;\n\n this.inputFocusHandler_ = () => this.activateFocus();\n this.inputBlurHandler_ = () => this.deactivateFocus();\n this.inputInputHandler_ = () => this.handleInput();\n this.setPointerXOffset_ = (evt) => this.setTransformOrigin(evt);\n this.textFieldInteractionHandler_ = () => this.handleTextFieldInteraction();\n this.validationAttributeChangeHandler_ = (attributesList) => this.handleValidationAttributeChange(attributesList);\n }\n\n init() {\n if (this.adapter_.isFocused()) {\n this.inputFocusHandler_();\n } else if (this.adapter_.hasLabel() && this.shouldFloat) {\n this.notchOutline(true);\n this.adapter_.floatLabel(true);\n }\n\n this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_);\n this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_);\n this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_);\n POINTERDOWN_EVENTS.forEach((evtType) => {\n this.adapter_.registerInputInteractionHandler(evtType, this.setPointerXOffset_);\n });\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter_.registerTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler_);\n });\n this.validationObserver_ =\n this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);\n this.setCharacterCounter_(this.getValue().length);\n }\n\n destroy() {\n this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);\n this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);\n this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_);\n POINTERDOWN_EVENTS.forEach((evtType) => {\n this.adapter_.deregisterInputInteractionHandler(evtType, this.setPointerXOffset_);\n });\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter_.deregisterTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler_);\n });\n this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);\n }\n\n /**\n * Handles user interactions with the Text Field.\n */\n handleTextFieldInteraction() {\n const nativeInput = this.adapter_.getNativeInput();\n if (nativeInput && nativeInput.disabled) {\n return;\n }\n this.receivedUserInput_ = true;\n }\n\n /**\n * Handles validation attribute changes\n */\n handleValidationAttributeChange(attributesList: string[]): void {\n attributesList.some((attributeName) => {\n if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {\n this.styleValidity_(true);\n return true;\n }\n return false;\n });\n\n if (attributesList.indexOf('maxlength') > -1) {\n this.setCharacterCounter_(this.getValue().length);\n }\n }\n\n /**\n * Opens/closes the notched outline.\n */\n notchOutline(openNotch: boolean) {\n if (!this.adapter_.hasOutline()) {\n return;\n }\n\n if (openNotch) {\n const isDense = this.adapter_.hasClass(cssClasses.DENSE);\n const labelScale = isDense ? numbers.DENSE_LABEL_SCALE : numbers.LABEL_SCALE;\n const labelWidth = this.adapter_.getLabelWidth() * labelScale;\n this.adapter_.notchOutline(labelWidth);\n } else {\n this.adapter_.closeOutline();\n }\n }\n\n /**\n * Activates the text field focus state.\n */\n activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter_.activateLineRipple();\n if (this.adapter_.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter_.floatLabel(this.shouldFloat);\n this.adapter_.shakeLabel(this.shouldShake);\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }\n\n /**\n * Sets the line ripple's transform origin, so that the line ripple activate\n * animation will animate out from the user's click location.\n */\n setTransformOrigin(evt: TouchEvent | MouseEvent): void {\n const touches = (evt as TouchEvent).touches;\n const targetEvent = touches ? touches[0] : evt;\n const targetClientRect = (targetEvent.target as Element).getBoundingClientRect();\n const normalizedX = (targetEvent as MouseEvent).clientX - targetClientRect.left;\n this.adapter_.setLineRippleTransformOrigin(normalizedX);\n }\n\n /**\n * Handles input change of text input and text area.\n */\n handleInput() {\n this.autoCompleteFocus();\n this.setCharacterCounter_(this.getValue().length);\n }\n\n /**\n * Activates the Text Field's focus state in cases when the input value\n * changes without user input (e.g. programmatically).\n */\n autoCompleteFocus() {\n if (!this.receivedUserInput_) {\n this.activateFocus();\n }\n }\n\n /**\n * Deactivates the Text Field's focus state.\n */\n deactivateFocus() {\n this.isFocused_ = false;\n this.adapter_.deactivateLineRipple();\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n this.styleFocused_(this.isFocused_);\n if (this.adapter_.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter_.floatLabel(this.shouldFloat);\n this.adapter_.shakeLabel(this.shouldShake);\n }\n if (!this.shouldFloat) {\n this.receivedUserInput_ = false;\n }\n }\n\n getValue(): string {\n return this.getNativeInput_().value;\n }\n\n /**\n * @param value The value to set on the input Element.\n */\n setValue(value: string): void {\n // Prevent Safari from moving the caret to the end of the input when the value has not changed.\n if (this.getValue() !== value) {\n this.getNativeInput_().value = value;\n }\n this.setCharacterCounter_(value.length);\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n if (this.adapter_.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter_.floatLabel(this.shouldFloat);\n this.adapter_.shakeLabel(this.shouldShake);\n }\n }\n\n /**\n * @return The custom validity state, if set; otherwise, the result of a native validity check.\n */\n isValid(): boolean {\n return this.useNativeValidation_\n ? this.isNativeInputValid_() : this.isValid_;\n }\n\n /**\n * @param isValid Sets the custom validity state of the Text Field.\n */\n setValid(isValid: boolean): void {\n this.isValid_ = isValid;\n this.styleValidity_(isValid);\n\n const shouldShake = !isValid && !this.isFocused_ && !!this.getValue();\n if (this.adapter_.hasLabel()) {\n this.adapter_.shakeLabel(shouldShake);\n }\n }\n\n /**\n * Enables or disables the use of native validation. Use this for custom validation.\n * @param useNativeValidation Set this to false to ignore native input validation.\n */\n setUseNativeValidation(useNativeValidation: boolean): void {\n this.useNativeValidation_ = useNativeValidation;\n }\n\n isDisabled(): boolean {\n return this.getNativeInput_().disabled;\n }\n\n /**\n * @param disabled Sets the text-field disabled or enabled.\n */\n setDisabled(disabled: boolean): void {\n this.getNativeInput_().disabled = disabled;\n this.styleDisabled_(disabled);\n }\n\n /**\n * @param content Sets the content of the helper text.\n */\n setHelperTextContent(content: string): void {\n if (this.helperText_) {\n this.helperText_.setContent(content);\n }\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n setLeadingIconAriaLabel(label: string): void {\n if (this.leadingIcon_) {\n this.leadingIcon_.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n setLeadingIconContent(content: string): void {\n if (this.leadingIcon_) {\n this.leadingIcon_.setContent(content);\n }\n }\n\n /**\n * Sets the aria label of the trailing icon.\n */\n setTrailingIconAriaLabel(label: string): void {\n if (this.trailingIcon_) {\n this.trailingIcon_.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the trailing icon.\n */\n setTrailingIconContent(content: string): void {\n if (this.trailingIcon_) {\n this.trailingIcon_.setContent(content);\n }\n }\n\n /**\n * Sets character counter values that shows characters used and the total character limit.\n */\n private setCharacterCounter_(currentLength: number): void {\n if (!this.characterCounter_) {\n return;\n }\n\n const maxLength = this.getNativeInput_().maxLength;\n if (maxLength === -1) {\n throw new Error('MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.');\n }\n\n this.characterCounter_.setCounterValue(currentLength, maxLength);\n }\n\n /**\n * @return True if the Text Field input fails in converting the user-supplied value.\n */\n private isBadInput_(): boolean {\n // The badInput property is not supported in IE 11 💩.\n return this.getNativeInput_().validity.badInput || false;\n }\n\n /**\n * @return The result of native validity checking (ValidityState.valid).\n */\n private isNativeInputValid_(): boolean {\n return this.getNativeInput_().validity.valid;\n }\n\n /**\n * Styles the component based on the validity state.\n */\n private styleValidity_(isValid: boolean): void {\n const {INVALID} = MDCTextFieldFoundation.cssClasses;\n if (isValid) {\n this.adapter_.removeClass(INVALID);\n } else {\n this.adapter_.addClass(INVALID);\n }\n if (this.helperText_) {\n this.helperText_.setValidity(isValid);\n }\n }\n\n /**\n * Styles the component based on the focused state.\n */\n private styleFocused_(isFocused: boolean): void {\n const {FOCUSED} = MDCTextFieldFoundation.cssClasses;\n if (isFocused) {\n this.adapter_.addClass(FOCUSED);\n } else {\n this.adapter_.removeClass(FOCUSED);\n }\n }\n\n /**\n * Styles the component based on the disabled state.\n */\n private styleDisabled_(isDisabled: boolean): void {\n const {DISABLED, INVALID} = MDCTextFieldFoundation.cssClasses;\n if (isDisabled) {\n this.adapter_.addClass(DISABLED);\n this.adapter_.removeClass(INVALID);\n } else {\n this.adapter_.removeClass(DISABLED);\n }\n\n if (this.leadingIcon_) {\n this.leadingIcon_.setDisabled(isDisabled);\n }\n\n if (this.trailingIcon_) {\n this.trailingIcon_.setDisabled(isDisabled);\n }\n }\n\n /**\n * @return The native text input element from the host environment, or an object with the same shape for unit tests.\n */\n private getNativeInput_(): MDCTextFieldNativeInputElement {\n // this.adapter_ may be undefined in foundation unit tests. This happens when testdouble is creating a mock object\n // and invokes the shouldShake/shouldFloat getters (which in turn call getValue(), which calls this method) before\n // init() has been called from the MDCTextField constructor. To work around that issue, we return a dummy object.\n const nativeInput = this.adapter_ ? this.adapter_.getNativeInput() : null;\n return nativeInput || {\n disabled: false,\n maxLength: -1,\n type: 'input',\n validity: {\n badInput: false,\n valid: true,\n },\n value: '',\n };\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldFoundation;\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldHelperTextAdapter} from './adapter';\nimport {MDCTextFieldHelperTextFoundation} from './foundation';\n\nexport type MDCTextFieldHelperTextFactory =\n (el: Element, foundation?: MDCTextFieldHelperTextFoundation) => MDCTextFieldHelperText;\n\nexport class MDCTextFieldHelperText extends MDCComponent<MDCTextFieldHelperTextFoundation> {\n static attachTo(root: Element): MDCTextFieldHelperText {\n return new MDCTextFieldHelperText(root);\n }\n\n get foundation(): MDCTextFieldHelperTextFoundation {\n return this.foundation_;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldHelperTextAdapter = {\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n hasClass: (className) => this.root_.classList.contains(className),\n setAttr: (attr, value) => this.root_.setAttribute(attr, value),\n removeAttr: (attr) => this.root_.removeAttribute(attr),\n setContent: (content) => {\n this.root_.textContent = content;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldHelperTextFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',\n HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg',\n ROOT: 'mdc-text-field-helper-text',\n};\n\nconst strings = {\n ARIA_HIDDEN: 'aria-hidden',\n ROLE: 'role',\n ROOT_SELECTOR: `.${cssClasses.ROOT}`,\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTextFieldHelperTextAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCTextFieldHelperTextFoundation extends MDCFoundation<MDCTextFieldHelperTextAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldHelperTextAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCTextFieldHelperTextAdapter>) {\n super({...MDCTextFieldHelperTextFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Sets the content of the helper text field.\n */\n setContent(content: string) {\n this.adapter_.setContent(content);\n }\n\n /**\n * @param isPersistent Sets the persistency of the helper text.\n */\n setPersistent(isPersistent: boolean) {\n if (isPersistent) {\n this.adapter_.addClass(cssClasses.HELPER_TEXT_PERSISTENT);\n } else {\n this.adapter_.removeClass(cssClasses.HELPER_TEXT_PERSISTENT);\n }\n }\n\n /**\n * @param isValidation True to make the helper text act as an error validation message.\n */\n setValidation(isValidation: boolean) {\n if (isValidation) {\n this.adapter_.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n } else {\n this.adapter_.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n }\n\n /**\n * Makes the helper text visible to the screen reader.\n */\n showToScreenReader() {\n this.adapter_.removeAttr(strings.ARIA_HIDDEN);\n }\n\n /**\n * Sets the validity of the helper text based on the input validity.\n */\n setValidity(inputIsValid: boolean) {\n const helperTextIsPersistent = this.adapter_.hasClass(cssClasses.HELPER_TEXT_PERSISTENT);\n const helperTextIsValidationMsg = this.adapter_.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n const validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;\n\n if (validationMsgNeedsDisplay) {\n this.adapter_.setAttr(strings.ROLE, 'alert');\n } else {\n this.adapter_.removeAttr(strings.ROLE);\n }\n\n if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {\n this.hide_();\n }\n }\n\n /**\n * Hides the help text from screen readers.\n */\n private hide_() {\n this.adapter_.setAttr(strings.ARIA_HIDDEN, 'true');\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldHelperTextFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as helperTextCssClasses, strings as helperTextStrings} from './constants';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldIconAdapter} from './adapter';\nimport {MDCTextFieldIconFoundation} from './foundation';\n\nexport type MDCTextFieldIconFactory = (el: Element, foundation?: MDCTextFieldIconFoundation) => MDCTextFieldIcon;\n\nexport class MDCTextFieldIcon extends MDCComponent<MDCTextFieldIconFoundation> {\n static attachTo(root: Element): MDCTextFieldIcon {\n return new MDCTextFieldIcon(root);\n }\n\n get foundation(): MDCTextFieldIconFoundation {\n return this.foundation_;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldIconAdapter = {\n getAttr: (attr) => this.root_.getAttribute(attr),\n setAttr: (attr, value) => this.root_.setAttribute(attr, value),\n removeAttr: (attr) => this.root_.removeAttribute(attr),\n setContent: (content) => {\n this.root_.textContent = content;\n },\n registerInteractionHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) => this.unlisten(evtType, handler),\n notifyIconAction: () => this.emit(\n MDCTextFieldIconFoundation.strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldIconFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ICON_EVENT: 'MDCTextField:icon',\n ICON_ROLE: 'button',\n};\n\nconst cssClasses = {\n ROOT: 'mdc-text-field__icon',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCTextFieldIconAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\ntype InteractionEventType = 'click' | 'keydown';\n\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCTextFieldIconFoundation extends MDCFoundation<MDCTextFieldIconAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldIconAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getAttr: () => null,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n notifyIconAction: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private savedTabIndex_: string | null = null;\n private readonly interactionHandler_: SpecificEventListener<InteractionEventType>;\n\n constructor(adapter?: Partial<MDCTextFieldIconAdapter>) {\n super({...MDCTextFieldIconFoundation.defaultAdapter, ...adapter});\n\n this.interactionHandler_ = (evt) => this.handleInteraction(evt);\n }\n\n init() {\n this.savedTabIndex_ = this.adapter_.getAttr('tabindex');\n\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter_.registerInteractionHandler(evtType, this.interactionHandler_);\n });\n }\n\n destroy() {\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter_.deregisterInteractionHandler(evtType, this.interactionHandler_);\n });\n }\n\n setDisabled(disabled: boolean) {\n if (!this.savedTabIndex_) {\n return;\n }\n\n if (disabled) {\n this.adapter_.setAttr('tabindex', '-1');\n this.adapter_.removeAttr('role');\n } else {\n this.adapter_.setAttr('tabindex', this.savedTabIndex_);\n this.adapter_.setAttr('role', strings.ICON_ROLE);\n }\n }\n\n setAriaLabel(label: string) {\n this.adapter_.setAttr('aria-label', label);\n }\n\n setContent(content: string) {\n this.adapter_.setContent(content);\n }\n\n handleInteraction(evt: MouseEvent | KeyboardEvent) {\n const isEnterKey = (evt as KeyboardEvent).key === 'Enter' || (evt as KeyboardEvent).keyCode === 13;\n if (evt.type === 'click' || isEnterKey) {\n evt.preventDefault(); // stop click from causing host label to focus\n // input\n this.adapter_.notifyIconAction();\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldIconFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as iconCssClasses, strings as iconStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\nexport * from './character-counter/index';\nexport * from './helper-text/index';\nexport * from './icon/index';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCTopAppBarAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCFixedTopAppBarFoundation} from './fixed/foundation';\nimport {MDCTopAppBarBaseFoundation} from './foundation';\nimport {MDCShortTopAppBarFoundation} from './short/foundation';\nimport {MDCTopAppBarFoundation} from './standard/foundation';\n\nexport class MDCTopAppBar extends MDCComponent<MDCTopAppBarBaseFoundation> {\n static attachTo(root: Element): MDCTopAppBar {\n return new MDCTopAppBar(root);\n }\n\n private handleNavigationClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleWindowResize_!: SpecificEventListener<'resize'>; // assigned in initialSyncWithDOM()\n private handleTargetScroll_!: SpecificEventListener<'scroll'>; // assigned in initialSyncWithDOM()\n private navIcon_!: Element | null;\n private iconRipples_!: MDCRipple[];\n private scrollTarget_!: EventTarget;\n\n initialize(rippleFactory: MDCRippleFactory = (el) => MDCRipple.attachTo(el)) {\n this.navIcon_ = this.root_.querySelector(strings.NAVIGATION_ICON_SELECTOR);\n\n // Get all icons in the toolbar and instantiate the ripples\n const icons: Element[] = [].slice.call(this.root_.querySelectorAll(strings.ACTION_ITEM_SELECTOR));\n if (this.navIcon_) {\n icons.push(this.navIcon_);\n }\n\n this.iconRipples_ = icons.map((icon) => {\n const ripple = rippleFactory(icon);\n ripple.unbounded = true;\n return ripple;\n });\n\n this.scrollTarget_ = window;\n }\n\n initialSyncWithDOM() {\n this.handleNavigationClick_ = this.foundation_.handleNavigationClick.bind(this.foundation_);\n this.handleWindowResize_ = this.foundation_.handleWindowResize.bind(this.foundation_);\n this.handleTargetScroll_ = this.foundation_.handleTargetScroll.bind(this.foundation_);\n\n this.scrollTarget_.addEventListener('scroll', this.handleTargetScroll_ as EventListener);\n\n if (this.navIcon_) {\n this.navIcon_.addEventListener('click', this.handleNavigationClick_ as EventListener);\n }\n\n const isFixed = this.root_.classList.contains(cssClasses.FIXED_CLASS);\n const isShort = this.root_.classList.contains(cssClasses.SHORT_CLASS);\n if (!isShort && !isFixed) {\n window.addEventListener('resize', this.handleWindowResize_ as EventListener);\n }\n }\n\n destroy() {\n this.iconRipples_.forEach((iconRipple) => iconRipple.destroy());\n this.scrollTarget_.removeEventListener('scroll', this.handleTargetScroll_ as EventListener);\n if (this.navIcon_) {\n this.navIcon_.removeEventListener('click', this.handleNavigationClick_ as EventListener);\n }\n const isFixed = this.root_.classList.contains(cssClasses.FIXED_CLASS);\n const isShort = this.root_.classList.contains(cssClasses.SHORT_CLASS);\n if (!isShort && !isFixed) {\n window.removeEventListener('resize', this.handleWindowResize_ as EventListener);\n }\n super.destroy();\n }\n\n setScrollTarget(target: EventTarget) {\n // Remove scroll handler from the previous scroll target\n this.scrollTarget_.removeEventListener('scroll', this.handleTargetScroll_ as EventListener);\n\n this.scrollTarget_ = target;\n\n // Initialize scroll handler on the new scroll target\n this.handleTargetScroll_ =\n this.foundation_.handleTargetScroll.bind(this.foundation_);\n this.scrollTarget_.addEventListener('scroll', this.handleTargetScroll_ as EventListener);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTopAppBarAdapter = {\n hasClass: (className) => this.root_.classList.contains(className),\n addClass: (className) => this.root_.classList.add(className),\n removeClass: (className) => this.root_.classList.remove(className),\n setStyle: (property, value) => (this.root_ as HTMLElement).style.setProperty(property, value),\n getTopAppBarHeight: () => this.root_.clientHeight,\n notifyNavigationIconClicked: () => this.emit(strings.NAVIGATION_EVENT, {}),\n getViewportScrollY: () => {\n const win = this.scrollTarget_ as Window;\n const el = this.scrollTarget_ as Element;\n return win.pageYOffset !== undefined ? win.pageYOffset : el.scrollTop;\n },\n getTotalActionItems: () => this.root_.querySelectorAll(strings.ACTION_ITEM_SELECTOR).length,\n };\n // tslint:enable:object-literal-sort-keys\n\n let foundation: MDCTopAppBarBaseFoundation;\n if (this.root_.classList.contains(cssClasses.SHORT_CLASS)) {\n foundation = new MDCShortTopAppBarFoundation(adapter);\n } else if (this.root_.classList.contains(cssClasses.FIXED_CLASS)) {\n foundation = new MDCFixedTopAppBarFoundation(adapter);\n } else {\n foundation = new MDCTopAppBarFoundation(adapter);\n }\n\n return foundation;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n FIXED_CLASS: 'mdc-top-app-bar--fixed',\n FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled',\n SHORT_CLASS: 'mdc-top-app-bar--short',\n SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed',\n SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item',\n};\n\nconst numbers = {\n DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,\n MAX_TOP_APP_BAR_HEIGHT: 128,\n};\n\nconst strings = {\n ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item',\n NAVIGATION_EVENT: 'MDCTopAppBar:nav',\n NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon',\n ROOT_SELECTOR: '.mdc-top-app-bar',\n TITLE_SELECTOR: '.mdc-top-app-bar__title',\n};\n\nexport {cssClasses, numbers, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {cssClasses} from '../constants';\nimport {MDCTopAppBarFoundation} from '../standard/foundation';\n\nexport class MDCFixedTopAppBarFoundation extends MDCTopAppBarFoundation {\n /**\n * State variable for the previous scroll iteration top app bar state\n */\n private wasScrolled_ = false;\n\n /**\n * Scroll handler for applying/removing the modifier class on the fixed top app bar.\n * @override\n */\n handleTargetScroll() {\n const currentScroll = this.adapter_.getViewportScrollY();\n\n if (currentScroll <= 0) {\n if (this.wasScrolled_) {\n this.adapter_.removeClass(cssClasses.FIXED_SCROLLED_CLASS);\n this.wasScrolled_ = false;\n }\n } else {\n if (!this.wasScrolled_) {\n this.adapter_.addClass(cssClasses.FIXED_SCROLLED_CLASS);\n this.wasScrolled_ = true;\n }\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFixedTopAppBarFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTopAppBarAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCTopAppBarBaseFoundation extends MDCFoundation<MDCTopAppBarAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n /**\n * See {@link MDCTopAppBarAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTopAppBarAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setStyle: () => undefined,\n getTopAppBarHeight: () => 0,\n notifyNavigationIconClicked: () => undefined,\n getViewportScrollY: () => 0,\n getTotalActionItems: () => 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super({...MDCTopAppBarBaseFoundation.defaultAdapter, ...adapter});\n }\n\n /** Other variants of TopAppBar foundation overrides this method */\n handleTargetScroll() {} // tslint:disable-line:no-empty\n /** Other variants of TopAppBar foundation overrides this method */\n handleWindowResize() {} // tslint:disable-line:no-empty\n\n handleNavigationClick() {\n this.adapter_.notifyNavigationIconClicked();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTopAppBarBaseFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './fixed/foundation';\nexport * from './short/foundation';\nexport * from './standard/foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTopAppBarAdapter} from '../adapter';\nimport {cssClasses} from '../constants';\nimport {MDCTopAppBarBaseFoundation} from '../foundation';\n\nexport class MDCShortTopAppBarFoundation extends MDCTopAppBarBaseFoundation {\n // Public visibility for backward compatibility.\n get isCollapsed(): boolean {\n return this.isCollapsed_;\n }\n\n private isCollapsed_ = false;\n\n private isAlwaysCollapsed_ = false;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super(adapter);\n }\n\n init() {\n super.init();\n\n if (this.adapter_.getTotalActionItems() > 0) {\n this.adapter_.addClass(cssClasses.SHORT_HAS_ACTION_ITEM_CLASS);\n }\n\n // If initialized with SHORT_COLLAPSED_CLASS, the bar should always be collapsed\n this.setAlwaysCollapsed(\n this.adapter_.hasClass(cssClasses.SHORT_COLLAPSED_CLASS));\n }\n\n /**\n * Set if the short top app bar should always be collapsed.\n *\n * @param value When `true`, bar will always be collapsed. When `false`, bar may collapse or expand based on scroll.\n */\n setAlwaysCollapsed(value: boolean) {\n this.isAlwaysCollapsed_ = !!value;\n if (this.isAlwaysCollapsed_) {\n this.collapse_();\n } else {\n // let maybeCollapseBar_ determine if the bar should be collapsed\n this.maybeCollapseBar_();\n }\n }\n\n getAlwaysCollapsed() {\n return this.isAlwaysCollapsed_;\n }\n\n /**\n * Scroll handler for applying/removing the collapsed modifier class on the short top app bar.\n * @override\n */\n handleTargetScroll() {\n this.maybeCollapseBar_();\n }\n\n private maybeCollapseBar_() {\n if (this.isAlwaysCollapsed_) {\n return;\n }\n const currentScroll = this.adapter_.getViewportScrollY();\n\n if (currentScroll <= 0) {\n if (this.isCollapsed_) {\n this.uncollapse_();\n }\n } else {\n if (!this.isCollapsed_) {\n this.collapse_();\n }\n }\n }\n\n private uncollapse_() {\n this.adapter_.removeClass(cssClasses.SHORT_COLLAPSED_CLASS);\n this.isCollapsed_ = false;\n }\n\n private collapse_() {\n this.adapter_.addClass(cssClasses.SHORT_COLLAPSED_CLASS);\n this.isCollapsed_ = true;\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCShortTopAppBarFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTopAppBarAdapter} from '../adapter';\nimport {numbers} from '../constants';\nimport {MDCTopAppBarBaseFoundation} from '../foundation';\n\nconst INITIAL_VALUE = 0;\n\nexport class MDCTopAppBarFoundation extends MDCTopAppBarBaseFoundation {\n /**\n * Indicates if the top app bar was docked in the previous scroll handler iteration.\n */\n private wasDocked_ = true;\n\n /**\n * Indicates if the top app bar is docked in the fully shown position.\n */\n private isDockedShowing_ = true;\n\n /**\n * Variable for current scroll position of the top app bar\n */\n private currentAppBarOffsetTop_ = 0;\n\n /**\n * Used to prevent the top app bar from being scrolled out of view during resize events\n */\n private isCurrentlyBeingResized_ = false;\n\n /**\n * The timeout that's used to throttle the resize events\n */\n private resizeThrottleId_ = INITIAL_VALUE;\n\n /**\n * Used for diffs of current scroll position vs previous scroll position\n */\n private lastScrollPosition_: number;\n\n /**\n * Used to verify when the top app bar is completely showing or completely hidden\n */\n private topAppBarHeight_: number;\n\n /**\n * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize\n */\n private resizeDebounceId_ = INITIAL_VALUE;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super(adapter);\n\n this.lastScrollPosition_ = this.adapter_.getViewportScrollY();\n this.topAppBarHeight_ = this.adapter_.getTopAppBarHeight();\n }\n\n destroy() {\n super.destroy();\n this.adapter_.setStyle('top', '');\n }\n\n /**\n * Scroll handler for the default scroll behavior of the top app bar.\n * @override\n */\n handleTargetScroll() {\n const currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);\n const diff = currentScrollPosition - this.lastScrollPosition_;\n this.lastScrollPosition_ = currentScrollPosition;\n\n // If the window is being resized the lastScrollPosition_ needs to be updated but the\n // current scroll of the top app bar should stay in the same position.\n if (!this.isCurrentlyBeingResized_) {\n this.currentAppBarOffsetTop_ -= diff;\n\n if (this.currentAppBarOffsetTop_ > 0) {\n this.currentAppBarOffsetTop_ = 0;\n } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {\n this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;\n }\n\n this.moveTopAppBar_();\n }\n }\n\n /**\n * Top app bar resize handler that throttle/debounce functions that execute updates.\n * @override\n */\n handleWindowResize() {\n // Throttle resize events 10 p/s\n if (!this.resizeThrottleId_) {\n this.resizeThrottleId_ = setTimeout(() => {\n this.resizeThrottleId_ = INITIAL_VALUE;\n this.throttledResizeHandler_();\n }, numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);\n }\n\n this.isCurrentlyBeingResized_ = true;\n\n if (this.resizeDebounceId_) {\n clearTimeout(this.resizeDebounceId_);\n }\n\n this.resizeDebounceId_ = setTimeout(() => {\n this.handleTargetScroll();\n this.isCurrentlyBeingResized_ = false;\n this.resizeDebounceId_ = INITIAL_VALUE;\n }, numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);\n }\n\n /**\n * Function to determine if the DOM needs to update.\n */\n private checkForUpdate_(): boolean {\n const offscreenBoundaryTop = -this.topAppBarHeight_;\n const hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;\n const hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;\n const partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;\n\n // If it's partially showing, it can't be docked.\n if (partiallyShowing) {\n this.wasDocked_ = false;\n } else {\n // Not previously docked and not partially showing, it's now docked.\n if (!this.wasDocked_) {\n this.wasDocked_ = true;\n return true;\n } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {\n this.isDockedShowing_ = hasAnyPixelsOnscreen;\n return true;\n }\n }\n\n return partiallyShowing;\n }\n\n /**\n * Function to move the top app bar if needed.\n */\n private moveTopAppBar_() {\n if (this.checkForUpdate_()) {\n // Once the top app bar is fully hidden we use the max potential top app bar height as our offset\n // so the top app bar doesn't show if the window resizes and the new height > the old height.\n let offset = this.currentAppBarOffsetTop_;\n if (Math.abs(offset) >= this.topAppBarHeight_) {\n offset = -numbers.MAX_TOP_APP_BAR_HEIGHT;\n }\n\n this.adapter_.setStyle('top', offset + 'px');\n }\n }\n\n /**\n * Throttled function that updates the top app bar scrolled values if the\n * top app bar height changes.\n */\n private throttledResizeHandler_() {\n const currentHeight = this.adapter_.getTopAppBarHeight();\n if (this.topAppBarHeight_ !== currentHeight) {\n this.wasDocked_ = false;\n\n // Since the top app bar has a different height depending on the screen width, this\n // will ensure that the top app bar remains in the correct location if\n // completely hidden and a resize makes the top app bar a different height.\n this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;\n this.topAppBarHeight_ = currentHeight;\n }\n this.handleTargetScroll();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTopAppBarFoundation;\n"],"sourceRoot":""}